Warning: Expiry date cannot have a year greater then 9999 in /home/kilandor/seditioforge.com/system/common.php on line 244
Show N characters from pages in your category listings - Extracts from Pages 0.2 - Seditio Forge
Show N characters from pages in your category listings
Author: Trustmaster
Submitted by: Trustmaster
Date: 2007-08-19 16:05
Comments: (0)
Ratings:
 
If you want to display extracts from pages in your category listings (news-like "Read More" layout), this tiny plug-in will help you with {LIST_ROW_EXTRACT} tag for list.tpl.

Installation:

    1. Unpack the files to your 'plugins' directory.
    2. Go to admin panel and install the plugin.
    3. Configure number of characters to show in extracts.
    4. Edit your 'skins/skin_name/list.tpl' and add {LIST_ROW_EXTRACT} in LIST_ROW section.


Changelog:

    0.2:
    * New auto-closing model as described in this article
    * Fixed HTML mode parsing.


As one flexible function:
PHP Code:

// Cutpost
function sed_cutpost($text, $max_chars, $parse_bbcodes = true)
{
    $text = $max_chars == 0 ? $text : sed_cutstring(strip_tags($text), $max_chars);
    // Fix partial cuttoff
    $text = preg_replace('#\[[^\]]*?$#', '...', $text);
    // Parse the BB-codes or skip them
    if($parse_bbcodes)
    {
        // Parse it
        $text = sed_parse($text);
    }
    else $text = preg_replace('#\[[^\]]+?\]#', '', $text);
    return $text;
}



Download : Extracts from Pages 0.2
Size: 1KB, downloaded 199 times
Copyright © 2008 Domain.Com. All Rights Reserved.
Page created in 0.25 seconds