Nukemods Forum  
» Log in
User Name:

Password:

Not a member yet?
Register Now!
» Online Users: 69
6 members and 63 guests
batckhroom9qclr, climckckwd8here, got2wpoap2gt9si, nhghgfdumaq4pst, shaqi5kerqlqbot, whyjjinternetvi
Most users ever online was 611, 03-21-2008 at 10:10 PM.
» .::.
» .:.

Go Back   Nukemods Forum > General > Open topics

Reply
 
LinkBack Thread Tools Display Modes
A new type of forum new.. Help?
Old
  (#1 (permalink))
Junior Member
 
Status: Offline
Posts: 14
Join Date: May 2003
A new type of forum new.. Help? - 05-25-2003, 10:29 PM

I have a question.. Im a php noob so this seems simple to me I was wondering if you could help me.

I have this forums block that pulls the 5 most recent posts from my db, And i was wondering if it would be possable to just pull topics from one forum catagory, say a News catagory.

This is the code
Code:
<?php

########################################################################
# PHP-Nuke Block: fiblack3d Center Forum Block v.1.0 				   #
# Made for PHP-Nuke 6.5  ONLY. 										   #
#																	   #
# Made by coldblooded http://www.nukemods.com                          #
# This block is made only to match the fiblack3d Theme pack            #
########################################################################
# This program is free software. You can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation; either version 2 of the License.       # 
# If you modify this, let me know for fun. =)                          #
########################################################################  

if (eregi("block-fiblack3d-Forum.php",$PHP_SELF)) {
    Header("Location: index.php");
    die();
}
	
global $prefix, $dbi, $sitename, $admin;

$HideViewReadOnly = 1;
    		
$Last_New_Topics  = 5;
$show = "  <tr> 
    <td height=\"28\" colspan=\"6\" align=\"center\" class=\"cat\">&</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 align=\"center\" height=\"30\" width=\"35\" nowrap class=\"row1\"><img src=\"themes/fiblack3d/forums/images/folder_new.gif\" border=\"0\" /></td>
    <td width=\"100%\" class=\"row1\">&<a href=\"modules.php?name=Forums&file=viewtopic&t=$topic_id#$topic_last_post_id\">$topic_title</a></td>
    <td align=\"center\" class=\"row2\">$topic_replies</td>
    <td align=\"center\" class=\"row3\"><a href=\"modules.php?name=Forums&file=profile&mode=viewprofile&u=$sifra\">$avtor</a></td>
    <td align=\"center\" class=\"row2\">$topic_views</td>
    <td align=\"center\" nowrap class=\"row3\"><font size=\"-2\">&&$post_time&</font>

      <a href=\"modules.php?name=Forums&file=profile&mode=viewprofile&u=$user_id\">$username</a>&<a href=\"modules.php?name=Forums&file=viewtopic&p=$topic_last_post_id#$topic_last_post_id\"><img src=\"themes/fiblack3d/forums/images/icon_minipost_new.gif\" border=\"0\" alt=\"Latest Post\"></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\" class=\"forumline\">
  <tr> 
    <th height=\"25\" colspan=\"2\" align=\"center\" nowrap class=\"thcornerl\"><font color=\"#8E8E8E\">Topics</font></th>
    <th width=\"50\" align=\"center\" nowrap class=\"thtop\"><font color=\"#8E8E8E\">&Replies&</font></th>
    <th width=\"100\" align=\"center\" nowrap class=\"thtop\"><font color=\"#8E8E8E\">&Author&</font></th>
    <th width=\"50\" align=\"center\" nowrap class=\"thtop\"><font color=\"#8E8E8E\">&Views&</font></th>
    <th align=\"center\" nowrap class=\"thcornerr\"><font color=\"#8E8E8E\">&Last Post&</font></th>
  </tr>";
    $content .= "$viewlast";

 $content .= "$show";

?>
Anyway to just make it pull from my News forum.. the forum_id is 24

Thanks for your help!
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old
  (#2 (permalink))
Senior Member
 
Status: Offline
Posts: 2,905
Join Date: Sep 2002
05-25-2003, 10:39 PM

We "kinda" covered this possibility once before. Try this topic and see if it helps.

http://www.nukemods.com/modules.php?...ighlight=catid

mikem
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old
  (#3 (permalink))
Junior Member
 
Status: Offline
Posts: 14
Join Date: May 2003
05-25-2003, 11:04 PM

I got it working where it pulls from only one forum_id... Now im going to "try" to add the post_text into it as well so it looks just like the forum news
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old
  (#4 (permalink))
Junior Member
 
Status: Offline
Posts: 14
Join Date: May 2003
05-25-2003, 11:39 PM

I did it!!!

I got it to work.. Its a block and you only need to edit one thing the forum_id #

Preview it at www.midwestdomination.com if anyone is intrested i can give you the code. I only have it for fiblack3d but hey thats one of the few you cant use the forumNews hack on

Tell me what you think
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old
  (#5 (permalink))
Senior Member
 
Status: Offline
Posts: 2,905
Join Date: Sep 2002
05-26-2003, 09:19 AM

Nicely done bud :-)

mikem
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to change text (font type) inside News section! mdhanapiah Theme packs 0 10-23-2005 11:51 PM
Grunge type.. theme virulent Theme pack requests 0 08-26-2004 12:40 AM
scrolling affiliate type... UnderGround Nuke 6.5 to 6.9 - Modules 1 07-04-2003 07:47 PM
Building a Roster Type Module Scott Nuke 6.5 to 6.9 - Modules 0 05-08-2003 02:46 PM
Installing This Type of Forum SR_Strata Purged Topics 10 11-12-2002 08:18 PM




vBulletin Skin developed by: vBStyles.com


LinkBacks Enabled by vBSEO 3.3.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31