vBulletin Tweak (Hide smilies)

If you’re a vBulletin administrator (like me) and you want to stop people from using older smilies, here’s a quick tweak that seems to stop them being used in the post editor.

A word of caution before we continue. This tweak involves editing one of the vBulletion system files. If you aren’t comfortable doing that, then don’t do it!

I should perhap also state that because this involves editing a system file, you will have to carry out a similar modifcation the next time you upgrade your vBulletin installation. This mod was done on the codebase for version 3.7.4 with no patches applied.

So, on to the modification.

Locate the file includes\functions_editor.php, and go down to line 558. It should read:-


$smilies = $vbulletin->db->query_read_slave("
SELECT smilieid, smilietext, smiliepath, smilie.title,
imagecategory.title AS category
FROM " . TABLE_PREFIX . "smilie AS smilie
LEFT JOIN " . TABLE_PREFIX . "imagecategory AS imagecategory USING(imagecategoryid)
ORDER BY imagecategory.displayorder, imagecategory.title, smilie.displayorder
");

All we’re going to do, is to add a condition to this SQL statement that will allow you to manage which smilies are visible to users in the editor. To do this, add the following where clause to the SQL.


WHERE (smilie.displayorder<>0) and (imagecategory.displayorder<>0)

If you’re unfamiliar with SQL, then this is what your code should look like after you’ve made the change.


$smilies = $vbulletin->db->query_read_slave("
SELECT smilieid, smilietext, smiliepath, smilie.title,
imagecategory.title AS category
FROM " . TABLE_PREFIX . "smilie AS smilie
LEFT JOIN " . TABLE_PREFIX . "imagecategory AS imagecategory USING(imagecategoryid)
WHERE (smilie.displayorder<>0) and (imagecategory.displayorder<>0)
ORDER BY imagecategory.displayorder, imagecategory.title, smilie.displayorder
");

Simple enough, no?

Now, assuming everything is fine, to hide a smilie (or whole category of smilies), set the display order of the item you want to hide to 0, and hey presto, they won’t appear in the editor, but posts that use older smilies will still be able to use them.

And that as they say, is that :-)


vBulletin is Copyright ©2000-2008 Jelsoft Enterprises Ltd. All Rights Reserved.

Leave a Reply

 

Bad Behavior has blocked 120 access attempts in the last 7 days.

communication