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.
Not a member yet? Click here to register.
Forgot Password?

Video Infusion PRO - Last video center panel

Asked Modified Viewed 3,193 times
Q
quiki
Q
quiki 10
  • Member, joined since
  • Contributed 171 posts on the community forums.
  • Started 41 threads in the forums
  • Started this discussions
asked
Member

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();
}
?>
0 replies

2 posts

F
faga
F
faga 10
I choose a lazy person to do a hard job. Because a lazy person will find an easy way to do it.” - Bill Gates
  • Member, joined since
  • Contributed 158 posts on the community forums.
  • Started 14 threads in the forums
answered
Member

$admin = dbquery("SELECT * FROM " . DB_VIDEO_SET . " LIMIT 0,1");

change the limit from 1 to 3 :)
0 replies
Q
quiki
Q
quiki 10
  • Member, joined since
  • Contributed 171 posts on the community forums.
  • Started 41 threads in the forums
  • Started this discussions
answered
Member

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
0 replies

Category Forum

Panels and Infusions

Labels

None yet

Statistics

  • Views 0 views
  • Posts 2 posts
  • Votes 0 votes
  • Topic users 2 members

2 participants

Q
Q
quiki 10
  • Member, joined since
  • Contributed 171 posts on the community forums.
  • Started 41 threads in the forums
  • Started this discussions
F
F
faga 10
I choose a lazy person to do a hard job. Because a lazy person will find an easy way to do it.” - Bill Gates
  • Member, joined since
  • Contributed 158 posts on the community forums.
  • Started 14 threads in the forums

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet