Ejemplo n.º 1
0
$bbcode->SetLocalImgURL("smileys");
print "<table class='test_table' align='center'>\n" . "<thead><tr><th>Description</th><th>Result</th><th>Avg. Time</th></thead>\n" . "<tbody>\n";
$numpassed = 0;
$numfailed = 0;
$numtested = 0;
foreach ($BBCodeTestSuite as $test) {
    if (is_string($test)) {
        print "<tr class='spacer'><th colspan='3'></th></tr>\n" . "<tr class='group'><th colspan='3'>" . htmlspecialchars($test) . "</th></tr>\n";
    } else {
        $output = "<tr class='test'><td class='descr'>" . htmlspecialchars($test['descr']) . "</td>";
        if (@$test['debug'] == true) {
            $bbcode->SetDebug(true);
        } else {
            $bbcode->SetDebug(false);
        }
        $bbcode->SetTagMarker('[');
        $bbcode->SetAllowAmpersand(false);
        if (@$test['newline_ignore'] == true) {
            $bbcode->SetIgnoreNewlines(true);
        } else {
            $bbcode->SetIgnoreNewlines(false);
        }
        if (@$test['detect_urls'] == true) {
            $bbcode->SetDetectURLs(true);
        } else {
            $bbcode->SetDetectURLs(false);
        }
        if (@$test['urltarget'] == true) {
            $bbcode->SetURLTargetable(true);
        } else {
            $bbcode->SetURLTargetable(false);
Ejemplo n.º 2
0
 public static function parse_html($content, $process_content_plugins = false, $bbcode = true, $autolink = true)
 {
     if ($bbcode) {
         require_once CJLIB_PATH . '/lib/nbbc/nbbc_main.php';
         $bbcode = new BBCode();
         $bbcode->SetSmileyURL(CJLIB_MEDIA_URI . '/smileys');
         $bbcode->SetSmileyDir(CJLIB_MEDIA_PATH . DS . 'smileys');
         $bbcode->SetTagMarker('[');
         $bbcode->SetAllowAmpersand(false);
         $bbcode->SetEnableSmileys(true);
         $bbcode->SetDetectURLs($autolink);
         $bbcode->SetPlainMode(false);
         $bbcode->SetDebug(false);
         $content = $bbcode->Parse($content);
     } else {
         if ($autolink) {
             require_once 'lib_autolink.php';
             $content = autolink_urls($content, 50, ' rel="nofollow"');
         }
     }
     if ($process_content_plugins) {
         $content = JHTML::_('content.prepare', $content);
     }
     return $content;
 }
Ejemplo n.º 3
0
<input type='checkbox' <?php 
if ($tag_marker == '<') {
    print "checked='checked'";
}
?>
 name='anglebrackets' /> Use &lt;&gt; instead of [] for tags<br />

</td></tr></tbody></table>

</form>

</div>

<?php 
if (isset($_POST['bbcode_input'])) {
    $bbcode = new BBCode();
    $bbcode->SetSmileyURL("../smileys");
    $bbcode->SetSmileyDir("../smileys");
    $bbcode->SetTagMarker($tag_marker);
    $bbcode->SetAllowAmpersand($allow_ampersand);
    $bbcode->SetEnableSmileys($enable_smileys);
    $bbcode->SetDetectURLs($autourl_mode);
    $bbcode->SetPlainMode($plain_mode);
    $output = $bbcode->Parse($input);
    print "<div class='box'>\n" . "<div class='bbcode'>{$output}</div>\n" . "</div>\n";
}
?>

</body>
</html>