Jump to content
php.lv forumi

IPB Last Topic script


JaKuT

Recommended Posts

Problema ir sekojosa, nerada pareizu laiku un teksta title no foruma iet aiz ramisa paredzeta kur jabut tam visam.

Paradisu ar piemeriem:

 

Tagad: 02:00 - Sveix, ka iet? ko dari?

 

Vajag lai ir taa: 02:00 - Sveix, ka...

 

Un laiks ari bisu laiku rada tikai ka 02:00 bet isto laiku kad pievieno, vai ieraksta taja tema, nerada :(

 

Pats skripts:

<?php
// Noradi datus
$host = "localhost"; // db hosts
$dbname = "forum"; // DB
$dbuser = "root"; // db useris
$dbpass = ""; // db parole
?>
<?php
$platums = "100"; // platums (px)
$forums = "/f/"; // foruma url
$limits = "7"; // cik posti uzraadiisies
$link = mysql_connect($host, $dbuser, $dbpass)
or die("Nesanaaca piekonekteeties: " . mysql_error());
mysql_select_db($dbname) or die("Datubaze neekstiste");
mysql_query("SET NAMES UTF-8"); // NEAIZTIEC


$kverisdivi = mysql_query("SELECT posts, last_poster_name, last_poster_id, title, tid, forum_id, last_post FROM ibf_topics ORDER BY last_post DESC LIMIT ".$limits."");
echo "<div>";

while($row = mysql_fetch_array( $kverisdivi )) {
 $datums = $row['start_date'];
 $piev_datums = date("H:i",$datums);
echo "<p><b>$piev_datums - </b> <a style='text-decoration: none' href=\"$forums/index.php?showtopic=".$row[tid]."&view=getnewpost\" title=\"\">".$row[title]."</a><br></p>";
}
echo "</div>";

?>

Link to comment
Share on other sites

  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...