function WYSIJA_help_back() { parent::WYSIJA_help(); //check that the application has been installed properly $config = WYSIJA::get('config', 'model'); define('WYSIJA_DBG', (int) $config->getValue('debug_new')); //by default do not show the errors until we get into the debug file if (!defined('WP_DEBUG') || !WP_DEBUG) { error_reporting(0); ini_set('display_errors', '0'); } add_filter('admin_footer_text', array(&$this, 'admin_footer_text')); add_filter('update_footer', array(&$this, 'update_footer'), 15); //the controller is backend is it from our pages or from wordpress? //are we pluging-in to wordpress interfaces or doing entirely our own page? if (isset($_GET['page']) && substr($_GET['page'], 0, 7) == 'wysija_') { define('WYSIJA_ITF', TRUE); $this->controller = WYSIJA::get(str_replace('wysija_', '', $_GET['page']), 'controller'); } else { //check if we are pluging in wordpress interface define('WYSIJA_ITF', FALSE); } if (WYSIJA_DBG > 0) { include_once WYSIJA_INC . 'debug.php'; } if (!function_exists('dbg')) { function dbg($mixed, $exit = true) { } } //we set up the important hooks for backend: menus js css etc if (defined('DOING_AJAX')) { //difference between frontend and backend add_action('after_setup_theme', array($this, 'ajax_setup')); } else { if (WYSIJA_ITF) { add_action('admin_init', array($this, 'verify_capability'), 1); add_action('admin_init', array($this->controller, 'main')); add_action('after_setup_theme', array($this, 'resolveConflicts')); } //this is a fix for qtranslate as we were loading translatable string quite early //somehow if we add caps to one role the user with that role doesnt get its caps updated ... add_action('after_setup_theme', array('WYSIJA', 'update_user_caps'), 11); add_action('admin_menu', array($this, 'define_translated_strings'), 98); add_action('admin_menu', array($this, 'add_menus'), 99); add_action('admin_enqueue_scripts', array($this, 'add_js'), 10, 1); //add specific page script add_action('admin_head-post-new.php', array($this, 'addCodeToPagePost')); add_action('admin_head-post.php', array($this, 'addCodeToPagePost')); //make sure that admin and super admin always have the highest access $wptools = WYSIJA::get('wp_tools', 'helper'); $wptools->set_default_rolecaps(); // Hook the warning function for premium. add_action('admin_init', array(&$this, 'warn_action_on_premium')); } //if the comment form option is activated then we add an approval action if ($config->getValue('commentform')) { add_action('wp_set_comment_status', array($this, 'comment_approved'), 60, 2); } }
function WYSIJA_help_back() { parent::WYSIJA_help(); $config =& WYSIJA::get('config', 'model'); define('WYSIJA_DBG', (int) $config->getValue('debug_new')); if (!defined('WP_DEBUG') || !WP_DEBUG) { error_reporting(0); ini_set('display_errors', '0'); } if (isset($_GET['page']) && substr($_GET['page'], 0, 7) == 'wysija_') { define('WYSIJA_ITF', TRUE); $this->controller =& WYSIJA::get(str_replace('wysija_', '', $_GET['page']), 'controller'); } else { define('WYSIJA_ITF', FALSE); } if (WYSIJA_DBG > 0) { include_once WYSIJA_INC . 'debug.php'; } if (!function_exists('dbg')) { function dbg($mixed, $exit = true) { } } if (defined('DOING_AJAX')) { if (!isset($_REQUEST['adminurl']) && !isset($_REQUEST['wysilog'])) { add_action('wp_ajax_nopriv_wysija_ajax', array($this, 'ajax')); } else { add_action('wp_ajax_wysija_ajax', array($this, 'ajax')); } } else { if (WYSIJA_ITF) { add_action('admin_init', array($this->controller, 'main')); if (!isset($_REQUEST['action']) || isset($_REQUEST['action']) && $_REQUEST['action'] !== 'editTemplate') { add_action('admin_footer', array($this, 'version'), 9); } add_action('after_setup_theme', array($this, 'resolveConflicts')); } add_action('after_setup_theme', array('WYSIJA', 'update_user_caps'), 11); add_action('admin_menu', array($this, 'define_translated_strings'), 98); add_action('admin_menu', array($this, 'add_menus'), 99); add_action('admin_enqueue_scripts', array($this, 'add_js'), 10, 1); add_action('admin_head-post-new.php', array($this, 'addCodeToPagePost')); add_action('admin_head-post.php', array($this, 'addCodeToPagePost')); $wptools =& WYSIJA::get('wp_tools', 'helper'); $wptools->set_default_rolecaps(); } if ($config->getValue('premium_key') && !WYSIJA::is_plugin_active('wysija-newsletters-premium/index.php')) { add_filter('pre_set_site_transient_update_plugins', array($this, 'prevent_update_wysija')); add_filter('http_request_args', array($this, 'disable_wysija_version_requests'), 5, 2); if (file_exists(WYSIJA_PLG_DIR . 'wysija-newsletters-premium' . DS . 'index.php')) { $this->notice('<h1>' . __('You need to activate the wysija premium plugin.', WYSIJA) . ' <a id="install-wjp" class="wysija-premium-btns wysija-premium" href="admin.php?page=wysija_campaigns&action=install_wjp">' . __('Activate now.', WYSIJA) . '</a></h1>'); } else { $readmoreaboutchange = str_replace(array('[link]', '[/link]'), array('<a href="http://support.wysija.com/knowledgebase/premium-users-get-their-own-extra-plugin/" target="_blank">', '</a>'), __('Premium users [link]need to install[/link] an additional plugin.', WYSIJA)); $this->notice('<h1>' . $readmoreaboutchange . ' <a id="install-wjp" class="wysija-premium-btns wysija-premium" href="admin.php?page=wysija_campaigns&action=install_wjp">' . __('Install now in one click.', WYSIJA) . '</a></h1>'); } $this->controller->jsTrans['instalwjp'] = 'Installing Wysija Newsletter Premium plugin'; } }
function WYSIJA_help_front() { parent::WYSIJA_help(); if (isset($_REQUEST['wysija-page']) || isset($_REQUEST['wysija-launch'])) { if (defined('DOING_AJAX')) { add_action('wp_ajax_nopriv_wysija_ajax', array($this, 'ajax')); } else { $paramscontroller = $_REQUEST['controller']; if ($paramscontroller == 'stat') { $paramscontroller = 'stats'; } $this->controller =& WYSIJA::get($paramscontroller, 'controller'); if (method_exists($this->controller, $_REQUEST['action'])) { add_action('init', array($this->controller, $_REQUEST['action'])); } else { $this->error('Action does not exist.'); } if (isset($_REQUEST['wysija-page'])) { add_filter('wp_title', array($this, 'meta_page_title')); add_filter('the_title', array($this, 'scan_title')); add_filter('the_content', array($this, 'scan_content'), 98); if (isset($_REQUEST['message_success'])) { add_filter('the_content', array($this, 'scan_content_NLform'), 99); } } if (isset($_REQUEST['wysija-page'])) { add_filter('wp_title', array($this, 'meta_page_title')); add_filter('the_title', array($this, 'scan_title')); add_filter('the_content', array($this, 'scan_content'), 98); if (isset($_REQUEST['message_success'])) { add_filter('the_content', array($this, 'scan_content_NLform'), 99); } } } } else { add_filter('the_content', array($this, 'scan_content_NLform'), 99); add_shortcode('wysija_form', array($this, 'scan_form_shortcode')); $mConfig =& WYSIJA::get('config', 'model'); if ($mConfig->getValue('commentform')) { add_action('comment_form', array($this, 'comment_form_extend')); add_action('comment_post', array($this, 'comment_posted'), 60, 2); } if ($mConfig->getValue('registerform')) { if (is_multisite()) { add_action('signup_extra_fields', array($this, 'register_form_extend')); add_filter('wpmu_validate_user_signup', array($this, 'registerms_posted'), 60, 3); } else { add_action('register_form', array($this, 'register_form_extend')); add_action('register_post', array($this, 'register_posted'), 60, 3); } if (WYSIJA::is_plugin_active('buddypress/bp-loader.php')) { add_action('bp_after_signup_profile_fields', array($this, 'register_form_bp_extend')); add_action('bp_signup_validate', array($this, 'register_bp'), 60, 3); } } } }
function WYSIJA_help_back() { parent::WYSIJA_help(); $config =& WYSIJA::get('config', 'model'); define('WYSIJA_DBG', (int) $config->getValue('debug_new')); if (!defined('WP_DEBUG') || !WP_DEBUG) { error_reporting(0); ini_set('display_errors', '0'); } if (isset($_GET['page']) && substr($_GET['page'], 0, 7) == 'wysija_') { define('WYSIJA_ITF', TRUE); $this->controller =& WYSIJA::get(str_replace('wysija_', '', $_GET['page']), 'controller'); } else { //check if we are pluging in wordpress interface define('WYSIJA_ITF', FALSE); } if (WYSIJA_DBG > 0) { include_once WYSIJA_INC . 'debug.php'; } if (!function_exists('dbg')) { function dbg($mixed, $exit = true) { } } if (defined('DOING_AJAX')) { add_action('after_setup_theme', array($this, 'ajax_setup')); } else { if (WYSIJA_ITF) { add_action('admin_init', array($this->controller, 'main')); if (!isset($_REQUEST['action']) || isset($_REQUEST['action']) && $_REQUEST['action'] !== 'editTemplate') { add_action('admin_footer', array($this, 'version'), 9); } add_action('after_setup_theme', array($this, 'resolveConflicts')); } add_action('after_setup_theme', array('WYSIJA', 'update_user_caps'), 11); add_action('admin_menu', array($this, 'define_translated_strings'), 98); add_action('admin_menu', array($this, 'add_menus'), 99); add_action('admin_enqueue_scripts', array($this, 'add_js'), 10, 1); add_action('admin_head-post-new.php', array($this, 'addCodeToPagePost')); add_action('admin_head-post.php', array($this, 'addCodeToPagePost')); $wptools =& WYSIJA::get('wp_tools', 'helper'); $wptools->set_default_rolecaps(); if ($config->getValue('premium_key') && !WYSIJA::is_plugin_active('wysija-newsletters-premium/index.php')) { add_filter('pre_set_site_transient_update_plugins', array($this, 'prevent_update_wysija')); add_filter('http_request_args', array($this, 'disable_wysija_version_requests'), 5, 2); if (file_exists(WYSIJA_PLG_DIR . 'wysija-newsletters-premium' . DS . 'index.php')) { $this->notice('<p>' . __('You need to activate the Wysija Premium plugin.', WYSIJA) . ' <a id="install-wjp" class="button-primary" href="admin.php?page=wysija_campaigns&action=install_wjp">' . __('Activate now', WYSIJA) . '</a></p>'); } else { $this->notice('<p>' . __('Congrats, your Premium license is active. One last step...', WYSIJA) . ' <a id="install-wjp" class="button-primary" href="admin.php?page=wysija_campaigns&action=install_wjp">' . __('Install the Premium plugin.', WYSIJA) . '</a></p>'); } $this->controller->jsTrans['instalwjp'] = 'Installing Wysija Newsletter Premium plugin'; } } if ($config->getValue('commentform')) { add_action('wp_set_comment_status', array($this, 'comment_approved'), 60, 2); } }
function WYSIJA_help_back() { parent::WYSIJA_help(); $config =& WYSIJA::get('config', 'model'); define('WYSIJA_DBG', (int) $config->getValue('debug_new')); error_reporting(0); ini_set('display_errors', '0'); if (isset($_GET['page']) && substr($_GET['page'], 0, 7) == 'wysija_') { define('WYSIJA_ITF', TRUE); $this->controller =& WYSIJA::get(str_replace('wysija_', '', $_GET['page']), 'controller'); } else { define('WYSIJA_ITF', FALSE); } if (WYSIJA_DBG > 0) { include_once WYSIJA_INC . 'debug.php'; } if (!function_exists('dbg')) { function dbg($mixed, $exit = true) { } } if (defined('DOING_AJAX')) { if (!isset($_REQUEST['adminurl']) && !isset($_REQUEST['wysilog'])) { add_action('wp_ajax_nopriv_wysija_ajax', array($this, 'ajax')); } else { add_action('wp_ajax_wysija_ajax', array($this, 'ajax')); } } else { if (WYSIJA_ITF) { add_action('admin_init', array($this->controller, 'main')); if (!isset($_REQUEST['action']) || isset($_REQUEST['action']) && $_REQUEST['action'] !== 'editTemplate') { add_action('admin_footer', array($this, 'version'), 9); } add_action('after_setup_theme', array($this, 'resolveConflicts')); } add_action('after_setup_theme', array('WYSIJA', 'update_user_caps'), 11); add_action('admin_menu', array($this, 'define_translated_strings'), 98); add_action('admin_menu', array($this, 'add_menus'), 99); add_action('admin_enqueue_scripts', array($this, 'add_js'), 10, 1); add_action('admin_head-post-new.php', array($this, 'addCodeToPagePost')); add_action('admin_head-post.php', array($this, 'addCodeToPagePost')); $wptools =& WYSIJA::get('wp_tools', 'helper'); $wptools->set_default_rolecaps(); } }
function WYSIJA_help_front() { parent::WYSIJA_help(); if (isset($_REQUEST['wysija-page']) || isset($_REQUEST['wysija-launch'])) { if (defined('DOING_AJAX')) { add_action('wp_ajax_nopriv_wysija_ajax', array($this, 'ajax')); } else { $paramscontroller = $_REQUEST['controller']; if ($paramscontroller == 'stat') { $paramscontroller = 'stats'; } $this->controller =& WYSIJA::get($paramscontroller, 'controller'); if (method_exists($this->controller, $_REQUEST['action'])) { add_action('init', array($this->controller, $_REQUEST['action'])); } else { $this->error('Action does not exists.'); } if (isset($_REQUEST['wysija-page'])) { add_filter('wp_title', array($this, 'meta_page_title')); add_filter('the_title', array($this, 'scan_title')); add_filter('the_content', array($this, 'scan_content'), 98); if (isset($_REQUEST['message_success'])) { add_filter('the_content', array($this, 'scan_content_NLform'), 99); } } if (isset($_REQUEST['wysija-page'])) { add_filter('wp_title', array($this, 'meta_page_title')); add_filter('the_title', array($this, 'scan_title')); add_filter('the_content', array($this, 'scan_content'), 98); if (isset($_REQUEST['message_success'])) { add_filter('the_content', array($this, 'scan_content_NLform'), 99); } } } } else { add_filter('the_content', array($this, 'scan_content_NLform'), 99); $mConfig =& WYSIJA::get('config', 'model'); if ($mConfig->getValue('commentform')) { add_action('comment_form', array($this, 'comment_form_extend')); add_action('comment_post', array($this, 'comment_posted'), 60, 2); } } }
function WYSIJA_help_front() { parent::WYSIJA_help(); if (isset($_REQUEST['wysija-page']) || isset($_REQUEST['wysija-launch'])) { if (defined('DOING_AJAX')) { add_action('wp_ajax_nopriv_wysija_ajax', array($this, 'ajax')); } else { $paramscontroller = $_REQUEST['controller']; if ($paramscontroller == 'stat') { $paramscontroller = 'stats'; } $this->controller =& WYSIJA::get($paramscontroller, "controller"); if (method_exists($this->controller, $_REQUEST['action'])) { add_action('init', array($this->controller, $_REQUEST['action'])); } else { $this->error("Action does not exists."); } if (isset($_REQUEST['wysija-page'])) { add_filter('wp_title', array($this, 'meta_page_title')); add_filter('the_title', array($this, 'scan_title')); add_filter('the_content', array($this, 'scan_content')); if (isset($_REQUEST['message_success'])) { add_filter('the_content', array($this, 'scan_content_NLform')); } } if (isset($_REQUEST['wysija-page'])) { add_filter('wp_title', array($this, 'meta_page_title')); add_filter('the_title', array($this, 'scan_title')); add_filter('the_content', array($this, 'scan_content')); if (isset($_REQUEST['message_success'])) { add_filter('the_content', array($this, 'scan_content_NLform')); } } } } else { add_filter('the_content', array($this, 'scan_content_NLform')); } }
function WYSIJA_help_backloader() { parent::WYSIJA_help(); }
function WYSIJA_help_licence(){ parent::WYSIJA_help(); }
public function admin_body_class($body_class_str) { if (WYSIJA_help::$admin_body_class_runner === true) { return $body_class_str; } WYSIJA_help::$admin_body_class_runner = true; global $wp_version; $class = array(); if (!empty($body_class_str)) { $class = explode(' ', $body_class_str); } if ('3.8' === $wp_version) { $class[] = 'mp-menu-icon-font'; } if (version_compare($wp_version, '3.8', '<')) { $class[] = 'mp-menu-icon-bg'; } else { $class[] = 'mpoet-ui'; } return implode(' ', $class); }
function WYSIJA_help_back() { parent::WYSIJA_help(); //check that the application has been installed properly $config = WYSIJA::get('config', 'model'); define('WYSIJA_DBG', (int) $config->getValue('debug_new')); //by default do not show the errors until we get into the debug file if (!defined('WP_DEBUG') || !WP_DEBUG) { error_reporting(0); ini_set('display_errors', '0'); } //the controller is backend is it from our pages or from wordpress? //are we pluging-in to wordpress interfaces or doing entirely our own page? if (isset($_GET['page']) && substr($_GET['page'], 0, 7) == 'wysija_') { define('WYSIJA_ITF', TRUE); $this->controller = WYSIJA::get(str_replace('wysija_', '', $_GET['page']), 'controller'); } else { //check if we are pluging in wordpress interface define('WYSIJA_ITF', FALSE); } if (WYSIJA_DBG > 0) { include_once WYSIJA_INC . 'debug.php'; } if (!function_exists('dbg')) { function dbg($mixed, $exit = true) { } } //we set up the important hooks for backend: menus js css etc if (defined('DOING_AJAX')) { //difference between frontend and backend add_action('after_setup_theme', array($this, 'ajax_setup')); } else { if (WYSIJA_ITF) { add_action('admin_init', array($this->controller, 'main')); if (!isset($_REQUEST['action']) || isset($_REQUEST['action']) && $_REQUEST['action'] !== 'editTemplate') { add_action('admin_footer', array($this, 'version'), 9); } add_action('after_setup_theme', array($this, 'resolveConflicts')); } //this is a fix for qtranslate as we were loading translatable string quite early //somehow if we add caps to one role the user with that role doesnt get its caps updated ... add_action('after_setup_theme', array('WYSIJA', 'update_user_caps'), 11); add_action('admin_menu', array($this, 'define_translated_strings'), 98); add_action('admin_menu', array($this, 'add_menus'), 99); add_action('admin_enqueue_scripts', array($this, 'add_js'), 10, 1); //add specific page script add_action('admin_head-post-new.php', array($this, 'addCodeToPagePost')); add_action('admin_head-post.php', array($this, 'addCodeToPagePost')); //make sure that admin and super admin always have the highest access $wptools = WYSIJA::get('wp_tools', 'helper'); $wptools->set_default_rolecaps(); //code disabling updates for premium users who dont have WJP activated if ($config->getValue('premium_key') && !WYSIJA::is_plugin_active('wysija-newsletters-premium/index.php')) { if (file_exists(WYSIJA_PLG_DIR . 'wysija-newsletters-premium' . DS . 'index.php')) { //send a message to the user so that he activates the premium plugin or try to fetch it directly. $this->notice('<p>' . __('You need to activate the Wysija Premium plugin.', WYSIJA) . ' <a id="install-wjp" class="button-primary" href="admin.php?page=wysija_campaigns&action=install_wjp">' . __('Activate now', WYSIJA) . '</a></p>'); } else { //send a message to the user so that he gets the premium plugin or try to fetch it directly. $this->notice('<p>' . __('Congrats, your Premium license is active. One last step...', WYSIJA) . ' <a id="install-wjp" class="button-primary" href="admin.php?page=wysija_campaigns&action=install_wjp">' . __('Install the Premium plugin.', WYSIJA) . '</a></p>'); } $this->controller->jsTrans['instalwjp'] = 'Installing Wysija Newsletter Premium plugin'; } } //if the comment form option is activated then we add an approval action if ($config->getValue('commentform')) { add_action('wp_set_comment_status', array($this, 'comment_approved'), 60, 2); } // if the beta mode is on we look for the updates on a different server if ($config->getValue('beta_mode')) { $package_helper = WYSIJA::get('package', 'helper'); $package_helper->set_package('wysija-newsletters'); } }
function WYSIJA_help_front(){ parent::WYSIJA_help(); /*if(defined('WYSIJA_DBG_ALL')){ $config=WYSIJA::get('config','model'); define('WYSIJA_DBG',(int)$config->getValue('debug_new')); if(WYSIJA_DBG>0) include_once(WYSIJA_INC.'debug.php'); if(!function_exists('dbg')) { function dbg($mixed,$exit=true){} } }*/ /* the controller is frontend if there is any wysija data requested */ /*$config=WYSIJA::get("config","model"); if($config->getValue("debug_on")) include_once(WYSIJA_INC."debug.php");*/ //include_once(WYSIJA_INC."debug.php"); // wysija form shortcode add_shortcode('wysija_form', array($this,'scan_form_shortcode')); // wysija total of subscribers shortcode add_shortcode('wysija_subscribers_count', array($this,'scan_subscribers_count_shortcode')); /* We try to process the least possible code */ if(isset($_REQUEST['wysija-page']) || isset($_REQUEST['wysija-launch'])){ if(defined('DOING_AJAX')){ add_action('wp_ajax_nopriv_wysija_ajax', array($this, 'ajax')); }else{ $paramscontroller=$_REQUEST['controller']; //this is an exception on one server this params stats was not accepted if($paramscontroller=='stat') $paramscontroller='stats'; $this->controller=WYSIJA::get($paramscontroller,'controller'); if(isset($_REQUEST['action']) && method_exists($this->controller, $_REQUEST['action'])){ add_action('init',array($this->controller,$_REQUEST['action'])); //$this->controller->$_REQUEST['action'](); }else $this->error('Action does not exist.'); if(isset($_REQUEST['wysija-page'])){ /* set the content filter to replace the shortcode */ add_filter('wp_title', array($this,'meta_page_title')); add_filter( 'the_title', array($this,'scan_title')); add_filter( 'the_content', array($this,'scan_content'),98); if(isset($_REQUEST['message_success'])){ add_filter( 'the_content', array($this,'scan_content_NLform'),99 ); } } if(isset($_REQUEST['wysija-page'])){ /* set the content filter to replace the shortcode */ add_filter('wp_title', array($this,'meta_page_title')); add_filter( 'the_title', array($this,'scan_title')); add_filter( 'the_content', array($this,'scan_content'),98); if(isset($_REQUEST['message_success'])){ add_filter( 'the_content', array($this,'scan_content_NLform'),99 ); } } } }else{ add_filter('the_content', array($this,'scan_content_NLform'),99 ); //if the comment form checkbox option is activated we add some hooks to process it $mConfig=WYSIJA::get('config','model'); if($mConfig->getValue('commentform')){ add_action('comment_form', array($this,'comment_form_extend')); add_action('comment_post', array($this,'comment_posted'), 60,2); } //if the register form checkbox option is activated we add some hooks to process it if($mConfig->getValue('registerform')){ if(is_multisite()){ add_action('signup_extra_fields', array($this,'register_form_extend')); // we need this condition otherwise we will send two confirmation emails when on ms with buddypress if(!WYSIJA::is_plugin_active('buddypress/bp-loader.php')){ add_filter('wpmu_validate_user_signup', array($this,'registerms_posted'), 60,3); } }else{ add_action('register_form', array($this,'register_form_extend')); add_action('register_post', array($this,'register_posted'), 60,3); } if(WYSIJA::is_plugin_active('buddypress/bp-loader.php')){ add_action('bp_after_signup_profile_fields', array($this,'register_form_bp_extend')); add_action('bp_signup_validate', array($this,'register_bp'),60,3); // we can have just one activation for the wp user and the wysija confirmation when bp and multisite are activated if(is_multisite()){ add_action('wpmu_activate_user', array($this,'wpmu_activate_user')); } } } } }
function __construct() { parent::__construct(); // wysija form shortcode add_shortcode('wysija_form', array($this, 'scan_form_shortcode')); // wysija total of subscribers shortcode add_shortcode('wysija_subscribers_count', array($this, 'scan_subscribers_count_shortcode')); // init shortcode [wysija_archive] require_once WYSIJA_CORE . 'controller.php'; require_once WYSIJA_CORE . 'module' . DS . 'module.php'; // @todo: move to autoloader $archive_std = WYSIJA_module::get_instance_by_name('archive_std'); // implement hook "wysija_front_init() if (!empty($archive_std) && is_a($archive_std, 'WYSIJA_module')) { $archive_std->front_init(); } /* We try to process the least possible code */ if (isset($_REQUEST['wysija-page']) || isset($_REQUEST['wysija-launch'])) { if (defined('DOING_AJAX')) { add_action('wp_ajax_nopriv_wysija_ajax', array($this, 'ajax')); } else { $paramscontroller = $_REQUEST['controller']; //this is an exception on one server this params stats was not accepted if ($paramscontroller == 'stat') { $paramscontroller = 'stats'; } $this->controller = WYSIJA::get($paramscontroller, 'controller'); if (isset($_REQUEST['action']) && method_exists($this->controller, $_REQUEST['action'])) { add_action('init', array($this->controller, $_REQUEST['action'])); //$this->controller->$_REQUEST['action'](); } else { $this->error('Action does not exist.'); } if (isset($_REQUEST['wysija-page'])) { /* set the content filter to replace the shortcode */ add_filter('wp_title', array($this, 'meta_page_title')); add_filter('the_title', array($this, 'scan_title')); add_filter('the_content', array($this, 'scan_content'), 98); if (isset($_REQUEST['message_success'])) { add_filter('the_content', array($this, 'scan_content_NLform'), 99); } } } } else { add_filter('the_content', array($this, 'scan_content_NLform'), 99); //if the comment form checkbox option is activated we add some hooks to process it $model_config = WYSIJA::get('config', 'model'); if ($model_config->getValue('commentform')) { add_action('comment_form', array($this, 'comment_form_extend')); add_action('comment_post', array($this, 'comment_posted'), 60, 2); } // if the register form checkbox option is activated we add some hooks to process it if ($model_config->getValue('registerform')) { if (is_multisite()) { add_action('signup_extra_fields', array($this, 'register_form_extend')); // we need this condition otherwise we will send two confirmation emails when on ms with buddypress if (!WYSIJA::is_plugin_active('buddypress/bp-loader.php')) { add_filter('wpmu_validate_user_signup', array($this, 'registerms_posted'), 60, 3); } } else { add_action('register_form', array($this, 'register_form_extend')); add_action('register_post', array($this, 'register_posted'), 60, 3); } // special case when buddypress is activated if (WYSIJA::is_plugin_active('buddypress/bp-loader.php')) { add_action('bp_after_signup_profile_fields', array($this, 'register_form_bp_extend')); add_action('bp_signup_validate', array($this, 'register_bp'), 60, 3); // we can have just one confirmation email for the wp user and the wysija confirmation when bp and multisite are activated if (is_multisite()) { add_action('wpmu_activate_user', array($this, 'wpmu_activate_user')); } } } } }
function __construct() { parent::__construct(); }