Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: Reikia pagalbos

Parašė WyPuk· 2009 Lie. 5 12:07:22
#1

Sveiki, man reikėtu pagalbos kaip šioje panelėje padaryti, kad rodytu tik įvertintas naujienas:
openside("Top filmai");
$result = dbquery("SELECT tn.*, SUM(tr.rating_vote) AS sum_rating, COUNT(tr.rating_item_id) AS count_votes FROM
".$db_prefix."news tn
LEFT JOIN ".$db_prefix."ratings tr ON tn.news_id=tr.rating_item_id AND tr.rating_type='N'
GROUP BY news_subject
ORDER BY SUM(tr.rating_vote) DESC LIMIT 10");

if (dbrows($result)) {
echo "<table cellpadding='0' cellspadding='0' class='tbl-border'>";
echo "<tr>
<td class='tbl2'><b>Filmo pavadinimas</b></td>
<td class='tbl2' width='1%' align='center'><b>Įvertinimas</b></td>
</tr>";

$i = 0;
while ($data = dbarray($result)) {
$rating = "<div style='background:url(http://img80.imageshack.us/img80/3918/ratingsbghp8.gif); height:21px; width:105px;'>".($data['count_votes'] > 0 ? str_repeat("<img src='http://img165.imageshack.us/img165/8202/starwd7.gif' alt='*' style='vertical-align:middle'>", ceil($data['sum_rating'] / $data['count_votes'])) : "")."</div>";
echo "<tr>
<td class='".($i%2?"tbl1":"tbl2")."'><a href='".BASEDIR."news.php?readmore=".$data['news_id']."'>".trimlink($data['news_subject'],25)."</a></td>
<td class='".($i%2?"tbl1":"tbl2")."'>$rating</td>";
$i++;
}

echo "</table>";
} else {
echo "<center>Naujienų Nėra</center>";
}
closeside();





Iš anksto dėkoju

Parašė And2s· 2009 Lie. 5 13:07:25
#2

openside("Top filmai");
$result = dbquery("SELECT tn.*, SUM(tr.rating_vote) AS sum_rating, COUNT(tr.rating_item_id) AS count_votes FROM
".$db_prefix."news tn
LEFT JOIN ".$db_prefix."ratings tr ON tn.news_id=tr.rating_item_id AND tr.rating_type='N'
GROUP BY news_subject
ORDER BY SUM(tr.rating_vote) DESC LIMIT 10");

if (dbrows($result)) {
echo "<table cellpadding='0' cellspadding='0' class='tbl-border'>";
echo "<tr>
<td class='tbl2'><b>Filmo pavadinimas</b></td>
<td class='tbl2' width='1%' align='center'><b>Įvertinimas</b></td>
</tr>";

$i = 0;
while ($data = dbarray($result)) {
if ($data['rating_item_id']) {
$rating = "<div style='background:url(http://img80.imageshack.us/img80/3918/ratingsbghp8.gif); height:21px; width:105px;'>".($data['count_votes'] > 0 ? str_repeat("<img src='http://img165.imageshack.us/img165/8202/starwd7.gif' alt='*' style='vertical-align:middle'>", ceil($data['sum_rating'] / $data['count_votes'])) : "")."</div>";
echo "<tr>
<td class='".($i%2?"tbl1":"tbl2")."'><a href='".BASEDIR."news.php?readmore=".$data['news_id']."'>".trimlink($data['news_subject'],25)."</a></td>
<td class='".($i%2?"tbl1":"tbl2")."'>$rating</td>";
$i++;
}
}

echo "</table>";
} else {
echo "<center>Naujienų Nėra</center>";
}
closeside();



Redagavo And2s· 2009 Lie. 5 13:07:46

Parašė WyPuk· 2009 Lie. 5 13:07:32
#3

Neveikia.

Parašė And2s· 2009 Lie. 5 14:07:18
#4

openside("Top filmai");
$result = dbquery("SELECT tn.*, SUM(tr.rating_vote) AS sum_rating, COUNT(tr.rating_item_id) AS count_votes FROM
".$db_prefix."news tn
LEFT JOIN ".$db_prefix."ratings tr ON tn.news_id=tr.rating_item_id AND tr.rating_type='N'
GROUP BY news_subject
ORDER BY SUM(tr.rating_vote) DESC LIMIT 10");

if (dbrows($result)) {

echo "<table cellpadding='0' cellspadding='0' class='tbl-border'>";
echo "<tr>
<td class='tbl2'><b>Filmo pavadinimas</b></td>
<td class='tbl2' width='1%' align='center'><b>Įvertinimas</b></td>
</tr>";

$i = 0;
while ($data = dbarray($result)) {
$result = dbquery("SELECT * FROM ".DB_PREFIX."ratings WHERE rating_item_id='".$data['news_id']."' AND rating_type='N'");
if (dbrows($result) > 0) {
$rating = "<div style='background:url(http://img80.imageshack.us/img80/3918/ratingsbghp8.gif); height:21px; width:105px;'>".($data['count_votes'] > 0 ? str_repeat("<img src='http://img165.imageshack.us/img165/8202/starwd7.gif' alt='*' style='vertical-align:middle'>", ceil($data['sum_rating'] / $data['count_votes'])) : "")."</div>";
echo "<tr>
<td class='".($i%2?"tbl1":"tbl2")."'><a href='".BASEDIR."news.php?readmore=".$data['news_id']."'>".trimlink($data['news_subject'],25)."</a></td>
<td class='".($i%2?"tbl1":"tbl2")."'>$rating</td>";
$i++;
}
}

echo "</table>";
} else {
echo "<center>Naujienų Nėra</center>";
}
closeside();




Parašė WyPuk· 2009 Lie. 5 14:07:27
#5

Dabar veiktu, bet rodo tik vieną įvertintą filmą, o kaip kitus įvertini jų nerodo.

Redagavo WyPuk· 2009 Lie. 5 14:07:51

Parašė bad_user· 2009 Lie. 5 14:07:39
#6

DESC LIMIT 0,10

Parašė WyPuk· 2009 Lie. 5 14:07:10
#7

Visvien tas pats ?|

Parašė WyPuk· 2009 Lie. 5 15:07:34
#8

Tai niekas nepadės?

Parašė Ultriukas pydariuk· 2009 Lie. 5 15:07:57
#9

net SoNG'o blogas. :D

Parašė ex-it· 2009 Lie. 5 16:07:13
#10

openside("Top filmai");
$result = dbquery("SELECT tn.*, SUM(tr.rating_vote) AS sum_rating, COUNT(tr.rating_item_id) AS count_votes FROM
".$db_prefix."news tn
LEFT JOIN ".$db_prefix."ratings tr ON tn.news_id=tr.rating_item_id AND tr.rating_type='N'
GROUP BY news_subject
ORDER BY SUM(tr.rating_vote) DESC LIMIT 10");

if (dbrows($result)) {

echo "<table cellpadding='0' cellspadding='0' class='tbl-border'>";
echo "<tr>
<td class='tbl2'><b>Filmo pavadinimas</b></td>
<td class='tbl2' width='1%' align='center'><b>Įvertinimas</b></td>
</tr>";

$i = 0;
while ($data = dbarray($result)) {
$resulta = dbquery("SELECT * FROM ".DB_PREFIX."ratings WHERE rating_item_id='".$data['news_id']."' AND rating_type='N'");
if (dbrows($resulta) > 0) {
$rating = "<div style='background:url(http://img80.imageshack.us/img80/3918/ratingsbghp8.gif); height:21px; width:105px;'>".($data['count_votes'] > 0 ? str_repeat("<img src='http://img165.imageshack.us/img165/8202/starwd7.gif' alt='*' style='vertical-align:middle'>", ceil($data['sum_rating'] / $data['count_votes'])) : "")."</div>";
echo "<tr>
<td class='".($i%2?"tbl1":"tbl2")."'><a href='".BASEDIR."news.php?readmore=".$data['news_id']."'>".trimlink($data['news_subject'],25)."</a></td>
<td class='".($i%2?"tbl1":"tbl2")."'>$rating</td>";
$i++;
}
}

echo "</table>";
} else {
echo "<center>Naujienų Nėra</center>";
}
closeside();



Parašė WyPuk· 2009 Lie. 5 19:07:41
#11

ex-it parašė:
openside("Top filmai");
$result = dbquery("SELECT tn.*, SUM(tr.rating_vote) AS sum_rating, COUNT(tr.rating_item_id) AS count_votes FROM
".$db_prefix."news tn
LEFT JOIN ".$db_prefix."ratings tr ON tn.news_id=tr.rating_item_id AND tr.rating_type='N'
GROUP BY news_subject
ORDER BY SUM(tr.rating_vote) DESC LIMIT 10");

if (dbrows($result)) {

echo "<table cellpadding='0' cellspadding='0' class='tbl-border'>";
echo "<tr>
<td class='tbl2'><b>Filmo pavadinimas</b></td>
<td class='tbl2' width='1%' align='center'><b>Įvertinimas</b></td>
</tr>";

$i = 0;
while ($data = dbarray($result)) {
$resulta = dbquery("SELECT * FROM ".DB_PREFIX."ratings WHERE rating_item_id='".$data['news_id']."' AND rating_type='N'");
if (dbrows($resulta) > 0) {
$rating = "<div style='background:url(http://img80.imageshack.us/img80/3918/ratingsbghp8.gif); height:21px; width:105px;'>".($data['count_votes'] > 0 ? str_repeat("<img src='http://img165.imageshack.us/img165/8202/starwd7.gif' alt='*' style='vertical-align:middle'>", ceil($data['sum_rating'] / $data['count_votes'])) : "")."</div>";
echo "<tr>
<td class='".($i%2?"tbl1":"tbl2")."'><a href='".BASEDIR."news.php?readmore=".$data['news_id']."'>".trimlink($data['news_subject'],25)."</a></td>
<td class='".($i%2?"tbl1":"tbl2")."'>$rating</td>";
$i++;
}
}

echo "</table>";
} else {
echo "<center>Naujienų Nėra</center>";
}
closeside();




Štai kur žmogus protingas, ačiū ;)