Help - Search - Member List - Calendar
Full Version: [Traité]Deriers post
IPBR-FR > Entraide > Questions diverses
noobforum
Bonsoir à tous,

Je me permet de poster dans cette rubrique, veuillez m'excuser si ce post n'a rien à y faire.


Je réclame votre aide mais comprendrai très bien votre refus étant donné que la source du problème n'a aucun rapport avec IB France.

J'ai installé un code qui me permet d'afficher sur la page d'accueil de mon site les derniers posts de mon forum IPB 2.1.4

Seulement, ce code affiche également les posts du forum privé, dont le public ne doit pas être au courant.

Savez-vous ce qui me permettrait de corriger cela ?

Je vous joins à ce mail le code en question, ainsi que le lien de téléchargement.

D'avance, merci beaucoup...

LIEN

Code :

QUOTE
<?php

//Recent Forum Post include by [pushyVII].
//1.01 Fixed post display
//Only edit when it says its editable. Don't edit when it says don't change.
//but you can =] of course, but you might screw something up.
//read instructions if you have issues.



// no. of posts to show

$posts = "5"; // editable - only chage the number.

//required files, do NOT edit.

require "ips_kernel/class_db_mysql.php";
require "conf_global.php";

//database stuff - do NOT edit as the conf_global.php should have the sql details.

$db = new db_driver;
$db->obj['sql_database']  = $INFO['sql_database'];
$db->obj['sql_user']      = $INFO['sql_user'];
$db->obj['sql_pass']      = $INFO['sql_pass'];
$db->obj['sql_host']      = $INFO['sql_host'];
$db->obj['sql_tbl_prefix']= $INFO['sql_tbl_prefix'];

$db->connect();

$query = $db->query("SELECT last_poster_name, last_poster_id, title, tid, forum_id, last_post FROM ibf_topics ORDER BY last_post DESC LIMIT 0,".$posts);



//how it is displayed - editable

while($out = $db->fetch_row($query))
{
echo "
<table bgcolor=\"#E9E7DA\" width=\"100%\" border=\"0\" cellspacing=\"3\" cellpadding=\"0\">
 
  <tr>
    <td ><a href=\"$INFO[board_url]/http://ipb2.ipbr-fr.com/index.php?showtopic=$out[tid]&view=getnewpost\" class=\"Style1\">$out[title]</a></td>
  </tr>
  <tr>
    <td><span class=\"Style2\">Par <a href=\"$INFO[board_url]/index.php?showuser=$out[last_poster_id]\">$out[last_poster_name]</a></span><br></td>
  </tr>

    <tr>
          <td  colspan=\"2\" background=\"img/separ2.gif\"><font size=\"1\"><img src=\"img/invisible.gif\" width=\"1\" height=\"1\"></font></td>

  </tr>
</table>";
}
// change the by to whatever you want.
// make sure it has the link within the link tags.
//make sure it is all within the echo part.

?>
Youp3
Bon essayez ceci :

Remplacez ceci :
CODE
$query = $db->query("SELECT last_poster_name, last_poster_id, title, tid, forum_id, last_post FROM ibf_topics ORDER BY last_post DESC LIMIT 0,".$posts);
par
CODE
$query = $db->query("SELECT last_poster_name, last_poster_id, title, tid, forum_id, last_post FROM ibf_topics WHERE forum_id NOT IN (x,y,z) ORDER BY last_post DESC LIMIT 0,".$posts);


Remplacez x, y et z par l'id des forums dont vous ne voulez pas que les messages apparaissent et complétez éventuellement la liste. Le séparateur est la virgule.
noobforum
Merci mille fois !

A bientôt smile.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.