Lid |
|
Goedendag, Leden.
Ik probeer op mijn index de laatste 10 actieve topics weer te geven van mijn phbb3 forum.
Dit forum is gevestigd op: http://www.svghosting.nl/forum/
Niet gebruiken voor spam doeleinden!
Nu als ik in mijn pakketten.php (Deze wordt geinclude in mijn index.php) het volgende stukje code plaats
<?php
/*
* (c) Rien van Hulten
* (w) rienvanhulten.nl
*/
function laatste_active_topics ($datum_formaat, $pad_naar_forum, $limit)
{
include_once $pad_naar_forum . '/config.php';
mysql_connect($dbhost, $dbuser, $dbpasswd) or die ("<p>Het verbinden met de database is mislukt. Onze excuses hiervoor. Neem indien nodig contact op via het contactformulier.</p>");
mysql_select_db ($dbname) or die ("<p>Het verbinden met de database is mislukt. Onze excuses hiervoor. Neem indien nodig contact op via het contactformulier.</p>");
$query = mysql_query("SELECT " . $table_prefix . "_topics.topic_id, " . $table_prefix . "_topics.topic_title, " . $table_prefix . "_topics.topic_poster, " . $table_prefix . "_topics.topic_replies, " . $table_prefix . "_users.username, " . $table_prefix . "_users.user_id, " . $table_prefix . "_posts.post_time, " . $table_prefix . "_topics.topic_last_post_id
FROM " . $table_prefix . "_topics
INNER JOIN " . $table_prefix . "_users ON ( " . $table_prefix . "_topics.topic_poster = " . $table_prefix . "_users.user_id )
INNER JOIN " . $table_prefix . "_posts ON ( " . $table_prefix . "_topics.topic_last_post_id = " . $table_prefix . "_posts.post_id )
ORDER BY " . $table_prefix . "_posts.post_time DESC
LIMIT 0," . $limit);
echo '<p>';
while($array = mysql_fetch_array($query))
{
$array['topic_replies'] = $array['topic_replies'] == 0 ? '<span style="color: orange">(' . $array['topic_replies'] . ')</span>' : '(' . $array['topic_replies'] . ')';
?>
[<?=date($datum_formaat, $array['post_time'])?>] <a href="<?=$pad_naar_forum?>/viewtopic.php?t=<?=$array['topic_id']?>#<?=$array['topic_last_post_id']?>"><?=$array['topic_title']?></a> <?=$array['topic_replies']?>, gestart door <a href="<?=$pad_naar_forum?>/profile.php?mode=viewprofile&u=<?=$array['user_id']?>"><?=$array['username']?></a>.<br />
<?php
}
echo '</p>';
}
laatste_active_topics('d-m-Y H:i:s', 'forum', 10)
?>
<?php /* * (c) Rien van Hulten * (w) rienvanhulten.nl */ function laatste_active_topics ($datum_formaat, $pad_naar_forum, $limit) { include_once $pad_naar_forum . '/config.php'; mysql_connect($dbhost, $dbuser, $dbpasswd) or die ("<p>Het verbinden met de database is mislukt. Onze excuses hiervoor. Neem indien nodig contact op via het contactformulier.</p>"); mysql_select_db ($dbname) or die ("<p>Het verbinden met de database is mislukt. Onze excuses hiervoor. Neem indien nodig contact op via het contactformulier.</p>"); $query = mysql_query("SELECT " . $table_prefix . "_topics.topic_id, " . $table_prefix . "_topics.topic_title, " . $table_prefix . "_topics.topic_poster, " . $table_prefix . "_topics.topic_replies, " . $table_prefix . "_users.username, " . $table_prefix . "_users.user_id, " . $table_prefix . "_posts.post_time, " . $table_prefix . "_topics.topic_last_post_id FROM " . $table_prefix . "_topics INNER JOIN " . $table_prefix . "_users ON ( " . $table_prefix . "_topics.topic_poster = " . $table_prefix . "_users.user_id ) INNER JOIN " . $table_prefix . "_posts ON ( " . $table_prefix . "_topics.topic_last_post_id = " . $table_prefix . "_posts.post_id ) ORDER BY " . $table_prefix . "_posts.post_time DESC LIMIT 0," . $limit); { $array['topic_replies'] = $array['topic_replies'] == 0 ? '<span style="color: orange">(' . $array['topic_replies'] . ')</span>' : '(' . $array['topic_replies'] . ')'; ?> [ <?=date($datum_formaat, $array['post_time'])?>] <a href=" <?=$pad_naar_forum? >/viewtopic.php?t= <?=$array['topic_id']?># <?=$array['topic_last_post_id']?>"> <?=$array['topic_title']?></a> <?=$array['topic_replies']?>, gestart door <a href=" <?=$pad_naar_forum? >/profile.php?mode=viewprofile&u= <?=$array['user_id']?>"> <?=$array['username']?></a>.<br /> <?php } } laatste_active_topics('d-m-Y H:i:s', 'forum', 10) ?>
Dan krijg ik de volgende foutmelding:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/svghosting/domains/svghosting.nl/public_html/pakketten.php on line 135
Kan iemand mij hier a.u.b mee helpen, ik heb zelf al een aantal foutjes opgelost. Maar bij deze fout kom ik er absoluut niet uit.
Dit is mijn pakketten.php:
Indien u meer scripts nodig heb plaats ik deze na aanvraag.
Plaatscode: 120954
Alvast Bedankt!
Met vriendelijke groet,
A. Ruter
|