Dotclear


Ignore:
Timestamp:
07/31/12 13:52:11 (13 years ago)
Author:
Dsls <dsls@…>
Branch:
sexy
Message:

sexy step 2 : no more cats.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • inc/public/lib.tpl.context.php

    r839 r851  
    162162     } 
    163163      
    164      public static function categoryPostParam(&$p) 
    165      { 
    166           $not = substr($p['cat_url'],0,1) == '!'; 
    167           if ($not) { 
    168                $p['cat_url'] = substr($p['cat_url'],1); 
    169           } 
    170            
    171           $p['cat_url'] = preg_split('/\s*,\s*/',$p['cat_url'],-1,PREG_SPLIT_NO_EMPTY); 
    172            
    173           foreach ($p['cat_url'] as &$v) 
    174           { 
    175                if ($not) { 
    176                     $v .= ' ?not'; 
    177                } 
    178                if ($GLOBALS['_ctx']->exists('categories') && preg_match('/#self/',$v)) { 
    179                     $v = preg_replace('/#self/',$GLOBALS['_ctx']->categories->cat_url,$v); 
    180                } elseif ($GLOBALS['_ctx']->exists('posts') && preg_match('/#self/',$v)) { 
    181                     $v = preg_replace('/#self/',$GLOBALS['_ctx']->posts->cat_url,$v); 
    182                } 
    183           } 
    184      } 
    185       
    186164     # Static methods for pagination 
    187165     public static function PaginationNbPages() 
     
    341319      
    342320     # First post image helpers 
    343      public static function EntryFirstImageHelper($size,$with_category,$class="") 
     321     public static function EntryFirstImageHelper($size,$class="") 
    344322     { 
    345323          global $core, $_ctx; 
     
    378356          } 
    379357           
    380           # No src, look in category description if available 
    381           if (!$src && $with_category && $_ctx->categories) 
    382           { 
    383                if (preg_match_all($pattern,$_ctx->categories->cat_desc,$m) > 0) 
    384                { 
    385                     foreach ($m[1] as $i => $img) { 
    386                          if (($src = self::ContentFirstImageLookup($p_root,$img,$size)) !== false) { 
    387                               $src = $p_url.(dirname($img) != '/' ? dirname($img) : '').'/'.$src; 
    388                               if (preg_match('/alt="([^"]+)"/',$m[0][$i],$malt)) { 
    389                                    $alt = $malt[1]; 
    390                               } 
    391                               break; 
    392                          } 
    393                     } 
    394                }; 
    395           } 
    396            
    397358          if ($src) { 
    398359               return '<img alt="'.$alt.'" src="'.$src.'" class="'.$class.'" />'; 
Note: See TracChangeset for help on using the changeset viewer.

Sites map