Example #1
0
function getUserInfo($uid)
{
    global $_G;
    $login_user = $_G['uid'];
    $sql_user = "******";
    $user = DB::fetch_first($sql_user);
    // 互相关注
    $sql_tmp = "SELECT * FROM pre_jf_follow WHERE user_id={$login_user} AND relation_id=" . $user['uid'] . ";";
    $data_tmp = DB::fetch_first($sql_tmp);
    if ($data_tmp['id']) {
        $user['each'] = 1;
    } else {
        $user['each'] = 0;
    }
    // 关注总量
    $sql_tmp = "SELECT count(1) fanss FROM pre_jf_follow WHERE relation_id=" . $user['uid'] . ";";
    $data_tmp = DB::fetch_first($sql_tmp);
    if ($data_tmp['fanss']) {
        $user['fanss'] = $data_tmp['fanss'];
    } else {
        $user['fanss'] = 0;
    }
    // 粉丝总量
    $sql_tmp = "SELECT count(1) follows FROM pre_jf_follow WHERE user_id=" . $user['uid'] . ";";
    $data_tmp = DB::fetch_first($sql_tmp);
    if ($data_tmp['follows']) {
        $user['follows'] = $data_tmp['follows'];
    } else {
        $user['follows'] = 0;
    }
    // 头像
    $user['head'] = jointGetPhoto($user['uid'], 1);
    $user['username'] = jointGetJfNiceByUsername($user['username']);
    return $user;
}
Example #2
0
// 列表-官方发布
$list_gffb	= jointGetRecommenList($cfg_portal_recommen_gf);

// 列表-攻略
$list_gl	= jointGetRecommenList($cfg_portal_recommen_gl);

// 列表-活动专区
$list_hdzq	= jointGetRecommenList($cfg_portal_recommen_hd);

// 列表-知性男女
$list_zxnn	= jointGetRecommenList($cfg_portal_recommen_zx);

// 查询推荐信息
$recommen_1	= jointGetRecommenList($cfg_portal_recommen_1);

// 查询推荐信息
$recommen_2	= jointGetRecommenList($cfg_portal_recommen_2);
*/
$recommen_1 = jointGetRecommenList($cfg_portal_recommen_1);
// 板块热门文章
$hot = jointGetHotList(array(181, 182, 183, 184));
// 我关注的板块
$follow_forum = jointGetFollowForum($_G['uid']);
// 未读消息
$message_num = jointGetWeiduMessage($_G['uid']);
$unreadthread = jointGetUnreadthread($_G['uid']);
// 个人信息
$_G['member']['username'] = jointGetJfNiceByUsername($_G['member']['username']);
$value2['head'] = jointGetPhoto($_G['uid'], $url = 1);
include template('jointapp/portal');
Example #3
0
<?php

/**
 * 根据type返回推荐信息,json格式
 **/
$action = $_REQUEST['action'] ? jointFlushStr($_REQUEST['action']) : 'follow';
$type = $_REQUEST['type'] ? jointFlushStr($_REQUEST['type']) : 'user';
$uid = jointFlushStr($_REQUEST['uid']);
if ($action == 'follow') {
    $login_user = $_G['uid'];
    $time = time();
    $sql_tmp = "INSERT INTO pre_jf_follow SET user_id={$login_user},relation_id={$uid},type='{$type}',time={$time};";
    $data_tmp = DB::query($sql_tmp);
    setUserMessage($uid, 4, jointGetJfNiceByUsername($_G['username']), $_G['uid']);
    echo 'create';
} else {
    $login_user = $_G['uid'];
    $sql_tmp = "DELETE FROM pre_jf_follow WHERE user_id={$login_user} AND relation_id={$uid} AND type='{$type}'";
    $data_tmp = DB::query($sql_tmp);
    echo 'delete';
}
Example #4
0
File: upost.php Project: suibber/jb
<?php

/**
 * 20150928
 * 用户参与的主题
 */
$uid = is_numeric($_GET['uid']) ? jointFlushStr($_GET['uid']) : 1;
if ($uid) {
    $user = getUserInfo($uid);
    // 查询我的回帖,并且不是我发的
    $sql = "SELECT td.*,t.pid,f.name \r\n\tFROM pre_forum_post t \r\n\tLEFT JOIN pre_forum_thread td ON t.tid=td.tid\r\n\tLEFT JOIN pre_forum_forum f ON t.fid=f.fid \r\n\tWHERE t.authorid={$uid} AND t.invisible>-1 AND t.position>1 {$att_where} GROUP BY t.tid ORDER BY t.pid DESC  LIMIT 0,40";
    $re = DB::query($sql);
    $threads = array();
    while ($data = mysql_fetch_assoc($re)) {
        $data['date'] = date("Y-m-d", $data['dateline']);
        $data['head'] = jointGetPhoto($data['authorid'], 1);
        $data['author'] = jointGetJfNiceByUsername($data['author']);
        $threads[] = $data;
    }
}
$uhome = $user['username'];
include template('jointapp/upost');
Example #5
0
        $data_tmp = DB::fetch_first($sql_tmp);
        if ($data_tmp['id']) {
            $data['each'] = 1;
        } else {
            $data['each'] = 0;
        }
        // 关注总量
        $sql_tmp = "SELECT count(1) fanss FROM pre_jf_follow WHERE relation_id=" . $data['uid'] . ";";
        $data_tmp = DB::fetch_first($sql_tmp);
        if ($data_tmp['fanss']) {
            $data['fanss'] = $data_tmp['fanss'];
        } else {
            $data['fanss'] = 0;
        }
        // 帖子总量
        $sql_tmp = "SELECT count(1) threads FROM pre_forum_thread where authorid = " . $data['uid'] . ";";
        $data_tmp = DB::fetch_first($sql_tmp);
        if ($data_tmp['threads']) {
            $data['threads'] = $data_tmp['threads'];
        } else {
            $data['threads'] = 0;
        }
        $data['head'] = jointGetPhoto($data['uid'], 1);
        $data['username'] = jointGetJfNiceByUsername($data['username']);
        $list[] = $data;
    }
} else {
    header("Location:http://bbs.jointforce.com");
}
$home = iconv('utf-8', 'gbk', '我的粉丝');
include template('jointapp/myfans');