Changeset 1267 in ExiteCMS for trunk/includes/core_functions.php


Ignore:
Timestamp:
02/12/08 00:23:31 (4 years ago)
Author:
hverton
Message:

check if wiki_links are enabled. if not, strip [wiki] bbcodes (nothing to link to)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/includes/core_functions.php

    r1264 r1267  
    526526// Parse bbcode into HTML code 
    527527function parseubb($text) { 
    528     global $locale; 
     528    global $settings, $locale; 
    529529     
    530530    $text = preg_replace('#\[li\](.*?)\[/li\]#si', '<li>\1</li>', $text); 
     
    540540 
    541541    // new wiki bbcode 
    542     $text = preg_replace('#\[wiki\](.*?)\[/wiki\]#si', '<a href="'.BASEDIR.'modules/wiki/index.php?wakka=\1" class="wiki_link" alt="">\1</a>', $text); 
     542    if (isset($settings['wiki_forum_links']) && $settings['wiki_forum_links']) { 
     543        // add the link to the wiki page 
     544        $text = preg_replace('#\[wiki\](.*?)\[/wiki\]#si', '<a href="'.BASEDIR.'modules/wiki/index.php?wakka=\1" class="wiki_link">\1</a>', $text); 
     545    } else { 
     546        // strip the wiki bbcode 
     547        $text = preg_replace('#\[wiki\](.*?)\[/wiki\]#si', '\1', $text); 
     548    } 
    543549 
    544550    // correct illegal [url=] BBcode 
Note: See TracChangeset for help on using the changeset viewer.