The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
SQL Query to bath upload paid subscribers
I am just wondering what would be the best way to mass upload a bunch of subscribed users to a forum. i dont want to chnage anything about the user since they are alreayd on the forum, but just upload paid subscription status.
I am moving away from the mod, a_w_c subscription system and want to use the default Vb subscription since that mod is no longer supported. Now I just want to move them over in mass via database instead of manually adding each users subscription. if should be pretty easy since the defualt vb subscription does not keep alot of the subscribers infor and I think there are only 2 tables i would need to populate: paymentinfo AND paymenttransaction Is there another table I am missing? Also, i am not asking for an easy query that would do the migration in one click. I dont mind doing some manual work but can you help me make a query to create a subscription for: if I know USERNAME, DATE SUBSCRIBED, LENGTH? Would i need to add info like, what was previous usergroup or anything else? Thanks! --------------- Added [DATE]1328367056[/DATE] at [TIME]1328367056[/TIME] --------------- i think i found the portion of the code that might have converted old vb data to the mod subsctioption data, maybe it can somehow be used: Code:
$vbmodsubslog_sql = $vbulletin->db->query_read(" SELECT sl.*, pi.subscriptionsubid FROM `".TABLE_PREFIX."subscriptionlog` AS sl LEFT JOIN `".TABLE_PREFIX."paymenttransaction` AS pt ON ( sl.regdate = pt.dateline AND pt.paymentinfoid <> 0 ) LEFT JOIN `".TABLE_PREFIX."paymentinfo` AS pi ON ( pt.paymentinfoid = pi.paymentinfoid AND sl.userid = pi.userid ) "); if ( $vbulletin->db->num_rows( $vbmodsubslog_sql ) ){ $time = time(); while ( $vbmodsubslog = $vbulletin->db->fetch_array( $vbmodsubslog_sql ) ){ if ( !empty( $vbulletin->options['ss_ns_sr_time'] ) && $vbmodsubslog['status'] ){ $remindertime = strtotime( "-".$vbulletin->options['ss_ns_sr_time'], $vbmodsubslog['expirydate'] ); if ( $remindertime < $time ){ $remindertime = 0; } } else { $remindertime = 0; } if ( $termids[$vbmodsubslog['subscriptionid']][$vbmodsubslog['subscriptionsubid']] ){ $termid = $termids[$vbmodsubslog['subscriptionid']][$vbmodsubslog['subscriptionsubid']]; } else { $termid = 0; } $db_string = null; $db_string = $BASE->compile_db_insert_string( array( 'sid' => 'ss', 'subid' => $vbmodsubslog['subscriptionid'], 'termid' => $termid, 'userid' => $vbmodsubslog['userid'], 'active' => $vbmodsubslog['status'], 'remindertime' => $remindertime, 'stime' => $vbmodsubslog['regdate'], 'etime' => $vbmodsubslog['expirydate'] ) ); $vbulletin->db->query_write(" INSERT IGNORE INTO `".TABLE_PREFIX."awc_subscriptions_data` (".$db_string['FIELD_NAMES'].") VALUES (".$db_string['FIELD_VALUES'].") "); } } $vbmodtrans_sql = $vbulletin->db->query_read(" SELECT pt.*, pi.*, pa.classname FROM `".TABLE_PREFIX."paymenttransaction` AS pt LEFT JOIN `".TABLE_PREFIX."paymentinfo` AS pi ON ( pt.paymentinfoid = pi.paymentinfoid ) LEFT JOIN `".TABLE_PREFIX."paymentapi` AS pa ON ( pt.paymentapiid = pa.paymentapiid ) WHERE pt.reversed <> 1 AND pt.paymentinfoid <> 0 AND pi.userid <> 0 AND pt.state = 1 "); if ( $vbulletin->db->num_rows( $vbmodtrans_sql ) ){ while ( $vbmodtrans = $vbulletin->db->fetch_array( $vbmodtrans_sql ) ){ $currency = strtoupper( $vbmodtrans['currency'] ); if ( empty( $currency ) ){ $currency = $vbulletin->options['awc_currency']; } if ( empty( $vbmodtrans['classname'] ) ){ $vbmodtrans['classname'] = 'imported'; } if ( $termids[$vbmodtrans['subscriptionid']][$vbmodtrans['subscriptionsubid']] ){ $termid = $termids[$vbmodtrans['subscriptionid']][$vbmodtrans['subscriptionsubid']]; } else { $termid = 0; } $db_string = null; $db_string = $BASE->compile_db_insert_string( array( 'sid' => 'ss', 'method' => $vbmodtrans['classname'], 'anonymous' => 0, 'disclose' => 1, 'txn_id' => $vbmodtrans['transactionid'], 'userid' => $vbmodtrans['userid'], 'receiver_email' => $vbulletin->options['ss_paypal_email'], 'item_number' => $termid, 'payment_date' => $vbmodtrans['dateline'], 'payment_status' => 'Completed', 'mc_gross' => $vbmodtrans['amount'], 'mc_fee' => 0, 'mc_currency' => $currency |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|