IPB versija: 2.3.X
Izvada jaunumus no IPB foruma uz Jūsu mājaslapu..
Code
<?php
$forums = "http://domains/f/"; // noraadam urliiti uz forumu
$limits = "4"; // topiku limits jaunumos
$forumaID = "2"; // forums no kura velkam aaraa jaunumus
$host = "localhost";
$dbname = "db";
$dbuser = "users";
$dbpass = "parole";
$link = mysql_connect($host, $dbuser, $dbpass)
or die("NEsanaaca piekontektities: " . mysql_error());
mysql_select_db($dbname) or die("Datubaaze neekstistee");
mysql_query("SET NAMES utf8"); // diezgan noziimiigs kveriijs, ja nee sh un zh vietaa buus nesmuki kjeburi
// dabuunam datus no DB
$kverisdivi = mysql_query("SELECT * FROM ibf_topics WHERE forum_id=".$forumaID." ORDER BY start_date DESC LIMIT ".$limits.""); // shito nedriikst aizmirst, ja nee baigiee suudi ar charstetiem iznaaks
echo "<h1>Jaunumi</h1><br><br>";
// izvadam jaunumus
while($row = mysql_fetch_array( $kverisdivi )) {
$rowis = mysql_fetch_array( mysql_query("SELECT * FROM ibf_posts WHERE topic_id = ".$row['tid']." ORDER by post_date LIMIT ".$limits.""));
echo "<h3><a href=\"$forums/index.php?showtopic=".$row['tid']."\">".$row['title']."</a> <br><br>
</h3>";
echo "<div>".$rowis['post']."</div>
";
echo "<div>autors: <a href=\"$forums/index.php?showuser=".$row['starter_id']."\">".$row['starter_name']."</a></div><br><br><hr>";
}
?>
Nomainam datus:
Code
$forums = "http://domains/f/"; // noraadam urliiti uz forumu
$limits = "4"; // topiku limits jaunumos
$forumaID = "2"; // forums no kura velkam aaraa jaunumus
$host = "localhost";
$dbname = "db";
$dbuser = "users";
$dbpass = "parole";