vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Random smilies in posts/reply (https://vborg.vbsupport.ru/showthread.php?t=99426)

GuaRRand 10-26-2005 10:00 PM

Random smilies in posts/reply
 
I edited the original 3.0.7 code, by BluPheonix, a bit to comply with 3.5.
Tetsed it with my 3.5 site and it works fine.

In includes/functions_editor.php find:

Code:

$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, smilie.displayorder
                        ");

Replace it with:

Code:

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

Should work fine!!

jugo 10-27-2005 01:28 PM

I want to do this so bad, but i'd hate to have to edit files...

[high]* jugo goes to find a way to trick it into a hook....
[/high]

[high]* jugo found it!!!
[/high]

I hope I'm not stepping on toes here, but i released the plugin version here: https://vborg.vbsupport.ru/showthread.php?t=99435 :ermm:

GuaRRand 10-27-2005 03:33 PM

OUCH!!

*sees toes get crushed*

:P

Snake 10-27-2005 06:42 PM

Installed!

GuaRRand 10-27-2005 06:50 PM

Dont forget to click INSTALL pls :D

sellbuydomain 10-27-2005 08:49 PM

find the code, where to change it, you did not say where to change or add
'

Bounce 10-27-2005 09:30 PM

Quote:

Originally Posted by sellbuydomain
find the code, where to change it, you did not say where to change or add
'

from the original thread ;)

Change To:-

PHP 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()
            "
); 

I take it its the same as thread from 3.0.7 :ninja:

GuaRRand 10-28-2005 06:34 AM

Hehe..sorry, will add it in the main post...

hotwheels 12-28-2005 09:51 PM

worked perfectly........thanks. hotwheels clicks *installs*

sportsoutlaw 12-31-2005 10:58 PM

I will give this one a try

jilly 01-03-2006 03:10 AM

that worked for me too , where nothing else did

jilly 01-03-2006 07:53 PM

Could there be a way to exclude certain categories of smilies by user preference? For example we have dancing bananas, and it's either a love/hate thing - I'd love to be able to let the members screen what smilies go in the random rotation by category...

LBSources 01-18-2006 05:53 PM

Welp.. working on 3.5.3 as for some reason all '1' do not rotate mine.. but this did the trick.. just hate that its a file edit..

good job and thanks..

QueenBee 01-19-2006 06:07 AM

works like a charm;)

:clicks install::

yinyang 03-12-2006 06:35 PM

Quote:

Originally Posted by jugo
I want to do this so bad, but i'd hate to have to edit files...

[high]* jugo goes to find a way to trick it into a hook....
[/high]

[high]* jugo found it!!!
[/high]

I hope I'm not stepping on toes here, but i released the plugin version here: https://vborg.vbsupport.ru/showthread.php?t=99435 :ermm:

no he doesn't. doesn't work.

GrendelKhan{TSU 03-13-2006 08:43 AM

anyway to exclude some smilie categories?

I have some that are HUGE (and in a HUGE smilie category). Don't want them showing up suddenly and stretching the page. :/
:eek:

vbreal 04-13-2006 12:33 AM

Quote:

Originally Posted by GrendelKhan{TSU
anyway to exclude some smilie categories?

I have some that are HUGE (and in a HUGE smilie category). Don't want them showing up suddenly and stretching the page. :/
:eek:


thats the same problem i am having. i need to exclude the big smilies

bairy 04-21-2006 04:39 PM

Yip. Create a second smilie category named "Big smilies" or something, and move the large smilies to it, then put:

WHERE smilie.imagecategoryid =1

above the ORDER BY line in the query, that will select smilies only from the default smilie category.

Of course that means the big smilies will only be accessible via viewing all of them.

Also I'm not one to critisise others, especially on matters such as php file hacking, but:
This is a tiny tiny file edit. I know everyone has become ultra sensitive about file hacks since the plugin system came out, but this is a 10 second job. Upgrade, Re-replace it. If you clicked install it'll show up in your profile so you can quickly find it again.

yumyumcat 06-20-2006 06:26 PM

Where do I find this in the Admin CP? I can't seem to locate it. :(

In includes/functions_editor.php

Bojangles 06-28-2006 01:43 AM

Easy to overwrite, nice job ;)

Polo 07-03-2006 03:22 AM

quick and easy.

installed on vb 3.5.3

Roxie 08-15-2006 01:39 AM

Quote:

Originally Posted by yumyumcat
Where do I find this in the Admin CP? I can't seem to locate it. :(

In includes/functions_editor.php

This is not in the admin control panel. You would have uploaded it to your server. It is a PHP file.

This also works with 3.6 Gold.

hotwheels 08-24-2006 06:30 AM

yes, it works perfectly on 3.6

PoetJA-1975 10-12-2006 09:30 AM

GREAT - very nice thanx

Jacquii.

PoetJA-1975 01-21-2007 04:16 PM

Great! Works in 3.6.4 as well!
Thanx,

Jacquii.

vivamexico55 02-12-2007 05:26 PM

Any way to do this with a plugin ?

Roxie 03-07-2007 04:19 PM

Works on 3.6.5.

Just replace the last line of the code.

LisaD1 03-29-2008 05:09 AM

Works with 3.6.8

Replaced this part of the code

Code:


LEFT JOIN " . TABLE_PREFIX . "imagecategory AS imagecategory USING(imagecategoryid)
ORDER BY imagecategory.displayorder, smilie.displayorder
");


With this

Code:


LEFT JOIN " . TABLE_PREFIX . "imagecategory AS imagecategory USING(imagecategoryid)
ORDER BY rand()
");


Works like a charm :)

jilly 05-03-2008 05:18 PM

Quote:

Originally Posted by LisaD1 (Post 1477379)
Works with 3.6.8

Replaced this part of the code

Code:


LEFT JOIN " . TABLE_PREFIX . "imagecategory AS imagecategory USING(imagecategoryid)
ORDER BY imagecategory.displayorder, smilie.displayorder
");


With this

Code:


LEFT JOIN " . TABLE_PREFIX . "imagecategory AS imagecategory USING(imagecategoryid)
ORDER BY rand()
");


Works like a charm :)

this works in 3.7.0 too.. wish it could just be a plugin though :)

Roxie 05-30-2008 04:56 PM

Yea. Seems to work, you just have to reapply the change after upgrading, which sucks. lol

LisaD1 06-02-2008 03:46 PM

Quote:

Originally Posted by Roxie (Post 1536401)
Yea. Seems to work, you just have to reapply the change after upgrading, which sucks. lol

Totally SUCKS!! Especially since the upgrades to vb happen often. But of well, At least it is a small change.

Neilll 08-05-2008 02:46 PM

Quote:

Originally Posted by Roxie (Post 1536401)
Yea. Seems to work, you just have to reapply the change after upgrading, which sucks. lol

would be great if this was a plugin


All times are GMT. The time now is 02:00 PM.

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.01323 seconds
  • Memory Usage 1,787KB
  • 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
  • (1)bbcode_php_printable
  • (7)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (32)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