Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Sign In
Not a member yet? Click here to register.

Video Infusion PRO - Last video center panel

How can I show only my last 3 videos in my last video center panel:

Here is the code:

Quote

if (!defined("IN_FUSION"wink) { die("Access Denied"wink; }

if (file_exists(INFUSIONS."video/locale/".$settings['locale'].".php"wink) {
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"wink;
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'wink . " GROUP BY v.id ORDER BY time DESC LIMIT 0,4"wink;
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'] != ""wink {
$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"wink);
} 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"wink . "' alt='*' style='vertical-align:middle; width: 13px; height: 13px;' />",
ceil($data['sum_rating'] / $data['count_votes'])) : "<small>" . $locale['n_y_r'] .
"</small>"wink : "<small>" . $locale['n_y_r'] . "</small>"wink;
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();
}
?>
$admin = dbquery("SELECT * FROM " . DB_VIDEO_SET . " LIMIT 0,1");

change the limit from 1 to 3 :)
Did'nt change anything sad

I change to this instead from 4 to 3:

Quote

WHERE " . groupaccess('vc.cat_access'wink . " GROUP BY v.id ORDER BY time DESC LIMIT 0,3"wink;


Worked great, Thx for the lead to a solution smile
Thread Information
Author
Replies
3 posts
Views
2,706 times
Last Post
Last updated on 6 years ago
You can view all discussion threads in this forum.
You cannot set up a bounty in this discussion thread.
You can start a new discussion thread in this forum.
You cannot reply in this discussion thread.
You cannot start on a poll in this forum.
You cannot upload attachments in this forum.
You can download attachments in this forum.
You cannot up or down-vote on the post in this discussion thread.
Users who participated in discussion: quiki, faga