242 lines
10 KiB
Smarty
242 lines
10 KiB
Smarty
|
|
{* $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 class='albumimagecontainer' >
|
|
|
|
<div class='page_header'>
|
|
{lang_sprintf id=1000141 1=$url->url_create('profile', $owner->user_info.user_username) 2=$owner->user_displayname 3=$url->url_create('albums', $owner->user_info.user_username)}
|
|
» <a href='{$url->url_create('album', $owner->user_info.user_username, $album_info.album_id)}'>{$album_info.album_title}</a>
|
|
</div>
|
|
|
|
|
|
{* SET MEDIA PATH *}
|
|
{assign var='media_dir' value=$url->url_userdir($owner->user_info.user_id)}
|
|
{assign var='media_path' value="`$media_dir``$media_info.media_id`.`$media_info.media_ext`"}
|
|
|
|
|
|
|
|
|
|
|
|
{* DISPLAY IMAGE *}
|
|
{if $media_info.media_ext == "jpg" ||
|
|
$media_info.media_ext == "jpeg" ||
|
|
$media_info.media_ext == "gif" ||
|
|
$media_info.media_ext == "png" ||
|
|
$media_info.media_ext == "bmp"||
|
|
$media_info.media_ext == "JPG" ||
|
|
$media_info.media_ext == "JPEG" ||
|
|
$media_info.media_ext == "GIF" ||
|
|
$media_info.media_ext == "PNG" ||
|
|
$media_info.media_ext == "BMP"}
|
|
{assign var='file_src' value="<img src='`$media_path`' id='media_photo' border='0' class='img-responsive center-block'>"}
|
|
{assign var='is_image' value=true}
|
|
|
|
|
|
|
|
|
|
{* DISPLAY UNKNOWN FILETYPE *}
|
|
{else}
|
|
{capture assign='media_download'}[ <a href='{$media_path}'>{lang_print id=1000144}</a> ]{/capture}
|
|
{assign var='file_src' value="<a href='`$media_path`'><!--<img src='./images/icons/file_big.gif' border='0'>--></a>"}
|
|
{assign var='is_image' value=false}
|
|
{/if}
|
|
|
|
|
|
{* ASSIGN INDICES *}
|
|
{*assign var="current_index" value=$media_info.media_id|array_search:$media_keys}
|
|
{capture assign="previous_index"}{if $current_index == 0}{math equation="x-1" x=$media|@count}{else}{math equation="x-1" x=$current_index}{/if}{/capture}
|
|
{capture assign="next_index"}{if $current_index+1 == $media|@count}0{else}{math equation="x+1" x=$current_index}{/if}{/capture}
|
|
{capture assign="current_num"}{math equation="x+1" x=$current_index}{/capture*}
|
|
|
|
|
|
<br>
|
|
|
|
{* SHOW PAGE NAVIGATION *}
|
|
<div style='margin-bottom: 6px;' id="media_file">
|
|
<table cellpadding='0' cellspacing='0' width='100%'>
|
|
<tr>
|
|
<td>
|
|
{lang_sprintf id=1000145 1=$thismediaid 2=$totalnum 3=$url->url_create('album', $owner->user_info.user_username, $album_info.album_id) 4=$album_info.album_title} {*lang_sprintf id=1000145 1=$current_num 2=$media|@count 3=$url->url_create('album', $owner->user_info.user_username, $album_info.album_id) 4=$album_info.album_title*}
|
|
</td>
|
|
<td style='text-align: right;'>
|
|
<a href='javascript:void(0);' onclick="loadalbumfile('{$owner->user_info.user_username}', '{$album_info.album_id}', '{$nextid}');" id="prevlink">Previous</a>
|
|
|
|
<a href='javascript:void(0);' onclick="loadalbumfile('{$owner->user_info.user_username}', '{$album_info.album_id}', '{$previd}');" id="nextlink">{lang_print id=1000147}</a>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
|
|
{* SHOW IMAGE *}
|
|
<div class='media' >
|
|
|
|
|
|
{* CREATE WRAPPER DIV *}
|
|
<div id='media_photo_div' class='media_photo_div'>
|
|
|
|
{* DISPLAY FILE/IMAGE *}
|
|
<a href='javascript:void(0);' onclick="loadalbumfile('{$owner->user_info.user_username}', '{$album_info.album_id}', '{$previd}');" id="nextlink">{$file_src}</a>
|
|
<!--
|
|
<a href='{$url->url_create('album_file', $owner->user_info.user_username, $album_info.album_id, $media_keys.$next_index)}' rel='nofollow'>{$file_src}</a>
|
|
//-->
|
|
|
|
</div>
|
|
|
|
{* SHOW MEDIA DOWNLOAD LINK FOR NON-IMAGES *}
|
|
{if $media_download != ""}
|
|
<div style='font-weight: bold; margin-left: auto; margin-right: auto;'>{$media_download}</div>
|
|
{/if}
|
|
|
|
{* SHOW DIV WITH TITLE, DESC, TAGS, ETC *}
|
|
<div class='album_media_caption' style='width: {if $media_info.media_width > 300}{$media_info.media_width}{else}300{/if}px;'>
|
|
{if $media_info.media_title != ""}<div class='album_media_title'>{$media_info.media_title}</div>{/if}
|
|
{if $media_info.media_desc != ""}<div>{$media_info.media_desc}</div>{/if}
|
|
<div id='media_tags' style='display: none; margin-top: 10px;'>{lang_print id=1000162}</div>
|
|
{if $is_image && $allowed_to_tag}
|
|
<a href='javascript:void(0);' onClick="SocialEngine.MediaTag.addTag();">{lang_print id=1000163}</a>
|
|
{/if}
|
|
<div class='album_media_date'>
|
|
{lang_print id=1000126} {assign var="uploaddate" value=$datetime->time_since($media_info.media_date)}{lang_sprintf id=$uploaddate[0] 1=$uploaddate[1]}
|
|
|
|
|
|
|
|
-
|
|
<a data-toggle="modal" data-target="#myModal" href="/user_report.php?return_url={$urlencoded}">{lang_print id=1000148}</a>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
{* TAGGING *}
|
|
{lang_javascript ids=39,1212,1213,1214,1215,1228}
|
|
|
|
<script type="text/javascript">
|
|
|
|
SocialEngine.MediaTag = new SocialEngineAPI.Tags({ldelim}
|
|
'canTag' : {if $allowed_to_tag}true{else}false{/if},
|
|
|
|
'type' : '',
|
|
'media_id' : {$media_info.media_id},
|
|
'media_dir' : '{$media_dir}'
|
|
|
|
{rdelim});
|
|
|
|
SocialEngine.RegisterModule(SocialEngine.MediaTag);
|
|
|
|
{section name=tag_loop loop=$tags}
|
|
insertTag('{$tags[tag_loop].mediatag_id}', '{if $tags[tag_loop].tagged_user->user_exists}{$url->url_create("profile", $tags[tag_loop].tagged_user->user_info.user_username)}{/if}', '{if $tags[tag_loop].tag_user->user_exists}{$tags[tag_loop].tagged_user->user_displayname}{else}{$tags[tag_loop].mediatag_text}{/if}', '{$tags[tag_loop].mediatag_x}', '{$tags[tag_loop].mediatag_y}', '{$tags[tag_loop].mediatag_width}', '{$tags[tag_loop].mediatag_height}', '{$tags[tag_loop].tagged_user->user_info.user_username}')
|
|
{/section}
|
|
|
|
// Backwards
|
|
function insertTag(tag_id, tag_link, tag_text, tag_x, tag_y, tag_width, tag_height, tagged_user)
|
|
{ldelim}
|
|
SocialEngine.MediaTag.insertTag(tag_id, tag_link, tag_text, tag_x, tag_y, tag_width, tag_height, tagged_user);
|
|
{rdelim}
|
|
|
|
</script>
|
|
|
|
|
|
</div>
|
|
<div style="overflow:hidden;">
|
|
<table class="newalbumcarousel"><tr>
|
|
{foreach name=media_loop from=$media key=k item=v}
|
|
{if $v.media_ext!=''}
|
|
{* IF IMAGE, GET THUMBNAIL *}
|
|
{if $v.media_ext == "jpeg" || $v.media_ext == "jpg" || $v.media_ext == "gif" || $v.media_ext == "png" || $v.media_ext == "bmp"||$v.media_ext == "JPEG" || $v.media_ext == "JPG" || $v.media_ext == "GIF" || $v.media_ext == "PNG" || $v.media_ext == "BMP"}
|
|
{assign var='file_dir' value=$url->url_userdir($v.album_user_id)}
|
|
{assign var='file_src' value="`$file_dir``$v.media_id`_thumb.`$v.media_ext`"}
|
|
|
|
|
|
{if $file_src|file_exists eq ''}
|
|
{assign var='file_src' value="`$file_dir``$v.media_id`_thumb.jpg"}
|
|
{/if}
|
|
|
|
|
|
{* SET THUMB PATH FOR AUDIO *}
|
|
{elseif $v.media_ext == "mp3" || $v.media_ext == "mp4" || $v.media_ext == "wav"}
|
|
{assign var='file_src' value='./images/icons/audio_big.gif'}
|
|
{* SET THUMB PATH FOR VIDEO *}
|
|
{elseif $v.media_ext == "mpeg" || $v.media_ext == "mpg" || $v.media_ext == "mpa" || $v.media_ext == "avi" || $v.media_ext == "swf" || $v.media_ext == "mov" || $v.media_ext == "ram" || $v.media_ext == "rm"}
|
|
{assign var='file_src' value='./images/icons/video_big.gif'}
|
|
{* SET THUMB PATH FOR UNKNOWN *}
|
|
{else}
|
|
{assign var='file_src' value='./images/icons/file_big.gif'}
|
|
{/if}
|
|
|
|
{* SHOW THUMBNAILS *}
|
|
<td id='thumb{$smarty.foreach.media_loop.iteration}' class='carousel_item{if $v.media_id == $media_info.media_id}_active{/if}'><a href="javascript:void(0);" onclick="loadalbumfile('{$owner->user_info.user_username}', '{$album_info.album_id}', '{$v.media_id}');"><img src='{$file_src}' border='0' width='{$misc->photo_size($file_src,'70','70','w')}' onClick='this.blur()'></a></td>
|
|
{/if}
|
|
{/foreach}
|
|
</tr></table></div>
|
|
<br>
|
|
|
|
|
|
{* DISPLAY POST COMMENT BOX *}
|
|
<div style='margin-left: auto; margin-right: auto;'>
|
|
|
|
{* COMMENTS *}
|
|
{if $allowed_to_comment}
|
|
<div id="profile_{$media_info.media_id}_postcomment"><div class="comment_headline">Comments (<span class="tc" id="totalcomments">{$total_comments|default:0}</span>)</div>
|
|
|
|
<form action="#" method="post" target="ajaxframe" onsubmit="return updatecount();"><div class="profile_postcomment"><textarea name="comment_body" id="comment_body" cols="25" class="comment_area" style="overflow: hidden; height: 70px;" placeholder="Write Something..."></textarea><div style="margin-top: 5px;">Allowed HTML Tags: b, img, a, br</div><div style="text-align: right; margin-top: 5px;">
|
|
|
|
<input type="submit" id="comment_submit" class="button" value="Post Comment" />
|
|
|
|
|
|
|
|
|
|
<input type="hidden" name="task" id="task" value="comment_post"><input type="hidden" name="type" id="type" value="media"><input type="hidden" name="col" id="col" value="media"><input type="hidden" name="iden" id="iden" value="media_id"><input type="hidden" name="value" id="value" value="{$media_info.media_id}"><input type="hidden" name="user" id="user" value="{$owner->user_info.user_username}"><input type="hidden" name="tab" id="tab" value="media"><input type="hidden" name="tab_parent" id="tab_parent" value="albums"><input type="hidden" name="col_parent" id="col_parent" value="album"><input type="hidden" name="child" id="child" value="1"></div><div id="comment_error" style="color: #FF0000; display: none;"></div></div></form>
|
|
|
|
|
|
</div>{/if}
|
|
<div id="{$owner->user_info.user_username}_profile_comments" style='margin-left: auto; margin-right: auto;'></div>
|
|
|
|
{lang_javascript ids=39,155,175,182,183,184,185,187,784,787,829,830,831,832,833,834,835,854,856,891,1025,1026,1032,1034,1071}
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
{literal}
|
|
<script>
|
|
|
|
{/literal}
|
|
mediaid={$media_info.media_id};
|
|
{literal}
|
|
jQuery(function() {
|
|
jQuery('#comment_body').autogrow();
|
|
});
|
|
jQuery(document).ready(function() {
|
|
|
|
|
|
loadXMLDoc(1);
|
|
|
|
{/literal}{if $user->user_info.user_level_id > 1&& $favorites==1&&$list==1}{literal}
|
|
|
|
jQuery(".addtofavorites").html({/literal}'<a data-toggle="modal" data-target="#myModal" href="user_list.php?{$smarty.server.QUERY_STRING}&type={$type}">Add to List</a>'{literal});
|
|
|
|
{/literal}{/if}{literal}
|
|
|
|
});
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
{/literal}
|
|
|