Ticket #1186 (closed enhancement: fixed)

Opened 4 years ago

Last modified 2 years ago

New filter for list_cats() $exclusions variable

Reported by: Alex Parkhomenko Assigned to: skippy
Priority: normal Milestone:
Component: General Version: 1.5.1
Severity: normal Keywords: bg|has-patch bg|dev-feedback
Cc: Alex Parkhomenko

Description

Could we add a new filter to give plugins more control of categories selections from database without modifying a template?

Would be useful in multiauthor views and category detections by browser-requested language.

Attachments

template-functions-category.diff (427 bytes) - added by Alex Parkhomenko on 05/21/05 06:37:32.

Change History

03/29/05 19:18:22 changed by Alex Parkhomenko

03/29/05 19:18:23 changed by Alex Parkhomenko

  • Patch set to No.

05/21/05 06:37:32 changed by Alex Parkhomenko

  • attachment template-functions-category.diff added.

06/30/05 20:54:48 changed by skippy

  • keywords set to bg|has-patch bg|dev-feedback.
  • owner changed from anonymous to skippy.
  • status changed from new to assigned.
  • component changed from Template to General.

This patch looks to add a filter right after this bit:

$exclusions = '';
        if (!empty($exclude)) {
                $excats = preg_split('/[\s,]+/',$exclude);
                if (count($excats)) {
                        foreach ($excats as $excat) {
                                $exclusions .= ' AND cat_ID <> ' . intval($excat) . ' ';
                        }
                }
        }

in order to adjust which categories get exluded. Such a filter could conceivably prepare a complex exclusion list (exclude all categories owned by users X and Z but not Y).

Adding filter and action hooks is cheap.

08/11/05 12:44:25 changed by skippy

  • milestone set to 1.5.2.

08/14/05 18:06:06 changed by matt

  • status changed from assigned to closed.
  • resolution set to fixed.

(In [2780]) Fixes #967, Fixes #972, Fixes #1578, Fixes #1580, Fixes #1567, Fixes #1481, Fixes #1186

08/30/05 23:25:35 changed by matt

  • status changed from closed to closed.
  • resolution set to fixed.

(In [2831]) Fixes #1186 for 1.6

11/30/06 19:41:47 changed by

  • milestone deleted.

Milestone 1.5.2 deleted