سلام
راستش سرچ زدم چیزی پیدا نکردم..
من میخواستم توی انجمن یک قسمتی رو اضافه کنم که داخل اون لیستی از اخرین پستهای یک تایپیک خاص رو نشون بده..یه چیزی شبیه اون لیست اخرین ارسالها هستا که از توی دیتابیس سرچ میزد ارسالها رو..من این بار میخوام پستهای اخر یک تایپیک رو بگیرم..
راستش اون فایل اخرین ارسالها رو نگاه کردم یه چیزهایی گرفتم..بخش مهمش این قسمته گویا
کد PHP:
//thread table sql query
$thread_sql_query = mysql_query("SELECT threadid,title,lastpost,lastposter,forumid,postusername,lastpostid FROM " . $table_prefix . "thread WHERE visible=1 AND open=1 $sforumid $iforumida $iforumidb $iforumidc $iforumidd $iforumide $iforumidf $iforumidg $iforumidh ORDER BY lastpost DESC $lastpost_limited");
while($thread_get_info = mysql_fetch_array($thread_sql_query))
{
$lastpost = $thread_get_info['lastpost'];
$lastposter = $thread_get_info['lastposter'];
$threadid = $thread_get_info['threadid'];
$forumid = $thread_get_info['forumid'];
$postusername = $thread_get_info['postusername'];
$lastpostid = $thread_get_info['lastpostid'];
$date = date ("m/d/y h:i A" ,$lastpost);
$threadtitle = $thread_get_info['title'];
$threadtitle = substr($threadtitle,0,$title_limit);
//forum table sql query
$forum_sql = mysql_query("SELECT title FROM " . $table_prefix . "forum WHERE forumid=$forumid");
$forum_get = mysql_fetch_array($forum_sql);
$forumtitle = $forum_get['title'];
//post table sql query
$post_sql = mysql_query("SELECT title,postid FROM " . $table_prefix . "post WHERE postid=$lastpostid");
$post_get = mysql_fetch_array($post_sql);
$lastposterid = $post_get['postid'];
$lastposttitle = $post_get['title'];
if (empty($lastposttitle)) {
$lastposttitle = ("پاسخ: $threadtitle");
}
$lastposttitle = substr($lastposttitle,0,$title_limit);
echo "<tr dir=\"rtl\"><td dir=\"rtl\"><font size=\"2\" face=\"utf-8\"><a target=_blank href=\"$forum_path/showthread.php?p=$lastposterid#post$lastposterid\"><FONT SIZE=\"4\" COLOR=\"$title_color\" face=\"tahoma\">$threadtitle</FONT></a></font><br> <font color=\"$text_color\" face=\"tahoma\" size='2'>نویسنده : $lastposter | انجمن : $forumtitle | شروع کننده موضوع: $postusername</FONT></td></tr>";
}
میخواستم ببینم این ادرس دهی برای کوئری گرفتن از دیتابیس رو چطوری باید بدم؟کسی در این رابطه تجربه ای داره؟و این که پستهای هر انجمن در ساختار دیتابیس کدوم قسمتشه..
اصلا امکان پذیر هست این کار؟
پیشاپیش ممنون از توجهتون
علاقه مندی ها (Bookmarks)