Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/virtual/site22/fst/var/www/html/phpnuke/blocks/block-Ibf-Stats.php on line 22
You have an error in your SQL syntax near '-_forums.ibf_posts order by pid desc' at line 1
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/virtual/site22/fst/var/www/html/phpnuke/blocks/block-Ibf-Stats.php on line 30
You have an error in your SQL syntax near '-_forums.ibf_topics WHERE tid=''' at line 1
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/virtual/site22/fst/var/www/html/phpnuke/blocks/block-Ibf-Stats.php on line 33
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/virtual/site22/fst/var/www/html/phpnuke/blocks/block-Ibf-Stats.php on line 45
Anyone? Please?
Holbrookau Corporal
Joined: May 31, 2003
Posts: 50
Posted:
Thu Dec 18, 2003 1:33 pm
The block is not connecting to your database correctly. ie, 1 or more of the following lines are not right:
Code:
$db_name = ""; // The name of the database where your forums are installed
// Variables
$ibf_stats = "ibf_stats"; // Name of the table where your stats are
$ibf_posts = "ibf_posts"; // The name of your posts table
$ibf_topics = "ibf_topics"; // The name of your topics table
$forum_id = "1"; // The forum ID of the forum you wish to export
$url = "forums/index.php"; // The full URL to your forums
$ibf_sessions = "ibf_sessions"; // Change if not correct
$ibf_groups = "ibf_groups"; // Change if not correct
$linkforums = "http://www.yoursiteurl/forums"; //Your Forum URL
Anyway, the code for this block is old and has some lines that were never used - here is a tidied up version:
Code:
<?
if (eregi("block-Ibf-Stats.php", $PHP_SELF)) {
Header("Location: index.php");
die();
}
// Edit these variables to suit your site
$db_name = ""; // Name of your IPB database (if PHP-Nuke & IPB are sharing the same database you can leave it blank).
$ibfprefix = "ibf"; // Prefix of your IPB tables (default = ibf)
$linkforums = "http://www.yoursite/forums"; //Your Forum URL
// End
global $sitename, $db;
$dbpath = "$db_name.$ibfprefix";
$stats_sql = $db->sql_query("select * from ".$dbpath."_stats");
$stats=$db->sql_fetchrow($stats_sql);
$date = date ("jS M Y" ,$stats["MOST_DATE"]);
$posts = $stats["TOTAL_TOPICS"] + $stats["TOTAL_REPLIES"];
$threads = $stats["TOTAL_TOPICS"];
$last_member_id = $db->sql_query("SELECT * FROM ".$dbpath."_members WHERE name ='$stats[LAST_MEM_NAME]'");
$m=$db->sql_fetchrow($last_member_id);
$content .= "<br><br><font size=\"1\"> Welcome to our newest member, <a href=\"$linkforums/index.php?act=Profile&MID=$m[id]\">$stats[LAST_MEM_NAME]</a><br> Most users ever online was <b>$stats[MOST_COUNT]</b> on $date.</font>";
$lastpost_sql = $db->sql_query("select * from ".$dbpath."_posts order by pid desc");
$p=$db->sql_fetchrow($lastpost_sql);
$last_topic = $db->sql_query("SELECT * FROM ".$dbpath."_topics WHERE tid='$p[topic_id]'");
$t=$db->sql_fetchrow($last_topic);
Hey, man, thanks for the reply. There seems to be no problem with the code now, i have no errors. But, there are no stats showing up. Might there have to be a NEW post before it starts tracking it?
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