Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.7 > vBulletin 3.7 Add-ons

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
  #32  
Old 09-18-2008, 02:12 AM
mambomouth mambomouth is offline
 
Join Date: May 2005
Location: NYC/NJ
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok i'm jack A**.
I did not upload one the files I needed edited for the Mod to work.
Anyhow it should work now.

Correction Idevaffiliate does have a API key see there demo and see PDF manual
See link:>
http://demo.idevdirect.com/admin/idev_info.php


As for the hook questions?
I'm not sure but in the past looking for a solution I found in the Phrase Manager
that info needed is inside both Phrase emails etc.

See this link:
https://vborg.vbsupport.ru/showpost....88&postcount=4

I understand what the hook system does but it may help one of you.
Reply With Quote
  #33  
Old 09-22-2008, 05:06 PM
mambomouth mambomouth is offline
 
Join Date: May 2005
Location: NYC/NJ
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hello All,

Great after fixing own error by not uploading the edit files.
I everything is working well.

Now only a few things Idev lets you pass
:>Additional Order Details (optional pass-thru variables) via the >Alternate Cart Integration.
There are three Variables one can add to:

With I guess can be added to the
Code:
$idevQuery = "idev_saleamt=" . $apiobj->paymentinfo['amount'] . "&ip_address=" . $apiobj->paymentinfo['ipaddress'] . "&idev_ordernum=" . $apiobj->paymentinfo['paymentinfoid'];
Concatenating the optional variables that you have set in Idev-affiliate.
Code:
"&idev_custom1=" . $apiobj->paymentinfo['extra'];
also I noticed that variable for the order ID being passed is the table ID in a database. Not a transaction number or hash needed to look up the status of the order in the back end.
You cannot search this ID number in the back of Vbulletin administrator for transactions logs etc.

Also we should look into payment reversals.
To take away the commission in case of payment reversal.


Still this is fantastic progress.
Reply With Quote
  #34  
Old 09-22-2008, 08:01 PM
mambomouth mambomouth is offline
 
Join Date: May 2005
Location: NYC/NJ
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

As for the Hooks question?

In the includes/class_paid_subscription.php
which is called by both the payment_gateway.php and payments.php.

There are two hooks
1. "paidsub_build" which adds the user to a subscription group.
If paid this execute credit to Affiliate.

2. "paidsub_delete" which deletes the user a subscription group.
If revered this execute minus credit to Affiliate.

What do you guys think?
This way we would not to hand code mod's on updates.
Reply With Quote
  #35  
Old 09-23-2008, 11:11 AM
vb_mp vb_mp is offline
 
Join Date: Feb 2008
Posts: 60
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by mambomouth View Post
As for the Hooks question?

In the includes/class_paid_subscription.php
which is called by both the payment_gateway.php and payments.php.

There are two hooks
1. "paidsub_build" which adds the user to a subscription group.
If paid this execute credit to Affiliate.

2. "paidsub_delete" which deletes the user a subscription group.
If revered this execute minus credit to Affiliate.

What do you guys think?
This way we would not to hand code mod's on updates.
iDevAffiliate still doesn't handle reversed payments. They say it will be handled in the next upgrade.

As for the hooks - we mentioned in a couple of earlier posts - but we are not sure where to get the data from to process idev calls at present hook locations.

There is also still not a hook that can be used to insert IP address into paymentinfo only on first payment and not on recurring payments ... so payments.php would still need to be hand edited.
Reply With Quote
  #36  
Old 09-27-2008, 01:49 AM
WIHEE's Avatar
WIHEE WIHEE is offline
 
Join Date: Sep 2008
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have installed it without any problem and is working 100%

Thanks
Reply With Quote
  #37  
Old 09-27-2008, 08:18 AM
nibb nibb is offline
 
Join Date: May 2008
Posts: 34
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi everyone, im looking this for since I own Vbulletin. I have Idev for 3 years. Its great, it can be integrated with almost anything and Vbulletin was really missing.
My question is, is this really working? I mean like without bugs or errors, for a commercial site? Im even willing to pay for this mod. Also my current Idev install is already integrated with a shopping cart, i suppose it will no hurt to have it with vbulletin at the same time since all this mods seems to do is pass to idev when a payment is made. Is this correct?
Reply With Quote
  #38  
Old 10-11-2008, 11:54 PM
gwerzal's Avatar
gwerzal gwerzal is offline
 
Join Date: Oct 2007
Posts: 317
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Does idevaffiliate need to be installed on the same website for this to work
Reply With Quote
  #39  
Old 10-19-2008, 02:07 PM
vb_mp vb_mp is offline
 
Join Date: Feb 2008
Posts: 60
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nope, from the above curl call you have to specify the website and idevaffiliate directory where you notify of commissions:
http://www.YOURDOMAINNAME.com/YOURID...OLDER/sale.php
Reply With Quote
  #40  
Old 01-28-2009, 02:59 PM
RS25com RS25com is offline
 
Join Date: Dec 2001
Posts: 87
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Has anyone installed this on 3.8?
Reply With Quote
  #41  
Old 02-14-2009, 09:01 AM
fionix fionix is offline
 
Join Date: Apr 2007
Posts: 63
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes would be nice to know it works with 3.8.

Anyway I go and try to install it now and will post back here if my forum crashed
Reply With Quote
Reply

Thread Tools

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 04:15 AM.


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.07604 seconds
  • Memory Usage 2,312KB
  • 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
  • (6)bbcode_code
  • (1)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