View Full Version : Pig's Subscription Gift
boozehound
01-16-2006, 10:00 PM
Description
Allows users to pay for a paid subscription for another user.
Five plugins
One new template
Three new phrases
Three template edits
Installation
Install the product XML through the product manager.
Edit template 'subscription' in 'Paid Subscriptions Templates'.
Find:
<if condition="$show['activesubscriptions']">
Insert before that, this code:
$giftbits
Find:
<input type="hidden" name="do" value="order" />
Insert after that, this code:
<if condition="$giftuser != null">
<input type="hidden" name="gift" value="$giftuser[userid]" />
</if>
This step may be altered according to taste. I chose to insert the link that userA would click to pay for userB into userB's profile, i.e. MEMBERINFO, but it could just as easily be put in 'postbit'. Anyway...
Edit template 'MEMBERINFO' in 'Member Info Templates'.
Find:
<td class="vbmenu_control">
<if condition="$show['addbuddylist']">
Add before that, this code:
<td class="vbmenu_control">
<a href="payments.php?$session[sessionurl]gift=true&userid=$userinfo[userid]"><phrase 1="$userinfo[username]">$vbphrase[buy_x_a_sub]</phrase></a>
</td>
And you're done.
Notes
Active subscriptions are never shown on the paid subscriptions page, either for the donor or the recipient, when visiting the paid subscriptions page through the gift subscription link.
The identity of the donor is not revealed to the recipient. An admin will have to check out the payment info if the recipient wants to know who gave them the subscription.
Screenshots
screen1.png: Member profile page containing link to subscription gift page
screen2.png: Subscription page showing that the user is about to pay for someone else
Skyline_GT
01-17-2006, 06:05 AM
this mod looks cool..
thanks.,
FleaBag
01-17-2006, 10:52 AM
Yeah definitely very nice! Thanks. :D
nexialys
01-17-2006, 11:05 AM
really, i can't imagine to live without it now that it exists... lol
damn this is a good idea for a sharing community!
Princeton
01-17-2006, 11:57 AM
Superb idea!!
chader144
01-17-2006, 01:51 PM
very nice mod.. any chance we can get it in a plugin? (very lazy admin here)
ConqSoft
01-17-2006, 02:00 PM
Umm. It is a plugin. Plugins can't modify templates though, so manual template changes are always going to be required.
Snake
01-17-2006, 03:19 PM
Awesome. I'll probably install this tonight! ;)
Reeve of shinra
01-17-2006, 03:24 PM
Great idea!
bashy
01-17-2006, 05:42 PM
Hi
I have installed and clicked install...
I get this error now when i got my donations page????
Warning: Division by zero in /includes/functions.php(4320) : eval()'d code on line 10
Any ideas please?
boozehound
01-17-2006, 05:52 PM
Hi
I have installed and clicked install...
I get this error now when i got my donations page????
Warning: Division by zero in /includes/functions.php(4320) : eval()'d code on line 10
Any ideas please?
Hmm line 4320 says...
($hook = vBulletinHook::fetch_hook('global_complete')) ? eval($hook) : false;
... so what code is in your global_complete hooks?
bashy
01-17-2006, 06:11 PM
Hi...
the only 1 that is enabled is the Realtime Template Compressor
and this is the code for it, the other 2 are disabled so i have not mentioned them....
//Logician Hack:
$page_byte=strlen($output);
$output=preg_replace ('/\r\n(\s*)/', "\r\n", $output);
$pagenew_byte=strlen($output);
$page_kilobyte=number_format(($page_byte/1024),2);
$pagenew_kilobyte=number_format(($pagenew_byte/1024),2);
$pagesaved_byte=$page_byte-$pagenew_byte;
$pagesaved_kilobyte=number_format((($pagesaved_byt e)/1024),2);
$pagesaved_perc=number_format(((100*$pagesaved_byt e)/$page_byte),2);
$output = str_replace('</body>', '<center><span class="smallfont">[Output: ' . $page_kilobyte . ' Kb. compressed to <b>' . $pagenew_kilobyte . '</b> Kb. by saving <b>' . $pagesaved_kilobyte . '</b> Kb. (' . $pagesaved_perc . '%)]</span></center></body>', $output);
//Logician Hack:
bashy
01-17-2006, 06:13 PM
I have just disabled this compressor and i dont get the error any more, although my donations page still does not show..... :(
boozehound
01-17-2006, 06:14 PM
Does this error go away when you disable or uninstall my product?
bashy
01-17-2006, 06:23 PM
I think i have resolved it, I had upgraded VB earlier last week and i need to redo a few things :(
bashy
01-17-2006, 06:42 PM
Sorry about that m8, I panicked thinking it was when i installed you hack as i had not checked the donations page latley and once i had installed yours i then checked the page and obviously it was not working as i had upgraded VB, hence i assumed it was your hack....
My oplogies m8...Yours is installed and working well...
Great hack, keep up the good work..
Sorry again for the false alarm :o
bigmonay2k
03-05-2006, 01:21 AM
great hack, will it work for 3.5.1?
Josh1
03-05-2006, 03:52 AM
Will this work in 3.5.4?
Erwin
03-08-2006, 08:09 PM
Is this working for people with 3.5.4 as it is? My members when they use this seem to get the subscription go back to their own accounts.
dsotmoon
03-08-2006, 08:56 PM
i'd like add this too if its 3.5.4 ready ? ? ?
Erwin
03-09-2006, 01:03 AM
Okay, I got this working with 3.5.4. Install the hack as it is, but make sure you do this:
DISABLE this plugin:
Hook Location : paidsub_order_paymentbit
Pig's Subscription Gift (4)
If you don't, the donation will still go to the donating member, not the other member. To be honest, I'm not sure why it's there in the first place as it removes the effect of the previous code.
yayvb
03-13-2006, 05:20 PM
Thanks for the fix, I just installed and didn't have to experience that. :)
Is there a certain if statement that we could surroud the memberinfo code to only show if the profile isn't already a subscriber? In other words if they are paying no need to have this link, but I'm not sure how.
yayvb
03-16-2006, 08:58 PM
After installing this hack, I click on the link provided in a profile and I'm brought to where you select which subscription to buy. I select the one I want, hit submit, and it reloads the subscription page but with this error on the top:
Warning: Invalid argument supplied for foreach() in /includes/functions_user.php on line 50
If I try to buy a subscription by not going through the 'buy this person a subscription' link, then I don't get that error message and it appears to work correctly.
My script has been customized by an external coder so I was thinking that is what caused the error. However when I view an original file I see that not much in that file has changed and line 50 is the same either way.
This is line#50 on either:
foreach ($vbulletin->userinfo['forumpermissions'] AS $forumid => $perm)
Anyone have any idea what's causing this?
The only thing that I've done is what Erwin recommended above by disabling that particular plugin that he specified. I've done nothing else.
yayvb
03-16-2006, 09:03 PM
Ok, I just for the hell of it re-enabled the plugin that Erwin said to disable and the error message went away. :) Now I'm wondering though, Erwin said the subscription goes to the buyer not the person it's intended for. I guess I could setup a paypal developer account and test this out but I haven't looked into that yet. :( haha
Has anyone else experienced the problem that Erwin was having? I am running 3.5.4 as well, but like I said re-enabling the plugin that Erwin said to disable got rid of the above error message.
yayvb
03-23-2006, 12:28 AM
Ok I can't seem to test this out because I can't send my own paypal account money. Does this work for recurring, in other words if I want to pay for someone elses subscription and I choose a recurring one then my paypal account will be the one billed each month but each month the other person will get the credit right? Any more info on what Erwin was saying?
flfooty tv
03-23-2006, 09:39 AM
awsome mod! love it
tei727
03-24-2006, 05:10 PM
Can anyone show this noob how to put this in postbit legacy? :)
yayvb
03-26-2006, 05:28 AM
btw this is such a cool hack. :) I am nervous since Erwin said to disable a plugin and doing so caused an error message. I am going to just trust the lack of problems reported and see what happens. Thanks again.
Shaliza
05-16-2006, 08:40 AM
Seems like this is another abandoned hack.
I can't get it to work in postbit. It drops the userID:
"invalid userID specified"
When I disable the plugin, it follows the link to paid subscriptions, but I don't think that it is paying for another user...
Replying to my own post:
Fixed (I think)
Changed
<td class="vbmenu_control">
<a href="payments.php?$session[sessionurl]gift=true&userid=$userinfo[userid]"><phrase 1="$userinfo[username]">$vbphrase[buy_x_a_sub]</phrase></a>
</td>
to:
<td class="vbmenu_control">
<a href="payments.php?$session[sessionurl]gift=true&userid=$post[userid]"><phrase 1="$userinfo[username]">$vbphrase[buy_x_a_sub]</phrase></a>
</td>
The string "userinfo[userid]" wasn't working so I changed it to "post[userid]"
I need to get one of my users to gift another one to test it.
gigolo_ant
05-25-2006, 07:01 AM
The available subscriptions does not show up. Any thoughts? I'm running 3.5.4
Shaliza
05-27-2006, 09:14 AM
It looks like it was abandoned.
Mysticales
07-15-2006, 07:18 PM
Any 3.0x version of this able? We havent had a chance to upgrade yet.
theChronic
07-18-2006, 09:07 AM
In what case do people use this? Never knew people would pay for someone elses' subscription?
Very curious
Mysticales
07-24-2006, 03:46 AM
In what case do people use this? Never knew people would pay for someone elses' subscription?
Very curious
Say like on our forums. http://forums.qj.net its LARGE, dedicated, mostly PSP users.
Needless to say.. "Kids" under 18. The option to buy someone else a 3$ gift.. is nothing to the 18+ users if they like the person.. thus being able to buy a membership for someone else helps. =)
LanciaStratos
08-14-2006, 07:14 PM
Anyone running this on 3.6.0? I could really use this mod. :)
---MAD---
08-14-2006, 09:29 PM
Anyone running this on 3.6.0? I could really use this mod. :)
same.
dsotmoon
09-12-2006, 10:02 PM
Anyone running this on 3.6.0? I could really use this mod. :)
ditto
Exitilus
09-14-2006, 12:07 AM
Yup. I'm running it on 3.6.0 and having no problems.
VbStudent1
10-25-2006, 04:04 AM
Just installed this on 3.6.2. No problems, everything seems fine. Nice Job.
CSS59
12-26-2006, 05:05 PM
anyone running it on 3.6.4?
We're running it on 3.6.4 All is fine. :)
Caerydd
01-01-2007, 12:29 PM
I'm trying this out too, hoping someone will pick it up and maintain long term though ^^ I can't believe this isn't standard in vB.
Caerydd
01-02-2007, 12:46 PM
Installed and running fine on 3.6.4, and confirmed to work by our users.
Mysticales
01-27-2007, 04:26 AM
Hey side question.. is there a way to ENSURE that gift subscriptions do not "Auto Renew"? I mean I know I could make a new set of options.... however that would allow everyone to select a subscription that doesnt auto renew. I just want it to ensure users who buy a gift sub do not get auto renewed for giving a gift. Is there a way to check for that and have forums tell paypal not to setup auto renews for gift sub purchases without setting up or disabling auto renew on vb admincp paid subscription settings?
mandy71480
01-28-2007, 11:47 AM
When I told my members our board was going paid they screamed for this feature! It installed beautifully and seems to be working fine! Thank you so much! :up:
Merriweather
02-02-2007, 11:28 PM
Easy install, works perfectly. This is excellent! Thank you.
Endurer
05-05-2007, 06:06 PM
Where are the files?
Endurer
05-08-2007, 07:22 PM
Sorry but where is the XML file?
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.