Added : Added manage playlists feature at admin area also configured it with manage members
This commit is contained in:
parent
cce89cb18e
commit
e4947e9cc4
7 changed files with 558 additions and 5 deletions
202
upload/admin_area/manage_playlist.php
Normal file
202
upload/admin_area/manage_playlist.php
Normal file
|
@ -0,0 +1,202 @@
|
|||
<?php
|
||||
/*
|
||||
*******************************************
|
||||
| Copyright (c) 2007-2010 Clip-Bucket.com & (Arslan Hassan). All rights reserved.
|
||||
| @ Author : AwaisFiaz
|
||||
| @ Software : ClipBucket , © PHPBucket.com
|
||||
*******************************************
|
||||
*/
|
||||
require_once '../includes/admin_config.php';
|
||||
$userquery->admin_login_check();
|
||||
|
||||
$pages->page_redir();
|
||||
|
||||
/* Assigning page and subpage */
|
||||
if(!defined('MAIN_PAGE')){
|
||||
define('MAIN_PAGE', 'Videos');
|
||||
}
|
||||
if(!defined('SUB_PAGE')){
|
||||
define('SUB_PAGE', 'Manage Playlist');
|
||||
}
|
||||
|
||||
|
||||
$mode = $_GET['mode'];
|
||||
|
||||
$page = mysql_clean($_GET['page']);
|
||||
$get_limit = create_query_limit($page,VLISTPP);
|
||||
|
||||
|
||||
switch($mode)
|
||||
{
|
||||
case 'manage_playlist':
|
||||
case 'manage_video_playlist':
|
||||
default:
|
||||
{
|
||||
|
||||
//Deleting Playlist
|
||||
|
||||
if(!empty($_GET['delete_pl']))
|
||||
{
|
||||
$plid = mysql_clean($_GET['delete_pl']);
|
||||
$cbvid->action->delete_playlist($plid);
|
||||
}
|
||||
|
||||
if(isset($_POST['delete_playlists']))
|
||||
{
|
||||
$playlists = post('check_playlist');
|
||||
|
||||
if(count($playlists)>0)
|
||||
{
|
||||
foreach($playlists as $playlist)
|
||||
{
|
||||
$playlist = mysql_clean($playlist);
|
||||
$cbvid->action->delete_playlist($playlist);
|
||||
}
|
||||
|
||||
if(!error())
|
||||
{
|
||||
$eh->flush();
|
||||
e(lang("playlists_have_been_removed"),"m");
|
||||
}else
|
||||
{
|
||||
$eh->flush();
|
||||
e(lang("playlist_not_exist"));
|
||||
}
|
||||
}else
|
||||
e(lang("no_playlist_was_selected_to_delete"));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
//if search is activated
|
||||
if(isset($_GET['search']))
|
||||
{
|
||||
|
||||
if (!empty($_GET['playlist_name']) && isset($_GET['playlist_name'])){
|
||||
$array['playlist_name'] = $_GET['playlist_name'];
|
||||
}
|
||||
if (!empty($_GET['tags']) && isset($_GET['tags'])){
|
||||
$array['tags'] = $_GET['tags'];
|
||||
}
|
||||
if (!empty($_GET['userid']) && isset($_GET['userid'])){
|
||||
$array['user'] = $_GET['userid'];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
assign('mode','manage_playlist');
|
||||
|
||||
//getting limit for pagination
|
||||
$page = mysql_clean($_GET['page']);
|
||||
$get_limit = create_query_limit($page,RESULTS);
|
||||
|
||||
//Getting List of available playlists with pagination
|
||||
$result_array=$array;
|
||||
$result_array['limit'] = $get_limit;
|
||||
if(!$array['order'])
|
||||
$result_array['order'] = " playlists.date_added DESC ";
|
||||
$playlists = $cbvid->action->get_playlists($result_array);
|
||||
|
||||
//Collecting Data for Pagination
|
||||
$pcount = $array;
|
||||
$pcount['count_only'] = true;
|
||||
$total_rows = get_playlists($pcount);
|
||||
$total_pages = count_pages($total_rows,RESULTS);
|
||||
$pages->paginate($total_pages,$page);
|
||||
|
||||
|
||||
assign('playlists',$playlists);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 'edit_playlist':
|
||||
{
|
||||
|
||||
if(isset($_POST['delete_playlist_item']))
|
||||
{
|
||||
$items = post('check_playlist_items');
|
||||
|
||||
if(count($items)>0)
|
||||
{
|
||||
foreach($items as $item)
|
||||
{
|
||||
$item = mysql_clean($item);
|
||||
$cbvid->action->delete_playlist_item($item);
|
||||
}
|
||||
|
||||
if(!error())
|
||||
{
|
||||
$eh->flush();
|
||||
e(lang("playlist_items_have_been_removed"),"m");
|
||||
}else
|
||||
{
|
||||
$eh->flush();
|
||||
e(lang("playlist_item_doesnt_exist"));
|
||||
}
|
||||
|
||||
}else
|
||||
e(lang("no_item_was_selected_to_delete"));
|
||||
}
|
||||
|
||||
assign('mode','edit_playlist');
|
||||
$pid = $_GET['pid'];
|
||||
|
||||
if(isset($_POST['edit_playlist']))
|
||||
{
|
||||
#$params = array('name'=>mysql_clean($_POST['name']),'pid'=>mysql_clean($pid));
|
||||
$_POST[ 'list_id' ] = $pid;
|
||||
$cbvid->action->edit_playlist();
|
||||
}
|
||||
|
||||
if ( isset( $_POST[ 'upload_playlist_cover' ] ) ) {
|
||||
$cover = $_FILES[ 'playlist_cover' ];
|
||||
$cover[ 'playlist_id' ] = $pid;
|
||||
|
||||
if ( playlist_upload_cover( $cover ) ) {
|
||||
e( lang( 'Playlist cover has been uploaded' ), 'm' );
|
||||
}
|
||||
|
||||
if ( file_exists( $cover[ 'tmp_name' ] ) ) {
|
||||
unlink( $cover[ 'tmp_name' ] );
|
||||
}
|
||||
}
|
||||
|
||||
$playlist = $cbvid->action->get_playlist($pid);
|
||||
|
||||
//Deleting Item
|
||||
if(!empty($_GET['delete_item']))
|
||||
{
|
||||
$delid = mysql_clean($_GET['delete_item']);
|
||||
$cbvid->action->delete_playlist_item($delid);
|
||||
}
|
||||
|
||||
if($playlist)
|
||||
{
|
||||
assign('playlist',$playlist);
|
||||
//Getting Playlist Item
|
||||
$items = $cbvid->get_playlist_items( $pid, 'playlist_items.date_added DESC' );
|
||||
assign('items',$items);
|
||||
|
||||
}else
|
||||
e(lang('playlist_not_exist'));
|
||||
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
//- manageplay front end
|
||||
|
||||
|
||||
|
||||
template_files('manage_playlist.html');
|
||||
display_it();
|
||||
?>
|
|
@ -0,0 +1,65 @@
|
|||
<div class="advanceSearchButton clearfix">
|
||||
<a href="#" class="btn btn-primary btn-sm pull-right current after" onclick="$('#searchdiv').toggle();return false;" style="margin-bottom: 0px;position: relative; top: 15px;">
|
||||
Advanced Search
|
||||
<i class="glyphicon glyphicon-chevron-down down"></i>
|
||||
<i class="glyphicon glyphicon-chevron-up up" style="display:none"></i>
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="search_box well" id="searchdiv" {if $smarty.cookies.show_searchdiv_search!='show'} style="display:none"{/if}>
|
||||
<form id="video_search" name="video_search" method="get" action="manage_playlist.php" class="video_search">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<!-- <label for="userid">Userid</label> -->
|
||||
<label for="title">Userid</label>
|
||||
<input class="form-control" name="userid" type="text" id="userid" value="{'userid'|get_form_val:true}" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<!-- <label for="title">Video title</label> -->
|
||||
<label for="title">Playlist title</label>
|
||||
<input name="playlist_name" type="text" class="form-control" id="title" value="{'playlist_name'|get_form_val:divue}" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<!-- <label for="tags">Video tags</label> -->
|
||||
<label for="title">Playlist tags</label>
|
||||
<input class="form-control" name="tags" type="text" id="tags" value="{'tags'|get_form_val:true}" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="submit" name="search" id="search" value="Search" class="btn btn-success btn-sm"/>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
$(document).ready(function neww () {
|
||||
$(".current").click(function() {
|
||||
$(this).toggleClass('after');
|
||||
if(!$(this).hasClass('after'))
|
||||
{
|
||||
|
||||
$('.down').hide();
|
||||
$('.up').show();
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
|
||||
$('.down').show();
|
||||
$('.up').hide();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
})
|
||||
|
||||
</script>
|
138
upload/admin_area/styles/cb_2014/layout/blocks/manage/account_video.html
Executable file
138
upload/admin_area/styles/cb_2014/layout/blocks/manage/account_video.html
Executable file
|
@ -0,0 +1,138 @@
|
|||
{if $control=='' || $control =='view'}
|
||||
{if $mode ==''}{assign var='mode' value='favorites'}{/if}
|
||||
|
||||
{/if}
|
||||
|
||||
|
||||
{if $control =='full'}
|
||||
<tr>
|
||||
<td>
|
||||
<div class="col-md-3">
|
||||
<a class="manageVid_thumb" href="edit_video.php?video={$video.videoid}">
|
||||
<img src="{getThumb vdetails=$video}" class="img-responsive" width="130" height="80" id="thumbs_{$video.videoid}" class="vthumb" title=""/>
|
||||
<span class="duration">({if
|
||||
$video.duration>1}{$video.duration|SetTime}{else}00:00{/if})</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<a href="edit_video.php?vid={$video.videoid}">{$video.title|truncate:80}</a>
|
||||
<br>
|
||||
<span class="maccountlabels">
|
||||
<strong>{$video.date_added|niceTime}</strong>
|
||||
{lang code='views'} : <strong>{$video.views|number_format}</strong>
|
||||
</span>
|
||||
<div class="labels">
|
||||
{if $video.featured=='yes'}
|
||||
<span class="label label-primary">Featured{else}{/if}</span>
|
||||
<span class="label {if $video.active=='yes'}label-success{else}label-warning{/if} mlabel">{if $video.active=='yes'}Active{else}InActive{/if}</span>
|
||||
<span class="label {if $video.status=='Successful'}label-success{else}label-warning{/if}">{if $video.status=='Successful'}Successful{else}Processing{/if}</span>
|
||||
<span class="label label-info">Viewed {$video.last_viewed|niceTime}</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
{*<td>
|
||||
<div class="clearfix">
|
||||
{if $video.broadcast=='public'}
|
||||
<div class="col-md-1"><i class="icon-globe"></i></div>
|
||||
{elseif $video.broadcast!='public'}
|
||||
<div class="col-md-1"><i class="icon-lock"></i></div>
|
||||
{/if}
|
||||
</div>
|
||||
<a href="view_user.php?uid={$video.userid}">{$video.username}</a>
|
||||
</td>*}
|
||||
|
||||
<td>
|
||||
<div class="dropdown text-center">
|
||||
<button id="dropdownMenu1" class="btn btn-primary btn-xs dropdown-toggle" data-toggle="dropdown">
|
||||
Actions <i class="caret"></i></button>
|
||||
<ul class="dropdown-menu pull-right" aria-labelledby="dropdownMenu1" role="menu">
|
||||
{if $cbvid->is_video_owner($video.videoid,$user.userid) || has_access('admin_access')}
|
||||
<li><a role="menuitem" tabindex="-1" href="{$baseurl}/edit_video.php?vid={$video.videoid}" class="">Edit</a></li>
|
||||
|
||||
<li><a role="menuitem" tabindex="-1" href="javascript:_cb.Confirm_Delete('?vid_delete={$video.videoid}')">Delete</a>
|
||||
</li>
|
||||
{/if}
|
||||
<li><a role="menuitem" tabindex="-1" href="{$baseurl}/watch_video.php?v={$video.videokey}"target="_blank">Watch</a>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
{foreach from=$cbvid->video_manager_links item=links}
|
||||
{$cbvid->video_manager_link($links,$video)}
|
||||
{/foreach}
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
|
||||
{if $control=='playlist'}
|
||||
<tr>
|
||||
<td width="25">
|
||||
<input type="checkbox" name="check_playlist_items[]" id="check_vid-{$video.playlist_item_id}" value="{$video.playlist_item_id}" />
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<img class="edit-img-thumbnail" src="{getThumb vdetails=$video}">
|
||||
<p class="marginTop">{$video.title|truncate:100}</p>
|
||||
<div class="btn-group show">
|
||||
<a class="btn btn-primary btn-sm" href="{videoLink vdetails=$video}">view</a>
|
||||
<a class="btn btn-primary btn-sm" href="javascript:void(0)" onmousedown="delete_video('delete_icon_a','{$video.playlist_item_id}','{lang code="remove_playlist_item_confirm"}','?mode=edit_playlist&pid={$pid}&delete_item={$video.playlist_item_id}')" id="delete_icon_a-{$video.playlist_item_id}">
|
||||
delete
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<a href="javascript:void(0)" onmousedown="delete_video('delete_icon','{$video.playlist_item_id}','{lang code="remove_playlist_item_confirm"}','?mode=edit_playlist&pid={$pid}&delete_item={$video.playlist_item_id}')" id="delete_icon-{$video.playlist_item_id}"><img src="{$imageurl}/dot.gif" border="0" class="delete_icon" /></a>
|
||||
</td>
|
||||
<td width="100">
|
||||
{$video.date_added|date_format}
|
||||
</td>
|
||||
<td width="100">
|
||||
{$video.views|number_format}
|
||||
</td>
|
||||
<td width="100">
|
||||
{$video.comments_count|number_format}
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
|
||||
|
||||
{if $control=='basic'}
|
||||
|
||||
<div class="clearfix">
|
||||
<input type="checkbox" name="check_vid[]" id="check_vid-{$video.videoid}" value="{$video.videoid}" />
|
||||
</div>
|
||||
|
||||
<div class="clearfix">
|
||||
<a href="{videoLink vdetails=$video}">
|
||||
<img src="{getThumb vdetails=$video}" width="130" height="80" id="thumbs_{$video.videoid}" class="vthumb" />
|
||||
<p class="marginTop">{$video.title|truncate:100}</p>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="clearfix">{$video.date_added|date_format}</div>
|
||||
<div class="clearfix">{$video.views|number_format}</div>
|
||||
<div class="clearfix">{$video.comments_count|number_format}</div>
|
||||
|
||||
{/if}
|
||||
|
||||
{if $control=='onWatch'}
|
||||
<div class="featured-video clearfix" {if $ajax_load == "yes"} style="display: none" {/if}>
|
||||
<a href="{videoLink($video)}">
|
||||
<div class="video_thumb">
|
||||
<img src="{getThumb vdetails=$video size=128x80}" {ANCHOR place="video_thumb" data=$video} class="img-responsive">
|
||||
<img src="{$theme}/images/thumb-ratio.png" alt="" class="thumb-ratio">
|
||||
<time datetime="2016-15-03" class="duration">
|
||||
{if $video.duration>1}{$video.duration|SetTime}{else}00:00{/if}</time>
|
||||
</div> <!--VIDEO_THUMB END-->
|
||||
</a>
|
||||
<div class="details_block">
|
||||
<strong class="title"><a href="{videoLink($video)}">{$video.title|truncate:50}</a></strong>
|
||||
<div class="views-date">
|
||||
<span>{$video.views} {lang code='views'}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
119
upload/admin_area/styles/cb_2014/layout/manage_playlist.html
Normal file
119
upload/admin_area/styles/cb_2014/layout/manage_playlist.html
Normal file
|
@ -0,0 +1,119 @@
|
|||
|
||||
<!-- Manage playlist backend -->
|
||||
{$myAccountLinks = $userquery->my_account_links()}
|
||||
<div class="container manage-page">
|
||||
<div class="row cb-box">
|
||||
<div class="col-lg-10 col-md-10 col-sm-10 col-xs-12">
|
||||
<div class="account_box">
|
||||
{if $mode =='manage_playlist'}
|
||||
<h2>{lang code='manage_playlists'}</h2>
|
||||
<!-- searching -->
|
||||
<div class="heading clearfix">
|
||||
{include file="$layout_dir/blocks/advanced_playlist_search.html" }
|
||||
</div>
|
||||
<!-- searching -->
|
||||
|
||||
<!-- Getting List of Playlist -->
|
||||
<form class="marginTop" name="manage_playlists" method="post">
|
||||
<div>
|
||||
<input type="submit" class="btn btn-primary btn-sm" value="{lang code='delete_selected'}" name="delete_playlists"/>
|
||||
</div><br>
|
||||
<div class="account_table">
|
||||
<table class="table table-bordered table-striped marginTop">
|
||||
<tr>
|
||||
<td width="25">
|
||||
<input type="checkbox" name="checkall" onclick="checkUncheckAll(this);"/>
|
||||
</td>
|
||||
<td><strong>{lang code='vdo_title'}</strong></td>
|
||||
<td width="100"><strong>{lang code='date_added'}</strong></td>
|
||||
<td width="60" class="last_td"><strong>{lang code='total_items'}</strong></td>
|
||||
<td width="80"><strong>{lang code='View/Edit'}</strong></td>
|
||||
<td width="80"><strong>{lang code='Delete'}</strong></td>
|
||||
</tr>
|
||||
{section name=plist loop=$playlists}
|
||||
<tr>
|
||||
<td>
|
||||
<input type="checkbox" name="check_playlist[]" id="check_playlist-{$playlists[plist].playlist_id}" value="{$playlists[plist].playlist_id}" />
|
||||
</td>
|
||||
<td valign="middle">
|
||||
{$playlists[plist].playlist_name|truncate:100}
|
||||
<span class="label label-primary"> <strong>Owner :
|
||||
<!-- my changes -->
|
||||
{assign var=obj value=$userquery->get_user_details($playlists[plist].userid)}
|
||||
{$obj['username']}
|
||||
<!-- my changes -->
|
||||
</strong></span>
|
||||
<span class="label label-primary"> <strong>Last Updated :
|
||||
{if $playlists[plist].last_update == true}
|
||||
{$playlists[plist].last_update}
|
||||
{else}Never updated{/if}
|
||||
</strong></span>
|
||||
<span class="label label-primary"> <strong>Privacy : {$playlists[plist].privacy}</strong></span>
|
||||
</td>
|
||||
<td>{$playlists[plist].date_added|date_format}</td>
|
||||
<td>{$cbvid->action->count_playlist_items($playlists[plist].playlist_id)|number_format}</td>
|
||||
<td><a href="?mode=edit_playlist&pid={$playlists[plist].playlist_id}">{lang code='View/Edit'}</a></td>
|
||||
<td><a href="javascript:void(0)" onmousedown="delete_video('delete_icon_a','{$playlists[plist].playlist_id}','{lang code="remove_playlist_confirm"}','?mode=manage_playlist&delete_pl={$playlists[plist].playlist_id}')" id="delete_icon_a-{$playlists[plist].playlist_id}">{lang code='delete'}</a></td>
|
||||
</tr>
|
||||
{/section}
|
||||
</table>
|
||||
</div>
|
||||
</form>
|
||||
<!-- Getting List of Playlist -->
|
||||
{/if}
|
||||
|
||||
{if $mode =='edit_playlist'}
|
||||
<h2>{lang code='manage_playlists'}</h2>
|
||||
<div class="account_form">
|
||||
<form method="post" name="edit_profile">
|
||||
|
||||
<h3>{lang code='edit_playlist'}</h3>
|
||||
{assign var='playlist_fields' value=$cbvid->action->load_playlist_fields($playlist)}
|
||||
|
||||
{foreach from=$playlist_fields item=group}
|
||||
{foreach from=$group.fields item=field}
|
||||
<div class="form-group">
|
||||
<label class="label-heading" for="{$field.id}">{$field.title}</label>
|
||||
{$field.class='form-control'}
|
||||
{$formObj->createField($field)}
|
||||
</div>
|
||||
{/foreach}
|
||||
{/foreach}
|
||||
<div>
|
||||
<button name="edit_playlist" id="button1" value="submit" class="btn btn-primary">{lang code='edit_playlist'}</button></div><br>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
{if $items}
|
||||
<a href="{videoLink vdetails=$items[0]}" ><button class="btn btn-success" style="float:right">{lang code='play_now'}</button></a>
|
||||
{/if}
|
||||
<form name="edit_playlist" method="post">
|
||||
<input type="submit" class="btn btn-primary" value="{lang code='delete_selected'}" name="delete_playlist_item"/>
|
||||
<div class="account_table">
|
||||
<table class="table table-striped table-bordered">
|
||||
<tr>
|
||||
<td width="25">
|
||||
<input type="checkbox" name="checkall" onclick="checkUncheckAll(this);"/>
|
||||
</td>
|
||||
<td>{lang code='vdo_title'}</td>
|
||||
<td width="100">{lang code='date_added'}</td>
|
||||
<td width="100">{lang code='views'}</td>
|
||||
<td width="100">{lang code='comments'}</td>
|
||||
</tr>
|
||||
{section name=plist loop=$items}
|
||||
{include file="$style_dir/blocks/manage/account_video.html" video=$items[plist] bg=$bg control="playlist" pid=$playlist.playlist_id}
|
||||
{sectionelse}
|
||||
<div align="center" style="padding:5px"><strong><em>{lang code='no_video_in_playlist'}</em></strong></div>
|
||||
{/section}
|
||||
</table>
|
||||
</div>
|
||||
</form>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Manage playlist backend -->
|
||||
<!-- lines added for pagination -->
|
||||
{include file="$style_dir/blocks/pagination.html" }
|
||||
<div class="marginBottomLarge"></div>
|
|
@ -88,7 +88,8 @@
|
|||
<ul class="dropdown-menu" aria-labelledby="dropdownMenu1" role="menu">
|
||||
<li><a role="menuitem" tabindex="-1" href="view_user.php?uid={$u.userid}">Edit</a></li>
|
||||
<li><a role="menuitem" tabindex="-1" href="view_user.php?uid={$u.userid}">View</a></li>
|
||||
|
||||
<li><a role="menuitem" tabindex="-1" href="manage_playlist.php?userid={$u.userid}&search=Search">View Playlists</a></li>
|
||||
|
||||
{if $u.usr_status == Ok}
|
||||
<li><a role="menuitem" tabindex="-1" href="?deactivate={$u.userid}">Deactivate</a></li>
|
||||
{elseif $u.usr_status == ToActivate}
|
||||
|
|
|
@ -322,6 +322,7 @@ class ClipBucket
|
|||
if ($per['video_moderation'] == "yes")
|
||||
$NewMenu['Videos'] = array(
|
||||
'Videos Manager' => 'video_manager.php',
|
||||
'Manage Playlists' => 'manage_playlist.php',
|
||||
'Manage Categories' => 'category.php',
|
||||
'List Flagged Videos' => 'flagged_videos.php',
|
||||
'Mass Upload Videos' => 'mass_uploader.php',
|
||||
|
|
|
@ -100,7 +100,7 @@ class cbactions
|
|||
lang('other')
|
||||
);
|
||||
|
||||
$fields = array( 'playlist_id', 'playlist_name', 'description', 'tags', 'category',
|
||||
$fields = array( 'playlist_id', 'playlist_name','userid', 'description', 'tags', 'category',
|
||||
'played', 'privacy', 'total_comments', 'total_items', 'runtime',
|
||||
'last_update', 'date_added', 'first_item', 'playlist_type', 'cover' );
|
||||
|
||||
|
@ -1163,11 +1163,20 @@ class cbactions
|
|||
|
||||
$order = $params[ 'order' ];
|
||||
$limit = $params[ 'limit' ];
|
||||
|
||||
//changes made
|
||||
|
||||
$playlist_name = $params[ 'playlist_name' ];
|
||||
$tags = $params[ 'tags' ];
|
||||
$userid = $params[ 'userid' ];
|
||||
|
||||
|
||||
$main_query = $query = "SELECT ".table_fields( $fields )." FROM ".table( 'playlists' );
|
||||
$condition = "playlists.playlist_type = 'v'";
|
||||
// $condition = "playlists.playlist_type = 'v'";
|
||||
|
||||
if ( !has_access( 'admin_access' ) ) {
|
||||
|
||||
|
||||
if ( !has_access( 'admin_access' ) ) {
|
||||
$condition .= ( $condition ) ? " AND " : "";
|
||||
$condition .= "playlists.privacy = 'public'";
|
||||
} else {
|
||||
|
@ -1218,6 +1227,24 @@ class cbactions
|
|||
$condition .= ( $condition ) ? " AND " : "";
|
||||
$condition .= " playlists.userid = '".$params[ 'user' ]."' ";
|
||||
}
|
||||
////////////CHANGES/////////////
|
||||
|
||||
if( isset($userid) ) {
|
||||
$condition .= ( $condition ) ? " AND " : "";
|
||||
$condition .= " playlists.userid = '".$userid."' ";
|
||||
}
|
||||
|
||||
if( isset($tags) ) {
|
||||
$condition .= ( $condition ) ? " AND " : "";
|
||||
$condition .= " playlists.tags LIKE '%$tags%' ";
|
||||
}
|
||||
|
||||
if( isset($playlist_name) ) {
|
||||
$condition .= ( $condition ) ? " AND " : "";
|
||||
$condition .= " playlists.playlist_name LIKE '%$playlist_name%' ";
|
||||
}
|
||||
|
||||
////////////CHANGES/////////////
|
||||
|
||||
if ( isset($params[ 'has_items' ]) ) {
|
||||
$condition .= ( $condition ) ? " AND " : "";
|
||||
|
@ -1225,7 +1252,7 @@ class cbactions
|
|||
}
|
||||
|
||||
if(isset($params['count_only'])){
|
||||
$result = $db->count( cb_sql_table('playlists') , 'playlist_id' );
|
||||
$result = $db->count( cb_sql_table('playlists') , 'playlist_id' , $condition);
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue