Edgein |
25th August 2010 10:56 |
Add in index where you want
PHP Code:
///////////////////////////////////////////////// LAST X FORUM POSTS
print("<table id=torrenttable border=1 cellspacing=0 cellpadding=5><tr>". "<td class=tabletitle align=left>Topic Title</td>". "<td class=tabletitle align=left>Posts</td>". "<td class=tabletitle align=left>Views</td>". "<td class=tabletitle align=left>Author</td>". "<td class=tabletitle align=left>Last Post</td>". "</tr>");
$res = mysql_query("SELECT posts.id AS pid, posts.topicid, posts.userid AS userpost, posts.added, topics.id AS tid, topics.userid AS usertopic, topics.subject, topics.forumid, topics.lastpost, topics.views, forums.name, forums.minclassread, forums.postcount, users.username, topicposter.username AS tusername FROM posts, topics, forums, users, users AS topicposter WHERE posts.topicid = topics.id AND topics.forumid = forums.id AND posts.userid = users.id AND topics.userid = topicposter.id AND minclassread <=" . $CURUSER["class"] . " ORDER BY posts.added DESC LIMIT 5");
while ($postsx = mysql_fetch_assoc($res)) { print("<tr><td><a href=\"forums.php?action=viewtopic&topicid={$postsx["tid"]}&page=p{$postsx["pid"]}#{$postsx["pid"]}\"><b>{$postsx["subject"]}</b></a>in <a href=\"forums.php?action=viewforum&forumid={$postsx["forumid"]}\">{$postsx["name"]}</a></td>". "<td align='right'>{$postsx["postcount"]}</td>". "<td align='right'>{$postsx["views"]}</td>". "<td><a href=userdetails.php?id={$postsx["usertopic"]}><b>{$postsx["tusername"]}</b></a></td>". "<td>{$postsx["added"]}by <a href=userdetails.php?id={$postsx["userpost"]}><b>{$postsx["username"]}</b></a></td></tr>"); } print("</table>"); ///////////////////////////////////////////////// END LAST X FORUM POSTS
|