Added : Category Order
Added : Editor's Pick Order Added : Editor's Pick Remove Fixed : Sent items error Fixed : Delete user
This commit is contained in:
parent
23ff3188b9
commit
b85178ea84
17 changed files with 332 additions and 176 deletions
|
@ -39,9 +39,29 @@ if(isset($_GET['category'])){
|
|||
if(isset($_GET['delete_category'])){
|
||||
$cbvid->delete_category($_GET['delete_category']);
|
||||
}
|
||||
|
||||
|
||||
$cats = $cbvid->get_categories();
|
||||
|
||||
|
||||
//Updating Category Order
|
||||
if(isset($_POST['update_order']))
|
||||
{
|
||||
foreach($cats as $cat)
|
||||
{
|
||||
if(!empty($cat['category_id']))
|
||||
{
|
||||
$order = $_POST['category_order_'.$cat['category_id']];
|
||||
$cbvid->update_cat_order($cat['category_id'],$order);
|
||||
}
|
||||
}
|
||||
|
||||
$cats = $cbvid->get_categories();
|
||||
|
||||
}
|
||||
|
||||
//Assing Category Values
|
||||
assign('category',$cbvid->get_categories());
|
||||
assign('category',$cats);
|
||||
assign('total',$cbvid->total_categories());
|
||||
|
||||
subtitle("Video Category Manager");
|
||||
|
|
|
@ -1,35 +1,50 @@
|
|||
<?php
|
||||
/*
|
||||
****************************************************************************************************
|
||||
| Copyright (c) 2007-2008 Clip-Bucket.com. All rights reserved. |
|
||||
| @ Author : ArslanHassan |
|
||||
| @ Software : ClipBucket , © PHPBucket.com |
|
||||
****************************************************************************************************
|
||||
***************************************************************
|
||||
| Copyright (c) 2007-2010 Clip-Bucket.com. All rights reserved.
|
||||
| @ Author : ArslanHassan
|
||||
| @ Software : ClipBucket , © PHPBucket.com
|
||||
****************************************************************
|
||||
*/
|
||||
|
||||
require_once '../includes/admin_config.php';
|
||||
$userquery->admin_login_check();
|
||||
$pages->page_redir();
|
||||
|
||||
//Move Video Up
|
||||
if(isset($_GET['move_up'])){
|
||||
$id = mysql_clean($_GET['move_up']);
|
||||
move_pick_up($id);
|
||||
}
|
||||
|
||||
//Move Down Up
|
||||
if(isset($_GET['move_down'])){
|
||||
$id = mysql_clean($_GET['move_down']);
|
||||
move_pick_down($id);
|
||||
}
|
||||
|
||||
//Removing
|
||||
if(isset($_GET['remove'])){
|
||||
$id = mysql_clean($_GET['remove']);
|
||||
remove_vid_editors_pick($id);
|
||||
}
|
||||
|
||||
assign('videos',get_ep_videos());
|
||||
if(isset($_POST['delete_selected']))
|
||||
{
|
||||
for($id=0;$id<=count($_POST['check_video']);$id++)
|
||||
{
|
||||
remove_vid_editors_pick($_POST['check_video'][$id]);
|
||||
}
|
||||
$eh->flush();
|
||||
e("Selected videos have been removed from editors pick","m");
|
||||
}
|
||||
|
||||
|
||||
$ep_videos = get_ep_videos();
|
||||
if(isset($_POST['update_order']))
|
||||
{
|
||||
if(is_array($ep_videos))
|
||||
{
|
||||
foreach($ep_videos as $epvid)
|
||||
{
|
||||
$order = $_POST['ep_order_'.$epvid['pick_id']];
|
||||
move_epick($epvid['videoid'],$order);
|
||||
}
|
||||
}
|
||||
$ep_videos = get_ep_videos();
|
||||
|
||||
}
|
||||
|
||||
|
||||
assign('videos',$ep_videos);
|
||||
assign('max',get_highest_sort_number());
|
||||
assign('min',get_lowest_sort_number());
|
||||
|
||||
|
|
|
@ -37,8 +37,23 @@ if(isset($_GET['delete_category'])){
|
|||
$cbgroup->delete_category($_GET['delete_category']);
|
||||
}
|
||||
|
||||
$cats = $cbgroup->get_categories();
|
||||
//Updating Category Order
|
||||
if(isset($_POST['update_order']))
|
||||
{
|
||||
foreach($cats as $cat)
|
||||
{
|
||||
if(!empty($cat['category_id']))
|
||||
{
|
||||
$order = $_POST['category_order_'.$cat['category_id']];
|
||||
$cbgroup->update_cat_order($cat['category_id'],$order);
|
||||
}
|
||||
}
|
||||
$cats = $cbgroup->get_categories();
|
||||
}
|
||||
|
||||
//Assing Category Values
|
||||
assign('category',$cbgroup->get_categories());
|
||||
assign('category',$cats);
|
||||
assign('total',$cbgroup->total_categories());
|
||||
|
||||
subtitle("Groups Category manager");
|
||||
|
|
|
@ -22,7 +22,7 @@ if(isset($_GET['deleteuser'])){
|
|||
//Deleting Multiple Videos
|
||||
if(isset($_POST['delete_selected'])){
|
||||
for($id=0;$id<=count($_POST['check_user']);$id++)
|
||||
$userquery->delete_user($deleteuser);
|
||||
$userquery->delete_user($_POST['check_user'][$id]);
|
||||
$eh->flush();
|
||||
e("Selected users have been deleted","m");
|
||||
}
|
||||
|
|
|
@ -105,13 +105,14 @@
|
|||
</div>
|
||||
|
||||
{if $total != 0}
|
||||
<form name="category" action="?update_order" method="post">
|
||||
<table width="100%" border="0" align="left" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td width="22%" class="left_head" style="text-indent:10px">Category Name</td>
|
||||
<td width="9%" class="head_sep_left">Thumb</td>
|
||||
<td width="34%" class="head_sep_left">Description</td>
|
||||
<td width="28%" class="head_sep_left">Default</td>
|
||||
<td width="7%" class="head_sep_left">Action</td>
|
||||
<td width="250" class="left_head" style="text-indent:10px">Category Name</td>
|
||||
<td width="50" align="left" class="head">Order</td>
|
||||
<td width="250" class="head">Description</td>
|
||||
<td width="100" class="head">Default</td>
|
||||
<td width="150" class="head">Action</td>
|
||||
<td width="20" align="left" class="right_head"> </td>
|
||||
</tr>
|
||||
{assign var = bgcolor value = ""}
|
||||
|
@ -125,18 +126,18 @@ cat_div = "#thumbs_{$category[list].category_id}";
|
|||
{/literal}
|
||||
</script>
|
||||
<tr bgcolor="{$bgcolor}" class="item_listing">
|
||||
<td style="text-indent:10px">{$category[list].category_name}</td>
|
||||
<td style="text-indent:10px"><a id="thumbs_{$category[list].category_id}" title="<img src='{$cbvid->get_category_thumb($category[list])}' />" href="javascript:void(0)">View Thumb</a>
|
||||
</td>
|
||||
<td style="text-indent:10px">{$category[list].category_name} - <a id="thumbs_{$category[list].category_id}" title="<img src='{$cbvid->get_category_thumb($category[list])}' />" href="javascript:void(0)">View Thumb</a></td>
|
||||
<td >
|
||||
<input name="category_order_{$category[list].category_id}" type="text" id="order" style="border:1px solid #999; padding:2px; width:30px" value="{$category[list].category_order}" size="5" maxlength="5" /></td>
|
||||
|
||||
<td style="text-indent:10px">{if $category[list].category_desc}{$category[list].category_desc}{else}<em>N/A</em>{/if}</td>
|
||||
<td style="text-indent:10px">{$category[list].isdefault}</td>
|
||||
<td style="text-indent:10px">
|
||||
<td>{if $category[list].category_desc}{$category[list].category_desc}{else}<em>N/A</em>{/if}</td>
|
||||
<td>{$category[list].isdefault}</td>
|
||||
<td>
|
||||
<li><a href="?category={$category[list].category_id}">Edit</a></li>
|
||||
<li><a href="javascript:Confirm_Delete('?delete_category={$category[list].category_id}')">Delete</a></li>
|
||||
{if $category[list].isdefault!="yes"}<li><a href="?make_default={$category[list].category_id}">Make Default</a></li>{/if}
|
||||
</td>
|
||||
<td style="text-indent:10px"> </td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
{if $bgcolor == ""}
|
||||
{assign var = bgcolor value = "#EEEEEE"}
|
||||
|
@ -145,10 +146,13 @@ cat_div = "#thumbs_{$category[list].category_id}";
|
|||
{/if}
|
||||
|
||||
{/section}
|
||||
|
||||
</table>
|
||||
|
||||
|
||||
<div><input type="submit" value="Update" name="update_order" class="button" style="margin-top:10px"/></div>
|
||||
</form>
|
||||
|
||||
{else}
|
||||
No Category Has Been Created Yet
|
||||
{/if}
|
||||
<br />
|
||||
<br />
|
||||
|
||||
{/if}
|
|
@ -1,12 +1,22 @@
|
|||
<span class="page_title">Editor's Pick</span>
|
||||
|
||||
<form name="editors_pick" action="" method="post">
|
||||
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td width="30" align="center" valign="middle"><img src="{$imageurl}/arrow_return.png" width="25" height="25"></td>
|
||||
<td height="50" style="padding-left:15px">
|
||||
<input type="submit" value="Update" name="update_order" class="button" />
|
||||
<input type="submit" name="delete_selected" value="Delete" class="button" onclick="return confirm_it('Are you sure you want to delete selected video(s)')"/>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td width="30" align="center" valign="middle" class="left_head">
|
||||
<input type="checkbox" name="checkall" onclick="checkUncheckAll(this);"/></td>
|
||||
<td width="50" class="head_sep_left">Num</td>
|
||||
<td width="100" class="head_sep_left">Sort</td>
|
||||
<td class="head"><div class="head_sep_left" style="width:250px">Details</div></td>
|
||||
<input type="checkbox" name="checkall" onclick="checkUncheckAll(this);"/></td>
|
||||
<td width="50" class="head">Order</td>
|
||||
<td class="head">Details</td>
|
||||
<td width="50" class="right_head"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
|
@ -17,9 +27,13 @@
|
|||
{section name=list loop=$videos}
|
||||
<tr class="video_opt_td" bgcolor="{$bgcolor}">
|
||||
<td width="30" align="center" valign="top" class="video_opt_td"> <input name="check_video[]" type="checkbox" id="check_video" value="{$videos[list].videoid}" /></td>
|
||||
<td width="50" align="center" valign="top" class="video_opt_td">{$videos[list].sort}</td>
|
||||
<td width="100" align="center" valign="top" class="video_opt_td">{if $videos[list].sort > $min}<a href="?move_up={$videos[list].pick_id}">Up</a>{/if} – {if $videos[list].sort < $max}<a href="?move_down={$videos[list].pick_id}">Down</a>{/if}</td>
|
||||
<td valign="top" class="video_opt_td" style="padding-left:15px">
|
||||
<td width="50" align="left" valign="top" class="video_opt_td"><input name="ep_order_{$videos[list].pick_id}" type="text" id="order" style="border:1px solid #999; padding:2px; width:30px" value="{$videos[list].sort}" size="5" maxlength="5" /></td>
|
||||
<td valign="top" class="video_opt_td"
|
||||
|
||||
onmouseover="$('#ep_opts-{$videos[list].videoid}').show()"
|
||||
onmouseout="$('#ep_opts-{$videos[list].videoid}').hide()"
|
||||
|
||||
>
|
||||
<a href="{$baseurl}/watch_video.php?v={$videos[list].videokey}" target="_blank" style="text-indent:10px">
|
||||
{$videos[list].title}
|
||||
</a> –<a href="?remove={$videos[list].videoid}"> Remove from editor's pick</a>—
|
||||
|
@ -28,8 +42,10 @@
|
|||
Active:<strong>{$videos[list].active}</strong> •
|
||||
Status:<strong>{$videos[list].status}</strong>
|
||||
</span>
|
||||
|
||||
<br />
|
||||
<div id="ep_opts-{$videos[list].videoid}" style="display:none" class="vid_opts">
|
||||
<a href="?remove={$videos[list].videoid}">Remove from editor's pick</a>
|
||||
</div>
|
||||
</td>
|
||||
<td width="50" valign="top" class="video_opt_td"> </td>
|
||||
</tr>
|
||||
|
@ -41,6 +57,15 @@
|
|||
|
||||
{/section}
|
||||
</table>
|
||||
|
||||
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td width="30" align="center" valign="middle"><img src="{$imageurl}/arrow_return_invert.png" width="25" height="25"></td>
|
||||
<td height="50" style="padding-left:15px"><input type="submit" value="Update" name="update_order" class="button" />
|
||||
<input type="submit" name="delete_selected" value="Delete" class="button" onclick="return confirm_it('Are you sure you want to delete selected video(s)')"/>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
|
||||
|
|
|
@ -102,13 +102,14 @@
|
|||
</div>
|
||||
|
||||
{if $total != 0}
|
||||
<form name="category" action="?update_order" method="post">
|
||||
<table width="100%" border="0" align="left" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td width="22%" class="left_head" style="text-indent:10px">Category Name</td>
|
||||
<td width="9%" class="head_sep_left">Thumb</td>
|
||||
<td width="34%" class="head_sep_left">Description</td>
|
||||
<td width="28%" class="head_sep_left">Default</td>
|
||||
<td width="7%" class="head_sep_left">Action</td>
|
||||
<td width="250" class="left_head" style="text-indent:10px">Category Name</td>
|
||||
<td width="50" align="left" class="head">Order</td>
|
||||
<td width="250" class="head">Description</td>
|
||||
<td width="100" class="head">Default</td>
|
||||
<td width="150" class="head">Action</td>
|
||||
<td width="20" align="left" class="right_head"> </td>
|
||||
</tr>
|
||||
{assign var = bgcolor value = ""}
|
||||
|
@ -122,18 +123,18 @@ cat_div = "#thumbs_{$category[list].category_id}";
|
|||
{/literal}
|
||||
</script>
|
||||
<tr bgcolor="{$bgcolor}" class="item_listing">
|
||||
<td style="text-indent:10px">{$category[list].category_name}</td>
|
||||
<td style="text-indent:10px"><a id="thumbs_{$category[list].category_id}" title="<img src='{$cbvid->get_category_thumb($category[list])}' />" href="javascript:void(0)">View Thumb</a>
|
||||
</td>
|
||||
<td style="text-indent:10px">{$category[list].category_name} - <a id="thumbs_{$category[list].category_id}" title="<img src='{$cbgroup->get_category_thumb($category[list])}' />" href="javascript:void(0)">View Thumb</a></td>
|
||||
<td >
|
||||
<input name="category_order_{$category[list].category_id}" type="text" id="order" style="border:1px solid #999; padding:2px; width:30px" value="{$category[list].category_order}" size="5" maxlength="5" /></td>
|
||||
|
||||
<td style="text-indent:10px">{if $category[list].category_desc}{$category[list].category_desc}{else}<em>N/A</em>{/if}</td>
|
||||
<td style="text-indent:10px">{$category[list].isdefault}</td>
|
||||
<td style="text-indent:10px">
|
||||
<td>{if $category[list].category_desc}{$category[list].category_desc}{else}<em>N/A</em>{/if}</td>
|
||||
<td>{$category[list].isdefault}</td>
|
||||
<td>
|
||||
<li><a href="?category={$category[list].category_id}">Edit</a></li>
|
||||
<li><a href="javascript:Confirm_Delete('?delete_category={$category[list].category_id}')">Delete</a></li>
|
||||
{if $category[list].isdefault!="yes"}<li><a href="?make_default={$category[list].category_id}">Make Default</a></li>{/if}
|
||||
</td>
|
||||
<td style="text-indent:10px"> </td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
{if $bgcolor == ""}
|
||||
{assign var = bgcolor value = "#EEEEEE"}
|
||||
|
@ -142,7 +143,12 @@ cat_div = "#thumbs_{$category[list].category_id}";
|
|||
{/if}
|
||||
|
||||
{/section}
|
||||
|
||||
</table>
|
||||
|
||||
|
||||
<div><input type="submit" value="Update" name="update_order" class="button" style="margin-top:10px" /></div>
|
||||
</form>
|
||||
{else}
|
||||
No Category Has Been Created Yet
|
||||
{/if}
|
||||
|
|
|
@ -57,10 +57,6 @@ $(document).ready(function(){
|
|||
<td valign="top">Closed message</td>
|
||||
<td valign="top"><textarea name="closed_msg" id="closed_msg" cols="45" rows="5">{$row.closed_msg}</textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top">Meta Description</td>
|
||||
<td valign="top"><textarea name="description" id="description" cols="45" rows="5">{$row.description}</textarea></td>
|
||||
|
@ -69,22 +65,6 @@ $(document).ready(function(){
|
|||
<td valign="top">Meta Keywords</td>
|
||||
<td valign="top"><input name="keywords" type="text" id="keywords" value="{$row.keywords}" size="45" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Default Language</td>
|
||||
<td><select name="default_site_lang">
|
||||
|
||||
{foreach from=$languages key=k item=v}
|
||||
|
||||
<option value="{$k}" {if $row.default_site_lang == $k} selected="selected" {/if}>{$v}</option>
|
||||
|
||||
{/foreach}
|
||||
|
||||
</select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>SEO Urls</td>
|
||||
<td><select name="seo" id="select2">
|
||||
|
@ -100,10 +80,6 @@ $(document).ready(function(){
|
|||
>No</option>
|
||||
</select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Allow template change</td>
|
||||
<td><select name="allow_language_change" id="allow_language_change">
|
||||
|
@ -139,7 +115,7 @@ $(document).ready(function(){
|
|||
<td> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">Emails</td>
|
||||
<td colspan="2" class="settings_inner_title">Emails</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Website Email</td>
|
||||
|
@ -150,7 +126,7 @@ $(document).ready(function(){
|
|||
<td><input name="support_email" type="text" id="support_email" value="{$row.support_email}" size="45" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Welcome Email</td>
|
||||
<td><label for="welcome_email">Welcome Email</label></td>
|
||||
<td><input name="welcome_email" type="text" id="welcome_email" value="{$row.welcome_email}" size="45" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -161,43 +137,50 @@ $(document).ready(function(){
|
|||
<td colspan="2" valign="top" class="settings_inner_title">Comments</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top">Allow Video Comments</td>
|
||||
<td valign="top"><input name="video_comments" type="checkbox" id="video_comments" value="1" {if $row.video_comments=='1'}checked="checked"{/if} />
|
||||
<br />
|
||||
<input name="user_comment_own" type="checkbox" id="user_comment_own" value="1" {if $row.user_comment_own=='1'}checked="checked"{/if} />
|
||||
User can comment on his/her own video</td>
|
||||
<td valign="top"><label for="video_comments">Allow Video Comments</label></td>
|
||||
<td valign="top"><input name="video_comments" type="checkbox" id="video_comments" value="1" {if $row.video_comments=='1'}checked="checked"{/if} /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top"> </td>
|
||||
<td valign="top"> </td>
|
||||
<td valign="top"><label for="user_comment_own">User can comment on his/her own video</label></td>
|
||||
<td valign="top"><input name="user_comment_own" type="checkbox" id="user_comment_own" value="1" {if $row.user_comment_own=='1'}checked="checked"{/if} /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top">Comments Counts</td>
|
||||
<td valign="top"><label for="max_comment_chr">Maximum Comment Characters</label></td>
|
||||
<td valign="top"><input name="max_comment_chr" type="text" id="max_comment_chr" value="{$row.max_comment_chr}" size="15" maxlength="5" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top">Allow ratings</td>
|
||||
<td valign="top"><input name="video_rating" type="checkbox" id="video_rating" value="1" {if $row.video_rating=='1'}checked="checked"{/if} />
|
||||
<br />
|
||||
<input name="video_comments3" type="checkbox" id="video_comments3" value="1" {if $row.video_comments=='1'}checked="checked"{/if} />
|
||||
User can rate his/her video/channel</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Allow comments rating</td>
|
||||
<td><label for="comment_rating">Allow comments rating</label></td>
|
||||
<td><input name="comment_rating" type="checkbox" id="comment_rating" value="1" {if $row.comment_rating=='1'}checked="checked"{/if} /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Allow video embedding</td>
|
||||
<td><input name="video_embed" type="checkbox" id="video_embed" value="1" {if $row.video_embed=='1'}checked="checked"{/if} /></td>
|
||||
<td colspan="2" valign="top" > </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Allow video download</td>
|
||||
<td colspan="2" valign="top" class="settings_inner_title">Videos</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="video_embed">Allow video embedding</label></td>
|
||||
<td><input name="video_embed" type="checkbox" id="video_embed" value="1" {if $row.video_embed=='1'} checked="checked"{/if} /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><labe for="video_download">Allow video download</labe></td>
|
||||
<td><input name="video_download" type="checkbox" id="video_download" value="1" {if $row.video_download=='1'}checked="checked"{/if} /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" class="settings_inner_title">General</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Allow ratings</td>
|
||||
<td><input name="video_rating" type="checkbox" id="video_rating" value="1" {if $row.video_rating=='1'}checked="checked"{/if} /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>User can rate his/her video/channel</td>
|
||||
<td><input name="video_comments3" type="checkbox" id="video_comments3" value="1" {if $row.video_comments=='1'}checked="checked"{/if} /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
|
|
@ -105,13 +105,14 @@
|
|||
</div>
|
||||
|
||||
{if $total != 0}
|
||||
<table width="98%" border="0" align="left" cellpadding="0" cellspacing="0">
|
||||
<form name="category" action="?update_order" method="post">
|
||||
<table width="100%" border="0" align="left" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td width="22%" class="left_head" style="text-indent:10px">Category Name</td>
|
||||
<td width="9%" class="head_sep_left">Thumb</td>
|
||||
<td width="34%" class="head_sep_left">Description</td>
|
||||
<td width="28%" class="head_sep_left">Default</td>
|
||||
<td width="7%" class="head_sep_left">Action</td>
|
||||
<td width="250" class="left_head" style="text-indent:10px">Category Name</td>
|
||||
<td width="50" align="left" class="head">Order</td>
|
||||
<td width="250" class="head">Description</td>
|
||||
<td width="100" class="head">Default</td>
|
||||
<td width="150" class="head">Action</td>
|
||||
<td width="20" align="left" class="right_head"> </td>
|
||||
</tr>
|
||||
{assign var = bgcolor value = ""}
|
||||
|
@ -125,18 +126,18 @@ cat_div = "#thumbs_{$category[list].category_id}";
|
|||
{/literal}
|
||||
</script>
|
||||
<tr bgcolor="{$bgcolor}" class="item_listing">
|
||||
<td style="text-indent:10px">{$category[list].category_name}</td>
|
||||
<td style="text-indent:10px"><a id="thumbs_{$category[list].category_id}" title="<img src='{$cbvid->get_category_thumb($category[list])}' />" href="javascript:void(0)">View Thumb</a>
|
||||
</td>
|
||||
<td style="text-indent:10px">{$category[list].category_name} - <a id="thumbs_{$category[list].category_id}" title="<img src='{$userquery->get_category_thumb($category[list])}' />" href="javascript:void(0)">View Thumb</a></td>
|
||||
<td >
|
||||
<input name="category_order_{$category[list].category_id}" type="text" id="order" style="border:1px solid #999; padding:2px; width:30px" value="{$category[list].category_order}" size="5" maxlength="5" /></td>
|
||||
|
||||
<td style="text-indent:10px">{if $category[list].category_desc}{$category[list].category_desc}{else}<em>N/A</em>{/if}</td>
|
||||
<td style="text-indent:10px">{$category[list].isdefault}</td>
|
||||
<td style="text-indent:10px">
|
||||
<td>{if $category[list].category_desc}{$category[list].category_desc}{else}<em>N/A</em>{/if}</td>
|
||||
<td>{$category[list].isdefault}</td>
|
||||
<td>
|
||||
<li><a href="?category={$category[list].category_id}">Edit</a></li>
|
||||
<li><a href="javascript:Confirm_Delete('?delete_category={$category[list].category_id}')">Delete</a></li>
|
||||
{if $category[list].isdefault!="yes"}<li><a href="?make_default={$category[list].category_id}">Make Default</a></li>{/if}
|
||||
</td>
|
||||
<td style="text-indent:10px"> </td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
{if $bgcolor == ""}
|
||||
{assign var = bgcolor value = "#EEEEEE"}
|
||||
|
@ -145,7 +146,12 @@ cat_div = "#thumbs_{$category[list].category_id}";
|
|||
{/if}
|
||||
|
||||
{/section}
|
||||
|
||||
</table>
|
||||
|
||||
|
||||
<div><input type="submit" value="Update" name="update_order" class="button" style="margin-top:10px" /></div>
|
||||
</form>
|
||||
{else}
|
||||
No Category Has Been Created Yet
|
||||
{/if}
|
||||
|
|
|
@ -40,8 +40,23 @@ if(isset($_GET['delete_category'])){
|
|||
$userquery->delete_category($_GET['delete_category']);
|
||||
}
|
||||
|
||||
$cats = $userquery->get_categories();
|
||||
//Updating Category Order
|
||||
if(isset($_POST['update_order']))
|
||||
{
|
||||
foreach($cats as $cat)
|
||||
{
|
||||
if(!empty($cat['category_id']))
|
||||
{
|
||||
$order = $_POST['category_order_'.$cat['category_id']];
|
||||
$userquery->update_cat_order($cat['category_id'],$order);
|
||||
}
|
||||
}
|
||||
$cats = $userquery->get_categories();
|
||||
}
|
||||
|
||||
//Assing Category Values
|
||||
assign('category',$userquery->get_categories());
|
||||
assign('category',$cats);
|
||||
assign('total',$userquery->total_categories());
|
||||
|
||||
Assign('msg',@$msg);
|
||||
|
|
|
@ -1,52 +1,45 @@
|
|||
<?php
|
||||
/*
|
||||
****************************************************************************************************
|
||||
| Copyright (c) 2007-2008 Clip-Bucket.com. All rights reserved. |
|
||||
| @ Author : ArslanHassan |
|
||||
| @ Software : ClipBucket , © PHPBucket.com |
|
||||
****************************************************************************************************
|
||||
*/
|
||||
require_once 'includes/config.inc.php';
|
||||
/**
|
||||
* FILE : Download
|
||||
* Function : Download video
|
||||
* @author : Arslan Hassan
|
||||
* @Software : ClipBucket
|
||||
* @Since : 1 Feb, 2010
|
||||
*
|
||||
* @License : CBLA
|
||||
*/
|
||||
|
||||
define("THIS_PAGE",'download');
|
||||
|
||||
$vkey = mysql_clean($_GET['v']);
|
||||
//Checking Video Key
|
||||
if(!empty($vkey) && $myquery->CheckVideoExists($vkey)){
|
||||
$videos = $myquery->GetVideDetails($vkey);
|
||||
$query = mysql_query("SELECT * FROM video_detail WHERE flv ='".$videos['flv']."'");
|
||||
$data = mysql_fetch_array($query);
|
||||
$flv_folder = 'files/videos';
|
||||
$original_folder = 'files/original';
|
||||
$flv = $flv_folder.'/'.$data['flv'];
|
||||
$original = $original_folder.'/'.$data['original'];
|
||||
if(!empty($data['original']) && file_exists($original)){
|
||||
$file = $original;
|
||||
}elseif(file_exists($flv)){
|
||||
$file = $flv;
|
||||
}else{
|
||||
$msg = lang('class_vdo_del_err');
|
||||
}
|
||||
if(VIDEO_DOWNLOAD != 1){
|
||||
$msg = lang('vdo_download_allow_err');
|
||||
}
|
||||
require 'includes/config.inc.php';
|
||||
$userquery->perm_check('download_video',true);
|
||||
$pages->page_redir();
|
||||
|
||||
//Getting Video Key
|
||||
$vkey = @$_GET['v'];
|
||||
$vdo = $cbvid->get_video($vkey);
|
||||
|
||||
if($vdo && video_playable($vkey))
|
||||
{
|
||||
//Calling Functions When Video Is going to download
|
||||
call_download_video_function($vdo);
|
||||
|
||||
if(empty($msg)){
|
||||
header("Pragma: public"); // required
|
||||
header("Expires: 0");
|
||||
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
|
||||
header("Cache-Control: private",false); // required for certain browsers
|
||||
header("Content-type: application/force-download");
|
||||
header("Content-Length: ".filesize($file));
|
||||
header("Content-Disposition: attachment; filename=\"".basename($file)."\"");
|
||||
readfile("$file");
|
||||
$file = get_video_file($vdo,false);
|
||||
|
||||
if($file)
|
||||
$vdo['download_file'] = $file;
|
||||
else
|
||||
{
|
||||
$Cbucket->show_page = false;
|
||||
e("Unable to find download file");
|
||||
}
|
||||
assign('vdo',$vdo);
|
||||
subtitle("Download ".$vdo['title']);
|
||||
|
||||
}
|
||||
if(!empty($msg) || empty($vkey) || !$myquery->CheckVideoExists($vkey)){
|
||||
Assign('msg',$msg);
|
||||
if(empty($msg))
|
||||
Assign('msg',lang('class_vdo_del_err'));
|
||||
Assign('subtitle',lang('class_vdo_del_err'));
|
||||
Template('header.html');
|
||||
Template('message.html');
|
||||
Template('footer.html');
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
//Displaying The Template
|
||||
template_files('download.html');
|
||||
display_it();
|
||||
?>
|
||||
|
|
|
@ -39,7 +39,7 @@ abstract class CBCategory
|
|||
function get_category($cid)
|
||||
{
|
||||
global $db;
|
||||
$results = $db->select($this->cat_tbl,"*"," category_id='$cid' ");
|
||||
$results = $db->select($this->cat_tbl,"*"," category_id='$cid'");
|
||||
if($db->num_rows>0)
|
||||
{
|
||||
return $results[0];
|
||||
|
@ -123,7 +123,7 @@ abstract class CBCategory
|
|||
function get_categories()
|
||||
{
|
||||
global $db;
|
||||
$select = $db->select($this->cat_tbl,"*");
|
||||
$select = $db->select($this->cat_tbl,"*",NULL,NULL," category_order ASC");
|
||||
return $select;
|
||||
}
|
||||
|
||||
|
@ -332,6 +332,23 @@ abstract class CBCategory
|
|||
return CAT_THUMB_URL.'/'.$this->default_thumb;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function used to update category id
|
||||
*/
|
||||
function update_cat_order($id,$order)
|
||||
{
|
||||
global $db;
|
||||
$cat = $this->category_exists($id);
|
||||
if(!$cat)
|
||||
e("Category does not exist");
|
||||
else
|
||||
{
|
||||
if(!is_numeric($order) || $order <1)
|
||||
$order = 1;
|
||||
$db->update($this->cat_tbl,array("category_order"),array($order)," category_id='".$id."'");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
|
@ -410,7 +410,10 @@ class cb_pm
|
|||
{
|
||||
$t_names[] = $tn[0];
|
||||
}
|
||||
$to_user_names = implode(', ',$t_names);
|
||||
if(is_array($t_names))
|
||||
$to_user_names = implode(', ',$t_names);
|
||||
else
|
||||
$to_user_names = $t_names;
|
||||
$result[$count]['to_usernames'] = $to_user_names;
|
||||
$count++;
|
||||
}
|
||||
|
|
|
@ -447,7 +447,7 @@ class userquery extends CBCategory{
|
|||
|
||||
$udetails = $this->get_user_details($uid);
|
||||
|
||||
if(userid()!=uid&&has_access('admin_access')&&$uid!=1)
|
||||
if(userid()!=$uid&&has_access('admin_access',true)&&$uid!=1)
|
||||
{
|
||||
//list of functions to perform while deleting a video
|
||||
$del_user_funcs = $this->delete_user_functions;
|
||||
|
|
|
@ -665,7 +665,7 @@
|
|||
* Function used to get video link
|
||||
* @param ARRAY video details
|
||||
*/
|
||||
function video_link($vdetails)
|
||||
function video_link($vdetails,$type=NULL)
|
||||
{
|
||||
global $myquery;
|
||||
#checking what kind of input we have
|
||||
|
@ -708,7 +708,10 @@
|
|||
$plist = '&play_list='.$vdetails['playlist_id'];
|
||||
$link = BASEURL.'/watch_video.php?v='.$vdetails['videokey'].$plist;
|
||||
}
|
||||
return $link;
|
||||
if(!$type || $type=='link')
|
||||
return $link;
|
||||
elseif($type=='download')
|
||||
return BASEURL.'/download.php?v='.$vdetails['videokey'];
|
||||
}
|
||||
|
||||
|
||||
|
@ -727,8 +730,8 @@
|
|||
}
|
||||
|
||||
//Function That will use in creating SEO urls
|
||||
function VideoLink($vdetails){
|
||||
return video_link($vdetails);
|
||||
function VideoLink($vdetails,$type=NULL){
|
||||
return video_link($vdetails,$type);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -800,7 +803,7 @@
|
|||
|
||||
function videoSmartyLink($params)
|
||||
{
|
||||
return VideoLink($params['vdetails']);
|
||||
return VideoLink($params['vdetails'],$params['type']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -879,7 +882,8 @@
|
|||
if($with_all)
|
||||
$all_cat = array(array('category_id'=>'all','category_name'=>'All'));
|
||||
$cats = $cbvid->get_categories();
|
||||
if($all_cat)
|
||||
|
||||
if($all_cat && is_array($cats))
|
||||
$cats = array_merge($all_cat,$cats);
|
||||
return $cats;
|
||||
}
|
||||
|
@ -891,7 +895,7 @@
|
|||
$all_cat = array(array('category_id'=>'all','category_name'=>'All'));
|
||||
|
||||
$cats = $userquery->get_categories();
|
||||
if($all_cat)
|
||||
if($all_cat && is_array($cats))
|
||||
$cats = array_merge($all_cat,$cats);
|
||||
return $cats;
|
||||
}
|
||||
|
@ -2474,6 +2478,36 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Funcion used to call functions
|
||||
* when video is going to dwnload
|
||||
* ie in download.php
|
||||
*/
|
||||
function call_download_video_function($vdo)
|
||||
{
|
||||
global $db;
|
||||
$funcs = get_functions('download_video_functions');
|
||||
if(is_array($funcs) && count($funcs)>0)
|
||||
{
|
||||
foreach($funcs as $func)
|
||||
{
|
||||
if(!function_exists($func))
|
||||
{
|
||||
$func($vdo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Updating Video Downloads
|
||||
$db->update("video",array("downloads"),array("|f|downloads+1"),"videoid = '".$vdo['videoid']."'");
|
||||
//Updating User Download
|
||||
if(userid())
|
||||
$db->update("users",array("total_downloads"),array("|f|total_downloads+1"),"userid = '".userid()."'");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Funcion used to call functions
|
||||
* when user view channel
|
||||
|
|
|
@ -177,6 +177,22 @@ if(!function_exists('editors_pick'))
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Function used to move editors pick
|
||||
*/
|
||||
function move_epick($id,$order)
|
||||
{
|
||||
global $db;
|
||||
if(!is_video_in_editors_pick($id))
|
||||
e("Video doesnt exist in editor's picks");
|
||||
else
|
||||
{
|
||||
if(!is_numeric($order) || $order <1)
|
||||
$order = 1;
|
||||
$db->update("cb_editors_picks",array("sort"),array($order)," videoid='".$id."'");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Function used to display editors pick
|
||||
*/
|
||||
|
|
|
@ -144,7 +144,11 @@
|
|||
<br />
|
||||
<label for="link_video">Link This Video<br />
|
||||
</label>
|
||||
<input type="text" name="link_video" id="link_video" style="width:99%" value="{videoLink vdetails=$vdo}" onclick="this.select()"/>
|
||||
<input type="text" name="link_video" id="link_video" style="width:99%;margin-bottom:5px; " value="{videoLink vdetails=$vdo}" onclick="this.select()"/>
|
||||
|
||||
{if $Cbucket->configs.video_download==1}
|
||||
<label><a href="{videoLink vdetails=$vdo type=download}">Click Here To Download This Video</a></label>
|
||||
{/if}
|
||||
</strong>{ANCHOR place="video_sharing_options" data=$vdo}</div>
|
||||
|
||||
{ANCHOR place="watch_video_right" data=$vdo}
|
||||
|
|
Loading…
Add table
Reference in a new issue