Parašė BloodKiller· 2007 Rugp. 18 20:08:07
#6
Parasiau kazka as cia. :D Tik va, visas naujienas tektu deti i kategorijas, o i istrauka rasyti tik nuoroda iki norimo paveikslelio. :) Beje, naudokite BBCode tag'us, o ne
HTML. Siuo kodu keiskite visa news.php koda.
<?php
/*www.webdnd.com*/
require_once "maincore.php";
require_once "subheader.php";
require_once "side_left.php";
if (!isset($_GET['readmore'])) {
$result = dbquery("SELECT * FROM ".$db_prefix."news_cats ORDER BY news_cat_id");
while ($data = dbarray($result)) {
opentable($data['news_cat_name']);
$res = dbquery("SELECT * FROM ".$db_prefix."news WHERE news_cat = '".$data['news_cat_id']."' ORDER BY news_datestamp DESC LIMIT 0,3");
while ($ndata = dbarray($res)) {
echo "<table width='100%'>
<tr><td valign='top' width='100'>".(verify_image($ndata['news_news']) ? "<img src='".$ndata['news_news']."'>" : "")."</td><td valign='top'><b>".showdate("%d.%m.%Y %H:%M:%S",$ndata['news_datestamp'])." <a href='".FUSION_SELF."?readmore=".$ndata['news_id']."'>".$ndata['news_subject']."</a></b><br>".parseubb(parsesmileys(stripinput(trimlink($ndata['news_extended'],200))))."<table align='right'><tr><td><a href='".FUSION_SELF."?readmore=".$ndata['news_id']."'><b>skaityti viską</b></a></td></tr></table></td></tr>
</table>\n";
}
echo "<a href='".BASEDIR."news_cats.php?cat_id=".$data['news_cat_id']."'><b>Skaityti toliau</b></a><br>\n";
closetable();
tablebreak();
}
} else {
if (!dbcount("(*)","news","news_id = '".$_GET['readmore']."'")) fallback("index.php");
$readmore = $_GET['readmore'];
$result = dbquery("SELECT * FROM ".$db_prefix."news LEFT JOIN ".$db_prefix."users ON news_name = user_id WHERE news_id = '$readmore'");
$data = dbarray($result);
opentable("Naujienos");
echo "<table width='100%'>
<tr><td valign='top'>".(verify_image($data['news_news']) ? "<img src='".$data['news_news']."'>" : "")."</td><td valign='top'><b>".$data['news_subject']."</b><br><b>".showdate("%d.%m.%Y %H:%M:%S",$data['news_datestamp'])." - <a href='".BASEDIR."profile.php?lookup=".$data['user_id']."'>".$data['user_name']."</a></b><br><br>".parseubb(parsesmileys(stripinput($data['news_extended'])))."</td></tr>
</table>\n";
closetable();
}
require_once "side_right.php";
require_once "footer.php";
?>
Redagavo BloodKiller· 2007 Rugp. 18 22:08:42