break; } } } } mysql_free_result($q_dby); } break; case 'kx001': if ($config['is_kx001'] > 0 && $config['kx001_key'] != '' && $config['kx001_se'] != '') { $s_dby = sprintf('select s_t from %s where aid=%s and name=%s and is_show=0 limit 1', $dbprefix . 'm_sync', $id, SQLString('kx001', '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/kaixin.php'; $kx_co = new kaixinPHP($config['kx001_key'], $config['kx001_se'], $r_dby['s_t']); $kx_re = $kx_co->records_me(5); if (isset($kx_re['data']) && count($kx_re['data']) > 0) { foreach ($kx_re['data'] as $v) { if (trim($v['main']['content']) != '') { echo '<div class="sync_list" style="background-image: url(images/i-kx001.gif);">' . trim($v['main']['content']) . '</div>'; } } } } mysql_free_result($q_dby); } break; case 'renren': if ($config['is_renren'] > 0 && $config['renren_key'] != '' && $config['renren_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('renren', 'text'));
* 请勿出售本程序或其修改版,请勿利用本程序或其修改版进行任何商业活动。 */ session_start(); require_once 'config.php'; require_once 'function.php'; $u = './'; $c_log = chklog(); if ($c_log) { $u = './?m=profile&t=sync&n=kx001'; } else { $u = './?m=login&t=kx001'; } if ($config['is_kx001'] > 0 && $config['kx001_key'] != '' && $config['kx001_se'] != '') { if (isset($_GET['code']) && trim($_GET['code']) != '') { require_once 'lib/kaixin.php'; $db_o = new kaixinPHP($config['kx001_key'], $config['kx001_se']); $result = $db_o->access_token($config['site_url'] . 'kx001_callback.php', $_GET['code']); } if (isset($result['access_token']) && $result['access_token'] != '') { $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'); $s_dby = sprintf('select id from %s where aid=%s and name=%s limit 1', $dbprefix . 'm_sync', $ar['id'], SQLString('kx001', '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_t=%s, s_r=%s, edate=%s where id=%s', $dbprefix . 'm_sync', SQLString($s_t, 'text'), SQLString($s_r, 'text'), SQLString($edate, 'int'), $r_dby['id']); $result = mysql_query($u_db) or die(''); } else {
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']; $r_dby['s_r'] = $result['refresh_token']; $r_dby['edate'] = time() + $result['expires_in']; } } break; case 'kx001': if ($config['is_kx001'] > 0 && $config['kx001_key'] != '' && $config['kx001_se'] != '') { require_once 'lib/kaixin.php'; $o = new kaixinPHP($config['kx001_key'], $config['kx001_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 't163': if ($config['is_t163'] > 0 && $config['t163_key'] != '' && $config['t163_se'] != '') { require_once 'lib/t163.php'; $o = new t163PHP($config['t163_key'], $config['t163_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'];
$result = mysql_query($d_db) or die(''); $me_url = 'http://www.kaixin001.com/home/?uid=' . $kx_re['uid']; if ($r_dby['s_n'] != $me_url || $r_dby['s_id'] != $kx_re['uid']) { $u_db = sprintf('update %s set s_n=%s, s_id=%s where id=%s', $dbprefix . 'm_sync', SQLString($me_url, 'text'), SQLString($kx_re['uid'], 'text'), $r_dby['id']); $result = mysql_query($u_db) or die(''); } $content .= '当前已绑定开心网账号<table width="200"><tr><td align="center">' . ($kx_re['logo50'] != '' ? '<img src="' . $kx_re['logo50'] . '" alt=""/><br/>' : '') . '<a href="' . $me_url . '" target="_blank">' . $kx_re['name'] . '</a>(<a href="?m=profile&t=sync&n=' . $nct . '&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_kx001_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) { $kx_uco = new kaixinPHP($config['kx001_key'], $config['kx001_se']); $qurl = $kx_uco->login_url($config['site_url'] . 'kx001_callback.php', 'user_records create_records'); $content .= '<a href="' . $qurl . '">点击此处和您的开心网账号建立连接</a>'; } $content .= '<br/><br/>绑定开心网账号后将实现以下功能:<ol><li>将留言、评论、回复发布到开心网动态</li><li>在<a href="?m=user&id=' . $r_dbu['id'] . '">用户信息</a>页面显示最新的开心网动态</li><li>使用开心网账号登录</li><li>注:开心网账号不可以重复绑定,用户绑定后,其他用户绑定的同一开心网账号将自动解除绑定</li></ol>'; break; case 'renren': 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/renren.php'; $is_sync = 0; $s_dby = sprintf('select id, s_id, s_t, s_r, s_n, edate, is_show from %s where aid=%s and name=%s limit 1', $dbprefix . 'm_sync', $r_dbu['id'], SQLString($nct, '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); } if ($config['is_kx001'] > 0 && $config['kx001_key'] != '' && $config['kx001_se'] != '' && in_array('kx001', $am)) { $s_dby = sprintf('select s_t from %s where aid=%s and name=%s limit 1', $dbprefix . 'm_sync', $aid, SQLString('kx001', '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/kaixin.php'; $kx_co = new kaixinPHP($config['kx001_key'], $config['kx001_se'], $r_dby['s_t']); $kx_co->records_add($a[0][0]); } mysql_free_result($q_dby); } if ($config['is_t163'] > 0 && $config['t163_key'] != '' && $config['t163_se'] != '' && in_array('t163', $am)) { $s_dby = sprintf('select s_id, s_t, s_s from %s where aid=%s and name=%s limit 1', $dbprefix . 'm_sync', $aid, SQLString('t163', '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/t163.php'; $tblog = new t163PHP($config['t163_key'], $config['t163_se'], $r_dby['s_t']); $tblog->update($a[0][0]); } mysql_free_result($q_dby); }