Dotclear


Ignore:
Timestamp:
09/16/09 10:39:06 (14 years ago)
Author:
Tomtom33
Message:

spliPost 0.3 :

  • Adds plugin configuration in blog pref panel
  • Adds auto insert post pagination
  • Fixes regex's pattern bug
File:
1 edited

Legend:

Unmodified
Added
Removed
  • plugins/splitPost/_public.php

    r1423 r1464  
    1414 
    1515$core->tpl->addValue('PostPagination',array('splitPostTpl','PostPagination')); 
     16$core->tpl->addValue('EntryContent',array('splitPostTpl','EntryContent')); 
    1617 
    1718$core->url->register('post','post','^post/(.+)$',array('splitPostUrl','post')); 
     
    197198class splitPostTpl 
    198199{ 
     200     public static function EntryContent($attr) 
     201     { 
     202          $urls = '0'; 
     203          if (!empty($attr['absolute_urls'])) { 
     204               $urls = '1'; 
     205          } 
     206           
     207          $f = $GLOBALS['core']->tpl->getFilters($attr); 
     208           
     209          $res = ''; 
     210           
     211           
     212          if (!empty($attr['full'])) { 
     213               $res = '<?php echo '.sprintf($f, 
     214                    '$_ctx->posts->getExcerpt('.$urls.')." ".$_ctx->posts->getContent('.$urls.')').'; ?>'; 
     215          } else { 
     216               $res = '<?php echo '.sprintf($f,'$_ctx->posts->getContent('.$urls.')').'; ?>'; 
     217          } 
     218           
     219          $res .= "<?php if (\$core->blog->settings->splitpost_auto_insert) : ?>\n"; 
     220          $res .= splitPostTpl::PostPagination($attr); 
     221          $res .= "<?php endif; ?>\n"; 
     222 
     223          return $res; 
     224     } 
     225      
    199226     public static function PostPagination($attr) 
    200227     { 
     
    219246          $res .= "\$pager = new splitPostPager(\$_ctx->post_page_current,\$_ctx->post_page_count,".$max.");\n"; 
    220247          $res .= "\$pager->init(\$params);\n"; 
    221           $res .= "echo \$pager->getLinks();\n"; 
     248          $res .= "echo ".sprintf($f,'$pager->getLinks()').";\n"; 
    222249          $res .= "?>\n"; 
    223250           
Note: See TracChangeset for help on using the changeset viewer.

Sites map