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

Reply
 
Thread Tools
Gift Subscriptions Details »»
Gift Subscriptions
Version: 1.00, by jamoss jamoss is offline
Developer Last Online: Jan 2021 Show Printable Version Email this Page

Category: Miscellaneous Hacks - Version: 3.6.8 Rating:
Released: 12-24-2007 Last Update: 12-26-2007 Installs: 52
Uses Plugins Template Edits
Code Changes  
No support by the author.

Looks like there was a huge need for a gift subscription hack, so I created one, attached. It allows users to extend or purchase board subscriptions for other users.

This has been implemented and tested on our boards, but it is in EARLY ALPHA! Please provide me with feedback/questions after you implement it.

Should take about 15 minutes to complete.

1. Create 1 plugin
2. Modify 2 templates
3. modify 1 script (payments.php) -- PLEASE backup and save your old script for upgrade purposes.

Let me know how it goes!
~ Jennifer

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Благодарность от:
MikeJDance

Comments
  #22  
Old 03-18-2008, 07:31 PM
ringleader's Avatar
ringleader ringleader is offline
 
Join Date: Dec 2006
Location: Dublin, Ireland
Posts: 192
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I wouldn't have even noticed. And my members are dumb enough to do this.

Find in payments.php:

Instead of (as provided)

Code:
    //=== HACK: GIFT SUBSCRIPTIONS ===//
    if ($_POST['giftname']!=$vbulletin->userinfo['username']) {
	 $goo=$db->query_read_slave("SELECT userid from ". TABLE_PREFIX ."user where username='".$_POST['giftname']."'");
       while ($giftee = $db->fetch_array($goo)) 
		{ $subid=$giftee['userid']; }
    }
    else { 
    	$subid=$vbulletin->userinfo['userid']; 
    }
    //=== HACK: GIFT SUBSCRIPTIONS ===//
Use this code that checks the member name and includes an error message

("Invalid recipient username. Please press the back button, enter the correct username and try again. <u>Click Here to See the Members List</u>"):

Code:
    //=== HACK: GIFT SUBSCRIPTIONS ===//
	if ($_POST['giftname'] != $vbulletin->userinfo['username']) 
	{
		$goo=$db->query_read_slave("SELECT userid from ". TABLE_PREFIX ."user where username='".$_POST['giftname']."'");

		if ($giftee = $db->fetch_array($goo)) 
		{ 
			$subid = $giftee['userid']; 
		}	
		else
		{
			eval(standard_error(fetch_error('pminvalidrecipient')));		
		}
	}
	else 
	{ 
    		$subid = $vbulletin->userinfo['userid']; 
	}
    //=== HACK: GIFT SUBSCRIPTIONS ===//
Reply With Quote
  #23  
Old 04-05-2008, 06:51 PM
Terrie's Avatar
Terrie Terrie is offline
 
Join Date: Jan 2008
Posts: 24
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I notice after upgrading to 3.6.9 the upgrade gets added to the person
buying the gift subscription as opposed to the person who should be
receiving the gift.
Reply With Quote
  #24  
Old 04-05-2008, 08:32 PM
Terrie's Avatar
Terrie Terrie is offline
 
Join Date: Jan 2008
Posts: 24
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Woops... Nevermind it seems payments.php got overwritten during the upgrade.
I had to reinsert the hacks back in.
Reply With Quote
  #25  
Old 04-09-2008, 07:29 PM
cookiepants cookiepants is offline
 
Join Date: Jul 2006
Location: Nor Cal
Posts: 118
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Okay, total newbie question, but how do I create a plug in for this?
Reply With Quote
  #26  
Old 04-09-2008, 07:29 PM
cookiepants cookiepants is offline
 
Join Date: Jul 2006
Location: Nor Cal
Posts: 118
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

oh never mind -- it's in the Plug in section of the Admin area.
Reply With Quote
  #27  
Old 04-28-2008, 01:56 AM
Terrie's Avatar
Terrie Terrie is offline
 
Join Date: Jan 2008
Posts: 24
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

In case anyone was wondering this hack works great in 3.7 RC4 :up:
Reply With Quote
  #28  
Old 11-27-2008, 09:19 PM
DieselMinded's Avatar
DieselMinded DieselMinded is offline
 
Join Date: Mar 2007
Posts: 1,655
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Diesel this work on 3.7.4 ?
Reply With Quote
  #29  
Old 07-03-2009, 04:27 AM
CSS59 CSS59 is offline
 
Join Date: Oct 2004
Posts: 275
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

3.8.3?
Reply With Quote
  #30  
Old 08-12-2009, 03:46 PM
Avimelech Avimelech is offline
 
Join Date: Jul 2006
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I tried inserting this into the brand new 3.8.4 and got an error message when I tried to execute a paid subscription, saying:

Database error in vBulletin 3.8.4:

Invalid SQL:

INSERT INTO paymentinfo
(hash, completed, subscriptionid, subscriptionsubid, userid)
VALUES
('0d336f6ad3eff6f2f898922e6eaeec2b', 0, 1, 1, );

MySQL Error : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 4
Error Number : 1064
Request Date : Wednesday, August 12th 2009 @ 12:33:06 PM
Error Date : Wednesday, August 12th 2009 @ 12:33:06 PM
Script : http://forums.escapeallthesethings.c...s.php?do=order
Referrer : http://forums.escapeallthesethings.com/payments.php
IP Address : 190.241.15.100
Classname : vB_Database
MySQL Version : 5.0.67-log

I am attaching my payments.php in case anyone can see if I did it wrong
Reply With Quote
  #31  
Old 08-12-2009, 03:56 PM
Shamil. Shamil. is offline
 
Join Date: Sep 2008
Posts: 196
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Avimelech View Post
I tried inserting this into the brand new 3.8.4 and got an error message when I tried to execute a paid subscription, saying:

Database error in vBulletin 3.8.4:

Invalid SQL:

INSERT INTO paymentinfo
(hash, completed, subscriptionid, subscriptionsubid, userid)
VALUES
('0d336f6ad3eff6f2f898922e6eaeec2b', 0, 1, 1, );

MySQL Error : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 4
Error Number : 1064
Request Date : Wednesday, August 12th 2009 @ 12:33:06 PM
Error Date : Wednesday, August 12th 2009 @ 12:33:06 PM
Script : http://forums.escapeallthesethings.c...s.php?do=order
Referrer : http://forums.escapeallthesethings.com/payments.php
IP Address : 190.241.15.100
Classname : vB_Database
MySQL Version : 5.0.67-log

I am attaching my payments.php in case anyone can see if I did it wrong
In that SQL, there userid is missing. This plugin was built for 3.6, you're on 3.8, I'd imagine that something has changed between the versions.
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 01:20 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.13678 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
  • (2)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
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (1)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • 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