Recent Post [block]

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   Recent Post [block]
SidewinderX
CZ Super Newbie
SidewinderX has been a member for over 20 year's 20 Year Member
Status: Offline
Joined: Aug 06, 2004
0.01 posts per day
Posts: 39
Points: 1,333
   
hello i have a recent post block i downloaded... i was wondering how to make it show the recent posts in the the registered users only forums since i have the block so only registered users can see it it dosnt make a difference if they are being showed or not..here is the code

<?php
if (eregi("block-Recent_Post.php",$PHP_SELF)) {
    Header("Location: index.php");
    die();
}
global $prefix, $dbi, $sitename, $admin;
$HideViewReadOnly = 1;
$Last_New_Topics  = 10;
$show = "  <tr>
    <td height=\"28\" colspan=\"6\" align=\"center\" class=\"catbottom\" background=\"http://www.oadsquad.com/oad/images/recent_post/cellpic3.gif\"> ;;</td>
  </tr>
</table></td>
        </tr>
      </table></td>
  </tr>
</table>";
$Count_Topics = 0;
$Topic_Buffer = "";
$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 );
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 ) )

{
   $skip_display = 0;
   if( $HideViewReadOnly == 1 )
   {
      $result1 = sql_query( "SELECT auth_view, auth_read FROM ".$prefix."_bbforums where forum_id = '$forum_id'", $dbi );
      list( $auth_view, $auth_read ) = sql_fetch_row( $result1, $dbi );
      if( ( $auth_view != 0 ) or ( $auth_read != 0 ) ) { $skip_display = 1; }
   }

   if( $topic_moved_id != 0 )
   {
     // Shadow Topic !!
      $skip_display = 1;
   }
   
   if( $skip_display == 0 )
   {
     $Count_Topics += 1;

$result2 = sql_query("SELECT username, user_id FROM ".$prefix."_users where user_id='$topic_poster'", $dbi);
list($username, $user_id)=sql_fetch_row($result2, $dbi);
$avtor=$username;
$sifra=$user_id;

$result3 = sql_query("SELECT poster_id, FROM_UNIXTIME(post_time,'%m/%d/%Y at %H:%i') as post_time FROM ".$prefix."_bbposts where post_id='$topic_last_post_id'", $dbi);
list($poster_id, $post_time)=sql_fetch_row($result3, $dbi);

$result4 = sql_query("SELECT username, user_id FROM ".$prefix."_users where user_id='$poster_id'", $dbi);
list($username, $user_id)=sql_fetch_row($result4, $dbi);

                         $viewlast .="  <tr>
    <td height=\"30\" nowrap bgcolor=\"#2A2A2A\" class=\"row1\"><img src=\"http://www.oadsquad.com/oad/images/recent_post/folder_new.gif\" border=\"0\" /></td>
    <td width=\"100%\" bgcolor=\"#2A2A2A\" class=\"row1\"> ;;<a href=\"modules.php?name=Forums&file=viewtopic&t=$topic_id#$topic_last_post_id\">$topic_title</a></td>
    <td align=\"center\" bgcolor=\"#363636\" class=\"row2\">$topic_replies</td>
    <td align=\"center\" bgcolor=\"#2A2A2A\" class=\"row3\"><a href=\"forum-userprofile-.html$sifra\">$avtor</a></td>
    <td align=\"center\" bgcolor=\"#363636\" class=\"row2\">$topic_views</td>
    <td align=\"center\" nowrap bgcolor=\"#363636\" class=\"row3\"><font size=\"-2\"><i> ;; ;;$post_time ;;</i></font><br>
      <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=\"http://www.oadsquad.com/oad/images/recent_post/icon_minipost_new.gif\" border=\"0\"></a></td>
  </tr>";
}
   
   if( $Last_New_Topics == $Count_Topics ) { break 1; }
   
}

    $content .= "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"1\">
  <tr>
    <td><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
        <tr>
          <td  bgcolor=\"#000000\"><table width=\"100%\" border=\"0\" cellpadding=\"1\" cellspacing=\"1\">

  <tr>
    <th height=\"25\" colspan=\"2\" align=\"center\" nowrap background=\"http://www.oadsquad.com/oad/images/recent_post/cellpic3.gif\" class=\"thcornerl\"><font color=\"#DCDCDC\"><strong>Topics</strong></font></th>
    <th width=\"50\" align=\"center\" nowrap background=\"http://www.oadsquad.com/oad/images/recent_post/cellpic3.gif\" class=\"thtop\"><font color=\"#DCDCDC\"><strong> ;;Replies ;;</strong></font></th>
    <th width=\"100\" align=\"center\" nowrap background=\"http://www.oadsquad.com/oad/images/recent_post/cellpic3.gif\" class=\"thtop\"><font color=\"#DCDCDC\"><strong> ;;Author ;;</strong></font></th>
    <th width=\"50\" align=\"center\" nowrap background=\"http://www.oadsquad.com/oad/images/recent_post/cellpic3.gif\" class=\"thtop\"><font color=\"#DCDCDC\"><strong> ;;Views ;;</strong></font></th>
    <th align=\"center\" nowrap background=\"http://www.oadsquad.com/oad/images/recent_post/cellpic3.gif\" class=\"thcornerr\"><font color=\"#DCDCDC\"><strong> ;;Last Post ;;</strong></font></th>
  </tr>";
$content .= "$viewlast";
$content .= "$show";

?>



Back to top Reply with quote
#2   re: Recent Post [block]
SidewinderX
CZ Super Newbie
SidewinderX has been a member for over 20 year's 20 Year Member
Status: Offline
Joined: Aug 06, 2004
0.01 posts per day
Posts: 39
Points: 1,333
   
anyone??



Back to top Reply with quote
#3   
Telli
Site Admin
Occupation: Self Employed
Age: 46
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.03 posts per day
Posts: 8089
Points: 494,475
   
Not sure of the forum_id but I would get that and add it into the query:


WHERE forum_id ='3'




_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum