2011-06-25 11:39:40 +00:00
|
|
|
<script>
|
2012-05-18 13:47:20 +00:00
|
|
|
var baseurl = '{$baseurl}';
|
|
|
|
var imageurl = '{$imageurl}';
|
2011-06-25 11:39:40 +00:00
|
|
|
</script>
|
2011-05-04 15:19:19 +00:00
|
|
|
<link rel="stylesheet" href="{$baseurl}/styles/global/jquery_ui.css" type="text/css" media="all" />
|
2012-05-18 13:47:20 +00:00
|
|
|
<link rel="stylesheet" href="{$js}/jquery_plugs/css/jquery.Jcrop.css" type="text/css" />
|
2011-05-04 15:19:19 +00:00
|
|
|
{if $Cbucket->configs.use_google_api}
|
2011-02-22 15:33:52 +00:00
|
|
|
<script type="text/javascript" src="https://www.google.com/jsapi?key=ABQIAAAAr5pj809LgbJgBTxDJGy0IxQH8siQo9V3STvJ8WIDHu37hIWsoxRX_d1ABxknSddUPvo4LFb7wq8gwA"></script>
|
2011-04-13 10:47:30 +00:00
|
|
|
|
2011-01-23 21:12:35 +00:00
|
|
|
<script type="text/javascript">
|
2012-05-18 13:47:20 +00:00
|
|
|
google.load("jquery", "1");
|
|
|
|
google.load("jqueryui", "1");
|
2011-04-13 08:20:37 +00:00
|
|
|
</script>
|
|
|
|
{else}
|
|
|
|
<script type="text/javascript" src="{$js}/jquery.js"></script>
|
|
|
|
<script type="text/javascript" src="{$js}/ui/jquery-ui.js"></script>
|
|
|
|
{/if}
|
|
|
|
<script type="text/javascript">
|
2012-05-18 13:47:20 +00:00
|
|
|
var embedPlayerWidth = '{$Cbucket->configs.embed_player_width}';
|
|
|
|
var embedPlayerHeight = '{$Cbucket->configs.embed_player_height}';
|
|
|
|
var autoPlayEmbed = '{$Cbucket->configs.autoplay_embed}';
|
|
|
|
|
|
|
|
|
|
|
|
{literal}
|
|
|
|
function updateEmbed(width,height,autoplay)
|
|
|
|
{
|
|
|
|
$('#embed_code').val( $('#embed_code').val().replace(/width=\"([0-9]+)\"/g,'width="'+width+'"') );
|
|
|
|
$('#embed_code').val( $('#embed_code').val().replace(/width\:([0-9]+)px/g,'width:'+width+'px') );
|
|
|
|
$('#embed_code').val( $('#embed_code').val().replace(/height=\"([0-9]+)\"/g,'height="'+height+'"') );
|
|
|
|
$('#embed_code').val( $('#embed_code').val().replace(/height\:([0-9]+)px/g,'height:'+height+'px') );
|
|
|
|
}
|
2011-02-22 15:33:52 +00:00
|
|
|
|
2012-05-18 13:47:20 +00:00
|
|
|
function switchEmbedCode(type)
|
|
|
|
{
|
|
|
|
if(embed_type==type)
|
|
|
|
return false;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
embed_type = type;
|
2011-08-13 00:04:06 +00:00
|
|
|
|
2012-05-18 13:47:20 +00:00
|
|
|
var alt_embed =$('#alternate_embed_code').val();
|
|
|
|
$('#alternate_embed_code').val($('#embed_code').val());
|
|
|
|
$('#embed_code').val(alt_embed);
|
2011-08-13 00:04:06 +00:00
|
|
|
|
2012-05-18 13:47:20 +00:00
|
|
|
}
|
|
|
|
}
|
2011-08-13 00:04:06 +00:00
|
|
|
|
2012-05-18 13:47:20 +00:00
|
|
|
{/literal}
|
2011-08-13 00:04:06 +00:00
|
|
|
|
2011-01-23 21:12:35 +00:00
|
|
|
</script>
|
|
|
|
|
2011-02-23 11:17:33 +00:00
|
|
|
|
|
|
|
<!-- Including JS Files-->
|
2012-07-04 07:45:05 +00:00
|
|
|
{cb_load_js()}
|
2011-02-23 11:17:33 +00:00
|
|
|
<!-- Including JS Files-->
|
2012-07-04 07:45:05 +00:00
|
|
|
|
2012-07-04 21:01:22 +00:00
|
|
|
<!-- Including all the css fiels -->
|
|
|
|
{cb_load_css()}
|
|
|
|
<!-- End including css files -->
|
|
|
|
|
2011-02-28 14:25:00 +00:00
|
|
|
<script type="text/javascript">
|
2012-05-18 13:47:20 +00:00
|
|
|
callURLParser();
|
2011-02-28 14:25:00 +00:00
|
|
|
</script>
|
2011-02-23 11:17:33 +00:00
|
|
|
<!-- Including Plugin Headers -->
|
|
|
|
{foreach key=file item=type from=$Cbucket->header_files}
|
2012-05-18 13:47:20 +00:00
|
|
|
{include_header file=$file type=$type}
|
2011-02-23 11:17:33 +00:00
|
|
|
{/foreach}
|
|
|
|
<!-- Ending Plugin Headers -->
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-12-23 11:29:55 +00:00
|
|
|
{if $smarty.const.THIS_PAGE == 'upload'}
|
2010-12-14 14:39:16 +00:00
|
|
|
|
|
|
|
<link href="{$js}/uploadify/uploadify.css" type="text/css" rel="stylesheet" />
|
|
|
|
<script type="text/javascript" src="{$js}/uploadify/swfobject.js"></script>
|
|
|
|
<script type="text/javascript" src="{$js}/uploadify/jquery.uploadify.v2.1.4.js"></script>
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
2012-05-18 13:47:20 +00:00
|
|
|
var jsURL = '{$js}';
|
|
|
|
var uploadError = false;
|
|
|
|
var file_name = '{$file_name}';
|
|
|
|
var lang = new Array();
|
|
|
|
lang['saveData'] = '{lang code='save_data'}';
|
|
|
|
lang['savingData'] = '{lang code='saving'}';
|
|
|
|
lang['remoteUploadFile'] = '{lang code="remote_upload_file"}';
|
|
|
|
lang['upload_video_button'] = '{lang code="upload_video_button"}';
|
|
|
|
var fileExt = '{$Cbucket->list_extensions()|replace:",":";"}';
|
|
|
|
|
|
|
|
var uploadSwfPath = '{$uploaderDetails.uploadSwfPath}';
|
|
|
|
var uploadScriptPath = '{$uploaderDetails.uploadScriptPath}';
|
|
|
|
|
|
|
|
|
|
|
|
{literal}
|
|
|
|
|
|
|
|
function show_error(msg,ID,fade)
|
|
|
|
{ $('#file_uploads'+ID+' .percentage')
|
|
|
|
.after('<div class=\"uploadErrorDiv\"><div class=\"uploadErrorMsg\">'+msg+'<\/div><\/div>');
|
|
|
|
if(fade){$('.uploadSuccessDiv').delay(3000).fadeOut('slow');}
|
|
|
|
}
|
2010-12-23 11:29:55 +00:00
|
|
|
|
2012-05-18 13:47:20 +00:00
|
|
|
function show_message(msg,ID,fade)
|
|
|
|
{ $('#uploadForm'+ID)
|
|
|
|
.prepend('<div class=\"uploadSuccessDiv\"><div class=\"uploadSuccessMsg\">'+msg+'<\/div><\/div>');
|
|
|
|
if(fade){$('.uploadSuccessDiv').delay(3000).fadeOut('slow');}
|
|
|
|
}
|
2010-12-23 11:29:55 +00:00
|
|
|
|
|
|
|
|
2012-05-18 13:47:20 +00:00
|
|
|
function doUpdateVideo(formId,ID)
|
|
|
|
{
|
|
|
|
var formObjectData = $(formId).serialize();
|
|
|
|
//alert(serializedData);
|
2010-12-23 11:29:55 +00:00
|
|
|
|
2012-05-18 13:47:20 +00:00
|
|
|
$('#updateVideoDataLoading').html('<img src="'+imageurl+'/ajax-loader.gif" />');
|
|
|
|
$('#cbSubmitUpload'+ID)
|
|
|
|
.attr('disabled','disabled')
|
|
|
|
.attr("value",lang.savingData)
|
|
|
|
.attr("onClick","return false;");
|
2010-12-23 11:29:55 +00:00
|
|
|
|
2012-05-18 13:47:20 +00:00
|
|
|
$.post(
|
|
|
|
baseurl+'/actions/file_uploader.php',formObjectData,function(data)
|
|
|
|
{
|
|
|
|
if(data.msg)
|
|
|
|
show_message(data.msg,ID,true);
|
|
|
|
if(data.error)
|
|
|
|
show_error(data.error,ID,true);
|
|
|
|
$('#updateVideoDataLoading').empty();
|
|
|
|
$('#cbSubmitUpload'+ID)
|
|
|
|
.removeAttr("disabled")
|
|
|
|
.attr("value",lang.saveData)
|
|
|
|
.attr("onClick","doUpdateVideo('#uploadForm"+ID+"','"+ID+"')")
|
|
|
|
},"json"
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
$(document).ready(function()
|
|
|
|
{
|
2010-12-23 11:29:55 +00:00
|
|
|
|
|
|
|
|
2012-05-18 13:47:20 +00:00
|
|
|
var instanceNumber = 0;
|
|
|
|
function showUploadify(object)
|
|
|
|
{
|
|
|
|
$(object).uploadify({
|
|
|
|
'uploader' : uploadSwfPath,
|
|
|
|
'scriptAccess' : 'always',
|
|
|
|
'script' : uploadScriptPath,
|
|
|
|
'cancelImg' : imageurl+'/cancel_upload.png',
|
|
|
|
'auto' : true,
|
|
|
|
'removeCompleted' : false,
|
|
|
|
'displayData' : 'both',
|
|
|
|
'fileExt' : fileExt,
|
|
|
|
'multi' : true,
|
|
|
|
'fileDesc' : 'Video Files',
|
|
|
|
'buttonText' : lang.upload_video_button,
|
|
|
|
'queueID' : 'fileUploadQueue',
|
|
|
|
'queueLimit' : 2,
|
|
|
|
'onOpen' : function(event,ID,fileObj) {
|
2010-12-23 11:29:55 +00:00
|
|
|
|
2012-05-18 13:47:20 +00:00
|
|
|
uploadError = false;
|
|
|
|
filename = new Date().getTime() + Math.round((99977 - 10016) * Math.random() + 1) ;
|
|
|
|
$.ajax({
|
|
|
|
url: baseurl+'/actions/file_uploader.php',
|
|
|
|
type: "POST",
|
|
|
|
data:({"getForm":"get_form","title":fileObj.name,"objId":ID}),
|
|
|
|
dataType: "text",
|
|
|
|
success: function(data)
|
|
|
|
{
|
|
|
|
if(!uploadError)
|
|
|
|
{
|
|
|
|
$('#file_uploads'+ID).append(data);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
2010-12-14 14:39:16 +00:00
|
|
|
|
2012-05-18 13:47:20 +00:00
|
|
|
return true;
|
|
|
|
},
|
|
|
|
'onComplete' : function(event, ID, fileObj, response, data)
|
|
|
|
{
|
|
|
|
var resObj = eval('(' + response + ')');
|
|
|
|
var vid = "";
|
|
|
|
if(resObj.success=='yes')
|
|
|
|
{
|
|
|
|
var file_name = resObj.file_name;
|
|
|
|
$.ajax({
|
|
|
|
url: baseurl+'/actions/file_uploader.php',
|
|
|
|
type: "POST",
|
|
|
|
data:({"insertVideo":"yes","title":fileObj.name,"file_name":file_name}),
|
|
|
|
dataType: "text",
|
|
|
|
success: function(data)
|
|
|
|
{
|
|
|
|
vid = data;
|
|
|
|
$("#uploadForm"+ID+" #title").after('<input type="hidden" name="videoid" value="'+vid+'" id="videoid" />')
|
|
|
|
.after('<input type="hidden" name="updateVideo" value="yes" id="updateVideo" />');
|
|
|
|
$('#cbSubmitUpload'+ID)
|
|
|
|
.before('<span id="updateVideoDataLoading" style="margin-right:5px"></span>')
|
|
|
|
.removeAttr("disabled")
|
|
|
|
.attr("value",lang.saveData)
|
|
|
|
.attr("onClick","doUpdateVideo('#uploadForm"+ID+"','"+ID+"')");
|
2010-12-23 11:29:55 +00:00
|
|
|
|
2012-05-18 13:47:20 +00:00
|
|
|
doUpdateVideo('#uploadForm'+ID,ID);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}else
|
|
|
|
{
|
|
|
|
$("#upload_form"+ID).empty().remove();
|
|
|
|
show_error(resObj.error,ID,false);
|
|
|
|
uploadError = true;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
2010-12-23 11:29:55 +00:00
|
|
|
|
|
|
|
|
2012-05-18 13:47:20 +00:00
|
|
|
showUploadify('#file_uploads');
|
|
|
|
});
|
2010-12-23 11:29:55 +00:00
|
|
|
|
2012-05-18 13:47:20 +00:00
|
|
|
{/literal}
|
2010-12-14 14:39:16 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
2010-12-23 11:29:55 +00:00
|
|
|
{else}
|
|
|
|
<script type="text/javascript">
|
2011-01-08 11:11:20 +00:00
|
|
|
|
2012-05-18 13:47:20 +00:00
|
|
|
window.onload = function() {ldelim}
|
|
|
|
{if $total_quicklist}
|
|
|
|
load_quicklist_box();
|
|
|
|
{/if}
|
|
|
|
ini_cookies();
|
|
|
|
{rdelim}
|
2011-01-08 11:11:20 +00:00
|
|
|
|
2010-12-23 11:29:55 +00:00
|
|
|
</script>
|
|
|
|
{/if}
|
|
|
|
|
2010-12-14 13:53:51 +00:00
|
|
|
{if $smarty.const.THIS_PAGE == 'photo_upload'}
|
2011-01-03 12:36:00 +00:00
|
|
|
<link href="{$js}/uploadify/uploadify.css" type="text/css" rel="stylesheet" />
|
|
|
|
<script type="text/javascript" src="{$js}/uploadify/swfobject.js"></script>
|
|
|
|
<script type="text/javascript" src="{$js}/uploadify/jquery.uploadify.v2.1.4.js"></script>
|
2010-12-14 13:53:51 +00:00
|
|
|
|
2011-01-03 12:36:00 +00:00
|
|
|
<script type="text/javascript" language="javascript">
|
2012-05-18 13:47:20 +00:00
|
|
|
fileExt = '{$cbphoto->extensions()}',
|
|
|
|
lang = new Array(),
|
|
|
|
pData = new Array(),
|
|
|
|
ajaxImage = '<img src="'+imageurl+'/ajax-loader.gif" style="vertical-align:middle;" /> ',
|
|
|
|
uploadError = false;
|
|
|
|
{if $smarty.get.collection}
|
|
|
|
{assign var=cid value=$cbphoto->decode_key($smarty.get.collection)}
|
|
|
|
{if $cbphoto->is_addable($cid)}
|
|
|
|
collectionID = '{$cid}';
|
|
|
|
{/if}
|
|
|
|
{/if}
|
|
|
|
lang['browsePhrase'] = '{lang code="browse_photos"}';
|
|
|
|
lang['saveData'] = "{lang code='save_data'}";
|
|
|
|
lang['savingData'] = "{lang code='saving'}";
|
|
|
|
lang['upPhoto'] = "{lang code='update_photo'}";
|
|
|
|
var uploadSwfPath = '{$photoUploaderDetails.uploadSwfPath}';
|
|
|
|
var uploadScriptPath = '{$photoUploaderDetails.uploadScriptPath}';
|
|
|
|
|
|
|
|
{literal}
|
|
|
|
|
|
|
|
function photoMessage(message,ID,fade)
|
|
|
|
{
|
|
|
|
if(document.getElementById(ID+"Message"))
|
|
|
|
$("#"+ID+"Message").children(":first-child").html(message).end().fadeIn('slow');
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$("#Form"+ID).before('<div id=\"'+ID+'Message\" class=\"uploadSuccessDiv\"><div class=\"uploadSuccessMsg\">'+message+'<\/div><\/div>');
|
|
|
|
}
|
2011-01-18 14:06:17 +00:00
|
|
|
|
2012-05-18 13:47:20 +00:00
|
|
|
if(fade)
|
|
|
|
$("#"+ID+"Message").delay(300).fadeOut('slow');
|
|
|
|
}
|
|
|
|
|
|
|
|
function photoError(message,ID,fade)
|
|
|
|
{
|
|
|
|
if(document.getElementById(ID+"Error"))
|
|
|
|
$("#"+ID+"Error").children(":first-child").html(message).end().fadeIn('slow');
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$("#Form"+ID)
|
|
|
|
.before('<div id=\"'+ID+'Error\" class=\"uploadErrorDiv\"><div class=\"uploadErrorMsg\">'+message+'<\/div><\/div>');
|
|
|
|
}
|
2011-01-18 14:06:17 +00:00
|
|
|
|
2012-05-18 13:47:20 +00:00
|
|
|
if(fade)
|
|
|
|
$("#"+ID+"Error").delay(3000).fadeOut('slow');
|
|
|
|
}
|
|
|
|
|
|
|
|
function QueueLimitError(message,fade)
|
|
|
|
{
|
|
|
|
$("#photoUploadQueue")
|
|
|
|
.before('<div id=\"QueueError\" style=\"margin-top:6px;\" class=\"uploadErrorDiv\"><div class=\"uploadErrorMsg\">'+message+'<\/div><\/div>');
|
|
|
|
if(fade)
|
|
|
|
$("#QueueError").delay(5000).fadeOut('slow');
|
|
|
|
}
|
|
|
|
|
|
|
|
function insertAjaxPhoto(ID,filename,extension,server_url,folder)
|
|
|
|
{
|
|
|
|
|
|
|
|
var photoFields = $("#Form"+ID).serialize();
|
|
|
|
$.ajax({
|
|
|
|
url : baseurl+'/actions/photo_uploader.php',
|
|
|
|
type : 'POST',
|
|
|
|
dataType : 'json',
|
|
|
|
data : photoFields+"&filename="+filename+"&ext="+extension+"&insertPhoto=yes&server_url="+server_url+
|
|
|
|
"&folder="+folder,
|
|
|
|
beforeSend : function()
|
|
|
|
{
|
|
|
|
$("#cbSubmitUpload"+ID).html(ajaxImage+lang.savingData).attr('disabled','disabled');
|
|
|
|
},
|
|
|
|
success : function(data)
|
|
|
|
{
|
|
|
|
if(data.error)
|
|
|
|
{
|
|
|
|
photoError(data.error,ID,true);
|
|
|
|
$("#cbSubmitUpload"+ID).html("Save Photo")
|
|
|
|
.removeAttr('disabled').attr('onClick','insertAjaxPhoto("'+ID+'","'+filename+'","'+extension+'");');
|
|
|
|
}
|
2011-01-18 14:06:17 +00:00
|
|
|
|
2012-05-18 13:47:20 +00:00
|
|
|
if(data.success)
|
|
|
|
{
|
|
|
|
photoMessage(data.success,ID,true);
|
|
|
|
showPhotoPreview(ID,data.photoPreview);
|
2011-01-18 14:06:17 +00:00
|
|
|
|
2012-05-18 13:47:20 +00:00
|
|
|
$("<input />").attr({
|
|
|
|
'id' : 'photo_id',
|
|
|
|
'name' : 'photo_id',
|
|
|
|
'value' : data.photoID,
|
|
|
|
'type' : 'hidden'
|
|
|
|
}).prependTo('#Form'+ID);
|
2011-01-18 14:06:17 +00:00
|
|
|
|
2012-05-18 13:47:20 +00:00
|
|
|
$("#cbSubmitUpload"+ID).html(lang.upPhoto)
|
|
|
|
.removeAttr('disabled').attr('onClick','updateAjaxPhoto("'+ID+'");');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
function updateAjaxPhoto(ID)
|
|
|
|
{
|
|
|
|
var updateFields = $("#Form"+ID).serialize();
|
|
|
|
$.ajax({
|
|
|
|
url : baseurl+'/actions/photo_uploader.php',
|
|
|
|
type : 'POST',
|
|
|
|
dataType : 'json',
|
|
|
|
data : updateFields+"&updatePhoto=yes",
|
|
|
|
beforeSend : function()
|
|
|
|
{
|
|
|
|
$("#cbSubmitUpload"+ID).html(ajaxImage+lang.upPhoto).attr('disabled','disabled');
|
|
|
|
},
|
|
|
|
success : function(data)
|
|
|
|
{
|
|
|
|
if(data.error)
|
|
|
|
{
|
|
|
|
photoError(data.error,ID,true);
|
|
|
|
$("#cbSubmitUpload"+ID).removeAttr('disabled').html(lang.upPhoto);
|
|
|
|
}
|
2011-01-18 14:06:17 +00:00
|
|
|
|
2012-05-18 13:47:20 +00:00
|
|
|
if(data.success)
|
|
|
|
{
|
|
|
|
photoMessage(data.success,ID,true);
|
|
|
|
$("#Form"+ID).hide();
|
|
|
|
$("#cbSubmitUpload"+ID).removeAttr('disabled').html(lang.upPhoto);
|
|
|
|
if(!document.getElementById("toggle"+ID))
|
|
|
|
{
|
|
|
|
$("<a></a>")
|
|
|
|
.addClass('reUpdateButton')
|
|
|
|
.attr({
|
|
|
|
"id" : "toggle"+ID,
|
|
|
|
"href" : "#reUpdate",
|
|
|
|
"onClick" : "$('#Form"+ID+"').toggle(); return false;",
|
|
|
|
"title" : "Toggle Photo Form"
|
|
|
|
}).html('Re-'+lang.upPhoto).appendTo("#photo_uploads"+ID+" .percentage").fadeIn(350);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
function showPhotoPreview(ID,preview)
|
|
|
|
{
|
|
|
|
var object = $("#"+ID+"Preview"), parentObj = object.parent();
|
|
|
|
var FinalPreview = new Image();
|
|
|
|
FinalPreview.src = preview;
|
|
|
|
$(FinalPreview).load(function()
|
|
|
|
{
|
|
|
|
object.hide();
|
|
|
|
$("<img />")
|
|
|
|
.addClass(object.attr('class'))
|
|
|
|
.attr({ "id" : "FinalPreview"+ID, "src" : preview }).appendTo(parentObj).fadeIn('normal');
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
function update_collection_selection(obj)
|
|
|
|
{
|
|
|
|
if($("#CollectionResult").css('display') == 'block')
|
|
|
|
$("#CollectionResult").slideUp('fast');
|
2011-01-18 14:06:17 +00:00
|
|
|
|
2012-05-18 13:47:20 +00:00
|
|
|
var This = $(obj), thisObj = obj;
|
|
|
|
This.attr('disabled','disabled');
|
|
|
|
This.after(ajaxImage);
|
|
|
|
collectionID = thisObj.value;
|
2011-01-18 14:06:17 +00:00
|
|
|
|
2012-05-18 13:47:20 +00:00
|
|
|
setTimeout(function(){
|
|
|
|
This.next().remove();
|
|
|
|
$("#CollectionResult").html("<div class='msg'>Collection Selected</div>").slideDown(350);
|
|
|
|
This.removeAttr('disabled');
|
|
|
|
},1000);
|
|
|
|
}
|
2011-01-18 14:06:17 +00:00
|
|
|
|
2012-05-18 13:47:20 +00:00
|
|
|
$(document).ready(function() {
|
2011-01-18 14:06:17 +00:00
|
|
|
|
2012-05-18 13:47:20 +00:00
|
|
|
function photoUploadify(object)
|
|
|
|
{
|
|
|
|
$(object).uploadify(
|
|
|
|
{
|
|
|
|
'uploader' : uploadSwfPath,
|
|
|
|
'script' : uploadScriptPath,
|
|
|
|
'scriptAccess' : 'always',
|
|
|
|
'fileDataName' : 'photoUpload',
|
|
|
|
'cancelImg' : imageurl+'/cancel_upload.png',
|
|
|
|
'auto' : true,
|
|
|
|
'removeCompleted' : false,
|
|
|
|
'displayData' : 'both',
|
|
|
|
'fileExt' : fileExt,
|
|
|
|
'multi' : true,
|
|
|
|
'queueSizeLimit': {/literal} '{$Cbucket->configs.photo_multi_upload}', {literal}
|
|
|
|
'fileDesc' : 'Photo Files',
|
|
|
|
'buttonText' : lang.browsePhrase,
|
|
|
|
'queueID' : 'photoUploadQueue',
|
|
|
|
'sizeLimit' : {/literal}'{$cbphoto->max_file_size}',{literal}
|
|
|
|
'onSelect' : function(event,ID,fileObj)
|
|
|
|
{
|
|
|
|
uploadError = false;
|
|
|
|
$.ajax({
|
|
|
|
url : baseurl+'/actions/photo_uploader.php',
|
|
|
|
dataType : 'json',
|
|
|
|
type : 'POST',
|
|
|
|
data : ({ "photoForm":"yes" , "objID":ID , "name":fileObj.name , "collection":collectionID }),
|
|
|
|
success : function(data)
|
|
|
|
{
|
|
|
|
if(!uploadError)
|
|
|
|
$("#photo_uploads"+ID).append(data['form']);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
},
|
|
|
|
'onComplete' : function(event,ID,fileObj,response,data)
|
|
|
|
{
|
2011-02-19 09:34:37 +00:00
|
|
|
|
2012-05-18 13:47:20 +00:00
|
|
|
var resObj = $.parseJSON(response);
|
|
|
|
if(resObj.success == "yes")
|
|
|
|
{
|
|
|
|
insertAjaxPhoto(ID,resObj.filename,resObj.extension,resObj.server_url,resObj.folder);
|
|
|
|
}
|
2011-01-18 14:06:17 +00:00
|
|
|
|
2012-05-18 13:47:20 +00:00
|
|
|
},
|
|
|
|
'onQueueFull' : function(event,queueSizeLimit)
|
|
|
|
{
|
|
|
|
QueueError = "I'm stuffed, "+queueSizeLimit+" is my limit. Thanks.";
|
|
|
|
QueueLimitError(QueueError,true);
|
|
|
|
return false;
|
|
|
|
},
|
|
|
|
'onError' : function(event,ID,fileObj,errorObj)
|
|
|
|
{
|
|
|
|
uploadError = true;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
2011-01-18 14:06:17 +00:00
|
|
|
|
2012-05-18 13:47:20 +00:00
|
|
|
photoUploadify('#photo_uploads');
|
|
|
|
});
|
|
|
|
{/literal}
|
2010-11-13 12:12:56 +00:00
|
|
|
</script>
|
2010-12-23 16:56:33 +00:00
|
|
|
{/if}
|
|
|
|
|
|
|
|
{if $smarty.const.THIS_PAGE == 'view_item'}
|
|
|
|
<script type="text/javascript">
|
2012-05-18 13:47:20 +00:00
|
|
|
var Seo = '{$Cbucket->configs.seo}';
|
|
|
|
onReload_item();
|
2010-12-23 16:56:33 +00:00
|
|
|
</script>
|
2011-01-14 14:40:39 +00:00
|
|
|
{/if}
|
|
|
|
|
2011-02-19 09:34:37 +00:00
|
|
|
{if $smarty.const.THIS_PAGE=='watch_video' || $object.videoid}
|
2012-05-18 13:47:20 +00:00
|
|
|
{if $object.videoid}{assign var=vdo value=$object} {/if}
|
|
|
|
<meta name="keywords" content="{$vdo.tags}" />
|
|
|
|
<meta name="description" content="{$vdo.description|description|strip_tags}" />
|
|
|
|
|
|
|
|
<meta property="og:title" content="{$vdo.title}" />
|
|
|
|
<meta property="og:description" content="{$vdo.description|description|strip_tags}" />
|
|
|
|
<meta property="og:image" content="{getThumb vdetails=$vdo}" />
|
|
|
|
|
|
|
|
{if $Cbucket->configs.facebook_embed=='yes'}
|
|
|
|
<meta property="og:type" content="video">
|
|
|
|
<meta property="og:video" content='{fb_embed_video video=$vdo}'>
|
|
|
|
<meta property="og:video:height" content="259" />
|
|
|
|
<meta property="og:video:width" content="398" />
|
|
|
|
<meta property="og:video:type" content="application/x-shockwave-flash">
|
|
|
|
{/if}
|
|
|
|
<meta property='og:url' content='{videoLink vdetails=$vdo}'/>
|
|
|
|
<meta property='og:site_name' content='{$title}'/>
|
|
|
|
|
2011-02-19 09:34:37 +00:00
|
|
|
{/if}
|
2011-02-28 14:25:00 +00:00
|
|
|
|
2011-11-24 12:37:19 +00:00
|
|
|
|
|
|
|
{if $smarty.const.THIS_PAGE=='view_channel' && $p.profile_desc}
|
2012-05-18 13:47:20 +00:00
|
|
|
<meta property="og:description" content="{$p.profile_desc}" />
|
2011-11-24 12:37:19 +00:00
|
|
|
{/if}
|
|
|
|
|
2011-02-19 09:34:37 +00:00
|
|
|
{if $object.photo_id}
|
|
|
|
<meta property="og:title" content="{$object.photo_title}" />
|
|
|
|
<meta property="og:description" content="{$object.photo_description|description}" />
|
2011-03-26 13:57:39 +00:00
|
|
|
<meta property="og:image" content="{get_photo details=$object size='m' output='non_html' alt=$object.photo_title}" />
|
2011-02-19 09:34:37 +00:00
|
|
|
<meta name="medium" content="image" />
|
|
|
|
{/if}
|
2011-02-22 15:33:52 +00:00
|
|
|
|
2012-09-13 12:18:39 +00:00
|
|
|
{if $smarty.const.THIS_PAGE == 'view_item'}
|
|
|
|
|
Fixed : Mass Recreation of photos
Fixed : Uploading/Making/Changing user avatar will also update collection cover to current one
Fixed : $crop variable to $cropping in generate_photos. In resizer.class.php we are using $cropping
Added : New cropping case, 10. Read it's example to understand what it does
Added : Documentation for few function in functions_photos.php
Added : new function called display_user_custom_background in functions_users.php
Added : Custom Dimensions for photos in startup.php. Now these will also be produced, 75x75,100x100,150x150,240,320,500,640,800,1024
Updated : default.css
Added : new display_method in blocks/video.html
Added : Change background form
Fixed : photo embed code
2012-09-26 12:35:05 +00:00
|
|
|
{$photo_embeds=photo_embed_codes(['details'=>$object,'display_error'=>'no'])}
|
|
|
|
{if $photo_embeds}
|
2012-09-13 12:18:39 +00:00
|
|
|
<script type="text/javascript">
|
|
|
|
var photo_url = '{view_photo_link($object,"view")}';
|
|
|
|
var embed_format_templates = {json_encode($cbphoto->photo_embed_templates)};
|
|
|
|
|
|
|
|
function update_photo_size( object ) {
|
Fixed : Mass Recreation of photos
Fixed : Uploading/Making/Changing user avatar will also update collection cover to current one
Fixed : $crop variable to $cropping in generate_photos. In resizer.class.php we are using $cropping
Added : New cropping case, 10. Read it's example to understand what it does
Added : Documentation for few function in functions_photos.php
Added : new function called display_user_custom_background in functions_users.php
Added : Custom Dimensions for photos in startup.php. Now these will also be produced, 75x75,100x100,150x150,240,320,500,640,800,1024
Updated : default.css
Added : new display_method in blocks/video.html
Added : Change background form
Fixed : photo embed code
2012-09-26 12:35:05 +00:00
|
|
|
if ( object.length ) {
|
|
|
|
object.siblings().removeClass('active').end().addClass('active');
|
|
|
|
|
|
|
|
$('#photo-embed-code-blocks .photo-embed-code').each( function( index, obj ){
|
|
|
|
$( obj ).addClass( 'photo-embed-code-updating' );
|
|
|
|
var photo_embed_code = embed_format_templates[$(obj).attr('id')];
|
|
|
|
if ( !photo_embed_code ) {
|
|
|
|
photo_embed_code = $(obj).attr('data-embed-format');
|
|
|
|
}
|
2012-09-13 12:18:39 +00:00
|
|
|
|
Fixed : Mass Recreation of photos
Fixed : Uploading/Making/Changing user avatar will also update collection cover to current one
Fixed : $crop variable to $cropping in generate_photos. In resizer.class.php we are using $cropping
Added : New cropping case, 10. Read it's example to understand what it does
Added : Documentation for few function in functions_photos.php
Added : new function called display_user_custom_background in functions_users.php
Added : Custom Dimensions for photos in startup.php. Now these will also be produced, 75x75,100x100,150x150,240,320,500,640,800,1024
Updated : default.css
Added : new display_method in blocks/video.html
Added : Change background form
Fixed : photo embed code
2012-09-26 12:35:05 +00:00
|
|
|
photo_embed_code = photo_embed_code.replace('%PHOTO_URL%', photo_url );
|
|
|
|
photo_embed_code = photo_embed_code.replace('%IMAGE_URL%', object.attr('data-url') );
|
|
|
|
photo_embed_code = photo_embed_code.replace('%IMAGE_WIDTH%', object.attr('data-width') );
|
|
|
|
photo_embed_code = photo_embed_code.replace('%IMAGE_HEIGHT%', object.attr('data-height') );
|
2012-09-13 12:18:39 +00:00
|
|
|
|
Fixed : Mass Recreation of photos
Fixed : Uploading/Making/Changing user avatar will also update collection cover to current one
Fixed : $crop variable to $cropping in generate_photos. In resizer.class.php we are using $cropping
Added : New cropping case, 10. Read it's example to understand what it does
Added : Documentation for few function in functions_photos.php
Added : new function called display_user_custom_background in functions_users.php
Added : Custom Dimensions for photos in startup.php. Now these will also be produced, 75x75,100x100,150x150,240,320,500,640,800,1024
Updated : default.css
Added : new display_method in blocks/video.html
Added : Change background form
Fixed : photo embed code
2012-09-26 12:35:05 +00:00
|
|
|
$( obj ).val( photo_embed_code );
|
|
|
|
setTimeout( function(){
|
|
|
|
$( obj ).removeClass( 'photo-embed-code-updating' );
|
|
|
|
},150 );
|
|
|
|
});
|
|
|
|
}
|
2012-09-13 12:18:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
$(document).ready(function() {
|
|
|
|
update_photo_size( $('li.toggle-photo-size[data-code=m]') );
|
|
|
|
|
|
|
|
$('li.toggle-photo-size').click( function(){
|
|
|
|
update_photo_size( $(this) );
|
|
|
|
});
|
|
|
|
|
|
|
|
$('#photo-embed-code-blocks .photo-embed-code').click( function(){
|
|
|
|
$(this).select();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
{/if}
|
Fixed : Mass Recreation of photos
Fixed : Uploading/Making/Changing user avatar will also update collection cover to current one
Fixed : $crop variable to $cropping in generate_photos. In resizer.class.php we are using $cropping
Added : New cropping case, 10. Read it's example to understand what it does
Added : Documentation for few function in functions_photos.php
Added : new function called display_user_custom_background in functions_users.php
Added : Custom Dimensions for photos in startup.php. Now these will also be produced, 75x75,100x100,150x150,240,320,500,640,800,1024
Updated : default.css
Added : new display_method in blocks/video.html
Added : Change background form
Fixed : photo embed code
2012-09-26 12:35:05 +00:00
|
|
|
{/if}
|
2011-02-22 15:33:52 +00:00
|
|
|
|
|
|
|
{literal}
|
|
|
|
<script>
|
2012-05-18 13:47:20 +00:00
|
|
|
$(function() {
|
|
|
|
|
|
|
|
$( ".date_field" ).datepicker({
|
|
|
|
dateFormat: 'yy-mm-dd',
|
|
|
|
changeMonth: true,
|
|
|
|
changeYear: true,
|
|
|
|
yearRange : "1901 : c"
|
|
|
|
});
|
|
|
|
|
|
|
|
{/literal}
|
|
|
|
{if $smarty.const.THIS_PAGE == 'view_group' || $smarty.const.THIS_PAGE == 'view_group_videos' || $smarty.const.THIS_PAGE == 'user_videos' || $smarty.const.THIS_PAGE == 'user_collections' || $smarty.const.THIS_PAGE == 'user_photos'}
|
|
|
|
{literal}
|
|
|
|
$(".pagination a").live({
|
|
|
|
click : function(event) {
|
|
|
|
event.preventDefault();
|
|
|
|
if(!window.location.hash) {
|
|
|
|
groupsAjax(event,this);
|
|
|
|
} else {
|
|
|
|
var windowHash = window.location.hash.replace("#!",""),
|
|
|
|
expression = /(\&page=[/a-zA-Z0-9=\.\&\-\_\?]*)/g;
|
|
|
|
page = this.href.match(expression);
|
|
|
|
if(page) {
|
|
|
|
pageCode = page;
|
|
|
|
} else {
|
|
|
|
pageCode = "&page=1";
|
|
|
|
}
|
|
|
|
this.href = baseurl+windowHash.replace(expression,"")+pageCode;
|
|
|
|
groupsAjax(event,this);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
{/literal}
|
|
|
|
{/if}
|
|
|
|
{literal}
|
|
|
|
});
|
2012-12-26 13:33:26 +00:00
|
|
|
{/literal}
|
|
|
|
$( document ).ready( function(){
|
|
|
|
var cbsearch_component = $('[data-component=cbsearch]');
|
|
|
|
var selected_search_type = $('[data-component=cbsearch] .selected-search-type').text();
|
|
|
|
var cbsearch_advance_options = $('.search-advance-options');
|
|
|
|
|
|
|
|
if ( !selected_search_type || selected_search_type == ' ' ) {
|
|
|
|
var default_search_type = $('[data-component=cbsearch] [data-type=videos].search-type');
|
|
|
|
$('[data-component=cbsearch] .selected-search-type').prepend( default_search_type.text()+' ' );
|
|
|
|
default_search_type.addClass('active');
|
|
|
|
default_search_type.parents('form').find('input[name=type]').val( default_search_type.attr('data-type') );
|
|
|
|
}
|
|
|
|
|
|
|
|
cbsearch_component.find('.search-type').click( function(){
|
|
|
|
var new_selected_type = $(this).attr('id'), new_selected_text = $(this).text(), selected_search_text = $( this ).parents('[data-component=cbsearch]').find('.selected-search-type').text();
|
|
|
|
var new_selected_search = cbsearch_component.find('.selected-search-type').html().replace( selected_search_text, new_selected_text+' ' );
|
|
|
|
cbsearch_component.find('.selected-search-type').html( new_selected_search );
|
|
|
|
cbsearch_component.find('input[name=type]').val( $(this).attr('data-type') );
|
|
|
|
cbsearch_component.find('.search-type.active').removeClass('active');
|
|
|
|
$( this ).addClass('active');
|
|
|
|
|
|
|
|
if ( cbsearch_advance_options.css('display') == 'block' ) {
|
|
|
|
cbsearch_advance_options.find('.search-advance-option').hide();
|
|
|
|
cbsearch_advance_options.find('[data-type='+$(this).attr('data-type')+']').show();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
cbsearch_component.find('.search-options').click( function(){
|
|
|
|
|
|
|
|
if ( cbsearch_advance_options.css('display') == 'block' ) {
|
|
|
|
cbsearch_advance_options.hide();
|
|
|
|
} else {
|
|
|
|
cbsearch_advance_options.find('.search-advance-option').hide();
|
|
|
|
var current_search_type = ( cbsearch_component.find('input[name=type]').val() );
|
|
|
|
cbsearch_advance_options.find('[data-type='+current_search_type+']').show();
|
|
|
|
cbsearch_advance_options.show();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
2011-02-22 15:33:52 +00:00
|
|
|
</script>
|
2012-12-26 13:33:26 +00:00
|
|
|
|
2012-05-18 13:47:20 +00:00
|
|
|
{ANCHOR place='cb_head'}
|
2011-08-09 08:23:23 +00:00
|
|
|
<!-- ClipBucket version {$Cbucket->cbinfo.version} -->
|