Le lien peut se présenter sous la forme :
pour aller au topicviewtopic.php?t[topic number]
pour aller au dernier post du topichref="forums/viewtopic.php?p=[last_post_id]
Modérateur: Modérateurs
par Falkra » 24 Aoû 2008 13:23
pour aller au topicviewtopic.php?t[topic number]
pour aller au dernier post du topichref="forums/viewtopic.php?p=[last_post_id]
par bouldingue » 24 Aoû 2008 16:34
par Falkra » 24 Aoû 2008 16:38
$les_sujets .= "<a href=\"$url_phpbb/post$reponse[topic_last_post_id].php#p$reponse[topic_last_post_id]\">$reponse[topic_title]</a><br>"};
par bouldingue » 24 Aoû 2008 16:49
par Falkra » 24 Aoû 2008 16:59
<?php
mysql_connect("localhost","***", "***"); // Connexion à MySQL
mysql_select_db("***"); // Sélection de la base
//Appel des posts et des données, tri par ordre chronologique descendant, limite à 10
$reponse = mysql_query("SELECT t1.topic_last_post_id, t1.topic_title, FROM phpbb_topics t1") ORDER BY t1.topic_last_post_id DESC LIMIT 10; // Requête SQL
// On fait une boucle pour lister tout ce que contient la table :
while ($donnees = mysql_fetch_array($reponse) )
{
$10posts .=<a href=\"forums/viewtopic.php?p=$reponse[last_post_id]\">$reponse[topic_title] ?></a>
}
mysql_close(); // Déconnexion de MySQL
echo $10posts; //affichage des liens
?>
$10posts .=<a href=\"forums/viewtopic.php?p=$reponse[last_post_id]\">$reponse[topic_title] ?></a>
par bouldingue » 24 Aoû 2008 17:12
par bouldingue » 24 Aoû 2008 17:15
par Falkra » 24 Aoû 2008 17:21
$reponse = mysql_query("SELECT t1.topic_last_post_id, t1.topic_title, FROM phpbb_topics t1 ORDER BY t1.topic_last_post_id DESC LIMIT 10");
par bouldingue » 24 Aoû 2008 17:29
par Falkra » 24 Aoû 2008 17:36
$10posts .= "<a href=\"forums/viewtopic.php?p=$reponse[last_post_id]\">$reponse[topic_title]</a>";
par bouldingue » 24 Aoû 2008 17:48
par bouldingue » 24 Aoû 2008 18:04
par Falkra » 24 Aoû 2008 18:47
par bouldingue » 24 Aoû 2008 18:51
par Falkra » 24 Aoû 2008 18:53
par bouldingue » 24 Aoû 2008 19:30
par Falkra » 24 Aoû 2008 19:46
<?php
$db = @mysql_connect("localhost", "tonlogin", "tonpass") or die("mysql : erreur a la connexion"); // Connexion à MySQL
@mysql_select_db("$***",$db) or die("mysql : probleme de selection de base"); // Sélection de la base
// init variable
$_10posts = '';
//Appel des posts et des données, tri par ordre chronologique descendant, limite à 10
$sql = "SELECT t1.topic_last_post_id, t1.topic_title, FROM phpbb_topics t1 ORDER BY t1.topic_last_post_id DESC LIMIT 10";
$r = mysql_query($sql, $db);
// On fait une boucle pour lister tout ce que contient la table :
while ($m = mysql_fetch_array($r) )
{
$m[topic_title] = stripslashes($m[topic_title]); // nettoyage
$_10posts .= "<a href=\"forums/viewtopic.php?p=$m[last_post_id]\">$m[topic_title]</a>";
}
mysql_close(); // Déconnexion de MySQL
echo $_10posts; //affichage des liens
?>
par bouldingue » 24 Aoû 2008 20:03
par Falkra » 24 Aoû 2008 20:04
par bouldingue » 24 Aoû 2008 20:14