vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=246)
-   -   Add-On Releases - Gift Subscriptions (https://vborg.vbsupport.ru/showthread.php?t=237351)

MrWizard 03-02-2010 10:00 PM

Gift Subscriptions
 
1 Attachment(s)
This is a mod to let users buy a paid subscription for other members on the board. This addon is just updated from the user Jamoss. All credit goes to her, my team of people just updated it to work in 4.0.2.

Thanks zachd.

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

Avimelech 03-04-2010 04:22 PM

Thanks for posting this update. I applied this change for 3.x and enjoyed it.

When I followed the instructions for this one, it is not complete here. On the final confirmation page for PayPal I get a blank User field as below in the table you have added the User column to (nice touch):

Subscription Duration Cost User
Basic Membership 6 Months US$20.00 [nothing]

What does this point to as missing?

Update: (Note that the page before, the new field labeled (for a gift sub, enter recipient's username) is filled in with my ID by default)

Update2: I think the problem is that in the code you gave in the txt file subscription_user is displayed but never set. It does not exist anywhere in VB4 templates either (judging from no search results). Did you mean to use some other variable there?

Avimelech 03-04-2010 05:11 PM

I fixed it. You forgot to register with the page_templater as follows:

AFTER
$page_templater->register('subscription_title', $subscription_title);

INSERT
$page_templater->register('subscription_user', $recipientname);

Happy gift subscribing to all.

MrWizard 03-04-2010 06:47 PM

You are 100% right. We had made the change, but forgot to document it.

Thanks for the headsup.

Updated.

Avimelech 03-04-2010 09:43 PM

Glad to help. By any chance have you taken a look at this one and updated it? That's the other on vb4 ruined for me.

http://www.vbulletin.com/forum/showt...or-New-Members

sburns1992 03-18-2010 06:59 PM

Will this work with 3.8.5? I really love the idea of this, and want to apply it to my 3.8.5 board. Thanks.

Bouncer222 06-19-2010 11:24 PM

I am about to apply this to our forums, but I have some questions/suggestions first.

1. Could you make it so that when someone purchases a subscription for a friend, that friend gets notified by PM AND EMAIL? (Make an option, either one or both)

2. Friend gets notified as well when the payee (or person who subscribed for him) cancels. Again, email, PM , or both.

Also my question is, if I subscribe for someone else, does that mean that I get added to the additional usergroup lets say "premium gamer" and my friend who i subscribed for gets added to the same usergroup? Or does it recognize that i subscribed for someone else and ONLY adds my friend to that group?

I wouldn't want both people to get added to that same usergroup.

And as a feature, for the person who's being nice and subscribing for someone else, could you make it so that they get put in a lets say... "nice supporter" usergroup while the friend gets put in the original usergroup intended to "premium gamer" ?

Thanks.

COL NIL SATIS 06-20-2010 05:17 PM

tagged

Dragonsys 07-29-2010 05:45 PM

Quote:

Originally Posted by sburns1992 (Post 2005992)
Will this work with 3.8.5? I really love the idea of this, and want to apply it to my 3.8.5 board. Thanks.

try this one for 3.x
https://vborg.vbsupport.ru/showthread.php?t=166121

Avian321 08-04-2010 05:06 PM

Marked as installed bro. ;)

ZERO <ibis> 11-26-2010 08:52 PM

What would I need to edit to support usernames with <> for example?

I think that htmlspecialchars() needs to be in here somewhere but I do not know where it needs to go.

Note that by adding in htmlspecialchars() it should also reduce the odds that this script can be exploited.

Fixed:

Replace:
$goo=$db->query_read_slave("SELECT userid from ". TABLE_PREFIX ."user where username='".$_POST['giftname']."'");

With:
$sqlname = htmlspecialchars($_POST['giftname']);
$goo=$db->query_read_slave("SELECT userid from ". TABLE_PREFIX ."user where username='".$sqlname."'");

Kyoshokid 12-12-2010 12:13 PM

Quote:

Originally Posted by ZERO <ibis> (Post 2126104)
What would I need to edit to support usernames with <> for example?

I think that htmlspecialchars() needs to be in here somewhere but I do not know where it needs to go.

Note that by adding in htmlspecialchars() it should also reduce the odds that this script can be exploited.

Fixed:

Replace:
$goo=$db->query_read_slave("SELECT userid from ". TABLE_PREFIX ."user where username='".$_POST['giftname']."'");

With:
$sqlname = htmlspecialchars($_POST['giftname']);
$goo=$db->query_read_slave("SELECT userid from ". TABLE_PREFIX ."user where username='".$sqlname."'");


@op I just wanted to say thanks for this, my users are very happy with this mod.

@Zero this helped as i have a lot of users with weird names.

Working on vb4.1.0

ZERO <ibis> 02-19-2011 08:44 PM

1 Attachment(s)
As I now actually use vb 4 (previously I was using vb3 despite posting how to fix the error) I wanted to post a fully patched version for people to use as a base install so they do not have problems. I use this exact file myself for instructions and if it stops working for me I will post back here with an update if I manage to fix it myself.

DM BoNeZ 04-22-2012 05:24 AM

this mod is great but i tested if there is a way to choose what usergroup cant get gifted becuase i dont want any staff to get gifted the subscribed usergroup so i will have to remove it.. till there is a better gifting mod

djfoxx 05-26-2012 12:54 AM

Dosen't seem to work on v4.2

Lilmikeishere 11-22-2012 08:21 PM

Any fixes for this?

Bluefin221 03-12-2014 09:25 PM

payments.php does not exist or I cannot find it, where else should that segment of code go?

ZERO <ibis> 08-14-2014 04:45 PM

It does exist and is in the root directory for your vbb install. Also I am not sure if the one posted by the OP works or not but the one that I linked a few years back still works fine even on the latest version.

tanzeelniazi 06-30-2015 04:27 PM

its working in vb 4.2.0 or not ?
if use this mod then members paying subs like as gift ?


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

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01125 seconds
  • Memory Usage 1,754KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (19)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete