User videos now come via ajax
This commit is contained in:
parent
ac84fc4cd8
commit
a99a3f401c
1 changed files with 34 additions and 2 deletions
|
@ -1,8 +1,9 @@
|
|||
{$myAccountLinks = $userquery->my_account_links()}
|
||||
{$leftMenuLinks = array_slice($myAccountLinks, 7)}
|
||||
{lang code='channel' assign='object_type'}
|
||||
{$uservideos=get_videos(["user"=>$user.userid, "order"=>"date_added DESC"])}
|
||||
{$uservideos=get_videos(["user"=>$user.userid, "order"=>"date_added DESC","limit" =>10])}
|
||||
{$first_video = $uservideos.0}
|
||||
{$total_videos = $user.total_videos}
|
||||
<div id="main" class="container clearfix">
|
||||
<div class="clearfix">
|
||||
{include file="$style_dir/blocks/view_channel/channel_header.html"}
|
||||
|
@ -100,13 +101,14 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="tab-pane videos fade in clearfix active" id="user-videos">
|
||||
<div class="clearfix row">
|
||||
<div class="clearfix row user_vids">
|
||||
{if $uservideos}
|
||||
{foreach $uservideos as $video}
|
||||
<div class="item-video col-lg-4 col-md-4 col-sm-6 col-xs-12">
|
||||
{include file="$style_dir/blocks/videos/video.html" display_type='homeVideos'}
|
||||
</div>
|
||||
{/foreach}
|
||||
<button id="more-view-channel" class="btn btn-primary text-centre" dataLimit="10" dataHit="2">Load More</button>
|
||||
{else}
|
||||
<div class="well well-info">No Videos Found !</div>
|
||||
{/if}
|
||||
|
@ -308,4 +310,34 @@ $('#cover_info').show();
|
|||
var total = $(this).attr("total");
|
||||
load_more(limit,mode,inner_mode,append_id,attrb,cat_id,total);
|
||||
});
|
||||
|
||||
$('#container').on("click","#more-view-channel",function(){
|
||||
loadHit = $(this).attr('dataHit');
|
||||
loadLimit = $(this).attr('dataLimit');
|
||||
user = "{$smarty.get.user}";
|
||||
totalVids = "{$total_videos}";
|
||||
nextHit = parseInt(loadHit) + 1;
|
||||
$.ajax({
|
||||
url: baseurl + "/ajax/view_channel.php",
|
||||
type: "post",
|
||||
dataType: "html",
|
||||
data: {
|
||||
"mode":'channelMore',
|
||||
"loadHit":loadHit,
|
||||
"loadLimit":loadLimit,
|
||||
"totalVids":totalVids,
|
||||
"userid":user,
|
||||
},
|
||||
|
||||
success: function(data) {
|
||||
$('#more-view-channel').remove();
|
||||
if (data.length > 1) {
|
||||
$(data).appendTo('.user_vids').fadeIn('slow');
|
||||
$('<button id="more-view-channel" class="btn btn-primary text-centre" dataLimit="'+loadLimit+'" dataHit="'+nextHit+'">Load More</button>').appendTo('.user_vids').fadeIn('slow');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
|
Loading…
Add table
Reference in a new issue