Trying to add free option.
I have free files from the classifieds site but I guess they are different to this site.
I know it is the more.php, payments.php and MoreTemplate files that need to be edited.
I have it setup at afterhoursnightparty.com and I have the free listing set as 0.00
Here is the original code for payments.php
Code:
<?
require_once("conn.php");
require_once("includes.php");
if(empty($_GET[SelectedPackage]))
{
header("location:$_SERVER[HTTP_REFERER]?e=1&PaymentGateway=$_GET[PaymentGateway]");
}
elseif(empty($_GET[PaymentGateway]))
{
header("location:$_SERVER[HTTP_REFERER]?e=2&SelectedPackage=$_GET[SelectedPackage]");
}
else
{
if(!empty($_SESSION[AgentID]))
{
$MyID = $_SESSION[AgentID];
}
if(!empty($_SESSION[MemberID]))
{
$MyID = $_SESSION[MemberID];
}
//get the agent details
$q1 = "select * from personal_members where MemberID = '$MyID' ";
$r1 = mysql_query($q1) or die(mysql_error());
$a1 = mysql_fetch_array($r1);
//get the price details
$q2 = "select * from personal_prices where PriceID = '$_GET[SelectedPackage]' ";
$r2 = mysql_query($q2) or die(mysql_error());
$a2 = mysql_fetch_array($r2);
/*
flags:
r -> renew
n -> new
m -> more
*/
if(ereg("renew.php", $_SERVER[HTTP_REFERER]))
{
$flag = "r";
$action = "Renewal";
}
elseif(ereg("more.php", $_SERVER[HTTP_REFERER]))
{
$flag = "m";
$action = "Upgrade";
}
else
{
$flag = "n";
$action = "Activation";
}
if($_GET[PaymentGateway] == "paypal")
{
header("location:https://www.paypal.com/xclick?business=$aset[PayPalEmail]&item_name=$a2[ads] ads for $a2[days] days&first_name=$a1[FirstName]&last_name=$a1[LastName]&email=$a1[email]&item_number=1&custom=$MyID|$_GET[SelectedPackage]|$flag&amount=$a2[price]¬ify_url=http://$_SERVER[HTTP_HOST]$dir/notify.php&return=http://$_SERVER[HTTP_HOST]$dir/login.php");
}
else
{
//manual
//send an email to the admin
$to = $aset[ContactEmail];
$subject = "Manual Service $action Request";
$message = "A client has selected Manual Service $action\nHere are the details:\n\n";
$message .= "Username: $a1[username]\nNames: $a1[FirstName] $a1[LastName]\nSelected Package: $a2[ads] ";
if($a2[PriorityLevel] == '1')
{
$message .= "Featured ";
}
$message .= "ads for $a2[days] days\nPrice: $$a2[price]\n";
$headers = "MIME-Version: 1.0\n";
$headers .= "Content-type: text/plain; charset=iso-8859-1\n";
$headers .= "Content-Transfer-Encoding: 8bit\n";
$headers .= "From: WebSites <$aset[ContactEmail]>\n";
$headers .= "X-Priority: 1\n";
$headers .= "X-MSMail-Priority: High\n";
$headers .= "X-Mailer: PHP/" . phpversion()."\n";
mail($to, $subject, $message, $headers);
//send an email to the client
$to = $a1[email];
$subject = "Your registration at $_SERVER[HTTP_HOST]";
$message = "Hello $a1[FirstName] $a1[LastName],\nhere is your login information for $_SERVER[HTTP_HOST]\n\nUsername: $a1[username]\nPassword: $a1[password]\n\nWe will send you another email message, when your account is activated.\n\nThank you for your registration!";
$headers = "MIME-Version: 1.0\n";
$headers .= "Content-type: text/plain; charset=iso-8859-1\n";
$headers .= "Content-Transfer-Encoding: 8bit\n";
$headers .= "From: $_SERVER[HTTP_HOST] <$aset[ContactEmail]>\n";
$headers .= "X-Priority: 1\n";
$headers .= "X-MSMail-Priority: High\n";
$headers .= "X-Mailer: PHP/" . phpversion()."\n";
mail($to, $subject, $message, $headers);
//get the templates
require_once("templates/HeaderTemplate.php");
require_once("templates/ManualTemplate.php");
require_once("templates/FooterTemplate.php");
}
}
?>
Thanks