Author Topic: E-mail Notification - Notifies you when a new video has been submitted  (Read 2334 times)

0 Members and 1 Guest are viewing this topic.

Offline FireDart

  • Project Leader
  • Pro Member
  • *****
  • Posts: 406
  • Karma: 4
    • View Profile
    • FireDart
Re: E-mail Notification - Notifies you when a new video has been submitted
« Reply #15 on: March 05, 2010, 01:35:49 AM »
Yep, nice.

Offline winracer

  • Development Team
  • Pro Member
  • *******
  • Posts: 446
  • Karma: 3
    • View Profile
    • helpmewithperl.com
  • Script Version: 1.0+
Re: E-mail Notification - Notifies you when a new video has been submitted
« Reply #16 on: March 05, 2010, 01:52:18 AM »
great!
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: E-mail Notification - Notifies you when a new video has been submitted
« Reply #17 on: March 05, 2010, 01:53:23 AM »
I will finish up code and repost it.

need to clean it up and comment it more :)
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: E-mail Notification - Notifies you when a new video has been submitted
« Reply #18 on: March 05, 2010, 02:55:27 AM »
Here is 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'];

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', '1', '$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: E-mail Notification - Notifies you when a new video has been submitted
« Reply #19 on: March 05, 2010, 02:57:52 AM »
thanks.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';
 }

$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','1','$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');

?>

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

Offline ultrafoxus

  • Newbie
  • *
  • Posts: 11
  • Karma: 0
    • View Profile
    • sbobet
thank you for all information  8) 8) 8)