Version 2.2.0 RC-1
This commit is contained in:
1 parent
f73f8bff6d
commit
22f1b963ee
1034 files changed
+178610
-70897
No files matched your search
@@ -1,24 +1,14 @@
|
||||
<?php
|
||||
/*
|
||||
+--------------------------------------------------------------------------
|
||||
| Invision Power Board 2.1.7
|
||||
| =============================================
|
||||
| Invision Power Board
|
||||
| ========================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2001 - 2005 Invision Power Services, Inc.
|
||||
| (c) 2001 - 2005 Invision Power Services
|
||||
| http://www.invisionpower.com
|
||||
| =============================================
|
||||
| ========================================
|
||||
| Web: http://www.invisionboard.com
|
||||
| http://www.ibresource.ru/products/invisionpowerboard/
|
||||
| Time: Tuesday 18th of July 2006 05:56:00 PM
|
||||
| Release: 52f408a29988b02f45b5e6f4ba5af0ae
|
||||
| Licence Info: http://www.invisionboard.com/?license
|
||||
| http://www.ibresource.ru/license
|
||||
+---------------------------------------------------------------------------
|
||||
| INVISION POWER BOARD IS NOT FREE / OPEN SOURCE!
|
||||
+---------------------------------------------------------------------------
|
||||
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
|
||||
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
|
||||
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
|
||||
| Email: matt@invisionpower.com
|
||||
+---------------------------------------------------------------------------
|
||||
| INVISION POWER BOARD IS NOT FREE SOFTWARE!
|
||||
| http://www.invisionboard.com/?license
|
||||
@@ -152,7 +142,7 @@ class paysubscriptions
|
||||
|
||||
$this->output .= $this->ipsclass->compiled_templates['skin_ucp']->CP_end();
|
||||
|
||||
$this->output .= $this->ipsclass->compiled_templates['skin_ucp']->forum_jump($fj, $links);
|
||||
$this->output .= $this->ipsclass->compiled_templates['skin_ucp']->forum_jump( $fj );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -163,6 +153,8 @@ class paysubscriptions
|
||||
// Any special message?
|
||||
//--------------------------------------
|
||||
|
||||
$this->ipsclass->input['msgtype'] = isset($this->ipsclass->input['msgtype']) ? $this->ipsclass->input['msgtype'] : '';
|
||||
|
||||
if ( $this->ipsclass->input['msgtype'] == 'fromreg' )
|
||||
{
|
||||
$msg = $this->ipsclass->compiled_templates['skin_subscriptions']->sub_msg_fromreg();
|
||||
@@ -189,7 +181,7 @@ class paysubscriptions
|
||||
$this->nav[] = "<a href='".$this->ipsclass->base_url."act=paysubs&CODE=index'>".$this->ipsclass->lang['s_page_title']."</a>";
|
||||
|
||||
$this->ipsclass->print->add_output( $this->output );
|
||||
$this->ipsclass->print->do_output( array( 'TITLE' => $this->ipsclass->lang['s_page_title'], 'JS' => 1, NAV => $this->nav ) );
|
||||
$this->ipsclass->print->do_output( array( 'TITLE' => $this->ipsclass->lang['s_page_title'], 'JS' => 1, 'NAV' => $this->nav ) );
|
||||
|
||||
}
|
||||
|
||||
@@ -274,17 +266,11 @@ class paysubscriptions
|
||||
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'subs_nomethod_selected' ) );
|
||||
}
|
||||
|
||||
$this->ipsclass->DB->query("SELECT * FROM ibf_subscription_methods WHERE submethod_id=$method_chosen");
|
||||
$method = $this->ipsclass->DB->build_and_exec_query( array( 'select' => '*', 'from' => 'subscription_methods', 'where' => "submethod_id={$method_chosen}" ) );
|
||||
|
||||
$method = $this->ipsclass->DB->fetch_row();
|
||||
$subs = $this->ipsclass->DB->build_and_exec_query( array( 'select' => '*', 'from' => 'subscriptions', 'where' => "sub_id={$sub_chosen}" ) );
|
||||
|
||||
$this->ipsclass->DB->query("SELECT * FROM ibf_subscriptions WHERE sub_id=$sub_chosen");
|
||||
|
||||
$subs = $this->ipsclass->DB->fetch_row();
|
||||
|
||||
$this->ipsclass->DB->query("SELECT * FROM ibf_subscription_extra WHERE subextra_sub_id=$sub_chosen AND subextra_method_id=$method_chosen");
|
||||
|
||||
$extra = $this->ipsclass->DB->fetch_row();
|
||||
$extra = $this->ipsclass->DB->build_and_exec_query( array( 'select' => '*', 'from' => 'subscription_extra', 'where' => "subextra_sub_id={$sub_chosen} AND subextra_method_id={$method_chosen}" ) );
|
||||
|
||||
//---------------------------------------------
|
||||
// INIT Load Payment handler
|
||||
@@ -309,9 +295,7 @@ class paysubscriptions
|
||||
|
||||
if ( $upgrade )
|
||||
{
|
||||
$this->ipsclass->DB->query("SELECT * FROM ibf_subscriptions WHERE sub_id=$cur_id");
|
||||
|
||||
$current = $this->ipsclass->DB->fetch_row();
|
||||
$current = $this->ipsclass->DB->build_and_exec_query( array( 'select' => '*', 'from' => 'subscriptions', 'where' => "sub_id={$cur_id}" ) );
|
||||
|
||||
if ( $method['submethod_name'] == 'manual' )
|
||||
{
|
||||
@@ -341,9 +325,9 @@ class paysubscriptions
|
||||
|
||||
function do_payment_method()
|
||||
{
|
||||
$cur_id = intval($this->ipsclass->input['curid']);
|
||||
$upgrade = intval($this->ipsclass->input['upgrade']);
|
||||
$sub_chosen = intval($this->ipsclass->input['sub']);
|
||||
$cur_id = isset($this->ipsclass->input['curid']) ? intval($this->ipsclass->input['curid']) : 0;
|
||||
$upgrade = isset($this->ipsclass->input['upgrade']) ? intval($this->ipsclass->input['upgrade']) : 0;
|
||||
$sub_chosen = isset($this->ipsclass->input['sub']) ? intval($this->ipsclass->input['sub']) : 0;
|
||||
$subs = array();
|
||||
$upg_methods = array();
|
||||
$all_methods = array();
|
||||
@@ -357,7 +341,8 @@ class paysubscriptions
|
||||
// Get all packages
|
||||
//--------------------------------------------
|
||||
|
||||
$this->ipsclass->DB->query("SELECT * FROM ibf_subscriptions ORDER BY sub_cost");
|
||||
$this->ipsclass->DB->build_query( array( 'select' => '*', 'from' => 'subscriptions', 'order' => 'sub_cost' ) );
|
||||
$this->ipsclass->DB->exec_query();
|
||||
|
||||
while ( $s = $this->ipsclass->DB->fetch_row() )
|
||||
{
|
||||
@@ -387,7 +372,8 @@ class paysubscriptions
|
||||
// We're upgrading!! Yay! - Get cur subs
|
||||
//--------------------------------------------
|
||||
|
||||
$this->ipsclass->DB->query("SELECT * FROM ibf_subscription_trans WHERE subtrans_member_id={$this->ipsclass->member['id']} AND subtrans_sub_id=$cur_id AND subtrans_state='paid'");
|
||||
$this->ipsclass->DB->build_query( array( 'select' => '*', 'from' => 'subscription_trans', 'where' => "subtrans_member_id={$this->ipsclass->member['id']} AND subtrans_sub_id={$cur_id} AND subtrans_state='paid'" ) );
|
||||
$this->ipsclass->DB->exec_query();
|
||||
|
||||
if ( ! $cur_trans = $this->ipsclass->DB->fetch_row() )
|
||||
{
|
||||
@@ -417,12 +403,17 @@ class paysubscriptions
|
||||
$end_date = ( $subs[ $sub_chosen ]['sub_unit'] == 'x' or $subs[ $cur_id ]['sub_unit'] == 'x' )
|
||||
? $this->ipsclass->lang['no_expire']
|
||||
: $this->ipsclass->get_date( $cur_trans['subtrans_end_date'], 'JOINED' );
|
||||
|
||||
$new_date = ( $sub_upgrade['sub_unit'] == 'x' or $sub_current['sub_unit'] == 'x' )
|
||||
? $this->ipsclass->lang['no_expire']
|
||||
: $this->ipsclass->get_date( ( $cur_trans['subtrans_end_date'] - ($subs[ $cur_trans['subtrans_sub_id'] ]['sub_length'] * $this->day_to_seconds[$subs[ $cur_trans['subtrans_sub_id'] ]['sub_unit']]) + ($subs[ $sub_chosen ]['sub_length'] * $this->day_to_seconds[$subs[ $sub_chosen ]['sub_unit']])) , 'JOINED' );
|
||||
|
||||
$this->ipsclass->lang['sc_upgrade_string'] = sprintf( $this->ipsclass->lang['sc_upgrade_string'],
|
||||
$subs[ $cur_trans['subtrans_sub_id'] ]['sub_title'],
|
||||
$subs[ $sub_chosen ]['sub_title'],
|
||||
$end_date,
|
||||
sprintf( "%.2f", $balance * $this->gateway->cho_currency['subcurrency_exchange'] ) . ' '.$this->gateway->cho_currency['subcurrency_code']
|
||||
sprintf( "%.2f", $balance * $this->gateway->cho_currency['subcurrency_exchange'] ) . ' '.$this->gateway->cho_currency['subcurrency_code'],
|
||||
$new_date
|
||||
);
|
||||
|
||||
$this->output .= $this->ipsclass->compiled_templates['skin_subscriptions']->sub_two_upgrade_summary();
|
||||
@@ -479,7 +470,8 @@ class paysubscriptions
|
||||
// Get all packages
|
||||
//--------------------------------------------
|
||||
|
||||
$this->ipsclass->DB->query("SELECT * FROM ibf_subscriptions ORDER BY sub_cost");
|
||||
$this->ipsclass->DB->build_query( array( 'select' => '*', 'from' => 'subscriptions', 'order' => 'sub_cost' ) );
|
||||
$this->ipsclass->DB->exec_query();
|
||||
|
||||
while ( $s = $this->ipsclass->DB->fetch_row() )
|
||||
{
|
||||
@@ -490,7 +482,8 @@ class paysubscriptions
|
||||
// Get all transactions with our memberid
|
||||
//--------------------------------------------
|
||||
|
||||
$this->ipsclass->DB->query("SELECT * FROM ibf_subscription_trans WHERE subtrans_member_id={$this->ipsclass->member['id']}");
|
||||
$this->ipsclass->DB->build_query( array( 'select' => '*', 'from' => 'subscription_trans', 'where' => "subtrans_member_id={$this->ipsclass->member['id']}" ) );
|
||||
$this->ipsclass->DB->exec_query();
|
||||
|
||||
while ( $r = $this->ipsclass->DB->fetch_row() )
|
||||
{
|
||||
@@ -595,7 +588,8 @@ class paysubscriptions
|
||||
// have anywhere to go (ie. we're not on the top tier)
|
||||
//--------------------------------------------
|
||||
|
||||
$this->ipsclass->DB->query("SELECT * FROM ibf_subscriptions WHERE sub_cost > $max_cost ORDER BY sub_cost");
|
||||
$this->ipsclass->DB->build_query( array( 'select' => '*', 'from' => 'subscriptions', 'where' => "sub_cost > {$max_cost}", 'order' => 'sub_cost' ) );
|
||||
$this->ipsclass->DB->exec_query();
|
||||
|
||||
if ( $this->ipsclass->DB->get_num_rows() )
|
||||
{
|
||||
@@ -605,7 +599,9 @@ class paysubscriptions
|
||||
|
||||
while ( $row = $this->ipsclass->DB->fetch_row() )
|
||||
{
|
||||
$end_date = ($row['sub_unit'] == 'x' or $max_end == 'x') ? $this->ipsclass->lang['no_expire'] : $this->ipsclass->get_date( $max_data['subtrans_end_date'], 'JOINED', 1 );
|
||||
$date = ($max_data['subtrans_end_date'] - ($subs[ $cdata['subtrans_sub_id'] ]['sub_length'] * $this->day_to_seconds[$max_end]) + ($row['sub_length'] * $this->day_to_seconds[$row['sub_unit']]) );
|
||||
|
||||
$end_date = ($row['sub_unit'] == 'x' or $max_end == 'x') ? $this->ipsclass->lang['no_expire'] : $this->ipsclass->get_date( $date, 'JOINED', 1 );
|
||||
|
||||
$this->output .= $this->ipsclass->compiled_templates['skin_subscriptions']->sub_choose_upgrade_row( $row['sub_id'],
|
||||
$row['sub_title'],
|
||||
@@ -633,7 +629,7 @@ class paysubscriptions
|
||||
|
||||
$this->output .= $this->ipsclass->compiled_templates['skin_subscriptions']->sub_choose_new_top($this->gateway->cho_currency['subcurrency_code']);
|
||||
|
||||
foreach( $subs as $id => $row )
|
||||
foreach( $subs as $row )
|
||||
{
|
||||
$duration = $row['sub_length'];
|
||||
|
||||
@@ -659,7 +655,7 @@ class paysubscriptions
|
||||
$this->output .= $this->ipsclass->compiled_templates['skin_subscriptions']->sub_choose_new_bottom();
|
||||
}
|
||||
|
||||
$this->output .= $this->ipsclass->compiled_templates['skin_subscriptions']->sub_currency_change_form( $this->_make_currency_dropdown(), $this->ipsclass->base_url.'act=paysubs&CODE=index' );
|
||||
$this->output .= $this->ipsclass->compiled_templates['skin_subscriptions']->sub_currency_change_form( $this->_make_currency_dropdown(), $this->ipsclass->base_url.'act=paysubs&CODE=index' );
|
||||
|
||||
$this->output .= $this->ipsclass->compiled_templates['skin_subscriptions']->sub_page_bottom();
|
||||
}
|
||||
@@ -696,8 +692,9 @@ class paysubscriptions
|
||||
// INIT da func
|
||||
//-----------------------------------------
|
||||
|
||||
$this->lib = new func_usercp($this);
|
||||
$this->lib = new func_usercp();
|
||||
$this->lib->ipsclass =& $this->ipsclass;
|
||||
$this->lib->class =& $this;
|
||||
|
||||
//-----------------------------------------
|
||||
// Print menu
|
||||
@@ -715,13 +712,14 @@ class paysubscriptions
|
||||
{
|
||||
$curr_box = $this->ipsclass->compiled_templates['skin_subscriptions']->sub_currency_change_top();
|
||||
|
||||
$this->ipsclass->DB->query("SELECT * FROM ibf_subscription_currency");
|
||||
$this->ipsclass->DB->build_query( array( 'select' => '*', 'from' => 'subscription_currency' ) );
|
||||
$this->ipsclass->DB->exec_query();
|
||||
|
||||
while ( $c = $this->ipsclass->DB->fetch_row() )
|
||||
{
|
||||
$default = "";
|
||||
|
||||
if ( $this->ipsclass->input['currency'] )
|
||||
if ( isset($this->ipsclass->input['currency']) AND $this->ipsclass->input['currency'] )
|
||||
{
|
||||
if ( $this->ipsclass->input['currency'] == $c['subcurrency_code'] )
|
||||
{
|
||||
@@ -800,12 +798,14 @@ class paysubscriptions
|
||||
$sub_id = intval( $this->ipsclass->input['sid'] );
|
||||
$tick_id = intval( $this->ipsclass->input['tickid'] );
|
||||
$upgrade = intval( $this->ipsclass->input['upgrade'] );
|
||||
$sub_title_extra = "";
|
||||
|
||||
//---------------------------------------
|
||||
// Check for pending subscription
|
||||
//---------------------------------------
|
||||
|
||||
$this->ipsclass->DB->query("SELECT * FROM ibf_subscription_trans WHERE subtrans_member_id={$this->ipsclass->member['id']} AND subtrans_state='pending' AND subtrans_end_date > ".time() );
|
||||
$this->ipsclass->DB->build_query( array( 'select' => '*', 'from' => 'subscription_trans', 'where' => "subtrans_member_id={$this->ipsclass->member['id']} AND subtrans_state='pending' AND subtrans_end_date > ".time() ) );
|
||||
$this->ipsclass->DB->exec_query();
|
||||
|
||||
if ( $trx = $this->ipsclass->DB->fetch_row() )
|
||||
{
|
||||
@@ -818,13 +818,16 @@ class paysubscriptions
|
||||
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'subs_fail', 'EXTRA' => 'no_curid' ) );
|
||||
}
|
||||
|
||||
$this->ipsclass->DB->query("SELECT * FROM ibf_subscriptions WHERE sub_id=$sub_id");
|
||||
$this->ipsclass->DB->build_query( array( 'select' => '*', 'from' => 'subscriptions', 'where' => "sub_id={$sub_id}" ) );
|
||||
$this->ipsclass->DB->exec_query();
|
||||
|
||||
if ( ! $sub = $this->ipsclass->DB->fetch_row() )
|
||||
{
|
||||
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'subs_fail', 'EXTRA' => 'no_curid' ) );
|
||||
}
|
||||
|
||||
$old_group = ($sub[ 'sub_new_group' ] > 0) ? $this->ipsclass->member['mgroup'] : 0;
|
||||
|
||||
//-------------------------
|
||||
// start array
|
||||
//-------------------------
|
||||
@@ -832,7 +835,7 @@ class paysubscriptions
|
||||
$use_meh = array(
|
||||
'subtrans_sub_id' => $sub_id,
|
||||
'subtrans_member_id' => $this->ipsclass->member['id'],
|
||||
'subtrans_old_group' => $this->ipsclass->member['mgroup'],
|
||||
'subtrans_old_group' => $old_group,
|
||||
'subtrans_paid' => $sub['sub_cost'],
|
||||
'subtrans_cumulative' => $sub['sub_cost'],
|
||||
'subtrans_method' => 'manual',
|
||||
@@ -857,7 +860,16 @@ class paysubscriptions
|
||||
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'subs_fail', 'EXTRA' => 'no_curid' ) );
|
||||
}
|
||||
|
||||
$this->ipsclass->DB->query("SELECT * FROM ibf_subscription_trans WHERE subtrans_id=$tick_id");
|
||||
$this->ipsclass->DB->build_query( array( 'select' => 't.*',
|
||||
'from' => array( 'subscription_trans' => 't' ),
|
||||
'where' => "t.subtrans_id={$tick_id}",
|
||||
'add_join' => array( array( 'type' => 'left',
|
||||
'select' => 's.sub_length, s.sub_unit',
|
||||
'from' => array( 'subscriptions' => 's' ),
|
||||
'where' => 's.sub_id=t.subtrans_sub_id'
|
||||
) )
|
||||
) );
|
||||
$this->ipsclass->DB->exec_query();
|
||||
|
||||
if ( ! $trans = $this->ipsclass->DB->fetch_row() )
|
||||
{
|
||||
@@ -870,9 +882,10 @@ class paysubscriptions
|
||||
unset($use_meh['sub_start_date']);
|
||||
unset($use_meh['sub_end_date']);
|
||||
|
||||
$dbs = $this->ipsclass->DB->compile_db_update_string($use_meh);
|
||||
$use_meh['sub_end_date'] = $trans['subtrans_end_date'] + ( $sub['sub_length'] * $this->day_to_seconds[ $sub['sub_unit'] ] );
|
||||
$use_meh['sub_end_date'] -= ($trans['sub_length'] * $this->day_to_seconds[ $trans['sub_unit'] ] );
|
||||
|
||||
$this->ipsclass->DB->query("UPDATE ibf_subscription_trans SET $dbs, subtrans_cumulative=subtrans_cumulative+{$sub['sub_cost']} WHERE subtrans_id=$tick_id");
|
||||
$this->ipsclass->DB->do_update( 'subscription_trans', array_merge( $use_meh, array( 'subtrans_cumulative' => "subtrans_cumulative+{$sub['sub_cost']}" ) ), "subtrans_id={$tick_id}" );
|
||||
|
||||
$sub_title_extra = '('. $this->ipsclass->lang['gw_upgrade'] .')';
|
||||
|
||||
@@ -885,7 +898,7 @@ class paysubscriptions
|
||||
|
||||
$dbs = $this->ipsclass->DB->compile_db_insert_string($use_meh);
|
||||
|
||||
$this->ipsclass->DB->query("INSERT INTO ibf_subscription_trans ({$dbs['FIELD_NAMES']}) VALUES({$dbs['FIELD_VALUES']})");
|
||||
$this->ipsclass->DB->do_insert( 'subscription_trans', $use_meh );
|
||||
|
||||
$tick_id = $this->ipsclass->DB->get_insert_id();
|
||||
|
||||
@@ -948,8 +961,6 @@ class paysubscriptions
|
||||
|
||||
function _show_manual_upgrade($sub_current, $sub_upgrade, $pay_method, $extra)
|
||||
{
|
||||
global $ibforums, $std, $DB;
|
||||
|
||||
//---------------------------------------
|
||||
// Check we can do upgrades
|
||||
//---------------------------------------
|
||||
@@ -981,8 +992,9 @@ class paysubscriptions
|
||||
// We're upgrading!! Yay! - Get cur subs
|
||||
//--------------------------------------------
|
||||
|
||||
$this->ipsclass->DB->query("SELECT * FROM ibf_subscription_trans WHERE subtrans_member_id={$this->ipsclass->member['id']} AND subtrans_sub_id={$sub_current['sub_id']} AND subtrans_state='paid'");
|
||||
|
||||
$this->ipsclass->DB->build_query( array( 'select' => '*', 'from' => 'subscription_trans', 'where' => "subtrans_member_id={$this->ipsclass->member['id']} AND subtrans_sub_id={$sub_current['sub_id']} AND subtrans_state='paid'" ) );
|
||||
$this->ipsclass->DB->exec_query();
|
||||
|
||||
if ( ! $cur_trans = $this->ipsclass->DB->fetch_row() )
|
||||
{
|
||||
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'subs_no_curid' ) );
|
||||
@@ -998,11 +1010,16 @@ class paysubscriptions
|
||||
? $this->ipsclass->lang['no_expire']
|
||||
: $this->ipsclass->get_date( $cur_trans['subtrans_end_date'], 'JOINED' );
|
||||
|
||||
$new_date = ( $sub_upgrade['sub_unit'] == 'x' or $sub_current['sub_unit'] == 'x' )
|
||||
? $this->ipsclass->lang['no_expire']
|
||||
: $this->ipsclass->get_date( ( $cur_trans['subtrans_end_date'] - ($sub_current['sub_length'] * $this->day_to_seconds[$sub_current['sub_unit']]) + ($sub_upgrade['sub_length'] * $this->day_to_seconds[$sub_upgrade['sub_unit']])) , 'JOINED' );
|
||||
|
||||
$this->ipsclass->lang['sc_upgrade_string'] = sprintf( $this->ipsclass->lang['sc_upgrade_string'],
|
||||
$sub_current['sub_title'],
|
||||
$sub_upgrade['sub_title'],
|
||||
$end_date,
|
||||
'$'.$balance
|
||||
'$'.$balance,
|
||||
$new_date
|
||||
);
|
||||
|
||||
$this->ipsclass->lang['post_manual_more'] = sprintf( $this->ipsclass->lang['post_manual_more'],
|
||||
@@ -1019,10 +1036,6 @@ class paysubscriptions
|
||||
$cur_trans['subtrans_id'],
|
||||
$this->ipsclass->lang['sc_upgrade_string']
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user