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.


All times are GMT. The time now is 12:35 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.01187 seconds
  • Memory Usage 1,734KB
  • 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
  • (4)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete