Jump to content
GIGN Forum

Sakarā Ar Vienu Script.


Krishaaa
 Share

Recommended Posts

<?php


$forums = "http://cs.1un2.lv/f"; // noraadam adresi uz forumu
$limits = "5"; // topiku limits jaunumos
$forumaID = "1"; // forums no kura velkam aaraa jaunumus
$host = "localhost"; // hosts, parasti localhost
$dbname = "forums"; // foruma db
$dbuser = "root"; // foruma db useris
$dbpass = "parole"; // foruma db 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"); 

$kverisdivi = mysql_query("SELECT * FROM ibf_topics WHERE forum_id=".$forumaID." ORDER BY start_date DESC LIMIT ".$limits.""); 



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.""));

$datums = $row['start_date'];

$piev_datums = date("d/m/Y - H:i:s",$datums);

echo "<a href=\"$forums/index.php?showtopic=".$row['tid']."\">".$row['title']."</a> (<strong style=\"color:#c0c0c0;font-weight:normal;\">".$row['description']."</strong>)<br />";

echo "<div>".$rowis['post']."</div><br />";

echo "<div> <strong>Datums: $piev_datums</strong> <strong>Autors: </strong><a href=\"$forums/index.php?showuser=".$row['starter_id']."\">".$row['starter_name']."</a>, <strong>Komentāri: (</strong><a href=\"$forums/index.php?showtopic=".$row['tid']."&view=getlastpost\">".$row['posts']."</a>) <hr />";

echo "";

}



?>

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...