View Full Version : Random Smilies in box on New Thread/Reply
JTMON
01-15-2002, 10:00 PM
Ok first, 100% of the credit for this goes to FireFly aka Chen:D
I had requested this and he answered. I have tested this on 2.2.0 through 2.2.5 and with vbPortal and it has worked great. This was my original question:
Here's one that I'm not even sure how easy/hard it is. One of my members wanted to have it so when you click to reply to a thread, the smilies box on the left will have random ones from your total collection so that they would be encouraged to use different smilies and not have to click the get more button. I would love this hack as increasing the number of smilies in that box breaks my table border so I had to only allow 18 smilies in that box vs. 30
I posted this here so I could have it on my install list and for anyone else wanting this.
The file you edit is admin/functions.php
Replace:
if ($smtotal > 0) {
$smilies = $DB_site->query("SELECT title, smilietext, smiliepath FROM smilie");
With this:
if ($smtotal > 0) {
$smilies = $DB_site->query("SELECT title, smilietext, smiliepath FROM smilie ORDER BY RAND()");
Once again, my thanks to FireFly and all the Hackers!
Martz
01-16-2002, 08:40 AM
Great little hack, a lot out for not much in. Just how I like it. :)
fonzerelli_79
01-16-2002, 12:30 PM
works great
definately reccomend this hack to other members
cheers JTMON (and of course firefly)
Parse error: parse error in /home/simpson/public_html/admin/functions.php on line 810
Fatal error: Call to undefined function: vbdate() in /home/simpson/public_html/admin/sessions.php on line 357
Awww. :( I changed the line of code in my admin/functions.php and this is what happens when I try to bring up the board. ^
JTMON
01-16-2002, 12:51 PM
Make sure there are no extra spaces and that it is exactly like above. I can't see this causing issues any other way since it's so simple but then again, I'm no php guru like FireFly:D Line 810 is way before this addition.
Admin
01-16-2002, 01:11 PM
Thanks for posting this for me JTMON. :)
JTMON
01-16-2002, 01:23 PM
You should repost it so it doesn't say I released it:p
I had to rehack everything because I put vbPortal, upgraded to 2.2.1, changed to php vs. php3 and moved my forums into a forums subfolder all in one upgrade! Worked though, but this one wasn't on my install list:D
Bald Bouncer
01-16-2002, 01:29 PM
Thanks for that, Great idea and works really well.
fonzerelli_79
01-16-2002, 01:33 PM
Originally posted by JTMON
You should repost it so it doesn't say I released it:p
or repost it to say that i released it - lol :pleased:
JTMON
01-16-2002, 01:43 PM
Hey buddy,
Your claim to fame comes from assaulting innocent soda machines to get free drinks :pleased:
fonzerelli_79
01-16-2002, 01:49 PM
Originally posted by JTMON
Hey buddy,
Your claim to fame comes from assaulting innocent soda machines to get free drinks :pleased:
oh, my secret shame - who told you!! :confused:
Arathorn
01-17-2002, 11:34 AM
Would it be difficult to a 2nd smiley box? i.e. leave the current one for often used smilies, and have another one for random smilies.
fonzerelli_79
01-17-2002, 12:24 PM
good idea
DarkReaper
01-17-2002, 07:49 PM
It'd be nice to be able to weigh the smilies as well. Some smilies would have a greater chance of coming up than others. This would allow some to always be there, and others to never be there...very useful if you have irregularly sized smilies :)
NYI Fan
01-27-2002, 06:39 PM
Thanks
quick and easy, as always, and soemthing my users asked for more than a few times!
The idea about giving the smilies weight is great! Kind of give them higher rank for X number of uses....
fonzerelli_79
01-27-2002, 06:54 PM
Originally posted by DarkReaper
It'd be nice to be able to weigh the smilies as well. Some smilies would have a greater chance of coming up than others. This would allow some to always be there, and others to never be there...very useful if you have irregularly sized smilies :)
id agree with this
Snake~eyes
01-30-2002, 11:32 PM
this hack looks very cool
I was wondering if there'd be a way to maybe insert an if statement so it would just use 15x15pixel smiles for this. Because if i use some of my bigger ones it'd mess up the tables.
help appreciated.
thx
tanster
02-17-2002, 06:48 PM
I love this, and it was sooo easy!
Thank you!
:) Jennie
Massiel
02-20-2002, 08:51 PM
I have one question Firefly, does it work with 2.2.2? Please let me know! I have lots of smilies showing out of like 100 LOL, so this would be a great hack to add on my site.
Massiel
02-21-2002, 07:54 AM
Anyone know??
Admin
02-21-2002, 10:07 AM
Yes.
Mental Stamina
04-24-2002, 03:55 PM
i have the same error Rose posted
Mental Stamina
04-24-2002, 04:49 PM
i removed the code addition from the page
and i still get
Parse error: parse error in /home/lyricoly/public_html/boards/admin/functions.php on line 811
Fatal error: Call to undefined function: vbsetcookie() in /home/lyricoly/public_html/boards/admin/sessions.php on line 181
immediate help needed
thanx
FleaBag
05-18-2002, 02:15 PM
Very simple and very effective! Installed on 2.2.5. Encourages my users to use a range of smilies!
DelusionalMind
05-21-2002, 04:54 AM
Originally posted by GamerForums
Very simple and very effective! Installed on 2.2.5. Encourages my users to use a range of smilies!
i installed this on 2.2.5 also and it doesn't work. I get a databse error. What gives?? And this has happened for a few hacks now....is 2.2.5 just so incampatible with hacks?? :(
Admin
05-21-2002, 09:05 AM
What's the database error, Delusional?
JTMON
05-21-2002, 01:22 PM
Originally posted by DelusionalMind
i installed this on 2.2.5 also and it doesn't work. I get a databse error. What gives?? And this has happened for a few hacks now....is 2.2.5 just so incampatible with hacks?? :(
yes what is the error as I have it working on 2.2.5 and actually just updated the first post in this thread cause I tested/used it on 2.2.0-2.2.5 with no problems so far and I also have other hacks
DelusionalMind
05-22-2002, 01:23 AM
Database error in vBulletin 2.2.5:
Invalid SQL: SELECT title, smilietext, smiliepath FROM smilie ORDER BY rand()
mysql error: You have an error in your SQL syntax near 'rand()' at line 1
mysql error number: 1064
that's the error...i double clicked on your code box and put it directly in...this even happened after a clean install...
DelusionalMind
05-24-2002, 07:07 AM
^bump^
can anyone help? :(
FleaBag
06-20-2002, 09:26 AM
Working on 2.2.6, thanks! :)
Schorsch
08-21-2002, 03:08 AM
cool and funny hack, thanks :) :banana:
Donkeyballz
08-21-2002, 05:49 AM
A little but great hack :D Thx m8
slider
08-22-2002, 11:46 PM
I made this change to my 2.2.6 board and got a weird problem with the default [url] vbCode. It caused a portion of the code to change to this:
return "<a href=../../../upload/admin//%22$righturl/%22 target=\"_blank\">".str_replace('\"', '"', $hyperlink)."</a>";
When it should be this:
return "<a href=\"$righturl\" target=\"_blank\">".str_replace('\"', '"', $hyperlink)."</a>";
It caused all default links to no longer work. It was probably something hokey Dreamweaver did on me, but I thought it was worth mentioning. I fixed the problem code using the original file and now it's working with the hack in place.
FleaBag
09-03-2002, 02:43 PM
Works with 2.2.7... Thank you. ;)
I have like 500+ smilies (yeah I know, I know) and some are just STOOPID sizes and whatnot.. would there be anyway to have it just randomize certain smilies and exclude others?
im got fireflys (my hero) smilie order edit installed, and I just number like the MAIN smilies 0 (so they show up first) then the semi-good ones 1 (so they show up next) then the rest are numebred 2.. so would there be a way to randomize the smilies in the 0 or just 1, or just 2 group?
or am I asking for too much? :D
-myles
okay each of my smiles have a showid, so how would I edit this to only show smilies with showid 1?
if ($smtotal > 0) {
$smilies = $DB_site->query("SELECT title, smilietext, smiliepath FROM smilie ORDER BY RAND()");
thx guys!
FleaBag
10-29-2002, 08:21 PM
Working with 2.2.8. Small, but possibly one of my favourite hacks! :D
banjolawyer
11-23-2002, 06:05 PM
Very easy and useful. Thanks.
Host Directory
02-10-2003, 09:37 PM
I have been looking for a hack which does not seem to exist, this is kind of on the same lines so i am hoping you might be interested in this hack.
New area in admin panel.
Allows you to set the smilies in Posts to be displayed ramdomly or pick the ones you wish from your smilies list to display in the New Post area.
Also allows option to display smilies in Get More as ramdom but also allows you to select how many smilies should appear in Get More before splitting the page.
For example if you have 400 smilies and you set the number to split at 50. The result would be 8 seperate pages with the smilies on.
This is much better - i have lots of smilies and they all display on one page. Many of the smilies i have are animated and the server cannot cope with so many on one page. I think a lot of people have this problem. The result is many of the smilies do not show as a graphic.
You can see what a mess this is if you go to my new forum and click on the Get More smilies option,
http://www.hostcompanies.com/forums
This would be a good hack to make.
monstergamer
02-18-2003, 03:55 PM
i like this hack :)
Jethro
03-02-2003, 03:50 AM
Well after wiping the sweat from my brow, praying to the gods it wouldn't explode ... l installed it :) No problems, except now l have members +++++ing about the screen resizing, guess we have the same problem with varied sized smilies others are reporting. Nice and easy though.
mwhoob
04-23-2003, 01:12 PM
can see screen shot
Gary King
04-24-2003, 08:38 PM
Yesterday at 09:12 AM mwhoob said this in Post #42 (https://vborg.vbsupport.ru/showthread.php?postid=385925#post385925)
can see screen shot
A screenshot is not needed, because it doesn't look any different, besides the fact that instead of the smilies always being in the same positions, they rotate randomly, so there will always be a different smilie in the same spot.
10-08-02 at 10:08 PM snyx said this in Post #35 (https://vborg.vbsupport.ru/showthread.php?postid=307720#post307720)
I have like 500+ smilies (yeah I know, I know) and some are just STOOPID sizes and whatnot.. would there be anyway to have it just randomize certain smilies and exclude others?
I have the same situation here and would love it if someone made that possible.
Salazar
06-13-2003, 03:12 PM
Nice hack. :)
* Salazar clicks install
Session
06-13-2003, 03:26 PM
/me clicks install!
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.