MyBB-Plugins Forums

Full Version: CPALead Postback Newpoints Integration
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
This really isn't a plugin but I'm sure someone will find use for this.
NOTE: This will require some knowledge of how to setup CPALead.

I have made a script from the information that CPALead gives that uses their postback system. It will give users Newpoints from completing surveys. It is completely automated just have to setup postback on your CPALead script. The points that users receive depends on the survey they took. Once they complete a survey it will give them the points they made from the surveys to their Newpoints.

This is the code you would use to make the postback.php file.
PHP Code:
<?php

define
("IN_MYBB"1);

require_once 
"./global.php";

// This is if you want to use a password
$validate "YOUR PASSWORD";

$password $_REQUEST['password'];
if (
$password != $validate) {
    
redirect("index.php""<strong>NOTHING</strong> to see here... Move along now.");
    exit;
}

$subid   $_REQUEST['subid'];
$pdtshow $_REQUEST['pdtshow'];

// Updates the users newpoints with amount they earned from surveys
$db->write_query('UPDATE `'.mybb_.'users` SET `newpoints` = `newpoints`+'.$pdtshow.' WHERE `uid`=\''.$subid.'\'');

// This shows if everything worked correctly
echo "Success: ".$subid." earned ".$pdtshow." points\n"

?>

To test this script do the following:

http://forumurl.com/postback?password=YO...ICKANUMBER

Oh and also I was using the onclick script for CPALead. To make sure the user gets their points you need to modify the script they give you to the follow:

Code:
<script type="text/javascript" src="http://www.cpalead.com/mygateway.php?pub=########&subid={$mybb->user['uid']}"></script>

Hope this helps some people. Smile
Thanks for posting but why is this in the NewPoints forum??
I posted this in Newpoints forum because the points CPALead gives when someone completes a survey it updates the users Newpoints amount. I'll update op to be little more clear. Smile
(12-26-2010, 12:42 PM)xScopex Wrote: [ -> ]I posted this in Newpoints forum because the points CPALead gives when someone completes a survey it updates the users Newpoints amount. I'll update op to be little more clear. Smile

Oh alright, seems okay to me Smile
You should probably use NewPoints's newpoints_addpoints function to add points though
(12-26-2010, 09:11 PM)Pirata Nervo Wrote: [ -> ]
(12-26-2010, 12:42 PM)xScopex Wrote: [ -> ]I posted this in Newpoints forum because the points CPALead gives when someone completes a survey it updates the users Newpoints amount. I'll update op to be little more clear. Smile

Oh alright, seems okay to me Smile
You should probably use NewPoints's newpoints_addpoints function to add points though

Ok, I'll have to look into that. I just started to learn php and all the workings with MyBB so learning as I go. Smile
Thanks for this! I was looking for something like this Smile
Sorry to bump this thread, but thanks very much for this.

Just a quick note, the test link you provided requires a .php at the end of postback like so;
http://forumurl.com/postback.php?passwor...how=NUMBER

Otherwise it looks good, just going to wait until someone tests it now.
Im willing to pay up to $20 if someone can make this plugin, simple button click do survey and when done converted to newpoints.
(10-15-2011, 03:00 PM)tabshell Wrote: [ -> ]Im willing to pay up to $20 if someone can make this plugin, simple button click do survey and when done converted to newpoints.

Not CPALead,but AdscendMedia: http://hostmafia.net/forum/surveys.php
Does someone know how to set this up?

Where do I find this - onclick script for CPALead?