Thread: phpBB
View Single Post
  #7  
Old 03-11-2002, 22:18
llaumgui's Avatar
llaumgui llaumgui is offline
XPerience-Fr
 
Join Date: 20-10-2002
Location: Montpellier
Age: 44
Posts: 456
Send a message via ICQ to llaumgui Send a message via AIM to llaumgui Send a message via MSN to llaumgui Send a message via Yahoo to llaumgui
Le truc c'est que j'ai chopé se code.

Quote:
<?php
/***************************************************************************
# Configuration #
****************************************************************************/
$nbr_sujets = 5; // Nombre de sujets à afficher
$url_phpbb = "/phpBB2"; // chemin vers le dossier PhpBB2 par rapport à la racine du site
$tz = 2; // Heure Locale = gmt + $tz (en France c gmt+1) +2 pour heure d' hiver
$format = 'd M Y H:i'; // Format de la date en php
$long_maxi = 35; // Longueurs maxi d'un titre de sujets (en caract.)

//-------------------------------------------------------------------------

require ("".$url_phpbb."/config.php");

$db = @mysql_connect("$dbhost", "$dbuser", "$dbpasswd") or die("mysql : erreur a la connexion");
@mysql_select_db("$dbname",$db) or die("mysql : probleme de selection de base");

$table1 = $table_prefix.'topics';
$table2 = $table_prefix.'forums';
$table3 = $table_prefix.'posts';
$sql = "SELECT t1.topic_last_post_id, t1.forum_id, t1.topic_title, t1.topic_id, t1.topic_time, t2.forum_id, t2.auth_view, t2.auth_read, t3.post_id, t3.post_time FROM $table1 t1, $table2 t2, $table3 t3 WHERE t2.auth_view = '0' AND t2.auth_read = '0' AND t1.forum_id = t2.forum_id AND t3.post_id=t1.topic_last_post_id ORDER BY t1.topic_last_post_id DESC LIMIT $nbr_sujets";

if($r = mysql_query($sql, $db)) {
while($m = mysql_fetch_array($r)) {
$m[topic_title] = stripslashes($m[topic_title]);
$m[topic_title] = substr($m[topic_title], 0, $long_maxi);
$post_date = @gmdate($format, $m[post_time] + (3600 * $tz));
echo "<a href=\"$url_phpbb/viewtopic.php?t=$m[topic_id]\"><b><font FACE=\"Verdana\" color=\"#6699FF\" size=\"1\">$m[topic_title]</font></b></a>";
echo "<font FACE=\"Verdana\" color=\"#555555\" size=\"1\"> - $post_date</font><br />";
}
}
?>
Le problème c'est que ca marche nickel sur le site du forum mais pas sur mon site (qui n'est pas le même)
__________________
| | |
Reply With Quote