vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Random Smilies v1 (https://vborg.vbsupport.ru/showthread.php?t=79108)

BluPhoenix 03-30-2005 10:00 PM

Random Smilies v1
 
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:
Code:

                        $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:
Code:

                        $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:

Code:

LEFT JOIN " . TABLE_PREFIX . "imagecategory AS imagecategory USING(imagecategoryid)
and add below:
Code:

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

Quote:

Originally Posted by mholtum
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

Quote:

Originally Posted by Pain86
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

Quote:

Originally Posted by hotwheels
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:
Code:

                        // 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:

Code:

// 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

Quote:

Originally Posted by Zachariah
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/showthrea...083#post806083

Zachariah 10-27-2005 05:15 PM

Quote:

Originally Posted by jugo
I put it in a plugin....seems to work fine for me.

https://vborg.vbsupport.ru/showthrea...083#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.


All times are GMT. The time now is 02:49 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01257 seconds
  • Memory Usage 1,761KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (6)bbcode_code_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (19)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete