Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 03-28-2005, 01:15 PM
rh2004 rh2004 is offline
 
Join Date: Nov 2004
Posts: 154
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default functions_subscriptions.php error

Hi, when I tried to add a user in subscriptions earlier I received

Fatal error: Unsupported operand types in /home/user/public_html/forum/includes/functions_subscriptions.php on line 50


Don't know whats causing it I have only added paypal reacuring


This is around line 50, anyone see the problem



PHP Code:
// ###################### Start getsubscriptionscache #######################
function cache_user_subscriptions()
{
    global 
$DB_site$subscriptioncache;

    if (!
is_array($subscriptioncache))
    {
        
$subscriptioncache = array();
        
$subscriptions $DB_site->query("SELECT * FROM " TABLE_PREFIX "subscription");
        while (
$subscription $DB_site->fetch_array($subscriptions))
        {
            
$subscriptioncache["$subscription[subscriptionid]"] = $subscription;
        }
        
$DB_site->free_result($subscriptions);
    }
}

function 
construct_payment($method$cost$currency$subscriptionid$title$userid)
{
    global 
$vboptions,$DB_site;

    
$item $subscriptionid '_' $userinfo['userid'];
    
$currency strtoupper($currency);

    switch (
$method)
    {
        case 
'paypal':
        
$form['action'] = 'https://www.paypal.com/cgi-bin/webscr';
        
$form['method'] = 'post';
        
/// Add In For Reacuring Payments
        
$paypalextra $DB_site->query_first("SELECT * FROM " TABLE_PREFIX "subscription AS subscription WHERE subscriptionid=$subscriptionid");
        if(
$paypalextra[reoccur]==0){// It is one time
        
$form['hiddenfields'] = "
            <input type=\"hidden\" name=\"cmd\" value=\"_xclick\" />
            <input type=\"hidden\" name=\"business\" value=\"
$vboptions[ppemail]\" />
            <input type=\"hidden\" name=\"item_name\" value=\"
$title Subscription\" />
            <input type=\"hidden\" name=\"item_number\" value=\"
$item\" />
            <input type=\"hidden\" name=\"amount\" value=\"
$cost\" />
            <input type=\"hidden\" name=\"currency_code\" value=\"
$currency\" />
            <input type=\"hidden\" name=\"no_shipping\" value=\"1\" />
            <input type=\"hidden\" name=\"return\" value=\"
$vboptions[bburl]\" />
            <input type=\"hidden\" name=\"no_note\" value=\"1\" />"
;
        }else{
        
$form['hiddenfields'] = "
            <input type=\"hidden\" name=\"cmd\" value=\"_xclick-subscriptions\" />
            <input type=\"hidden\" name=\"business\" value=\"
$vboptions[ppemail]\" />
            <input type=\"hidden\" name=\"item_name\" value=\"
$title Subscription\" />
            <input type=\"hidden\" name=\"item_number\" value=\"
$item\" />
            <input type=\"hidden\" name=\"currency_code\" value=\"
$currency\" />
            <input type=\"hidden\" name=\"ammount\" value=\"
$cost\" />
            <input type=\"hidden\" name=\"a3\" value=\"
$cost\" />
            <input type=\"hidden\" name=\"p3\" value=\"
$paypalextra[length]\">
            <input type=\"hidden\" name=\"t3\" value=\"
$paypalextra[units]\">
            <input type=\"hidden\" name=\"src\" value=\"1\">
            <input type=\"hidden\" name=\"sra\" value=\"1\">
            <input type=\"hidden\" name=\"no_shipping\" value=\"1\" />
            <input type=\"hidden\" name=\"return\" value=\"
$vboptions[bburl]\" />
            <input type=\"hidden\" name=\"no_note\" value=\"1\" />"
;
    
        }
            break;
        case 
'nochex':
        
$form['action'] = 'https://www.nochex.com/nochex.dll/checkout';
        
$form['method'] = 'post';
        
$form['hiddenfields'] = "
            <input type=\"hidden\" name=\"email\" value=\"
$vboptions[ncxemail]\" />
            <input type=\"hidden\" name=\"amount\" value=\"
$cost\" />
            <input type=\"hidden\" name=\"ordernumber\" value=\"
$item\" />
            <input type=\"hidden\" name=\"returnurl\" value=\"
$vboptions[bburl]\" />";
            break;
        case 
'authorize':
            
$form construct_authorize_form($cost$item$currency);
            break;
        case 
'worldpay':
        
$form['action'] = 'https://select.worldpay.com/wcc/purchase';
        
$form['method'] = 'post';
        
$form['hiddenfields'] = "
            <input type=\"hidden\" name=\"desc\" value=\"
$item\" />
            <input type=\"hidden\" name=\"cost\" value=\"
$cost\" />
            <input type=\"hidden\" name=\"currency\" value=\"
$currency\" />
            <input type=\"hidden\" name=\"instId\" value=\"
$vboptions[worldpay_instid]\">
            <input type=\"hidden\" name=\"cartId\" value=\"
$title Subscription\">";
            break;
    }
    return 
$form;
}

function 
construct_subscription_currency($method$currency$cost$sub)
{
    global 
$_SUBSCRIPTIONS$_CURRENCYSYMBOLS$bbuserinfo;
    
$currencies $_SUBSCRIPTIONS['curencies']["$method"]; 
OK, I have changed the file back to the original and it still gives the error:

Fatal error: Unsupported operand types in /home/user/public_html/forum/includes/functions_subscriptions.php on line 50


What is causing that error if its not that file

This file seems to be the problem:

admincp/subscriptions.php



PHP Code:
// ###################### Start status #######################
if ($_POST['do'] == 'status')
{
    
globalize($_POST, array('subscriptionlogid' => INT'subscriptionid' => INT'userid' => INT'status' => INT'regdate''expirydate''username' => STR_NOHTML));

    require_once(
'./includes/functions_misc.php');
    
//$regdate = vbmktime(intval($regdate['hour']), intval($regdate['minute']), 0, intval($regdate['month']), intval($regdate['day']), intval($regdate['year']));
    
$expirydate vbmktime(intval($expirydate['hour']), intval($expirydate['minute']), 0intval($expirydate['month']), intval($expirydate['day']), intval($expirydate['year']));

    if (
$expirydate 0)
    {
        
print_stop_message('invalid_subscription_length');
    }
    if (
$userid)
    { 
// already existing entry
        
if (!$status)
        {
            
$DB_site->query("
                UPDATE " 
TABLE_PREFIX "subscriptionlog
                SET regdate = 
$regdate, expirydate = $expirydate
                WHERE userid = 
$userid
                    AND subscriptionid = 
$subscriptionid
            "
);
            
delete_user_subscription($subscriptionid$userid);
        }
        else
        {
            
build_user_subscription($subscriptionid$userid$regdate$expirydate);
        }
    }
    else
    {
        
$userinfo $DB_site->query_first("
            SELECT userid
            FROM " 
TABLE_PREFIX "user
            WHERE username = '" 
addslashes($username) . "'
        "
);

        if (!
$userinfo['userid'])
        {
            
print_stop_message('no_users_matched_your_query');
        }

        
build_user_subscription($subscriptionid$userinfo['userid'], $regdate$expirydate);

    }

    
define('CP_REDIRECT'"subscriptions.php?do=find&subscriptionid=$subscriptionid");
    
print_stop_message('saved_subscription_x_successfully'$sub['title']);
}

// ###################### Start status ####################### 

Around the above area can anyone see anything wrong

OK, fixed I have kept this line:

print_label_row($vbphrase['start_date'], '<span>' . vbdate($vboptions['dateformat'] . ' ' . $vboptions['timeformat'], $sub['regdate']) . '</span>');


and not merged this one over the top


print_time_row($vbphrase['start_date'], 'regdate', $sub['regdate']);
Reply With Quote
 


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 12:01 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.03362 seconds
  • Memory Usage 2,414KB
  • Queries Executed 13 (?)
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_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)showthread_list
  • (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_threadedmode.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_threaded
  • showthread_threaded_construct_link
  • 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
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete