Version: , by Admin (Coder)
Developer Last Online: Nov 2024
Version: 2.2.x
Rating:
Released: 08-19-2001
Last Update: Never
Installs: 75
No support by the author.
Description:
This hack will allow you to set the display order of clickable smilies (if you use them).
It's good if you have a lot of smilies, and want the more commonly used to be shown in the box.
Demo:
Installation: 1. Run the following queries either in phpMyAdmin or thru Telnet: (one query at a time)
Code:
ALTER TABLE smilie ADD showid SMALLINT not null
ALTER TABLE smilie ADD INDEX (showid)
UPDATE smilie SET showid=smilieid
2. In functions.php (in your admin folder) replace
PHP Code:
$smilies = $DB_site->query("SELECT title, smilietext, smiliepath FROM smilie");
with
PHP Code:
$smilies = $DB_site->query("SELECT title, smilietext, smiliepath FROM smilie ORDER BY showid");
And also replace
PHP Code:
$smilies=$DB_site->query("SELECT smilietext,smiliepath FROM smilie");
with
PHP Code:
$smilies=$DB_site->query("SELECT smilietext,smiliepath FROM smilie ORDER BY showid");
3. In smilie.php (in your admin folder) replace
PHP Code:
$smilies=$DB_site->query("SELECT smilietext,smilieid,title,smiliepath FROM smilie ORDER BY title LIMIT ".($limitlower-1).",$perpage");
with
PHP Code:
$smilies=$DB_site->query("SELECT smilietext,smilieid,title,smiliepath,showid FROM smilie ORDER BY showid LIMIT ".($limitlower-1).",$perpage");
I just re-did this hack as I upgraded to 2.3.2 and it is working fine.
Attached is my version of it, which really only has a couple minor changes. If anybody wants to try it, go for it, and let me know if it works for you.
Futureal, thanks for providing the attachment. It appears my install went fine this time but when I try to update the order of the smilies it doesn't seem to work. Any ideas?
Does it give you any sort of an error message or anything?
I just double-checked on mine and it works, using those same instructions. Try replacing your admin/smilie.php with a 100% fresh copy and make those same changes. Pay close attention to which lines are getting modified; there are a number of similar lines in there for the different actions.
Does it give you any sort of an error message or anything?
Nah, after re-numbering all the smilies I click on the 'update' button but it doesn't appear to have any effect. It just refreshes the page and returns the same smilie order as when I started. In other words no changes are saved. But thanks for your help anyway futureal. With 100+ smilies now I'd like to keep them organised so I'll do what you suggest and try it again and see how it goes. Any chance you could send me your copy of the smilies.php as a fallback?
Technically we're not allowed to send out vB source files, modified or otherwise. The only modifications I've made to it, though, are those I detailed in the text file. So once those are made, your file should be identical to mine.
It sounds like a step is being missed somewhere, so that when you click the update button, no query is being performed. Just a guess, though.
Futureal, thanks for posting the update to get this working in 2.32. I had installed the previous version and was able to update the order by manually changing the orderid in the database, but had not been able to get the interface to work in the Admin panel. I hadn't had a chance to look at it myself, and since I don't really need to reorganize the smilies very often, didn't feel very inclined to put much more effort into it since I'd already ordered them to my liking in my database. Then I just happened to buzz by here and saw that you'd redone it, so I tried again. Thank you so much!
All worked well till I added more smiles thus a click for more link appears and when clicked an error page not found pops up... Its marked php but I run php3 where can I change the java script to read php3 instead of php?
THANKS in advance