Back to vBulletin 3.7 Add-ons

vBulletin and iDevAffiliate Integration
Mod Version: 1.00, by vb_mp

This modification is in the archives.
vB Version: 3.7.2 Rating: (3 votes - 3.67 average) Installs: 17
Released: 14 Sep 2008 Last Update: Never Downloads: 76
Not Supported Uses Plugins Code Changes Re-usable Code Translations Is in Beta Stage  

NOTE: I have it installed on 3.7x, I haven't tried earlier versions.

Description: I have been searching around for a plugin to allow vBulletin and iDevIntegration (for affiliate management of vbulletin paid subscriptions) and could not find any.

I contacted iDevAffiliate and their response was that they did not know enough
about vbulletin to create a plugin themselves but they explain what I had to do
on the iDevAffiliate side to make things work.

Thanks to vbulletin.org members Marco van Herwaarden, Dismounted, Delphiprogrammi, Opserty for pointing me in the right direction as this is my first vbulletin plugin.

This mod integrates iDevAffiliate commission tracking.

NOTE: Keep in mind, I assume that you are fairly well versed and comfortable with editing files/templates and following the flow of things.

Installing:

*********************************
STEP 1
*********************************
In payments.php in your forum root find the following code lines:

Code:
    /* insert query */
    $db->query_write("
        INSERT INTO " . TABLE_PREFIX . "paymentinfo
            (hash, completed, subscriptionid, subscriptionsubid, userid)
        VALUES
            ('" . $db->escape_string($hash) . "', 0, $subscriptionid, $subscriptionsubid, " . $vbulletin->userinfo['userid'] . ")
    ");
Replace them with the following:

Code:
    /* insert query */
    $insertQuery = "INSERT INTO " . TABLE_PREFIX . "paymentinfo
            (hash, completed, subscriptionid, subscriptionsubid, userid";
    $insertQuery .= $vbulletin->options['idevaffiliate_active'] ? ", ipaddress)" : ")";
    $insertQuery .= "VALUES
            ('" . $db->escape_string($hash) . "', 0, $subscriptionid, $subscriptionsubid, " . $vbulletin->userinfo['userid'];
    $insertQuery .= $vbulletin->options['idevaffiliate_active'] ? ", '" . IPADDRESS . "')" : ")";
    $db->query_write($insertQuery);
*********************************
STEP 2
*********************************
In payment_gateway.php file in your forum root find the following code lines:

Code:
    
if ($apiobj->type == 1)
{
    $subobj->build_user_subscription($apiobj->paymentinfo['subscriptionid'], $apiobj->paymentinfo['subscriptionsubid'], $apiobj->paymentinfo['userid']);
Add the following code under the above code ( make sure you replace YOURDOMAINNAME with your domain name and YOURIDEVINSTALLATIONFOLDER with your idev installation folder:

Code:
if ($vbulletin->options['idevaffiliate_active'] AND function_exists('curl_init') AND $ch = curl_init())
{
    $idevQuery = "idev_saleamt=" . $apiobj->paymentinfo['amount'] . "&ip_address=" . $apiobj->paymentinfo['ipaddress'] . "&idev_ordernum=" . $apiobj->paymentinfo['paymentinfoid'];
    curl_setopt($ch, CURLOPT_URL, "http://www.YOURDOMAINNAME.com/YOURIDEVINSTALATIONFOLDER/sale.php");
    curl_setopt($ch, CURLOPT_TIMEOUT, 15);
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_POSTFIELDSIZE, 0);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $idevQuery);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_USERAGENT, 'vBulletin via cURL/PHP');
    $result = curl_exec($ch);
    curl_close($ch);
}
*********************************
STEP 3
*********************************
Install the idevaffiliate_integration Product via the Plugin Manager

*********************************
STEP 4
*********************************
Go to AdminCP -> vBulletin Options -> iDevAffiliate Integration Settings and enable use of iDevAffiliate by selecting 'Yes' and saving.

That's it, you are ready to use iDevAffiliate with vBulletin.

Dont Forget To MARK AS INSTALLED
And Also Don't Forget To Visit http://www.dnxpert.com/forum

Download

This modification is archived, downloads are still allowed.

File Type: %1$s idevaffiliate_integration.zip (1.8 KB, 85 downloads)

Similar Mods

Jpilot / Vbulletin Integration for Vbulletin 3 vBulletin 3.0 Full Releases

vblts.ru supports vBulletin®, 2022-2024