Les avertissements suivants se sont produits :
Warning [2] Undefined array key 0 - Line: 1640 - File: showthread.php PHP 8.2.18 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/showthread.php 1640 errorHandler->error_callback
/showthread.php 915 buildtree




Note de ce sujet :
  • Moyenne : 0 (0 vote(s))
  • 1
  • 2
  • 3
  • 4
  • 5
listit2 category par défaut
#2
bon, j’imagine que c’est par ici pour qu’il exclue une catégorie mais affiche les "sans catégorie"

mais zero idée de comment faire le changement Smile

class.ListIt2ItemQuery.php


Code :
[== PHP ==]
* INCLUDE/EXCLUDE CATEGORY
         */                    
        if(!empty($params['category']) || !empty($params['exclude_category'])) {
        
            if(!empty($params['category'])) {
            
                $array = explode(',', $params['category']);
                $str = "(";
            }
            
            if(!empty($params['exclude_category'])) {
            
                $array = explode(',', $params['exclude_category']);
                $str = "NOT (";
            }
            
            $count = 0;
            foreach ($array as $cat) {

                if ($count > 0)
                    $str .= ' OR ';
                        
                $str .= " B.category_alias = '" . $cat . "'";
                
                if ((isset($params['subcategory']) && $params['subcategory']) || $mod->GetPreference('subcategory')) {
                    
                    $this->_get_subcategories($str, $cat);
                }    
                
                $count++;
            }
            $str .= ')';
            
            $this->AppendTo(parent::VARTYPE_WHERE, $str);

        } // end of category;
Répondre


Messages dans ce sujet

Atteindre :


Utilisateur(s) parcourant ce sujet : 1 visiteur(s)