472 lines
6.8 KiB
Smarty
472 lines
6.8 KiB
Smarty
|
|
{include file='header.tpl'}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
{* $Id: album_file.tpl 240 2009-11-14 02:42:57Z phil $ *}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
{* SET PAGE WIDTH *}
|
||
|
|
|
||
|
|
{assign var='page_width' value=$owner->level_info.level_album_width}
|
||
|
|
|
||
|
|
{assign var='menu_width' value=$page_width+32}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<div id="albumimagecontainer">
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</div>
|
||
|
|
|
||
|
|
{literal}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<script type="text/javascript" src="/js/jquery.autogrow-textarea.js"></script>
|
||
|
|
|
||
|
|
<script>
|
||
|
|
|
||
|
|
|
||
|
|
jQuery(function() {
|
||
|
|
|
||
|
|
jQuery('#comment_body').autogrow();
|
||
|
|
|
||
|
|
});
|
||
|
|
|
||
|
|
jQuery(document).ready(function() {
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
{/literal}
|
||
|
|
|
||
|
|
|
||
|
|
loadalbumfile("{$owner->user_info.user_username}", {$album_info.album_id}, {$media_info.media_id}, 0);
|
||
|
|
|
||
|
|
{literal}
|
||
|
|
|
||
|
|
//loadXMLDoc(1);
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
});
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</script>
|
||
|
|
|
||
|
|
<script>
|
||
|
|
|
||
|
|
{/literal}
|
||
|
|
|
||
|
|
mediaid={$media_info.media_id};
|
||
|
|
|
||
|
|
{literal}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
function loadXMLDoc(page)
|
||
|
|
|
||
|
|
{
|
||
|
|
|
||
|
|
/*var xmlhttp;
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
if (window.XMLHttpRequest)
|
||
|
|
|
||
|
|
{// code for IE7+, Firefox, Chrome, Opera, Safari
|
||
|
|
|
||
|
|
xmlhttp=new XMLHttpRequest();
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
else
|
||
|
|
|
||
|
|
{// code for IE6, IE5
|
||
|
|
|
||
|
|
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
xmlhttp.onreadystatechange=function()
|
||
|
|
|
||
|
|
{
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
if (xmlhttp.readyState==4 && xmlhttp.status==200)
|
||
|
|
|
||
|
|
{
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
document.getElementById("{/literal}{$owner->user_info.user_username}_profile_comments{literal}").innerHTML=xmlhttp.responseText;
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
xmlhttp.open("GET","{/literal}grabprofilecomments.php?user={$owner->user_info.user_username}&url={$smarty.server.PHP_SELF}{if $smarty.server.QUERY_STRING!=""}?{$smarty.server.QUERY_STRING|urlencode}{/if}&p="+page+"&type=media&tab=media&tab_parent=albums&col_parent=album&child=1&col=media&focus=media_id&media_id="+mediaid{literal},true);
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
xmlhttp.send();*/
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
jQuery("#{/literal}{$owner->user_info.user_username}_profile_comments{literal}").load("{/literal}grabprofilecomments.php?user={$owner->user_info.user_username}&url={$smarty.server.PHP_SELF}{if $smarty.server.QUERY_STRING!=""}?{$smarty.server.QUERY_STRING|urlencode}{/if}&p="+page+"&type=media&tab=media&tab_parent=albums&col_parent=album&child=1&col=media&focus=media_id&media_id="+mediaid{literal}, function(responseTxt, statusTxt, xhr){
|
||
|
|
|
||
|
|
if(xhr.state() == "resolved"){
|
||
|
|
|
||
|
|
// alert(statusTxt);
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
else
|
||
|
|
|
||
|
|
{
|
||
|
|
|
||
|
|
e.preventdefault();
|
||
|
|
|
||
|
|
return;
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
//alert(xhr.state());
|
||
|
|
|
||
|
|
});
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</script>
|
||
|
|
|
||
|
|
<script type="text/javascript">
|
||
|
|
|
||
|
|
var media_id = 0;
|
||
|
|
|
||
|
|
queryString="";
|
||
|
|
|
||
|
|
urlParams="";
|
||
|
|
|
||
|
|
window.addEventListener('popstate', function(e) {
|
||
|
|
|
||
|
|
// e.state is equal to the data-attribute of the last image we clicked
|
||
|
|
|
||
|
|
queryString = window.location.search;
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
urlParams = new URLSearchParams(queryString);
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
loadalbumfile(urlParams.get('user'), urlParams.get('album_id'), urlParams.get('media_id'), 0);
|
||
|
|
|
||
|
|
return;
|
||
|
|
|
||
|
|
});
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
jQuery(document).keydown(function (e) {
|
||
|
|
|
||
|
|
var focussedTag = document.activeElement && document.activeElement.nodeName;
|
||
|
|
|
||
|
|
if( focussedTag === 'INPUT' || focussedTag === 'TEXTAREA' ) {
|
||
|
|
|
||
|
|
return;
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
if (!jQuery(".emojionearea-editor"). is(":focus")) {
|
||
|
|
|
||
|
|
if (e.which === 37) {
|
||
|
|
|
||
|
|
jQuery("#prevlink").trigger("click");
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
else if (e.which === 39) {
|
||
|
|
|
||
|
|
jQuery("#nextlink").trigger("click");
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
} );
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
/*document.onkeydown = function(e) {
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
switch(e.which) {
|
||
|
|
|
||
|
|
case 37: // left
|
||
|
|
|
||
|
|
jQuery("#prevlink").trigger("click");
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
break;
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
case 39: // right
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
jQuery("#nextlink").trigger("click");
|
||
|
|
|
||
|
|
break;
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
default: return; // exit this handler for other keys
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
e.preventDefault(); // prevent the default action (scroll / move caret)
|
||
|
|
|
||
|
|
};
|
||
|
|
|
||
|
|
*/
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
function loadalbumfile(user, albumid, media_id, push=1)
|
||
|
|
|
||
|
|
{
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
if(media_id==0||media_id==undefined){
|
||
|
|
|
||
|
|
location.href="/album.php?user="+user+"&album_id="+albumid;
|
||
|
|
|
||
|
|
return
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
else{
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
if(push==1){history.pushState("", "BateWorld Album", 'album_file.php?user='+user+'&album_id='+albumid+'&media_id='+media_id);}
|
||
|
|
jQuery("#albumimagecontainer").load('homestorage/album_file_load.php?user='+user+'&album_id='+albumid+'&media_id='+media_id, function(responseTxt, statusTxt, xhr){
|
||
|
|
|
||
|
|
if(xhr.state() == "resolved"){
|
||
|
|
|
||
|
|
// alert(statusTxt);
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
else
|
||
|
|
|
||
|
|
{
|
||
|
|
|
||
|
|
e.preventdefault();
|
||
|
|
|
||
|
|
return;
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
//alert(xhr.state());
|
||
|
|
|
||
|
|
});
|
||
|
|
|
||
|
|
}}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
/*jQuery('#ajaxframe').load(function(){
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
//loadXMLDoc(1);
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
document.getElementById('comment_body').value="";
|
||
|
|
|
||
|
|
});*/
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
function editComment1(commentID)
|
||
|
|
|
||
|
|
{
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
//var commentContainerElement = $(this.options.type + '_' + this.options.typeID + '_comments');
|
||
|
|
|
||
|
|
//var commentElement = commentContainerElement.getElement('profile_comment_body_' + commentID);
|
||
|
|
|
||
|
|
var commentElement = document.getElementById('profile_comment_body_' + commentID);
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
var height = commentElement.offsetHeight + 10;
|
||
|
|
|
||
|
|
var commentText = commentElement.innerHTML.replace(/<br>/gi, '\r\n').replace(/>/gi, '>');
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
var innerHTML = '';
|
||
|
|
|
||
|
|
innerHTML += "<form action='misc_js.php' method='post' name='editCommentForm' id='editCommentForm'>";
|
||
|
|
|
||
|
|
innerHTML += "<textarea name='comment_edit' id='comment_edit_" + commentID + "' style='height: " + height +" px; width: 100%;' onblur='doCommentEditNew("+commentID+")'>" + commentText + "</textarea>";
|
||
|
|
|
||
|
|
innerHTML += "<input type='hidden' name='task' value='comment_edit'>";
|
||
|
|
|
||
|
|
innerHTML += "<input type='hidden' name='comment_id' value='" + commentID + "'>";
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
innerHTML += "<input type='hidden' name='type' value='media'>";
|
||
|
|
|
||
|
|
innerHTML += "<input type='hidden' name='iden' value='media_id'>";
|
||
|
|
|
||
|
|
innerHTML += "<input type='hidden' name='value' value='"+mediaid+"'>";
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
innerHTML +=
|
||
|
|
|
||
|
|
'<input type="hidden" name="tab" value="users">';
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
innerHTML +=
|
||
|
|
|
||
|
|
'<input type="hidden" name="col" value="user">';
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
/* if( this.options.typeTabParent ) innerHTML +=
|
||
|
|
|
||
|
|
'<input type="hidden" name="tab_parent" value="' + this.options.typeTabParent + '">';
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
if( this.options.typeColParent ) innerHTML +=
|
||
|
|
|
||
|
|
'<input type="hidden" name="col_parent" value="' + this.options.typeColParent + '">';
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
if( this.options.typeChild ) innerHTML +=
|
||
|
|
|
||
|
|
'<input type="hidden" name="child" value="1">';
|
||
|
|
|
||
|
|
*/
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
innerHTML += "</form>";
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
// Inject
|
||
|
|
|
||
|
|
commentElement.innerHTML = innerHTML;
|
||
|
|
|
||
|
|
textarea_autogrow('comment_edit_' + commentID);
|
||
|
|
|
||
|
|
jQuery('#comment_edit_' + commentID).focus();
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</script>
|
||
|
|
|
||
|
|
{/literal}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
{include file='footer.tpl'}
|