here it is...
viewvid.tpl
{include file="header.tpl"}
<div id="shadow"></div>
{section name=video loop=$video}
<div class="clearer"> </div>
<div id="videowrapper" class="roundedcorner">
<div class="clearer"> </div>
<div id="vheader" class="roundedcorner">
<div class="clearer"> </div>
<div id="name">
<h8>{$video[video].name}</h8>
</div>
<div id="voptions">
<h2><a class="lightSwitcher" href="#"> </a> <a href="addfavorite.php?g={$video[video].id}&u={$user}"><img src="templates/default/images/favorites.png" border="0" title="{$LAN_109}" alt="" /></a></h2>
</div>
</div>
<div class="clearer"> </div>
<div id="video" class="roundedcorner">
<div> </div>
<div style="text-align: center;">
{include file="players.tpl"}
</div>
<br />
{include file="bookmarks.tpl"}
<br />
{include file="comment.tpl"}
</div>
<div id="info" class="roundedcorner">
<div id="userinfo">
<img class="userlogo" alt="" src="templates/default/images/userlogo.png" />
<b>{$LAN_36}:</b> {$video[video].creator}
<br />
<b>{$LAN_32}: </b>{$video[video].views}
<br />
<br />
<br />
<br />
<strong>{$LAN_35|default:"Description"}:</strong>
<br />
<div id="description">
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap !important; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">
{$video[video].description}
</pre>
</div>
</div>
<div id="rating">
<h2>{$LAN_92|default:"Rate This Video"}</h2>
<hr />
<br />
<img src="templates/default/images/star-default.png" alt="" width="20" height="20" hspace="0" align="left" class="userlogo" />
<img src="templates/default/images/star-default.png" alt="" width="20" height="20" hspace="0" align="left" class="userlogo" />
<img src="templates/default/images/star-default.png" alt="" width="20" height="20" align="left" class="userlogo" />
<img src="templates/default/images/star-default.png" alt="" width="20" height="20" align="left" class="userlogo" />
<img src="templates/default/images/star-default.png" alt="" width="20" height="20" align="left" class="userlogo" />
{rating_bar units='5' id=$video[video].id} </div>
<div id="link">
<hr />
</div>
{/section}
</div>
<div class="clearer"> </div>
</div>
{include file="footer.tpl"}
videos.php
<?php
/*
+ ----------------------------------------------------------------------------+
| PHPDirector.
| $License: GNU General Public License
| $Website: phpdirector.co.uk
|
| THIS FILE IS AN UPDATED VIDEOS.PHP FILE.
+----------------------------------------------------------------------------+
*/
$idc = $_GET["id"];
if(isset($idc) && is_numeric($idc)){
if(!isset($_COOKIE[$idc])){
$twomonths = 60 * 60 * 24 * 60 + time();
setcookie("$idc", $idc, $twomonths);
$viewaddone = true;
}
}
require('header.php');
if(isset($_COOKIE["id"]))
{
$res = mysql_query("select Views from pp_user WHERE id = '$_COOKIE[id]'") or die(mysql_error());
$row_plays = mysql_fetch_assoc($res);
$new_plays = $row_plays["Views"] + 1;
mysql_query("UPDATE pp_user SET Views = $new_plays WHERE id = '$_COOKIE[id]'");
mysql_free_result($res);
}
$ip=$_SERVER['REMOTE_ADDR'];
if(isset($_POST['go']) && !empty($_POST['comment']) && !empty($_POST['nom']))
{
mysql_query("INSERT INTO pp_comment (file_id, nom, comment,ip) VALUES ('$_POST[id]', '$_POST[nom]','".addslashes($_POST['comment'])."','$ip')");
$smarty->assign('message', 'Your comment has been added. Thanks');
}
if(isset($_GET['id']))
{
$query_co = "SELECT * FROM pp_comment,pp_user WHERE pp_comment.nom = pp_user.user AND pp_comment.file_id=$_GET[id] ORDER BY pp_comment.id DESC";
$result_co = mysql_query($query_co) or die (mysql_error());
while ($row_co = mysql_fetch_array($result_co)){
$videos_co[] = $row_co;
}
$smarty->assign('videos_co', $videos_co);
}
if(isset($idc) && is_numeric($idc)){
$id = mysql_real_escape_string($idc);
$result = mysql_query("SELECT * FROM pp_files WHERE id=$id AND `approved` = '1' LIMIT 1") or die(mysql_error());
}else{
$result = mysql_query("select * from pp_files WHERE approved='1' AND reject='0' order by rand() LIMIT 1") or die(mysql_error());
}
// For each result that we got from the Database
while ($row = mysql_fetch_assoc($result))
{
$video[] = $row;
if($viewaddone == true){
$new_views = $row["views"] + 1;
mysql_query("UPDATE pp_files SET views = '$new_views' WHERE id = '$id'");
}
$smarty->assign('vidtype', $row['video_type']);
if( $row['video_type'] == "dailymotion"){
$dm_xml_pic_string = @file_get_contents("http://www.dailymotion.com/atom/fr/cluster/extreme/featured/video/".$row['file']);
$dm_xml_pic_start = explode("/swf/",$dm_xml_pic_string,2);
$dm_xml_pic_end = explode("\"",$dm_xml_pic_start[1],2);
$dmid = $dm_xml_pic_end[0];
$smarty->assign('dmid', $dmid);
}
}
// Assign this array to smarty
$smarty->assign('video', $video);
$smarty->assign('id', $row['id']);
if(isset($_GET["pop"])){
$smarty->display('viewvidpop.tpl');
}else{
$smarty->display('viewvid.tpl');
}
mysql_close($mysql_link);
?>