PDA

View Full Version : Random Smilies v1


BluPhoenix
03-30-2005, 10:00 PM
What does this do then?
It's nice having those smilies on the side of the editor, but after a while you get sick of looking at the same ones each time you post, so this changes the display to a random one.

The Hack

In includes/functions_editor.php find:
$smilies = $DB_site->query("
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, smilie.displayorder
");

REPLACE that code with:
$smilies = $DB_site->query("
SELECT smilieid, smilietext, smiliepath, smilie.title,
imagecategory.imagetype AS category
FROM " . TABLE_PREFIX . "smilie AS smilie
LEFT JOIN " . TABLE_PREFIX . "imagecategory AS imagecategory USING(imagecategoryid)
ORDER BY rand()
");

================================================== ====
*Important Extra Configuration bit*

Do you have large smilies you'd rather weren't in the random selection? well make sure they are all stored in their own categories and then find:

LEFT JOIN " . TABLE_PREFIX . "imagecategory AS imagecategory USING(imagecategoryid)

and add below:
WHERE imagecategory.imagecategoryid NOT IN (1,2)

Where the highlighted bits are the categoryid's you'd rather weren't available in the random smilies.
================================================== =====

and now you are all done, no template edits are required and of course the screenshot, but it'll be different on yours as it'll include your smilies so you need to use a bit of imagination on this one ;)

Thanks for looking at (and hopefully installing) a BluPhoenix vB Hack :tired:

sabret00the
03-31-2005, 07:47 AM
if you don't order them doesn't it show them randomized anyway?

BluPhoenix
03-31-2005, 01:16 PM
Noit as far as I'm aware.. if you set them all to one it'll just shown the first 16 or whatever you have set..

error_22
03-31-2005, 02:50 PM
sabret00the is right, they are if u don't order them.....thanks anyway:)

underESTIMATED
03-31-2005, 10:47 PM
Good enough for me.

Thank you. :)

Zachariah
04-10-2005, 08:46 AM
thanks

Pain86
04-26-2005, 08:25 PM
thanks just what i needed

colorteck
05-21-2005, 04:41 PM
Nice just what I was looking for. Installed and clicked :squareeyed:

Pain86
05-26-2005, 07:56 PM
can you get it workin for vb 3.0.7?

mholtum
05-26-2005, 08:04 PM
just set them all to number 1 in the smiley manager, does the same thing.

Pain86
05-27-2005, 03:47 PM
just set them all to number 1 in the smiley manager, does the same thing.

no it doesnt :ermm:

o0Hubba0o
09-15-2005, 11:33 PM
no it doesnt :ermm:
Yep agreed, at one time we thought that maybe they were, but we've been watching them for awhile now and they are staying the same. This is just the hack we've looking for.

hotwheels
10-14-2005, 12:27 AM
That is awesome.......i have been wanting something like this....thanks for the great work.

hotwheels

o0Hubba0o
10-23-2005, 01:50 AM
That is awesome.......i have been wanting something like this....thanks for the great work.

hotwheels

Will this work with 3.5?

GuaRRand
10-27-2005, 12:24 PM
Does this work with 3.5. also??

Zachariah
10-27-2005, 01:48 PM
Does this work with 3.5. also??

No / Yes :D

Change the RED

Find:
// query smilies
$smilies = $vbulletin->db->query_read("
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
");

Replace:

// query smilies
$smilies = $vbulletin->db->query_read("
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 rand()
");

jugo
10-27-2005, 02:33 PM
Does this work with 3.5. also??

No / Yes :D


I put it in a plugin....seems to work fine for me.

https://vborg.vbsupport.ru/showthread.php?p=806083#post806083

Zachariah
10-27-2005, 05:15 PM
I put it in a plugin....seems to work fine for me.

https://vborg.vbsupport.ru/showthread.php?p=806083#post806083


HA! you so groovy - no file edits :D

Nice, but I prefer the file edit - One less query ran on loading the editor

ThugTheLeet
01-15-2006, 12:11 AM
Thanks installed.