Ejemplo n.º 1
0
if ($c_log) {
    $u = './?m=profile&t=sync&n=instagram';
} else {
    $u = './?m=login&t=instagram';
}
if ($config['is_instagram'] > 0 && $config['instagram_key'] != '' && $config['instagram_se'] != '') {
    if (isset($_GET['code']) && trim($_GET['code']) != '') {
        require_once 'lib/instagram.php';
        $io = new instagramPHP($config['instagram_key'], $config['instagram_se']);
        $result = $io->access_token($config['site_url'] . 'instagram_callback.php', $_GET['code']);
    }
    if (isset($result['access_token']) && $result['access_token'] != '') {
        $s_t = $result['access_token'];
        $s_id = $ia['user']['id'];
        if ($c_log) {
            $ar = getainfo($_SESSION[$config['u_hash']], 'id, name');
            $d_db = sprintf('delete from %s where s_id=%s and aid<>%s and name=%s', $dbprefix . 'm_sync', SQLString($s_id, 'text'), $ar['id'], SQLString('instagram', 'text'));
            $result = mysql_query($d_db) or die('');
            $s_dby = sprintf('select id from %s where aid=%s and name=%s limit 1', $dbprefix . 'm_sync', $ar['id'], SQLString('instagram', 'text'));
            $q_dby = mysql_query($s_dby) or die('');
            $r_dby = mysql_fetch_assoc($q_dby);
            if (mysql_num_rows($q_dby) > 0) {
                $u_db = sprintf('update %s set s_id=%s, s_t=%s where id=%s', $dbprefix . 'm_sync', SQLString($s_id, 'text'), SQLString($s_t, 'text'), $r_dby['id']);
                $result = mysql_query($u_db) or die('');
            } else {
                $i_db = sprintf('insert into %s (aid, name, s_id, s_t) values (%s, %s, %s, %s)', $dbprefix . 'm_sync', $ar['id'], SQLString('instagram', 'text'), SQLString($s_id, 'text'), SQLString($s_t, 'text'));
                $result = mysql_query($i_db) or die('');
            }
            mysql_free_result($q_dby);
            setsinfo($ar['name'] . ' 绑定了Instagram', $ar['id']);
        } else {
Ejemplo n.º 2
0
/**
 * 迷你同学录 (http://mini_class.piscdong.com/)
 * (c)PiscDong studio (http://www.piscdong.com/)
 *
 * 程序完全免费,请保留这段代码。
 * 请勿出售本程序或其修改版,请勿利用本程序或其修改版进行任何商业活动。
 */
session_start();
require_once '../config.php';
require_once '../function.php';
require_once 'function.php';
$c_log = chklog();
$menua = array('list', 'album', 'camp', 'user', 'message', 'login', 'logout');
if ($c_log) {
    $ar = getainfo($_SESSION[$config['u_hash']], 'name, power');
    $pa = $ar['power'];
    $pn = $ar['name'];
    $s_dbo = sprintf('select datetime from %s where aid=%s limit 1', $dbprefix . 'online', $_SESSION[$config['u_hash']]);
    $q_dbo = mysql_query($s_dbo) or die('');
    $r_dbo = mysql_fetch_assoc($q_dbo);
    if (mysql_num_rows($q_dbo) > 0) {
        if (time() - $r_dbo['datetime'] > 600) {
            $u_db = sprintf('update %s set visit=visit+1, visitdate=%s where id=%s', $dbprefix . 'member', time(), $_SESSION[$config['u_hash']]);
            $result = mysql_query($u_db) or die('');
        }
        $u_db = sprintf('update %s set datetime=%s, online=1, ip_i=inet_aton(%s) where aid=%s', $dbprefix . 'online', time(), SQLString(getIP(), 'text'), $_SESSION[$config['u_hash']]);
        $result = mysql_query($u_db) or die('');
    } else {
        $i_db = sprintf('insert into %s (aid, datetime, ip_i) values (%s, %s, inet_aton(%s))', $dbprefix . 'online', $_SESSION[$config['u_hash']], time(), SQLString(getIP(), 'text'));
        $result = mysql_query($i_db) or die('');
Ejemplo n.º 3
0
<?php

/**
 * 迷你同学录 (http://mini_class.piscdong.com/)
 * (c)PiscDong studio (http://www.piscdong.com/)
 *
 * 程序完全免费,请保留这段代码。
 * 请勿出售本程序或其修改版,请勿利用本程序或其修改版进行任何商业活动。
 */
if ($c_log) {
    $title .= '短消息';
    $page = isset($_GET['page']) && intval($_GET['page']) > 0 ? intval($_GET['page']) : 1;
    if (isset($_GET['id']) && intval($_GET['id']) > 0 && intval($_GET['id']) != $_SESSION[$config['u_hash']] && getainfo(intval($_GET['id']), 'id')) {
        $tid = intval($_GET['id']);
        $tn = getainfo($tid, 'name');
        $title .= ' - ' . $tn['name'];
        if ($_SERVER['REQUEST_METHOD'] == 'POST') {
            $cont = htmlspecialchars(trim($_POST['rinfo']), ENT_QUOTES);
            if ($cont != '') {
                $i_db = sprintf('insert into %s (content, aid, tid, datetime, readed) values (%s, %s, %s, %s, 1)', $dbprefix . 'message', SQLString($cont, 'text'), $_SESSION[$config['u_hash']], $tid, time());
                $result = mysql_query($i_db) or die('');
            }
            header('Location:./?m=message&id=' . $tid);
            exit;
        } else {
            $content .= '<div class="title" id="send">发消息 - 收件人:' . $tn['name'] . '</div><div class="lcontent"><form method="post" action="" class="btform" id="lyform"><textarea name="rinfo" id="forminfor0" rows="4" style="width: 95%" class="bt_input" rel="内容"></textarea><br/><input type="submit" value="发消息" /></form></div>';
            $s_a_dbg = sprintf('select * from %s where (aid=%s and tid=%s) or (tid=%s and aid=%s) order by datetime desc', $dbprefix . 'message', $tid, $_SESSION[$config['u_hash']], $tid, $_SESSION[$config['u_hash']]);
            $q_a_dbg = mysql_query($s_a_dbg) or die('');
            $c_dbg = mysql_num_rows($q_a_dbg);
            if ($c_dbg > 0) {
                $content .= '<div class="title">聊天记录</div>';
Ejemplo n.º 4
0
                if ($_SESSION[$config['u_hash']] != $r_dbu['id']) {
                    $content .= '<a href="?m=message&amp;id=' . $r_dbu['id'] . '">发短信</a><br/><br/>';
                }
                if ($r_dbu['rela'] != '') {
                    $content .= $r_dbu['rela'] . '<br/><br/>';
                }
                if ($r_dbu['gender'] > 0) {
                    $content .= '性别:' . ($r_dbu['gender'] == 1 ? '帅哥' : '美女') . '<br/>';
                }
                if ($r_dbu['phone'] != '') {
                    $content .= '手机:' . $r_dbu['phone'] . '<br/>';
                }
                if (isset($g_a[$r_dbu['gid']])) {
                    $content .= '身份:' . $g_a[$r_dbu['gid']] . '<br/>';
                }
                $content .= '注册日期:' . date('Y-n-j H:i', getftime($r_dbu['regdate'])) . '<br/>';
                if ($r_dbu['jaid'] > 0) {
                    if (!isset($jadb[$r_dbu['jaid']])) {
                        $jadb[$r_dbu['jaid']] = getainfo($r_dbu['jaid'], 'name');
                    }
                    $content .= '邀请人:<a href="?m=user&amp;id=' . $r_dbu['jaid'] . '">' . $jadb[$r_dbu['jaid']]['name'] . '</a><br/>';
                }
            }
            $content .= '最后访问:' . ($r_dbu['visitdate'] > 0 ? date('Y-n-j H:i', getftime($r_dbu['visitdate'])) : '从未') . ($r_dbu['visit'] > 0 ? '<br/>访问次数:' . $r_dbu['visit'] : '') . ($c_log && $_SESSION[$config['u_hash']] != $r_dbu['id'] ? '<br/><br/><a href="?m=message&amp;id=' . $r_dbu['id'] . '">发短信</a>' : '') . '</div></div>';
        } while ($r_dbu = mysql_fetch_assoc($q_dbu));
    } else {
        header('Location:./');
        exit;
    }
    mysql_free_result($q_dbu);
}
Ejemplo n.º 5
0
function chklog()
{
    global $config;
    if (isset($_SESSION[$config['u_hash']]) && getainfo($_SESSION[$config['u_hash']], 'id')) {
        return true;
    } else {
        return false;
    }
}
Ejemplo n.º 6
0
<?php

/**
 * 迷你同学录 (http://mini_class.piscdong.com/)
 * (c)PiscDong studio (http://www.piscdong.com/)
 *
 * 程序完全免费,请保留这段代码。
 * 请勿出售本程序或其修改版,请勿利用本程序或其修改版进行任何商业活动。
 */
session_start();
require_once 'config.php';
require_once 'function.php';
$c_log = chklog();
if ($config['open'] == 0 || $c_log) {
    if ($c_log) {
        $ar = getainfo($_SESSION[$config['u_hash']]);
        $pa = $ar['power'];
    }
    $r = isset($_GET['i']) && intval($_GET['i']) > 0 ? intval($_GET['i']) : 1;
    $ddb = $c_log && $pa == 9 ? '' : ' and a.disp=0';
    $dpage = isset($_GET['e']) && intval($_GET['e']) > 0 ? intval($_GET['e']) : 1;
    $page = isset($_GET['p']) && intval($_GET['p']) > 0 ? intval($_GET['p']) : 1;
    $reply_s = 5;
    $s_a_dbt = sprintf('select a.id, a.aid, a.content, a.disp, b.name, b.power from %s as a, %s as b where a.rid=%s and a.aid=b.id%s order by a.datetime desc', $dbprefix . 'topic', $dbprefix . 'member', $r, $ddb);
    $q_a_dbt = mysql_query($s_a_dbt) or die('');
    $c_dbt = mysql_num_rows($q_a_dbt);
    if ($c_dbt > 0) {
        $p_dbt = ceil($c_dbt / $reply_s);
        if ($page > $p_dbt) {
            $page = $p_dbt;
        }