Exemple #1
0
 public function uploadimage()
 {
     $viewdata = array();
     if ($_POST) {
         $this->load->library('upload/UploadService');
         // Try to Recieve the image
         if ($this->uploadservice->recieve_profile_image_upload(get_user()->get_id())) {
             // Success
             $data = $this->uploadservice->get_upload_data();
             // Check if it is an image
             if ($data['is_image']) {
                 // Create images
                 $this->load->library('image/ImageService');
                 $this->imageservice->generate_profile_image($data['full_path']);
                 // Updated user
                 $this->update_user(TRUE);
                 // Show confirmation
                 set_status_message('Your image have been uploaded');
                 return redirect(profile_route());
             } else {
                 $this->update_profile_image(FALSE);
             }
         }
         // Fail
         set_status_message('Something went wrong with your upload', $viewdata);
     }
     // Fallback
     $this->template->load('settings/uploadimage', $viewdata);
 }
Exemple #2
0
function home_route()
{
    if (is_authenticated()) {
        return profile_route();
    }
    return base_url();
}
Exemple #3
0
 public function add_comment()
 {
     //get the post data
     $comment = $this->input->post('comment');
     $status_id = $this->input->post('status_id');
     $userid = $this->input->post('user_id');
     //load the model
     $this->load->model('StatusModel');
     //add comment to statusUpdate
     $this->StatusModel->add_comment($comment, $status_id);
     //return to the profile page
     return redirect(profile_route($userid));
 }
Exemple #4
0
 public function add($id, $profile = FALSE)
 {
     if ($id != get_user()->get_id()) {
         $this->load->model('ProfileUserModel');
         $this->ProfileUserModel->add_friend($id, get_user()->get_id());
         // Set status message
         set_status_message('Friend have been added');
     }
     if ($profile) {
         return redirect(profile_route($id));
     }
     return redirect('friends');
 }
Exemple #5
0
}
?>
    </div>
    <div class="clear"></div>
    <div class="left-menu-line"></div>
</div>

<div id="profile-left-item">
    <div class="float-left">
        <h3>Friends</h3>
        <div id="friends-thumbs">
            <?php 
foreach ($friends as $friend) {
    ?>
            <a href="<?php 
    echo profile_route($friend->id);
    ?>
">
                <img src="<?php 
    echo select_thumbnail_image($friend->id, $friend->hasimage);
    ?>
" width="40px;" alt="<?php 
    echo $friend->firstname . ' ' . $friend->lastname;
    ?>
"/>
            </a>
            <?php 
}
?>
        </div>
    </div>
Exemple #6
0
<ul class="searchresult">
    <?php 
    foreach ($result as $row) {
        ?>
    <li>
        <a href="<?php 
        echo profile_route($row->id);
        ?>
">
            <img src="<?php 
        echo select_thumbnail_image($row->id, $row->hasimage);
        ?>
" alt="" />
        </a>
        <a href="<?php 
        echo profile_route($row->id);
        ?>
"><?php 
        echo $row->firstname . ' ' . $row->lastname;
        ?>
</a>
        <?php 
        if (!is_friend($row->id)) {
            ?>
            -&nbsp;<a href="<?php 
            echo friends_add_route($row->id);
            ?>
">add as friend</a>
        <?php 
        }
        ?>
Exemple #7
0
    echo home_route();
    ?>
">Home</a></li>
            <li><a href="<?php 
    echo signup_route();
    ?>
">Sign up</a></li>
            <li><a href="<?php 
    echo login_route();
    ?>
">Login</a></li>
        <?php 
} else {
    ?>
            <li><a href="<?php 
    echo profile_route();
    ?>
">Home</a></li>
            <li><a href="<?php 
    echo usersearch_route();
    ?>
">Search</a></li>
            <li><a href="<?php 
    echo settings_route();
    ?>
">Settings</a></li>
            <li><a href="<?php 
    echo logout_route();
    ?>
">Logout</a></li>
        <?php 
Exemple #8
0
 public function resetpasswordadmin($id)
 {
     // Check user is admin
     if (!is_admin() || is_nan($id)) {
         return redirect(profile_route());
     }
     // Look up email
     $this->load->model('user/UserModel');
     $user = $this->UserModel->get_by_id($id);
     if ($user != null) {
         // User found
         // Put into Post to load ResetPasswordInput
         if ($user->email != '') {
             $_POST['email'] = $user->email;
         }
         $this->load->model("user/ResetPasswordInput");
         if ($this->ResetPasswordInput->is_valid()) {
             // Insert reset code into database
             $this->UserModel->reset_password($this->ResetPasswordInput);
             // Send reset password email
             $this->load->library('email/EmailService');
             $this->emailservice->send_reset_password_email($this->ResetPasswordInput->get_email(), $this->ResetPasswordInput->get_resetcode());
             // Set status message
             set_status_message('Email with password reset code have been sent.');
         }
     }
     // Always redirect back to the profile page
     if ($id == get_user()->get_id()) {
         return redirect(profile_route());
     }
     return redirect(friend_profile_route($id));
 }
Exemple #9
0
                <p><?php 
    echo $update->comment;
    ?>
</p>
                <p class="update-date"><?php 
    echo $update->date;
    ?>
</p>

                <?php 
    foreach ($comments[$update->id] as $comment) {
        ?>
                <div class="comment">
                    <div class="float-left">
                        <a href="<?php 
        echo profile_route($comment->userid);
        ?>
">
                            <img src="<?php 
        echo select_thumbnail_image($comment->userid, $comment->hasimage);
        ?>
" width="40px;" alt="" />
                        </a>
                    </div>
                    <div class="float-left comment-width">
                        <span class="comment_name"><?php 
        echo $comment->firstname . ' ' . $comment->lastname;
        ?>
</span>
                        <span class="comment_text"><?php 
        echo $comment->comment;