Admin
08-20-2001, 10:00 PM
Description:
This hack will allow you to set the display order of message icons.
Similar to my other hack, ordering of smilies (http://www.vbulletin.com/forum/showthread.php?s=&threadid=25888).
Demo:
http://forum.t-cove.com/order2.gif
Installation:
1. Run the following queries either in phpMyAdmin (http://www.vbulletin.com/forum/showthread.php?threadid=18558) or thru Telnet: (one query at a time)
ALTER TABLE icon ADD showid SMALLINT not null
ALTER TABLE icon ADD INDEX (showid)
UPDATE icon SET showid=iconid
2. In functions.php (in your admin folder) replace
$icons=$DB_site->query("SELECT iconid,iconpath,title FROM icon ORDER BY iconid");
with
$icons=$DB_site->query("SELECT iconid,iconpath,title FROM icon ORDER BY showid");
3. In icon.php (in your admin folder) replace
$icons=$DB_site->query("SELECT iconid,title,iconpath FROM icon ORDER BY title LIMIT ".($limitlower-1).",$perpage");
with
$icons=$DB_site->query("SELECT iconid,title,iconpath FROM icon ORDER BY showid LIMIT ".($limitlower-1).",$perpage");
Below
makelinkcode("remove","icon.php?s=$session[sessionhash]&action=remove&iconid=$icon[iconid]&perpage=$perpage&statrpage=$startpage");
add
echo "<br>Order: <input type=text name=\"order[$icon[iconid]]\" size=5 value=\"$icon[showid]\">";
Replace
echo "</table></td></tr></table></form>";
with
doformfooter("Update order");
Replace
doformheader("icon","modify");
with
doformheader("icon","doorder");
Above
// ###################### Start Modify #######################
add
// ###################### Start do order #####################
if ($HTTP_POST_VARS['action']=="doorder") {
while (list($key,$val)=each($order)) {
$DB_site->query("UPDATE icon SET showid='$val' WHERE iconid='$key'");
}
echo "<p>Order updated!</p>";
$action="modify";
}
Requested by:
theflow
That's it. Feedback, requests and anything else is more than welcome. :)
Good luck! :D
This hack will allow you to set the display order of message icons.
Similar to my other hack, ordering of smilies (http://www.vbulletin.com/forum/showthread.php?s=&threadid=25888).
Demo:
http://forum.t-cove.com/order2.gif
Installation:
1. Run the following queries either in phpMyAdmin (http://www.vbulletin.com/forum/showthread.php?threadid=18558) or thru Telnet: (one query at a time)
ALTER TABLE icon ADD showid SMALLINT not null
ALTER TABLE icon ADD INDEX (showid)
UPDATE icon SET showid=iconid
2. In functions.php (in your admin folder) replace
$icons=$DB_site->query("SELECT iconid,iconpath,title FROM icon ORDER BY iconid");
with
$icons=$DB_site->query("SELECT iconid,iconpath,title FROM icon ORDER BY showid");
3. In icon.php (in your admin folder) replace
$icons=$DB_site->query("SELECT iconid,title,iconpath FROM icon ORDER BY title LIMIT ".($limitlower-1).",$perpage");
with
$icons=$DB_site->query("SELECT iconid,title,iconpath FROM icon ORDER BY showid LIMIT ".($limitlower-1).",$perpage");
Below
makelinkcode("remove","icon.php?s=$session[sessionhash]&action=remove&iconid=$icon[iconid]&perpage=$perpage&statrpage=$startpage");
add
echo "<br>Order: <input type=text name=\"order[$icon[iconid]]\" size=5 value=\"$icon[showid]\">";
Replace
echo "</table></td></tr></table></form>";
with
doformfooter("Update order");
Replace
doformheader("icon","modify");
with
doformheader("icon","doorder");
Above
// ###################### Start Modify #######################
add
// ###################### Start do order #####################
if ($HTTP_POST_VARS['action']=="doorder") {
while (list($key,$val)=each($order)) {
$DB_site->query("UPDATE icon SET showid='$val' WHERE iconid='$key'");
}
echo "<p>Order updated!</p>";
$action="modify";
}
Requested by:
theflow
That's it. Feedback, requests and anything else is more than welcome. :)
Good luck! :D