Quote
if (!defined("IN_FUSION") { die("Access Denied" }
if (file_exists(INFUSIONS."video/locale/".$settings['locale'].".php") {
include INFUSIONS."video/locale/English.php";
include INFUSIONS."video/locale/".$settings['locale'].".php";
} else {
include INFUSIONS."video/locale/English.php";
}
include INFUSIONS . "video/infusion_db.php";
require_once INCLUDES . "bbcode_include.php";
$admin = dbquery("SELECT * FROM " . DB_VIDEO_SET . " LIMIT 0,1"
while ($d = dbarray($admin)) {
$access = $d['sub_enable'];
$t_width = $d['t_width'];
$t_height = $d['t_height'];
$maxi = $d['items'];
}
$column = dbquery("SELECT columns FROM " . DB_VIDEO_SET);
if ($column) {
$columns = dbresult($column, 0);
} else {
$columns = 2;
}
$result = dbquery("SELECT v.*, vc.*, u.user_id, u.user_name, SUM(tr.rating_vote) AS sum_rating, COUNT(tr.rating_item_id) AS count_votes FROM " .
DB_VIDEO . " v
LEFT JOIN " . DB_VIDEO_CAT . " vc ON v.cat_id=vc.cat_id
LEFT JOIN " . DB_USERS . " u ON u.user_id=v.uid
LEFT JOIN " . DB_RATINGS .
" tr ON tr.rating_item_id = v.id AND tr.rating_type='V'
WHERE " . groupaccess('vc.cat_access' . " GROUP BY v.id ORDER BY time DESC LIMIT 0,4"
if (dbrows($result)) {
opentable($locale['latest-videos']);
$counter = 0;
$count = 1;
echo "<table cellpadding='0' cellspacing='1' class='tbl-border center' width='100%'>\n<tr>";
while($data = dbarray($result)) {
if ($counter != 0 && ($counter % $columns == 0)) {
echo "</tr>\n<tr>\n";
}
echo "<td valign='top' class='tbl' width='1%' style='padding: 0;'>";
echo "<table cellpadding='0' cellspacing='1' width='100%' class='center'>\n";
echo "<tr><td colspan='3' class='forum-caption'>";
echo "<a href='".INFUSIONS."video/video.php?id=" . $data['id'] . "'>" . $data['name'] . "</a>\n";
echo "</td></tr>";
echo "<tr><td width='1%' rowspan='2' class='tbl' valign='top'>";
echo "<a href='".INFUSIONS."video/video.php?id=" . $data['id'] . "'>";
if ($data['video_type'] == "youtube" && $data['url']) {
echo "<img src='http://img.youtube.com/vi/{$data['url']}/0.jpg' alt='' style='border:0; width: {$t_width}px; height: {$t_height}px;' />\n";
} elseif (!empty($data['file_image_thumb']) && file_exists(INFUSIONS."video/images/" . $data['file_image_thumb'])) {
echo "<img src='".INFUSIONS."video/images/" . $data['file_image_thumb'] .
"' alt='' style='border:0; width: {$t_width}px; height: {$t_height}px;' />\n";
} else {
echo "<img src='".INFUSIONS."video/images/cat_images/cat1.png' alt='' style='border:0; width: {$t_width}px; height: {$t_height}px;' />\n";
}
echo "</a></td><td width='99%' valign='top' class='tbl' colspan='2'>";
if ($data['description'] != "" {
$data['description'] = strip_bbcodes($data['description']);
$data['description'] = trimlink($data['description'], 90);
echo nl2br(parseubb(parsesmileys($data['description']),
"b|i|u|small|url|mail|img|color");
} else {
echo $locale['no_description_p'];
}
echo "</tr><tr><td width='50%' class='tbl' valign='bottom'><small>";
echo number_format($data['views']) . " " . $locale['v_tv'] . "</small><br />\n";
echo ($data['allow_ratings'] ? "" . ($data['count_votes'] > 0 ? str_repeat("<img src='" .
get_image("star" . "' alt='*' style='vertical-align:middle; width: 13px; height: 13px;' />",
ceil($data['sum_rating'] / $data['count_votes'])) : "<small>" . $locale['n_y_r'] .
"</small>" : "<small>" . $locale['n_y_r'] . "</small>"
echo "</td><td width='50%' class='tbl' valign='bottom'>";
echo "<small><b>{$locale['video_author']} <a href='".BASEDIR."profile.php?lookup=" . $data['user_id'] .
"' target='_self'>" . trimlink($data['user_name'], 12) .
"</a></b></small><br />";
echo "<small>" . showdate("shortdate", $data['time']) . "</small>";
echo "</td></tr></table>";
echo "</td>\n";
$counter++;
$count++;
}
echo "</tr>\n</table>\n";
closetable();
}
?>
Quote
WHERE " . groupaccess('vc.cat_access' . " GROUP BY v.id ORDER BY time DESC LIMIT 0,3"
Category Forum
Panels and InfusionsLabels
None yet
Statistics
2 participants
Notifications
You are not receiving notifications from this thread.
Related Questions