程序版本:discuz!X3
目的:解决QQ和群分享英文错误问题呢
适合人群:使用Discuz!x3的站长
把spacecp.inc.php覆盖到/source/plugin/qqconnect/下,把module.htm覆盖到/source/plugin/qqconnect/template/
spacecp.inc.php内容如下:- <?php
- /**
- * [Discuz! X] (C)2001-2099 Comsenz Inc.
- * This is NOT a freeware, use is subject to license terms
- *
- * $Id: spacecp.inc.php 32630 2013-02-27 05:46:25Z liulanbo $
- */
- if(!defined('IN_DISCUZ')) {
- exit('Access Denied');
- }
- if(!$_G['uid']) {
- showmessage('not_loggedin', NULL, array(), array('login' => 1));
- }
- $pluginop = !empty($_GET['pluginop']) ? $_GET['pluginop'] : 'config';
- if (!in_array($pluginop, array('config', 'share', 'new', 'sync_tthread'))) {
- showmessage('undefined_action');
- }
- $sh_type = trim(intval($_GET['sh_type']));
- $tid = trim(intval($_GET['thread_id']));
- $connectService = Cloud::loadClass('Service_Connect');
- if ($pluginop == 'config') {
- $connectService->connectMergeMember();
- $_G['connect']['is_oauth_user'] = true;
- if (empty($_G['member']['conuinsecret'])) {
- $_G['connect']['is_oauth_user'] = false;
- }
- $referer = str_replace($_G['siteurl'], '', dreferer());
- if(!empty($_GET['connect_autoshare'])) {
- if(strpos($referer, '?') !== false) {
- $referer .= '&connect_autoshare=1';
- } else {
- $referer .= '?connect_autoshare=1';
- }
- }
- $_G['connect']['loginbind_url'] = $_G['siteurl'].'connect.php?mod=login&op=init&type=loginbind&referer='.urlencode($_G['connect']['referer'] ? $_G['connect']['referer'] : 'index.php');
- } elseif ($pluginop == 'share') {
- $_GET['share_url'] = $_G['connect']['discuz_new_share_url'];
- $post = C::t('forum_post')->fetch_threadpost_by_tid_invisible($tid, 0);
- $thread = C::t('forum_thread')->fetch_by_tid_displayorder($tid, 0);
- $msglower = strtolower($post['message']);
- if(strpos($msglower, '[/quote]') !== FALSE) {
- $post['message'] = preg_replace('/\[quote\].*\[\/quote\](\r\n|\n|\r){0,}/is', '', $post['message']);
- }
- if(strpos($msglower, '[/media]') !== FALSE) {
- $post['message'] = preg_replace("/\[media=([\w,]+)\]\s*([^\[\<\r\n]+?)\s*\[\/media\]/ies", '', $post['message']);
- }
- if(strpos($msglower, '[/flash]') !== FALSE) {
- $post['message'] = preg_replace("/\[flash(=(\d+),(\d+))?\]\s*([^\[\<\r\n]+?)\s*\[\/flash\]/ies", '', $post['message']);
- }
- if(strpos($msglower, '[/hide]') !== FALSE) {
- $post['message'] = preg_replace("/\[hide[=]?(d\d+)?[,]?(\d+)?\]\s*(.*?)\s*\[\/hide\]/is", '', $post['message']);
- }
- $html_content = $connectService->connectParseBbcode($post['message'], $thread['fid'], $post['pid'], $post['htmlon'], $attach_images);
- if ($_G['group']['allowgetimage'] && $thread['price'] == 0 && $post['pid']) {
- if ($attach_images && is_array($attach_images)) {
- $_GET['share_images'] = array_slice($attach_images, 0, 3);
- $attach_images = array();
- foreach ($_GET['share_images'] as $image) {
- $attach_images[] = $image['big'];
- }
- $_GET['attach_image'] = implode('|', $attach_images);
- unset($attach_images);
- }
- }
- if($_GET['sh_type'] == 4){
- if($_G['setting']['rewritestatus'] && in_array('forum_viewthread', $_G['setting']['rewritestatus'])) {
- $url = rewriteoutput('forum_viewthread', 1, $_G['siteurl'], $tid);
- } else {
- $url = $_G['siteurl'].'forum.php?mod=viewthread&tid='.$tid;
- }
- $shareqq_params = array(
- 'url' => $url,
- 'title' => diconv($thread['subject'], CHARSET, 'UTF-8'),
- 'summary' => diconv(cutstr(strip_tags(str_replace(' ', ' ', $html_content)), 80), CHARSET, 'UTF-8'),
- 'desc' => diconv(lang('plugin/qqconnect', '看看这个吧,还不错哦,也许你会喜欢^_^'), CHARSET, 'UTF-8'),
- 'site' => 'discuz|',
- 'style' => '103',
- 'width' => 50,
- 'height' => 16
- );
- $s = '';
- foreach($shareqq_params as $key => $val) {
- $s .= ($s ? '&' : '').$key.'='.urlencode($val);
- }
- header('Location: http://connect.qq.com/widget/shareqq/index.html?'.$s);
- } else {
- $share_message = lang('plugin/qqconnect', 'connect_spacecp_share_a_post', array('bbname' => cutstr($_G['setting']['bbname'], 20,''), 'subject' => cutstr($thread['subject'], 120), 'message' => cutstr(strip_tags(str_replace(' ', ' ', $html_content)), 80)));
- $share_message = str_replace(array('\'', "\r\n", "\r", "\n"), array('"', '', '', ''), $share_message);
- }
- } elseif ($pluginop == 'new') {
- if (trim($_GET['formhash']) != formhash()) {
- showmessage('submit_invalid');
- }
- $sh_type = intval(trim($_POST['sh_type']));
- $tid = intval(trim($_POST['thread_id']));
- $dialog_id = $_POST['dialog_id'];
- $connectService->connectMergeMember();
- if($_G['setting']['rewritestatus'] && in_array('forum_viewthread', $_G['setting']['rewritestatus'])) {
- $url = rewriteoutput('forum_viewthread', 1, $_G['siteurl'], $tid);
- } else {
- $url = $_G['siteurl'].'forum.php?mod=viewthread&tid='.$tid;
- }
- $connectOAuthClient = Cloud::loadClass('Service_Client_ConnectOAuth');
- $connectService = Cloud::loadClass('Service_Connect');
- if($sh_type == 1 || $sh_type == 3) {
- $firstpost = C::t('forum_post')->fetch_threadpost_by_tid_invisible($tid, 0);
- $msglower = strtolower($firstpost['message']);
- if(strpos($msglower, '[/quote]') !== FALSE) {
- $firstpost['message'] = preg_replace('/\[quote\].*\[\/quote\](\r\n|\n|\r){0,}/is', '', $firstpost['message']);
- }
- if(strpos($msglower, '[/media]') !== FALSE) {
- $firstpost['message'] = preg_replace("/\[media=([\w,]+)\]\s*([^\[\<\r\n]+?)\s*\[\/media\]/ies", '', $firstpost['message']);
- }
- if(strpos($msglower, '[/flash]') !== FALSE) {
- $firstpost['message'] = preg_replace("/\[flash(=(\d+),(\d+))?\]\s*([^\[\<\r\n]+?)\s*\[\/flash\]/ies", '', $firstpost['message']);
- }
- if(strpos($msglower, '[/hide]') !== FALSE) {
- $firstpost['message'] = preg_replace("/\[hide[=]?(d\d+)?[,]?(\d+)?\]\s*(.*?)\s*\[\/hide\]/is", '', $firstpost['message']);
- }
- $summary = $connectService->connectParseBbcode($firstpost['message'], $firstpost['fid'], $firstpost['pid'], $firstpost['htmlon'], $attach_images);
- $qzone_params = array(
- 'title' => $_POST['share_subject'],
- 'url' => $url,
- 'comment' => $_POST['reason'],
- 'summary' => strip_tags($summary),
- 'images' => $_POST['attach_image'],
- 'nswb' => '1',
- );
- try {
- $response = $connectOAuthClient->connectAddShare($_G['member']['conopenid'], $_G['member']['conuin'], $_G['member']['conuinsecret'], $qzone_params);
- } catch(Exception $e) {
- $errorCode = $e->getCode();
- }
- if($errorCode) {
- $code = $errorCode;
- if($errorCode == 41001) {
- $message = lang('plugin/qqconnect', 'connect_user_unauthorized', array('login_url' => $_G['connect']['login_url'].'&reauthorize=yes&formhash='.FORMHASH));
- } elseif($errorCode == 41003 || $errorCode == 40006) { // access token失效或非法
- $message = lang('plugin/qqconnect', 'connect_share_token_outofdate', array('login_url' => $_G['connect']['login_url']));
- } elseif ($errorCode == 3021) {
- $message = lang('plugin/qqconnect', 'connect_qzone_share_same_url');
- } else {
- $code = 100;
- $message = lang('plugin/qqconnect', 'connect_server_busy');
- $connectService->connectErrlog($code, lang('plugin/qqconnect', 'connect_errlog_server_no_response'));
- }
- } else {
- $code = $response['ret'];
- $message = lang('plugin/qqconnect', 'connect_share_success');
- }
- } elseif($sh_type == 2) {
- $t_params = array(
- 'content' => $_POST['reason'],
- );
- $aid = intval($_POST['attach_image_id']);
- if ($aid) {
- $method = 'connectAddPicT';
- $attach = C::t('forum_attachment_n')->fetch('aid:'.$aid, $aid);
- if($attach['remote']) {
- $t_params['pic'] = $_G['setting']['ftp']['attachurl'].'forum/'.$attach['attachment'];
- $t_params['remote'] = true;
- } else {
- $t_params['pic'] = $_G['setting']['attachdir'].'forum/'.$attach['attachment'];
- }
- } else {
- $method = 'connectAddT';
- }
- try {
- $response = $connectOAuthClient->$method($_G['member']['conopenid'], $_G['member']['conuin'], $_G['member']['conuinsecret'], $t_params);
- } catch(Exception $e) {
- $errorCode = $e->getCode();
- }
- if($errorCode) {
- $code = $errorCode;
- if($errorCode == 41001) {
- $message = lang('plugin/qqconnect', 'connect_user_unauthorized', array('login_url' => $_G['connect']['login_url'].'&reauthorize=yes&formhash='.FORMHASH));
- } elseif($errorCode == 41003 || $errorCode == 40006) { // access token失效或非法
- $message = lang('plugin/qqconnect', 'connect_share_token_outofdate', array('login_url' => $_G['connect']['login_url']));
- } elseif ($errorCode == 3013) {
- $message = lang('plugin/qqconnect', 'connect_qzone_weibo_same_content');
- } else if($errorCode == 3020) {
- $message = lang('plugin/qqconnect', 'connect_weibo_account_not_signup');
- } else {
- $code = 100;
- $message = lang('plugin/qqconnect', 'connect_server_busy');
- $connectService->connectErrlog($code, lang('plugin/qqconnect', 'connect_errlog_server_no_response'));
- }
- } else {
- $thread = C::t('forum_thread')->fetch($tid);
- if($response['data']['id'] && $_G['setting']['connect']['t']['reply'] && $thread['tid'] && !$thread['closed'] && !getstatus($thread['status'], 3) && empty($_G['forum']['replyperm'])) {
- C::t('#qqconnect#connect_tthreadlog')->insert(array(
- 'twid' => $response['data']['id'],
- 'tid' => $tid,
- 'conopenid' => $_G['member']['conopenid'],
- 'pagetime' => 0,
- 'lasttwid' => '0',
- 'nexttime' => $_G['timestamp'] + 30 * 60,
- 'updatetime' => 0,
- 'dateline' => $_G['timestamp'],
- ));
- }
- if(!getstatus($thread['status'], 8)) {
- C::t('forum_thread')->update($tid, array('status' => setstatus(8, 1, $thread['status'])));
- }
- $code = $response['ret'];
- $message = lang('plugin/qqconnect', 'connect_broadcast_success');
- }
- }
- } elseif($pluginop == 'sync_tthread') {
- if (trim($_GET['formhash']) != formhash()) {
- showmessage('submit_invalid');
- }
- if(!$_G['setting']['connect']['t']['reply']) {
- exit;
- }
- $tid = $_GET['tid'];
- $processname = 'connect_tthread_'.$tid.'_cache';
- if(discuz_process::islocked($processname, 600)) {
- exit;
- }
- $thread = C::t('forum_thread')->fetch($tid);
- if(!$thread || $thread['closed'] == 1 || getstatus($thread['status'], 3) || $thread['displayorder'] < 0 || !empty($_G['forum']['replyperm'])) {
- discuz_process::unlock($processname);
- exit;
- }
- $updatetime = C::t('#qqconnect#connect_tthreadlog')->fetch_max_updatetime_by_tid($tid);
- if($_G['timestamp'] < $updatetime + 10 * 60) {
- discuz_process::unlock($processname);
- exit;
- }
- $tthread = C::t('#qqconnect#connect_tthreadlog')->fetch_min_nexttime_by_tid($tid);
- if(empty($tthread)) {
- discuz_process::unlock($processname);
- exit;
- }
- $connectOAuthClient = Cloud::loadClass('Service_Client_ConnectOAuth');
- $connectmember = C::t('#qqconnect#common_member_connect')->fetch_fields_by_openid($tthread['conopenid']);
- $param = array();
- $param['format'] = 'xml';
- $param['flag'] = '2';
- $param['rootid'] = $tthread['twid'];
- $param['pageflag'] = 2;
- $param['pagetime'] = $tthread['pagetime'];
- $param['reqnum'] = 20;
- $param['twitterid'] = $tthread['lasttwid'];
- try {
- $response = $connectOAuthClient->connectGetRepostList($tthread['conopenid'], $connectmember['conuin'], $connectmember['conuinsecret'], $param);
- } catch(Exception $e) {
- showmessage('qqconnect:server_busy');
- }
- if($response && $response['ret'] == 0 && $response['data']['info']) {
- include_once libfile('function/forum');
- $forum = C::t('forum_forum')->fetch($thread['fid']);
- $pinvisible = $forum['modnewposts'] ? -2 : 0;
- $pids = array();
- $i = 0;
- $responseinfo = array();
- if(!isset($response['data']['info'][0])) {
- $responseinfo[] = $response['data']['info'];
- } else {
- $responseinfo = $response['data']['info'];
- krsort($responseinfo);
- }
- foreach($responseinfo as $post) {
- $message = trim($post['text']);
- $post['username'] = trim($post['name']);
- $post['nick'] = trim($post['nick']);
- $message = preg_replace("/((https?|ftp|gopher|news|telnet|rtsp|mms|callto):\/\/|www\.)([a-z0-9\/\-_+=.~!%@?#%&;:$\\()|]+\s*)/i", '', $message);
- $message = str_replace(explode(' ', lang('plugin/qqconnect', 'connect_reply_filter_smiley')), '', $message);
- if($message) {
- $newmessage = censor($message, null, true);
- if($message != $newmessage) {
- continue;
- }
- } else {
- $message = lang('plugin/qqconnect', 'connect_tthread_broadcast');
- }
- if($_G['setting']['connect']['t']['reply_showauthor']) {
- $message .= '[tthread='.$post['username'].', '.$post['nick'].']'.$post['head'].'[/tthread]';
- }
- $pid = insertpost(array(
- 'fid' => $thread['fid'],
- 'tid' => $thread['tid'],
- 'first' => '0',
- 'author' => '',
- 'authorid' => '0',
- 'subject' => '',
- 'dateline' => $_G['timestamp'] + $i,
- 'message' => $message,
- 'useip' => '',
- 'invisible' => $pinvisible,
- 'anonymous' => '0',
- 'usesig' => '0',
- 'htmlon' => '1',
- 'bbcodeoff' => '0',
- 'smileyoff' => '0',
- 'parseurloff' => '0',
- 'attachment' => '0',
- 'status' => 16,
- ));
- if($pid) {
- $pids[] = $pid;
- }
- $i++;
- }
- if($pinvisible) {
- updatemoderate('pid', $pids);
- C::t('forum_forum')->update_forum_counter($thread['fid'], 0, 0, count($pids), 1);
- } else {
- $fieldarr = array(
- 'lastposter' => array(''),
- 'replies' => count($pids),
- );
- if($thread['lastpost'] < $_G['timestamp']) {
- $fieldarr['lastpost'] = array($_G['timestamp']);
- }
- C::t('forum_thread')->increase($tid, $fieldarr);
- $postionid = C::t('forum_post')->fetch_maxposition_by_tid($thread['posttableid'], $tid);
- C::t('forum_thread')->update($tid, array('maxposition' => $postionid));
- $lastpost = "$thread[tid]\t$thread[subject]\t$_G[timestamp]\t".'';
- C::t('forum_forum')->update($thread['fid'], array('lastpost' => $lastpost));
- C::t('forum_forum')->update_forum_counter($thread['fid'], 0, count($pids), count($pids));
- if($forum['type'] == 'sub') {
- C::t('forum_forum')->update($forum['fup'], array('lastpost' => $lastpost));
- }
- }
- $setarr['pagetime'] = $post['timestamp'];
- $setarr['lasttwid'] = $post['id'];
- if(count($responseinfo) < $param['reqnum']) {
- $setarr['nexttime'] = $_G['timestamp'] + 2 * 3600;
- } else {
- $setarr['nexttime'] = $_G['timestamp'] + 30 * 60;
- }
- } else {
- $setarr['nexttime'] = $_G['timestamp'] + 3 * 3600;
- }
- $setarr['updatetime'] = $_G['timestamp'];
- C::t('#qqconnect#connect_tthreadlog')->update($tthread['twid'], $setarr);
- discuz_process::unlock($processname);
- exit;
- }
复制代码 请用记事本保存下,然后替换
module.htm内容如下- {eval
- function tpl_global_login_extra() {
- global $_G;
- }
- <!--{block return}-->
- <div class="fastlg_fm y" style="margin-right: 10px; padding-right: 10px">
- <p><a href="$_G[connect][login_url]&statfrom=login_simple"><img src="{IMGDIR}/qq_login.gif" class="vm" alt="{lang qqconnect:connect_header_login}" /></a></p>
- <p class="hm xg1" style="padding-top: 2px;">{lang qqconnect:connect_header_login_tip}</p>
- </div>
- <!--{/block}-->
- <!--{eval return $return;}-->
- {eval
- }
- function tpl_global_usernav_extra1() {
- global $_G;
- }
- <!--{block return}-->
- <!--{if CURMODULE != 'connect'}-->
- <!--{if $_G['connectguest']}-->
- <span class="pipe">|</span><a href="member.php?mod=connect" target="_blank" title="{lang qqconnect:connect_member_register_button_tip}">{lang qqconnect:connect_register_profile}</a><span class="pipe">|</span><a href="member.php?mod=connect&ac=bind" target="_blank" title="{lang qqconnect:connect_member_loginbind_button_tip}">{lang qqconnect:connect_register_bind}</a>
- <!--{else}-->
- <span class="pipe">|</span><a href="connect.php?mod=config" target="_blank"><img src="{IMGDIR}/qq_bind_small.gif" class="qq_bind" align="absmiddle" alt="{lang qqconnect:connect_config}" /></a>
- <!--{/if}-->
- <!--{/if}-->
- <!--{/block}-->
- <!--{eval return $return;}-->
- {eval
- }
- function tpl_global_footer($loadJs) {
- }
- <!--{block return}-->
- <!--{if $loadJs['qsharejs']}-->
- <script type="text/javascript" src="{$loadJs['qsharejs']['jsurl']}"></script><script type="text/javascript">_share_tencent_weibo(null, {$loadJs['qsharejs']['func']}("t_f", null, "td"), "{$_G['siteurl']}", "{$loadJs['qsharejs']['appkey']}", "{$loadJs['qsharejs']['sitename']}");</script>
- <!--{/if}-->
- <!--{if $loadJs['feedjs']}-->
- <script type="text/javascript">_attachEvent(window, 'load', function () { appendscript('{$loadJs[feedjs][jsurl]}', '', 1, 'utf-8') }, document);</script>
- <!--{/if}-->
- <!--{if $loadJs['cookieloginjs']}-->
- <script type="text/javascript">var cookieLogin = Ajax("TEXT");cookieLogin.get("{$loadJs['cookieloginjs']['jsurl']}", function() {});</script>
- <!--{/if}-->
- <!--{if $loadJs['guestloginjs']}-->
- <script type="text/javascript">_attachEvent(window, 'load', function () { appendscript('{$loadJs[guestloginjs][jsurl]}', '', 1, 'utf-8') }, document);</script>
- <!--{/if}-->
- <!--{if $loadJs['syncpostjs']}-->
- <script type="text/javascript">_attachEvent(window, 'load', function () { appendscript('{$loadJs[syncpostjs][jsurl]}', '', 1, 'utf-8') }, document);</script>
- <!--{/if}-->
- <!--{/block}-->
- <!--{eval return $return;}-->
- {eval
- }
- function tpl_login_bar() {
- global $_G;
- }
- <!--{block return}-->
- <!--{if !$_G['connectguest']}-->
- <a href="$_G[connect][login_url]&statfrom=login" target="_top" rel="nofollow"><img src="{IMGDIR}/qq_login.gif" class="vm" /></a>
- <!--{/if}-->
- <!--{/block}-->
- <!--{eval return $return;}-->
- {eval
- }
- function tpl_index_status_extra() {
- global $_G;
- }
- <!--{block return}-->
- <iframe id="connectlike" allowtransparency="true" scrolling="no" border="0" width="280" height="25" frameborder="0"></iframe>
- <script type="text/javascript">_attachEvent(window, 'load', function () { $('connectlike').src = 'api/connect/like.php';}, document);</script>
- <!--{/block}-->
- <!--{eval return $return;}-->
- {eval
- }
- function tpl_sync_method($allowconnectfeed, $allowconnectt, $cssextra = '') {
- global $_G;
- }
- <!--{block return}-->
- <!--{if $allowconnectfeed || $allowconnectt}-->
- <script type="text/javascript">
- var _allow_qq = {if $allowconnectfeed}true{else}false{/if};
- var _allow_t = {if $allowconnectt}true{else}false{/if};
- var _syn_qq = {if intval($_G['cookie']['connect_not_sync_feed'])}false{else}{if $_G['member']['conisbind'] && $_G['member']['conispublishfeed']}true{else}false{/if}{/if};
- var _syn_t = {if intval($_G['cookie']['connect_not_sync_t'])}false{else}{if $_G['member']['conisbind'] && $_G['member']['conispublisht']}true{else}false{/if}{/if};
- var _is_oauth_user = {if $_G['member']['conisbind']}true{else}false{/if};
- var _is_feed_auth = {if $_G['member']['conuinsecret'] && $_G['member']['is_feed']}true{else}false{/if};
- var _is_token_outofdate = {if $_G['member']['conuinsecret']}false{else}true{/if};
- function connect_post_init() {
- if (_allow_qq && _syn_qq) {
- if (_is_feed_auth && !_is_token_outofdate) {
- $('connectPost_synQQ').className = 'syn_qq_check';
- $('connectPost_synQQ').title = '{lang qqconnect:connect_post_sync_qzone1}';
- $('connect_publish_feed').value = 1;
- } else {
- $('connectPost_synQQ').className = 'syn_qq';
- $('connectPost_synQQ').title = '{lang qqconnect:connect_post_sync_qzone2}';
- $('connect_publish_feed').value = 0;
- }
- }
- if (_allow_t && _syn_t) {
- if (_is_feed_auth && !_is_token_outofdate) {
- $('connectPost_synT').className = 'syn_tqq_check';
- $('connectPost_synT').title = '{lang qqconnect:connect_post_sync_t1}';
- $('connect_publish_t').value = 1;
- } else {
- $('connectPost_synT').className = 'syn_tqq';
- $('connectPost_synT').title = '{lang qqconnect:connect_post_sync_t2}';
- $('connect_publish_t').value = 0;
- }
- }
- if (_allow_qq) {
- $('connectPost_synQQ').onclick = function () {
- connect_syn_option_toggle(this);
- }
- }
- if (_allow_t) {
- $('connectPost_synT').onclick = function () {
- connect_syn_option_toggle(this);
- }
- }
- if (getcookie('connect_synpost_tip')) {
- connect_post_tip();
- }
- }
- function connect_syn_option_toggle(opt) {
- if (_is_feed_auth && !_is_token_outofdate) {
- if ($(opt.getAttribute('rel')).value == 1) {
- opt.className = opt.className.replace('_check', '');
- opt.title = opt.title.replace('{lang qqconnect:connect_post_sync_yes}', '{lang qqconnect:connect_post_sync_no}');
- $(opt.getAttribute('rel')).value = 0;
- } else {
- $(opt.getAttribute('rel')).value = 1;
- opt.className += '_check';
- opt.title = opt.title.replace('{lang qqconnect:connect_post_sync_no}', '{lang qqconnect:connect_post_sync_yes}');
- }
- } else {
- var _auth_text = '{lang qqconnect:connect_post_sync_unauthorized_desc}';
- if (_is_token_outofdate) {
- _auth_text = '{lang qqconnect:connect_access_token_out_of_date_feed}';
- var _button = '{lang qqconnect:connect_access_token_outofdate_button}';
- showDialog(_auth_text, 'notice', null, null, 0, null, null, _button);
- return;
- } else if (!_is_oauth_user) {
- _auth_text = '{lang qqconnect:connect_post_sync_not_bind_desc}';
- }
- showDialog(_auth_text, 'notice', '{lang qqconnect:connect_post_sync_unauthorized_title}', 'connect_goto_setting()', 0, null, null, '{lang qqconnect:connect_modify_authorization_button}');
- }
- }
- function connect_post_tip() {
- if ($('fastpostform')) {
- return;
- }
- if (_is_token_outofdate) {
- if ($('synnotice')) {
- $('synnotice').style.display = 'none';
- }
- return;
- }
- var r = document.getElementById('rstnotice');
- var c = document.createElement('div');
- c.setAttribute('id', 'synnotice');
- c.setAttribute('class', 'ntc_l bbs');
- if(BROWSER.ie) {
- c.id = 'synnotice';
- c.className = 'ntc_l bbs';
- }
- c.style.display = 'block';
- r.parentNode.insertBefore(c, r.nextSibling);
- c.innerHTML = '<a href="javascript:void(0);" title="{lang qqconnect:connect_post_sync_tip_close}" class="d y" onclick="connect_syn_tip_hide();">close</a>{lang qqconnect:connect_post_sync_tip} <a class="xi2" href="javascript:void(0);" onclick="connect_syn_cancel();" title="{lang qqconnect:connect_post_sync_cancel_tip}"><strong>{lang qqconnect:connect_post_sync_cancel}</strong></a>';
- }
- function connect_syn_tip_hide() {
- setcookie('connect_synpost_tip', '', '-1');
- $('synnotice').style.display = 'none';
- }
- function connect_syn_cancel() {
- ajaxget('{$_G['siteurl']}connect.php?mod=config&op=synconfig', '');
- $('connectPost_synQQ').className = 'syn_qq';
- $('connectPost_synQQ').title = '{lang qqconnect:connect_post_sync_qzone2}';
- $('connect_publish_feed').value = 0;
- $('connectPost_synT').className = 'syn_tqq';
- $('connectPost_synT').title = '{lang qqconnect:connect_post_sync_t2}';
- $('connect_publish_t').value = 0;
- $('synnotice').style.display = 'none';
- }
- function connect_goto_setting() {
- var _url = "{$_G['siteurl']}home.php?mod=spacecp&ac=plugin&id=qqconnect:spacecp";
- hideMenu('fwin_dialog', 'dialog')
- var _newWindow = window.open(_url, 'newWindow');
- _newWindow.focus();
- }
- _attachEvent(window, 'load', function(){
- connect_post_init();
- });
- </script>
- <!--{if $allowconnectfeed}-->
- <a title="{lang qqconnect:connect_post_sync_qzone2}" class="syn_qq" href="javascript:void(0);" id="connectPost_synQQ" rel="connect_publish_feed">{lang qqconnect:connect_viewthread_share_to_qzone}</a>
- <input type="hidden" name="connect_publish_feed" id="connect_publish_feed" value="0" />
- <!--{/if}-->
- <!--{if $allowconnectt}-->
- <a title="{lang qqconnect:connect_post_sync_t2}" class="syn_tqq" href="javascript:void(0);" id="connectPost_synT" rel="connect_publish_t">{lang qqconnect:connect_viewthread_share_to_t}</a>
- <input type="hidden" name="connect_publish_t" id="connect_publish_t" value="0" />
- <!--{/if}-->
- <!--{/if}-->
- <!--{/block}-->
- <!--{eval return $return;}-->
- {eval
- }
- function tpl_infloat_sync_method($allowconnectfeed, $allowconnectt) {
- global $_G;
- }
- <!--{block return}-->
- <!--{if $allowconnectfeed}-->
- <a title="{lang qqconnect:connect_post_sync_qzone2}" class="syn_qq" href="javascript:void(0);" id="connectPost_synQQ_infloat" rel="connect_publish_feed_infloat">{lang qqconnect:connect_viewthread_share_to_qzone}</a>
- <input type="hidden" name="connect_publish_feed" id="connect_publish_feed_infloat" value="0" />
- <!--{/if}-->
- <!--{if $allowconnectt}-->
- <a title="{lang qqconnect:connect_post_sync_t2}" class="syn_tqq" href="javascript:void(0);" id="connectPost_synT_infloat" rel="connect_publish_t_infloat">{lang qqconnect:connect_viewthread_share_to_t}</a>
- <input type="hidden" name="connect_publish_t" id="connect_publish_t_infloat" value="0" />
- <!--{/if}-->
- <!--{if $allowconnectfeed || $allowconnectt}-->
- <script type="text/javascript" reload="1">
- var _allow_qq_infloat = {if $allowconnectfeed}true{else}false{/if};
- var _allow_t_infloat = {if $allowconnectt}true{else}false{/if};
- var _syn_qq_infloat = {if intval($_G['cookie']['connect_not_sync_feed'])}false{else}{if $_G['member']['conisbind'] && $_G['member']['conispublishfeed']}true{else}false{/if}{/if};
- var _syn_t_infloat = {if intval($_G['cookie']['connect_not_sync_t'])}false{else}{if $_G['member']['conisbind'] && $_G['member']['conispublisht']}true{else}false{/if}{/if};
- var _is_oauth_user_infloat = {if $_G['member']['conisbind']}true{else}false{/if};
- var _is_feed_auth_infloat = {if $_G['member']['conuinsecret'] && $_G['member']['is_feed']}true{else}false{/if};
- var _is_token_outofdate = {if $_G['member']['conuinsecret']}false{else}true{/if};
- function connect_post_init_infloat() {
- if (_allow_qq_infloat && _syn_qq_infloat) {
- if (_is_feed_auth_infloat && !_is_token_outofdate) {
- $('connectPost_synQQ_infloat').className = 'syn_qq_check';
- $('connectPost_synQQ_infloat').title = '{lang qqconnect:connect_post_sync_qzone1}';
- $('connect_publish_feed_infloat').value = 1;
- } else {
- $('connectPost_synQQ_infloat').className = 'syn_qq';
- $('connectPost_synQQ_infloat').title = '{lang qqconnect:connect_post_sync_qzone2}';
- $('connect_publish_feed_infloat').value = 0;
- }
- }
- if (_allow_t_infloat && _syn_t_infloat) {
- if (_is_feed_auth_infloat && !_is_token_outofdate) {
- $('connectPost_synT_infloat').className = 'syn_tqq_check';
- $('connectPost_synT_infloat').title = '{lang qqconnect:connect_post_sync_t1}';
- $('connect_publish_t_infloat').value = 1;
- } else {
- $('connectPost_synT_infloat').className = 'syn_tqq';
- $('connectPost_synT_infloat').title = '{lang qqconnect:connect_post_sync_t2}';
- $('connect_publish_t_infloat').value = 0;
- }
- }
- if (_allow_qq_infloat) {
- $('connectPost_synQQ_infloat').onclick = function () {
- connect_syn_option_toggle_infloat(this);
- }
- }
- if (_allow_t_infloat) {
- $('connectPost_synT_infloat').onclick = function () {
- connect_syn_option_toggle_infloat(this);
- }
- }
- if (getcookie('connect_synpost_tip')) {
- connect_post_tip_infloat();
- }
- }
- function connect_syn_option_toggle_infloat(opt) {
- if (_is_feed_auth_infloat && !_is_token_outofdate) {
- if ($(opt.getAttribute('rel')).value == 1) {
- opt.className = opt.className.replace('_check', '');
- opt.title = opt.title.replace('{lang qqconnect:connect_post_sync_yes}', '{lang qqconnect:connect_post_sync_no}');
- $(opt.getAttribute('rel')).value = 0;
- } else {
- $(opt.getAttribute('rel')).value = 1;
- opt.className += '_check';
- opt.title = opt.title.replace('{lang qqconnect:connect_post_sync_no}', '{lang qqconnect:connect_post_sync_yes}');
- }
- } else {
- var _auth_text = '{lang qqconnect:connect_post_sync_unauthorized_desc}';
- if (_is_token_outofdate) {
- _auth_text = '{lang qqconnect:connect_access_token_out_of_date_feed}';
- var _button = '{lang qqconnect:connect_access_token_outofdate_button}';
- showDialog(_auth_text, 'notice', null, null, 0, null, null, _button);
- return;
- } else if (!_is_oauth_user_infloat) {
- _auth_text = '{lang qqconnect:connect_post_sync_not_bind_desc}';
- }
- showDialog(_auth_text, 'notice', '{lang qqconnect:connect_post_sync_unauthorized_title}', 'connect_goto_setting_infloat()', 0, null, null, '{lang qqconnect:connect_modify_authorization_button}');
- }
- }
- function connect_post_tip_infloat() {
- if ($('fastpostform')) {
- return;
- }
- var r = document.getElementById('rstnotice');
- var c = document.createElement('div');
- c.setAttribute('id', 'synnotice');
- c.setAttribute('class', 'ntc_l bbs');
- if(BROWSER.ie) {
- c.id = 'synnotice';
- c.className = 'ntc_l bbs';
- }
- c.style.display = 'block';
- r.parentNode.insertBefore(c, r.nextSibling);
- c.innerHTML = '<a href="javascript:void(0);" title="{lang qqconnect:connect_post_sync_tip_close}" class="d y" onclick="connect_syn_tip_hide_infloat();">close</a>{lang qqconnect:connect_post_sync_tip} <a class="xi2" href="javascript:void(0);" onclick="connect_syn_cancel_infloat();" title="{lang qqconnect:connect_post_sync_cancel_tip}"><strong>{lang qqconnect:connect_post_sync_cancel}</strong></a>';
- }
- function connect_syn_tip_hide_infloat() {
- setcookie('connect_synpost_tip', '', '-1');
- $('synnotice').style.display = 'none';
- }
- function connect_syn_cancel_infloat() {
- ajaxget('{$_G['siteurl']}connect.php?mod=config&op=synconfig', '');
- $('connectPost_synQQ_infloat').className = 'syn_qq';
- $('connectPost_synQQ_infloat').title = '{lang qqconnect:connect_post_sync_qzone2}';
- $('connect_publish_feed_infloat').value = 0;
- $('connectPost_synT_infloat').className = 'syn_tqq';
- $('connectPost_synT_infloat').title = '{lang qqconnect:connect_post_sync_t2}';
- $('connect_publish_t_infloat').value = 0;
- $('synnotice').style.display = 'none';
- }
- function connect_goto_setting_infloat() {
- var _url = "{$_G['siteurl']}home.php?mod=spacecp&ac=plugin&id=qqconnect:spacecp";
- hideMenu('fwin_dialog', 'dialog')
- var _newWindow = window.open(_url, 'newWindow');
- _newWindow.focus();
- }
- connect_post_init_infloat();
- </script>
- <!--{/if}-->
- <!--{/block}-->
- <!--{eval return $return;}-->
- {eval
- }
- function tpl_viewthread_share_method($jsurl) {
- global $_G;
- if (!$_G['setting']['connect']['allow']) return;
- $connect_thread_subject = addslashes(strip_tags($_G['thread']['subject']));
- }
- <!--{block return}-->
- <!--{if $_G['member']['conisbind'] && $_G['member']['conuinsecret']}-->
- <a href="{$_G[connect][qq_share_url]}" id="k_share_to_qq" title="{QQ好友和群}" target="_blank"><i><img src="{IMGDIR}/qq_share.png" alt="{QQ好友和群}" />{QQ好友和群}</i></a>
- <a href="javascript:void(0);" ref="{$_G[connect][qzone_share_url]}" id="k_qqshare" title="{lang qqconnect:connect_viewthread_share_to_qzone}"><i><img src="{IMGDIR}/qzone.gif" alt="{lang qqconnect:connect_viewthread_share_to_qzone}" />{lang qqconnect:connect_viewthread_share_to_qzone}</i></a>
- <a href="javascript:void(0);" ref="{$_G[connect][weibo_share_url]}" id="k_weiboshare" title="{lang qqconnect:connect_viewthread_share_to_t}"><i><img src="{IMGDIR}/weibo.png" alt="{lang qqconnect:connect_viewthread_share_to_t}" />{lang qqconnect:connect_viewthread_share_to_t}</i></a>
- <a href="javascript:void(0);" ref="{$_G[connect][pengyou_share_url]}" id="k_pengyoushare" title="{lang qqconnect:connect_viewthread_share_to_pengyou}"><i><img src="{IMGDIR}/pengyou.png" alt="{lang qqconnect:connect_viewthread_share_to_pengyou}" />{lang qqconnect:connect_viewthread_share_to_pengyou}</i></a>
- <script type="text/javascript">
- var _is_oauth_user = {if $_G['member']['conuinsecret']}true{else}false{/if};
- var _is_share_token_outofdate = {if $_G['member']['conuinsecret']}false{else}true{/if};
- var _is_feed_auth = {if $_G['member']['conuinsecret'] && $_G['member']['is_feed']}true{else}false{/if};
- _is_feed_auth = true;
- var _share_buttons = ['k_qqshare', 'k_weiboshare', 'k_pengyoushare'];
- function connect_share_init() {
- for (var i = 0; i < _share_buttons.length; i++) {
- $(_share_buttons[i]).onclick = function () {
- connect_share_form(this);
- return false;
- }
- }
- }
- function connect_share_form(obj) {
- if (_is_oauth_user && _is_feed_auth) {
- var _url = obj.getAttribute('ref');
- showWindow(obj.id, _url, 'get', 1);
- } else {
- if (_is_share_token_outofdate) {
- var _text = '{lang qqconnect:connect_access_token_out_of_date_share}';
- var _button = '{lang qqconnect:connect_access_token_outofdate_button}';
- showDialog(_text, 'notice', null, null, 0, null, null, _button);
- } else if (!_is_oauth_user) {
- var _text = '{lang qqconnect:connect_share_unbind}';
- var _button = '{lang qqconnect:connect_share_unbind_know_button}';
- showDialog(_text, 'notice', null, 'connect_goto_setting()', 0, null, null, _button);
- } else if (!_is_feed_auth) {
- var _title = '{lang qqconnect:connect_post_sync_unauthorized_title}';
- var _text = '{lang qqconnect:connect_share_unauthorized}';
- var _button = '{lang qqconnect:connect_modify_authorization_button}';
- showDialog(_text, 'notice', _title, 'connect_goto_setting()', 0, null, null, _button);
- }
- }
- }
- function connect_goto_setting() {
- if (_is_oauth_user) {
- var _url = "{$_G['siteurl']}home.php?mod=spacecp&ac=plugin&id=qqconnect:spacecp";
- hideMenu('fwin_dialog', 'dialog');
- var _newWindow = window.open(_url, 'newWindow');
- _newWindow.focus();
- } else {
- hideMenu('fwin_dialog', 'dialog');
- }
- }
- _attachEvent(window, 'load', function(){
- connect_share_init();
- });
- </script>
- <!--{else}-->
- <a href="{$_G[connect][qq_share_url]}" id="k_share_to_qq" title="{QQ好友和群}" target="_blank"><i><img src="{IMGDIR}/qq_share.png" alt="{QQ好友和群}" />{QQ好友和群}</i></a>
- <a href="javascript:void(0);" id="k_qqshare" onclick="postToQzone();" title="{lang qqconnect:connect_viewthread_share_to_qzone}"><i><img src="{IMGDIR}/qzone.gif" alt="{lang qqconnect:connect_viewthread_share_to_qzone}" />{lang qqconnect:connect_viewthread_share_to_qzone}</i></a>
- <a href="javascript:void(0)" onclick="postToWb();" id="k_weiboshare" title="{lang qqconnect:connect_viewthread_share_to_t}"><i><img src="{IMGDIR}/weibo.png" alt="{lang qqconnect:connect_viewthread_share_to_t}" />{lang qqconnect:connect_viewthread_share_to_t}</i></a>
- <a href="javascript:void(0);" onclick="postToPengyou();" id="k_pengyoushare" title="{lang qqconnect:connect_viewthread_share_to_pengyou}"><i><img src="{IMGDIR}/pengyou.png" alt="{lang qqconnect:connect_viewthread_share_to_pengyou}" />{lang qqconnect:connect_viewthread_share_to_pengyou}</i></a>
- <script type="text/javascript">
- function postToWb(){
- var _t = encodeURI(document.title);
- var _url = encodeURIComponent(document.location);
- var _appkey = encodeURI("{$_G['connect']['weibo_appkey']}");
- var _pic = "{$_G['connect']['share_images']}";
- var _site = encodeURIComponent("{$_G['setting']['bbname']}");
- var _from = 'discuz';
- var _u = 'http://v.t.qq.com/share/share.php?url='+_url+'&appkey='+_appkey+'&site='+_site+'&pic='+_pic+'&title='+_t+'&from='+_from;
- window.open( _u,'', 'width=700, height=680, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, location=yes, resizable=no, status=no' );
- }
- function postToQzone(){
- var _url = encodeURIComponent(document.location.href);
- var _site = encodeURIComponent("{$_G['setting']['bbname']}");
- var _title = encodeURIComponent("{$connect_thread_subject}");
- var _pics = "{$_G['connect']['share_images']}";
- var _from = 'discuz';
- var _u = '{$_G[connect][qzone_public_share_url]}?url='+_url+'&site='+_site+'&title='+_title+'&pics='+_pics+'&from='+_from;
- window.open(_u);
- }
- function postToPengyou(){
- var _url = encodeURIComponent(document.location.href);
- var _site = encodeURIComponent("{$_G['setting']['bbname']}");
- var _title = encodeURIComponent("{$connect_thread_subject}");
- var _pics = "{$_G['connect']['share_images']}";
- var _from = 'discuz';
- var _u = '{$_G[connect][qzone_public_share_url]}?to=pengyou&url='+_url+'&site='+_site+'&title='+_title+'&pics='+_pics+'&from='+_from;
- window.open(_u);
- }
- </script>
- <!--{/if}-->
- <!--{if $jsurl}-->
- <script type="text/javascript">_attachEvent(window, 'load', function () { appendscript('{$jsurl}', '', 1, 'utf-8') }, document);</script>
- <!--{/if}-->
- <!--{/block}-->
- <!--{eval return $return;}-->
- {eval
- }
- function tpl_viewthread_bottom($jsurl) {
- global $_G;
- }
- <!--{block return}-->
- <script type="text/javascript">
- var connect_qzone_share_url = '{$_G[connect][qzone_share_url]}';
- var connect_weibo_share_url = '{$_G[connect][weibo_share_url]}';
- var connect_thread_info = {
- thread_url: '{$_G['siteurl']}{$GLOBALS['canonical']}',
- thread_id: '{$_G[tid]}',
- post_id: '{$_G[connect][first_post][pid]}',
- forum_id: '{$_G[fid]}',
- author_id: '{$_G[connect][first_post][authorid]}',
- author: '{$_G[connect][first_post][author]}'
- };
- connect_autoshare = '{$_GET[connect_autoshare]}';
- connect_isbind = '{$_G[member][conisbind]}';
- if(connect_autoshare == 1 && connect_isbind) {
- _attachEvent(window, 'load', function(){
- connect_share(connect_weibo_share_url, connect_openid);
- });
- }
- </script>
- <!--{if $_G['member']['conisbind']}-->
- <div id="connect_share_unbind" style="display: none;">
- <div class="c hm">
- <div style="font-size:14px; margin:10px 0;">{lang qqconnect:connect_post_unbind}</div>
- <div><a href="connect.php?mod=config&connect_autoshare=1" target="_blank"><img src="{IMGDIR}/qq_bind.gif" align="absmiddle" style="margin-top:5px;" /></a></div>
- </div>
- <input type="hidden" id="connect_thread_title" name="connect_thread_title" value="$_G[forum_thread][subject]" />
- </div>
- <!--{/if}-->
- <!--{if $jsurl}-->
- <script type="text/javascript">_attachEvent(window, 'load', function () { appendscript('{$jsurl}', '', 1, 'utf-8') }, document);</script>
- <!--{/if}-->
- <!--{/block}-->
- <!--{eval return $return;}-->
- {eval
- }
- function tpl_sync_post_viewthread_bottom($jsurl) {
- }
- <!--{block return}-->
- <div style="display:none;"><iframe src='{$jsurl}' style="display:none;"></div>
- <!--{/block}-->
- <!--{eval return $return;}-->
- {eval
- }
- function tpl_register_input() {
- global $_G;
- $connect_app_id = $_G['qc']['connect_app_id'];
- $connect_openid = $_G['qc']['connect_openid'];
- }
- <!--{block return}-->
- <!--{if $connect_app_id && $connect_openid}-->
- <div class="rfm">
- <table>
- <tr>
- <th></th>
- <td>
- <label for="use_qzone_avatar_qqshow"><input type="checkbox" name="use_qzone_avatar_qqshow" id="use_qzone_avatar_qqshow" class="pc" value="1" checked="checked" tabindex="1" />使用QQ头像和QQ秀</label>
- </td>
- </tr>
- </table>
- </div>
- <!--{/if}-->
- <input type="hidden" id="auth_hash" name="auth_hash" value="{$_G['qc']['connect_auth_hash']}" />
- <input type="hidden" id="is_notify" name="is_notify" value="{$_G['qc']['connect_is_notify']}" />
- <input type="hidden" id="is_feed" name="is_feed" value="{$_G['qc']['connect_is_feed']}" />
- <!--{/block}-->
- <!--{eval return $return;}-->
- {eval
- }
- function tpl_register_bottom() {
- global $_G;
- $loginhash = 'L'.random(4);
- $change_qq_url = $_G['connect']['discuz_change_qq_url'];
- $qq_nick = $_G['qc']['qq_nick'];
- $connect_app_id = $_G['qc']['connect_app_id'];
- $connect_openid = $_G['qc']['connect_openid'];
- $connect_tab_1 = $_GET['ac'] != 'bind' && $_G['setting']['regconnect'] ? ' class="a"' : '';
- $connect_tab_2 = $_GET['ac'] == 'bind' ? ' class="a"' : '';
- }
- <!--{block js2}-->
- <style>
- .loggingbox { width: 760px; margin: 40px auto 0; }
- .loging_tit { border-bottom: 1px solid #CCC; _overflow:hidden; }
- .ie_all .loging_tit { height:66px;}
- .loggingbox .fm_box { border-bottom:0; padding: 20px 0; }
- .loggingbox .welcome { font-size:14px; width:100%; line-height:30px;}
- .loggingbox .welcome span { font-size:12px; }
- .loggingbox .avt img { margin: 0 5px 5px 0; padding:0; border:0; width:60px; height:60px; }
- .loggingbox .tb{ border-bottom: 0; margin-top: 0; padding-left: 0px; }
- .loggingbox .tb a { background:#F6F6F6; padding:0 20px; }
- .loggingbox .tb .a a { background:#FFF; }
- </style>
- <!--{if $_GET['ac'] == 'bind' || $_G['setting']['regconnect']}-->
- <div id="loggingbox" class="loggingbox">
- <div class="loging_tit cl">
- <div class="z avt" style="display:block;"><img src="{$_G[connect][avatar_url]}/$connect_app_id/$connect_openid" width="48" height="48" /></div>
- <div class="z">
- <p class="welcome mbn cl" style="clear:both; width:100%; "><strong>Hi</strong>,<strong>$_G['member']['username']</strong>,<span class="xg2">{lang connect_member_login_tip}</span></p>
- <ul class="tb cl z">
- <li id="connect_tab_1"$connect_tab_1><a id="loginlist" href="javascript:;" onclick="connect_switch(1);this.blur();" tabindex="900">{lang connect_register_profile}</a></li>
- <li id="connect_tab_2"$connect_tab_2><a id="loginlist2" href="javascript:;" onclick="connect_switch(2);this.blur();" tabindex="900">{lang connect_register_bind}</a></li>
- </ul>
- </div>
- </div>
- </div>
- <!--{/if}-->
- <!--{/block}-->
- {eval
- $js2 = str_replace(array("'", "\r", "\n"), array("\'", '', ''), $js2);
- }
- <!--{block return}-->
- <div class="b1lr">
- <form method="post" autocomplete="off" name="login" id="loginform_$loginhash" class="cl"{if $_G['setting']['regconnect']} style="display:none"{/if} onsubmit="ajaxpost('loginform_$loginhash', 'returnmessage4', 'returnmessage4', 'onerror');return false;" action="member.php?mod=connect&action=login&loginsubmit=yes{if !empty($_GET['handlekey'])}&handlekey=$_GET[handlekey]{/if}&loginhash=$loginhash">
- <div class="c cl bm_c">
- <input type="hidden" name="formhash" value="{FORMHASH}" />
- <input type="hidden" name="referer" value="{$_G['qc']['dreferer']}" />
- <input type="hidden" id="auth_hash" name="auth_hash" value="{$_G['qc']['connect_auth_hash']}" />
- <input type="hidden" id="is_notify" name="is_notify" value="{$_G['qc']['connect_is_notify']}" />
- <input type="hidden" id="is_feed" name="is_feed" value="{$_G['qc']['connect_is_feed']}" />
- <!--{if $_G['qc']['uinlimit']}-->
- <!--<div class="bm xi1 xw1"><div class="bm_c"><img src="{IMGDIR}/connect_qq.gif" alt="QQ" class="vm" /> {lang qqconnect:connect_uin_limit}</div></div>-->
- <div class="rfm">
- <table>
- <tr>
- <th><img src="{IMGDIR}/connect_qq.gif" alt="QQ" class="mtn" /></th>
- <td>
- {lang qqconnect:connect_uin_limit}
- </td>
- </tr>
- </table>
- </div>
- <!--{/if}-->
- <div class="rfm">
- <table>
- <tr>
- <th>
- <!--{if $_G['setting']['autoidselect']}-->
- <label for="username">{lang login_id}:</label>
- <!--{else}-->
- <span class="login_slct">
- <select name="loginfield" style="float: left;" width="45" id="loginfield_$loginhash">
- <option value="username">{lang username}</option>
- <option value="uid">{lang uid}</option>
- <option value="email">{lang email}</option>
- </select>
- </span>
- <!--{/if}-->
- </th>
- <td><input type="text" name="username" id="username_$loginhash" autocomplete="off" size="36" class="txt" tabindex="1" value="$username" /></td>
- </tr>
- </table>
- </div>
- <div class="rfm">
- <table>
- <tr>
- <th><label for="password3_$loginhash">{lang login_password}:</label></th>
- <td><input type="password" id="password3_$loginhash" name="password" size="36" class="txt" tabindex="1" /></td>
- </tr>
- </table>
- </div>
- <div class="rfm">
- <table>
- <tr>
- <th>{lang security_q}:</th>
- <td><select id="loginquestionid_$loginhash" width="213" name="questionid" onchange="if($('loginquestionid_$loginhash').value > 0) $('loginanswer_row_$loginhash').style.display=''; else $('loginanswer_row_$loginhash').style.display='none'">
- <option value="0">{lang security_question}</option>
- <option value="1">{lang security_question_1}</option>
- <option value="2">{lang security_question_2}</option>
- <option value="3">{lang security_question_3}</option>
- <option value="4">{lang security_question_4}</option>
- <option value="5">{lang security_question_5}</option>
- <option value="6">{lang security_question_6}</option>
- <option value="7">{lang security_question_7}</option>
- </select></td>
- </tr>
- </table>
- </div>
- <div class="rfm" id="loginanswer_row_$loginhash" style="display:none">
- <table>
- <tr>
- <th>{lang security_a}:</th>
- <td><input type="text" name="answer" id="loginanswer_$loginhash" autocomplete="off" size="36" class="txt" tabindex="1" /></td>
- </tr>
- </table>
- </div>
- <div class="rfm">
- <table>
- <tr>
- <th></th>
- <td>
- <p><label for="use_qqshow_bind"><input type="checkbox" name="use_qqshow" id="use_qqshow_bind" class="pc" value="1" checked="checked" tabindex="1" /> {lang qqconnect:connect_register_use_qqshow}</label></p>
- </td>
- </tr>
- </table>
- </div>
- </div>
- <div class="rfm mbw bw0">
- <table>
- <tr>
- <th> </th>
- <td><button class="pn pnc" type="submit" name="loginsubmit" value="true" tabindex="1"><strong>{lang qqconnect:connect_register_bind_window_button}</strong></button></td>
- </tr>
- </table>
- </div>
- </form>
- </div>
- <script type="text/javascript">
- <!--{if $_G['setting']['regconnect']}-->
- $('reginfo_a').parentNode.className = '';
- $('{$_G['setting']['reginput']['password']}').parentNode.parentNode.parentNode.parentNode.parentNode.style.display = 'none';
- $('{$_G['setting']['reginput']['username']}').outerHTML += '$js1';
- $('{$_G['setting']['reginput']['password']}').required = 0;
- $('{$_G['setting']['reginput']['password2']}').parentNode.parentNode.parentNode.parentNode.parentNode.style.display = 'none';
- $('{$_G['setting']['reginput']['password2']}').required = 0;
- $('main_hnav').outerHTML = '$js2';
- function connect_switch(op) {
- $('returnmessage4').className='';
- $('returnmessage4').innerHTML='';
- if(op == 1) {
- $('loginform_$loginhash').style.display='none';$('registerform').style.display='block';
- $('connect_tab_1').className = 'a';
- $('connect_tab_2').className = '';
- //$('connect_login_register_tip').style.display = '';
- //$('connect_login_bind_tip').style.display = 'none';
-
- } else {
- $('loginform_$loginhash').style.display='block';$('registerform').style.display='none';
- $('connect_tab_2').className = 'a';
- $('connect_tab_1').className = '';
- //$('connect_login_register_tip').style.display = 'none';
- //$('connect_login_bind_tip').style.display = '';
- }
- }
- function connect_use_available(value) {
- $('{$_G['setting']['reginput']['username']}').value = value;
- checkusername(value);
- }
- <!--{if $_G['qc']['uinlimit']}-->
- $('registerformsubmit').disabled = true;
- <!--{/if}-->
- <!--{if $_GET[action] != 'activation'}-->
- $('registerformsubmit').innerHTML = '<span>{lang qqconnect:connect_register_finish}</span>';
- <!--{/if}-->
- <!--{else}-->
- $('layer_reginfo_t').innerHTML = '{lang qqconnect:connect_register_bind}';
- <!--{/if}-->
- <!--{if $_GET[action] != 'activation'}-->
- <!--{if !$_G['setting']['autoidselect']}-->
- simulateSelect('loginfield_$loginhash');
- <!--{/if}-->
- <!--{/if}-->
-
- <!--{if $_G['setting']['regconnect'] && $_GET['ac'] != 'bind'}-->
- function connect_get_user_info() {
- var x = new Ajax();
- x.get('connect.php?mod=user&op=get&hash={FORMHASH}&inajax=1&_r='+Math.random(), function(s){
- var nick = s;
- if(nick) {
- document.getElementById('{$_G['setting']['reginput']['username']}').value = nick;
- }
- });
- }
- window.load=connect_get_user_info();
- <!--{/if}-->
- </script>
- <!--{/block}-->
- <!--{eval return $return;}-->
- {eval
- }
- function tpl_spacecp_profile_bottom() {
- global $_G;
- }
- <!--{block return}-->
- <script type="text/javascript">
- function connect_handle_get_weibosign(response, ajax) {
- // 返回值形如: errCode=XX&result=XX
- if (typeof(response) == "string" && response.indexOf("&") > 0) {
- var errCode = response.substring(0, response.indexOf("&"));
- errCode = errCode.substring(errCode.indexOf("=") + 1);
- var result = response.substring(response.indexOf("&") + 1);
- result = result.substring(result.indexOf("=") + 1);
- response = {"errCode" : errCode, "result" : result};
- } else {
- return false;
- }
- if (response.errCode == '0') {
- seditor_insertunit('sightml', response.result);
- } else {
- // 请求失败
- showDialog('{lang qqconnect:connect_wbsign_no_account}');
- }
- }
- function connect_get_weibosign() {
- var sign_url = '{$_G['siteurl']}connect.php?mod=config&op=weibosign&hash={FORMHASH}&_r='+Math.random();
- var get_weibosign_ajax = Ajax("HTML", null);
- get_weibosign_ajax.get(sign_url, connect_handle_get_weibosign);
- }
- if($('sightmlsml')) {
- var a = document.createElement('a');
- a.href = 'javascript:void(0);';
- a.style.background = 'url(' + STATICURL + 'image/common/weibo.png) no-repeat 0 2px';
- a.onmouseover = function () { showTip(this); };
- a.onclick = connect_get_weibosign;
- a.setAttribute('tip', '{lang qqconnect:connect_wbsign_tip}');
- $('sightmlsml').parentNode.appendChild(a);
- }
- </script>
- <!--{/block}-->
- <!--{eval return $return;}-->
- {eval
- }
- }
复制代码 用文本编辑器编辑保存下,再上传替换。
下载:
x3qq分享错误解决.rar
(10.32 KB, 下载次数: 1)
本教程又无限星辰工作室www.xmspace.net整理发布,转载请注明地址。
|
|