Example #1
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();
Example #2
0
  </head>
  <body>

  <menu>
   <nav class="navbar navbar-default navbar-fixed-top" role="navigation">
    <div class="container">
    <div class="navbar-header">
      <a class="navbar-brand" href="index.php">
        <img alt="Explore" src="img/logo.png" width="25" height="25"> 探索</a>
    </div>

<?php 
if (!empty($_SESSION)) {
    $logUser = new userProfile($pdo);
    $usercls = $logUser->loadProfile($_SESSION['userid']);
    ?>
    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
      <ul class="nav navbar-nav">
        <li <?php 
    if ($pageTitle == "探索") {
        echo 'class="active"';
    }
    ?>
><a href="index.php">主页</a></li>
        <li <?php 
    if ($pageTitle == "发现 - 探索") {
        echo 'class="active"';
    }
    ?>
><a href="column.php?column=explore">发现</a></li>
Example #3
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