$Articles = $MySQL->Query("SELECT * FROM ".$pre."News_Articles ORDER BY Article_Time DESC LIMIT ".$Show_New_News."");
while($post = mysql_fetch_array($Articles)){
$Article_ID = $post['Article_ID'];
$Article_Title = $post['Article_Title'];
$Article_Topic = "<b><a href=\"index.php?find=News&file=View_Articles&show_page=1&topic=".$post['Article_Topic']."\">".$post['Article_Topic']."</a>:</b>";
$Article_Story = nl2br($post['Article_Story']);
$Article_Views = $post['Article_Views'];
if($Censor_Words == 1){
$Article_Story = censor($Article_Story);
}
if($Emoticon_On == 1){
$Article_Story = emoticon($Article_Story);
}
$Comment_Count = $MySQL->Rows("SELECT * FROM ".$pre."Article_Comments WHERE Story_ID = ".$Article_ID."");
$Read_More = "( <a href=\"index.php?find=News&Show_Full=1&Article_ID=".$Article_ID."\">"._SEE_FULL_STORY."</a> | ";
$Read_More .= _READS.": ". $Article_Views . " | ";
$Read_More .= "<a href=\"index.php?find=News&Show_Full=1&Article_ID=".$Article_ID."#Post_Comment\">"._POST_COMMENT." [".$Comment_Count."]</a> )";
$Article_Date = $post['Article_Date'];
$Article_Author = _POSTED_BY ." ". $post['Article_Author'];
include($Current_Directory."/Templates/".$user->theme()."/news.tpl");
}
echo "<a href=\"index.php?find=News&file=View_Articles\">"._OLD_ARTICLES."</a>";
}
The smilies are now ran in a function in the backend of the website. Here is the code for the smilies and censored words
function censor($string){
global $MySQL, $pre;
$Bad_Word = $MySQL->Query("SELECT bad_word FROM ".$pre."censor_words");
$Replace = $MySQL->Query("SELECT replacement FROM ".$pre."censor_words");
$i = 0;
while($bad_word = mysql_fetch_array($Bad_Word)){
$Bad_Words[$i] = $bad_word[0];
$i++;
}
unset($i);
$i = 0;
while($replace = mysql_fetch_array($Replace)){
$Replacement[$i] = $replace[0];
$i++;
}
$string = str_replace($Bad_Words, $Replacement, $string);
return $string;
}
function emoticon($string){
global $MySQL, $pre;
$EmotCODE = $MySQL->Query("SELECT smilie_code FROM ".$pre."smilies");
$EmotIMG = $MySQL->Query("SELECT smilie_img FROM ".$pre."smilies");
$x = 0;
while($emcode = mysql_fetch_array($EmotCODE)){
$ecode[$x] = $emcode[0];
$x++;
}
$x = 0;
while($emimg = mysql_fetch_array($EmotIMG)){
$eimg[$x] = "<img src=\"".$base_url."/images/smilies/".$emimg[0]."\">";
$x++;
}
$string = str_replace($ecode, $eimg, $string);
return $string;
}
The query count is uneffected either way it seems...And there is 5 news articles being shown. and a stand of 5-6 on every other page, so I am figuring that means 4 queries per article some how..
+EDIT: http://timtimtimma.com/backend_source.php shows the current backend code being used
+EDIT: http://timtimtimma.com to see the site, and main page if you need