Dotclear

Changeset 2303


Ignore:
Timestamp:
06/06/10 00:45:54 (13 years ago)
Author:
JcDenis
Message:

lastpostsExtend 0.9

  • Switched to DC 2.2
Location:
plugins/lastpostsExtend
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • plugins/lastpostsExtend/_define.php

    r2143 r2303  
    1717     /* Description*/         "Widget like lastposts with extended options", 
    1818     /* Author */             "JC Denis", 
    19      /* Version */            '0.8.2', 
     19     /* Version */            '0.9', 
    2020     /* Permissions */        'admin' 
    2121); 
    22      /* date */          #20100329 
     22     /* date */          #20100605 
    2323?> 
  • plugins/lastpostsExtend/_widgets.php

    r2143 r2303  
    2020     { 
    2121          global $core; 
    22  
     22           
    2323          # Create widget 
    2424          $w->create( 
     
    103103          ); 
    104104          # Tag 
    105           if ($core->plugins->moduleExists('metadata')) 
     105          if ($core->plugins->moduleExists('tags')) 
    106106          { 
    107107               $w->lastpostsextend->setting( 
     
    192192          ); 
    193193     } 
    194  
     194      
    195195     public static function parseWidget($w) 
    196196     { 
    197197          global $core; 
    198  
     198           
    199199          $params = array('sql' => '', 'columns' => array(), 'from' => ''); 
    200  
     200           
    201201          # Home page only 
    202202          if ($w->homeonly && $core->url->type != 'default') 
     
    268268          } 
    269269          # Tags 
    270           if ($core->plugins->moduleExists('metadata') && $w->tag) 
     270          if ($core->plugins->moduleExists('tags') && $w->tag) 
    271271          { 
    272272               $tags = explode(',',$w->tag); 
     
    277277               $params['sql'] .= "AND META.meta_type = 'tag' "; 
    278278          } 
    279  
     279           
    280280          //$rs = self::getPosts($params); 
    281281          $rs = $core->auth->sudo(array($core->blog,'getPosts'),$params,false); 
    282  
     282           
    283283          # No result 
    284284          if ($rs->isEmpty()) return; 
     
    293293               '<'.($rs->post_status == 1 ? 'a href="'.$rs->getURL().'"' : 'span'). 
    294294               ' title="'. 
    295                dt::dt2str($core->blog->settings->date_format,$rs->post_upddt).', '. 
    296                dt::dt2str($core->blog->settings->time_format,$rs->post_upddt).'">'. 
     295               dt::dt2str($core->blog->settings->system->date_format,$rs->post_upddt).', '. 
     296               dt::dt2str($core->blog->settings->system->time_format,$rs->post_upddt).'">'. 
    297297               html::escapeHTML($rs->post_title). 
    298298               '</'.($rs->post_status == 1 ? 'a' : 'span').'>'; 
     
    327327          } 
    328328          $res .= '</ul></div>'; 
    329  
     329           
    330330          return $res; 
    331331     } 
    332  
     332      
    333333     private static function entryFirstImage($core,$type,$id,$size='s') 
    334334     { 
    335335          if (!in_array($type,array('post','page','galitem'))) return ''; 
    336  
     336           
    337337          $rs = $core->auth->sudo(array($core->blog,'getPosts'),array('post_id'=>$id,'post_type'=>$type),false); 
    338  
     338           
    339339          if ($rs->isEmpty()) return ''; 
    340  
     340           
    341341          if (!preg_match('/^sq|t|s|m|o$/',$size)) 
    342342          { 
    343343               $size = 's'; 
    344344          } 
    345  
    346           $p_url = $core->blog->settings->public_url; 
     345           
     346          $p_url = $core->blog->settings->system->public_url; 
    347347          $p_site = preg_replace('#^(.+?//.+?)/(.*)$#','$1',$core->blog->url); 
    348348          $p_root = $core->blog->public_path; 
    349  
     349           
    350350          $pattern = '(?:'.preg_quote($p_site,'/').')?'.preg_quote($p_url,'/'); 
    351351          $pattern = sprintf('/<img.+?src="%s(.*?\.(?:jpg|gif|png))"[^>]+/msu',$pattern); 
    352  
     352           
    353353          $src = ''; 
    354354          $alt = ''; 
    355  
     355           
    356356          $subject = $rs->post_excerpt_xhtml.$rs->post_content_xhtml.$rs->cat_desc; 
    357357          if (preg_match_all($pattern,$subject,$m) > 0) 
     
    371371          } 
    372372          if (!$src) return ''; 
    373  
     373           
    374374          return  
    375375          '<div class="img-box">'.                 
     
    410410               } 
    411411          } 
    412  
     412           
    413413          return $res ? $res : false; 
    414414     } 
  • plugins/lastpostsExtend/release.txt

    r2143 r2303  
     10.9 20100906 
     2 * Switched to DC 2.2 
     3 
    140.8.2 20100329 
    25 * Fixed getPosts by using sudo 
Note: See TracChangeset for help on using the changeset viewer.

Sites map