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
Argus
Client


Joined: Oct 06, 2003
Posts: 81

PostPosted: Thu Oct 16, 2003 4:57 pm Reply with quote Back to top

Heya...

I'm having a small problem with a block atm. Here's the block:

Code:

<?php

/************************************************/
/* Last Posts from Invision Board               */
/* A block for phpNuke 6.0 - 6.6                */
/* By Patrick (http://www.actionrpg.net)        */
/*                                              */
/* All credit goes to:                          */
/* Holbrookau - http://phpnuke.holbrookau.com   */
/* VladOr - http://www.cm4.ru                   */
/*                                              */
/* All I have done is combined those two. The   */
/* VladOr block hardly worked for me, and the   */
/* Holbrookau block required a shared database. */
/* Thank you for downloading. I hope you enjoy! */
/************************************************/

if (eregi("block-IPB_last_posts.php", $PHP_SELF)) {
Header("Location: index.php");
die();
}
global $admin;

$ibf_sql_host = "localhost";
$ibf_sql_user = "XXXX";            // DB username
$ibf_sql_password = "XXXX";        // DB password
$ibf_sql_dbname = "forums";          // DB name

$ibf_path = "forums/index.php"; // path from phpNuke root directory to IPB index.php
$ibf_table_prefix = "ibf_";     // change if your IPB table prefix is not ibf_
$limit = "10";                  // How many threads would you like to display?
$noshow = "0";                  // Don't show posts from these forums - seperate IDs with commas, eg: "2,8"
$scroll = "1";                  // Scroll - 1=On, 0=Off

$ibf_connect = mysql_connect($ibf_sql_host, $ibf_sql_user, $ibf_sql_password);

if(!$ibf_connect)

{
        echo $content="<div style=\"font-color:#ff0000; font-weight:bold;\">Error: Could not connect to database server</div>";
}
else
{
   $ibf_db = mysql_select_db($ibf_sql_dbname, $ibf_connect);

   if (is_admin($admin))
   {
      $ibf_query = mysql_query("SELECT DISTINCT tid, title, last_poster_name, last_poster_id, forum_id FROM ".$ibf_table_prefix."topics ORDER BY last_post DESC LIMIT ".$limit, $ibf_connect);
   }
   else
   {
      $ibf_query = mysql_query("SELECT DISTINCT tid, title, last_poster_name, last_poster_id, forum_id FROM ".$ibf_table_prefix."topics  WHERE forum_id NOT IN ($noshow) ORDER BY last_post DESC LIMIT ".$limit, $ibf_connect);
   }
   if ($scroll=="1")
   {
      $content = " <MARQUEE behavior= \"scroll\" align= \"center\" direction= \"up\" height=\"150\" scrollamount= \"1\" scrolldelay= \"10\" onmouseover='this.stop()' onmouseout='this.start()'>";
   }
   while($ibf_result = mysql_fetch_row($ibf_query))
   {
      $content .= "<br><b><strong><big>·</big></strong>&nbsp;<a href=\"/".$ibf_path."?act=ST&amp;f=".$ibf_result[4]."&amp;t=".$ibf_result[0]."&amp;view=getnewpost\">".$ibf_result[1]."</a></b> <i>by ";
      if($ibf_result[3] != 0)
      {
         $content .= "<a href=\"".$ibf_path."?act=Profile&amp;CODE=03&amp;MID=".$ibf_result[3]."\">".$ibf_result[2]."</a></i><br>\n";
      }
      else
      {
         $content = $ibf_result[2]."</i></p>\n";
      }
   }
   mysql_free_result($ibf_query);
}
mysql_close($ibf_connect);
?>


The block works, however any block or even module (if its on the right) that loads after it gets no input. They show up as no content now for this block etc. Does anyone know why this is happening?

Thanks much,

-Arg
View user's profile Send private message
scottr
PHP-Portal Project


Joined: Jan 21, 2003
Posts: 41
Location: Southern California

PostPosted: Thu Oct 16, 2003 5:48 pm Reply with quote Back to top

Maybe get rid of that last mysql_close() statement ?
View user's profile Send private message Visit poster's website Yahoo Messenger
Raven
Site Admin/Owner


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

PostPosted: Thu Oct 16, 2003 6:54 pm Reply with quote Back to top

That's usually a sign that either a variable name is clashing with nuke or the form is maligned, meaning an open form tag or something. Can you provide a link so I can see this in action?
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
Argus
Client


Joined: Oct 06, 2003
Posts: 81

PostPosted: Thu Oct 16, 2003 10:05 pm Reply with quote Back to top

I added the close thinking that was the problem, but nothing changed when I did. A link to the page is
Only registered users can see links on this board!
Get registered or login to the forums!
. Top right side. Site is a work in progress.

-Thanks
View user's profile Send private message
Raven
Site Admin/Owner


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

PostPosted: Fri Oct 17, 2003 5:07 am Reply with quote Back to top

I clicked on the link and I don't see the problem. What am I missing?
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
Argus
Client


Joined: Oct 06, 2003
Posts: 81

PostPosted: Fri Oct 17, 2003 10:18 am Reply with quote Back to top

Mmmm someone's been editting the page I think. I put the survey block and the big story of today block back in and you can see the prob.

-Arg
View user's profile Send private message
Raven
Site Admin/Owner


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

PostPosted: Fri Oct 17, 2003 1:11 pm Reply with quote Back to top

Well, there may not be a biggest story and is the survey module active? The reason I ask is that there is a Gaming League's block that is working. Try moving the who's online block on the right to see if it works or not.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
Argus
Client


Joined: Oct 06, 2003
Posts: 81

PostPosted: Fri Oct 17, 2003 1:55 pm Reply with quote Back to top

Hehe, I think thats because its just content - pure html (the gaming league block) Here, I'll move it to the left side and you can see what happens Razz

-Arg
View user's profile Send private message
Raven
Site Admin/Owner


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

PostPosted: Fri Oct 17, 2003 5:45 pm Reply with quote Back to top

Well, I have looked at this for about an hour or more and I can't see anything wrong. The symptoms are as I said earlier. It's as if nuke thinks it's done building so I think there is a variable being used in the script that is confusing nuke. This is how I would debug it if it were me. I would rename these variables in the script to have a prefix of xxx_ (limit, noshow, scroll). Then, see if you still have the problem. Also, the variable $PHP_SELF should be $_SERVER['PHP_SELF']. Also, modify this code
Code:
        echo $content="<div style=\"font-color:#ff0000; font-weight:bold;\">Error: Could not connect to database server</div>";
to
Code:
        $content="<div style=\"font-color:#ff0000; font-weight:bold;\">Error: Could not connect to database server</div>";
That coding seems troublesome to me.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
Argus
Client


Joined: Oct 06, 2003
Posts: 81

PostPosted: Sun Oct 19, 2003 3:34 pm Reply with quote Back to top

Heyas...

I made the changes as suggested with no effect. Thanks for looking at it though. I was also trying to create a custom block by hacking another with no success. Do I understand you will take on small projects like this for $?

Thanks,

-Arg
View user's profile Send private message
Raven
Site Admin/Owner


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

PostPosted: Sun Oct 19, 2003 4:56 pm Reply with quote Back to top

I do custom contracting work, yes. I also have a couple of people who I refer work to. Send me an email with your specs.
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