Community Support Forums — WordPress® ( Users Helping Users ) — 2011-12-20T09:51:26-05:00 http://www.primothemes.com/forums/feed.php?f=40&t=13173 2011-12-20T09:51:26-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13173&p=57932#p57932 <![CDATA[s2Member v111220 / Source Code: s2member-p...]]>
s2Member v111220
Source Code: s2member-pro\includes\classes\exports-in.inc.php
Docs updated: December 20, 2011, 9:51 am

Open for public discussion.
(!-- s-words :: --)n/a(!-- :: s-words --)

Statistics: Posted by System Robot — December 20th, 2011, 9:51 am


]]>
2011-12-07T01:04:33-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13173&p=55614#p55614 <![CDATA[s2Member v111206 / Source Code: s2member-p...]]>
s2Member v111206
Source Code: s2member-pro\includes\classes\exports-in.inc.php
Docs updated: December 7, 2011, 1:04 am

Open for public discussion.
(!-- s-words :: --)n/a(!-- :: s-words --)

Statistics: Posted by System Robot — December 7th, 2011, 1:04 am


]]>
2011-11-05T19:27:14-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13173&p=51988#p51988 <![CDATA[s2Member v111105 / Source Code: s2member-p...]]>
s2Member v111105
Source Code: s2member-pro\includes\classes\exports-in.inc.php
Docs updated: November 5, 2011, 8:27 pm

Open for public discussion.
(!-- s-words :: --)n/a(!-- :: s-words --)

Statistics: Posted by System Robot — November 5th, 2011, 7:27 pm


]]>
2011-10-29T20:36:38-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13173&p=50084#p50084 <![CDATA[s2Member v111029 / Source Code: s2member-p...]]>
s2Member v111029
Source Code: s2member-pro\includes\classes\exports-in.inc.php
Docs updated: October 29, 2011, 9:36 pm

Open for public discussion.
(!-- s-words :: --)n/a(!-- :: s-words --)

Statistics: Posted by System Robot — October 29th, 2011, 8:36 pm


]]>
2011-10-17T15:41:00-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13173&p=47878#p47878 <![CDATA[s2Member v111017 / Source Code: s2member-p...]]>
s2Member v111017
Source Code: s2member-pro\includes\classes\exports-in.inc.php
Docs updated: October 17, 2011, 1:41 pm

Open for public discussion.
(!-- s-words :: --)n/a(!-- :: s-words --)

Statistics: Posted by System Robot — October 17th, 2011, 3:41 pm


]]>
2011-10-11T14:36:44-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13173&p=46280#p46280 <![CDATA[s2Member v111011 / Source Code: s2member-p...]]>
s2Member v111011
Source Code: s2member-pro\includes\classes\exports-in.inc.php
Docs updated: October 11, 2011, 12:36 pm

Open for public discussion.
(!-- s-words :: --)n/a(!-- :: s-words --)

Statistics: Posted by System Robot — October 11th, 2011, 2:36 pm


]]>
2011-10-03T15:49:09-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13173&p=44409#p44409 <![CDATA[s2Member v111003 / Source Code: s2member-p...]]>
s2Member v111003
Source Code: s2member-pro\includes\classes\exports-in.inc.php
Docs updated: October 3, 2011, 1:49 pm

Open for public discussion.
(!-- s-words :: --)n/a(!-- :: s-words --)

Statistics: Posted by System Robot — October 3rd, 2011, 3:49 pm


]]>
2011-10-03T03:42:48-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13173&p=43116#p43116 <![CDATA[s2Member v111002 / Source Code: s2member-p...]]>
s2Member v111002
Source Code: s2member-pro\includes\classes\exports-in.inc.php
Docs updated: October 3, 2011, 1:42 am

Open for public discussion.
(!-- s-words :: --)n/a(!-- :: s-words --)

Statistics: Posted by System Robot — October 3rd, 2011, 3:42 am


]]>
2011-09-27T05:27:53-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13173&p=41358#p41358 <![CDATA[s2Member v110927 / Source Code: s2member-p...]]>
s2Member v110927
Source Code: s2member-pro\includes\classes\exports-in.inc.php
Docs updated: September 27, 2011, 3:27 am

Open for public discussion.
(!-- s-words :: --)n/a(!-- :: s-words --)

Statistics: Posted by System Robot — September 27th, 2011, 5:27 am


]]>
2011-09-26T21:04:21-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13173&p=40114#p40114 <![CDATA[s2Member v110926 / Source Code: s2member-p...]]>
s2Member v110926
Source Code: s2member-pro\includes\classes\exports-in.inc.php
Docs updated: September 26, 2011, 7:04 pm

Open for public discussion.
(!-- s-words :: --)n/a(!-- :: s-words --)

Statistics: Posted by System Robot — September 26th, 2011, 9:04 pm


]]>
2011-09-17T17:03:24-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13173&p=38258#p38258 <![CDATA[s2Member v110915 / Source Code: s2member-p...]]>
s2Member v110915
Source Code: s2member-pro\includes\classes\exports-in.inc.php
Docs updated: September 17, 2011, 3:03 pm

Open for public discussion.
(!-- s-words :: --)n/a(!-- :: s-words --)

Statistics: Posted by System Robot — September 17th, 2011, 5:03 pm


]]>
2011-09-14T01:28:52-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13173&p=36836#p36836 <![CDATA[s2Member v110913 / Source Code: s2member-p...]]>
s2Member v110913
Source Code: s2member-pro\includes\classes\exports-in.inc.php
Docs updated: September 13, 2011, 11:28 pm

Open for public discussion.
(!-- s-words :: --)n/a(!-- :: s-words --)

Statistics: Posted by System Robot — September 14th, 2011, 1:28 am


]]>
2011-09-13T12:03:53-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13173&p=35564#p35564 <![CDATA[s2Member v110912 / Source Code: s2member-p...]]>
s2Member v110912
Source Code: s2member-pro\includes\classes\exports-in.inc.php
Docs updated: September 13, 2011, 10:03 am

Open for public discussion.
(!-- s-words :: --)n/a(!-- :: s-words --)

Statistics: Posted by System Robot — September 13th, 2011, 12:03 pm


]]>
2011-08-15T15:16:11-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13173&p=31672#p31672 <![CDATA[s2Member v110815 / Source Code: s2member-p...]]>
s2Member v110815
Source Code: s2member-pro\includes\classes\exports-in.inc.php
Docs updated: August 15, 2011, 4:16 pm

Open for public discussion.
(!-- s-words :: --)Source Code Documentation Packages ( Overview ) Classes Deprecated Todo Index Source Code jQuery(window).load(function(){ if(typeof location.hash === 'string' && location.hash.match(/^#/)) jQuery('olli'+location.hash).addClass('hilite'); }); jQuery(window).bind('hashchange', function(){ if(typeof location.hash === 'string' && location.hash.match(/^#/)) jQuery('olli').removeClass('hilite'); jQuery('olli'+location.hash).addClass('hilite'); }); [ full view ]s2member-pro\includes\classes\exports-in.inc.php ?php /** * Handles various exportations ( innner processing routines ). * * Copyright: © 2009-2011 * {@link http://www.websharks-inc.com/ WebSharks, Inc.} * ( coded in the USA ) * * This WordPress® plugin ( s2Member Pro ) is comprised of two parts: * * o (1) Its PHP code is licensed under the GPL license, as is WordPress®. * You should have received a copy of the GNU General Public License, * along with this software. In the main directory, see: /licensing/ * If not, see: {@link http://www.gnu.org/licenses/}. * * o (2) All other parts of ( s2Member Pro ); including, but not limited to: * the CSS code, some JavaScript code, images, and design; * are licensed according to the license purchased. * See: {@link http://www.s2member.com/prices/} * * Unless you have our prior written consent, you must NOT directly or indirectly license, * sub-license, sell, resell, or provide for free; part (2) of the s2Member Pro Module; * or make an offer to do any of these things. All of these things are strictly * prohibited with part (2) of the s2Member Pro Module. * * Your purchase of s2Member Pro includes free lifetime upgrades via s2Member.com * ( i.e. new features, bug fixes, updates, improvements ); along with full access * to our video tutorial library: {@link http://www.s2member.com/videos/} * * @package s2Member\Exports * @since 1.5 */ if ( realpath ( __FILE__ ) === realpath ( $_SERVER [ "SCRIPT_FILENAME" ] ) ) exit ( "Do not access this file directly." ) ; /**/ if ( ! class_exists ( "c_ws_plugin__s2member_pro_exports_in" ) ) { /** * Handles various exportations ( innner processing routines ). * * @package s2Member\Exports * @since 1.5 */ class c_ws_plugin__s2member_pro_exports_in { /** * Handles the exportation of Users/Members. * * @package s2Member\Exports * @since 110815 * * @return null Or exits script execution after issuing file download prompt with CSV file. */ public static function export_users ( ) { if ( ! empty ( $_POST [ "ws_plugin__s2member_pro_export_users" ] ) && ( $nonce = $_POST [ "ws_plugin__s2member_pro_export_users" ] ) && wp_verify_nonce ( $nonce , "ws-plugin--s2member-pro-export-users" ) && current_user_can ( "create_users" ) ) { global $wpdb ; /* Global database object reference. */ global $current_site , $current_blog ; /* Multisite Networking. */ /**/ @ set_time_limit ( 0 ) ; /* Make time for processing. */ @ ini_set ( "memory_limit" , "256M" ) ; /* RAM. */ /**/ $format = ! empty ( $_POST [ "ws_plugin__s2member_pro_export_users_format" ] ) ? $_POST [ "ws_plugin__s2member_pro_export_users_format" ] : "" ; $start = ! empty ( $_POST [ "ws_plugin__s2member_pro_export_users_start" ] ) ? (int) $_POST [ "ws_plugin__s2member_pro_export_users_start" ] : 1 ; /**/ $start = ( $start = 1 ) ? $start : 1 ; /* Must be 1 or higher. */ $sql_s = ( $start === 1 ) ? 0 : $start ; /* 1 should be 0. */ /**/ $export = "" ; /* Initialize the export file variable. */ /**/ $s2map = array ( /* Map s2Member fields. */ "custom" = $wpdb - prefix . "s2member_custom" , /**/ "subscr_id" = $wpdb - prefix . "s2member_subscr_id" , /**/ "subscr_gateway" = $wpdb - prefix . "s2member_subscr_gateway" , /**/ "auto_eot_time" = $wpdb - prefix . "s2member_auto_eot_time" , /**/ "last_payment_time" = $wpdb - prefix . "s2member_last_payment_time" , /**/ "paid_registration_times" = $wpdb - prefix . "s2member_paid_registration_times" , /**/ "custom_fields" = $wpdb - prefix . "s2member_custom_fields" ) ; /**/ if ( is_array ( $_users = $wpdb - get_results ( "SELECT `" . $wpdb - users . "`.`ID` FROM `" . $wpdb - users . "`, `" . $wpdb - usermeta . "` WHERE `" . $wpdb - users . "`.`ID` = `" . $wpdb - usermeta . "`.`user_id` AND `" . $wpdb - usermeta . "`.`meta_key` = '" . esc_sql ( $wpdb - prefix . "capabilities" ) . "' LIMIT " . $sql_s . ", 250" ) ) ) { if ( is_multisite ( ) && c_ws_plugin__s2member_utils_conds:: is_multisite_farm ( ) && ! is_main_site ( ) ) $export .= '"ID","Username","First Name","Last Name","Display Name","Email","Website","Role","Custom Capabilities","Registration Date","First Payment Date","Last Payment Date","Auto-EOT Date","Custom Value","Paid Subscr. ID","Paid Subscr. Gateway"' . "\n" ; else /* Otherwise, we use the standardized format for exportation.*/ $export .= '"ID","Username","Password","First Name","Last Name","Display Name","Email","Website","Role","Custom Capabilities","Registration Date","First Payment Date","Last Payment Date","Auto-EOT Date","Custom Value","Paid Subscr. ID","Paid Subscr. Gateway"' . "\n" ; /**/ foreach ( $_users as $_user ) /* Go through each User/Member in this result set. */ { if ( is_object ( $user = new WP_User ( $_user - ID ) ) && $user - ID ) { $custom_capabilities = "" ; /* Reset each time. */ /**/ foreach ( $user - allcaps as $cap = $cap_enabled ) if ( preg_match ( "/^access_s2member_ccap_/" , $cap ) ) if ( $cap = preg_replace ( "/^access_s2member_ccap_/" , "" , $cap ) ) $custom_capabilities .= "," . $cap ; /**/ $custom_capabilities = trim ( $custom_capabilities , "," ) ; /**/ $custom = ( isset ( $user - $s2map [ "custom" ] ) ) ? $user - $s2map [ "custom" ] : "" ; $subscr_id = ( isset ( $user - $s2map [ "subscr_id" ] ) ) ? $user - $s2map [ "subscr_id" ] : "" ; $subscr_gateway = ( isset ( $user - $s2map [ "subscr_gateway" ] ) ) ? $user - $s2map [ "subscr_gateway" ] : "" ; /**/ $auto_eot_time = ( isset ( $user - $s2map [ "auto_eot_time" ] ) ) ? $user - $s2map [ "auto_eot_time" ] : "" ; $last_payment_time = ( isset ( $user - $s2map [ "last_payment_time" ] ) ) ? $user - $s2map [ "last_payment_time" ] : "" ; $paid_registration_times = ( isset ( $user - $s2map [ "paid_registration_times" ] ) ) ? $user - $s2map [ "paid_registration_times" ] : "" ; $custom_fields = ( isset ( $user - $s2map [ "custom_fields" ] ) && is_array ( $user - $s2map [ "custom_fields" ] ) ) ? $user - $s2map [ "custom_fields" ] : array ( ) ; /**/ $paid_registration_date = ( $paid_registration_times [ "level" ] ) ? date ( "m/d/Y" , $paid_registration_times [ "level" ] ) : "" ; $paid_registration_times = ( is_array ( $paid_registration_times ) && ! empty ( $paid_registration_times ) ) ? serialize ( $paid_registration_times ) : "" ; $registration_date = ( $user - user_registered ) ? date ( "m/d/Y" , strtotime ( $user - user_registered ) ) : "" ; $last_payment_date = ( $last_payment_time ) ? date ( "m/d/Y" , $last_payment_time ) : "" ; $auto_eot_date = ( $auto_eot_time ) ? date ( "m/d/Y" , $auto_eot_time ) : "" ; /**/ ksort ( $custom_fields ) ; /* Make sure Custom Fields are always in the same order. This provides clarity/uniformity in the export file. */ /**/ if ( is_multisite ( ) && c_ws_plugin__s2member_utils_conds:: is_multisite_farm ( ) && ! is_main_site ( ) ) { if ( $format === "readable" ) /* Human readable format; easier for some. */ { $line = '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $user - ID ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $user - user_login ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $user - first_name ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $user - last_name ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $user - display_name ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $user - user_email ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $user - user_url ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( reset ( $user - roles ) ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $custom_capabilities ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $registration_date ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $paid_registration_date ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $last_payment_date ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $auto_eot_date ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $custom ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $subscr_id ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $subscr_gateway ) . '",' ; /**/ foreach ( $custom_fields as $custom_field_var = $custom_field_value ) { $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $custom_field_var ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq /* Implode array? */ ( implode ( "|" , ( array ) $custom_field_value ) ) . '",' ; } } else /* Otherwise, we can just use the default re-importation format. */ { $line = '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $user - ID ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $user - user_login ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $user - first_name ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $user - last_name ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $user - display_name ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $user - user_email ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $user - user_url ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( reset ( $user - roles ) ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $custom_capabilities ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $registration_date ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $paid_registration_times ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $last_payment_date ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $auto_eot_date ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $custom ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $subscr_id ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $subscr_gateway ) . '",' ; /**/ foreach ( $custom_fields as $custom_field_var = $custom_field_value ) { $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $custom_field_var ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq /* Serialize? */ ( maybe_serialize ( $custom_field_value ) ) . '",' ; } } } else /* Otherwise, we use the standardized formats for exportation.*/ { if ( $format === "readable" ) /* Human readable format; easier for some. */ { $line = '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $user - ID ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $user - user_login ) . '",' ; $line .= '"",' ; /* The Password field is left blank on export. */ $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $user - first_name ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $user - last_name ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $user - display_name ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $user - user_email ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $user - user_url ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( reset ( $user - roles ) ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $custom_capabilities ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $registration_date ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $paid_registration_date ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $last_payment_date ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $auto_eot_date ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $custom ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $subscr_id ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $subscr_gateway ) . '",' ; /**/ foreach ( $custom_fields as $custom_field_var = $custom_field_value ) { $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $custom_field_var ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq /* Implode array? */ ( implode ( "|" , ( array ) $custom_field_value ) ) . '",' ; } } else /* Otherwise, we can just use the default re-importation format. */ { $line = '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $user - ID ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $user - user_login ) . '",' ; $line .= '"",' ; /* The Password field is left blank on export. */ $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $user - first_name ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $user - last_name ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $user - display_name ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $user - user_email ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $user - user_url ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( reset ( $user - roles ) ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $custom_capabilities ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $registration_date ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $paid_registration_times ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $last_payment_date ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $auto_eot_date ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $custom ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $subscr_id ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $subscr_gateway ) . '",' ; /**/ foreach ( $custom_fields as $custom_field_var = $custom_field_value ) { $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $custom_field_var ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq /* Serialize? */ ( maybe_serialize ( $custom_field_value ) ) . '",' ; } } } /**/ $export .= trim ( $line , " \r \n \t \0 \x0B," ) . "\n" ; } } } /**/ @ ini_set ( "zlib.output_compression" , 0 ) ; /**/ header ( "Accept-Ranges: none" ) ; header ( "Content-Encoding: none" ) ; header ( "Content-Type: text/csv; charset=utf-8" ) ; header ( "Content-Length: " . strlen ( $export ) ) ; header ( "Expires: " . gmdate ( "D, d M Y H:i:s" , strtotime ( "-1 week" ) ) . " GMT" ) ; header ( "Last-Modified: " . gmdate ( "D, d M Y H:i:s" ) . " GMT" ) ; header ( "Cache-Control: no-cache, must-revalidate, max-age=0" ) ; header ( "Cache-Control: post-check=0, pre-check=0" , false ) ; header ( "Pragma: no-cache" ) ; /**/ header ( 'Content-Disposition: attachment; filename="export-' . $start . '-' . ( $start + 249 ) . '.csv"' ) ; /**/ eval ( 'while (@ob_end_clean ());' ) ; /* Clean output buffers. */ /**/ exit ( $export ) ; } } /** * Handles the exportation of options. * * @package s2Member\Exports * @since 110815 * * @return null Or exits script execution after issuing file download prompt with TXT file. */ public static function export_ops ( ) { if ( ! empty ( $_GET [ "ws_plugin__s2member_pro_export_ops" ] ) && ( $nonce = $_GET [ "ws_plugin__s2member_pro_export_ops" ] ) && wp_verify_nonce ( $nonce , "ws-plugin--s2member-pro-export-ops" ) && current_user_can ( "create_users" ) ) { $export = serialize (c_ws_plugin__s2member_pro_utils_ops:: op_replace ( $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "o" ] ) ) ; /**/ @ set_time_limit ( 0 ) ; /* Make time for processing. */ @ ini_set ( "memory_limit" , "256M" ) ; /* RAM. */ /**/ @ ini_set ( "zlib.output_compression" , 0 ) ; /**/ header ( "Accept-Ranges: none" ) ; header ( "Content-Encoding: none" ) ; header ( "Content-Type: text/plain; charset=utf-8" ) ; header ( "Content-Length: " . strlen ( $export ) ) ; header ( "Expires: " . gmdate ( "D, d M Y H:i:s" , strtotime ( "-1 week" ) ) . " GMT" ) ; header ( "Last-Modified: " . gmdate ( "D, d M Y H:i:s" ) . " GMT" ) ; header ( "Cache-Control: no-cache, must-revalidate, max-age=0" ) ; header ( "Cache-Control: post-check=0, pre-check=0" , false ) ; header ( "Pragma: no-cache" ) ; /**/ header ( 'Content-Disposition: attachment; filename="export.s2e"' ) ; /**/ eval ( 'while (@ob_end_clean ());' ) ; /* Clean output buffers. */ /**/ exit ( $export ) ; } } } } ? [ full view ]s2member-pro\includes\classes\exports-in.inc.php Source Code Documentation Packages ( Overview ) Classes Deprecated Todo Index Source Code(!-- :: s-words --)

Statistics: Posted by System Robot — August 15th, 2011, 3:16 pm


]]>
2011-07-11T17:33:07-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13173&p=27836#p27836 <![CDATA[s2Member v110710 / Source Code: s2member-p...]]>
s2Member v110710
Source Code: s2member-pro\includes\classes\exports-in.inc.php
Docs updated: July 11, 2011, 6:33 pm

Open for public discussion.
(!-- s-words :: --)Source Code Documentation Packages ( Overview ) Classes Deprecated Todo Index Source Code jQuery(window).load(function(){ if(typeof location.hash === 'string' && location.hash.match(/^#/)) jQuery('olli'+location.hash).addClass('hilite'); }); jQuery(window).bind('hashchange', function(){ if(typeof location.hash === 'string' && location.hash.match(/^#/)) jQuery('olli').removeClass('hilite'); jQuery('olli'+location.hash).addClass('hilite'); }); [ full view ]s2member-pro\includes\classes\exports-in.inc.php ?php /** * Handles User Export requests ( innner processing routines ). * * Copyright: © 2009-2011 * {@link http://www.websharks-inc.com/ WebSharks, Inc.} * ( coded in the USA ) * * This WordPress® plugin ( s2Member Pro ) is comprised of two parts: * * o (1) Its PHP code is licensed under the GPL license, as is WordPress®. * You should have received a copy of the GNU General Public License, * along with this software. In the main directory, see: /licensing/ * If not, see: {@link http://www.gnu.org/licenses/}. * * o (2) All other parts of ( s2Member Pro ); including, but not limited to: * the CSS code, some JavaScript code, images, and design; * are licensed according to the license purchased. * See: {@link http://www.s2member.com/prices/} * * Unless you have our prior written consent, you must NOT directly or indirectly license, * sub-license, sell, resell, or provide for free; part (2) of the s2Member Pro Module; * or make an offer to do any of these things. All of these things are strictly * prohibited with part (2) of the s2Member Pro Module. * * Your purchase of s2Member Pro includes free lifetime upgrades via s2Member.com * ( i.e. new features, bug fixes, updates, improvements ); along with full access * to our video tutorial library: {@link http://www.s2member.com/videos/} * * @package s2Member\User_Exports * @since 1.5 */ if ( realpath ( __FILE__ ) === realpath ( $_SERVER [ "SCRIPT_FILENAME" ] ) ) exit ( "Do not access this file directly." ) ; /**/ if ( ! class_exists ( "c_ws_plugin__s2member_pro_exports_in" ) ) { /** * Handles User Export requests ( innner processing routines ). * * @package s2Member\User_Exports * @since 1.5 */ class c_ws_plugin__s2member_pro_exports_in { /** * Handles the exportation of Users/Members. * * @package s2Member\User_Exports * @since 1.5 * * @attaches-to ``add_action("init");`` * * @return null Or exits script execution after issuing file download prompt with CSV file. */ public static function export ( ) { if ( ! empty ( $_POST [ "ws_plugin__s2member_pro_export" ] ) && ( $nonce = $_POST [ "ws_plugin__s2member_pro_export" ] ) && wp_verify_nonce ( $nonce , "ws-plugin--s2member-pro-export" ) && current_user_can ( "create_users" ) ) { global $wpdb ; /* Global database object reference. */ global $current_site , $current_blog ; /* Multisite Networking. */ /**/ @ set_time_limit ( 0 ) ; /* Make time for processing. */ @ ini_set ( "memory_limit" , "256M" ) ; /* RAM. */ /**/ $format = ! empty ( $_POST [ "ws_plugin__s2member_pro_export_format" ] ) ? $_POST [ "ws_plugin__s2member_pro_export_format" ] : "" ; $start = ! empty ( $_POST [ "ws_plugin__s2member_pro_export_start" ] ) ? (int) $_POST [ "ws_plugin__s2member_pro_export_start" ] : 1 ; /**/ $start = ( $start = 1 ) ? $start : 1 ; /* Must be 1 or higher. */ $sql_s = ( $start === 1 ) ? 0 : $start ; /* 1 should be 0. */ /**/ $export = "" ; /* Initialize the export file variable. */ /**/ $s2map = array ( /* Map s2Member fields. */ "custom" = $wpdb - prefix . "s2member_custom" , /**/ "subscr_id" = $wpdb - prefix . "s2member_subscr_id" , /**/ "subscr_gateway" = $wpdb - prefix . "s2member_subscr_gateway" , /**/ "auto_eot_time" = $wpdb - prefix . "s2member_auto_eot_time" , /**/ "last_payment_time" = $wpdb - prefix . "s2member_last_payment_time" , /**/ "paid_registration_times" = $wpdb - prefix . "s2member_paid_registration_times" , /**/ "custom_fields" = $wpdb - prefix . "s2member_custom_fields" ) ; /**/ if ( is_array ( $_users = $wpdb - get_results ( "SELECT `" . $wpdb - users . "`.`ID` FROM `" . $wpdb - users . "`, `" . $wpdb - usermeta . "` WHERE `" . $wpdb - users . "`.`ID` = `" . $wpdb - usermeta . "`.`user_id` AND `" . $wpdb - usermeta . "`.`meta_key` = '" . esc_sql ( $wpdb - prefix . "capabilities" ) . "' LIMIT " . $sql_s . ", 250" ) ) ) { if ( is_multisite ( ) && c_ws_plugin__s2member_utils_conds:: is_multisite_farm ( ) && ! is_main_site ( ) ) $export .= '"ID","Username","First Name","Last Name","Display Name","Email","Website","Role","Custom Capabilities","Registration Date","First Payment Date","Last Payment Date","Auto-EOT Date","Custom Value","Paid Subscr. ID","Paid Subscr. Gateway"' . "\n" ; else /* Otherwise, we use the standardized format for exportation.*/ $export .= '"ID","Username","Password","First Name","Last Name","Display Name","Email","Website","Role","Custom Capabilities","Registration Date","First Payment Date","Last Payment Date","Auto-EOT Date","Custom Value","Paid Subscr. ID","Paid Subscr. Gateway"' . "\n" ; /**/ foreach ( $_users as $_user ) /* Go through each User/Member in this result set. */ { if ( is_object ( $user = new WP_User ( $_user - ID ) ) && $user - ID ) { $custom_capabilities = "" ; /* Reset each time. */ /**/ foreach ( $user - allcaps as $cap = $cap_enabled ) if ( preg_match ( "/^access_s2member_ccap_/" , $cap ) ) if ( $cap = preg_replace ( "/^access_s2member_ccap_/" , "" , $cap ) ) $custom_capabilities .= "," . $cap ; /**/ $custom_capabilities = trim ( $custom_capabilities , "," ) ; /**/ $custom = ( isset ( $user - $s2map [ "custom" ] ) ) ? $user - $s2map [ "custom" ] : "" ; $subscr_id = ( isset ( $user - $s2map [ "subscr_id" ] ) ) ? $user - $s2map [ "subscr_id" ] : "" ; $subscr_gateway = ( isset ( $user - $s2map [ "subscr_gateway" ] ) ) ? $user - $s2map [ "subscr_gateway" ] : "" ; /**/ $auto_eot_time = ( isset ( $user - $s2map [ "auto_eot_time" ] ) ) ? $user - $s2map [ "auto_eot_time" ] : "" ; $last_payment_time = ( isset ( $user - $s2map [ "last_payment_time" ] ) ) ? $user - $s2map [ "last_payment_time" ] : "" ; $paid_registration_times = ( isset ( $user - $s2map [ "paid_registration_times" ] ) ) ? $user - $s2map [ "paid_registration_times" ] : "" ; $custom_fields = ( isset ( $user - $s2map [ "custom_fields" ] ) && is_array ( $user - $s2map [ "custom_fields" ] ) ) ? $user - $s2map [ "custom_fields" ] : array ( ) ; /**/ $paid_registration_date = ( $paid_registration_times [ "level" ] ) ? date ( "m/d/Y" , $paid_registration_times [ "level" ] ) : "" ; $paid_registration_times = ( is_array ( $paid_registration_times ) && ! empty ( $paid_registration_times ) ) ? serialize ( $paid_registration_times ) : "" ; $registration_date = ( $user - user_registered ) ? date ( "m/d/Y" , strtotime ( $user - user_registered ) ) : "" ; $last_payment_date = ( $last_payment_time ) ? date ( "m/d/Y" , $last_payment_time ) : "" ; $auto_eot_date = ( $auto_eot_time ) ? date ( "m/d/Y" , $auto_eot_time ) : "" ; /**/ ksort ( $custom_fields ) ; /* Make sure Custom Fields are always in the same order. This provides clarity/uniformity in the export file. */ /**/ if ( is_multisite ( ) && c_ws_plugin__s2member_utils_conds:: is_multisite_farm ( ) && ! is_main_site ( ) ) { if ( $format === "readable" ) /* Human readable format; easier for some. */ { $line = '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $user - ID ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $user - user_login ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $user - first_name ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $user - last_name ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $user - display_name ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $user - user_email ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $user - user_url ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( reset ( $user - roles ) ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $custom_capabilities ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $registration_date ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $paid_registration_date ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $last_payment_date ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $auto_eot_date ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $custom ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $subscr_id ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $subscr_gateway ) . '",' ; /**/ foreach ( $custom_fields as $custom_field_var = $custom_field_value ) { $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $custom_field_var ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq /* Implode array? */ ( implode ( "|" , ( array ) $custom_field_value ) ) . '",' ; } } else /* Otherwise, we can just use the default re-importation format. */ { $line = '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $user - ID ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $user - user_login ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $user - first_name ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $user - last_name ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $user - display_name ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $user - user_email ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $user - user_url ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( reset ( $user - roles ) ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $custom_capabilities ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $registration_date ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $paid_registration_times ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $last_payment_date ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $auto_eot_date ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $custom ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $subscr_id ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $subscr_gateway ) . '",' ; /**/ foreach ( $custom_fields as $custom_field_var = $custom_field_value ) { $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $custom_field_var ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq /* Serialize? */ ( maybe_serialize ( $custom_field_value ) ) . '",' ; } } } else /* Otherwise, we use the standardized formats for exportation.*/ { if ( $format === "readable" ) /* Human readable format; easier for some. */ { $line = '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $user - ID ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $user - user_login ) . '",' ; $line .= '"",' ; /* The Password field is left blank on export. */ $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $user - first_name ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $user - last_name ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $user - display_name ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $user - user_email ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $user - user_url ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( reset ( $user - roles ) ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $custom_capabilities ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $registration_date ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $paid_registration_date ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $last_payment_date ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $auto_eot_date ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $custom ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $subscr_id ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $subscr_gateway ) . '",' ; /**/ foreach ( $custom_fields as $custom_field_var = $custom_field_value ) { $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $custom_field_var ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq /* Implode array? */ ( implode ( "|" , ( array ) $custom_field_value ) ) . '",' ; } } else /* Otherwise, we can just use the default re-importation format. */ { $line = '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $user - ID ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $user - user_login ) . '",' ; $line .= '"",' ; /* The Password field is left blank on export. */ $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $user - first_name ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $user - last_name ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $user - display_name ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $user - user_email ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $user - user_url ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( reset ( $user - roles ) ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $custom_capabilities ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $registration_date ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $paid_registration_times ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $last_payment_date ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $auto_eot_date ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $custom ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $subscr_id ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $subscr_gateway ) . '",' ; /**/ foreach ( $custom_fields as $custom_field_var = $custom_field_value ) { $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq ( $custom_field_var ) . '",' ; $line .= '"' . c_ws_plugin__s2member_utils_strings:: esc_dq /* Serialize? */ ( maybe_serialize ( $custom_field_value ) ) . '",' ; } } } /**/ $export .= trim ( $line , " \r \n \t \0 \x0B," ) . "\n" ; } } } /**/ @ ini_set ( "zlib.output_compression" , 0 ) ; /**/ header ( "Accept-Ranges: none" ) ; header ( "Content-Encoding: none" ) ; header ( "Content-Type: text/csv; charset=utf-8" ) ; header ( "Content-Length: " . strlen ( $export ) ) ; header ( "Expires: " . gmdate ( "D, d M Y H:i:s" , strtotime ( "-1 week" ) ) . " GMT" ) ; header ( "Last-Modified: " . gmdate ( "D, d M Y H:i:s" ) . " GMT" ) ; header ( "Cache-Control: no-cache, must-revalidate, max-age=0" ) ; header ( "Cache-Control: post-check=0, pre-check=0" , false ) ; header ( "Pragma: no-cache" ) ; /**/ header ( 'Content-Disposition: attachment; filename="export-' . $start . '-' . ( $start + 249 ) . '.csv"' ) ; /**/ eval ( 'while (@ob_end_clean ());' ) ; /* Clean output buffers. */ /**/ exit ( $export ) ; } } } } ? [ full view ]s2member-pro\includes\classes\exports-in.inc.php Source Code Documentation Packages ( Overview ) Classes Deprecated Todo Index Source Code(!-- :: s-words --)

Statistics: Posted by System Robot — July 11th, 2011, 5:33 pm


]]>
2011-07-09T06:13:35-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13173&p=25468#p25468 <![CDATA[s2Member v111220 / Source Code: s2member-p...]]>
s2Member v111220
Source Code: s2member-pro\includes\classes\exports-in.inc.php
Docs updated: December 20, 2011, 9:51 am

Open for public discussion.
(!-- s-words :: --)n/a(!-- :: s-words --)

Statistics: Posted by System Robot — July 9th, 2011, 6:13 am


]]>