|
Joined: Sep 2004
Posts: 15
Newbie
|
Newbie
Joined: Sep 2004
Posts: 15 |
I want to completely remove graemlins from our forums. Since the stock graemlins can't be deleted from the control panel, is it as easy as deleting the graemlins from the database? If not, I guess I'll be performing surgery on ubbt.inc.php. As best as I can tell, these are the sections of code that I will be commenting out: In do_markup(): // Convert the smileys<br /> // First grab all smileys out of the database<br /> $query = "<br /> SELECT G_Code,G_Smiley,G_Image<br /> FROM {$config['tbprefix']}Graemlins<br /> ORDER BY G_Smiley<br /> ";<br /> $sth = $dbh -> do_query($query,__LINE__,__FILE__);<br /> while (list($code,$smiley,$image) = $dbh -> fetch_array($sth)) {<br /> if ($smiley) {<br /> @eval("\$string = $code;");<br /> $string = preg_quote($string,'/');<br /> $smiley = preg_quote($smiley,'/');<br /> $Body = preg_replace("/(( |\n|^|\r\])$smiley|(\[|:)$string(\]|:))/","\\2<img src=\"{$config['images']}/graemlins/$image\" alt=\"\" />",$Body);<br /> }<br /> else {<br /> @eval("\$string = $code;");<br /> $string = preg_quote($string,'/');<br /> $Body = preg_replace("/(:|\[)$string(:|\])/i","<img src=\"{$config['images']}/graemlins/$image\" alt=\"\" />",$Body);<br /> }<br /> } In undo_markup(): // Convert the smileys<br /> // First grab all smileys out of the database<br /> $query = "<br /> SELECT G_Code,G_Smiley,G_Image<br /> FROM {$config['tbprefix']}Graemlins<br /> ORDER BY G_Smiley<br /> ";<br /> $sth = $dbh -> do_query($query,__LINE__,__FILE__);<br /> while (list($code,$smiley,$image) = $dbh -> fetch_array($sth)) {<br /> @eval("\$string = $code;");<br /> if ($smiley) {<br /> $string = $smiley;<br /> } else {<br /> $string = ":$string:";<br /> }<br /> $Body = str_replace("<img src=\"{$config['images']}/graemlins/$image\" alt=\"\" />","$string",$Body);<br /> } In instant_ubbcode(): // We need to grab all of the graemlins out of the db<br /> $query = "<br /> SELECT G_Code,G_Smiley,G_Image<br /> FROM {$config['tbprefix']}Graemlins<br /> WHERE G_Active='1'<br /> ";<br /> $sth = $dbh -> do_query($query,__LINE__,__FILE__);<br /> $i=0;<br /> $graemlinlist="";<br /> $altcode = "";<br /> while (list($code,$smiley,$image) = $dbh -> fetch_array($sth)) {<br /> if (stristr("$code","$")) {<br /> @eval("\$code = $code;");<br /> }<br /> $code = ":$code:";<br /> $altcode = "$code";<br /> if ($smiley) {<br /> $code = $smiley;<br /> $altcode .= " $smiley";<br /> }<br /> $graemlinlist .= <<<EOF<br /> <a href="javascript:void(0)" onclick="insertAtCaret(document.replier.Body, ' $code'); document.replier.Body.focus();"><img src="{$config['images']}/graemlins/$image" border="0" alt="$altcode" title="$altcode" /></a> <br />EOF;<br /> $i++;<br /> if ($i==6) {<br /> $i=0;<br /> $graemlinlist .= "<br />";<br /> }<br /> } I assume that this is not really necessary, but there's no reason to have the board do a query for graemlins when it's never going to find any. In ubbt_instant_ubbcode.tmpl: function DoSmilie(addSmilie) {<br /> var revisedMessage;<br /> var currentMessage = document.replier.Body.value;<br /> revisedMessage = currentMessage+addSmilie;<br /> document.replier.Body.value=revisedMessage;<br /> document.replier.Body.focus();<br /> return;<br />}<br /><br />...<br /><br /><td class="tdheader"><br /><b>{$ubbt_lang['INST_GRAEMLIN']}</b><br /></td><br /><br />...<br /><br /><td valign="top" align="left" nowrap="nowrap"><br />$graemlinlist<br /><br /> <br /></td> Thoughts? Am I overlooking something?
|
|
|
|
Joined: Nov 2001
Posts: 10,369
I type Like navaho
|
I type Like navaho
Joined: Nov 2001
Posts: 10,369 |
|
|
|
|
Joined: Sep 2003
Posts: 803
Coder
|
Coder
Joined: Sep 2003
Posts: 803 |
at the risk of replying 5 days later "doh"
why is it such a big deal to keep the stock graemlins? Why cant they be deleted by forum owners?
|
|
|
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
|
|
Posts: 87
Joined: December 2001
|
|
Forums63
Topics37,575
Posts293,931
Members13,823
|
Most Online6,139 Sep 21st, 2024
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|