Previous Thread
Next Thread
Print Thread
Rate Thread
#283521 02/11/2005 11:15 AM
Joined: Sep 2004
Posts: 15
Newbie
Newbie
Offline
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():
Code
		// 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():
Code
		// 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():
Code
		// 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>  &nbsp;<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:
Code
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 />&nbsp;<br /></td>


Thoughts? Am I overlooking something?

Sponsored Links
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
That should cover it.

Joined: Sep 2003
Posts: 803
Coder
Coder
Offline
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?


Link Copied to Clipboard
Donate Today!
Donate via PayPal

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.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Shock Hosting
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Bill B
Bill B
Issaquah, WA
Posts: 87
Joined: December 2001
Forum Statistics
Forums63
Topics37,583
Posts293,955
Members13,824
Most Online151,614
Nov 14th, 2025
Today's Statistics
Currently Online 547
Topics Created 0
Posts Made 0
Users Online 0
Birthdays 12
Top Posters
AllenAyres 21,080
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,834
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2026 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.1.0
(Snapshot build 20260108)