PDA

View Full Version : [release] hack pt 2 for global.php - makes the smilie look up


09-06-2000, 04:07 PM
This hack really reduces the load on your database server.

Each time you view a thread the php does

SELECT allowbbcode,allowhtml,allowimages,allowsmilies FROM forum WHERE forumid=$forumid

SELECT smilietext,smiliepath FROM smilie


SELECT findcode,replacecode FROM bbcode

_Per_ message.

This hack makes it happen once per thread. Basically it
caches the lookups in a local lookup table and hey presto
cuts down the hits on the database ...

To see what a difference this makes turn logging on in mysql and watch the before and after..

This is a replacement for bbcodeparse2

Go to http://forums.gameplay.com/global_hack_pt2.html
to download as it's rather large ;-)

Fodder

09-06-2000, 09:20 PM
What if the first user to post chooses to parse smilies in their post but the second user doesnt? Then what happens?

~Chris

09-07-2000, 07:04 AM
Exactly what was wanted (AFAIK)

All i've changed was the lookup bit. The only
problem is if someone adds a new smilie and
someone uses it in their post if they manage
to post the smilie and the message in
the time that the page takes to load.
But taken as though that page wouldn't
pick up their post i don't see it as much of a
problem :-)

Fodder