if (!defined("IN_FUSION")) { die("Access Denied"); }
echo '<style type="text/css">
.ratings_glob {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
</style>';
if ($settings['ratings_enabled'] == "1") {
$where = "";
// Allgemeines
$result_order_rights = dbquery("SELECT * FROM ".DB_ADMIN);
while ($order_rights = dbarray($result_order_rights)) {
$rights = array("admin_rights" => $order_rights['admin_rights'], );
// Where Abfrage aufbauen
foreach ($rights AS $right) {
if (!checkrights($right)) {
$where .= ($where ? " AND " : "")."submit_type !='".$right."'";
}}}
if (iADMIN && checkrights($right) ) {
$where_rating = "";
} else {
$where_rating = "AND rating_main='0'";
}
$result = dbquery(" SELECT c.*, a.*
FROM ".DB_RATINGS." c
LEFT JOIN ".DB_RATINGS_ADD." a ON c.rating_type=a.add_rating_type
WHERE (".groupaccess('user_access')." || rating_user='".$userdata['user_id']."') $where_rating
GROUP BY c.rating_type , c.rating_item_id
ORDER BY MAX(rating_datestamp) DESC LIMIT 100
");
$rows = dbrows($result);
if ($rows) {
openside("Latest Ratings Panel");
while($data = dbarray($result)) {
if ($data['rating_draft'] == '1' || $data['rating_hidden'] == '0' ) { } else {
$rating = $data['rating_subject'];
echo "<div class='ratings_glob'><a href='".BASEDIR.$data['add_rating_url']."".$data['add_rating_page']."=".$data['rating_item_id']."#rating_100' title='".$data['add_rating_name']."' class='side'><i style='text-align:center; width: 16px; margin-right: 2px;' class='".$data['add_rating_icon']."' ></i>".$data['rating_user']." -- ".$rating."</a></div>
\n";
}
}
closeside();
} else {
}
}
INSERT INTO `fusion4uaj3_ratings` (`rating_id`, `compare_rights`, `user_access`, `rating_item_id`, `rating_type`, `rating_subject`, `rating_user`, `rating_vote`, `rating_datestamp`, `rating_ip`, `rating_ip_type`, `rating_hidden`, `rating_draft`, `rating_main`) VALUES
(5, 'RAT', 0, 2, 'A', '111', 6, 3, 1518084338, '0', 6, 1, 0, 0),
(7, 'RAT', 0, 2, 'A', '111', 1, 3, 1518090546, '0', 6, 1, 0, 0),
(8, 'RAT', 0, 3, 'A', '2222222222222', 1, 5, 1518091489, '0', 6, 1, 0, 0),
(9, 'RAT', 0, 2, 'N', '11111111', 1, 5, 1518091871, '0', 6, 1, 0, 0),
(10, 'RAT', 0, 1, 'N', 'aaaaa', 1, 5, 1518091900, '0', 6, 1, 0, 0),
(11, 'RAT', 0, 1, 'N', 'aaaaa', 4, 4, 1518092162, '0', 6, 1, 0, 0),
(12, 'RAT', 0, 3, 'N', 'kk,k,k,k,k,', 1, 5, 1518092386, '0', 6, 1, 0, 0);
rating_id 10 & 11 gehören mit 0, 1, zusammen zu ein und derselben Bewertung.
Ausgegeben wird mir jetzt aber die 10 obwohl die 11 Jünger ist, die Ausgabe darf aber nur einzeln sein zur rating_item_id.
Zusammengefügt am 10. Februar 2018 um 09:04:03:
rating_id 10 & 11 gehören mit 1, N, zusammen zu ein und derselben Bewertung. |