Exemplo n.º 1
0
 public function user_manager()
 {
     /** check permission **/
     wpl_global::min_access('administrator');
     $possible_orders = array('u.id', 'u.user_registered');
     $orderby = in_array(wpl_request::getVar('orderby'), $possible_orders) ? wpl_request::getVar('orderby') : $possible_orders[0];
     $order = in_array(strtoupper(wpl_request::getVar('order')), array('ASC', 'DESC')) ? wpl_request::getVar('order') : 'ASC';
     $page_size = trim(wpl_request::getVar('page_size')) != '' ? wpl_request::getVar('page_size') : NULL;
     $this->show_all = wpl_request::getVar('show_all', 0);
     $this->filter = wpl_request::getVar('filter', '');
     $this->membership_id = wpl_request::getVar('membership_id', '');
     $where_query = wpl_db::create_query();
     if (trim($this->filter)) {
         $where_query = " AND (`user_login` LIKE '%" . $this->filter . "%' OR `user_email` LIKE '%" . $this->filter . "%' OR `first_name` LIKE '%" . $this->filter . "%' OR `last_name` LIKE '%" . $this->filter . "%')";
     }
     if (trim($this->membership_id)) {
         $where_query = " AND `membership_id`='" . $this->membership_id . "'";
     }
     $num_result = wpl_db::num("SELECT COUNT(u.ID) FROM `#__users` AS u " . ($this->show_all ? 'LEFT' : 'INNER') . " JOIN `#__wpl_users` AS wpl ON u.ID = wpl.id WHERE 1 {$where_query}");
     $this->pagination = wpl_pagination::get_pagination($num_result, $page_size);
     $where_query .= " ORDER BY {$orderby} {$order} " . $this->pagination->limit_query;
     if ($this->show_all) {
         $this->wp_users = wpl_users::get_wp_users($where_query);
     } else {
         $this->wp_users = wpl_users::get_wpl_users($where_query);
     }
     $this->memberships = wpl_users::get_wpl_memberships();
     /** import tpl **/
     parent::render($this->tpl_path, $this->tpl);
 }
Exemplo n.º 2
0
 public function modify()
 {
     $this->notification = wpl_notifications::get_notifications("AND `id`='" . wpl_db::escape($this->id) . "'", 'loadObject');
     $this->additional_memberships = explode(',', $this->notification->additional_memberships);
     $this->additional_users = explode(',', $this->notification->additional_users);
     $this->additional_emails = explode(',', $this->notification->additional_emails);
     $this->users = wpl_users::get_wpl_users();
     $this->memberships = wpl_users::get_wpl_memberships();
     $this->memberships_array = self::unset_additional_receipts($this->additional_memberships, $this->memberships);
     $this->users_array = self::unset_additional_receipts($this->additional_users, $this->users);
     $this->template_path = wpl_notifications::get_template_path($this->notification->template);
     $this->template = wpl_notifications::get_template_content($this->template_path, true);
     $this->template = '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">' . $this->template;
     parent::render($this->tpl_path, $this->tpl);
 }
Exemplo n.º 3
0
 /**
  * Returns all WPL item links (Used in sitemap feature)
  * @author Howard <*****@*****.**>
  * @static
  * @since 1.8.0
  * @param array $exclude
  * @return array
  */
 public static function get_wpl_item_links($exclude = array())
 {
     $links = array();
     /** WPL Properties **/
     $properties = wpl_property::select_active_properties(NULL, '`id`');
     foreach ($properties as $property) {
         /** exclude **/
         if (isset($exclude['properties']) and in_array($property['id'], $exclude['properties'])) {
             continue;
         }
         $property_data = wpl_db::select("SELECT `id`,`alias`,`last_modified_time_stamp` FROM `#__wpl_properties` WHERE `id`='" . $property['id'] . "'", 'loadAssoc');
         $link = wpl_property::get_property_link($property_data);
         $links[] = array('link' => $link, 'time' => strtotime($property_data['last_modified_time_stamp']));
     }
     /** WPL Profiles **/
     $profiles = wpl_users::get_wpl_users();
     foreach ($profiles as $profile) {
         /** exclude **/
         if (isset($exclude['profiles']) and in_array($profile->ID, $exclude['profiles'])) {
             continue;
         }
         $link = wpl_users::get_profile_link($profile->ID);
         $links[] = array('link' => $link, 'time' => strtotime($profile->last_modified_time_stamp));
     }
     return $links;
 }
Exemplo n.º 4
0
    ?>
" class="change-user-cnt-wp">
            <div class="change-user-wp">
                <label id="pmanager_change_user_label<?php 
    echo $pid;
    ?>
"
                       for="pmanager_change_user_select<?php 
    echo $pid;
    ?>
"><?php 
    echo __('User', WPL_TEXTDOMAIN);
    ?>
: </label>
                <?php 
    $wpl_users = wpl_users::get_wpl_users();
    ?>
                <select id="pmanager_change_user_select<?php 
    echo $pid;
    ?>
" data-has-chosen onchange="change_user(<?php 
    echo $pid;
    ?>
, this.value);">
                    <?php 
    foreach ($wpl_users as $wpl_user) {
        ?>
                        <option value="<?php 
        echo $wpl_user->ID;
        ?>
"
Exemplo n.º 5
0
 /**
  * Sets recipients
  * @author Howard R <*****@*****.**>
  * @param array $recipients
  * @return array
  */
 public function set_recipients($recipients)
 {
     if (!is_array($recipients)) {
         $recipients = array($recipients);
     }
     $ex = trim($this->notification_data['additional_memberships']) != '' ? explode(',', $this->notification_data['additional_memberships']) : array();
     if (is_array($ex) and count($ex) >= 1) {
         foreach ($ex as $value) {
             array_push($recipients, $value);
         }
     }
     $ex = trim($this->notification_data['additional_users']) != '' ? explode(',', $this->notification_data['additional_users']) : array();
     if (is_array($ex) and count($ex) >= 1) {
         foreach ($ex as $value) {
             array_push($recipients, $value);
         }
     }
     $ex = trim($this->notification_data['additional_emails']) != '' ? explode(',', $this->notification_data['additional_emails']) : array();
     if (is_array($ex) and count($ex) >= 1) {
         foreach ($ex as $value) {
             array_push($recipients, $value);
         }
     }
     $emails = array();
     foreach ($recipients as $recipient) {
         /** user **/
         if (is_numeric($recipient) and $recipient >= 0) {
             $user_data = wpl_users::get_user($recipient);
             array_push($emails, array($user_data->ID, $user_data->user_email));
         } elseif (is_numeric($recipient) and $recipient < 0) {
             $users = wpl_users::get_wpl_users("AND `membership_id`='{$recipient}'");
             foreach ($users as $user) {
                 array_push($emails, array($user->ID, $user->user_email));
             }
         } elseif (is_string($recipient)) {
             $user_id = wpl_users::get_id_by_email($recipient);
             if (!$user_id) {
                 $user_id = 0;
             }
             array_push($emails, array($user_id, $recipient));
         }
     }
     return $emails;
 }
Exemplo n.º 6
0
 public function generate_search_form()
 {
     $this->property_types = wpl_global::get_property_types();
     $this->listings = wpl_global::get_listings();
     $this->users = wpl_users::get_wpl_users();
     parent::render($this->tpl_path, 'search_form');
 }