function render_account_page()
 {
     if (is_user_logged_in()) {
         $this->user_id = get_current_user_id();
         $current_user = get_userdata($this->user_id);
         $this->user_login = $current_user->user_login;
         $this->email = $current_user->user_email;
         $this->old_password = $current_user->user_pass;
         //Check email status if already verified
         $email_status = get_user_meta($this->user_id, 'is_email_verified', true);
         $email_status == 1 ? $this->is_verified = true : ($this->is_verified = false);
         if (isset($_POST['submit'])) {
             $result = $this->update($_POST['submit']);
         }
         require_once dirname(__DIR__) . '/views/account.php';
     } else {
         redirect_to_home();
     }
 }
 function render_edit_profile()
 {
     require_once WPPR_PLUGIN_DIR . '/models/members-model.php';
     $model = new Members_Model();
     if (is_user_logged_in()) {
         $this->user_id = get_current_user_id();
         if (isset($_POST['profile'])) {
             $result = $this->update($_POST['profile']);
         }
         $meta = get_user_meta($this->user_id);
         //Filter out empty meta data
         $meta = array_filter(array_map(function ($a) {
             return $a[0];
         }, $meta));
         if (isset($meta['first_name'])) {
             $this->first_name = $meta['first_name'];
         }
         if (isset($meta['last_name'])) {
             $this->last_name = $meta['last_name'];
         }
         if (isset($meta['description'])) {
             $this->description = $meta['description'];
         }
         $userdata = get_userdata($this->user_id);
         $this->user_url = $userdata->user_url;
         $this->display_name = $userdata->display_name;
         $this->ref_sports = $model->get_other_sports();
         if (isset($meta['other_sports'])) {
             $this->other_sports = $meta['other_sports'];
             $this->other_sports = unserialize($this->other_sports);
         }
         $this->ref_interests = $model->get_interest_lists();
         if (isset($meta['interests'])) {
             $this->interests = $meta['interests'];
             $this->interests = unserialize($this->interests);
         }
         if (isset($meta['location'])) {
             $this->location = $meta['location'];
         }
         if (isset($meta['gender'])) {
             $this->gender = $meta['gender'];
         }
         if (isset($meta['birth_day'])) {
             $this->birth_day = $meta['birth_day'];
         }
         if (isset($meta['birth_month'])) {
             $this->birth_month = $meta['birth_month'];
         }
         $this->months = array('1' => 'January', '2' => 'February', '3' => 'March', '4' => 'April', '5' => 'May', '6' => 'June', '7' => 'July', '8' => 'August', '9' => 'September', '10' => 'October', '11' => 'November', '12' => 'December');
         if (isset($meta['birth_year'])) {
             $this->birth_year = $meta['birth_year'];
         }
         if (isset($meta['height'])) {
             $this->height = $meta['height'];
         }
         if (isset($meta['weight'])) {
             $this->weight = $meta['weight'];
         }
         if (isset($meta['year_started_running'])) {
             $this->year_started_running = $meta['year_started_running'];
         }
         if (isset($meta['facebook'])) {
             $this->facebook = $meta['facebook'];
         }
         if (isset($meta['twitter'])) {
             $this->twitter = $meta['twitter'];
         }
         if (isset($meta['instagram'])) {
             $this->instagram = $meta['instagram'];
         }
         require_once dirname(__DIR__) . '/views/edit-profile.php';
     } else {
         redirect_to_home();
     }
 }
Example #3
0
<?php 
include 'header.php.inc';
?>

<?php 
$qparams = [];
$sql = "select p.name, p.description, p.avatar, p.big_picture, p.location_id " . "from profile p " . "where p.id = :id ";
//. "and period @> '["
//. $arrival_date->format('Y-m-d').", "
//. $departure_date->format('Y-m-d')."]'::daterange "
$qparams[":id"] = $id;
$q = $db->prepare($sql);
$q->execute($qparams);
if ($q->rowCount() == 0) {
    redirect_to_home();
}
$profile = $q->fetch(PDO::FETCH_ASSOC);
?>

  <body class="family">  
  	<div class="navbar navbar-inverse navbar-static-top">
        <div class="container">
            <a href="index.php" class="navbar-brand"><img src="img/F2F_word_blue.png" class="img-responsive"/><img src="img/beta.png" class="img-responsive" style="width:35px;margin-top:-86px;margin-left:-15px;"/></a>
                <button class="navbar-toggle" data-toggle="collapse" data-target=".navHeaderCollapse">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
            <div class="collapse navbar-collapse navHeaderCollapse">
                <ul class="nav navbar-nav navbar-right">