Parašė edis2· 2009 Vas. 4 13:02:12
#2
echo "<table width='100%'>
<tr>
<td width='50%'>";
opentable("Populiariausi filmukai");
$tickerquery = dbquery("SELECT tn.*, tu.user_id,user_name ,COUNT(comment_item_id) AS movie_comments
FROM ".$db_prefix."movie tn
LEFT JOIN ".$db_prefix."users tu ON tn.movie_name=tu.user_id
LEFT JOIN ".$db_prefix."comments ON movie_id=comment_item_id AND comment_type='K'
GROUP BY movie_id
ORDER BY movie_reads DESC LIMIT 0,5");
$ticker_content = "";
while($data = dbarray($tickerquery)) {
$ticker_content .= "<img src='".THEME."images/bullet.gif'> <a href=\"".INFUSIONS."movie/movies.php?movie_id=".$data['movie_id']."\">".$data['movie_subject']."</a><br> ";
if($ticker_author+$ticker_date+$ticker_comments+$ticker_reads != "0" ) {
$ticker_content .= "[";
}
}
echo $ticker_content;
closetable();
echo "</td>
<td width='50%'>";
opentable("Populiariausi straipsniai");
$result = dbquery(
"SELECT ta.*,tac.* FROM ".$db_prefix."articles ta
INNER JOIN ".$db_prefix."article_cats tac ON ta.article_cat=tac.article_cat_id
WHERE ".groupaccess('article_cat_access')." ORDER BY article_datestamp DESC LIMIT 0,7"
);
if (dbrows($result) != 0) {
while($data = dbarray($result)) {
$itemsubject = trimlink($data['article_subject'], 20);
echo "<img src='".THEME."images/bullet.gif' alt=''> <a href='".BASEDIR."readarticle.php?article_id=".$data['article_id']."' title='".$data['article_subject']."' class='side'>$itemsubject</a><br>\n";
}
} else {
echo "<center>".$locale['004']."</center>\n";
}
echo "</td></table>";
closetable();
Taip reikia??