PHP Web Host - Quality Web Hosting For All PHP Applications $35/month $250/year (Unlimited) - $25/month - 200,000 impressions - Your Ad Could be Here - Click For Details
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
BamBamPSK
Regular
Regular


Joined: Nov 11, 2003
Posts: 61

PostPosted: Mon Jan 19, 2004 6:21 pm Reply with quote Back to top

hey raven you are the man when it comes to php coding so i come here to get help..thanks you for your site

and now for my "thing"

i have a scrolling forums block on my site that i LOVE it puts dividers between entries but it doesnt do exactly what i want it to do.

it shows the forums i want it to but it counts the "private" forums for the count in the block itself.

like if i had say 6 entries in the public forums and 4 in the private forums the count in the forums block is 6 not 10 like i would like it to be..

hope that makes sense....any who here is the code for the block if i could get it to show and count ONLY the public forums that would be great.

Code:
if (eregi("block-Forums.php", $_SERVER['PHP_SELF'])) {
    Header("Location: index.php");
    die();
}
############################################
#### To remove top fixed link of forum put 0
$toplink = 1;
############################################
#### To stop scroll put 0
$scroll = 1;
############################################
#### To remove the counter put 0
$number = 0;
############################################
#### To remove the search link put 0
$search = 1;
############################################

include_once ('blocks/smileys.php');
$ThemeSel = get_theme();

global $sitename, $prefix, $db, $ThemeSel;
$count = 1;

if ($toplink == 1) {
$content .= "<center><a href=\"forums.html\"><b>$sitename Forums</b></a></center><br>";
}
if ($scroll == 1) {
     $content .="<A name= \"scrollingCode\"></A>";
     $content .="<MARQUEE behavior= \"scroll\" align= \"center\" direction= \"up\" height=\"220\" scrollamount= \"2\" scrolldelay= \"20\" onmouseover='this.stop()' onmouseout='this.start()'>";
     $content .="<br>";
#####################################################################################
################# This will only appear if it's scrolling ###########################
     $content .="<center><b>Last 10 Messages</b></center><br>";
     }
#####################################################################################
############# To change the number of posts change the number in the end of this line
$sql = "SELECT topic_title, topic_last_post_id, forum_id FROM ".$prefix."_bbtopics ORDER BY topic_last_post_id DESC LIMIT 10";
#####################################################################################
   

    $result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)){
    $topic_title = $row[topic_title];
    $topic_last_post_id = $row[topic_last_post_id];
    $forum_id = $row[forum_id];
    $sql = "SELECT forum_id, forum_name FROM ".$prefix."_bbforums where forum_id='$forum_id'";
    $result2 = $db->sql_query($sql);
    $row = $db->sql_fetchrow($result2);
    $forum_id = $row[forum_id];
    $forum_name = $row[forum_name];
    $sql = "SELECT poster_id, FROM_UNIXTIME(post_time,'%b %d, %Y at %T') as post_time FROM ".$prefix."_bbposts where post_id='$topic_last_post_id'";
    $result3 = $db->sql_query($sql);
    $row = $db->sql_fetchrow($result3);
    $poster_id = $row[poster_id];
    $post_time = $row[post_time];
    $sql = "SELECT username, user_id FROM ".$prefix."_users where user_id='$poster_id'";
    $result4 = $db->sql_query($sql);
    $row = $db->sql_fetchrow($result4);
    $username = $row[username];
    $user_id = $row[user_id];
    $sql2 = "SELECT auth_view, auth_read FROM ".$prefix."_bbforums WHERE forum_id='$forum_id'";
    $result5 = $db->sql_query($sql2);
    $row2 = $db->sql_fetchrow($result5);
    $auth_view = $row2[auth_view];
    $auth_read = $row2[auth_read];
if (($auth_view < 2) OR ($auth_read < 2)) {
    if ($number == 1) {
    $content .= "<table><tr><td><b>Message: $count<br></b></td></tr>";
    } else {
   $content .= "<table>";
   }
    $topic_title=parseEmoticons($topic_title);
   if (file_exists("themes/$ThemeSel/forums/images/icon_minipost.gif")) {
$content .= "<tr><td><img src=\"themes/$ThemeSel/forums/images/icon_minipost.gif\" border=\"0\" alt=\"\"><a href=\"forums.html&amp;file=viewtopic&amp;p=$topic_last_post_id#$topic_last_post_id\" STYLE=\"text-decoration: none\"><b> $topic_title </b><br></a>Last Message by <A HREF=\"profile-.html$user_id\"STYLE=\"text-decoration: none\"> <i><strong>$username</strong></i> </a> in <a href=\"forums.html&amp;file=viewforum&amp;f=$forum_id\" STYLE=\"text-decoration: none\"><b>$forum_name</b></a> on <i><strong>$post_time</strong></i><hr></td></tr></table>";
    } else {
$content .= "<tr><td><img src=\"modules/Forums/templates/subSilver/images/icon_minipost.gif\" border=\"0\" alt=\"\"><a href=\"forums.html&amp;file=viewtopic&amp;p=$topic_last_post_id#$topic_last_post_id\" STYLE=\"text-decoration: none\"><b> $topic_title </b><br></a>Last Message by <A HREF=\"profile-.html$user_id\"STYLE=\"text-decoration: none\"> <i><strong>$username</strong></i> </a> in <a href=\"forums.html&amp;file=viewforum&amp;f=$forum_id\" STYLE=\"text-decoration: none\"><b>$forum_name</b></a> on <i><strong>$post_time</strong></i><hr></td></tr></table>";
    }
   }
    $count = $count + 1;
   }
if ($toplink == 0) {
$content .= "<center><a href=\"forums.html\"><b>$sitename Forums</b></a></center><br>";
}
if ($scroll == 1){
$content .= "</MARQUEE>";
}
if($search == 1){
$content .= "<center><a href=\"forums.html&file=search\"><b>Search Forums</b></a></center><br>";
}
?>
View user's profile Send private message
BamBamPSK
Regular
Regular


Joined: Nov 11, 2003
Posts: 61

PostPosted: Tue Jan 20, 2004 7:07 am Reply with quote Back to top

any one?
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

PostPosted: Tue Jan 20, 2004 7:33 am Reply with quote Back to top

I'm not clear on what you want. If you have 6 in public and 4 in private, do you want to only see the public count, which would be 6?
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
BamBamPSK
Regular
Regular


Joined: Nov 11, 2003
Posts: 61

PostPosted: Tue Jan 20, 2004 1:56 pm Reply with quote Back to top

ok ill try to explain better....

the block says it will show the last 10 forum messages BUT it really doesnt unless those messages are in the public forums.

when my clan members post in the private section or i and the other admins post in the admin section then those posts count in the forums block...what i want it for those posts NOT to count in the block.

hope that explains it better
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

PostPosted: Tue Jan 20, 2004 2:06 pm Reply with quote Back to top

A quick and dirty way might be to alter this line of code from
Code:
$sql = "SELECT topic_title, topic_last_post_id, forum_id FROM ".$prefix."_bbtopics ORDER BY topic_last_post_id DESC LIMIT 10";
to
Code:
$sql = "SELECT topic_title, topic_last_post_id, forum_id FROM ".$prefix."_bbtopics WHERE forum_id NOT IN('ID1','ID2') ORDER BY topic_last_post_id DESC LIMIT 10";

Of course you need to hard code in the ID1, ID2, etc., with real forum ID's to exclude. It could be written automatically with an SQL join or 2, but if you have just a couple forums to block this would be easier.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
BamBamPSK
Regular
Regular


Joined: Nov 11, 2003
Posts: 61

PostPosted: Tue Jan 20, 2004 5:47 pm Reply with quote Back to top

i have 4 total to block and how would i hard code it in?
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

PostPosted: Tue Jan 20, 2004 6:14 pm Reply with quote Back to top

??? I gave you the code in my above message Laughing
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
BamBamPSK
Regular
Regular


Joined: Nov 11, 2003
Posts: 61

PostPosted: Tue Jan 20, 2004 6:45 pm Reply with quote Back to top

Raven wrote:

Of course you need to hard code in the ID1, ID2, etc., with real forum ID's to exclude. It could be written automatically with an SQL join or 2, but if you have just a couple forums to block this would be easier.
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

PostPosted: Tue Jan 20, 2004 6:53 pm Reply with quote Back to top

This is the code I gave you, in that same post
Code:
$sql = "SELECT topic_title, topic_last_post_id, forum_id FROM ".$prefix."_bbtopics WHERE forum_id NOT IN('ID1','ID2') ORDER BY topic_last_post_id DESC LIMIT 10";
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
Display posts from previous:       
Post new topic   Reply to topic

View next topic
View previous topic
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
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum