Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.7 > vBulletin 3.7 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
vBulletin and iDevAffiliate Integration Details »»
vBulletin and iDevAffiliate Integration
Version: 1.00, by vb_mp vb_mp is offline
Developer Last Online: Sep 2010 Show Printable Version Email this Page

Category: Miscellaneous Hacks - Version: 3.7.2 Rating:
Released: 09-13-2008 Last Update: Never Installs: 17
Uses Plugins
Re-useable Code Code Changes Translations Is in Beta Stage  
No support by the author.

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 DNXpert.com

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 09-14-2008, 01:15 PM
vb_mp vb_mp is offline
 
Join Date: Feb 2008
Posts: 60
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by TeelK View Post
tagged.. but i would never edit any original vb files as because when and upgrade comes out you have to do it all again, al wait see if someone can make it so no edit of files is possible.
I could make it so that no original files are edited if they put a hook in the right place (in the payment and payment_gateway files).

Currently, there are no hooks, but I think there is a place around here where I can request hooks for new upgrades so I will do that.
Reply With Quote
  #13  
Old 09-14-2008, 07:20 PM
mambomouth mambomouth is offline
 
Join Date: May 2005
Location: NYC/NJ
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

fantastic work I can't wait to try this.
Thanks a "vb_mp"
Reply With Quote
  #14  
Old 09-14-2008, 08:52 PM
vb_mp vb_mp is offline
 
Join Date: Feb 2008
Posts: 60
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by mambomouth View Post
fantastic work I can't wait to try this.
Thanks a "vb_mp"
No probs . Let me know how you go. It's currently live and counting commissions for my affiliates on my site.
Reply With Quote
  #15  
Old 09-15-2008, 03:39 PM
jasculs jasculs is offline
 
Join Date: Jun 2007
Posts: 217
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hey vb_mp have you tested this out with some of your members already getting recorded commissions? If so then you're the best person ever because I've been looking for a paid subscription affiliate system for a very very long time.
Reply With Quote
  #16  
Old 09-15-2008, 09:09 PM
vb_mp vb_mp is offline
 
Join Date: Feb 2008
Posts: 60
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yea I have tested it - it is currently working and functional on my forum ( link is above in the original post ). People are spreading the affiliate link around and commissions are being generated on subscription purchases.

The things to note - according to iDevAffiliate they will be releasing a new release that will enable deletion of commissions on payment reversal... currently when a payment is reversed (for example on a refund) you have to manually cancel the subscription in iDevAffiliate... this is not a vBulletin problem though, rather a iDevAffiliate deficiency.

The guys from iDevAffiliate have promised that this payment reversal curl target url will be released in new upgrade, once that's there I will add it to this mod.
Reply With Quote
  #17  
Old 09-15-2008, 09:29 PM
jasculs jasculs is offline
 
Join Date: Jun 2007
Posts: 217
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by vb_mp View Post
Yea I have tested it - it is currently working and functional on my forum ( link is above in the original post ). People are spreading the affiliate link around and commissions are being generated on subscription purchases.

The things to note - according to iDevAffiliate they will be releasing a new release that will enable deletion of commissions on payment reversal... currently when a payment is reversed (for example on a refund) you have to manually cancel the subscription in iDevAffiliate... this is not a vBulletin problem though, rather a iDevAffiliate deficiency.

The guys from iDevAffiliate have promised that this payment reversal curl target url will be released in new upgrade, once that's there I will add it to this mod.
Great Thank You!!...I just wanted to be sure before I purchased the software. I know it may be a little off topic, but how do you like the affiliate software?

Also if I have people on recurring billing can I have it work with recurring commissions?

Thanks a lot!!
Jason
Reply With Quote
  #18  
Old 09-15-2008, 09:50 PM
vb_mp vb_mp is offline
 
Join Date: Feb 2008
Posts: 60
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I like iDevAffiliate, easy to install, works well.

Paypal recurring commissions (I have them on my forum) are treated as individual payments each month - it works quite well.

User signs up - iDevAffiliate records payment information, affiliate gets commission. Next month, PayPal triggers IPN on recurring payment, idevaffiliate checks payment info and credits affiliate with another commission - and so on.

iDevAffiliate has some internal recurring commissions setup - make sure you ignore that - it's some manual recurring commissions crap.

Also, once you install iDevAffiliate, make sure you download this patch that fixes a bug of approving/unapproving commissions:
http://www.idevsupport.com/index.php...temid=16&nav=0

Cheers
Reply With Quote
  #19  
Old 09-16-2008, 12:50 AM
Quarterbore Quarterbore is offline
 
Join Date: Mar 2005
Location: Valley Forge PA
Posts: 538
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You listed some pros in your credits but I likewise really would prefer not install this until it is plugin based. I would rather add a couple queries on the occasion where I get a purchase then to have to risk that there is an upgrade out and I need to deal with hardcoded file edits.
Reply With Quote
  #20  
Old 09-16-2008, 10:57 AM
vb_mp vb_mp is offline
 
Join Date: Feb 2008
Posts: 60
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Quarterbore View Post
You listed some pros in your credits but I likewise really would prefer not install this until it is plugin based. I would rather add a couple queries on the occasion where I get a purchase then to have to risk that there is an upgrade out and I need to deal with hardcoded file edits.
That's totally cool with me. I posted this mod to allow the people that have been searching for a mod for this for ages to get it and use it.

I will however fix it to use hooks as soon as some hooks are made available by vBulletin.com
Reply With Quote
  #21  
Old 09-16-2008, 10:23 PM
mambomouth mambomouth is offline
 
Join Date: May 2005
Location: NYC/NJ
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have installed but have not recorded any sales.
Wait traffic site to send a sale .
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:14 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05291 seconds
  • Memory Usage 2,316KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (4)bbcode_code
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete