Ejemplo n.º 1
0
<?php

require "functions/config.php";
$userAccount = testInput($_GET['people']);
//初始化个人信息
$user = new userProfile($pdo);
$usercls = $user->loadProfile($userID);
if ($userID = $user->userIsExist($userAccount)) {
    //初始化关注/粉丝数据信息
    $focls = new followCls($pdo);
    //初始化个人分享
    $shacls = new sharingCls($pdo);
    $shalist = $shacls->loadSharing($userID[0]);
    if (!empty($_SESSION)) {
        $pageTitle = "{$userAccount} - 探索";
    } else {
        header("Location:index.php");
    }
    require "includes/header.php";
    ?>

<div class="people-user-background-detail">
	<div class="people-user-heading">
		<div class="people-user-heading-left">
			<img src="user/ivydom/background-blur.jpg" alt="i<?php 
    echo $usercls->getName();
    ?>
" width="260" height="265">
			<div class="people-user-heading-left-detail">
				<div class="people-user-photo">
					<img src="<?php 
Ejemplo n.º 2
0
<?php

require '..\\functions\\config.php';
//getSharing.php?uid=15
$uid = testInput($_GET['uid']);
$flag = 0;
if (strlen($uid) == 0) {
    echo 'the value of uid can not be NULL';
    $flag = $flag - 1;
}
if ($flag >= 0) {
    if (!$pdo) {
        echo '-1';
        //链接数据库失败
    } elseif (empty($_SESSION)) {
        echo '-2';
        //用户没有登录
    } else {
        $getSha = new sharingCls($pdo);
        $sharingList = $getSha->loadSharing($uid);
        $getUser = new userProfile($pdo);
        $userlist = $getUser->loadProfile($_SESSION['userid']);
        arsort($sharingList);
        foreach ($sharingList as $key => $value) {
            $jsonData = $jsonData . '{"face":"' . $userlist->getFace() . '","name":"' . $userlist->getName() . '","uid":"' . $value->getUid() . '","time":"' . $value->getTime() . '","sharingType":"' . $value->getSharingType() . '","img":"' . $value->getImg() . '","content":"' . $value->getContent() . '","commentNum":"' . $value->getCommentAmount() . '","likeNum":"' . $value->getLikeAmount() . '","dislikeNum":"' . $value->getDislikeAmount() . '"},';
        }
        $jsonData = substr_replace($jsonData, "", -1, 1);
        echo "{sharing:[" . $jsonData . "]}";
    }
}
session_write_close();
Ejemplo n.º 3
0
$flag = 0;
foreach ($requestQueue as $key => $value) {
    if (strlen($value) == 0) {
        echo "the value of {$key} can not be NULL<br>";
        $flag = $flag - 1;
    }
}
if ($flag >= 0) {
    if (!$pdo) {
        echo '-1';
        //链接数据库失败
    } elseif (empty($_SESSION)) {
        echo '-2';
        //用户没有登录
    } else {
        $newSha = new sharingCls($pdo);
        switch ($method) {
            case 'delete':
                if (!$newSha->deleteSharing($uid, $sharingID)) {
                    echo '-4';
                    /*删除失败*/
                } else {
                    echo '2';
                }
                break;
            case 'new':
                if (!$newSha->newSharing($uid, $type, $content, $img)) {
                    echo '-5';
                    /*发送失败*/
                } else {
                    echo '1';