Most other cms/blog systems will be case insensitive for bbcodes.
its a simple code update really. just change all /sU to /isU in the textsanitizer module for xoopsCodeDecode
............
function b_news_top_show($options) {
global $xoopsDB;
$myts =& MyTextSanitizer::getInstance();
$block = array();
//should use 'topicid' for implementing News Topics in future
$sql = "SELECT storyid, title, published, expired, counter, [b]hometext, bodytext, [u]nohtml, nosmiley, comments[/u][/b] FROM ".$xoopsDB->prefix("stories")." WHERE published < ".time()." AND published > 0 AND (expired = 0 OR expired > ".time().") ORDER BY ".$options[0]." DESC";
$result = $xoopsDB->query($sql,$options[1],0);
while ( $myrow = $xoopsDB->fetchArray($result) ) {
$news = array();
$title = $myts->makeTboxData4Show($myrow["title"]);
if ( !XOOPS_USE_MULTIBYTES ) {
if (strlen($myrow['title']) >= $options[2]) {
$title = $myts->makeTboxData4Show(substr($myrow['title'],0,($options[2] -1)))."...";
}
}
$news['title'] = $title;
[b][u]$news['text'] = $myts->makeTareaData4Show( $myrow['hometext'], !$myrow['nohtml'], !$myrow['nosmiley'], 1);[/u]
if( $myrow['bodytext'] == "" ) {
$news['readmore'] = "";
} else {
$news['readmore'] = "Read More... | ";
}
[u]if( $myrow['comments'] == 0 ){
$news['comments'] = "Post Comment";
} else{
$news['comments'] = $myrow['comments']." Comment(s)";
}[/u]
$news['id'] = $myrow['storyid'];
$news['date'] = formatTimestamp($myrow['published'],"s");
$news['hits'] = $myrow['counter'];
$block['stories'][] = $news;
$block['numStory'] = $options[1];
}[/b]
return $block;
}
.................
<{foreach item=news from=$block.stories}>
<div class="item">
<div class="itemHead"><span class="itemTitle">
<a href="<{$xoops_url}>/modules/news/article.php?storyid=<{$news.id}>"><{$news.title}></a>
</span></div>
<div class="itemInfo">
<span class="itemPostDate"><{$news.date}></span> (<span class="itemStats"><{$news.hits}> reads</span>)
</div>
<div class="itemBody">
<{$story.imglink}>
<p class="itemText"><{$news.text}></p>
</div>
<div class="itemFoot"><span class="itemPermaLink">
<a href="<{$xoops_url}>/modules/news/article.php?storyid=<{$news.id}>"><{$news.readmore}><{$news.comments}></a>
</span></div></div><br />
<{/foreach}>
<hr>
<div style="text-align: right; margin: 10px;"><b><i><a href="<{$xoops_url}>/modules/news/">[Read More News]</a></i></b></div>
<?php
// $Id: news_top.php,v 1.1 2004/01/29 14:45:49 buennagel Exp $
// ------------------------------------------------------------------------ //
// XOOPS - PHP Content Management System //
...................
// ------------------------------------------------------------------------ //
function b_news_top_show($options) {
global $xoopsDB;
$myts =& MyTextSanitizer::getInstance();
$block = array();
$sql = "SELECT storyid, title, [b]hometext, bodytext,[/b] published, expired, counter FROM ".$xoopsDB->prefix("stories")." WHERE published < ".time()." AND published > 0 AND (expired = 0 OR expired > ".time().") ORDER BY ".$options[0]." DESC";
$result = $xoopsDB->query($sql,$options[1],0);
while ( $myrow = $xoopsDB->fetchArray($result) ) {
$news = array();
$title = $myts->makeTboxData4Show($myrow["title"]);
if ( !XOOPS_USE_MULTIBYTES ) {
if (strlen($myrow['title']) >= $options[2]) {
$title = $myts->makeTboxData4Show(substr($myrow['title'],0,($options[2] -1)))."...";
}
}
$news['title'] = $title;
[b] $news['text'] = $myts->displayTarea( $myrow['hometext'] );
if( $myrow['bodytext'] == "" ) {
$news['readmore'] = "";
} else {
$news['readmore'] = "Read More... | ";
}
if( $myrow['comments'] != 0 ){
$news['comments'] = (string)$myrow['comments']." Comment(s)";
} else{
$news['comments'] = "Post Comment";
}
$news['id'] = $myrow['storyid'];
$news['date'] = formatTimestamp($myrow['published'],"s");
$news['hits'] = $myrow['counter'];
$block['stories'][] = $news;
[/b] }
return $block;
}
.........................
return $form;
}
?>
$patterns[] = "/[img align=(['"]?)(left|center|right)\1]([^"()?&'<>]*)[/img]/sU";
$patterns[] = "/[img]([^"()?&'<>]*)[/img]/sU";
$patterns[] = "/[img align=(['"]?)(left|center|right)\1 id=(['"]?)([0-9]*)\3]([^"()?&'<>]*)[/img]/sU";
$patterns[] = "/[img id=(['"]?)([0-9]*)\1]([^"()?&'<>]*)[/img]/sU";
$patterns[] = "/[img align=(['"]?)(left|center|right)\1]([^"()&'<>]*)[/img]/sU";
$patterns[] = "/[img]([^"()&'<>]*)[/img]/sU";
$patterns[] = "/[img align=(['"]?)(left|center|right)\1 id=(['"]?)([0-9]*)\3]([^"()&'<>]*)[/img]/sU";
$patterns[] = "/[img id=(['"]?)([0-9]*)\1]([^"()&'<>]*)[/img]/sU";