Help - Search - Member List - Calendar
Full Version: [Traité]dernier id de plusieurs forums
IPBR-FR > Entraide > Forums dédiés aux mods majeures > IPB SDK
jona
forum : 1.3
SDK 1.0

je voudrais afficher le dernier topic écrit qui provient de plusieurs forums. Je sais le faire avec un seul forum il me renvoi l'id du dernier du forum mais des que je veux le faire sur plusieurs paf ca marche pas.

Voila le code qui marche pour un forum
CODE

<?
require_once "forums/sdk/ipbsdk_class.inc.php";
$SDK =& new IPBSDK();
$forumid = "15";
$topics = $SDK->get_forum_info($forumid);
$postid = $topics ['last_id'];
$info = $SDK->get_topic_info($postid);
$info['post_date'] = date(' d.m.Y  à H:i', $info['post_date']);
     

echo <<<HTML
<table width="90%" height="100%" cellspacing="0">
<tr>
 <td colspan="3"class="textenews">&nbsp;</td>
</tr>
 <tr>
 <td colspan="3"class="titrenews" > <a href="{$SDK->board_url}/http://ipb2.ipbr-fr.com/index.php?showtopic=$postid" target="_blank"> {$info['title']} </td>
</tr>
  <tr>
   <td>&nbsp;</td>
   <td>&nbsp;</td>
 </tr>
<tr>
 <td colspan="3"class="textenews"> {$info['post']} </td>
 </tr>
</table>

HTML;
?>


si je met un "array" pour mettre mes deux forums dans " $forumid =" ça plante j'ai plus rien.
CODE

$forumid = array("15","191");


Peut être j'utilise pas la bonne fonction.

Avez vous une idée ?

jona
j'ai trouvé faut juste que je mette limit à 1 :

CODE

<?
require_once "forums/sdk/ipbsdk_class.inc.php"; // Include SDK Functions and Files
$SDK =& new IPBSDK();

if ($topics = $SDK->list_forum_topics ($forumid, array("limit" => "1", "start" => "0", "order" => "desc", "orderby" => "start_date"), TRUE))
{
if (count($topics))
{
 foreach ($topics as $i)
 {
  $date = $SDK->sdk_date($i['start_date'] + ($time_offset * 3600), "d.m");
  $post = $i['post'];
  $url = $i['title'];
  $url = str_replace('é', 'e', $url);
  $url = str_replace('à', 'a', $url);
  $url = str_replace('è', 'e', $url);
  $url = str_replace('ê', 'e', $url);
  $url = str_replace('ë', 'e', $url);
  $url = str_replace(' ', '-', $url);
  $url = str_replace('?', '-', $url);
  $url = str_replace(':', '-', $url);
  $url = str_replace('[', '-', $url);
  $url = str_replace(']', '-', $url);
  $url = str_replace('/', '-', $url);
  $url = str_replace('*', '-', $url);
  $url = str_replace('+', '-', $url);      
  $url = str_replace('-', '-', $url);  
  $url = str_replace('!', '-', $url);
             
     echo  '<a href="'.$url.'-'.$i['tid'].'.html" target="_self">'.$i['title'].'</a><br />';
     echo $post;
 }
}
}

else
{
echo 'Erreur: '.$SDK->sdk_error();
}

?>
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.