Files
Testing/leptesting/imobile_video.tpl

321 lines
13 KiB
Smarty
Raw Permalink Normal View History

2026-11-17 16:15:01 -05:00
{include file='imobile_header.tpl'}
<div id="contentlist">
{* $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'>
</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'>
<div class='inner' style='cursor:default'>
<h1>{$video_info.video_title}</h1>
<h2 id='short_desc'>{$video_info.video_desc|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}
<video width="320" height="240" controls poster="{/literal}{$video_info.video_dir|replace:'./':''}{$video_id}_thumb.jpg{literal}">
<source src="{/literal}{$video_info.video_dir|replace:'./':''}{$video_id}{literal}.flv" type="video/flv">
<source src="{/literal}{$video_info.video_dir|replace:'./':''}{$video_id}{literal}.mp4" type="video/mp4">
</video>
{/literal}
{/if}
{* DISPLAY FLASH PLAYER *}
<div id='sevideo_player' style="margin-left:auto; margin-right:auto;"></div>
</div>
{* SHOW VIDEO DETAILS *}
<div class='videoInfo'>
<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}
<div class="clear"></div>
<br />
{* SHOW STATS *}
<div style='float: left; 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 class="clear"></div>
<div class="center"><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 *}
{* COMMENTS *}
<script type="text/javascript">
commentcount={$commentcount};
{literal}
function showHint()
{
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()
{//alert(xmlhttp.readyState); alert(xmlhttp.status);
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById('hotflash').innerHTML=xmlhttp.responseText+document.getElementById('hotflash').innerHTML;
document.getElementById('body').value="";
commentcount++;
document.getElementById('video_totalcomments').innerHTML=commentcount;
return false;
//document.getElementById("txtHint").innerHTML=xmlhttp.responseText;
}
}
var url = "secommentspost.php";
{/literal}
var params = "postid={$video_info.videocomment_id}&object=se_videocomments&object_id={$video_info.video_id}&comment="+document.getElementById('body').value+"&user={$user->user_info.user_id}";
{literal}
xmlhttp.open("POST", url, true);
xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlhttp.setRequestHeader("Content-length", params.length);
xmlhttp.setRequestHeader("Connection", "close");
//xmlhttp.open("GET","/sendweb.php?email="+document.getElementById('web-email').value+"&url="+document.getElementById('web-your-website').value+"&website="+document.getElementById('website').checked+"&addons="+document.getElementById('add-ons').checked+"&toolbars="+document.getElementById('toolbar').checked+"&other="+document.getElementById('other').checked+"&learnMore="+document.getElementById('learnMore').checked+"",true);
xmlhttp.send(params);
return false;
}
{/literal}
</script>
<div id="video_2773_postcomment" style=""><div class="comment_headline">Comments (<span class="tc" id="video_totalcomments">{$commentcount}</span>)</div>
<form id="addCommentForm" method="post" action="" onsubmit="showHint(); return false;">
<div class="profile_postcomment"><textarea name="body" id="body" cols="25" class="comment_area" style="overflow: hidden; height: 70px; "></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"></div>
</div>
</form>
</div>
<div id="groupvideo_{$video_info.video_id}_comments" style='margin-left: auto; margin-right: auto;'>
<div id="hotflash"></div>
{php}grabcomments();{/php}
</div>
{* RIGHT COLUMN - USER'S OTHER VIDEOS *}
</td>
</tr></table>
<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>
{/if}</div>
{include file='imobile_footer.tpl'}