Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *
- * @ This file is created by deZender.Net
- * @ deZender (PHP5 Decoder for ionCube Encoder)
- *
- * @ Version : 1.1.6.0
- * @ Author : DeZender
- * @ Release on : 02.06.2013
- * @ Official site : http://DeZender.Net
- *
- */
- function wpmlm_query_vars_product_list($vars) {
- if (( 'wpmlm-product' != $vars['post_type'] || in_array( $vars['orderby'], array( 'meta_value_num', 'meta_value' ) ) )) {
- return $vars;
- }
- $vars['posts_per_archive_page'] = 0;
- if (( is_admin( ) && isset( $vars['orderby'] ) )) {
- $vars['orderby'] = 'date';
- $vars['order'] = 'desc';
- $vars['nopaging'] = false;
- $posts_per_page = (int)get_user_option( 'edit_wpmlm_product_per_page' );
- $vars['posts_per_page'] = ($posts_per_page ? $posts_per_page : 20);
- }
- if ('dragndrop' == get_option( 'wpmlm_sort_by' )) {
- $vars['orderby'] = 'menu_order title';
- $vars['order'] = 'desc';
- $vars['nopaging'] = true;
- }
- return $vars;
- }
- /**
- * setting the screen option to between 1 and 999
- * @access public
- *
- * @since 3.8
- * @param $status
- * @param $option (string) name of option being saved
- * @param $value (string) value of option being saved
- * @return $value after changes...
- */
- function wpmlm_set_screen_option($status, $option, $value) {
- if (in_array( $option, array( 'edit_wpmlm_variation_per_page', 'edit_wpmlm_product_per_page' ) )) {
- if ('edit_wpmlm_variation_per_page' == $option) {
- global $user_ID;
- update_user_option( $user_ID, 'edit_wpmlm-variation_per_page', $value );
- }
- return $value;
- }
- }
- /**
- * When rearranging the products for drag and drop it is easiest to arrange them when they are all on the same page...
- * @access public (wp-admin)
- *
- * @since 3.8
- * @param $per_page (int) number of products per page
- * @param $post_type (string) name of current post type
- * @return $per_page after changes...
- */
- function wpmlm_drag_and_drop_ordering($per_page, $post_type) {
- global $wpdb;
- if (( ( 'wpmlm-product' == $post_type && 'dragndrop' == get_option( 'wpmlm_sort_by' ) ) && $count = $wpdb->get_var( '' . 'SELECT COUNT(*) FROM ' . $wpdb->posts . ' WHERE `post_type`=\'wpmlm-product\' AND `post_parent`=0' ) )) {
- $per_page = $count;
- }
- return $per_page;
- }
- /**
- * Checks whether to display or hide the update wp-e-commerce link
- *
- * @access public
- *
- * @since 3.8
- * @return boolean true - show link, false- hide link
- */
- function wpmlm_show_update_link() {
- global $wpdb;
- $sql = 'SHOW TABLES LIKE "' . $wpdb->prefix . 'wpmlm_product_list"';
- $var = $wpdb->get_var( $sql );
- if (( !empty( $var ) && false == get_option( 'wpmlm_hide_update' ) )) {
- return true;
- }
- return false;
- }
- /**
- * wpmlm_admin_pages function, all the definitons of admin pages are stores here.
- * No parameters, returns nothing
- *
- * Fairly standard wordpress plugin API stuff for adding the admin pages, rearrange the order to rearrange the pages
- * The bits to display the options page first on first use may be buggy, but tend not to stick around long enough to be identified and fixed
- * if you find bugs, feel free to fix them.
- *
- * If the permissions are changed here, they will likewise need to be changed for the other sections of the admin that either use ajax
- * or bypass the normal download system.
- */
- function wpmlm_admin_pages() {
- if (isset( $_GET['wpmlm_activate_debug_page'] )) {
- if ('true' == $_GET['wpmlm_activate_debug_page']) {
- $_SESSION['wpmlm_activate_debug_page'] = true;
- } else {
- if ('false' == $_GET['wpmlm_activate_debug_page']) {
- $_SESSION['wpmlm_activate_debug_page'] = false;
- }
- }
- }
- if (wpmlm_show_update_link( )) {
- $page_hooks[] = add_submenu_page( 'index.php', __( 'Update Store', 'wpmlm' ), __( 'Store Update', 'wpmlm' ), 'administrator', 'wpmlm-update', 'wpmlm_display_update_page' );
- }
- $iconURL = WPMLM_CORE_IMAGES_URL . '/binary-tree-icon.png';
- $page_hooks[] = add_menu_page( 'eCommerce MLM', 'eCommerce MLM', 'administrator', 'wpmlm-ecommerce', 'wpmlm_display_purchase_logs_page', $iconURL );
- $page_hooks[] = $purchase_logs_page = add_submenu_page( 'wpmlm-ecommerce', __( 'Sales', 'wpmlm' ), __( 'Sales', 'wpmlm' ), 'administrator', 'wpmlm-ecommerce', 'wpmlm_display_purchase_logs_page' );
- $page_hooks[] = $wpmlm_report_page = add_submenu_page( 'wpmlm-ecommerce', __( 'MLM Reports', 'wpmlm' ), __( 'MLM Reports', 'wpmlm' ), 'administrator', 'wpmlm-admin-tasks', 'display_wpmlm_page' );
- $page_hooks[] = $wpmlm_member_profile_page = add_submenu_page( 'wpmlm-ecommerce', __( 'Members Info', 'wpmlm' ), __( 'Members Info', 'wpmlm' ), 'administrator', 'wpmlm-member-profile', 'display_wpmlm_member_profile_page' );
- $products_page = 'edit.php?post_type=wpmlm-product';
- $page_hooks[] = $edit_coupons_page = add_submenu_page( $products_page, __( 'Coupons', 'wpmlm' ), __( 'Coupons', 'wpmlm' ), 'administrator', 'wpmlm-edit-coupons', 'wpmlm_display_coupons_page' );
- $page_hooks[] = $edit_options_page = add_submenu_page( 'wpmlm-ecommerce', __( 'Shopping Cart Setting', 'wpmlm' ), __( 'Shopping Cart Setting', 'wpmlm' ), 'administrator', 'wpmlm-settings', 'wpmlm_display_settings_page' );
- add_action( 'admin_print_scripts-' . $edit_options_page, 'wpmlm_print_admin_scripts' );
- $page_hooks[] = $wpmlm_mlmsetting_page = add_submenu_page( 'wpmlm-ecommerce', __( 'MLM Settings', 'wpmlm' ), __( 'MLM Settings', 'wpmlm' ), 'administrator', 'wpmlm-mlmsettings', 'wpmlm_display_mlm_settings_page' );
- if (( ( defined( 'WPMLM_ADD_DEBUG_PAGE' ) && WPMLM_ADD_DEBUG_PAGE == true ) || ( isset( $_SESSION['wpmlm_activate_debug_page'] ) && true == $_SESSION['wpmlm_activate_debug_page'] ) )) {
- $page_hooks[] = add_options_page( __( 'Store Debug', 'wpmlm' ), __( 'Store Debug', 'wpmlm' ), 'administrator', 'wpmlm-debug', 'wpmlm_debug_page' );
- }
- $page_hooks = apply_filters( 'wpmlm_additional_pages', $page_hooks, $products_page );
- do_action( 'wpmlm_add_submenu' );
- foreach ($page_hooks as $page_hook) {
- add_action( 'load-' . $page_hook, 'wpmlm_admin_include_css_and_js_refac' );
- switch ($page_hook) {
- case $edit_options_page: {
- add_action( 'load-' . $page_hook, 'wpmlm_admin_include_optionspage_css_and_js' );
- break;
- }
- case $wpmlm_report_page: {
- add_action( 'load-' . $page_hook, 'wpmlm_admin_include_report_page_css_and_js' );
- add_action( 'load-' . $page_hook . '2', 'cmi_add_option' );
- break;
- }
- case $wpmlm_member_profile_page: {
- add_action( 'load-' . $page_hook, 'wpmlm_admin_include_member_profile_page_css_and_js' );
- break;
- }
- case $wpmlm_mlmsetting_page: {
- add_action( 'load-' . $page_hook, 'wpmlm_admin_include_wpmlm_setting_page_css_and_js' );
- break;
- }
- ......................................................................................................
- .......................................................
- ..........
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement