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");
Sorry to bring this back to the top, but I am in the middle of doing this. The queries were all successful. In phpMyadmin however, I don't have a folder "functions.php" I have the other ones but not that one.......
I guess I'm the only one to notice this...(I don't know how the other peeps installed...) but you have a type there..should be $perpage&startpage=$startpage") right?
I couldn't find that line so i looked at it a little more closely...what i don't get is how everyone else installed it O_O...
I go this erro when I did my query?
Error
SQL-query:
ALTER TABLE smilie ADD showid SMALLINT not null
ALTER TABLE smilie ADD INDEX (showid)
UPDATE smilie SET showid=smilieid
MySQL said: You have an error in your SQL syntax near 'ALTER TABLE smilie ADD INDEX (showid) UPDATE smilie SET showid=smilieid' at line 2
My queries worked and all that, but I got that header error that a couple other people posted earlier in the thread. I couldn't figure it out, I even went to check the white spaces behind ?> like Firefly said as that could help in the config.php, but that did nothing either. I ultimately reverted back to my backup copies of my files, because I couldn't get the hack working. Any help on fixing those header errors would be appreciated. Thanks!
Originally posted by amsch I go this erro when I did my query?
Error
SQL-query:
ALTER TABLE smilie ADD showid SMALLINT not null
ALTER TABLE smilie ADD INDEX (showid)
UPDATE smilie SET showid=smilieid
MySQL said: You have an error in your SQL syntax near 'ALTER TABLE smilie ADD INDEX (showid) UPDATE smilie SET showid=smilieid' at line 2
They are each different queries.
Run ALTER TABLE smilie ADD showid SMALLINT not null
no...You can run them through phpMyAdmin and there doesn't need to be ';' at the end...I don't know about other ways cuz I've only ran queries with phpMyAdmin.