Tema
by user
e sada bi volio da pise
tema
by user
datum: datum zadnjeg odgovora
e sad stvarno ne znam vaditi iz MySQL pa ako moze mala pomoc...
Code:
$posts = "5"; // Change this to how many posts you want displayed
//////////////
// Required //
//////////////
require "forum/ips_kernel/class_db_mysql.php";
require "forum/conf_global.php";
//////////////
// Database //
//////////////
$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);
/////////////////
// Post Format //
/////////////////
while($out = $db->fetch_row($query))
{
echo "
<a href=\"$INFO[board_url]/index.php?showtopic=$out[tid]&view=getnewpost\">$out[title]</a><br> by
<a href=\"$INFO[board_url]/index.php?showuser=$out[last_poster_id]\">$out[last_poster_name]</a><br /><br>";
}
// Change this to the format you want but make sure its in the echo ""; command,
// and has the whole link that is inside the <a> command or it will not work
?>
$posts = "5"; // Change this to how many posts you want displayed
//////////////
// Required //
//////////////
require "forum/ips_kernel/class_db_mysql.php";
require "forum/conf_global.php";
//////////////
// Database //
//////////////
$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);
/////////////////
// Post Format //
/////////////////
while($out = $db->fetch_row($query))
{
echo "
<a href=\"$INFO[board_url]/index.php?showtopic=$out[tid]&view=getnewpost\">$out[title]</a><br> by
<a href=\"$INFO[board_url]/index.php?showuser=$out[last_poster_id]\">$out[last_poster_name]</a><br /><br>";
}
// Change this to the format you want but make sure its in the echo ""; command,
// and has the whole link that is inside the <a> command or it will not work
?>