vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Graveyard (https://vborg.vbsupport.ru/forumdisplay.php?f=224)
-   -   Pig's Subscription Gift (https://vborg.vbsupport.ru/showthread.php?t=105553)

boozehound 01-16-2006 10:00 PM

Pig's Subscription Gift
 
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:
    Code:

    <if condition="$show['activesubscriptions']">
    Insert before that, this code:
    Code:

    $giftbits
    Find:
    Code:

    <input type="hidden" name="do" value="order" />
    Insert after that, this code:
    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:
    Code:

            <td class="vbmenu_control">
                    <if condition="$show['addbuddylist']">

    Add before that, this code:
    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

Quote:

Originally Posted by bashy
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...
Code:

($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....

Code:

//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_byte)/1024),2);
$pagesaved_perc=number_format(((100*$pagesaved_byte)/$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:
Code:

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.

TRR 05-22-2006 10:24 PM

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...

TRR 05-24-2006 02:07 AM

Replying to my own post:

Fixed (I think)
Changed
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>

to:

Code:

<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

Quote:

Originally Posted by theChronic
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

Quote:

Originally Posted by LanciaStratos
Anyone running this on 3.6.0? I could really use this mod. :)

same.

dsotmoon 09-12-2006 10:02 PM

Quote:

Originally Posted by LanciaStratos
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.


All times are GMT. The time now is 06:46 AM.

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.01264 seconds
  • Memory Usage 1,818KB
  • 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
  • (11)bbcode_code_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete