Fixed : Mysql collation
Fixed : Date Picker Browser window problem Added : HDFLVPlayer Smart Added : JWPlayer Smart Added : Playlist for HDFLVPlayer with Autoplay feature Added : New Player Configurations
This commit is contained in:
parent
a390075df0
commit
c08e1e42bf
23 changed files with 483 additions and 12 deletions
|
@ -1,3 +1,10 @@
|
|||
INSERT INTO `cb_config` (`configid`, `name`, `value`) VALUES (NULL, 'allow_username_spaces', 'yes');
|
||||
INSERT INTO `cb_config` (`configid`, `name`, `value`) VALUES (NULL, 'use_playlist', 'yes');
|
||||
INSERT INTO `cb_config` (`configid`, `name`, `value`) VALUES (NULL, 'comments_captcha', 'all');
|
||||
INSERT INTO `cb_config` (`configid`, `name`, `value`) VALUES (NULL, 'comments_captcha', 'all');
|
||||
|
||||
-- April 27
|
||||
|
||||
INSERT INTO `clipbucket_svn`.`cb_config` (`configid`, `name`, `value`) VALUES (NULL, 'player_logo_file', 'logo.png');
|
||||
INSERT INTO `clipbucket_svn`.`cb_config` (`configid`, `name`, `value`) VALUES (NULL, 'logo_placement', 'br');
|
||||
INSERT INTO `clipbucket_svn`.`cb_config` (`configid`, `name`, `value`) VALUES (NULL, 'buffer_time', '3');
|
||||
INSERT INTO `clipbucket_svn`.`cb_config` (`configid`, `name`, `value`) VALUES (NULL, 'youtube_enabled', 'yes');
|
|
@ -18,11 +18,25 @@ assign('mode',$_GET['mode']);
|
|||
if(isset($_POST['update'])){
|
||||
$configs = $Cbucket->configs;
|
||||
|
||||
|
||||
$rows = array(
|
||||
'autoplay_video',
|
||||
'buffer_time',
|
||||
'logo_placement',
|
||||
'use_playlist',
|
||||
'youtube_enabled',
|
||||
|
||||
);
|
||||
|
||||
//Checking for logo
|
||||
if(isset($_FILES['logo_file']['name']))
|
||||
{
|
||||
$logo_file = $Upload->upload_website_logo($_FILES['logo_file']);
|
||||
if($logo_file)
|
||||
$myquery->Set_Website_Details('player_logo_file',$logo_file);
|
||||
}
|
||||
|
||||
|
||||
foreach($rows as $field)
|
||||
{
|
||||
$value = mysql_clean($_POST[$field]);
|
||||
|
|
|
@ -75,6 +75,15 @@ Latest Version <strong>{$Cbucket->cbinfo.latest.version} {$Cbucket->cbinfo.lates
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div style="height:20px;"></div>
|
||||
<h2>ClipBucket Team and Development</h2><br /><br />
|
||||
|
||||
ClipBucket is developed by <strong>Arslan</strong>, <strong>Fawaz</strong> and <strong>Frank White</strong>.<br />
|
||||
We say special thanks to <strong>Frank</strong> and <strong>Christian</strong> (oUTSKIRTs) for their great support and time.
|
||||
<br />
|
||||
<br />
|
||||
We need to grow our team but so far very few people are thinking of doing any kind of contribution, so please go ahead and contribute your code so we can achieve higher goals.
|
||||
|
||||
</div>
|
||||
|
||||
</td>
|
||||
|
|
|
@ -573,13 +573,13 @@ $(document).ready(function(){
|
|||
</tr>
|
||||
<tr>
|
||||
<td>Users contacts in channel view</td>
|
||||
<td><input name="users_items_group_page" type="text" id="users_items_group_page" value="{$row.users_items_group_page}" size="6" maxlength="3" />
|
||||
<td><input name="users_items_contacts_channel" type="text" id="users_items_contacts_channel" value="{$row.users_items_contacts_channel}" size="6" maxlength="3" />
|
||||
- users contacts in view channel</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>View Group Page</td>
|
||||
<td><input name="users_items_contacts_channel" type="text" id="users_items_contacts_channel" value="{$row.users_items_contacts_channel}" size="6" maxlength="3" />
|
||||
- users in view group page</td>
|
||||
<td> <input name="users_items_group_page" type="text" id="users_items_group_page" value="{$row.users_items_group_page}" size="6" maxlength="3" />
|
||||
- users in view group page</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Search Page</td>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
</tr>
|
||||
</table>
|
||||
<div style="width:100%; margin:auto" id="player_size">
|
||||
<form name="player_settings" action="manage_players.php?mode=show_settings" method="post">
|
||||
<form action="manage_players.php?mode=show_settings" method="post" enctype="multipart/form-data" name="player_settings">
|
||||
<fieldset class="fieldset" style="border:none">
|
||||
<table width="100%" border="0" cellpadding="2" cellspacing="0" class="block">
|
||||
<tr>
|
||||
|
@ -31,8 +31,41 @@
|
|||
No</label></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top"> </td>
|
||||
<td valign="top"> </td>
|
||||
<td valign="top"><strong>Logo File</strong><br />
|
||||
Logo file that will display on your flash player</td>
|
||||
<td valign="top"><img src="{website_logo}" /><br />
|
||||
<label>
|
||||
<input type="file" name="logo_file" id="logo_file" />
|
||||
</label></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top"><strong>Logo Placement</strong><br />
|
||||
Placement of logo, top, left , right or bottom</td>
|
||||
<td valign="top"><label>
|
||||
<select name="logo_placement" id="logo_placement">
|
||||
<option value="tl" {if $row.logo_placement=='tl'} selected="selected"{/if}>Top Left</option>
|
||||
<option value="tr" {if $row.logo_placement=='tr'} selected="selected"{/if}>Top Right</option>
|
||||
<option value="br" {if $row.logo_placement=='br'} selected="selected"{/if}>Bottom Right</option>
|
||||
<option value="bl" {if $row.logo_placement=='bl'} selected="selected"{/if}>Bottom Left</option>
|
||||
</select>
|
||||
</label></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top"><strong>Buffer Time</strong><br />
|
||||
To control the buffer seconds</td>
|
||||
<td valign="top"><label>
|
||||
<input type="text" name="buffer_time" id="buffer_time" value="{$row.buffer_time}" />
|
||||
</label></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top"><strong>Play Youtube Video Inside Player</strong><br />
|
||||
this will let you play youtube videos in your player</td>
|
||||
<td valign="top"><label>
|
||||
<input type="radio" name="youtube_enabled" value="yes" id="youtube_enabled" {if $row.youtube_enabled=='yes'} checked="checked"{/if} />
|
||||
Yes</label>
|
||||
<label>
|
||||
<input type="radio" name="youtube_enabled" value="no" id="youtube_enabled" {if $row.youtube_enabled=='no'} checked="checked"{/if} />
|
||||
No</label></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top"> </td>
|
||||
|
@ -107,7 +140,7 @@ In order to change player size, resize the box given below..
|
|||
<div style="height:10px"></div>
|
||||
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="block">
|
||||
<tr>
|
||||
<td align="left" class="settings_inner_title"><div onclick="toggle_search('website_player');" style="cursor:pointer">Main Website Player -<span style="font-size:11px; color:#06c"> click here to main website player</span></div></td>
|
||||
<td align="left" class="settings_inner_title"><div onclick="toggle_search('website_player');" style="cursor:pointer">Main Website Player Size -<span style="font-size:11px; color:#06c"> click here to main website player</span></div></td>
|
||||
<td width="20" align="right" > </td>
|
||||
</tr>
|
||||
</table>
|
||||
|
@ -129,7 +162,7 @@ In order to change player size, resize the box given below..
|
|||
|
||||
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="block">
|
||||
<tr>
|
||||
<td align="left" class="settings_inner_title"><div onclick="toggle_search('channel_player');" style="cursor:pointer">Channel Player Settings -<span style="font-size:11px; color:#06c"> click here to edit channel player settings</span></div></td>
|
||||
<td align="left" class="settings_inner_title"><div onclick="toggle_search('channel_player');" style="cursor:pointer">Channel Player Settings Size -<span style="font-size:11px; color:#06c"> click here to edit channel player settings</span></div></td>
|
||||
<td width="20" align="right" > </td>
|
||||
</tr>
|
||||
</table>
|
||||
|
|
|
@ -868,7 +868,8 @@
|
|||
if ($i+1 != sizeof($sqlarr)) ADOConnection::outp( "Input Array does not match ?: ".htmlspecialchars($sql));
|
||||
} else if ($i != sizeof($sqlarr))
|
||||
ADOConnection::outp( "Input array does not match ?: ".htmlspecialchars($sql));
|
||||
|
||||
|
||||
|
||||
$ret =& $this->_Execute($sql);
|
||||
if (!$ret) return $ret;
|
||||
}
|
||||
|
@ -878,12 +879,13 @@
|
|||
$stmt = $this->Prepare($sql);
|
||||
else
|
||||
$stmt = $sql;
|
||||
|
||||
|
||||
foreach($inputarr as $arr) {
|
||||
$ret =& $this->_Execute($stmt,$arr);
|
||||
if (!$ret) return $ret;
|
||||
}
|
||||
} else {
|
||||
|
||||
$ret =& $this->_Execute($sql,$inputarr);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1001,6 +1001,41 @@ class Upload{
|
|||
}else
|
||||
e(lang('user_doesnt_exist'));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function used to upload website logo
|
||||
* @param logo_file
|
||||
* @return $file_name.'.'.$ext;
|
||||
*/
|
||||
function upload_website_logo($file)
|
||||
{
|
||||
global $imgObj,$LANG;
|
||||
|
||||
if(!empty($file['name']))
|
||||
{
|
||||
//$file_num = $this->get_available_file_num($file_name);
|
||||
$ext = getExt($file['name']);
|
||||
$file_name = 'plaery-logo';
|
||||
if($imgObj->ValidateImage($file['tmp_name'],$ext))
|
||||
{
|
||||
$file_path = BASEDIR.'/images/'.$file_name.'.'.$ext;
|
||||
if(file_exists($file_path))
|
||||
if(!unlink($file_path))
|
||||
{
|
||||
e("Unable to remove '$file_path' , please chmod it to 0777");
|
||||
return false;
|
||||
}
|
||||
|
||||
move_uploaded_file($file['tmp_name'],$file_path);
|
||||
//$imgObj->CreateThumb($file_path,$file_path,200,$ext,200,false);
|
||||
e("Logo has been uploaded",'m');
|
||||
return $file_name.'.'.$ext;
|
||||
}else
|
||||
e("Invalid Image file");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
|
@ -219,6 +219,7 @@ class CBvideo extends CBCategory
|
|||
|
||||
if(!empty($field['db_field']))
|
||||
$query_val[] = $val;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -322,6 +323,7 @@ class CBvideo extends CBCategory
|
|||
$db->execute("DELETE FROM ".tbl("video")." WHERE videoid='$vid'");
|
||||
//Removing Video From Playlist
|
||||
$db->execute("DELETE FROM ".tbl("playlist_items")." WHERE object_id='$vid' AND playlist_item_type='v'");
|
||||
|
||||
$db->update(tbl("users"),array("total_videos"),array("|f|total_videos-1")," userid='".$vdetails['userid']."'");
|
||||
e(lang("class_vdo_del_msg"),'m');
|
||||
}else{
|
||||
|
|
|
@ -276,6 +276,10 @@ if(phpversion() < '5.2.0')
|
|||
define('TOPIC_ICON_DIR',BASEDIR.'/images/icons/topic_icons');
|
||||
define('TOPIC_ICON_URL',BASEURL.'/images/icons/topic_icons');
|
||||
|
||||
|
||||
//Enable youtube videos
|
||||
define("YOUTUBE_ENABLED",$row['youtube_enabled']);
|
||||
|
||||
include 'plugin.functions.php';
|
||||
include 'plugins_functions.php';
|
||||
require BASEDIR.'/includes/templatelib/Template.class.php';
|
||||
|
@ -432,6 +436,7 @@ $Smarty->register_function('include_js','include_js');
|
|||
$Smarty->register_function('get_binaries','get_binaries');
|
||||
$Smarty->register_function('check_module_path','check_module_path');
|
||||
$Smarty->register_function('rss_feeds','rss_feeds');
|
||||
$Smarty->register_function('website_logo','website_logo');
|
||||
|
||||
$Smarty->register_modifier('SetTime','SetTime');
|
||||
$Smarty->register_modifier('getname','getname');
|
||||
|
|
|
@ -2220,6 +2220,10 @@
|
|||
*/
|
||||
function website_logo()
|
||||
{
|
||||
$logo_file = config('player_logo_file');
|
||||
if(file_exists(BASEDIR.'/images/'.$logo_file) && $logo_file)
|
||||
return BASEURL.'/images/'.$logo_file;
|
||||
|
||||
return BASEURL.'/images/logo.png';
|
||||
}
|
||||
|
||||
|
|
|
@ -762,4 +762,22 @@ function hq_toggle(nplayer_div,hq_div)
|
|||
}
|
||||
|
||||
$(nplayer_div+","+hq_div).toggle()
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Funcion autplay playlist
|
||||
*/
|
||||
function swap_auto_play()
|
||||
{
|
||||
if($.cookie("auto_play_playlist")=="true")
|
||||
{
|
||||
$.cookie("auto_play_playlist","false");
|
||||
$('#ap_status').html("off");
|
||||
}else
|
||||
{
|
||||
$.cookie("auto_play_playlist","true");
|
||||
$('#ap_status').html("on");
|
||||
}
|
||||
}
|
2
upload/js/jquery_plugs/compressed/layout.js
vendored
2
upload/js/jquery_plugs/compressed/layout.js
vendored
|
@ -1 +1 @@
|
|||
(function($){var initLayout=function(){var hash=window.location.hash.replace('#','');var currentTab=$('ul.navigationTabs a').bind('click',showTab).filter('a[rel='+hash+']');if(currentTab.size()==0){currentTab=$('ul.navigationTabs a:first')}showTab.apply(currentTab.get(0));var now=new Date();$('.date_field').DatePicker({format:date_format,date:['1960-01-01',now.getFullYear()-5+'-01-01'],current:'2008-07-31',starts:1,calendars:1,position:'right',view:'years',onBeforeShow:function(){$('.date_field').DatePickerSetDate($('.date_field').val(),true)},onChange:function(formated,dates){$('.date_field').val(formated)}});$('#widgetCalendar div.datepicker').css('position','absolute')};var showTab=function(e){var tabIndex=$('ul.navigationTabs a').removeClass('active').index(this);$(this).addClass('active').blur();$('div.tab').hide().eq(tabIndex).show()};EYE.register(initLayout,'init')})(jQuery)
|
||||
(function($){var initLayout=function(){var hash=window.location.hash.replace('#','');var currentTab=$('ul.navigationTabs a').bind('click',showTab).filter('a[rel='+hash+']');if(currentTab.size()==0){currentTab=$('ul.navigationTabs a:first')}var now=new Date();$('.date_field').DatePicker({format:date_format,date:['1960-01-01',now.getFullYear()-5+'-01-01'],current:'2008-07-31',starts:1,calendars:1,position:'right',view:'years',onBeforeShow:function(){$('.date_field').DatePickerSetDate($('.date_field').val(),true)},onChange:function(formated,dates){$('.date_field').val(formated)}});$('#widgetCalendar div.datepicker').css('position','absolute')};var showTab=function(e){var tabIndex=$('ul.navigationTabs a').removeClass('active').index(this);$(this).addClass('active').blur();$('div.tab').hide().eq(tabIndex).show()};EYE.register(initLayout,'init')})(jQuery)
|
120
upload/plugins/hdplayersmart/admin/hd_admin.html
Normal file
120
upload/plugins/hdplayersmart/admin/hd_admin.html
Normal file
|
@ -0,0 +1,120 @@
|
|||
<span class="page_title">HD Flv Player Smart - Plugin</span>
|
||||
<p>this plugin will let you customize your hd flvplayer player, if its is activated.<br>
|
||||
you can set its skin, add custom variables, set its icons and other configurations that are available for player</p>
|
||||
<p> </p>
|
||||
|
||||
|
||||
<div class="main_page_div">
|
||||
|
||||
<form action="" method="post" enctype="multipart/form-data" name="hd_player">
|
||||
<fieldset class="fieldset" style="border:none">
|
||||
<table width="100%" border="0" cellpadding="2" cellspacing="0" class="block">
|
||||
<tr>
|
||||
<td colspan="2" valign="top" class="settings_inner_title">HD FLV Player Option</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="200" valign="top">Auto Play Video</td>
|
||||
<td valign="top"><label for="auto_play"></label>
|
||||
<select name="auto_play" id="auto_play">
|
||||
<option value="yes" {if $hd_smart->configs.auto_play=='yes'} selected{/if}>Yes</option>
|
||||
<option value="no" {if $hd_smart->configs.auto_play=='no'} selected{/if}>No</option>
|
||||
</select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top">Logo Placement</td>
|
||||
<td valign="top"><label for="logo_placement"></label>
|
||||
<select name="logo_placement" id="logo_placement">
|
||||
<option value="TL"{if $hd_smart->configs.logo_placement=='TL'} selected{/if}>Top Left</option>
|
||||
<option value="TR"{if $hd_smart->configs.logo_placement=='TR'} selected{/if}>Top Right</option>
|
||||
<option value="BL"{if $hd_smart->configs.logo_placement=='BL'} selected{/if}>Bottom Left</option>
|
||||
<option value="BR"{if $hd_smart->configs.logo_placement=='BR'} selected{/if}>Bottom Right</option>
|
||||
</select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top">Embed Visible</td>
|
||||
<td valign="top"><label>
|
||||
<input type="radio" name="embed_visible" value="true" id="embed_visible" {if $hd_smart->configs.embed_visible=='true'} checked="checked"{/if} />
|
||||
Yes</label>
|
||||
<label>
|
||||
<input type="radio" name="embed_visible" value="false" id="embed_visible" {if $hd_smart->configs.embed_visible=='false'} checked="checked"{/if} />
|
||||
No</label></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top"> </td>
|
||||
<td valign="top"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top"> </td>
|
||||
<td valign="top"> </td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td colspan="2" class="settings_inner_title">HD FLV Player Skins</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top">Choose Skin</td>
|
||||
<td valign="top"><label for="hd_skin"></label>
|
||||
<select name="hd_skin" id="hd_skin">
|
||||
<option>Choose Skin</option>
|
||||
{if $hd_smart->skins}
|
||||
{foreach from=$hd_smart->skins item=skin}
|
||||
<option value="{$skin.file}"
|
||||
{if $hd_smart->configs.hd_skin ==$skin.file}selected{/if}>{$skin.name}</option>
|
||||
{/foreach}
|
||||
{/if}
|
||||
</select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top">Upload Skin</td>
|
||||
<td valign="top"><label for="skin_file"></label>
|
||||
<input type="file" name="skin_file" id="skin_file"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top"> </td>
|
||||
<td valign="top"> </td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td colspan="2" class="settings_inner_title">HD FLV Player Plugins and Variables</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top">Add New Var</td>
|
||||
<td valign="top">Name
|
||||
<label for="cust_name"></label>
|
||||
<input type="text" name="cust_name" id="cust_name">
|
||||
Value
|
||||
<label for="cust_val"></label>
|
||||
<input type="text" name="cust_val" id="cust_val"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top">Custom Variables</td>
|
||||
<td valign="top">{if $hd_smart->configs.custom_variables}
|
||||
<input type="hidden" value="{$hd_smart->configs.custom_variables|form_val}" name="custom_vars" />
|
||||
{foreach from=$hd_smart->configs.custom_vars item=vars key=key}
|
||||
<label><input type="checkbox" value="yes" name="cust_{$key}" checked> {$key}</label><br>
|
||||
{/foreach}{/if}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top"> </td>
|
||||
<td valign="top"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" valign="top">HD FLV Player License</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top">License </td>
|
||||
<td valign="top"><label>
|
||||
<input type="text" name="license" id="license" value="{$hd_smart->configs.license}" />
|
||||
</label></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top"> </td>
|
||||
<td valign="top"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top"><label for="update"></label>
|
||||
<input type="submit" name="update" id="update" value="Submit" class="button"></td>
|
||||
<td valign="top"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
41
upload/plugins/hdplayersmart/admin/hd_admin.php
Normal file
41
upload/plugins/hdplayersmart/admin/hd_admin.php
Normal file
|
@ -0,0 +1,41 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Plugin code goes here...
|
||||
*/
|
||||
|
||||
//Updaing COnfigs
|
||||
if($_POST['update'])
|
||||
{
|
||||
$fields = array
|
||||
(
|
||||
'auto_play',
|
||||
'logo_placement',
|
||||
'hd_skin',
|
||||
'license',
|
||||
'embed_visible',
|
||||
|
||||
);
|
||||
foreach($fields as $field)
|
||||
$cb_hd_smart->update_config($field,$_POST[$field]);
|
||||
|
||||
//Setting Custom Vars
|
||||
$custom_vars = $_POST['custom_vars'];
|
||||
$cust_name = $_POST['cust_name'];
|
||||
$cust_val = $_POST['cust_val'];
|
||||
$new_code = $cb_hd_smart->custom_to_json($cust_name,$cust_val,$custom_vars,$_POST);
|
||||
$cb_hd_smart->update_config('custom_variables','|no_mc|'.$new_code);
|
||||
$cb_hd_smart->get_configs();
|
||||
|
||||
if(isset($_FILES['skin_file']) && $_FILES['skin_file']['name'])
|
||||
{
|
||||
$cb_hd_smart->upload_skin($_FILES['skin_file']);
|
||||
$cb_hd_smart->get_skins();
|
||||
|
||||
}
|
||||
|
||||
e("Configurations have been updated","m");
|
||||
}
|
||||
|
||||
template_files('hd_admin.html',PLUG_DIR.'/hdplayersmart/admin');
|
||||
?>
|
152
upload/plugins/hdplayersmart/hd_player_smart.php
Normal file
152
upload/plugins/hdplayersmart/hd_player_smart.php
Normal file
|
@ -0,0 +1,152 @@
|
|||
<?php
|
||||
/*
|
||||
Plugin Name: HD Player Smart Plugin
|
||||
Description: This plugin will let you control HD Player more properly
|
||||
Author: Arslan Hassan
|
||||
ClipBucket Version: 2
|
||||
Plugin Version: 1.0
|
||||
Website: http://clip-bucket.com/
|
||||
*/
|
||||
|
||||
|
||||
add_admin_menu('Templates And Players','HD Player Smart','hd_admin.php','hdplayersmart/admin');
|
||||
|
||||
class hdplayer_smart
|
||||
{
|
||||
var $tbl = 'hd_smart';
|
||||
var $configs = array();
|
||||
var $plug_dir = 'hdplayersmart';
|
||||
var $skins = array();
|
||||
var $skins_path = '/hdplayersmart/skins'; //Relative to PLUGIN FOLDER
|
||||
|
||||
//hd Smary Plugin Constructor
|
||||
function hdplayer_smart()
|
||||
{
|
||||
//Get hdplayer Configs
|
||||
$this->get_configs();
|
||||
//Get Available SKins
|
||||
$this->get_skins();
|
||||
//defining plugin
|
||||
define("hd_smart_install","installed");
|
||||
//Setting Skins Path
|
||||
//echo $this->skins_path = PLAYER_DIR.'/hdflvplayer/skin';
|
||||
|
||||
}
|
||||
|
||||
//Function used to get hdplyaer_smart configurations
|
||||
function get_configs()
|
||||
{
|
||||
global $db;
|
||||
$results = $db->select(tbl($this->tbl),"*");
|
||||
foreach($results as $result)
|
||||
{
|
||||
$this->configs[$result['hd_config_name']] = $result['hd_config_value'];
|
||||
}
|
||||
//Setting up plugin vars
|
||||
$vars = $this->configs['custom_variables'];
|
||||
$this->configs['custom_vars'] = json_decode($vars,true);
|
||||
|
||||
return $this->configs;
|
||||
}
|
||||
|
||||
//Function used to get list of all skins
|
||||
function get_skins()
|
||||
{
|
||||
$skins = array();
|
||||
$skin_dir = PLUG_DIR.$this->skins_path;
|
||||
$files = glob($skin_dir."/*.swf");
|
||||
if(is_array($files))
|
||||
foreach($files as $file)
|
||||
{
|
||||
$file_arr = explode("/",$file);
|
||||
$file_name = $file_arr[count($file_arr) -1];
|
||||
$skins[] = array('name'=>ucwords(preg_replace(array('/\.swf/','/\_/'),
|
||||
array('',' '),$file_name)),'file'=>$file_name);
|
||||
}
|
||||
|
||||
return $this->skins = $skins;
|
||||
}
|
||||
|
||||
//Function used to upload new skins in hd smarty skins directory
|
||||
// Make sure your skins directory is chmod to 777
|
||||
function upload_skin($file)
|
||||
{
|
||||
//Checking file name
|
||||
$file_name = $file['name'];
|
||||
$skins = PLUG_DIR.$this->get_skins();
|
||||
if(!in_array($file_name,$skins))
|
||||
{
|
||||
$skin_dir = $this->skins_path;
|
||||
|
||||
if(getext($file_name)=='swf')
|
||||
{
|
||||
if(!move_uploaded_file($file['tmp_name'],$skin_dir.'/'.$file_name))
|
||||
e("Unable to upload new skin");
|
||||
else
|
||||
e("New skin hass been added","m");
|
||||
}else
|
||||
e("Please upload .swf files only");
|
||||
}else
|
||||
e("Skin with name '$file_name' already exists");
|
||||
}
|
||||
|
||||
/**
|
||||
* Function used to convert input to custom variables
|
||||
*/
|
||||
function json_to_custom($input)
|
||||
{
|
||||
return json_decode(stripslashes($input),TRUE);
|
||||
}
|
||||
|
||||
/**
|
||||
* Function used to update configs
|
||||
*/
|
||||
function update_config($name,$value)
|
||||
{
|
||||
global $db;
|
||||
$db->update(tbl($this->tbl),array('hd_config_value'),array($value)," hd_config_name='$name' ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Funtion used to add new value and return it in jason
|
||||
*/
|
||||
function custom_to_json($new_name,$new_value,$code,$carray)
|
||||
{
|
||||
$new_array = array();
|
||||
//Checkig if code is array or not
|
||||
if(!is_array($code))
|
||||
{
|
||||
$code = $this->json_to_custom($code);
|
||||
}
|
||||
//pr($code);
|
||||
if(is_array($code))
|
||||
foreach($code as $name => $value)
|
||||
{
|
||||
if($carray["cust_".$name] == 'yes')
|
||||
$new_array[$name] = $value;
|
||||
}
|
||||
|
||||
if($new_name && $new_value)
|
||||
{
|
||||
$new_array[$new_name] = $new_value;
|
||||
}
|
||||
// pr($new_array);
|
||||
return json_encode($new_array);
|
||||
}
|
||||
|
||||
/**
|
||||
* Function used to set hd player skn
|
||||
*/
|
||||
function skin($skin)
|
||||
{
|
||||
$skin_path = $this->skins_path.'/'.$skin;
|
||||
if(file_exists(PLUG_DIR.$skin_path))
|
||||
return PLUG_URL.$skin_path;
|
||||
}
|
||||
|
||||
}
|
||||
$cb_hd_smart = new hdplayer_smart();
|
||||
$Smarty->assign_by_ref('hd_smart',$cb_hd_smart);
|
||||
|
||||
|
||||
?>
|
21
upload/plugins/hdplayersmart/install_hd_player_smart.php
Normal file
21
upload/plugins/hdplayersmart/install_hd_player_smart.php
Normal file
|
@ -0,0 +1,21 @@
|
|||
<?php
|
||||
|
||||
require_once('../includes/common.php');
|
||||
|
||||
$db->Execute("CREATE TABLE ".tbl("hd_smart")." (
|
||||
`hd_config_id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
|
||||
`hd_config_name` VARCHAR( 225 ) NOT NULL ,
|
||||
`hd_config_value` TEXT NOT NULL ,
|
||||
`hd_config_description` TEXT NOT NULL
|
||||
) ENGINE = MYISAM ;
|
||||
");
|
||||
|
||||
$db->Execute("INSERT INTO ".tbl("hd_smart")." (`hd_config_id`, `hd_config_name`, `hd_config_value`, `hd_config_description`) VALUES
|
||||
(1, 'auto_play', 'yes', ''),
|
||||
(2, 'logo_placement', 'BR', ''),
|
||||
(3, 'hd_skin', 'skin_black.swf', ''),
|
||||
(4, 'custom_variables', '', ''),
|
||||
(5, 'license', '', ''),
|
||||
(6, 'embed_visible', 'true', '');");
|
||||
|
||||
?>
|
BIN
upload/plugins/hdplayersmart/skins/skin_black.swf
Normal file
BIN
upload/plugins/hdplayersmart/skins/skin_black.swf
Normal file
Binary file not shown.
BIN
upload/plugins/hdplayersmart/skins/skin_fancyblack.swf
Normal file
BIN
upload/plugins/hdplayersmart/skins/skin_fancyblack.swf
Normal file
Binary file not shown.
BIN
upload/plugins/hdplayersmart/skins/skin_sleekblack.swf
Normal file
BIN
upload/plugins/hdplayersmart/skins/skin_sleekblack.swf
Normal file
Binary file not shown.
BIN
upload/plugins/hdplayersmart/skins/skin_white.swf
Normal file
BIN
upload/plugins/hdplayersmart/skins/skin_white.swf
Normal file
Binary file not shown.
|
@ -0,0 +1,6 @@
|
|||
<?php
|
||||
|
||||
require_once('../includes/common.php');
|
||||
|
||||
$db->Execute("DROP TABLE ".tbl("hd_smart")." ");
|
||||
?>
|
|
@ -56,6 +56,7 @@ switch($mode)
|
|||
$total_vids = get_videos(array('count_only'=>true,'user'=>$uid));
|
||||
$title = "Videos uploaded by ".$user;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
{if $playlist}
|
||||
<span class="watch_vids_head" onclick='$(this).toggleClass("watch_vids_head_closed");$("#my_playlist").slideToggle("fast")'>Playlist : {$playlist.playlist_name}</span>
|
||||
<div class="watch_vids_cont" id="my_playlist">
|
||||
<div align="right"><span class="auto_play"><a href="javascript:void(0)" onclick="swap_auto_play()">Auto Play (<span id="ap_status">{if $smarty.cookies.auto_play_playlist!="true"}off{else}on{/if}</span>)</a></span></div>
|
||||
<!-- Getting Playlist Items-->
|
||||
{assign var=items value=$cbvid->get_playlist_items($playlist.playlist_id)}
|
||||
{assign var='bg' value='fff'}
|
||||
|
|
Loading…
Add table
Reference in a new issue