459 lines
18 KiB
Smarty
459 lines
18 KiB
Smarty
{include file='header.tpl'}
|
|
aaaaaaaa
|
|
{* $Id: video.tpl 236 2009-11-13 05:29:23Z phil $ *}
|
|
{if $video_info.video_admin_approved==0 && $user->user_info.user_id!=$owner->user_info.user_id}This video is pending moderator approval.{else}
|
|
<div class='page_header'>
|
|
{capture assign="owner_url"}{$url->url_create('profile', $owner->user_info.user_username)}&v=video{/capture}
|
|
{lang_sprintf id=5500076 1=$owner_url 2=$owner->user_displayname}
|
|
</div>
|
|
|
|
|
|
{* LEFT COLUMN - VIDEO PLAYER AND COMMENTS *}
|
|
<table cellpadding='0' cellspacing='0' border='0' style='margin-top: 10px;' width='100%'>
|
|
<tr>
|
|
<td valign='top' align='left'>
|
|
|
|
{* VIDEO HEADER - TITLE AND TEXT *}
|
|
<div style='padding:2px;border:1px solid #c0c0c0;'>
|
|
<div class='videoHeader' style='width:{$setting.setting_video_width}px'>
|
|
<div class='inner' style='cursor:default'>
|
|
<h1>{$video_info.video_title}</h1>
|
|
<h2 id='short_desc'>{$video_info.video_desc_short|truncate:100:"...":true}{if $video_info.video_desc|count_characters:true > 100} (<a href='javascript:void(0);' onClick="$('short_desc').style.display = 'none'; $('long_desc').style.display = 'block';">{lang_print id=5500101}</a>){/if}</h2>
|
|
{if $video_info.video_desc|count_characters:true > 100}
|
|
<h2 id='long_desc' style='display:none'>{$video_info.video_desc|nl2br} (<a href='javascript:void(0);' onClick="$('short_desc').style.display = 'block'; $('long_desc').style.display = 'none';">{lang_print id=5500027}</a>)</h2>
|
|
{/if}
|
|
</div>
|
|
</div>
|
|
|
|
{* LOAD FLASH PLAYER *}
|
|
{if $video_info.video_type == 1}
|
|
|
|
<object width="{$setting.setting_video_width}" height="{$setting.setting_video_height}"><param name="wmode" value="transparent"></param><param name="movie" value="http://www.youtube.com/v/{$video_info.video_youtube_code}&hl=en&fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed wmode="transparent" src="http://www.youtube.com/v/{$video_info.video_youtube_code}&hl=en&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="{$setting.setting_video_width}" height="{$setting.setting_video_height}"></embed></object>
|
|
|
|
{/if}
|
|
|
|
{if $video_info.video_type == 0}
|
|
{literal}
|
|
<script src="/js/html5media.min.js"></script>
|
|
<video width="660" height="480" id="myElement" controls poster="{/literal}{$video_info.video_dir|replace:'./':''}{$video_id}_thumb.jpg{literal}">
|
|
|
|
|
|
<source src="{/literal}{$video_info.video_dir|replace:'./':''}{$video_id}{literal}.mp4" type="video/mp4">
|
|
<source src="{/literal}{$video_info.video_dir|replace:'./':''}{$video_id}{literal}.flv" type="video/flv">
|
|
|
|
|
|
Please use another browser to view this video.
|
|
|
|
</video>
|
|
<script type="text/javascript" src="/player/jwplayer.js" ></script>
|
|
<script type="text/javascript">jwplayer.key="ZEHRl3BZ35p1owAi0ceaQ6S3yKRy5SJt+CC1pA==";</script>
|
|
<script type="text/javascript">
|
|
|
|
function supports_h264_baseline_video() {
|
|
|
|
//if (!supports_video()) { return false; }
|
|
var v = document.createElement("video");
|
|
return v.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"');
|
|
}
|
|
|
|
jQuery(function() {
|
|
jQuery('#comment_body').autogrow();
|
|
});
|
|
jQuery(document).ready(function() {
|
|
|
|
|
|
loadXMLDoc(1);
|
|
var v = document.createElement("video"); // Check if the browser supports the video tag
|
|
if (!supports_h264_baseline_video()) {
|
|
|
|
jwplayer("myElement").setup({
|
|
modes: [
|
|
{ type: 'flash', src: '/player/player.swf' },
|
|
{ type: 'html5' }
|
|
|
|
],
|
|
levels: [
|
|
{file: "{/literal}{$video_info.video_dir|replace:'./':''}{$video_id}.flv{literal}", type: 'video/flv' },
|
|
{file: "{/literal}{$video_info.video_dir|replace:'./':''}{$video_id}.mp4{literal}", type: 'video/mp4' }
|
|
|
|
],
|
|
|
|
//file: "{/literal}{$video_info.video_dir|replace:'./':''}{$video_id}.mp4{literal}",
|
|
image: "{/literal}{$video_info.video_dir|replace:'./':''}{$video_id}_thumb.jpg{literal}",
|
|
height: 480,
|
|
width: 660
|
|
});}
|
|
else {
|
|
// fix for firefox not looping
|
|
var myVideo = document.getElementById('myElement');
|
|
|
|
if (!(typeof myVideo.loop == 'boolean')) { // loop supported
|
|
myVideo.addEventListener('ended', function () {
|
|
this.currentTime = 0;
|
|
this.play();
|
|
}, false);
|
|
}
|
|
}
|
|
});</script>
|
|
{/literal}
|
|
{/if}
|
|
{* DISPLAY FLASH PLAYER *}
|
|
|
|
</div>
|
|
|
|
|
|
{* SHOW VIDEO DETAILS *}
|
|
<div class='videoInfo' style='width:{$setting.setting_video_width}px'>
|
|
|
|
<div id='tab'>
|
|
|
|
{* SHOW RATING (NOT ALLOWED TO RATE) *}
|
|
{if !$allowed_to_rate}
|
|
<div id='video_rating' style='float: left;'>
|
|
{section name=full_loop start=0 loop=$video_info.video_rating_full}
|
|
<img src='./images/icons/video_rating_full.gif' border='0'>
|
|
{/section}
|
|
{if $video_info.video_rating_part}<img src='./images/icons/video_rating_part.gif' border='0'>{/if}
|
|
{section name=none_loop start=0 loop=$video_info.video_rating_none}
|
|
<img src='./images/icons/video_rating_none.gif' border='0'>
|
|
{/section}
|
|
</div>
|
|
|
|
{* SHOW RATING (ALLOWED TO RATE) *}
|
|
{else}
|
|
<div id='video_rating' onmouseout='rating_out()' style='float: left;'>
|
|
{assign var="rating" value="0"}
|
|
{section name=full_loop start=0 loop=$video_info.video_rating_full}
|
|
{assign var="rating" value=$rating+1}
|
|
<img src='./images/icons/video_rating_full.gif' border='0' onmouseover="rating_over({$rating});" onclick="rate({$rating});" id='rate_{$rating}' style='cursor:pointer;'>
|
|
{/section}
|
|
{if $video_info.video_rating_part}
|
|
{assign var="rating" value=$rating+1}
|
|
<img src='./images/icons/video_rating_part.gif' border='0' onmouseover="rating_over({$rating});" onclick="rate({$rating});" id='rate_{$rating}' style='cursor:pointer;'>
|
|
{/if}
|
|
{section name=none_loop start=0 loop=$video_info.video_rating_none}
|
|
{assign var="rating" value=$rating+1}
|
|
<img src='./images/icons/video_rating_none.gif' border='0' onmouseover="rating_over({$rating});" onclick="rate({$rating});" id='rate_{$rating}' style='cursor:pointer;'>
|
|
{/section}
|
|
</div>
|
|
|
|
{* RATING JAVASCRIPT *}
|
|
{literal}
|
|
<script type='text/javascript'>
|
|
<!--
|
|
|
|
preload_full = new Image();
|
|
preload_full.src = "./images/icons/video_rating_full.gif";
|
|
preload_partial = new Image();
|
|
preload_partial.src = "./images/icons/video_rating_part.gif";
|
|
preload_empty = new Image();
|
|
preload_empty.src = "./images/icons/video_rating_none.gif";
|
|
|
|
function rating_over(rating) {
|
|
for(var x=1; x<=5; x++) {
|
|
if(x <= rating) {
|
|
$('rate_'+x).src = preload_full.src;
|
|
} else {
|
|
$('rate_'+x).src = preload_empty.src;
|
|
}
|
|
}
|
|
}
|
|
|
|
function rating_out() {
|
|
for(var x=1; x<=5; x++) {
|
|
if(x <= {/literal}{$video_info.video_rating_full}{literal}) {
|
|
$('rate_'+x).src = preload_full.src;
|
|
} else if({/literal}{$video_info.video_rating_part}{literal} != 0 && x == {/literal}{math equation='x+1' x=$video_info.video_rating_full}{literal}) {
|
|
$('rate_'+x).src = preload_partial.src;
|
|
} else {
|
|
$('rate_'+x).src = preload_empty.src;
|
|
}
|
|
}
|
|
}
|
|
|
|
function rate(rating) {
|
|
$('video_rating').onmouseout = null;
|
|
var request = new Request.JSON({
|
|
'url' : 'video.php',
|
|
'method' : 'post',
|
|
'secure' : false,
|
|
'data' : {
|
|
'task' : 'rate_do',
|
|
'user' : '{/literal}{$owner->user_info.user_username}{literal}',
|
|
'video_id' : '{/literal}{$video_info.video_id}{literal}',
|
|
'rating' : rating
|
|
},
|
|
'onComplete' : function(responseObject, responseText)
|
|
{
|
|
rating_result(responseObject);
|
|
}
|
|
});
|
|
request.send();
|
|
}
|
|
|
|
function rating_result(rating) {
|
|
$('rating_total').innerHTML = rating.rating_total;
|
|
for(var x=1; x<=5; x++) {
|
|
if(x <= rating.rating_full) {
|
|
$('rate_'+x).src = preload_full.src;
|
|
if(!rating.allowed_to_rate) { $('rate_'+x).onmouseover = null; $('rate_'+x).onclick = null; }
|
|
} else if(rating.rating_part != 0 && x == rating.rating_full+1) {
|
|
$('rate_'+x).src = preload_partial.src;
|
|
if(!rating.allowed_to_rate) { $('rate_'+x).onmouseover = null; $('rate_'+x).onclick = null; }
|
|
} else {
|
|
$('rate_'+x).src = preload_empty.src;
|
|
if(!rating.allowed_to_rate) { $('rate_'+x).onmouseover = null; $('rate_'+x).onclick = null; }
|
|
}
|
|
}
|
|
if(!rating.allowed_to_rate) { $('video_rating').onmouseout = null; }
|
|
}
|
|
|
|
//-->
|
|
</script>
|
|
{/literal}
|
|
|
|
{/if}
|
|
|
|
{* SHOW STATS *}
|
|
<div style='float: left; padding-left: 15px; padding-top: 5px;'>
|
|
{assign var="uploaddate" value=$datetime->time_since($video_info.video_datecreated)}
|
|
{capture assign="uploaded"}{$uploaddate[1]}
|
|
{if $uploaddate[0]==773}second{if $uploaddate[1]!=1}s{/if} ago
|
|
{elseif $uploaddate[0]==774}minutes{if $uploaddate[1]!=1}s{/if} ago
|
|
{elseif $uploaddate[0]==775}hour{if $uploaddate[1]!=1}s{/if} ago
|
|
{elseif $uploaddate[0]==776}day{if $uploaddate[1]!=1}s{/if} ago
|
|
{elseif $uploaddate[0]==777}week{if $uploaddate[1]!=1}s{/if} ago
|
|
{elseif $uploaddate[0]==778}month{if $uploaddate[1]!=1}s{/if} ago
|
|
{elseif $uploaddate[0]==779}year{if $uploaddate[1]!=1}s{/if} ago
|
|
{/if}
|
|
{/capture}
|
|
{lang_sprintf id=5500024 1=$uploaded}
|
|
</div>
|
|
<div style='float: left; padding-left: 15px; padding-top: 5px;'>{lang_sprintf id=5500037 1=$video_info.video_rating_total}</div>
|
|
<div style='float: left; padding-left: 15px; padding-top: 5px;'>{lang_sprintf id=5500038 1=$video_info.video_views}</div>
|
|
<div style='float: left; padding-left: 15px; padding-top: 5px;'><a href="javascript:TB_show('{lang_print id=5500147}', 'user_report.php?return_url={$url->url_current()|escape:url}&TB_iframe=true&height=300&width=450', '', './images/trans.gif');">{lang_print id=5500147}</a></div>
|
|
<div style='clear: both; height: 0px;'></div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<br>
|
|
|
|
{* COMMENTS *}
|
|
|
|
{if $allowed_to_comment}
|
|
<div id="profile_{$video_info.video_id}_postcomment"><div class="comment_headline">Comments (<span class="tc" id="totalcomments">{$total_comments|default:0}</span>)</div>
|
|
|
|
<form action="misc_js.php" method="post" target="ajaxframe" onsubmit="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" value="comment_post"><input type="hidden" name="type" value="video"><input type="hidden" name="iden" value="video_id"><input type="hidden" name="value" value="{$video_info.video_id}"><input type="hidden" name="user" value="{$owner->user_info.user_username}"><input type="hidden" name="tab" value="videos"><input type="hidden" name="col" value="video"></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}
|
|
|
|
|
|
|
|
{* RIGHT COLUMN - USER'S OTHER VIDEOS *}
|
|
</td>
|
|
<td valign='top' align='left' width='100%'>
|
|
|
|
<div id='videoTabFrame'>
|
|
|
|
<div class='header'>{lang_sprintf id=5500022 1=$owner->user_displayname_short} ({$total_videos})</div>
|
|
<div class='video_box' style='margin-bottom: 10px; padding-bottom: 10px; height: 395px; overflow: auto;'>
|
|
|
|
{* LOOP THROUGH USER VIDEOS *}
|
|
{section name=video_loop loop=$videos}
|
|
|
|
{* ENSURE VIDEO TITLE ISN'T BLANK *}
|
|
{if $videos[video_loop].video_title == ""}{capture assign="video_title"}{lang_print id=589}{/capture}{else}{assign var="video_title" value=$videos[video_loop].video_title}{/if}
|
|
|
|
<div class='video_row' style='{if $smarty.section.video_loop.first}padding-top: 0px; border-top: none;{/if}'>
|
|
<table cellpadding='0' cellspacing='0'>
|
|
<tr>
|
|
<td style='vertical-align: top;' width='1'>
|
|
<div class='video_row_nowplaying{if $videos[video_loop].video_id == $video_info.video_id}2{/if}'{if $videos[video_loop].video_id != $video_info.video_id}onMouseOver="this.className='video_row_nowplaying2'" onMouseOut="this.className='video_row_nowplaying'"{/if}><a href='{$url->url_create("video", $owner->user_info.user_username, $videos[video_loop].video_id)}'><img src='{if $videos[video_loop].video_thumb}{$videos[video_loop].video_dir}{$videos[video_loop].video_id}_thumb.jpg{else}./images/video_placeholder.gif{/if}' border='0' width='{$setting.setting_video_thumb_width}' height='{$setting.setting_video_thumb_height}'></a></div>
|
|
</td>
|
|
<td style='vertical-align: top; padding-left: 7px;'>
|
|
<div class='video_row_title'><a href='{$url->url_create("video", $owner->user_info.user_username, $videos[video_loop].video_id)}'>{$video_title|truncate:45:'...':true}</a></div>
|
|
<div class='video_row_info'>
|
|
{if $videos[video_loop].video_type==0}{$videos[video_loop].video_duration_in_min} - {/if}
|
|
|
|
{$videos[video_loop].total_comments} comment{if $videos[video_loop].total_comments!=1}s{/if}
|
|
- {$videos[video_loop].video_views} view{if $videos[video_loop].video_views!=1}s{/if}</div>
|
|
<div>
|
|
{section name=full_loop start=0 loop=$videos[video_loop].video_rating_full}
|
|
<img src='./images/icons/video_rating_full_small.gif' border='0'>
|
|
{/section}
|
|
{if $videos[video_loop].video_rating_part}<img src='./images/icons/video_rating_part_small.gif' border='0'>{/if}
|
|
{section name=none_loop start=0 loop=$videos[video_loop].video_rating_none}
|
|
<img src='./images/icons/video_rating_none_small.gif' border='0'>
|
|
{/section}
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
{/section}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
|
|
|
|
{/if}
|
|
{literal}
|
|
<script type="text/javascript" src="/js/jquery.autogrow-textarea.js"></script>
|
|
<script>
|
|
function subtractcount(){
|
|
total=document.getElementById('totalcomments').innerHTML;
|
|
total=total*1;
|
|
document.getElementById('totalcomments').innerHTML=total-1;}
|
|
function updatecount()
|
|
{
|
|
if(document.getElementById('comment_body').value!=""){
|
|
total=document.getElementById('totalcomments').innerHTML;
|
|
total=total*1;
|
|
document.getElementById('totalcomments').innerHTML=total+1;
|
|
}
|
|
}
|
|
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=video&focus=video_id&video_id={$video_info.video_id}{literal}",true);
|
|
|
|
|
|
xmlhttp.send();
|
|
|
|
}
|
|
|
|
|
|
|
|
</script>
|
|
<script type="text/javascript">
|
|
var video_id = 0;
|
|
|
|
jQuery('#ajaxframe').load(function(){
|
|
loadXMLDoc(1);
|
|
|
|
document.getElementById('comment_body').value="";
|
|
});
|
|
|
|
|
|
function lepconfirmprofDelete(id) {
|
|
|
|
video_id = id;
|
|
document.getElementById('del_comment_id1').value=id;
|
|
|
|
TB_show('Delete Comment', '#TB_inline?height=150&width=300&inlineId=confirmdelete1', '', '../images/trans.gif');
|
|
|
|
document.getElementById('del_comment_id1').value=id;
|
|
|
|
}
|
|
function lepremovecomment()
|
|
{
|
|
id=document.getElementById('del_comment_id1').value;
|
|
document.getElementById('comment_'+id).style.display='none';
|
|
}
|
|
|
|
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, '>');
|
|
|
|
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='video'>";
|
|
innerHTML += "<input type='hidden' name='iden' value='video_id'>";
|
|
innerHTML += "<input type='hidden' name='value' value='{/literal}{$video_info.video_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();
|
|
|
|
|
|
|
|
}
|
|
|
|
function doCommentEdit(commentid)
|
|
{
|
|
//var event = new Event(e);
|
|
|
|
document.getElementById("editCommentForm").submit();
|
|
|
|
commentElement = $('profile_comment_body_' + commentid);
|
|
commentElement.innerHTML=document.getElementById("comment_edit_" + commentid).value;
|
|
|
|
|
|
// stop form submission
|
|
//event.stop();
|
|
}
|
|
|
|
|
|
</script>
|
|
{/literal}
|
|
{include file='footer.tpl'} |