![]() |
Показаны 5 сообщений на этой странице |
Форум сетевых администраторов (http://netadmin.ws/forum/index.php)
- VBulletin 2.x.x (http://netadmin.ws/forum/forumdisplay.php?forumid=45)
-- время последнего поста + несколько вопросов (http://netadmin.ws/forum/showthread.php?threadid=7477)
время последнего поста + несколько вопросов
Первый вопрос.
последние 10 новых топиков
quote:
<strong>Последние 10 тем на форуме.</strong><br>
<?
error_reporting(0);
include("forum/admin/config.php");
$connection = mysql_connect("$servername","$dbusername","$dbpassword") or die ("Cannot connect to server.");
$db = mysql_select_db("$dbname", $connection) or die ("Could not select database.");
// $sql = "SELECT title, threadid, replycount, postusername, lastposter from thread order by lastpost desc limit 10";
$sql = "SELECT title, threadid, lastposter from thread WHERE thread.forumid NOT IN(16, 25) order by lastpost desc limit 10";
$sql_result = mysql_query($sql, $connection) or die ("Could not execute query.");
if (!$sql_result) {
echo "<p>Could not get record.";
}
while ($row = mysql_fetch_array($sql_result)) {
$threadid = $row["threadid"];
$thetitle = $row["title"];
$replycount = $row["replycount"];
$postusername = $row["postusername"];
$postuserid = $row["postuserid"];
$lastposter = $row["lastposter"];
// echo ">> <a href=\"forum/showthread.php?s=&threadid=$threadid&goto=newpost\"><b>$thetitle</b></a> -$lastposter [$replycount]<br>";
echo "<li> <a href=\"forum/showthread.php?s=&threadid=$threadid&goto=newpost\" class=second><b>$thetitle</b></a><br>";
}
mysql_free_result($sql_result);
mysql_close($connection);
?>
__________________
cmukraine.org.ua.forum - футбол - игра или жизнь?
Гм.. никто не знает или просто игнорируют вопросы ? 
__________________
cmukraine.org.ua.forum - футбол - игра или жизнь?
bigfoot
строчку
echo "<li> <a href=\"forum/showthread.php?s=&threadid=$threadid&goto=newpost\" class=second><b>$thetitle</b></a><br>";
меняешь на
$row['lastpostdate']=vbdate($dateformat,$row['last
post']);
$row['lastposttime']=vbdate($timeformat,$row['last
post']);
echo "<li> <a href=\"forum/showthread.php?s=&threadid=$threadid&goto=newpost\" class=second><b>$thetitle</b></a>($row[lastpostdate] $row[lastposttime])<br>";
__________________
Форум 3DNews
1. Не работает, выдает просто пустую страницу вместо "последних постов".
3. Ð_аботает, спасибо
"мдя" - ты конечно зря так, не все ж умные такие 
__________________
cmukraine.org.ua.forum - футбол - игра или жизнь?
bigfoot
после первого include добавь еще include("forum/admin/functions.php");
а в запросе select ля-ля-ля from напиши select * from
__________________
Форум 3DNews
| Формат времени GMT. Текущее время 04:38. | Показаны 5 сообщений на этой странице |
Powered by: vBulletin Version 2.2.4
Copyright © Jelsoft Enterprises Limited 2000, 2001.