예제 #1
0
 function global_footer()
 {
     global $_G;
     if (!$this->allow || !empty($_G['inshowmessage'])) {
         return;
     }
     $footerjs = '';
     require_once libfile('function/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'] : '';
         $footerjs .= connect_load_qshare_js($appkey);
     }
     if (!empty($_G['cookie']['connect_js_name']) && $_G['cookie']['connect_js_name'] == 'user_bind') {
         $params = array('openid' => $_G['cookie']['connect_uin']);
         $footerjs .= connect_user_bind_js($params);
     } elseif ($_G['cookie']['connect_js_name'] == 'feed_resend') {
         $footerjs .= connect_feed_resend_js();
     }
     connect_merge_member();
     if (!$_G['cookie']['connect_check_token'] && $_G['member']['conuinsecret']) {
         $footerjs .= connect_check_token_js();
     }
     if ($_G['member']['conuinsecret'] && ($_G['cookie']['connect_last_report_time'] != date('Y-m-d') || $_G['cookie']['connect_report_times'] <= 4)) {
         $footerjs .= connect_cookie_login_js();
     }
     return $footerjs;
 }
예제 #2
0
 function global_footer()
 {
     if (!$this->allow) {
         return;
     }
     global $_G;
     if (!$_G['cookie']['client_token'] || !empty($_G['inshowmessage']) || empty($_G['cookie']['connect_js_name'])) {
         return;
     }
     if ($_G['cookie']['connect_js_name'] == 'user_bind') {
         require_once libfile('function/connect');
         $params = array('openid' => $_G['cookie']['connect_uin']);
         return connect_user_bind_js($params);
     } elseif ($_G['cookie']['connect_js_name'] == 'feed_resend') {
         require_once libfile('function/connect');
         return connect_feed_resend_js();
     }
 }
예제 #3
0
 function global_footer()
 {
     global $_G;
     if (!$this->allow || !empty($_G['inshowmessage'])) {
         return;
     }
     $footerjs = '';
     require_once libfile('function/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'] : '';
         $footerjs .= connect_load_qshare_js($appkey);
     }
     if (!empty($_G['cookie']['connect_js_name']) && $_G['cookie']['connect_js_name'] == 'user_bind') {
         $params = array('openid' => $_G['cookie']['connect_uin']);
         $footerjs .= connect_user_bind_js($params);
     } elseif ($_G['cookie']['connect_js_name'] == 'feed_resend') {
         $footerjs .= connect_feed_resend_js();
     }
     if ($_G['member']['conisbind']) {
         connect_merge_member();
         if ($_G['member']['conuinsecret'] && $_G['cookie']['connect_last_report_time'] != dgmdate(TIMESTAMP, 'Y-m-d')) {
             $connect_login_times = DB::result_first("SELECT skey FROM " . DB::table('common_setting') . " WHERE skey='connect_login_times'");
             if ($connect_login_times) {
                 DB::query("UPDATE " . DB::table('common_setting') . " SET svalue=svalue+1 WHERE skey='connect_login_times'");
             } else {
                 DB::query("INSERT INTO " . DB::table('common_setting') . " SET skey='connect_login_times', svalue='1'");
             }
             $current_date = dgmdate(TIMESTAMP, 'Y-m-d');
             $life = 86400;
             dsetcookie('connect_last_report_time', $current_date, $life);
         }
     }
     $settings = array();
     $query = DB::query("SELECT skey, svalue FROM " . DB::table('common_setting') . " WHERE skey IN ('connect_login_times', 'connect_login_report_date')");
     while ($setting = DB::fetch($query)) {
         $settings[$setting['skey']] = $setting['svalue'];
     }
     if ($settings['connect_login_times'] && (empty($settings['connect_login_report_date']) || dgmdate(TIMESTAMP, 'Y-m-d') != $settings['connect_login_report_date'])) {
         $footerjs .= connect_cookie_login_js();
     }
     return $footerjs;
 }