コード例 #1
0
ファイル: profilePic.php プロジェクト: khaledkhalil94/SH.A
    }
}
if (isset($_GET['action'])) {
    $image = new Images();
    $info = $image->get_pic_info($_GET['id']);
    $info->size = human_filesize($info->size);
    echo json_encode((array) $info);
    exit;
}
// upload or change
if (!isset($_FILES['file'])) {
    header('Location: /404.php');
}
$_FILES = $_FILES['file'];
$image = new Images();
if (Images::has_pic(USER_ID)) {
    if ($image->change_profile_pic()) {
        echo json_encode(array('action' => 'update', 'status' => 'success', 'path' => $image->path, 'id' => $image->id));
        exit;
    } else {
        echo json_encode(array('status' => 'fail', 'errMsg' => $image->errMsg, 'id' => $image->id));
        exit;
    }
} else {
    if ($image->upload_profile_pic()) {
        echo json_encode(['status' => 'success', 'path' => $image->path, 'id' => $image->id]);
        exit;
    } else {
        echo json_encode(array('status' => 'fail', 'errMsg' => $image->errMsg, 'id' => $image->id));
        exit;
    }
コード例 #2
0
ファイル: profile.php プロジェクト: khaledkhalil94/SH.A
$emptyLinks = false;
if (empty($website) && empty($skype) && empty($twitter) && empty($github) && empty($facebook)) {
    $emptyLinks = true;
}
$self = $session->userCheck($user);
$emailP = $user->email_privacy;
$locationP = $user->location_privacy;
$phoneNumberP = $user->phoneNumber_privacy;
$genderP = $user->gender_privacy;
$birthP = $user->birthDate_privacy;
$pub = $emailP && $locationP && $phoneNumberP && $genderP && $birthP ? true : false;
$custom = ($emailP || $locationP || $phoneNumberP || $genderP || $birthP) && !$pub ? true : false;
$linksP = $user->links_privacy;
$public = "<i title=\"Public\" class=\"world icon\"></i>";
$private = "<i title=\"Private\" class=\"lock icon\"></i>";
$has_pic = Images::has_pic($id);
$q_count = count($QNA->get_questions_by_user($id));
$following = $userg->get_flwing($id);
$following_count = count($following);
$followers = $userg->get_flwers($id);
$followers_count = count($followers);
if (USER_ID) {
    $saved_count = count($QNA->get_saved(USER_ID));
}
$pageTitle = $name;
$sec = 'profile';
include ROOT_PATH . "inc/head.php";
?>
<div class="ui ui container section">
<?php 
if ($session->is_logged_in() && !$self) {