Jump to content
php.lv forumi

IPB Jaunumu skripts.


JaKuT

Recommended Posts

Gribu uztaisit skriptu, bet nesanak nezinu kaa..

Lai jaunumi rakstas taa nevis taka man, viss viena loga, bet lai rakstas katrs sava loga.

Radisu piemeru ar bildem.

Tas ir kur stulbi izskatas:

13114699.th.jpg

A gribu lai taa vini rakstitos:

57056629.th.jpg

 

Un rekur pats skripts ceru ka juus man palidzesiet vinu uzrakstit un uztaisit :) :

<!----Vidus---->
<td valign="top" width="100%">
<div class="r_col_wrap">
   <div class="r_col_top">Новости</div>
   <div class="r_col_content">

<?php
$forums = "http://localhost/f"; // noraadam adresi uz forumu
$limits = "5"; // topiku limits jaunumos
$zinas = "8"; // forums no kura velkam aaraa jaunumus
$host = "localhost"; // hosts, parasti localhost
$dbname = "forum"; // foruma db
$dbuser = "root"; // foruma db useris
$dbpass = ""; // foruma db parole

$link = mysql_connect($host, $dbuser, $dbpass)

or die("Неполучилось подконектится к MySQL: " . mysql_error());

mysql_select_db($dbname) or die("Базы данных не существует");

mysql_query("SET NAMES utf8");

$kverisdivi = mysql_query("SELECT * FROM ibf_topics WHERE forum_id=".$zinas." 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",$datums);

echo "<center><strong>".$row['title']."</strong></center> <br />";

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

echo "<div>         $piev_datums                 <u>Комментариев: (<a href=\"$forums/index.php?showtopic=".$row['tid']."&view=getlastpost\">".$row['posts']."</a>)</u>                  Добавил: ".$row['starter_name']."<hr /><br />";

echo "";

}
?>

P.S Nav obligati ar so skriptu, var kaut ko citadaku izdomat, bet labak buutu jau caur IPB, jo daudziem redzeju kas tas ir iespejams.

Link to comment
Share on other sites

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...