<?
/**
  * Script  to get the latests posts from IPB (Invision Power Board)
  *
  * By Bjørn Børresen - http://www.bie.no/blog/
  *
  * This work is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License.
  */
require_once '/home/vusers/<EDIT_FULL_PATH_TO_IPB_HERE>/wwwdocs/forum/conf_global.php';

$db_name $INFO['sql_database'];
$db_user $INFO['sql_user'];
$db_pass $INFO['sql_pass'];
$db_host $INFO['sql_host'];
    
$forum_ids "12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,33,35,37,38,39,40,42,44,45,46,47,48,49,50,53,55";        // the id's of the forum you want to retrieve posts from
$url "http://www.root.no/forum/index.php?showtopic=";
$num 10;        // number of posts to show

$db mysql_connect($db_host$db_user$db_pass);

if (
$db) {
    
mysql_select_db($db_name);
    
    
$sql "SELECT tid, title FROM `ibstopics` WHERE forum_id IN($forum_ids) ORDER BY `last_post` DESC LIMIT 0 , $num";    
    
$res mysql_query($sql);
    while(
$row mysql_fetch_array($res)) {
        echo 
"<li><a href='".$url.$row['tid']."'>".utf8_encode($row['title'])."</a></li>";
    }
}    

 
?>