Example #1
0
                         echo '<div class="sync_list" style="background-image: url(images/i-sina.gif);">' . trim($v['text']) . '</div>';
                     }
                 }
             }
         }
         mysql_free_result($q_dby);
     }
     break;
 case 'tqq':
     if ($config['is_tqq'] > 0 && ($config['is_utqq'] > 0 || $config['tqq_key'] != '' && $config['tqq_se'] != '')) {
         $s_dby = sprintf('select s_id, s_t from %s where aid=%s and name=%s and is_show=0 limit 1', $dbprefix . 'm_sync', $id, SQLString('tqq', 'text'));
         $q_dby = mysql_query($s_dby) or die('');
         $r_dby = mysql_fetch_assoc($q_dby);
         if (mysql_num_rows($q_dby) > 0) {
             require_once 'lib/tqq.php';
             $o = new tqqPHP($config['tqq_key'], $config['tqq_se'], $r_dby['s_t'], $r_dby['s_id']);
             $ma = $o->getMyTweet(5);
             if (isset($ma['ret']) && $ma['ret'] == 0 && isset($ma['data']['info']) && is_array($ma['data']['info']) && count($ma['data']['info']) > 0) {
                 foreach ($ma['data']['info'] as $v) {
                     if (trim($v['text']) != '') {
                         echo '<div class="sync_list" style="background-image: url(images/i-tqq.gif);">' . trim($v['text']) . '</div>';
                     }
                 }
             }
         }
         mysql_free_result($q_dby);
     }
     break;
 case 'tsohu':
     if ($config['is_tsohu'] > 0 && ($config['is_utsohu'] > 0 || $config['tsohu_key'] != '' && $config['tsohu_se'] != '')) {
         $s_dby = sprintf('select s_id, s_t, s_s from %s where aid=%s and name=%s and is_show=0 limit 1', $dbprefix . 'm_sync', $id, SQLString('tsohu', 'text'));
Example #2
0
             $result = mysql_query($d_db) or die('');
             $me_url = 'http://t.qq.com/' . $ma['data']['name'];
             if ($r_dby['s_n'] != $me_url || $r_dby['s_id'] != $ma['data']['openid']) {
                 $u_db = sprintf('update %s set s_n=%s, s_id=%s where id=%s', $dbprefix . 'm_sync', SQLString($me_url, 'text'), SQLString($ma['data']['openid'], 'text'), $r_dby['id']);
                 $result = mysql_query($u_db) or die('');
             }
             $content .= '当前已绑定腾讯微博账号<table width="200"><tr><td align="center">' . ($ma['data']['head'] != '' ? '<img src="' . $ma['data']['head'] . '/50" alt=""/><br/>' : '') . '<a href="' . $me_url . '" target="_blank">' . $ma['data']['nick'] . '</a>(<a href="?m=profile&amp;t=sync&amp;n=' . $nct . '&amp;lt=1">取消绑定</a>)</td></tr></table>';
             $content .= '<br/><br/><form method="post" action=""><input type="checkbox" name="is_show" value="1"' . ($r_dby['is_show'] > 0 ? ' checked="checked"' : '') . '/>隐藏已绑定腾讯微博账号相关信息<br/><input type="submit" value="更新" class="button"/><input type="hidden" name="isl_tqq_h" value="' . $r_dby['id'] . '"/></form>';
         } else {
             $d_db = sprintf('delete from %s where aid=%s and name=%s', $dbprefix . 'm_sync', $r_dbu['id'], SQLString($nct, 'text'));
             $result = mysql_query($d_db) or die('');
         }
     }
     mysql_free_result($q_dby);
     if ($is_sync == 0) {
         $o = new tqqPHP($config['tqq_key'], $config['tqq_se']);
         $aurl = $o->login_url($config['site_url'] . 'tqq_callback.php');
         $content .= '<a href="' . $aurl . '">点击此处和您的腾讯微博账号建立连接</a>';
     }
     $content .= '<br/><br/>绑定腾讯微博账号后将实现以下功能:<ol><li>将留言、评论、回复发布到腾讯微博</li><li>在<a href="?m=user&amp;id=' . $r_dbu['id'] . '">用户信息</a>页面显示最新的腾讯微博留言</li><li>使用腾讯微博账号登录</li><li>注:腾讯微博账号不可以重复绑定,用户绑定后,其他用户绑定的同一腾讯微博账号将自动解除绑定</li></ol>';
     break;
 case 'sina':
     if (isset($_GET['lt']) && $_GET['lt'] == 1) {
         $d_db = sprintf('delete from %s where aid=%s and name=%s', $dbprefix . 'm_sync', $r_dbu['id'], SQLString($nct, 'text'));
         $result = mysql_query($d_db) or die('');
         header('Location:./?m=profile&t=sync&n=' . $nct);
         exit;
     }
     require_once 'lib/sina.php';
     $is_sync = 0;
     $s_dby = sprintf('select id, s_id, s_t, s_n, is_show from %s where aid=%s and name=%s limit 1', $dbprefix . 'm_sync', $r_dbu['id'], SQLString($nct, 'text'));
Example #3
0
 * 程序完全免费,请保留这段代码。
 * 请勿出售本程序或其修改版,请勿利用本程序或其修改版进行任何商业活动。
 */
session_start();
require_once 'config.php';
require_once 'function.php';
$f = 'sync_e.php';
$s_dby = sprintf('select id, name, s_t, s_r, edate from %s where mdate<%s and edate<%s and edate>0 and length(s_r)>0 order by id desc limit 1', $dbprefix . 'm_sync', time() - 3600, time());
$q_dby = mysql_query($s_dby) or die('');
$r_dby = mysql_fetch_assoc($q_dby);
if (mysql_num_rows($q_dby) > 0) {
    switch ($r_dby['name']) {
        case 'tqq':
            if ($config['is_tqq'] > 0 && ($config['is_utqq'] > 0 || $config['tqq_key'] != '' && $config['tqq_se'] != '')) {
                require_once 'lib/tqq.php';
                $o = new tqqPHP($config['tqq_key'], $config['tqq_se']);
                $result = $o->access_token_refresh($r_dby['s_r']);
                if (isset($result['access_token']) && $result['access_token'] != '') {
                    $r_dby['s_t'] = $result['access_token'];
                    $r_dby['s_r'] = $result['refresh_token'];
                    $r_dby['edate'] = time() + $result['expires_in'];
                }
            }
            break;
        case 'renren':
            if ($config['is_renren'] > 0 && $config['renren_key'] != '' && $config['renren_se'] != '') {
                require_once 'lib/renren.php';
                $o = new renrenPHP($config['renren_key'], $config['renren_se']);
                $result = $o->access_token_refresh($r_dby['s_r']);
                if (isset($result['access_token']) && $result['access_token'] != '') {
                    $r_dby['s_t'] = $result['access_token'];
Example #4
0
 * 请勿出售本程序或其修改版,请勿利用本程序或其修改版进行任何商业活动。
 */
session_start();
require_once 'config.php';
require_once 'function.php';
$u = './';
$c_log = chklog();
if ($c_log) {
    $u = './?m=profile&t=sync&n=tqq';
} else {
    $u = './?m=login&t=tqq';
}
if ($config['is_tqq'] > 0 && ($config['is_utqq'] > 0 || $config['tqq_key'] != '' && $config['tqq_se'] != '')) {
    if (isset($_GET['code']) && trim($_GET['code']) != '') {
        require_once 'lib/tqq.php';
        $db_o = new tqqPHP($config['tqq_key'], $config['tqq_se']);
        $result = $db_o->access_token($config['site_url'] . 'tqq_callback.php', $_GET['code']);
    }
    if (isset($result['access_token']) && $result['access_token'] != '' && isset($_GET['openid']) && $_GET['openid'] != '') {
        $s_id = $_GET['openid'];
        $s_t = $result['access_token'];
        $s_r = $result['refresh_token'];
        $edate = time() + $result['expires_in'];
        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('tqq', '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('tqq', 'text'));
            $q_dby = mysql_query($s_dby) or die('');
            $r_dby = mysql_fetch_assoc($q_dby);
            if (mysql_num_rows($q_dby) > 0) {
Example #5
0
     $q_dby = mysql_query($s_dby) or die('');
     $r_dby = mysql_fetch_assoc($q_dby);
     if (mysql_num_rows($q_dby) > 0) {
         require_once 'lib/sina.php';
         $sina = new sinaPHP($config['sina_key'], $config['sina_se'], $r_dby['s_t']);
         $sina->update($a[0][0]);
     }
     mysql_free_result($q_dby);
 }
 if ($config['is_tqq'] > 0 && ($config['is_utqq'] > 0 || $config['tqq_key'] != '' && $config['tqq_se'] != '') && in_array('tqq', $am)) {
     $s_dby = sprintf('select s_id, s_t from %s where aid=%s and name=%s limit 1', $dbprefix . 'm_sync', $aid, SQLString('tqq', 'text'));
     $q_dby = mysql_query($s_dby) or die('');
     $r_dby = mysql_fetch_assoc($q_dby);
     if (mysql_num_rows($q_dby) > 0) {
         require_once 'lib/tqq.php';
         $tqq = new tqqPHP($config['tqq_key'], $config['tqq_se'], $r_dby['s_t'], $r_dby['s_id']);
         $tqq->postOne($a[0][0]);
     }
     mysql_free_result($q_dby);
 }
 if ($config['is_renren'] > 0 && $config['renren_key'] != '' && $config['renren_se'] != '' && in_array('renren', $am)) {
     $s_dby = sprintf('select s_t from %s where aid=%s and name=%s limit 1', $dbprefix . 'm_sync', $aid, SQLString('renren', 'text'));
     $q_dby = mysql_query($s_dby) or die('');
     $r_dby = mysql_fetch_assoc($q_dby);
     if (mysql_num_rows($q_dby) > 0) {
         require_once 'lib/renren.php';
         $rr_c = new renrenPHP($config['renren_key'], $config['renren_se'], $r_dby['s_t']);
         $rr_c->setStatus($a[0][0]);
     }
     mysql_free_result($q_dby);
 }