| 1 |
<?php |
| 2 |
/* |
| 3 |
Plugin Name: Profile Builder |
| 4 |
Plugin URI: http://www.cozmoslabs.com/2011/04/12/wordpress-profile-builder-a-front-end-user-registration-login-and-edit-profile-plugin/ |
| 5 |
Description: Login, registration and edit profile shortcodes for the front-end. Also you can chose what fields should be displayed or add new (custom) ones both in the front-end and in the dashboard. |
| 6 |
Version: 1.1.9 |
| 7 |
Author: Reflection Media, Barina Gabriel |
| 8 |
Author URI: http://www.reflectionmedia.ro |
| 9 |
License: GPL2 |
| 10 |
|
| 11 |
== Copyright == |
| 12 |
Copyright 2011 Reflection Media (wwww.reflectionmedia.ro) |
| 13 |
|
| 14 |
This program is free software; you can redistribute it and/or modify |
| 15 |
it under the terms of the GNU General Public License as published by |
| 16 |
the Free Software Foundation; either version 2 of the License, or |
| 17 |
(at your option) any later version. |
| 18 |
This program is distributed in the hope that it will be useful, |
| 19 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 20 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 21 |
GNU General Public License for more details. |
| 22 |
You should have received a copy of the GNU General Public License |
| 23 |
along with this program; if not, write to the Free Software |
| 24 |
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 25 |
*/ |
| 26 |
|
| 27 |
/* |
| 28 |
Original Plugin Name: OptionTree |
| 29 |
Original Plugin URI: http://wp.envato.com |
| 30 |
Original Author: Derek Herman |
| 31 |
Original Author URI: http://valendesigns.com |
| 32 |
*/ |
| 33 |
|
| 34 |
/** |
| 35 |
* Definitions |
| 36 |
* |
| 37 |
* |
| 38 |
*/ |
| 39 |
|
| 40 |
function return_bytes($val) { |
| 41 |
$val = trim($val); |
| 42 |
$last = strtolower($val[strlen($val)-1]); |
| 43 |
switch($last) { |
| 44 |
// The 'G' modifier is available since PHP 5.1.0 |
| 45 |
case 'g': |
| 46 |
$val *= 1024; |
| 47 |
case 'm': |
| 48 |
$val *= 1024; |
| 49 |
case 'k': |
| 50 |
$val *= 1024; |
| 51 |
} |
| 52 |
|
| 53 |
return $val; |
| 54 |
} |
| 55 |
|
| 56 |
|
| 57 |
define( 'ProfileBuilderVersion', '1.1.9' ); |
| 58 |
define( 'wppb_plugin_dir', WP_PLUGIN_DIR . '/' . dirname( plugin_basename( __FILE__ ) ) ); |
| 59 |
define( 'wppb_plugin_url', WP_PLUGIN_URL . '/' . dirname( plugin_basename( __FILE__ ) ) ); |
| 60 |
define( 'ServerMaxUploadSizeByte', return_bytes( ini_get( 'upload_max_filesize') ) ); |
| 61 |
define( 'ServerMaxUploadSizeMega', ini_get( 'upload_max_filesize') ); |
| 62 |
define( 'ServerMaxPostSizeByte', return_bytes( ini_get( 'post_max_size') ) ); |
| 63 |
define( 'ServerMaxPostSizeMega', ini_get( 'post_max_size') ); |
| 64 |
define ('wppb_TRANSLATEDIR', wppb_plugin_dir.'/translation'); |
| 65 |
define ('wppb_TRANSLATIONDOMAIN', 'profilebuilder'); |
| 66 |
|
| 67 |
|
| 68 |
/** |
| 69 |
* Required Files |
| 70 |
* |
| 71 |
* |
| 72 |
*/ |
| 73 |
require_once('functions/functions.load.php'); |
| 74 |
|
| 75 |
$wppb_premiumAdmin = wppb_plugin_dir . '/premium/classes/'; |
| 76 |
if (file_exists ( $wppb_premiumAdmin.'premium.class.admin.php' )){ |
| 77 |
require_once($wppb_premiumAdmin.'premium.class.admin.php'); |
| 78 |
}else{ |
| 79 |
require_once('classes/class.admin.php'); |
| 80 |
} |
| 81 |
|
| 82 |
/* check for updates */ |
| 83 |
$wppb_premiumUpdate = wppb_plugin_dir.'/premium/update/'; |
| 84 |
if (file_exists ($wppb_premiumUpdate.'update-checker.php')){ |
| 85 |
require ($wppb_premiumUpdate.'update-checker.php'); |
| 86 |
$localSerial = get_option( 'wppb_profile_builder_pro_serial' ); |
| 87 |
$MyUpdateChecker = new PluginUpdateChecker('http://cozmoslabs.com/update_metadata.php?localSerialNumber='.$localSerial, __FILE__, 'profile-builder-pro-update'); |
| 88 |
} |
| 89 |
|
| 90 |
|
| 91 |
/** |
| 92 |
* Initialize the translation for the Plugin. |
| 93 |
* |
| 94 |
*/ |
| 95 |
function wppb_init_translation(){ |
| 96 |
load_plugin_textdomain( 'profilebuilder', false, basename( dirname( __FILE__ ) ) . '/translation/' ); |
| 97 |
} |
| 98 |
add_action('init', 'wppb_init_translation'); |
| 99 |
|
| 100 |
/** |
| 101 |
* Instantiate Classe |
| 102 |
* |
| 103 |
* |
| 104 |
*/ |
| 105 |
$PB_Admin = new PB_Admin(); |
| 106 |
|
| 107 |
/** |
| 108 |
* Wordpress Activate/Deactivate |
| 109 |
* |
| 110 |
* @uses register_activation_hook() |
| 111 |
* @uses register_deactivation_hook() |
| 112 |
* |
| 113 |
* |
| 114 |
*/ |
| 115 |
register_activation_hook( __FILE__, array( $PB_Admin, 'profile_builder_activate' ) ); |
| 116 |
register_deactivation_hook( __FILE__, array( $PB_Admin, 'profile_builder_deactivate' ) ); |
| 117 |
|
| 118 |
/** |
| 119 |
* Required action filters |
| 120 |
* |
| 121 |
* @uses add_action() |
| 122 |
* |
| 123 |
* |
| 124 |
*/ |
| 125 |
add_action( 'admin_init', array( $PB_Admin, 'profile_builder_initialize' ) ); |
| 126 |
add_action( 'admin_menu', array( $PB_Admin, 'profile_builder_admin' ) ); |
| 127 |
add_action( 'wp_ajax_profile_builder_add', array( $PB_Admin, 'profile_builder_add' ) ); |
| 128 |
add_action( 'wp_ajax_profile_builder_edit', array( $PB_Admin, 'profile_builder_edit' ) ); |
| 129 |
add_action( 'wp_ajax_profile_builder_delete', array( $PB_Admin, 'profile_builder_delete' ) ); |
| 130 |
add_action( 'wp_ajax_profile_builder_next_id', array( $PB_Admin, 'profile_builder_next_id' ) ); |
| 131 |
add_action( 'wp_ajax_profile_builder_sort', array( $PB_Admin, 'profile_builder_sort' ) ); |