Author Topic: Approve Video  (Read 1144 times)

0 Members and 1 Guest are viewing this topic.

Offline winracer

  • Development Team
  • Pro Member
  • *******
  • Posts: 446
  • Karma: 3
    • View Profile
    • helpmewithperl.com
  • Script Version: 1.0+
Approve Video
« on: March 03, 2010, 01:56:27 AM »
Does anyone think that a admin option to let the submit and upload video would be a good idea.

what I mean is a yes or no option

yes meaning admin Approvel need
no meaning NO Approvel needed

if so I can write the code for it.
winracer
myfunnypets.com
helpmewithperl.com
coosavalleyclassifieds.com
brownlows.net
myphpforum.com

Offline FireDart

  • Project Leader
  • Pro Member
  • *****
  • Posts: 406
  • Karma: 4
    • View Profile
    • FireDart
Re: Approve Video
« Reply #1 on: March 03, 2010, 06:58:49 PM »
Would be nice if it's a easy to use on/off.

Offline winracer

  • Development Team
  • Pro Member
  • *******
  • Posts: 446
  • Karma: 3
    • View Profile
    • helpmewithperl.com
  • Script Version: 1.0+
Re: Approve Video
« Reply #2 on: March 03, 2010, 08:16:20 PM »
Would be nice if it's a easy to use on/off.

yes should be easy. I will do after I finish the e-mail to admin and user
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: Approve Video
« Reply #3 on: March 05, 2010, 03:26:16 AM »
Step one

Step 1

update add this to the en-gb.inc.php

Code: [Select]
$smarty->assign('LAN_205', 'Admin Approve Upload');
$smarty->assign('LAN_206', 'Admin Approve Submit');

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: Approve Video
« Reply #4 on: March 05, 2010, 03:30:17 AM »
step 2

Step 2

add this to option.tbl about the <!--Footer-->

Code: [Select]
<tr>
<td class="first"><strong>{$LAN_205}</strong></td>
<td class="last">
<label><input name="uapprove" type="radio" value="Yes" {if $options[options].uapprove eq "Yes"}checked="checked"{/if} />Yes</label>
<label><input name="uapprove" type="radio" value="No" {if $options[options].uapprove eq "No"}checked="checked"{/if} />No</label>
</td>
</tr>

<tr>
<td class="first"><strong>{$LAN_206}</strong></td>
<td class="last">
<label><input name="sapprove" type="radio" value="Yes" {if $options[options].sapprove eq "Yes"}checked="checked"{/if} />Yes</label>
<label><input name="sapprove" type="radio" value="No" {if $options[options].sapprove eq "No"}checked="checked"{/if} />No</label>
</td>
</tr>




« Last Edit: March 05, 2010, 01:21:09 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: Approve Video
« Reply #5 on: March 05, 2010, 01:20:27 PM »
step 3
go into mysql and run this
Code: [Select]
alter table pp_config add column uapprove varchar (5) NOT NULL default 'No';
alter table pp_config add column sapprove varchar (5) NOT NULL default 'No';
alter table pp_files add column submitter varchar (50) NOT NULL;


step 4

edit the admin.options.php

add

Code: [Select]
mysql_query("UPDATE pp_config SET uapprove = '$_POST[uapprove]'");
mysql_query("UPDATE pp_config SET sapprove = '$_POST[sapprove]'");


« Last Edit: March 07, 2010, 10:46:55 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: Approve Video
« Reply #6 on: March 05, 2010, 01:23:06 PM »
last step thanks.php or upload.php
Code: [Select]
<?php
require('header.php');

// Check for the file id we should have gotten from SWFUpload
if (isset($_POST["hidFileID"]) && $_POST["hidFileID"] != "" ) {
$resume_id $_POST["hidFileID"];
$resume_id strtolower($resume_id);
}

$extension strtolower($extension);
$extensions strtolower($extensions);
$extensions = array('.png''.gif''.jpg''.jpeg','.mov''.swf''.wmv''.mpg','.mp3','.wav','.Mp3');
$extension1 strrchr($_FILES['Filedata']['name'], '.'); 
$extension strrchr($resume_id'.');


if ((
$extension == '.gif') OR ($extension == '.png') OR ($extension == '.jpg') OR ($extension == '.jpeg'))
 {
 $picture 'upload_files/'.$resume_id.'';
 }

   elseif(
$extension == '.wmv')    
   {
   
$picture 'images/ico_wmv.jpg';
   }
elseif(
$extension == '.avi')    
   {
   
$picture 'images/ico_avi_tm.jpg';
   }
elseif(
$extension == '.wav')    
   {
   
$picture 'images/ico_wav.jpg';
   }
   elseif(
$extension == '.mov')    
   {
   
$picture 'images/ico_mov.jpg';
   }
 elseif(
$extension == '.MOV')    
   {
   
$picture 'images/ico_mov.jpg';
   }
elseif(
$extension == '.mp3')    
   {
   
$picture 'images/ico_mp3_tm.jpg';
  }
elseif(
$extension == '.Mp3')    
   {
   
$picture 'images/ico_mp3_tm.jpg';
}
elseif(
$extension == '.swf')   
   {
   
$picture 'images/ico_swf.jpg';
}
 else
    {
 $picture ='images/no_picture.jpg';
 }

$uapprove = $_GET[uapprove];

if(
$uapprove 'Yes')
{
$approve "1";
}
else
{
$approve "0";
}

$ip $_SERVER['REMOTE_ADDR'];
$submitter $_COOKIE[user];
$query mysql_query("INSERT INTO pp_files (name, video_type, creator, description, date, file, file2, approved, ip, picture, category, submitter) 
VALUES ('
$_POST[name]', '$extension' , '$_COOKIE[user]', '".safe_sql_insert($_POST['description'])."', CURRENT_DATE(),'$resume_id','$w','$approve','$ip','$picture', '$_POST[category]', '$submitter')") or die(mysql_error());   
  


$aupload = $_GET[aupload];



if(
$aupload 'Yes'//OR ($aupload = 'Yes'))

{
$data mysql_query("SELECT * FROM pp_config") or die(mysql_error()); 

while(
$info mysql_fetch_array$data )) 

// admin email address
$email $info['aemail'];
$sitename $info['name'];

}

$data1 mysql_query("SELECT id FROM pp_files") or die(mysql_error());
while(
$info1 mysql_fetch_array$data1 )) 

 
$id1 $info1['id'];


$data mysql_query("SELECT email FROM pp_user where user = '$submitter'") or die(mysql_error()); 

while(
$infouser mysql_fetch_array$data )) 

// user email address
$emailuser $infouser['email'];


// The subject
$subject 'Someone just upload a video to '."$sitename";



$headers "From: " strip_tags($email) . "\r\n";
$headers .= "Reply-To: "strip_tags($_POST['req-email']) . "\r\n";
//$headers .= "CC: $email\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
$message '<html><body>';
$message .= '<img src="http://www.myfunnypets.com/30/templates/default/images/logo.png" alt="Powered by PHPDirector" />';
$message .= '<table rules="all" style="border-color: #666;" cellpadding="10">';
$message .= "<tr style='background: #eee;'><td><strong>User Name:</strong> </td><td>" strip_tags($_COOKIE[user]) . "</td></tr>";
$message .= "<tr><td><strong>Email:</strong> </td><td>" strip_tags($emailuser) . "</td></tr>";
$message .= "<tr><td><strong>Video Name:</strong> </td><td>" strip_tags($_POST[name]) . "</td></tr>";
$message .= "<tr><td><strong>Category</strong> </td><td>" strip_tags($_POST[category]) . "</td></tr>";
$message .= "<tr><td><strong>Description</strong> </td><td>" strip_tags($_POST['description']) . "</td></tr>";
$message .= "<tr><td><strong>File</strong> </td><td>" strip_tags($resume_id) . "</td></tr>";
$message .= "<tr><td><strong>File Uploaded to " ."$sitename"."</strong> </td><td>"."http://" $_SERVER['SERVER_NAME']."/30/"."media-"."$id1""</td></tr>";
$message .= "<tr><td><strong>User IP Address:</strong> </td><td>" $ip "</td></tr>";
$message .= "</table>";
$message .= "</body></html>";


//mail($email, $subject, $message, $headers, "From: $email");

mail($email$subject$message$headers);




}
else
{

}


$uupload = $_GET[uupload];


if(
$uupload 'Yes')

{
$data mysql_query("SELECT email FROM pp_user where user = '$submitter'") or die(mysql_error()); 

while(
$info mysql_fetch_array$data )) 

// user email address
$email $info['email'];


$data1 mysql_query("SELECT id FROM pp_files") or die(mysql_error());
while(
$info1 mysql_fetch_array$data1 )) 

$id1 $info1['id'];


// The subject
$subject 'thanks for uploading to '"$sitename";

// The message
$headers "From: " strip_tags($email) . "\r\n";
$headers .= "Reply-To: "strip_tags($_POST['req-email']) . "\r\n";
//$headers .= "CC: $email\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
$message '<html><body>';
$message .= '<img src="http://www.myfunnypets.com/30/templates/default/images/logo.png" alt="Powered by PHPDirector" />';
$message .= '<table rules="all" style="border-color: #666;" cellpadding="10">';
$message .= "<tr style='background: #eee;'><td><strong>User Name:</strong> </td><td>" strip_tags($_COOKIE[user]) . "</td></tr>";
$message .= "<tr><td><strong>Email:</strong> </td><td>" strip_tags($email) . "</td></tr>";
$message .= "<tr><td><strong>Video Name:</strong> </td><td>" strip_tags($_POST[name]) . "</td></tr>";
$message .= "<tr><td><strong>Category</strong> </td><td>" strip_tags($_POST[category]) . "</td></tr>";
$message .= "<tr><td><strong>Description</strong> </td><td>" strip_tags($_POST['description']) . "</td></tr>";
$message .= "<tr><td><strong>File</strong> </td><td>" strip_tags($resume_id) . "</td></tr>";
$message .= "<tr><td><strong>File Uploaded to " ."$sitename"."</strong> </td><td>"."http://" $_SERVER['SERVER_NAME']."/30/"."media-"."$id1""</td></tr>";
$message .= "<tr><td><strong>User IP Address:</strong> </td><td>" $ip "</td></tr>";
$message .= "</table>";
$message .= "</body></html>";


mail($email$subject$message$headers);


}
else
{

}



$smarty->assign('name'$_POST[name]);
$smarty->assign('description'$_POST[description]);
$smarty->assign('resume_id'$resume_id);
$smarty->display('thanks.tpl');

?>


« Last Edit: March 06, 2010, 04:58:29 AM 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: Approve Video
« Reply #7 on: March 06, 2010, 05:01:17 AM »
last step for the submit.php


Code: [Select]
<?php
/*
+ ----------------------------------------------------------------------------+
|     PHPDirector.
| $License: GNU General Public License
| $Website: phpdirector.co.uk
+----------------------------------------------------------------------------+
*/
ob_start();
session_start();
if(!isset(
$_COOKIE["id"]))
{
     
header("Location: login.php");
}
else
{

require(
'header.php');  

$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"];
$submitter $_POST["submitter"];
$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;
}

$ip $_SERVER['REMOTE_ADDR'];
$sapprove = $_GET[sapprove];

if(
$sapprove 'Yes')
{
$approve "1";
}
else
{
$approve "0";
}
mysql_query("INSERT INTO pp_files (name, video_type, creator, description, date, file, file2, approved, ip, picture, category, submitter) VALUES ('$inserttitle', '$source' , '$insertauthor', '$insertdes', CURDATE(), '$videoid', '$file2', '$approve', '$ip', '$insertthumb', '$insetycat', '$submitter')")   or die(mysql_error());


$asubmit = $_GET[asubmit];

if(
$asubmit 'Yes')

{
$data mysql_query("SELECT * FROM pp_config") or die(mysql_error()); 

while(
$info mysql_fetch_array$data )) 

// admin email address
$email $info['aemail'];
$sitename $info['name'];


$data1 mysql_query("SELECT id FROM pp_files") or die(mysql_error());
while(
$info1 mysql_fetch_array$data1 )) 

$id1 $info1['id'];


$data mysql_query("SELECT email FROM pp_user where user = '$submitter'") or die(mysql_error()); 

while(
$infouser mysql_fetch_array$data )) 

// user email address
$emailuser $infouser['email'];

// The subject
$subject 'Someome just submited a video to '."$sitename";

// The message
//$ip = $_SERVER['REMOTE_ADDR'];
$headers "From: " strip_tags($email) . "\r\n";
$headers .= "Reply-To: "strip_tags($_POST['req-email']) . "\r\n";
//$headers .= "CC: $email\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
$message '<html><body>';
$message .= '<img src="http://www.myfunnypets.com/30/templates/default/images/logo.png" alt="Powered by PHPDirector" />';
$message .= '<table rules="all" style="border-color: #666;" cellpadding="10">';
$message .= "<tr style='background: #eee;'><td><strong>User Name:</strong> </td><td>" strip_tags($_COOKIE[user]) . "</td></tr>";
$message .= "<tr><td><strong>Email:</strong> </td><td>" strip_tags($emailuser) . "</td></tr>";
$message .= "<tr><td><strong>Video Name:</strong> </td><td>" $inserttitle "</td></tr>";
$message .= "<tr><td><strong>Category</strong> </td><td>" strip_tags($_POST[category]) . "</td></tr>";
$message .= "<tr><td><strong>Description</strong> </td><td>" $insertdes "</td></tr>";
$message .= "<tr><td><strong>File</strong> </td><td>" $source "</td></tr>";
$message .= "<tr><td><strong>URL To Submit (main):</strong> </td><td>"."http://" $_SERVER['SERVER_NAME']."/30/"."media-"."$id1""</td></tr>";
$message .= "<tr><td><strong>User IP Address:</strong> </td><td>" $ip "</td></tr>";
$message .= "</table>";
$message .= "</body></html>";


mail($email$subject$message$headers);


}
else
{

}


$usubmit = $_GET[usubmit];


if(
$usubmit 'Yes')

{
$data mysql_query("SELECT email FROM pp_user where user = '$submitter'") or die(mysql_error()); 

while(
$info mysql_fetch_array$data )) 

// user email address
$email $info['email'];


// to get video ID
$data1 mysql_query("SELECT id FROM pp_files") or die(mysql_error());
while(
$info1 mysql_fetch_array$data1 )) 

$id1 $info1['id'];


// The subject
$subject 'thanks for submiting a video to '"$sitename";

// The message
$headers "From: " strip_tags($email) . "\r\n";
$headers .= "Reply-To: "strip_tags($_POST['req-email']) . "\r\n";
//$headers .= "CC: $email\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
$message '<html><body>';
$message .= '<img src="http://www.myfunnypets.com/30/templates/default/images/logo.png" alt="Powered by PHPDirector" />';
$message .= '<table rules="all" style="border-color: #666;" cellpadding="10">';
$message .= "<tr style='background: #eee;'><td><strong>User Name:</strong> </td><td>" strip_tags($_COOKIE[user]) . "</td></tr>";
$message .= "<tr><td><strong>Email:</strong> </td><td>" strip_tags($email) . "</td></tr>";
$message .= "<tr><td><strong>Video Name:</strong> </td><td>" $inserttitle "</td></tr>";
$message .= "<tr><td><strong>Category</strong> </td><td>" strip_tags($_POST[category]) . "</td></tr>";
$message .= "<tr><td><strong>Description</strong> </td><td>" $insertdes "</td></tr>";
$message .= "<tr><td><strong>File</strong> </td><td>" $source "</td></tr>";
$message .= "<tr><td><strong>Video Submited to ""$sitename".":</strong> </td><td>"."http://" $_SERVER['SERVER_NAME']."/30/"."media-"."$id1""</td></tr>";
$message .= "<tr><td><strong>User IP Address:</strong> </td><td>" $ip "</td></tr>";
$message .= "</table>";
$message .= "</body></html>";


mail($email$subject$message$headers);


}
else
{

}


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

}


?>


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: Approve Video
« Reply #8 on: March 06, 2010, 05:04:01 AM »
Please let me know if you see any bugs
winracer
myfunnypets.com
helpmewithperl.com
coosavalleyclassifieds.com
brownlows.net
myphpforum.com

Offline svarog

  • phpd Basic Member
  • **
  • Posts: 30
  • Karma: 0
    • View Profile
Re: Approve Video
« Reply #9 on: March 07, 2010, 10:18:11 AM »
first let see if i understood right. approve video is about that the admin doesn't need to approve every video that is submitted (auto approve) right?.

For what is Admin Approve Submit?   

And why in the submit.php has functions for email notify.

And last the creation of field submitter in the pp_user is missing in steps 3 and 4.
« Last Edit: March 07, 2010, 10:47:14 AM by svarog »

Offline winracer

  • Development Team
  • Pro Member
  • *******
  • Posts: 446
  • Karma: 3
    • View Profile
    • helpmewithperl.com
  • Script Version: 1.0+
Re: Approve Video
« Reply #10 on: March 07, 2010, 05:44:09 PM »
first let see if i understood right. approve video is about that the admin doesn't need to approve every video that is submitted (auto approve) right?.

For what is Admin Approve Submit?   

And why in the submit.php has functions for email notify.

And last the creation of field submitter in the pp_user is missing in steps 3 and 4.

you are right this is for auto Approve.

there are different ones for admin Approve

one for the upload part and one for the submit part.


submitter field should be under pp_files

if not
alter table pp_files add column submitter varchar (50) NOT NULL;

and functions for email notify. Is part of my other post. sorry I will change.
« Last Edit: March 07, 2010, 05:52:56 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: Approve Video
« Reply #11 on: March 07, 2010, 10:50:22 PM »
submit with out the e-mail stuff

Code: [Select]
<?php
/*
+ ----------------------------------------------------------------------------+
| PHPDirector.
| $License: GNU General Public License
| $Website: phpdirector.co.uk
+----------------------------------------------------------------------------+
*/
ob_start();
session_start();
if(!isset(
$_COOKIE["id"]))
{
header("Location: login.php");
}
else
{

require(
'header.php'); 

$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"];
$submitter $_POST["submitter"];
$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;
}

$ip $_SERVER['REMOTE_ADDR'];
$sapprove $_GET[sapprove];

if(
$sapprove 'Yes')
{
$approve "1";
}
else
{
$approve "0";
}
mysql_query("INSERT INTO pp_files (name, video_type, creator, description, date, file, file2, approved, ip, picture, category, submitter) VALUES ('$inserttitle', '$source' , '$insertauthor', '$insertdes', CURDATE(), '$videoid', '$file2', '$approve', '$ip', '$insertthumb', '$insetycat', '$submitter')") or die(mysql_error());

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

}


?>


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: Approve Video
« Reply #12 on: March 07, 2010, 10:52:33 PM »
thanks.php with out the e-mail

Code: [Select]
<?php
require('header.php');

// Check for the file id we should have gotten from SWFUpload
if (isset($_POST["hidFileID"]) && $_POST["hidFileID"] != "" ) {
$resume_id $_POST["hidFileID"];
$resume_id strtolower($resume_id);
}

$extension strtolower($extension);
$extensions strtolower($extensions);
$extensions = array('.png''.gif''.jpg''.jpeg','.mov''.swf''.wmv''.mpg','.mp3','.wav','.Mp3');
$extension1 strrchr($_FILES['Filedata']['name'], '.'); 
$extension strrchr($resume_id'.');


if ((
$extension == '.gif') OR ($extension == '.png') OR ($extension == '.jpg') OR ($extension == '.jpeg'))
{
$picture 'upload_files/'.$resume_id.'';
}

elseif(
$extension == '.wmv'
{
$picture 'images/ico_wmv.jpg';
}
elseif(
$extension == '.avi'
{
$picture 'images/ico_avi_tm.jpg';
}
elseif(
$extension == '.wav'
{
$picture 'images/ico_wav.jpg';
}
elseif(
$extension == '.mov'
{
$picture 'images/ico_mov.jpg';
}
elseif(
$extension == '.MOV'
{
$picture 'images/ico_mov.jpg';
}
elseif(
$extension == '.mp3'
{
$picture 'images/ico_mp3_tm.jpg';
}
elseif(
$extension == '.Mp3'
{
$picture 'images/ico_mp3_tm.jpg';
}
elseif(
$extension == '.swf'
{
$picture 'images/ico_swf.jpg';
}
else
{
$picture ='images/no_picture.jpg';
}

$uapprove $_GET[uapprove];

if(
$uapprove 'Yes')
{
$approve "1";
}
else
{
$approve "0";
}

$ip $_SERVER['REMOTE_ADDR'];
$submitter $_COOKIE[user];
$query mysql_query("INSERT INTO pp_files (name, video_type, creator, description, date, file, file2, approved, ip, picture, category, submitter) 
VALUES ('
$_POST[name]', '$extension' , '$_COOKIE[user]', '".safe_sql_insert($_POST['description'])."', CURRENT_DATE(),'$resume_id','$w','$approve','$ip','$picture', '$_POST[category]', '$submitter')") or die(mysql_error()); 


$smarty->assign('name'$_POST[name]);
$smarty->assign('description'$_POST[description]);
$smarty->assign('resume_id'$resume_id);
$smarty->display('thanks.tpl');

?>







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

Offline svarog

  • phpd Basic Member
  • **
  • Posts: 30
  • Karma: 0
    • View Profile
Re: Approve Video
« Reply #13 on: March 08, 2010, 05:41:14 AM »
OK  ;) now works. Just can't understand what is the function of submitter field and why we need the ip of the user.

Offline winracer

  • Development Team
  • Pro Member
  • *******
  • Posts: 446
  • Karma: 3
    • View Profile
    • helpmewithperl.com
  • Script Version: 1.0+
Re: Approve Video
« Reply #14 on: March 08, 2010, 03:54:19 PM »
the function of the submiter filed to me is for future because with it you can have a link to view all video by user... or to use in admin panel/ the ip would also be admin stuff so you can use for a spammer etc...

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