Recent scrolling topic
Geplaatst: 20 okt 2003, 10:41
Als jullie gaan kijken op http://www.glansbeton.be/forum/portal.php
Zien jullie dat deze mod (links) goed werkt bij mij...
of ga naar http://www.glansbeton.be/forum/scroll.php
Wat is dan het probleem????
Wel er staat altijd by davy... dat wil ik niet omdat ik op alle berichten antwoord... Het beste zou zijn dat hij ofwel mij eruit filtert..
Of misschien nog beter dat er echt komt te staan wie het bericht heeft opgesteld.
Hieronder staat de code... iemand een idee hoe ik het verander dat er de naam van diegene die het berircht heeft opgesteld komt te staan?
Zien jullie dat deze mod (links) goed werkt bij mij...
of ga naar http://www.glansbeton.be/forum/scroll.php
Wat is dan het probleem????
Wel er staat altijd by davy... dat wil ik niet omdat ik op alle berichten antwoord... Het beste zou zijn dat hij ofwel mij eruit filtert..
Of misschien nog beter dat er echt komt te staan wie het bericht heeft opgesteld.
Hieronder staat de code... iemand een idee hoe ik het verander dat er de naam van diegene die het berircht heeft opgesteld komt te staan?
Code: Selecteer alles
<?php
// ########################################################
// ## Title: Recent Topics for v2.0.4
// ## Author: CFSILENT <cfsilent@yahoo.com> - http://www.seekideas.com/
// ## Description: Display Recent Topics on any page.
// ##
// ## Demo: http://www.seekideas.com/
// ## Installation Level: Easy
// ## Installation Time: 2 minutes
// ########################################################
/* Basic config */
$topicnumber = 10; /*+++ Number of topics you want to display +++*/
$scroll = "up"; /*+++ Scroll "down" or "up" */
/* Database config */
include 'config.php'; /*+++ Replace "XXX" with relative or URL path of your forum directory. +++*/
/*+++ Example (Relative Path): phpBB2, forum, board, etc. +++*/
$urlPath = "http://www.glansbeton.be/forum/";
/*+++ Example (URL Path): http://www.phpbb.com/phpBB2 +++*/
// Connecting & Selecting Databases
$table_topics = $table_prefix. "topics";
$table_forums = $table_prefix. "forums";
$table_posts = $table_prefix. "posts";
$table_users = $table_prefix. "users";
$link = mysql_connect("$dbhost", "$dbuser", "$dbpasswd") or die("Could not connect");
mysql_select_db("$dbname") or die("Could not select database");
// Perform Sql Query
$query = "SELECT t.topic_id, t.topic_title, t.topic_last_post_id, t.forum_id, p.post_id, p.poster_id, p.post_time, u.user_id, u.username
FROM $table_topics t, $table_forums f, $table_posts p, $table_users u
WHERE t.topic_id = p.topic_id AND
f.forum_id = t.forum_id AND
t.topic_status <> 2 AND
p.post_id = t.topic_last_post_id AND
p.poster_id = u.user_id
ORDER BY p.post_id DESC LIMIT $topicnumber";
$result = mysql_query($query) or die("Query failed");
// Outcome of the HTML
// Be carefull when you edit these!
print "<marquee id=\"recent_topics\" behavior=\"scroll\" direction=\"$scroll\" height=\"170\" scrolldelay=\"100\" scrollamount=\"2\" onMouseOver=\"document.all.recent_topics.stop()\" onMouseOut=\"document.all.recent_topics.start()\">
<table cellpadding='3' cellSpacing='2' width='350'>";
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
echo "<tr valign='top'><td><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\"><font color=\"#FFCC00\"><b><a href=\"$urlPath/viewtopic.php?topic=$row[topic_id]&forum=$row[forum_id]\">" .
$row["topic_title"] .
"</a></td></font></b><td><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\"><font color=\"#C0C0C0\"> by: <a href=\"$urlPath/profile.php?mode=viewprofile&u=$row[user_id]\">" .
$row["username"] .
"</td><td><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\"><font color=\"#C0C0C0\">" .
date('F j, Y, g:i a', $row["post_time"]) .
"</td></tr></font>";
}
print "</table></marquee>";
// Free Result
mysql_free_result($result);
// Close the Connection
mysql_close($link);
?>