PDA

View Full Version : Auto Set Campaigns upon Signup


SPeSeR.com
11th December 2006, 07:16 AM
UPDATED:
This Auto Sets 3 Campaigns to Users when they join.
You will need to change the below variables to meet your specific campaign settings. To do this you will need to have one affilate already assigned to campaigns, then in phpMySQL Admin look under wd_pa_affiliatescampaigns for their correct settings
$campcategoryid
$campaignid

Most of the coding for PAP is too confusing to figure out without studying it for a while because it is well functionated. So I have just added a Verifying Section to the postsignup.php file, it works just fine and the user will really never know the differance.

Below is a copy of my postsignup.php file

<?
//================================================== ==========================
// Copyright (c) webradev.com 2004
// All rights reserved
//
// For support contact info@webradev.com
//================================================== ==========================

include_once('global_signup.php');


////////////////// Added by Rusty Jordan

if(isset($_POST['submit']))
{
$email=$_POST['email'];

$getref="SELECT refid from wd_g_users where username='$email'";
$getref2=mysql_query($getref) or die("Could not get refid");
$getref3=mysql_fetch_array($getref2);

$affiliateid=$getref3[refid];
$rstatus='2';

$affcampid = QCore_Sql_DBUnit::createUniqueID('wd_pa_affiliates campaigns', 'affcampid');
$campcategoryid='b3c44762';
$campaignid='9fc8797f';
$newcamp="INSERT into wd_pa_affiliatescampaigns (affcampid,campcategoryid,affiliateid,campaignid,r status)
values('$affcampid','$campcategoryid','$affiliatei d','$campaignid','$rstatus')";
$newcamp2=mysql_query($newcamp) or die("Could not add campaign 1");

$affcampid = QCore_Sql_DBUnit::createUniqueID('wd_pa_affiliates campaigns', 'affcampid');
$campcategoryid='7d66eedf';
$campaignid='a487923b';
$newcamp="INSERT into wd_pa_affiliatescampaigns (affcampid,campcategoryid,affiliateid,campaignid,r status)
values('$affcampid','$campcategoryid','$affiliatei d','$campaignid','$rstatus')";
$newcamp2=mysql_query($newcamp) or die("Could not add campaign 2");

$affcampid = QCore_Sql_DBUnit::createUniqueID('wd_pa_affiliates campaigns', 'affcampid');
$campcategoryid='a7c2e59b';
$campaignid='fc978841';
$newcamp="INSERT into wd_pa_affiliatescampaigns (affcampid,campcategoryid,affiliateid,campaignid,r status)
values('$affcampid','$campcategoryid','$affiliatei d','$campaignid','$rstatus')";
$newcamp2=mysql_query($newcamp) or die("Could not add campaign 3");


print "<p align='center'>

Your account has successfully been verified";
exit();

}
else
{
?>
<p align='center'>


Please enter email to verify account

<form action='postsignup.php' method='post'>
<center>Email Address:

<input type='text' name='email' size='20'>

<input type='submit' name='submit' value='Verify'>
</form>
<?
}
}
//////////////END OF MY CODE


$page = QUnit_Global::newobj('QUnit_UI_MainPage');

$page->setDefaultView('AffiliateAfterSignup');
$page->user_type = USERTYPE_ADMIN;
$page->setFilePrefix('Affiliate_Scripts_Views_');
$page->setMainTemplate('main_after_signup');

echo $page->processNoSecurityCheck();
?>

SPeSeR.com
12th December 2006, 06:09 AM
A side note. When I have a member it creates a session. in the postsignup.php page it looks to see if the session is in existance, if so it then runs the settings to auto activate campaigns. If not it does not and they do not get access to special commissions and private campaigns.

SPeSeR.com
2nd January 2007, 09:54 AM
I also added an area which matches up my current db users with the PAP3 info to help integrate better if you would like to know this please let me know.

Julien
11th January 2007, 10:03 PM
Hi,
This is a great mod as I was wondering how to ensure my affiliates get assigned in all the campaign automatically.
I need to check something though. What version of PAP you run? I checked my postsignup.php file and it doesn't contain the same as yours. Right now, there is only

<?
include('./header.htm');
?>

Thank you for joining our affiliate program.

<?
include('./footer.htm');
?>

Am I looking at the correct file?
Thanks,
Julien

drakeman
16th January 2007, 02:20 PM
You must copy this code and then insert it into your postsignup.php file

Julien
17th January 2007, 10:22 PM
What I meant is that my postsignup.php file currently contains

<?
include('./header.htm');
?>

Thank you for joining our affiliate program.

<?
include('./footer.htm');
?>


Should I copy the code given above and paste it in place of the code in my current postsignup file or should I add it between my header and footer inside it?

Also, is the code to be added only the lines between

////////////////// Added by Rusty Jordan

and

//////////////END OF MY CODE

or all of it?

I have tried various options and so far didn't get it to work.
Once I register a new affiliate, the postsignup.php page is blank. The affiliate has been created but hasn't been assigned to the campaigns I defined.

drakeman
23rd January 2007, 01:28 PM
His file must be located in scripts/ directory. This is auto generated postsignup file.

if you want use it in ./ PAP root directory you must insert to postsignup.php file this code:

<?
include('./header.htm');
include_once('includes/global_signup.php');

////////////////// Added by Rusty Jordan

if(isset($_POST['submit']))
{
$email=$_POST['email'];

$getref="SELECT refid from wd_g_users where username='$email'";
$getref2=mysql_query($getref) or die("Could not get refid");
$getref3=mysql_fetch_array($getref2);

$affiliateid=$getref3[refid];
$rstatus='2';

$affcampid = QCore_Sql_DBUnit::createUniqueID('wd_pa_affiliates campaigns', 'affcampid');
$campcategoryid='b3c44762';
$campaignid='9fc8797f';
$newcamp="INSERT into wd_pa_affiliatescampaigns (affcampid,campcategoryid,affiliateid,campaignid,r status)
values('$affcampid','$campcategoryid','$affiliatei d','$campaignid','$rstatus')";
$newcamp2=mysql_query($newcamp) or die("Could not add campaign 1");

$affcampid = QCore_Sql_DBUnit::createUniqueID('wd_pa_affiliates campaigns', 'affcampid');
$campcategoryid='7d66eedf';
$campaignid='a487923b';
$newcamp="INSERT into wd_pa_affiliatescampaigns (affcampid,campcategoryid,affiliateid,campaignid,r status)
values('$affcampid','$campcategoryid','$affiliatei d','$campaignid','$rstatus')";
$newcamp2=mysql_query($newcamp) or die("Could not add campaign 2");

$affcampid = QCore_Sql_DBUnit::createUniqueID('wd_pa_affiliates campaigns', 'affcampid');
$campcategoryid='a7c2e59b';
$campaignid='fc978841';
$newcamp="INSERT into wd_pa_affiliatescampaigns (affcampid,campcategoryid,affiliateid,campaignid,r status)
values('$affcampid','$campcategoryid','$affiliatei d','$campaignid','$rstatus')";
$newcamp2=mysql_query($newcamp) or die("Could not add campaign 3");


print "<p align='center'>

Your account has successfully been verified";
exit();

}
else
{
?>
<p align='center'>


Please enter email to verify account

<form action='postsignup.php' method='post'>
<center>Email Address:

<input type='text' name='email' size='20'>

<input type='submit' name='submit' value='Verify'>
</form>
<?
}
}
//////////////END OF MY CODE


include('./footer.htm');
?>

I don't test it

theohiobloke
16th January 2008, 06:09 PM
I am looking to have sub-affilates of a particular affilate be automatically joined to a private campaign. Is this the mod I need for my system? I am on 3.1.4