Witam!
Przerobiłem sobie panel z nazwy tematu, ale brakuje mi jeszcze jednej opcji, a mianowicie chodzi o przenoszenie do ostatniego postu w temacie. Nie wiem jak to wykonać. Pomoże ktoś?
Kod:
<?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2008 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: forum_threads_panel.php
| Author: Nick Jones (Digitanium)
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at http://www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
if (!defined("IN_FUSION")) { die("Access Denied"); }
openside2('Ostatnio na forum');
$result = dbquery("
SELECT tt.forum_id, tt.thread_id, tt.thread_lastuser, tt.thread_subject, tt.thread_lastpost, tt.thread_postcount FROM ".DB_THREADS." tt
INNER JOIN ".DB_FORUMS." tf ON tt.forum_id=tf.forum_id
WHERE ".groupaccess('forum_access')." ORDER BY thread_lastpost DESC LIMIT 5
");
if (dbrows($result)) {
while($data = dbarray($result)) {
$itemsubject = trimlink($data['thread_subject'], 23);
echo "<center><table cellspacing='0' cellpadding='0' border='0'>";
echo "<tr>";
echo "<td style='text-align: left; width: 250px;'><a href='".FORUM."viewthread.php?thread_id=".$data['thread_id']."' title='".$data['thread_subject']."' class='side'>$itemsubject</a></td>";
$res = dbquery("SELECT user_name, user_id FROM ".DB_USERS." WHERE user_id='".$data['thread_lastuser']."'");
if (dbrows($res)) {
if ($da = dbarray($res)) {
echo "<td style='text-align: right; width: 100px;'><span style='color: #887c6c;'>".$da['user_name']." |";
}
}
echo " ".$data['thread_postcount']."</span></td>";
echo "</tr>";
echo "</table>";
echo "<img src='".THEME."images/kress.png' border='0'><p>";
echo "</center>";
}
} else {
echo "<div style='text-align:center'>".$locale['global_023']."</div>\n";
}
closeside2();
?>
|