示例#1
0
                 }
             }
         }
         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'));
         $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/SohuOAuth.php';
             $oauth = new SohuOAuth($config['tsohu_key'], $config['tsohu_se'], $r_dby['s_t'], $r_dby['s_s']);
             $url = 'http://api.t.sohu.com/statuses/user_timeline/' . $r_dby['s_id'] . '.json';
             $ma = $oauth->get($url, array('count' => 5));
             if (is_array($ma) && count($ma) > 0) {
                 foreach ($ma as $v) {
                     if (trim($v['text']) != '') {
                         echo '<div class="sync_list" style="background-image: url(images/i-tsohu.gif);">' . trim($v['text']) . '</div>';
                     }
                 }
             }
         }
         mysql_free_result($q_dby);
     }
     break;
 case 't163':
     if ($config['is_t163'] > 0 && $config['t163_key'] != '' && $config['t163_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('t163', 'text'));
         $q_dby = mysql_query($s_dby) or die('');
示例#2
0
 case 'tsohu':
     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/SohuOAuth.php';
     $is_sync = 0;
     $s_dby = sprintf('select id, s_id, s_t, s_s, s_n, 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) {
         $oauth = new SohuOAuth($config['tsohu_key'], $config['tsohu_se'], $r_dby['s_t'], $r_dby['s_s']);
         $url = 'http://api.t.sohu.com/users/show.json';
         $ma = $oauth->get($url);
         if (isset($ma['id']) && $ma['id'] != '') {
             $is_sync = 1;
             $d_db = sprintf('delete from %s where aid<>%s and name=%s and s_id=%s', $dbprefix . 'm_sync', $r_dbu['id'], SQLString($nct, 'text'), SQLString($ma['id'], 'text'));
             $result = mysql_query($d_db) or die('');
             $me_url = 'http://t.sohu.com/u/' . $ma['id'];
             if ($r_dby['s_n'] != $me_url || $r_dby['s_id'] != $ma['id']) {
                 $u_db = sprintf('update %s set s_n=%s, s_id=%s where id=%s', $dbprefix . 'm_sync', SQLString($me_url, 'text'), SQLString($ma['id'], 'text'), $r_dby['id']);
                 $result = mysql_query($u_db) or die('');
             }
             $content .= '当前已绑定搜狐微博账号<table width="200"><tr><td align="center">' . ($ma['profile_image_url'] != '' ? '<img src="' . $ma['profile_image_url'] . '" alt=""/><br/>' : '') . '<a href="' . $me_url . '" target="_blank">' . $ma['screen_name'] . '</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_tsohu_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('');
         }