Members: 16,996
Threads: 38,845
Posts: 159,389
Online: 18

Newest Member: Kl_broka@rediffmail.com


Odoo.tv - Outdoor Television


Sedo - Domains kaufen und verkaufen das Projekt mambers.com steht zum Verkauf Besucherstatistiken von mambers.com etracker® Web-Controlling statt Logfile-Analyse

Go Back   Mambers.com > Development > Module Development

Reply
 
LinkBack Thread Tools Display Modes
Old 12.06.2004, 23:23   #1 (permalink)
Baby Mamber
 
Join Date: May 2004
Posts: 1
KristianB is on a distinguished road
Default MySQL problem with a VBulletin module

I tried to use a module called VBLastpost but i get this error instead of the module:

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /Library/Apache2/htdocs/Mambo07/modules/mod_vBlastposts.php on line 47



The code for the module is: (please help me find the problem!)

<?php
//Lastest posts from vBulletin forum//
/**
* @ Mambo Open Source Version 4.5.+
* @ Dynamic portal server and Content management engine
* @ APRIL-15-2004
* @ Distributed under the terms of the GNU General Public License
* @ This software may be used without warranty and modified as long
* @ Site Name: www.casinotalks.com
* @ Site Address: http://www.casinotalks.com/
* @ File Name: mod_vBlastposts.php
* @ Developer: Dinh Viet Hung
* @ Date: APRIL-15-2004
* @ Version #: 1.0
* @ Comments: Created for Casinotalks.com web site.
* @ Purpose: This module displays the last 10 posts from vBulletin forum
**/
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
## CUSTOMIZE SETTINGS FOR YOUR SITE ##
$db_host = "localhost"; // Change this if your MySQL database host is different.
$db_name = "mambo07"; // Change this to the name of your database.
$db_user = "root"; // Change this to your database username.
$db_pw = "password"; // Change this to your database password.

$forum_url = "localhost"; // Change this to reflect to your forum's URL.
$forum_id = ""; // If you wish to display the posts from a specific forum, enter the forum id here. Otherwise, leave it blank.
$limit = "10"; // Number of posts displayed.
$txtlimit = "50"; // This is the character limit.
#######################################

// Connecting to your database
mysql_connect($db_host, $db_user, $db_pw)
OR die ("Cannot connect to your database");
mysql_select_db($db_name) OR die("Cannot connect to your database");
// Below is the beginning of a table. If you feel you don't need it, you may remove it.
echo "<table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">";

if ($forum_id) {
$forumid = "AND forumid=$forum_id";
}

if ($limit) {
$limited = "LIMIT $limit";
}
$thread_sql = mysql_query("SELECT threadid,title,lastpost,lastposter FROM thread WHERE visible=1 AND open=1 $forumid ORDER BY lastpost DESC $limited");

while($thread_get=mysql_fetch_array($thread_sql))
{
$lastpost = $thread_get['lastpost'];
$poster = $thread_get['lastposter'];
$tid = $thread_get['threadid'];
$psql = mysql_query("SELECT postid FROM post WHERE threadid=$tid ORDER BY postid DESC");
$getp=mysql_fetch_array($psql);
$pid = $getp['postid'];
$date2 = date ("m/d/y h:i A" ,$lastpost);
$title = $thread_get['title'];
$title = substr($title,0,$txtlimit);
echo "<tr><td class=\"contentheading\"> <a href=\"$forum_url/showthread.php?p=$pid#post$pid\">$title...</a></td></tr><tr><td>posted by $poster<i>$date2</i></td></tr>";
}
echo "</table>";
?>
KristianB is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Old 17.06.2004, 18:39   #2 (permalink)
Mamber
 
manuman's Avatar
 
Join Date: Apr 2004
Location: Western Australia
Posts: 106
manuman is on a distinguished road
Default Re: MySQL problem with a VBulletin module

My guess is that the SQL statement is not returning a result.

Have you tried running it in phpMyAdmin or similar? Are there any posts in the forum?
__________________
Joomla! Core Team Member :: Documentation Team Co-Leader ::www.joomla.org
The J! Factory :: http://www.thejfactory.com
manuman is offline  
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
Module -> page(s) selection problem er16004 Module 'How Do I' Questions 10 09.09.2004 23:17
phpShop Module... problem... dunedain Module 'How Do I' Questions 4 05.07.2004 14:41
Problem With MyWeather Module JCnow Mambo 4.5 General Talk 2 23.05.2004 08:58
Problem with Slide Show Module Zurrupion Mambo 4.5 General Talk 2 14.05.2004 01:42
Module -> mod_menu CSS problem Ready Module 'How Do I' Questions 2 29.04.2004 04:13


All times are GMT +2. The time now is 08:47.

Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.1.0
A vBSkinworks Design
© Copyright 2004-2008 by Arthur Konze Webdesign.