Files
Testing/templates/group_album_file1.tpl
sean 0e8a8b3028
Some checks failed
deploy-testing / deploy (push) Has been cancelled
Initial testing snapshot
2026-11-17 16:15:01 -05:00

203 lines
5.6 KiB
Smarty

{include file='header.tpl'}
{* $Id: group_album_file.tpl 247 2009-11-14 03:30:43Z phil $ *}
{* SET GROUP OWNER *}
<script type="text/javascript">
// User - Owner
SocialEngine.Owner = new SocialEngineAPI.User();
SocialEngine.Owner.ImportUserInfo({$se_javascript->generateUserInfo($groupowner)});
SocialEngine.RegisterModule(SocialEngine.Owner);
</script>
{* SET PAGE WIDTH *}
{assign var='page_width' value=$group->groupowner_level_info.level_group_album_width}
{assign var='menu_width' value=$page_width+32}
<div id="albumimagecontainer">
</div>
<script type="text/javascript" src="/js/jquery.autogrow-textarea.js"></script>
<script>mediaid={$media_info.groupmedia_id};{literal}
jQuery(function() {
jQuery('#comment_body').autogrow();
});
jQuery(document).ready(function() {
{/literal}
loadalbumfile({$group->group_info.group_id}, {$media_info.groupmedia_id})
//loadXMLDoc(1);
{literal}
});
</script>
<script>
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}group_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=groupmedia&tab=groupmedia&tab_parent=groupalbums&col_parent=groupalbum&child=1&col=groupmedia&focus=groupmedia_id&object_owner=group&object_owner_id={$group->group_info.group_id}&groupmedia_id="+mediaid{literal},true);
xmlhttp.send();
}
</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('group_id'), urlParams.get('groupmedia_id'), 0);
return;
});
jQuery(document).keydown(function (e) {
var focussedTag = document.activeElement && document.activeElement.nodeName;
if( focussedTag === 'INPUT' || focussedTag === 'TEXTAREA' ) {
return;
}
if (e.which === 37) {
jQuery("#prevlink").trigger("click");
}
else if (e.which === 39) {
jQuery("#nextlink").trigger("click");
}
} );
function loadalbumfile(groupid, groupmedia_id, push=1)
{
if(groupmedia_id==0||groupmedia_id==undefined){
location.href="/group_album_file.php?group_id="+groupid+"&groupmedia_id="+groupmedia_id;
return
}
else{
if(push==1){history.pushState("", "BateWorld Album", 'group_album_file.php?group_id='+groupid+'&groupmedia_id='+groupmedia_id);}
jQuery("#albumimagecontainer").load('homestorage/group_file_load.php?group_id='+groupid+'&groupmedia_id='+groupmedia_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 = $('profile_comment_body_' + commentID);
var height = commentElement.offsetHeight + 10;
var commentText = commentElement.innerHTML.replace(/<br>/gi, '\r\n').replace(/>/gi, '&gt;');
var innerHTML = '';
innerHTML += "<form action='misc_js.php' method='post' target='ajaxframe' name='editCommentForm' id='editCommentForm'>";
innerHTML += "<textarea name='comment_edit' id='comment_edit_" + commentID + "' style='height: " + height +" px; width: 100%;' onblur='doCommentEdit("+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='groupmedia'>";
innerHTML += "<input type='hidden' name='iden' value='groupmedia_id'>";
innerHTML += "<input type='hidden' name='value' value='{/literal}{$media_info.groupmedia_id}{literal}'>";
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);
$('comment_edit_' + commentID).focus();
}
</script>
{/literal}
{include file='footer.tpl'}