Example #1
0
 function global_footer()
 {
     global $_G;
     if (!$this->allow || !empty($_G['inshowmessage'])) {
         return;
     }
     $loadJs = array();
     $connectService = Cloud::loadClass('Service_Connect');
     if (defined('CURSCRIPT') && CURSCRIPT == 'forum' && defined('CURMODULE') && CURMODULE == 'viewthread' && $_G['setting']['connect']['allow'] && $_G['setting']['connect']['qshare_allow']) {
         $appkey = $_G['setting']['connect']['qshare_appkey'] ? $_G['setting']['connect']['qshare_appkey'] : $_G['connect']['weibo_public_appkey'];
         $qsharejsurl = $_G['siteurl'] . 'static/js/qshare.js';
         $sitename = isset($_G['setting']['bbname']) ? $_G['setting']['bbname'] : '';
         $loadJs['qsharejs'] = array('jsurl' => $qsharejsurl, 'appkey' => $appkey, 'sitename' => $sitename, 'func' => '$C');
     }
     if (!empty($_G['cookie']['connect_js_name'])) {
         if ($_G['cookie']['connect_js_name'] == 'feed_resend') {
             $jsurl = $connectService->connectFeedResendJs();
             $loadJs['feedjs'] = array('jsurl' => $jsurl);
         }
         dsetcookie('connect_js_name');
         dsetcookie('connect_js_params');
     }
     loadcache('connect_login_report_date');
     if (dgmdate(TIMESTAMP, 'Y-m-d') != $_G['cache']['connect_login_report_date']) {
         $jsurl = $connectService->connectCookieLoginJs();
         $loadJs['cookieloginjs'] = array('jsurl' => $jsurl);
     }
     if ($_G['member']['conisbind']) {
         $connectService->connectMergeMember();
         if ($_G['member']['conuinsecret'] && $_G['cookie']['connect_last_report_time'] != dgmdate(TIMESTAMP, 'Y-m-d')) {
             $connectService->connectAddCookieLogins();
         }
     }
     if ($_G['cookie']['connect_sync_post']) {
         $params = array();
         list($params['thread_id'], $params['post_id']) = explode('|', $_G['cookie']['connect_sync_post']);
         $params['ts'] = TIMESTAMP;
         $params['sig'] = $connectService->connectGetSig($params, $connectService->connectGetSigKey());
         $utilService = Cloud::loadClass('Service_Util');
         $jsurl = $_G['connect']['discuz_new_post_feed_url'] . '&' . $utilService->httpBuildQuery($params, '', '&');
         $loadJs['syncpostjs'] = array('jsurl' => $jsurl);
     }
     return tpl_global_footer($loadJs);
 }
 function global_footer()
 {
     global $_G;
     if (!$this->allow || !empty($_G['inshowmessage'])) {
         return;
     }
     $loadJs = array();
     $connectService = Cloud::loadClass('Service_Connect');
     if (defined('CURSCRIPT') && CURSCRIPT == 'forum' && defined('CURMODULE') && CURMODULE == 'viewthread' && $_G['setting']['connect']['allow'] && $_G['setting']['connect']['qshare_allow']) {
         $appkey = $_G['setting']['connect']['qshare_appkey'] ? $_G['setting']['connect']['qshare_appkey'] : $_G['connect']['weibo_public_appkey'];
         $qsharejsurl = $_G['siteurl'] . 'static/js/qshare.js';
         $sitename = isset($_G['setting']['bbname']) ? $_G['setting']['bbname'] : '';
         $loadJs['qsharejs'] = array('jsurl' => $qsharejsurl, 'appkey' => $appkey, 'sitename' => $sitename, 'func' => '$C');
     }
     if (!empty($_G['cookie']['connect_js_name'])) {
         if ($_G['cookie']['connect_js_name'] == 'user_bind') {
             $params = array('openid' => $_G['cookie']['connect_uin']);
             $jsurl = $connectService->connectUserBindJs($params);
             $loadJs['feedjs'] = array('jsurl' => $jsurl);
         } elseif ($_G['cookie']['connect_js_name'] == 'feed_resend') {
             $jsurl = $connectService->connectFeedResendJs();
             $loadJs['feedjs'] = array('jsurl' => $jsurl);
         } elseif ($_G['cookie']['connect_js_name'] == 'guest_ptlogin') {
             $jsurl = $connectService->connectGuestPtloginJs();
             $loadJs['guestloginjs'] = array('jsurl' => $jsurl);
         }
         dsetcookie('connect_js_name');
         dsetcookie('connect_js_params');
     }
     loadcache('connect_login_report_date');
     if (dgmdate(TIMESTAMP, 'Y-m-d') != $_G['cache']['connect_login_report_date']) {
         $jsurl = $connectService->connectCookieLoginJs();
         $loadJs['cookieloginjs'] = array('jsurl' => $jsurl);
     }
     if ($_G['member']['conisbind']) {
         $connectService->connectMergeMember();
         if ($_G['member']['conuinsecret'] && $_G['cookie']['connect_last_report_time'] != dgmdate(TIMESTAMP, 'Y-m-d')) {
             $connectService->connectAddCookieLogins();
         }
     }
     return tpl_global_footer($loadJs);
 }