| Code:
|
1. <?php
2. if (eregi("block-Forum.php",$PHP_SELF)) {
3. Header("Location: index.php");
4. die();
5. }
6.
7. global $prefix, $dbi, $sitename, $admin, $ThemeSel;
8.
9. $HideViewReadOnly = 1;
10. $Last_New_Topics = 8;
11. $Count_Topics = 0;
12. $Topic_Buffer = "";
13.
14. $result = sql_query( "SELECT topic_id, forum_id, topic_last_post_id, topic_title, topic_poster, topic_views, topic_replies, topic_moved_id FROM ".$prefix."_bbtopics ORDER BY topic_last_post_id DESC", $dbi );
15. while( list( $topic_id, $forum_id, $topic_last_post_id, $topic_title, $topic_poster, $topic_views, $topic_replies, $topic_moved_id ) = sql_fetch_row( $result, $dbi ) )
16.
17. {
18. $skip_display = 0;
19. if( $HideViewReadOnly == 1 )
20. {
21. $result1 = sql_query( "SELECT auth_view, auth_read FROM ".$prefix."_bbforums where forum_id = '$forum_id'", $dbi );
22. list( $auth_view, $auth_read ) = sql_fetch_row( $result1, $dbi );
23. if( ( $auth_view != 0 ) or ( $auth_read != 0 ) ) { $skip_display = 1; }
24. }
25.
26. if( $topic_moved_id != 0 )
27. {
28. // Shadow Topic !!
29. $skip_display = 1;
30. }
31.
32. if( $skip_display == 0 )
33. {
34. $Count_Topics += 1;
35.
36. $result2 = sql_query("SELECT username, user_id FROM ".$prefix."_users where user_id='$topic_poster'", $dbi);
37. list($username, $user_id)=sql_fetch_row($result2, $dbi);
38. $avtor=$username;
39. $sifra=$user_id;
40.
41. $result3 = sql_query("SELECT poster_id, FROM_UNIXTIME(post_time,'%d/%m/%Y om %H:%i') as post_time FROM ".$prefix."_bbposts where post_id='$topic_last_post_id'", $dbi);
42. list($poster_id, $post_time)=sql_fetch_row($result3, $dbi);
43.
44. $result4 = sql_query("SELECT username, user_id FROM ".$prefix."_users where user_id='$poster_id'", $dbi);
45. list($username, $user_id)=sql_fetch_row($result4, $dbi);
46.
47. $viewlast .=" <tr>
48. <td height="34" nowrap bgcolor="#272727" class="row1"><img src="themes/$ThemeSel/forums/images/folder_new.gif" border="0" /></td>
49. <td width="100%" bgcolor="#272727" class="row1"> <a href="modules.php?name=Forums&file=viewtopic&t=$topic_id#$topic_last_post_id">$topic_title</a></td>
50. <td align="center" bgcolor="#303030" class="row2">$topic_replies</td>
51. <td align="center" bgcolor="#414141" class="row3"><a href="forum-userprofile-.html$sifra">$avtor</a></td>
52. <td align="center" bgcolor="#303030" class="row2">$topic_views</td>
53. <td align="center" nowrap bgcolor="#414141" class="row3"><font size="-2"><i> $post_time </i></font><br>
54. <a href="forum-userprofile-.html$user_id">$username</a> <a href="modules.php?name=Forums&file=viewtopic&p=$topic_last_post_id#$topic_last_post_id"><img src="themes/$ThemeSel/forums/images/icon_latest_reply.gif" border="0"></a></td>
55. </tr>";
56. }
57.
58. if( $Last_New_Topics == $Count_Topics ) { break 1; }
59.
60. }
61.
62. $content .= "<table width="100%" border="0" cellspacing="1" cellpadding="0">
63. <tr>
64. <td><table width="100%" border="0" cellspacing="1" cellpadding="0">
65. <tr>
66. <td bgcolor="#010101"><table width="100%" border="0" cellpadding="2" cellspacing="1">
67. <tr>
68. <th height="28" colspan="2" align="center" nowrap background="themes/$ThemeSel/forums/$ThemeSel/images/cellpic3.gif" class="thcornerl"><font class="block-title"><strong>Topics</strong></font></th>
69. <th width="50" align="center" nowrap background="themes/$ThemeSel/forums/$ThemeSel/images/cellpic3.gif" class="thtop"><font class="block-title"><strong> Answers </strong></font></th>
70. <th width="100" align="center" nowrap background="themes/$ThemeSel/forums/$ThemeSel/images/cellpic3.gif" class="thtop"><font class="block-title"><strong> Author </strong></font></th>
71. <th width="50" align="center" nowrap background="themes/$ThemeSel/forums/$ThemeSel/images/cellpic3.gif" class="thtop"><font class="block-title"><strong> Views </strong></font></th>
72. <th align="center" nowrap background="themes/$ThemeSel/forums/images/cellpic3.gif" class="thcornerr"><font class="block-title"><strong> Last Post </strong></font></th>
73. </tr>";
74. $content .= "$viewlast";
75.
76. $content .=" <tr>
77. <td height="12" colspan="6" class="catbottom"></td>
78. </tr>
79. </table></td>
80. </tr>
81. </table></td>
82. </tr>
83. </table>";
84.
85. ?>
|