Notifications
Retirer tout

PHP BB 7 derniers messages...

11 Posts
3 Utilisateurs
0 Reactions
1 754 Vu
MystM
Posts: 1364
Initiateur du sujet
(@mystm)
Membre noble
Inscription: Il y a 22 ans

heuu, comme je l'ai dejà dit, je ne connais ... rien au php 😥

et justement, j'aimerais bien utiliser ce service, mais j' n'y comprend .. RIEN !!

ya pas qqun qui peut m'aider svp ?? 😕
########################################################

##

## Nom: Derniers Messages sur n'importe quelle page

## Version: 2.0

## Auteur: LiLCoolboy (M@urice Cheung)

##       (originellement écrit par John B. Abela)

## Description:

## Ce hack vous permettra de mettre les messages les plus

## récents sur n'importe quel page de votre site.

##

## Niveau d'installation:   Facile

## Temps d'installation:   1-5 Minutes

## Fichiers à éditer:      X

## Fichiers inclus:      N/A

##

########################################################

##

## Notes d'installation/auteur:

##

## Pour utiliser ce MOD, il vous suffit de faire un copier-

## coller du code-ci dessous, après avoir édité $urlPath et

## $ServerPath, dans le fichier où vous voulez que les liens

## vers les derniers posts doivent s'afficher.

##

## Traduit par Helix - http://www.phpbb-fr.com/

########################################################

#

#-----[ COPIER-COLLER: ]------------------------------------------

#

<?php

$ServerPath = "/chemin_complet/vers/phpBB/config.php";  //- Ne pas mettre de ''

$urlPath = "http://www.votredomaine.com/phpBB";  //- Ne pas mettre de ''

$PostNumber = "7";  // Le nomre de posts à afficher.

$type = "topics";  // Affiche les 'posts' ou les 'topics'

//-----------------[ DO NOT EDIT BELOW HERE ]-------------------------

include_once("$ServerPath");

$db = @mysql_connect("$dbhost", "$dbuser", "$dbpasswd") or die("here we die at connection");

@mysql_select_db("$dbname",$db) or die("here we die");

if($type == "phpbb_posts")

  $sql = "SELECT t.topic_title, t.topic_id, f.forum_id FROM topics t, forums f, posts p WHERE t.topic_id = p.topic_id AND f.forum_id = t.forum_id ORDER BY post_id DESC LIMIT $PostNumber";

else

  $sql = "SELECT t.topic_title, t.topic_id, f.forum_id FROM topics t, forums f WHERE f.forum_id = t.forum_id ORDER BY topic_time DESC LIMIT $PostNumber";

if($r = mysql_query($sql, $db))

{

  while($m = mysql_fetch_array($r))

  {

     $j = stripslashes($m[topic_title]);

     $k = substr($j, 0, 20) . "...";

     echo "-<a title="$m[topic_title]" href="$urlpath/viewtopic.php?t=$m[topic_id]&sid=$m[forum_id]">$k</a><br>";

  }

}

?>

#

#-----------------------------------------------

#
merci 😉

10 Réponses
Malouk
Posts: 6354
Admin
(@malouk)
Membre illustre
Inscription: Il y a 23 ans

Apparement, tu dois éditer ça :

ServerPath = "/forum/vers/phpBB/config.php"; //- Ne pas mettre de ''
$urlPath = "http://www.votredomaine.com/forum"; //- Ne pas mettre de ''

avec les paramètres de ton site.

Et tu copie le tout dans le code de la page de ton site. Là ou tu veux insérer les posts de ton forum.

Faudra juste que ta page soit en php.
Suffit pour ça de changer l'extension .html en .php

Répondre
MystM
Posts: 1364
Initiateur du sujet
(@mystm)
Membre noble
Inscription: Il y a 22 ans

ok la page en php, tu peux aller voir mon idex, c fait
ensuite, pour ce qui est des pages a éditer... 😕 c'est là que je capte rien 😥

Répondre
Malouk
Posts: 6354
Admin
(@malouk)
Membre illustre
Inscription: Il y a 23 ans

Tu dois modifier c'est deux lignes :

ServerPath = "/forum/vers/phpBB/config.php";
$urlPath = "http://www.votredomaine.com/forum";

comme ça apparement chez toi 😉

ServerPath = "/phpBB2/phpBB2/config.php";
$urlPath = "http://mystm.webdynamit.net/phpBB2/phpBB2";

le reste t'y touche pas.

Répondre
MystM
Posts: 1364
Initiateur du sujet
(@mystm)
Membre noble
Inscription: Il y a 22 ans

dessous, après avoir édité $urlPath et

## $ServerPath, dans le fichier où vous voulez que les liens

## vers les derniers posts doivent s'afficher.

voilà, surtout ca :s

Répondre
Page 1 / 3
Retour en haut