vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   functions_subscriptions.php error (https://vborg.vbsupport.ru/showthread.php?t=78947)

rh2004 03-28-2005 01:15 PM

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']);


All times are GMT. The time now is 12:29 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.00984 seconds
  • Memory Usage 1,776KB
  • 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_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (1)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