هل تقصد هذه التعديلات :
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.
Installation:
1. Run the following queries either in phpMyAdmin or thru Telnet: (one query at a time)
كود:
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:
$smilies = $DB_site->query("SELECT title, smilietext, smiliepath FROM smilie");
with
كود PHP:
$smilies = $DB_site->query("SELECT title, smilietext, smiliepath FROM smilie ORDER BY showid");
And also replace
كود PHP:
$smilies=$DB_site->query("SELECT smilietext,smiliepath FROM smilie");
with
كود PHP:
$smilies=$DB_site->query("SELECT smilietext,smiliepath FROM smilie ORDER BY showid");
3. In smilie.php (in your admin folder) replace
كود PHP:
$smilies=$DB_site->query("SELECT smilietext,smilieid,title,smiliepath FROM smilie ORDER BY title LIMIT ".($limitlower-1).",$perpage");
with
كود PHP:
$smilies=$DB_site->query("SELECT smilietext,smilieid,title,smiliepath,showid FROM smilie ORDER BY showid LIMIT ".($limitlower-1).",$perpage");
Below
كود PHP:
echo makelinkcode("remove","smilie.php?s=$session[sessionhash]&action=remove&smilieid=$smilie[smilieid]&perpage=$perpage&statrpage=$startpage");
add
كود PHP:
echo "<br>Order: <input type=text name=\"order[$smilie[smilieid]]\" size=5 value=\"$smilie[showid]\">";
Replace
كود PHP:
echo "</table></td></tr></table></form>";
with
كود PHP:
doformfooter("Update order");
Replace
كود PHP:
doformheader("smilie","modify");
with
كود PHP:
doformheader("smilie","doorder");
Above
كود PHP:
// ###################### Start Modify #######################
add
كود PHP:
// ###################### Start do order #####################
if ($HTTP_POST_VARS['action']=="doorder") {
while (list($key,$val)=each($order)) {
$DB_site->query("UPDATE smilie SET showid='$val' WHERE smilieid='$key'");
}
echo "<p>Order updated!</p>";
$action="modify";
}