FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum Development » Plugins and Code Hacks » Looking for hack...
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Looking for hack... [message #4350 is a reply to message #3253] Wed, 24 July 2002 19:00 Go to previous messageGo to previous message
heidiott is currently offline  heidiott   United States
Messages: 34
Registered: May 2002
Karma:
Member
I upgraded to the new forum version this morning and now I'm getting the following error with this code...

Warning: Supplied argument is not a valid MySQL result resource in /home/sites/www.crafterscommunity.net/web/test.php on line 11

Warning: Supplied argument is not a valid MySQL result resource in /home/sites/www.crafterscommunity.net/web/test.php on line 27

Warning: Supplied argument is not a valid MySQL result resource in /home/sites/www.crafterscommunity.net/web/test.php on line 32


Here is the code I have in test.php...

<?php

function fetch_forum_posts($n_posts) /* n_posts is the number of messages you wish to fetch */
{
include_once "/path_removed_/GLOBALS.php";

$cid = mysql_connect($MYSQL_SERVER, $MYSQL_LOGIN, $MYSQL_PASSWORD);
$r = mysql_db_query($MYSQL_DB, "SELECT resource_id FROM fud_group_cache WHERE user_id='0' AND p_READ='Y'", $cid);

$lm='';
while( list($id) = mysql_fetch_row($r) ) $lm .= $id.',';
$lm = substr($lm, 0, -1);

$r = mysql_db_query($MYSQL_DB, "SELECT
fud_msg.id,
fud_msg.subject
FROM
fud_thread
INNER JOIN fud_msg
ON fud_thread.root_msg_id=fud_msg.id
WHERE
fud_thread.forum_id IN (".$lm.") AND
fud_msg.approved='Y'
ORDER by
fud_thread.id DESC
LIMIT ".$n_posts, $cid);
while( $obj = mysql_fetch_object($r) ) {

/* Here you do your actual code, below is a working example */
echo "<img src=http://www.crafterscommunity.net/forum/styles/default/goto.gif vspace=3 align=middle>&nbsp;<a href=\"".$WWW_ROOT."msg.php?goto=".$obj->id."\& quot;>".$obj->subject."</a><br>\n";
}
mysql_free_result($r);
}



?>


[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message icon5.gif
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message icon9.gif
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message icon9.gif
Read Message
Read Message
Read Message
Read Message
Previous Topic: New threads on the front page of the site
Next Topic: General Hacking Recommendation please
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Mon Nov 25 21:09:37 GMT 2024

Total time taken to generate the page: 0.03467 seconds