/** * Sends welcome email to user after registeration * @author Howard <*****@*****.**> * @static * @param array $params * @return boolean */ public static function user_registered($params) { $replacements = $params[0]; $notification = new wpl_notifications('email'); $notification->prepare(5, $replacements); /** Disabled **/ if (!$notification->notification_data['enabled']) { return false; } $user = wpl_users::get_user($params[0]['user_id']); $replacements['name'] = isset($user->data->wpl_data) ? $user->data->wpl_data->first_name : $user->data->display_name; $replacements['password'] = $params[0]['password']; $replacements['username'] = $user->data->user_login; $link = wpl_global::get_wp_site_url(); $replacements['site_address'] = '<a target="_blank" href="' . $link . '">' . $link . '</a>'; $notification->replacements = $notification->set_replacements($replacements); $notification->rendered_content = $notification->render_notification_content(); $notification->recipients = $notification->set_recipients(array($user->data->user_email)); $notification->send(); return true; }
/** * Adding js dynamic vars to the head of page * @author Howard <*****@*****.**> * @return void */ public function import_dynamic_js() { echo '<script type="text/javascript">'; echo 'wpl_baseUrl="' . wpl_global::get_wp_site_url() . '";'; echo 'wpl_baseName="' . WPL_BASENAME . '";'; echo '</script>'; }
/** * This functions will take care of multisite usage * @author Howard <*****@*****.**> * @param type $blog_id * @return string WPL base url for uploaded files */ public static function get_upload_base_url($blog_id = NULL) { if (!$blog_id) { $blog_id = wpl_global::get_current_blog_id(); } $ABSPATH = WPL_UP_ABSPATH; if (!$blog_id or $blog_id == 1) { return wpl_global::get_wp_site_url() . 'wp-content/uploads/WPL/'; } else { $path = rtrim($ABSPATH, DS) . $blog_id . DS; if (!wpl_folder::exists($path)) { wpl_folder::create($path); } return wpl_global::get_wp_site_url() . 'wp-content/uploads/WPL' . $blog_id . '/'; } }
load-scripts.php?c=1&load[]=jquery-core,jquery-migrate&ver=<?php echo wpl_global::wp_version(); ?> "></script> <script type="text/javascript"> wpl_baseUrl="<?php echo wpl_global::get_wp_site_url(); ?> "; wpl_baseName="<?php echo WPL_BASENAME; ?> "; </script> <script type="text/javascript" src="<?php echo wpl_global::get_wp_site_url() . 'wp-includes/js/tinymce/tiny_mce_popup.js'; ?> "></script> <script type="text/javascript" src="<?php echo wpl_global::get_wpl_asset_url('js/prettyJS/jquery.prettyPhoto.min.js'); ?> "></script> <script type="text/javascript" src="<?php echo wpl_global::get_wpl_asset_url('js/libraries/wpl.jquery.mcustomscrollbar.min.js'); ?> "></script> <script type="text/javascript" src="<?php echo wpl_global::get_wpl_asset_url('js/libraries/wpl.jquery.chosen.min.js'); ?> "></script>
{ var term = request.term.toUpperCase(), items = []; for(var key in autocomplete_cache) { if(key === term) { response(autocomplete_cache[key]); return; } } wplj.ajax( { type: "GET", url: "' . wpl_global::get_wp_site_url() . '?wpl_format=f:property_listing:ajax&wpl_function=locationtextsearch_autocomplete&term="+request.term, contentType: "application/json; charset=utf-8", success: function (msg) { response(wplj.parseJSON(msg)); autocomplete_cache[request.term.toUpperCase()] = wplj.parseJSON(msg); }, error: function (msg) { } }); }, width: 260, matchContains: true, minChars: 1, delay: 300
/** no direct access **/ defined('_WPLEXEC') or die('Restricted access'); ?> <script type="text/javascript"> function wpl_send_contact(property_id) { var ajax_loader_element = '#wpl_contact_ajax_loader_'+property_id; wplj(ajax_loader_element).html('<img src="<?php echo wpl_global::get_wpl_asset_url('img/ajax-loader3.gif'); ?> " />'); wpl_remove_message('#wpl_contact_message_'+property_id); var request_str = 'wpl_format=f:property_listing:ajax&wpl_function=contact_listing_user&'+wplj('#wpl_contact_form'+property_id).serialize()+'&pid='+property_id; var ajax = wpl_run_ajax_query('<?php echo wpl_global::get_wp_site_url(); ?> ', request_str, ajax_loader_element, 'JSON', 'GET'); ajax.success(function(data) { if(data.success === 1) { wpl_show_messages(data.message, '#wpl_contact_message_'+property_id, 'wpl_green_msg'); wplj('#wpl_contact_form'+property_id).hide(); } else if(data.success === 0) { wpl_show_messages(data.message, '#wpl_contact_message_'+property_id, 'wpl_red_msg'); }
<?php /** no direct access **/ defined('_WPLEXEC') or die('Restricted access'); $js = (object) array('param1' => 'wpl-tinymce-popup', 'param2' => wpl_global::get_wp_site_url() . 'wp-includes/js/tinymce/tiny_mce_popup.js', 'external' => true); wpl_extensions::import_javascript($js); ?> <div class="short-code-wp wpl_shortcode_wizard_container" id="wpl_shortcode_wizard_container" style="margin: 0 20px;"> <h2> <i class="icon-shortcode"></i> <span><?php echo __('WPL Shortcodes', WPL_TEXTDOMAIN); ?> </span> <button class="wpl-button button-1" onclick="insert_shortcode();"><?php echo __('Insert', WPL_TEXTDOMAIN); ?> </button> </h2> <div class="short-code-body"> <div class="plugin-row wpl_select_view"> <label for="view_selectbox"><?php echo __('View', WPL_TEXTDOMAIN); ?> </label> <select id="view_selectbox" onchange="wpl_view_selected(this.value);"> <option value="property_listing"><?php echo __('Property Listing', WPL_TEXTDOMAIN); ?> </option> <option value="property_show"><?php