Author Topic: Help needed modifying website  (Read 1791 times)

0 Members and 1 Guest are viewing this topic.

Offline MrMac

  • Newbie
  • *
  • Posts: 7
  • Karma: 0
    • View Profile
  • Script Version: 0.3
Help needed modifying website
« on: April 06, 2010, 11:33:33 AM »
Hello all I am new to PHPDirector and I have just installed it on my own server (http://www.lewmac.co.uk/tube)

What I would like to know is if I can do the following and how?  I hope this is in the right section.

1.  Able to add a upload link as seen on (http://www.myfunnypets.com/30/upload.php).

2.  Only allow registered members to submit or upload video's

3. Change the colour like on FireDarts Demo (http://firedartonline.com/projects/phpdirector/)

4. Take the light bulb off, its not needed.

5. Change the navigation links on the admin side

6. Have different level of admin i.e. (Master Admin, Admin, Moderators, Member, Guests etc ....)


Also when will Version 1.0 be released?  It looks promising.

Any help would be appriciated, I am looking forward to modifying my site.

Thank You.

Lewis.

Offline FireDart

  • Project Leader
  • Pro Member
  • *****
  • Posts: 406
  • Karma: 4
    • View Profile
    • FireDart
Re: Help needed modifying website
« Reply #1 on: April 06, 2010, 02:11:32 PM »
1. You mean only upload a link?

2. In Submit.php change code with:
Code: [Select]
<?php
/*
+ ----------------------------------------------------------------------------+
|     PHPDirector.
| $License: GNU General Public License
| $Website: phpdirector.co.uk
+----------------------------------------------------------------------------+
*/
require('header.php');  
include 
'db.php';
if(!isset(
$_COOKIE["id"]))
{
     
header("Location: index.php");
}
else
{
$part $_GET["part"];  //Gets which part it is on
if ($part == null){
$part "1";  //If part isnt set goto part 1
}

if (
$part == "1"){
//Display Images page
$smarty->display('submit.tpl');




//PART 2
}elseif ($part == "2"){

//Source
$videourl $_POST['videourl'];
$smarty->assign('id'$videourl);


if ($videourl == null){
$smarty->assign('error''Please Do Not Submit Blank Links');
$smarty->display('error.tpl');
exit;
}

$check explode("."$videourl);

$source $check[1];

$source2 between('http://''.'$videourl);

if ($source2 !== "http://video."){ //google
if ($source2 !== "http://www."){
$smarty->assign('error''Invalid Link, Try http://<b>www</b>...');
$smarty->display('error.tpl');
exit;
}
}
if ($source == "youtube"){ //youtube
include("processes/process_youtube.inc.php");

}elseif ($source == "google"){ //google
include("processes/process_google.inc.php");

}elseif ($source == "dailymotion"){ //dailymotion
include("processes/process_dailymotion.inc.php");

}else{
$error $smarty->get_template_vars('LAN_22');
$smarty->assign_by_ref('error'$error);
$smarty->display('error.tpl');
exit;
}

$smarty->assign('source'$source);
//Source End


//ALLREADY EXIST?
if ($videoid !==  null){
$fileresult mysql_query("SELECT file FROM pp_files WHERE file='$videoid' LIMIT 0 , 1")or die(mysql_error());
$rowfile mysql_fetch_array($fileresult);
if ($rowfile['file'] == $videoid){
$smarty->assign('error''This Video Has Allready Been Submitted');
$smarty->display('error.tpl');
exit;
}
}

//Categories
$catresult mysql_query("SELECT * FROM pp_categories WHERE disable='0'") or die("Error: " mysql_error());
//Gets Categories
while ($catrow2 =  mysql_fetch_array($catresult)){
$result11[] = $catrow2;
}
//pass the results to the template
$smarty->assign('cat'$result11);

//Display Images page
$smarty->display('submit2.tpl');
}elseif (
$part == "3"){
$insertthumb $_POST["picture"];
$inserttitle $_POST["titletext"];
$insertauthor $_POST["authortext"];
$insertdes safe_sql_insert($_POST["descriptiontext"]);
$insetycat $_POST["category"];
$videoid $_POST["videoid"];
$source $_POST["vidtype"];
$file2 $_POST["file2"];

$fileresult mysql_query("SELECT file FROM pp_files WHERE file='$videoid' LIMIT 0 , 1")or die(mysql_error());
$rowfile mysql_fetch_array($fileresult);
if ($rowfile['file'] == $videoid){
$smarty->assign('error''This Video Has Allready Been Submitted');
$smarty->display('error.tpl');
exit;
}
mysql_query("INSERT INTO pp_files (name, video_type, creator, description, date, file, file2, approved, ip, picture, category) VALUES ('$inserttitle', '$source' , '$insertauthor', '$insertdes', CURDATE(), '$videoid', '$file2', '0', '$ip', '$insertthumb', '$insetycat')") or die(mysql_error());

$error $smarty->get_template_vars('LAN_24');
$smarty->assign_by_ref('error'$error);
$smarty->display('error.tpl');
exit;
}
}
?>


Upload feature should be available in V. 1.0(I think)

3. This is a custom theme I made for V. 1.0. Since we our remaking it it is now outdated. You can change how the site looks by editing the templates/default/ & templates/default/css/ files. Only do this if you know how to edit XHTML(HTML) and CSS.

4. Replace templates/default/header.tpl with:
Code: [Select]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<!--Page Title-->
<title>{$config_name|default:"PHP Director"}{section name=video loop=$video} - {$video[video].name max=1}{/section}{$cat_name|capitalize}</title>

<!--Meta Tags-->
<meta http-equiv="content-type" content="text/html;charset=iso-8859-2" />
<meta name="author" content="FireDart"/>
<meta name="theme" content="Default"/>
<meta name="description" content="{$config_metadescription}" />
<meta name="keywords" content="{$config_metakeywords}" />

<!--Favicon Icon-->
<link href="{$config_favicon|default:"templates/default/images/x-icon.ico"}" rel="shortcut icon" />

<!--CSS Fies-->
<!--Main CSS-->
<link rel="stylesheet" href="templates/default/css/style.css" type="text/css" />
<link rel="stylesheet" href="templates/default/css/c-css.php" type="text/css" />

<!--Turn off Lights CSS-->
<link href="turn_off_lights/style.css" rel="stylesheet" type="text/css" />

<!--Javascript Files-->

<!--Curvy Corners-->
<script type="text/javascript" src="templates/default/js/curvycorners.js"></script>

<!--Default JS-->
<script type="text/javascript" src="js/behavior.js"></script>
<script type="text/javascript" src="js/rating.js"></script>
<script type="text/javascript" src="js/reflection.js"></script>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/thickbox.js"></script>
<script type="text/javascript" src="js/show_hide.js"></script>
</head>
<body>
<!--Header Wrapper Start-->
<div id="headerwrapper">
<!--Header Start-->
<div id="header">
<!--Logo Start-->
<div id="logo">
<h1>
<a href="index.php" title="{$LAN_41|default:"Home"}">
<img src="{$config_logo|default:"templates/default/images/logo.png"}" alt="{$config_name|default:"PHPDirector"}" />
</a>
</h1>
</div>
<!--Logo End-->
<!--User Bar Start-->
<div id="userbar">
<div class="userbarcontent broundedcorner">
{include file="memberbar.tpl"}
</div>
</div>
<!--User Bar End-->
<!--Slogan Start-->
<div id="slogan">
"{$config_slogan|default:"A Community Driven Project"}"
</div>
<!--Slogan End-->
</div>
<!--Header End-->

<div class="clearer"> </div>

<!--Navigation Start-->
<div id="navigation">
<!--Navigation Start End-->
<div id="inner">
<!--Navigation UL Start-->
<ul>
<li><a {if $pagetype eq "home"}class="current"{/if} href='index.php' accesskey='h'><span class='key'>{$LAN_41|default:"Home"}</span></a></li>
<li><a {if $pagetype eq "feature"}class="current"{/if} href='index.php?pt=feature' accesskey='f'><span class='key'>{$LAN_2|default:"Featured"}</span></a></li>
<li><a {if $pagetype eq "all"}class="current"{/if} href='index.php?pt=all' accesskey='a'><span class='key'>{$LAN_3|default:"All"}</span></a></li>
<li><a {if $pagetype eq "categories"}class="current"{/if} href='categories.php?pt=categories' accesskey='c'><span class='key'>{$LAN_40|default:"Categories"}</span></a></li>
<li><a {if $pagetype eq "images"}class="current"{/if} href='images.php?pt=images' accesskey='i'><span class='key'>{$LAN_4|default:"Images"}</span></a></li>
<li><a {if $pagetype eq "videos"}class="current"{/if} href='videos.php?pt=videos' accesskey='r'><span class='key'>{$LAN_39|default:"Videos"}</span></a></li>
<li><a {if $pagetype eq "submit"}class="current"{/if} href='submit.php?pt=submit&amp;part=1' accesskey='s'><span class='key'>{$LAN_5|default:"Submit"}</span></a></li>
</ul>
<!--Navigation UL End-->
<!--Search Start-->
<div id="search">
<form method="post" action="index.php" name="search1">
<input type="text" name="searching" />
<input type="submit" value="{$LAN_71}" />
</form>
</div>
<!--Search End-->
</div>
<!--Navigation Inner End-->
</div>
<!--Navigation End-->
</div>
<!--Header Wrapper End-->

<div class="clearer"> </div>

<!--Body Wrapper Start-->
<div id="bodywrapper">
<!--Body Start-->
<div class="clearer"> </div>
<div id="body">
<div class="clearer"> </div>


templates/default/viewvid.tpl:
Code: [Select]
{include file="header.tpl"}
{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">
<h2>{$video[video].name}</h2>
</div>
<div id="voptions">
<h2><a href="addfavorite.php?g={$video[video].id}&amp;u={$user}"><img src="templates/default/images/favorites.png" border="0" title="{$LAN_109}" alt="" /></a></h2>
</div>
&nbsp;
</div>
<div class="clearer"> </div>
<div id="video" class="roundedcorner">
<div>&nbsp;</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">
<h1>{$LAN_92|default:"Rate This Video"}</h1>
<hr />
<br />
{rating_bar units='5' id=$video[video].id}
</div>
<div id="link">
<h1>{$LAN_93|default:"Share This Video"}</h1>
<hr />
{include file="videolink.tpl"}
</div>
{/section}
</div>
<div class="clearer"> </div>
</div>
{include file="footer.tpl"}


5. You can edit the templates/default/admin/header.tpl to change the navigation links. Look for:
Code: [Select]
<!--Navigation Start-->
<div id="navigation">
<!--Navigation Start End-->
<div id="inner">
<!--Navigation UL Start-->
<ul id="topnav">
<li {if $pag eq "Home"}class='selected'{/if}><a href="../index.php" target="_blank">{$LAN_41}</a></li>
<li {if $pag eq "Admin home"}class='selected'{/if}><a href="index.php">Admin Panel</a></li>
<li {if $pag eq "vid"}class='selected'{/if}> <a href="admin_manage.php?pt=all&amp;pag=vid">{$LAN_68}s</a></li>
<li {if $pagetype eq "comment"}class='selected'{/if}><a href="comment.php?pt=comment">{$LAN_65} {$LAN_120}</a></li>
<li {if $pag eq "options"}class='selected'{/if}><a href="options.php?pt=options&amp;pag=options">{$LAN_48}</a></li>
<li><a href="logout.php">{$LAN_42}</a></li>
</ul>
<ul id="submenu" class="broundedcorner" style="z-index: 100; border: border: 3px solid #333; background: #222; margin-top: 33px; padding: 3px; filter:alpha(Opacity=80); opacity:0.8; -moz-opacity:0.8; -khtml-opacity:0.8;">
{if $pag eq "vid"}
<li {if $pagetype eq "all"}class='selected'{/if}><a href="admin_manage.php?pt=all&amp;pag=vid">{$LAN_43}</a></li>
<li {if $pagetype eq "feature"}class='selected'{/if}><a href="admin_manage.php?pt=feature&amp;pag=vid&amp;next=1">{$LAN_45}</a></li>
<li {if $pagetype eq "approve"}class='selected'{/if}><a href="admin_manage.php?pt=approve&amp;pag=vid&amp;next=1">{$LAN_44}</a></li>
<li {if $pagetype eq "rejected"}class='selected'{/if}><a href="admin_manage.php?pt=rejected&amp;pag=vid&amp;next=1">{$LAN_46}</a></li>
<li {if $pagetype eq "easyapprove"}class='selected'{/if}><a href="admin_videos.php?pt=easyapprove&amp;pag=vid">{$LAN_47}</a></li>
{/if}
{if $pag eq "options"}
<li {if $pagetype eq "options"}class='selected'{/if}><a href="options.php?pt=options&amp;pag=options">{$LAN_48}</a></li>
<li {if $pagetype eq "categories"}class='selected'{/if}><a href="categories.php?pt=categories&amp;pag=options">{$LAN_40}</a></li>
{/if}
<li></li>
</ul>
<!--Navigation UL End-->
</div>
<!--Navigation Inner End-->
</div>
<!--Navigation End-->

6. Should be available in Version 1.0




Version 1.0 release date is unknown, we hope for 2 ~ 3 months.
« Last Edit: April 06, 2010, 02:13:29 PM by FireDart »

Offline MrMac

  • Newbie
  • *
  • Posts: 7
  • Karma: 0
    • View Profile
  • Script Version: 0.3
Re: Help needed modifying website
« Reply #2 on: April 06, 2010, 03:04:51 PM »
Thanks FireDart.  I will go over the posts and have a play about.

Also I forgot to ask, is it possible to only have registered members to view/watch certain videos.  So the general public cannot view them?

Also for Question 1:  I would like a uploader so people can upload videos from their computers rather than just use YouTube Videos.

Thanks.

Lewis.
« Last Edit: April 06, 2010, 03:06:32 PM by MrMac »

Offline FireDart

  • Project Leader
  • Pro Member
  • *****
  • Posts: 406
  • Karma: 4
    • View Profile
    • FireDart
Re: Help needed modifying website
« Reply #3 on: April 06, 2010, 05:58:53 PM »
Uploading is coming to Version 1.0,

To let only registered users see videos replace videos.php with:
Code: [Select]
<?php
/*
+ ----------------------------------------------------------------------------+
|     PHPDirector.
| $License: GNU General Public License
| $Website: phpdirector.co.uk
|
| THIS FILE IS AN UPDATED VIDEOS.PHP FILE.
+----------------------------------------------------------------------------+
*/
require('header.php');  
include 
'db.php';
if(!isset(
$_COOKIE["id"])) {
     
header("Location: index.php");
} else {
$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);
}
?>


Offline MrMac

  • Newbie
  • *
  • Posts: 7
  • Karma: 0
    • View Profile
  • Script Version: 0.3
Re: Help needed modifying website
« Reply #4 on: April 07, 2010, 08:07:29 AM »

To let only registered users see videos replace videos.php with:
Code: [Select]
<?php
/*
+ ----------------------------------------------------------------------------+
|     PHPDirector.
| $License: GNU General Public License
| $Website: phpdirector.co.uk
|
| THIS FILE IS AN UPDATED VIDEOS.PHP FILE.
+----------------------------------------------------------------------------+
*/
require('header.php');  
include 
'db.php';
if(!isset(
$_COOKIE["id"])) {
     
header("Location: index.php");
} else {
$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);
}
?>


I put this in my videos.php and when you try to watch the videos unregistred it works, however when you login and try to watch a video I get this:

Fatal error: Cannot redeclare class Smarty in /home/lewmac/public_html/tube/libs/Smarty.class.php  on line 65

What do I need to do to get rid of that?

Also is there no way the uploader will not work on version 0.3? It would come in handy if it does?

Plus how do I get it so that the member login is not on the header but on the right hand column?

I have also noticed on the admin panel you cannot see any members registered? How can you create a members table? So you can view members of the site?

Thanks.

Lewis.
« Last Edit: April 07, 2010, 11:28:24 AM by MrMac »

Offline FireDart

  • Project Leader
  • Pro Member
  • *****
  • Posts: 406
  • Karma: 4
    • View Profile
    • FireDart
Re: Help needed modifying website
« Reply #5 on: April 07, 2010, 02:55:38 PM »
Try this, not sure if it will work:
Code: [Select]
<?php
/*
+ ----------------------------------------------------------------------------+
|     PHPDirector.
| $License: GNU General Public License
| $Website: phpdirector.co.uk
|
| THIS FILE IS AN UPDATED VIDEOS.PHP FILE.
+----------------------------------------------------------------------------+
*/
require('header.php');  
include 
'db.php';
if(!isset(
$_COOKIE["id"])) {
     
header("Location: index.php");
} else {
$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('id'$row['id']);


if(isset($_GET["pop"])){
$smarty->display('viewvidpop.tpl');
}else{
$smarty->display('viewvid.tpl');
}

mysql_close($mysql_link);
}
?>



Quote
Also is there no way the uploader will not work on version 0.3? It would come in handy if it does?
-- Not at the moment

Quote
Plus how do I get it so that the member login is not on the header but on the right hand column?
-- You would only be able to view the login info on the index pages(home, featured, all). But replace templates/default/header.tpl:
Code: [Select]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
   <!--Page Title-->
   <title>{$config_name|default:"PHP Director"}{section name=video loop=$video} - {$video[video].name max=1}{/section}{$cat_name|capitalize}</title>
   
   <!--Meta Tags-->
   <meta http-equiv="content-type" content="text/html;charset=iso-8859-2" />
   <meta name="author" content="FireDart"/>
   <meta name="theme" content="Default"/>
   <meta name="description" content="{$config_metadescription}" />
   <meta name="keywords" content="{$config_metakeywords}" />

   <!--Favicon Icon-->
   <link href="{$config_favicon|default:"templates/default/images/x-icon.ico"}" rel="shortcut icon" />
   
   <!--CSS Fies-->
   <!--Main CSS-->
   <link rel="stylesheet" href="templates/default/css/style.css" type="text/css" />
   <link rel="stylesheet" href="templates/default/css/c-css.php" type="text/css" />
   
   <!--Turn off Lights CSS-->
   <link href="turn_off_lights/style.css" rel="stylesheet" type="text/css" />
   
   <!--Javascript Files-->
   
   <!--Curvy Corners-->
   <script type="text/javascript" src="templates/default/js/curvycorners.js"></script>
   
   <!--Default JS-->
   <script type="text/javascript" src="js/behavior.js"></script>
   <script type="text/javascript" src="js/rating.js"></script>
   <script type="text/javascript" src="js/reflection.js"></script>
   <script type="text/javascript" src="js/jquery.js"></script>
   <script type="text/javascript" src="js/thickbox.js"></script>
   <script type="text/javascript" src="js/show_hide.js"></script>
</head>
<body>
<!--Header Wrapper Start-->
<div id="headerwrapper">
   <!--Header Start-->
   <div id="header">
      <!--Logo Start-->
      <div id="logo">
         <h1>
            <a href="index.php" title="{$LAN_41|default:"Home"}">
               <img src="{$config_logo|default:"templates/default/images/logo.png"}" alt="{$config_name|default:"PHPDirector"}" />
            </a>
         </h1>
      </div>
      <!--Logo End-->
      <!--Slogan Start-->
      <div id="slogan">
         "{$config_slogan|default:"A Community Driven Project"}"
      </div>
      <!--Slogan End-->
   </div>
   <!--Header End-->
   
   <div class="clearer"> </div>
   
   <!--Navigation Start-->
   <div id="navigation">
      <!--Navigation Start End-->
      <div id="inner">
         <!--Navigation UL Start-->
         <ul>
            <li><a {if $pagetype eq "home"}class="current"{/if} href='index.php' accesskey='h'><span class='key'>{$LAN_41|default:"Home"}</span></a></li>
            <li><a {if $pagetype eq "feature"}class="current"{/if} href='index.php?pt=feature' accesskey='f'><span class='key'>{$LAN_2|default:"Featured"}</span></a></li>
            <li><a {if $pagetype eq "all"}class="current"{/if} href='index.php?pt=all' accesskey='a'><span class='key'>{$LAN_3|default:"All"}</span></a></li>
            <li><a {if $pagetype eq "categories"}class="current"{/if} href='categories.php?pt=categories' accesskey='c'><span class='key'>{$LAN_40|default:"Categories"}</span></a></li>
            <li><a {if $pagetype eq "images"}class="current"{/if} href='images.php?pt=images' accesskey='i'><span class='key'>{$LAN_4|default:"Images"}</span></a></li>
            <li><a {if $pagetype eq "videos"}class="current"{/if} href='videos.php?pt=videos' accesskey='r'><span class='key'>{$LAN_39|default:"Videos"}</span></a></li>
            <li><a {if $pagetype eq "submit"}class="current"{/if} href='submit.php?pt=submit&amp;part=1' accesskey='s'><span class='key'>{$LAN_5|default:"Submit"}</span></a></li>
         </ul>
         <!--Navigation UL End-->
         <!--Search Start-->
         <div id="search">
            <form method="post" action="index.php" name="search1">
               <input type="text" name="searching" />
               <input type="submit" value="{$LAN_71}" />
            </form>
         </div>
         <!--Search End-->
      </div>
      <!--Navigation Inner End-->
   </div>
   <!--Navigation End-->
</div>
<!--Header Wrapper End-->

<div class="clearer"> </div>

<!--Body Wrapper Start-->
<div id="bodywrapper">
   <!--Body Start-->
   <div class="clearer"> </div>
   <div id="body">
      <div class="clearer"> </div>



Replace templates/default/index.tpl:
Code: [Select]
{include file="header.tpl"}
<!--Container Start-->
<div id="container">
<!--Left Column Start-->
<div id="main-wrapper">
<!--Left Column Inner Start-->
<div id="content" class="roundedcorner">
<!--Content-->
{section name=mysec loop=$videos}
<div class="videocontent">
<div class="buttons">
<a href="videos.php?id={$videos[mysec].id}" class="small button" style="margin-left: 5px;">
{$LAN_14}
</a>
<a href="videos.php?KeepThis=true&amp;height=600&amp;width=970&amp;id={$videos[mysec].id}&amp;pop=1" class="small button thickbox" title="{$videos[mysec].name}">
{$LAN_15}
</a>
</div>
<div class="calendar roundedcorner">
<p>
{$videos[mysec].month}
<br />
{$videos[mysec].day}
</p>
</div>
<h2>
<a href="videos.php?id={$videos[mysec].id}">
{$videos[mysec].name|truncate:32:'...'}
</a>
</h2>

<div class="description">
<b>{$LAN_16}:</b>
{$videos[mysec].creator|truncate:20:'...'}
</div>
<br />
<table width="0" border="0" cellspacing="0">
<tr>
<td>
<a href="videos.php?id={$videos[mysec].id}">
<img height='89' width='120' src="{$videos[mysec].picture}" class="thumbnail" alt="thumbnail" />
</a>
</td>
<td>
{$videos[mysec].description|truncate:580:'...'}
</td>
</tr>
</table>
</div>
{sectionelse}

No Results

{/section}

<br />

<!--Page Tab-->
{* display pagination info *}
<p align="center">
&nbsp;&nbsp;{paginate_prev}&nbsp;&nbsp;{paginate_next}
<br />
{paginate_middle page_limit="20"}
</p>


</div>
<!--Left Column Inner End-->
</div>
<!--Left Column End-->
<!--Right Column Start-->
<div id="sidebar-wrapper">
<!--Right Column Inner Start-->
<div id="sidebar-content" class="roundedcorner">
<!--Conent-->

<div class="box roundedcorner">
<h1>{$LAN_71}</h1>
<div id="sidebarsearch">
<form method="post" action="index.php" name="search1">
<input type="text" class="searchinput" name="searching" /><input type="submit" value="{$LAN_71}" />
</form>
</div>
<div class="clearer"> </div>
</div>
<div class="clearer"> </div>
<div class="box roundedcorner">
<h1>{$LAN_71}</h1>
{include file="memberbar.tpl"}
<div class="clearer"> </div>
</div>
<div class="clearer"> </div>
<div class="box roundedcorner">
<h1>{$LAN_67}</h1>
{if $news eq ""}
<div class="newscontent broundedcorner">{if $firefox eq "1"}</div>
{/if} {else}
<div class="newscontent broundedcorner">{$news}</div>
{/if}
</div>
<div class="clearer"> </div>
<div class="box roundedcorner">
<h1>{$LAN_58}</h1>
<div style="margin: 0px auto;">
<div style="float: left; padding: 5px;">
<!--Image by: http://www.icondrawer.com/-->
<a href="?lang=en-gb"><img alt="" style="vertical-align: middle;" src="lang/flags/gb.png" border="0" />English</a>
<br />
<!--Image by: http://www.icondrawer.com/-->
<a href="?lang=fr"><img alt="" style="vertical-align: middle;" src="lang/flags/fr.png" border="0" />French</a>
<br />
<!--Image by: http://www.icondrawer.com/-->
<a href="?lang=cz"><img alt="" style="vertical-align: middle;" src="lang/flags/cz.png" border="0" />Czech</a>
</div>
<div style="float: left; padding: 5px;">
<!--Image by: http://www.icondrawer.com/-->
<a href="?lang=de"><img alt="" style="vertical-align: middle;" src="lang/flags/de.png" border="0" />Dutch</a>
<br />
<!--Image by: http://www.icondrawer.com/-->
<a href="?lang=it"><img alt="" style="vertical-align: middle;" src="lang/flags/it.png" border="0" />Italian</a>
<br />
<!--Image by: http://www.icondrawer.com/-->
<a href="?lang=po"><img alt="" style="vertical-align: middle;" src="lang/flags/po.png" border="0" />Polish</a>
</div>
<div style="float: left; padding: 5px;">
<!--Image by: http://www.icondrawer.com/-->
<a href="?lang=pt"><img alt="" style="vertical-align: middle;" src="lang/flags/pt.png" border="0" />Portuguese</a>
<br />
<!--Image by: http://www.icondrawer.com/-->
<a href="?lang=ru"><img alt="" style="vertical-align: middle;" src="lang/flags/ru.png" border="0" />Russian</a>
<br />
<!--Image by: http://www.icondrawer.com/-->
<a href="?lang=sp"><img alt="" style="vertical-align: middle;" src="lang/flags/sp.png" border="0" />Spanish</a>
</div>
</div>
<div class="clearer"> </div>
</div>
<div class="clearer"> </div>
<div class="box roundedcorner">
<h1>{$LAN_7}</h1>
<div align="center">
&nbsp;{$LAN_31}
<!--Sort By Rating-->
<a href="?sort=rating&amp;order=up&amp;next={$next}&amp;pt={$pagetype}">
<img src="templates/default/images/arrowup.png" alt="Up" border="0" />
</a>
<a href="?sort=rating&amp;order=down&amp;next={$next}&amp;pt={$pagetype}" >
<img src="templates/default/images/arrowdown.png" border="0" alt="Down" />
</a>&nbsp;&nbsp; &nbsp; &nbsp; {$LAN_32}

<!--Sort By Views-->
<a href="?sort=views&amp;order=up&amp;next={$next}&amp;pt={$pagetype}">
<img src="templates/default/images/arrowup.png" border="0" alt="Up" />
</a>
<a href="?sort=views&amp;order=down&amp;next={$next}&amp;pt={$pagetype}">
<img src="templates/default/images/arrowdown.png" border="0" alt="Down" />
</a>
<br />
&nbsp;{$LAN_33}

<!--Sort By Name-->
<a href="?sort=name&amp;order=up&amp;next={$next}&amp;pt={$pagetype}">
<img src="templates/default/images/arrowup.png" border="0" alt="Up" />
</a>
<a href="?sort=name&amp;order=down&amp;next={$next}&amp;pt={$pagetype}">
<img src="templates/default/images/arrowdown.png" border="0" alt="Down" />
</a>&nbsp; &nbsp; &nbsp; &nbsp; {$LAN_34}

<!--Sort By Date-->
<a href="?sort=date&amp;order=up&amp;next={$next}&amp;pt={$pagetype}">
<img src="templates/default/images/arrowup.png" border="0" alt="Up" />
</a>
<a href="?sort=date&amp;order=down&amp;next={$next}&amp;pt={$pagetype}">
<img src="templates/default/images/arrowdown.png" border="0" alt="Down" />
</a>
<br />
{paginate_prev}&nbsp;&nbsp;{paginate_next}
</div>
</div>

<div class="clearer"> </div>

<div class="box roundedcorner">
<h1>{$LAN_76} {$LAN_75}</h1>
<!--Page Tab-->
{* display pagination info *}
<p align="center">
{paginate_prev}&nbsp;&nbsp;{paginate_next}
<br />
{paginate_middle page_limit="20"}
</p>
</div>

<div class="clearer"> </div>

<!-Right Column Content End-->
</div>
<!-Right Column Inner End-->
</div>
<!--Right Column End-->
</div>
<!--Container End-->
{include file="footer.tpl"}


Replace templates/default/memberbar.tpl"
Code: [Select]
{if isset($smarty.cookies.id)}
<ul style="float: right; text-align: right; width: 410px; padding-right: 5px;">
<li><a href="member.php">{$LAN_132}</a></li>
<li><a href="avatar.php">{$LAN_111}</a></li>
<li><a href="favorite.php">{$LAN_110}</a></li>
<li><a href="message.php">{$LAN_133}{if $nbmess gte 1}(<font color="red">{$nbmess}</font>){else}({$nbmess}){/if}</a></li>
<li><a href="logout.php">{$LAN_106}</a></li>
</ul>
<div style="float: left;">
<img src="avatar/{$avatar}" style="height: 25px; vertical-align: middle;" alt=""/> <strong>{$LAN_134},</strong>
</div>
<div class="clearer"> </div>
<div style="margin-left: 30px; margin-top: 0px; font-weight: bold;"><a href="user.php?u={$user}">{$user}</a></div>
{else}
<form action="login.php" method="post">
          {$LAN_103} : <input type="text" name="TB_Nom_Utilisateur" />
          {$LAN_63} : <input type="password" name="TB_Mot_de_Passe" />
          <input type="submit" name="BT_Envoyer" value="{$LAN_103}" />
<p style="text-align: right; padding-right: 8px;"><a href="register.php">{$LAN_107}</a></p>
</form>
{/if}

There may be styling issues but it should work.

Quote
I have also noticed on the admin panel you cannot see any members registered? How can you create a members table? So you can view members of the site?
-- We would have to right some new code, and if I do it the fast way could be a security risk. We will work on it in Version 1.0.

Offline MrMac

  • Newbie
  • *
  • Posts: 7
  • Karma: 0
    • View Profile
  • Script Version: 0.3
Re: Help needed modifying website
« Reply #6 on: April 08, 2010, 10:10:20 AM »
Thanks again FireDart.  Code still does not work for restricting viewing to members only.  If you login, both codes come up with the same Smarty Error as posted above.  It's a pain lol.

A bit of a niggle for me though, I have a few video's (on my laptop) I would like to put on my website and I don't want to upload them to another video hosting site for people to see.  Is there no way I can upload these to my personal PHPDirector Website?  I only want the video's to appear on my site.  It would be a great help if this could be done.

Thanks Again.

Lewis.

« Last Edit: April 08, 2010, 12:43:02 PM by MrMac »

Offline MrMac

  • Newbie
  • *
  • Posts: 7
  • Karma: 0
    • View Profile
  • Script Version: 0.3
Re: Help needed modifying website
« Reply #7 on: April 12, 2010, 01:04:23 PM »
Can no one help a poor young user :'(

Offline winracer

  • Development Team
  • Pro Member
  • *******
  • Posts: 446
  • Karma: 3
    • View Profile
    • helpmewithperl.com
  • Script Version: 1.0+
Re: Help needed modifying website
« Reply #8 on: April 12, 2010, 01:25:54 PM »
can you PM me your website url so that I can view it.


Version 1.0 should have the upload, when it is released.

« Last Edit: April 12, 2010, 01:42:07 PM by winracer »
winracer
myfunnypets.com
helpmewithperl.com
coosavalleyclassifieds.com
brownlows.net
myphpforum.com

Offline winracer

  • Development Team
  • Pro Member
  • *******
  • Posts: 446
  • Karma: 3
    • View Profile
    • helpmewithperl.com
  • Script Version: 1.0+
Re: Help needed modifying website
« Reply #9 on: April 13, 2010, 04:26:37 PM »
try this create folder called upload_files and upload the zip files to it
upload.php

Code: [Select]

<?php
// ==============
// Configuration
// ==============

ob_start();
session_start();
if(!isset(
$_COOKIE["id"]))
{
     
header("Location: register.php");
}
else
{
include(
"header.php");

//Categories
$catresult mysql_query("SELECT * FROM pp_categories WHERE disable='0'") or die("Error: " mysql_error());
//Gets Categories
while ($catrow2 =  mysql_fetch_array($catresult)){
$result11[] = $catrow2;
}
//pass the results to the template
$smarty->assign('cat'$result11);
$dossier 'upload_files/';
$fichier basename($_FILES['file']['name']);
$taille_maxi 750000000;
$taille filesize($_FILES['file']['tmp_name']);
$extensions = array('.png''.gif''.jpg''.jpeg','.mov''.swf''.wmv''.mpg','.mp3');
$extension strrchr($_FILES['file']['name'], '.'); 
$max_height "1000"// This is in pixels - Leave this field empty if you don't want to upload images
$max_width "1000"// This is in pixels - Leave this field empty if you don't want to upload images
//Scurtiy test
if(!in_array($extension$extensions)) //Extension test
{
     
$erreur 'Only png, gif, jpg, jpeg, mov, flv, wmv; swf, mp3 files are allowed';
}
if(
$taille>$taille_maxi)
{
     
$erreur 'The file is too big';
}
$filesize $_FILES['file']['size'];
$filename $_FILES['file']['name'];
// Check Height & Width
if(!empty($_FILES['file']['tmp_name']));
{
if (
$max_width && $max_height) {
list(
$width$height$type$w) = getimagesize($_FILES['file']['tmp_name']);
if(
$width $max_width || $height $max_height)
{
Print 
"File height and/or width are too big!";
exit;
}
}
}
if(!isset(
$erreur)) //S'il n'y a pas d'erreur, on upload
{
list(
$width$height$type$w) =getimagesize($_FILES['file']['tmp_name']);
     
$fichier basename($_FILES['file']['name']);
     if(
move_uploaded_file($_FILES['file']['tmp_name'], $dossier $fichier)) //Si la fonction renvoie TRUE, c'est que ça a fonctionné...
     
{
 $erreur ='Congratulation, your file '.$fichier.' '.$width.'X'.$height.' has been uploaded on our server !';
 if(($extension == '.gif') OR ($extension == '.png') OR ($extension == '.jpg') OR ($extension == '.jpeg'))
 {
 $picture 'upload_files/'.$fichier.'';
 }

   elseif(
$extension == '.wmv')    
   {
   
$picture 'upload_files/wmv.jpg';
   }
   elseif(
$extension == '.mov')    
   {
   
$picture 'upload_files/mov.jpg';
   }
   else
    {
 $picture ='no_picture.jpg';
 }
mysql_query("INSERT INTO pp_files (name, video_type, creator, description, date, file, file2, approved, picture, category) 
VALUES ('
$_POST[name]', '$extension' , '$_COOKIE[user]', '".safe_sql_insert($_POST['description'])."', CURRENT_DATE(),'$fichier','$w','0','$picture', '$_POST[category]')") or die(mysql_error());   
     }
     else 
//Sinon (la fonction renvoie FALSE).
     
{
          
$erreur 'Upload failed !';
     }
}
}
$smarty->assign('message'$erreur);   
$smarty->display('upload.tpl');
?>


upload.tbl


Code: [Select]

{include file="header.tpl"}
{literal}
<script>
function checkform()
{
if (document.video.name.value == '') {
alert('Please Enter A Title');
return false;
}
else if (document.video.description.value == '')
{
alert('Please Enter A description');
return false;
}
}
// If the script gets this far through all of your fields
// without problems, it's ok and you can submit the form
return true;
}
</script>
{/literal}
<br />
<div align="center">
<font size="4" face="Times">
{$message}<br><br><br></font>
<form action="upload.php" method="post" name="video" onSubmit="return checkform()" ENCTYPE="multipart/form-data">
<!--Center Page-->
<h3><font size="5" face="Times"><b>Submit you video</b>:{$source}</font></h3>
<table width="83" border="0">
<tr>
<td height="21" align="center"><b>Name</b></td>
</tr>
<tr>
<td height="21" align="center"><textarea name="name" cols="50" rows="1" id="name" style="text-align:center; text-shadow:#990000"></textarea></td>
<td>&nbsp;</td>
</tr>
<tr>
<td height="21" align="center"><b>Description</b></td>
</tr>
<tr>
<td height="104"><textarea name="description" cols="50" rows="6" style="text-align:center;"></textarea></td>
<td>&nbsp;</td>
</tr>
<tr>
<td height="21" align="center"><b>File</b></td>
</tr>
<tr>
<td height="104"><input type="file" name="file" size="30"></td>
<td>&nbsp;</td>
</tr>
<tr>
<td height="19" align="center"><b>Category</b></td>
</tr>
<tr>
<td height="104" align="center"><select name="category" size="6">

        {section name=cat loop=$cat}

<option value="{$cat[cat].id}" {if $cat[cat].id eq "1"}selected="selected"{/if}>{$cat[cat].name}</option>

{/section}
</select>
</td>
<td>&nbsp;</td>
</tr>
</table>
<p align="center">
<input type="submit" value="Submit">
</p>
</form>
</div>

{include file="footer.tpl"}


players.tbl

Code: [Select]

{if $vidtype eq "YouTube"}
<object type="application/x-shockwave-flash" style="width:450px; height:366px;" data="http://www.youtube.com/v/{if $video[video].file eq ""}{$videoid}{else}{$video[video].file}{/if}&amp;autoplay=1">
<param name="movie" value="http://www.youtube.com/v/{if $video[video].file eq ""}{$videoid}{else}{$video[video].file}{/if}&amp;autoplay=1" />
</object>

{elseif $vidtype eq "GoogleVideo"}
<embed style="width:400px; height:326px;" id="VideoPlayback" type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.swf?docId={if $video[video].file eq ""}{$videoid}{else}{$video[video].file}{/if}" flashvars=""> </embed>

{elseif $vidtype eq "dailymotion"}
<div><object width="425" height="335"><param name="movie" value="http://www.dailymotion.com/swf/{if $video[video].file eq ""}{$videoid}{else}{$video[video].file}{/if}"></param><param name="allowfullscreen" value="true"></param><embed src="http://www.dailymotion.com/swf/{if $video[video].file eq ""}{$videoid}{else}{$video[video].file}{/if}" type="application/x-shockwave-flash" width="425" height="334" allowfullscreen="true"></embed></object></div>

{elseif $vidtype eq ".swf"}
<!--div><object {$video[video].file2}>
<param name="movie" value="upload_files/{$video[video].file}"></param><param name="allowfullscreen" value="true"></param>
<embed src="upload_files/{$video[video].file}" type="application/x-shockwave-flash" {$video[video].file2} allowfullscreen="true"></embed></object></div-->


<!--div id="player" style="display:block;width:425px;height:300px;"></div>
<script>     
flowplayer("player", "upload_files/{$video[video].file}", ...);
</script-->
<!--link rel="stylesheet" type="text/css" href="css/style.css"-->
<a 
href="upload_files/{$video[video].file}" 
style="display:block;width:520px;height:330px" 
id="player">
</a>

<!-- this will install flowplayer inside previous A- tag. -->
<script>
flowplayer("player", "upload_files/{$video[video].file}");
</script>




<div id="flashbanner">this will be replaced by the SWF.</div>

<script type="text/javascript">
  var so = new SWFObject('upload_files/{$video[video].file}','mpl','400','450','9');
  so.addParam('allowfullscreen','true');
  so.addParam("quality", "low");
   so.addParam("wmode", "transparent");
   so.addParam("salign", "t");
 so. addParam('flashvars','file=playlist.xml&autostart=true');
  so.write('flashbanner');
</script>



{elseif $vidtype eq ".gif"}
<img src="upload_files/{$video[video].file}" {$video[video].file2}>

{elseif $vidtype eq ".png"}
<img src="upload_files/{$video[video].file}" {$video[video].file2}>

{elseif $vidtype eq ".jpg"}
<img src="upload_files/{$video[video].file}" {$video[video].file2}>

{elseif $vidtype eq ".jpeg"}
<img src="upload_files/{$video[video].file}" {$video[video].file2}>

{elseif $vidtype eq ".wmv"}
<!--object id="MediaPlayer" {$video[video].file2} classid="CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95" standby="Loading Windows Media Player components..." type="application/x-oleobject" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112">
 
<param name="filename" value="upload_files/{$video[video].file}">
<param name="Showcontrols" value="True">
<param name="autoStart" value="True">
 
<embed type="application/x-mplayer2" src="http://media.pmcmovies.com/SixtiesLove.wmv" name="MediaPlayer"{$video[video].file2} ></embed>
 
</object-->


<!--OBJECT id="VIDEO" CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" type="application/x-oleobject" width="320" height="240">

   <PARAM NAME="URL" VALUE="upload_files/{$video[video].file}">

   <PARAM NAME="enabled" VALUE="True">

   <PARAM NAME="AutoStart" VALUE="False">

   <PARAM name="PlayCount" value="3">

   <PARAM name="Volume" value="50">

   <PARAM NAME="balance" VALUE="0">

   <PARAM NAME="Rate" VALUE="1.0">

   <PARAM NAME="Mute" VALUE="False">

   <PARAM NAME="fullScreen" VALUE="False">

   <PARAM name="uiMode" value="full">

</OBJECT-->



<OBJECT ID="Video" width="405" height="450"
classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"
type="application/x-oleobject" VIEWASTEXT>
<PARAM NAME="FileName" VALUE="upload_files/{$video[video].file}">
<PARAM NAME="ShowControls" VALUE="True">
<PARAM NAME="ShowStatusBar" VALUE="True">
<PARAM NAME="TransparentAtStart" Value="True">
<PARAM NAME="AutoStart" Value="False">
<PARAM NAME="AnimationatStart" Value="True">
<PARAM NAME="autoSize" Value="True">
<PARAM NAME="displaySize" Value="True">
<PARAM NAME="enableContextMenu" Value="True">
<PARAM NAME="Mute" VALUE="True">
<PARAM NAME="SetFullScreen" Value="True">
<PARAM NAME="uiMode" Value="invisible">
<EMBED type="application/x-mplayer2"
pluginspage = "http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/"
SRC="upload_files/{$video[video].file}"
Name="MediaPlayer1"
Width="405"
Height="450"
autoStart=1
transparentAtStart=1
animationAtStart=1
autoSize=1
ShowStatusBar=1
ShowControls=1
displaySize=1
SetFullScreen=1
Mute=1
enableContextMenu=1
uiMode="invisible"
align="center">
</EMBED>
</OBJECT>



<!--SELECT name=selecta size=1 id=musica onchange=document.all.playera.Filename=document.all.musica.value;>
<OPTION selected>::::::::: Choose Your Media Sample Here :::::::::</OPTION>
<OPTION value="upload_files/{$video[video].file}">My Video File </OPTION>
<OPTION value="Stream URL or Full File Path Goes Here">My Audio File</OPTION>
<OPTION value="Stream URL or Full File Path Goes Here">My Live Stream</OPTION>
</select-->
<BR>


<!--OBJECT id=playera height=430 width=430 classid=clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95>
<PARAM NAME="AutoStart" VALUE="True">
<PARAM NAME="Balance" VALUE="True">
<PARAM NAME="DisplaySize" VALUE="True">
<PARAM NAME="Filename" VALUE="upload_files/{$video[video].file}">
<PARAM NAME="Mute" VALUE="True">
<PARAM NAME="SelectionStart" VALUE="True">
<PARAM NAME="SelectionEnd" VALUE="True">
<PARAM NAME="ShowControls" VALUE="True">
<PARAM NAME="ShowAudioControls" VALUE="True">
<PARAM NAME="ShowDisplay" VALUE="True">
<PARAM NAME="ShowPositionControls" VALUE="True">
<PARAM NAME="Volume" VALUE="1">
<PARAM NAME="AudioStream" VALUE="False">
<PARAM NAME="AutoSize" VALUE="True">
<PARAM NAME="AnimationAtStart" VALUE="True">
<PARAM NAME="AllowScan" VALUE="False">
<PARAM NAME="AllowChangeDisplaySize" VALUE="True">
<PARAM NAME="AutoRewind" VALUE="True">
<PARAM NAME="BaseURL" VALUE="">
<PARAM NAME="BufferingTime" VALUE="5">
<PARAM NAME="CaptioningID" VALUE="">
<PARAM NAME="ClickToPlay" VALUE="True">
<PARAM NAME="CursorType" VALUE="0">
<PARAM NAME="CurrentPosition" VALUE="True">
<PARAM NAME="CurrentMarker" VALUE="True">
<PARAM NAME="DefaultFrame" VALUE="mainframe">
<PARAM NAME="DisplayBackColor" VALUE="True">
<PARAM NAME="DisplayForeColor" VALUE="16777215">
<PARAM NAME="DisplayMode" VALUE="1">
<PARAM NAME="Enabled" VALUE="-1">
<PARAM NAME="EnableContextMenu" VALUE="True">
<PARAM NAME="EnablePositionControls" VALUE="True">
<PARAM NAME="EnableFullScreenControls" VALUE="True">
<PARAM NAME="EnableTracker" VALUE="False">
<PARAM NAME="InvokeURLs" VALUE="False">
<PARAM NAME="Language" VALUE="False">
<PARAM NAME="PlayCount" VALUE="1">
<PARAM NAME="PreviewMode" VALUE="True">
<PARAM NAME="ShowStatusBar" VALUE="True">
<PARAM NAME="TransparentAtStart" VALUE="True">
</OBJECT-->







{elseif $vidtype eq ".Mp3"}


<embed src= "http://www.odeo.com/flash/audio_player_standard_gray.swf" quality="high" width="300" height="52" allowScriptAccess="always" wmode="transparent"  type="application/x-shockwave-flash" flashvars= "valid_sample_rate=true&external_url=upload_files/{$video[video].file}" pluginspage="http://www.macromedia.com/go/getflashplayer"> </embed>
<br><br><br>

<embed src="upload_files/{$video[video].file}"
width="140" height="40" autostart="false" loop="FALSE">
</embed>

{elseif $vidtype eq ".wav"}


<embed src= "http://www.odeo.com/flash/audio_player_standard_gray.swf" quality="high" width="300" height="52" allowScriptAccess="always" wmode="transparent"  type="application/x-shockwave-flash" flashvars= "valid_sample_rate=true&external_url=upload_files/{$video[video].file}" pluginspage="http://www.macromedia.com/go/getflashplayer"> </embed>
<br><br><br>

<embed src="upload_files/{$video[video].file}"
width="140" height="40" autostart="false" loop="FALSE">
</embed>



<!--{elseif $vidtype eq ".swf"}


<object width="Width in Pixels" height="Height in Pixels" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0">
<param name="salign" value="lt">
<param name="quality" value="high">   
<param name="scale" value="noscale">
<param name="wmode" value="transparent">
<param name="movie" value="http://geekfile.googlepages.com/flvplay.swf">
<param name="FlashVars" value="&streamName=upload_files/{$video[video].file}&skinName=http://geekfile.googlepages.com/flvskin&autoPlay=true&autoRewind=true"> 
<embed width="Width in Pixels" height="Height in Pixels" flashvars="&streamName=upload_files/{$video[video].file}&autoPlay=true&autoRewind=true&skinName=http://geekfile.googlepages.com/flvskin" quality="high" scale="noscale" salign="LT" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" src="http://geekfile.googlepages.com/flvplay.swf" wmode="transparent">
</embed></object-->







{elseif $vidtype eq ".mov"}


<EMBED SRC="upload_files/{$video[video].file}" WIDTH="400" HEIGHT="440"

QTNEXT1="</quicktime/movies/sample.mov> T<myself>"

QTNEXT2="<rtsp://www.apple.com/quicktime/movies/sample.mov> T<myself>"

QTNEXT3="<URL> T<myself>"

QTNEXT4="GOTO0"





{elseif $vidtype eq ".avi"}


<object
  id="mediaPlayer"
  classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"
  codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"
  standby="Loading Microsoft Windows Media Player components..."
  type="application/x-oleobject">
  <param name="fileName" value="upload_files/{$video[video].file}">
  <param name="animationatStart" value="1">
  <param name="transparentatStart" value="1">
  <param name="autoStart" value="1">
  <param name="autoSize" value="1">
  <param name="showControls" value="1">
  <param name="loop" value="0">
  <param name="ShowDisplay" value="0">
  <param name="ShowStatusBar" value="1">
<embed type="application/x-mplayer2"
       pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/"
       filename="upload_files/{$video[video].file}"
       src="upload_files/{$video[video].file}"
       name=NSPlay
       showcontrols=1
       showdisplay=0
       showstatusbar=1>
</embed>
</object>




{else}
This video type is currently unsuppotred
{/if}




also in the header.tbl

add this about the </ul>

Code: [Select]

<li><a {if $pagetype eq "upload"}class="current"{/if} href='upload.php?pt=upload' accesskey='t'><span class='key'>{$LAN_170|default:"upload"}</span></a></li>


winracer
myfunnypets.com
helpmewithperl.com
coosavalleyclassifieds.com
brownlows.net
myphpforum.com