Beispiel #1
0
 public function getRecWords($needNum = 14)
 {
     global $_G;
     $sId = $_G['setting']['my_siteid'];
     $data = array();
     if ($sId) {
         $kname = 'search_recommend_words_' . $sId;
         loadcache($kname);
         if (isset($_G['cache'][$kname]['ts']) && TIMESTAMP - $_G['cache'][$kname]['ts'] <= 21600) {
             $data = $_G['cache'][$kname]['result'];
         } else {
             $apiUrl = 'http://api.discuz.qq.com/search/recwords/get';
             $params = array('s_id' => $sId, 'need_random' => false, 'need_num' => $needNum, 'response_format' => 'php', 'version' => 1);
             $response = dfsockopen($apiUrl, 0, generateSiteSignUrl($params), '', false, $_G['setting']['cloud_api_ip']);
             $result = (array) unserialize($response);
             if (isset($result['status']) && $result['status'] === 0) {
                 $data = $result['result'];
                 save_syscache($kname, array('ts' => TIMESTAMP, 'result' => $data));
             }
         }
     }
     return $data;
 }
Beispiel #2
0
<?php

/**
 *      [Discuz!] (C)2001-2099 Comsenz Inc.
 *      This is NOT a freeware, use is subject to license terms
 *
 *      $Id: cloud_union.php 22747 2011-05-19 04:11:31Z yexinhao $
 */
if (!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
    exit('Access Denied');
}
if (!$_G['inajax']) {
    cpheader();
    shownav('navcloud', 'cloud_stats');
}
$unionDomain = 'http://union.discuz.qq.com';
$signUrl = generateSiteSignUrl();
headerLocation($unionDomain . '/site/application/?' . $signUrl);
Beispiel #3
0
                if ($checkUrl) {
                    foreach ($results as $key => $result) {
                        $registerResult['errMessage'] = str_replace($result, '{replace_' . $key . '}', $registerResult['errMessage']);
                        $msgValues = array('replace_' . $key => $result);
                    }
                }
                cpmsg($registerResult['errMessage'], '', 'error', $msgValues);
            }
        }
    }
} elseif ($operation == 'applist') {
    if ($cloudstatus != 'cloud') {
        cpmsg('cloud_open_first', '', 'succeed', array(), '<p class="marginbot"><a href="###" onclick="top.location = \'' . ADMINSCRIPT . '?frames=yes&action=cloud&operation=open\'" class="lightlink">' . cplang('message_redirect') . '</a></p><script type="text/JavaScript">setTimeout("top.location = \'' . ADMINSCRIPT . '?frames=yes&action=cloud&operation=open\'", 3000);</script>');
    }
    $signParams = array('refer' => $_G['siteurl'], 'ADTAG' => 'CP.DISCUZ.APPLIST');
    $signUrl = generateSiteSignUrl($signParams);
    headerLocation($cloudDomain . '/cloud/appList/?' . $signUrl);
} elseif (in_array($operation, array('siteinfo', 'doctor'))) {
    require libfile("cloud/{$operation}", 'admincp');
} elseif (in_array($operation, array('manyou', 'connect', 'security', 'stats', 'search', 'smilies', 'qqgroup', 'union', 'storage'))) {
    if ($cloudstatus != 'cloud') {
        cpmsg('cloud_open_first', '', 'succeed', array(), '<p class="marginbot"><a href="###" onclick="top.location = \'' . ADMINSCRIPT . '?frames=yes&action=cloud&operation=open\'" class="lightlink">' . cplang('message_redirect') . '</a></p><script type="text/JavaScript">setTimeout("top.location = \'' . ADMINSCRIPT . '?frames=yes&action=cloud&operation=open\'", 3000);</script>');
    }
    $apps = getcloudapps();
    if (empty($apps) || empty($apps[$operation]) || $apps[$operation]['status'] == 'close') {
        cpmsg('cloud_application_close', 'action=cloud&operation=applist', 'error');
    }
    if ($apps[$operation]['status'] == 'disable') {
        cpmsg('cloud_application_disable', 'action=cloud&operation=applist', 'error');
    }
    require libfile("cloud/{$operation}", 'admincp');
Beispiel #4
0
    if (!empty($source)) {
        $params['source'] = $source;
    }
    if (!empty($_G['gp_author'])) {
        $params['author'] = $_G['gp_author'];
    }
    if (!empty($_G['gp_scope'])) {
        $params['scope'] = $_G['gp_scope'];
    }
    $mySearchData = unserialize($_G['setting']['my_search_data']);
    if ($mySearchData['domain']) {
        $domain = $mySearchData['domain'];
    } else {
        $domain = 'search.discuz.qq.com';
    }
    $url = 'http://' . $domain . '/f/discuz?' . generateSiteSignUrl($params, true, true);
    dheader('Location: ' . $url);
    die;
}
if (!submitcheck('searchsubmit', 1)) {
    if ($_G['gp_adv']) {
        include template('search/forum_adv');
    } else {
        include template('search/forum');
    }
} else {
    $orderby = in_array($_G['gp_orderby'], array('dateline', 'replies', 'views')) ? $_G['gp_orderby'] : 'lastpost';
    $ascdesc = isset($_G['gp_ascdesc']) && $_G['gp_ascdesc'] == 'asc' ? 'asc' : 'desc';
    if (!empty($searchid)) {
        require_once libfile('function/misc');
        $page = max(1, intval($_G['gp_page']));
Beispiel #5
0
}
if ($_G['forum']['alloweditpost'] && $_G['uid']) {
    $alloweditpost_status = getstatus($_G['setting']['alloweditpost'], $_G['forum_thread']['special'] + 1);
    if (!$alloweditpost_status) {
        $edittimelimit = $_G['group']['edittimelimit'] * 60;
    }
}
if ($_G['forum_thread']['replies'] > $_G['forum_thread']['views']) {
    $_G['forum_thread']['views'] = $_G['forum_thread']['replies'];
}
$my_search_data = unserialize($_G['setting']['my_search_data']);
if (viewthread_is_search_referer() && $my_search_data['status']) {
    require_once libfile('function/cloud');
    if (getcloudappstatus('search')) {
        $_params = array('s_site_gid' => $_G['groupid'], 'response_type' => 'js', 'referer' => $_SERVER['HTTP_REFERER']);
        $signUrl = generateSiteSignUrl($_params);
        $my_search_se_url = 'http://search.discuz.qq.com/api/site/se?' . $signUrl . "";
    }
}
if (empty($_G['gp_viewpid'])) {
    $sufix = '';
    if ($_G['gp_from'] == 'portal') {
        $_G['disabledwidthauto'] = 1;
        $sufix = '_portal';
        $post =& $postlist[$_G['forum_firstpid']];
    }
    include template('diy:forum/viewthread' . $sufix . ':' . $_G['fid']);
} else {
    $_G['setting']['admode'] = 0;
    $post = $postlist[$_G['gp_viewpid']];
    if ($rushreply) {
Beispiel #6
0
                $icons .= '<input class="radio" type="radio" id="stat_icon_' . $i . '" name="settingnew[cloud_staticon]" value="' . $i . '"' . $checkicon[$i] . ' /><label for="stat_icon_' . $i . '">&nbsp;<img src="http://tcss.qq.com/icon/toss_1' . $i . '.gif" /></label>&nbsp;&nbsp;';
                if ($i % 4 == 0) {
                    $icons .= '</td></tr><tr><td>';
                }
            } elseif ($i < 9) {
                continue;
            } elseif ($i < 11) {
                $icons .= '<input class="radio" type="radio" id="stat_icon_' . $i . '" name="settingnew[cloud_staticon]" value="' . $i . '"' . $checkicon[$i] . ' /><label for="stat_icon_' . $i . '">&nbsp;' . $lang['cloud_stats_icon_word' . $i] . '</label>&nbsp;&nbsp;';
            } else {
                $icons .= '</td></tr><tr><td><input class="radio" type="radio" id="stat_icon_' . $i . '" name="settingnew[cloud_staticon]" value="0"' . $checkicon[0] . ' /><label for="stat_icon_' . $i . '">&nbsp;' . $lang['cloud_stats_icon_none'] . '</label></td></tr>';
            }
        }
        $icons .= '</table>';
        showsetting('cloud_stats_icon_set', '', '', $icons);
        showsubmit('settingsubmit', 'submit');
        showtablefooter();
        showformfooter();
    } else {
        $settingnew = $_G['gp_settingnew'];
        $settingnew['cloud_staticon'] = intval($settingnew['cloud_staticon']);
        DB::query("REPLACE INTO " . DB::table('common_setting') . " (`skey`, `svalue`) VALUES ('cloud_staticon', '{$settingnew['cloud_staticon']}')");
        updatecache('setting');
        cpmsg('setting_update_succeed', 'action=cloud&operation=' . $operation . (!empty($_G['gp_anchor']) ? '&anchor=' . $_G['gp_anchor'] : ''), 'succeed');
    }
} elseif ($_G['gp_anchor'] == 'summary') {
    shownav('navcloud', 'cloud_stats');
    showsubmenu('cloud_stats', $statsnav);
    $statsDomain = 'http://stats.discuz.qq.com';
    $signUrl = generateSiteSignUrl(array('v' => 2));
    headerLocation($statsDomain . '/statsSummary/?' . $signUrl);
}