Thread: Miscellaneous Hacks - vBulletin and iDevAffiliate Integration
View Single Post
  #23  
Old 09-17-2008, 01:53 AM
Quarterbore Quarterbore is offline
 
Join Date: Mar 2005
Location: Valley Forge PA
Posts: 538
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK, I am looking at the code and I do not have an iDevAffilaite package (yet) so I need to guess a little what is going on here so bear with me as I try to summarize what this is doing.

Step 1: payments.php simply adds the IP address of the person who has purchased the subscription.

Comment: It really is too bad vBulletin doesn't have a hook right after the code you quote as we could simply run an update where "hash" = $hash. The hook that is in the while loop could be used however if we added a variable for example:

paidsub_order_paymentbit Plugin:

PHP Code:
if($vbulletin->options['idevaffiliate_active'] AND $ipsaved != '1'){
$escapedhash $db->escape_string($hash);

      
$vbulletin->db->query_write("UPDATE " TABLE_PREFIX "paymentinfo
      SET ipaddress = " 
IPADDRESS "
      WHERE hash = " 
$escapedhash "
      "
);
     
$ipsaved '1';

Question - Is this IP information important and required (remember I don't use the script)? I ask as with vBulletin we know more about a user then just the IP they used to pay including registration IP, all IPs they used, plus e-mail, etc. Again, I have not used the affiliate script so just curious why this matters as we know who the user is and that is the most important matter for us.

Step 2: payment_gateway.php saves the sale in the affiliate script

This is really an amazing file in vBulletin as there is not a single hook in this file There is no way around a file edit in this file but I am not convinced we have to use the file to do this. I say this as we do have hooks in class file that does subscriptions:

./includes/class_paid_subscription.php

I am curious why we can't use the paidsub_build hook to log the sale into the affiliate script? There could also be a plugin added to paidsub_delete to handle reversals too (I think).

Summary:

I am really not trying to be critical as I am very thankful you shared your work as I have been considering adding an affiliate script to my own premium site. I am really not going to be able to test this without buying the software but I think that if you look at the possibility of moving the STEP 2 of this to the Class that you may be able to remove the file edits.

Also, as I said above, I don't see the value in the "Step 1" addition as vBulletin allows us to know a whole lot about our users that are far above the IP they are using when they pay for a subscription

I welcome feedback on my humble oppinions as I know there are developers and coders on here with far more skill then I have.

Cheers,
Ken
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01173 seconds
  • Memory Usage 1,782KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • 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
  • showpost_complete