Forums / Cotonti / Extensions / [new plugin] {PAGE_TEXT_ID_XX}

Display content of page with id=XX anywhere in site

medar
#1 2008-12-15 23:46
See in branch - pagetextbyidn.

Allows tag {PAGE_TEXT_ID_XX}
Tag work in any .tpl file
Displaying content of page (page_text) with id=XX
Link for editing this content included.

I think it may be included in release.
rangjungyeshe.ru
musiconly
#2 2008-12-17 03:55
Does this show shortened page text, like first 100 characters of page text and then it automatically brakes it and gives (more) code?
medar
#3 2008-12-17 06:51
Output page as is.
Tag not works now.
rangjungyeshe.ru
Trustmaster
#4 2008-12-17 15:22
You could make a shortened version {PAGE_TEXT_SHORT_ID_XX} using something like this:
// 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_bbcode_parse($text);
    }
    else $text = preg_replace('#\[[^\]]+?\]#', '', $text);
    return $text;
}
May the Source be with you!