vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Miscellaneous Hacks - Gift Subscriptions (https://vborg.vbsupport.ru/showthread.php?t=166121)

ringleader 03-18-2008 07:31 PM

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 ===//


Terrie 04-05-2008 06:51 PM

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.

Terrie 04-05-2008 08:32 PM

Woops... Nevermind it seems payments.php got overwritten during the upgrade. :rolleyes:
I had to reinsert the hacks back in. :D

cookiepants 04-09-2008 07:29 PM

Okay, total newbie question, but how do I create a plug in for this?

cookiepants 04-09-2008 07:29 PM

oh never mind -- it's in the Plug in section of the Admin area.

Terrie 04-28-2008 01:56 AM

In case anyone was wondering this hack works great in 3.7 RC4 :up:

DieselMinded 11-27-2008 09:19 PM

Diesel this work on 3.7.4 ?

CSS59 07-03-2009 04:27 AM

3.8.3?

Avimelech 08-12-2009 03:46 PM

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

Shamil. 08-12-2009 03:56 PM

Quote:

Originally Posted by Avimelech (Post 1865941)
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.


All times are GMT. The time now is 03:41 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.01152 seconds
  • Memory Usage 1,741KB
  • 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_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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