<!--安装失败的信息:给出提示信息--> <div class="mainTxt"> <hr /> <div class="con red"><p><strong>安装失败,安装数据已全部回退。</strong></p></div> <div class="con red"><p>如果您能将“初始化程序以及数据”提示信息,以及论坛地址、论坛版本和论坛字符编码等信息反馈给我们(比如<a href="http://bbs.x.weibo.com/forum/forumdisplay.php?fid=9" target="_blank">官方论坛</a>),将有助于我们的产品改进,感谢您的支持!</p></div> <div class="con red"><p>联系邮箱:<a href="mailto:xweibo@vip.sina.com">mailto:xweibo@vip.sina.com</a> | 技术支持:<a href="http://x.weibo.com/" target="_blank">Xweibo官网</a></p></div> </div> <div class="clear"></div> <?php } ?> <div class="footer">Copyright © 1996-2010 SINA</div> </div> </div> <?php //统计上报[安装] $xwb_statType = 'in'; $xwb_statArgs = array(); $xwb_statArgs['akey'] = $appkey; $xwb_statArgs['uid'] = 0; $xwb_statArgs['domain'] = str_replace(array('http://', 'https://'), '', XWB_plugin::baseUrl()); $xwb_statArgs['qq'] = $qq; echo XWB_plugin::statUrl($xwb_statType, $xwb_statArgs, true); ?> </body> </html>
/** * 获取当前脚本的完整url路径。末尾有/ */ function siteUrl() { if (defined('XWB_S_SITEURL')) { return XWB_S_SITEURL; } return XWB_plugin::baseUrl() . XWB_plugin::pathUrl(); }
function _getOAuthUrl() { static $aurl = null; if (!empty($aurl)) { return $aurl; } $sess = XWB_plugin::getUser(); $sess->clearToken(); $wbApi = XWB_plugin::getWB(); $keys = $wbApi->getRequestToken(); if (!isset($keys['oauth_token']) || !isset($keys['oauth_token_secret'])) { $api_error_origin = isset($keys['error']) ? $keys['error'] : 'UNKNOWN ERROR. MAYBE SERVER CAN NOT CONNECT TO SINA API SERVER'; $api_error = isset($keys['error_CN']) && !empty($keys['error_CN']) && 'null' != $keys['error_CN'] ? $keys['error_CN'] : ''; XWB_plugin::LOG("[WEIBO CLASS]\t[ERROR]\t#{$wbApi->req_error_count}\t{$api_error}\t{$wbApi->last_req_url}\tERROR ARRAY:\r\n" . print_r($keys, 1)); XWB_plugin::showError("服务器获取Request Token失败;请稍候再试。<br />错误原因:{$api_error}[{$api_error_origin}]"); } //print_r($keys); $aurl = $wbApi->getAuthorizeURL($keys['oauth_token'], false, XWB_plugin::baseUrl() . XWB_plugin::URL('xwbAuth.authCallBack')); //echo XWB_plugin::baseUrl().XWB_plugin::URL('xwbAuth.authCallBack')."\n"; $sess->setOAuthKey($keys, false); return rtrim($aurl, '&'); //."&from=xweibo&xtype=1"; }
function bind() { if (!XWB_plugin::pCfg('is_account_binding')) { XWB_plugin::showError('新浪微博绑定功能已经关闭!'); } if (XWB_S_UID > 0 && XWB_plugin::isUserBinded()) { $xwb_user = XWB_plugin::getUser(); $sina_id = $xwb_user->getInfo('sina_uid'); $wb = XWB_plugin::getWB(); $wb->is_exit_error = false; $sina_user_info = $wb->getUserShow($sina_id); if (isset($sina_user_info['error_code']) || isset($sina_user_info['error'])) { include XWB_P_ROOT . '/tpl/xwb_cenbind_error.tpl.php'; } else { $db = XWB_plugin::getDB(); $share = XWB_plugin::V("R:share"); $share_msg = ''; if ($share) { $bind_info = $db->fetch_first("select * from " . XWB_S_TBPRE . "xwb_bind_info where `uid`='" . XWB_S_UID . "'"); $share_time = $bind_info['share_time']; if (!$share_time) { $share_time = time(); $db->query("update " . XWB_S_TBPRE . "xwb_bind_info set `share_time`='" . $share_time . "' where `uid`='" . XWB_S_UID . "'"); jclass('misc')->update_account_bind_info(XWB_S_UID, '', '', 1); $share_msg = "<img src='" . (XWB_plugin::baseUrl() . XWB_plugin::URL('&code=enter&share_time=' . $share_time)) . "' width='0' height='0' />"; } } else { /** * 分享给好友显示页面 */ $skip_share = XWB_plugin::V("R:skip_share"); if (!$skip_share) { $bind_info = $db->fetch_first("select * from " . XWB_S_TBPRE . "xwb_bind_info where `uid`='" . XWB_S_UID . "'"); if (!$bind_info['share_time']) { include XWB_P_ROOT . '/tpl/xwb_cenbind_share.tpl.php'; exit; } } } $screen_name = $sina_user_info['screen_name']; $profile = XWB_plugin::O('xwbUserProfile'); $setting = $profile->get('bind_setting', 1); $tojishigou = $profile->get('synctopic_tojishigou', 0); $reply_tojishigou = $profile->get('syncreply_tojishigou', 0); include XWB_P_ROOT . '/tpl/xwb_cenbind_on.tpl.php'; } } else { include XWB_P_ROOT . '/tpl/xwb_cenbind_off.tpl.php'; } }
/** * 获取当前脚本的完整url路径。 * @param integer $deep */ function siteUrl($deep = 0) { //当自动生成出错的时候,可让用户通过常量XWB_S_SITEURL自定义。末尾需要加/ if (0 === $deep && defined('XWB_S_SITEURL')) { return XWB_S_SITEURL; } //DOCUMENT_ROOT在IIS的CGI/FASTCGI模式下无定义 $v1 = isset($_SERVER['DOCUMENT_ROOT']) ? str_replace('\\', '/', $_SERVER['DOCUMENT_ROOT']) : ''; $v2 = str_replace('\\', '/', $_SERVER['SCRIPT_FILENAME']); $deep += 1; //$p = $_SERVER['SERVER_PORT']=='80' ? '' : ':'.$_SERVER['SERVER_PORT']; $url = XWB_plugin::baseUrl(); $pUrl = str_replace($v1, '', $v2); if ($pUrl == $v2) { $pUrl = $_SERVER['SCRIPT_NAME']; } $pUrl = '/' . ltrim($pUrl, '/'); $url = $url . preg_replace("#(/[^/]+){" . $deep . "}\$#", '/', $pUrl); return $url; }