Пример #1
0
function createfail($checkpwd, $showinfo = '', $type = 'fail')
{
    if ($checkpwd) {
        $showinfo = 'fail' == $type && '' != $showinfo ? getLangInfo('msg', $showinfo) : $showinfo;
        echo "{$type}\t{$showinfo}";
        ajax_footer();
    }
    return false;
}
Пример #2
0
 /**
  * {@inheritDoc}
  */
 public function sendContent()
 {
     // Print the response.
     $commands = ajax_prepare_response(['#type' => 'ajax', '#commands' => $this->commands]);
     $output = ajax_render($commands);
     if ($this->isJSONP()) {
         echo '<textarea>' . $output . '</textarea>';
     } else {
         echo $output;
     }
     ajax_footer();
     return $this;
 }
Пример #3
0
 function _render()
 {
     $show = $this->_show ? $this->_show : "add";
     if ($show == "update") {
         list($id, $rateConfig, $isopen) = $this->_buildUpdateHtml();
     }
     isset($isopen) ? $isopen : ($isopen[1] = "checked=checked");
     $typeId = isset($rateConfig['typeid']) ? $rateConfig['typeid'] : 1;
     $typeSelect = $this->_buildTypeSelectHTML($typeId);
     $default_handler_url = EncodeUrl($this->_getDefaultUrl() . "&job=ajax");
     include H_R . '/template/ajax.htm';
     ajax_footer();
 }
Пример #4
0
 function _showHotMessage($message)
 {
     echo $message;
     ajax_footer();
 }
Пример #5
0
function adminmsg($msg, $jumpurl = '', $t = 2, $langtype = 'admin')
{
    @extract($GLOBALS, EXTR_SKIP);
    if ($langtype == 'admin') {
        $msg = getLangInfo('cpmsg', $msg);
    } else {
        $msg = getLangInfo('msg', $msg);
    }
    if (defined('AJAX')) {
        echo $msg;
        ajax_footer();
    }
    if ($jumpurl != '') {
        $basename = $jumpurl;
        $ifjump = "<meta http-equiv='Refresh' content='{$t}; url={$jumpurl}'>";
    } elseif (!$basename) {
        $basename = $REQUEST_URI;
    }
    if ($db_adminrecord == 1 && $basename != 'javascript:history.go(-1);') {
        $adminmsg = 2;
    } else {
        $adminmsg = 1;
    }
    include PrintEot('message');
    $cachetime = $timestamp - 3600 * 24;
    if (readover(D_P . 'data/bbscache/none.txt') != '' || pwFilemtime(D_P . 'data/bbscache/file_lock.txt') < $cachetime || pwFilemtime(D_P . 'data/bbscache/info.txt') < $cachetime || pwFilemtime(D_P . 'data/bbscache/userpay.txt') < $cachetime) {
        echo '<script language="JavaScript">if (parent.notice) {parent.notice.location.href = "' . $admin_file . '?adminjob=notice";}</script>';
    }
    afooter();
}
Пример #6
0
function ajaxRedirect($tostep, $fromstep = null, $ajaxResult = 'continue')
{
    @extract($GLOBALS, EXTR_SKIP);
    $url = "{$basename}?step={$tostep}";
    if (!empty($fromstep) && $times == $record && empty($lastid)) {
        list($stepnum, $steptype) = explode('_', $start);
        $end = (int) $stepnum + $record;
        strlen($steptype) && ($end .= "_{$steptype}");
        $url = "{$basename}?step={$fromstep}&start={$end}";
    } elseif (!empty($fromstep) && $times == $record && $lastid) {
        list($stepnum, $steptype) = explode('_', $start);
        $end = (int) $lastid;
        strlen($steptype) && ($end .= "_{$steptype}");
        $url = "{$basename}?step={$fromstep}&start={$end}";
    }
    if ($limit < $max) {
        $url = "{$basename}?step={$fromstep}&start={$limit}";
    }
    $msg = $steps[$step];
    switch ($fromstep) {
        case 2:
            $tableNames = array_slice(array_keys($sqlarray), $start, 5);
            $tableNames && ($msg .= '|' . implode('|', $tableNames));
            break;
        case 3:
            $tableNames = array();
            $sqlarray = ${"sqlarray_{$steptype}"};
            $tmpTables = array_slice($sqlarray, $stepnum, $record);
            foreach ($tmpTables as $v) {
                $tableNames[] = $v[0];
            }
            $tableNames && ($msg .= '|' . implode('|', $tableNames));
            break;
    }
    ob_end_clean();
    ob_start();
    echo "{$ajaxResult}\t{$url}\t{$msg}";
    ajax_footer();
}
Пример #7
0
function deleteThreadsHander($tidarray)
{
    global $windid, $manager, $groupid, $SYSTEM;
    PostCheck();
    (!$SYSTEM['superright'] || !$SYSTEM['delatc']) && Showmsg('mawhole_right');
    if ($tidarray == "") {
        Showmsg('data_error');
    }
    $tidarray = explode("|", $tidarray);
    if (!is_array($tidarray)) {
        Showmsg('data_error');
    }
    $forums = $threadIds = array();
    foreach ($tidarray as $v) {
        if ($v == "") {
            continue;
        }
        if (intval($v) < 0) {
            continue;
        }
        $threadIds[] = $v;
    }
    /**
    	$threadManager = L::loadclass('threadmanager', 'forum');
    	foreach($forums as $fid=>$threadIds){
    		$threadManager->deleteByThreadIds($fid,$threadIds);
    	}**/
    $threadService = L::loadclass('threads', 'forum');
    foreach ($forums as $fid => $_threadIds) {
        $threadService->deleteByThreadIds($_threadIds);
        Perf::gatherInfo('changeThreadWithForumIds', array('fid' => $fid));
    }
    $delarticle = L::loadClass('DelArticle', 'forum');
    $delarticle->delTopicByTids($threadIds, true);
    echo getLangInfo('other', 'search_manager_success');
    ajax_footer();
}
Пример #8
0
function showExtraMsg($msg)
{
    echo "fail\t" . getLangInfo('msg', $msg);
    ajax_footer();
}
 /**
  * Master entry point for handling a list.
  *
  * It is unlikely that a child object will need to override this method,
  * unless the listing mechanism is going to be highly specialized.
  */
 function list_page($js, $input)
 {
     $this->items = ctools_export_crud_load_all($this->plugin['schema'], $js);
     // Respond to a reset command by clearing session and doing a drupal goto
     // back to the base URL.
     if (isset($input['op']) && $input['op'] == t('Reset')) {
         unset($_SESSION['ctools_export_ui'][$this->plugin['name']]);
         if (!$js) {
             drupal_goto($_GET['q']);
         }
         // clear everything but form id, form build id and form token:
         $keys = array_keys($input);
         foreach ($keys as $id) {
             if (!in_array($id, array('form_id', 'form_build_id', 'form_token'))) {
                 unset($input[$id]);
             }
         }
         $replace_form = TRUE;
     }
     // If there is no input, check to see if we have stored input in the
     // session.
     if (!isset($input['form_id'])) {
         if (isset($_SESSION['ctools_export_ui'][$this->plugin['name']]) && is_array($_SESSION['ctools_export_ui'][$this->plugin['name']])) {
             $input = $_SESSION['ctools_export_ui'][$this->plugin['name']];
         }
     } else {
         $_SESSION['ctools_export_ui'][$this->plugin['name']] = $input;
         unset($_SESSION['ctools_export_ui'][$this->plugin['name']]['q']);
     }
     // This is where the form will put the output.
     $this->rows = array();
     $this->sorts = array();
     $form_state = array('plugin' => $this->plugin, 'input' => $input, 'rerender' => TRUE, 'no_redirect' => TRUE, 'object' => &$this);
     if (!isset($form_state['input']['form_id'])) {
         $form_state['input']['form_id'] = 'ctools_export_ui_list_form';
     }
     // If we do any form rendering, it's to completely replace a form on the
     // page, so don't let it force our ids to change.
     if ($js && isset($_POST['ajax_html_ids'])) {
         unset($_POST['ajax_html_ids']);
     }
     $form = drupal_build_form('ctools_export_ui_list_form', $form_state);
     $form = drupal_render($form);
     $output = $this->list_header($form_state) . $this->list_render($form_state) . $this->list_footer($form_state);
     if (!$js) {
         $this->list_css();
         return $form . $output;
     }
     $commands = array();
     $commands[] = ajax_command_replace('#ctools-export-ui-list-items', $output);
     if (!empty($replace_form)) {
         $commands[] = ajax_command_replace('#ctools-export-ui-list-form', $form);
     }
     print ajax_render($commands);
     ajax_footer();
 }
Пример #10
0
function showThreadTrade($k, $showlang = true)
{
    $flag = $showlang ? 1 : 0;
    echo '[{"message":\'' . ($showlang ? getThreadTradeLang($k) : $k) . '\',"flag":\'' . $flag . '\'}]';
    ajax_footer();
}
Пример #11
0
function footer()
{
    global $db, $db_obstart, $db_footertime, $db_htmifopen, $P_S_T, $mtablewidth, $db_ceoconnect, $wind_version, $imgpath, $stylepath, $footer_ad, $db_union, $timestamp, $db_icp, $db_icpurl, $db_advertdb, $groupid, $SCR, $db_ystats_ifopen, $db_ystats_unit_id, $db_ystats_style, $db_redundancy, $pwServer, $db_ifcredit, $credit_pop, $db_foot, $db_mode, $db_modes, $shortcutforum, $_G, $winddb, $db_toolbar, $winduid, $db_menuinit, $db_appifopen, $db_job_ispop, $db_job_isopen, $db_siteappkey;
    defined('AJAX') && ajax_footer();
    Update_ol();
    $wind_spend = '';
    $ft_gzip = ($db_obstart ? 'Gzip enabled' : 'Gzip disabled') . $db_union[3];
    if ($db_footertime == 1) {
        $t_array = explode(' ', microtime());
        $totaltime = number_format($t_array[0] + $t_array[1] - $P_S_T, 6);
        $qn = $db ? $db->query_num : 0;
        $wind_spend = "Total {$totaltime}(s) query {$qn},";
    }
    $ft_time = get_date($timestamp, 'm-d H:i');
    $db_icp && ($db_icp = "<a href=\"http://www.miibeian.gov.cn\" target=\"_blank\">{$db_icp}</a>");
    if ($db_toolbar) {
        if ($_COOKIE['toolbarhide']) {
            $toolbarstyle = 'style="display:none"';
            $openbarstyle = '';
            $closebarstyle = 'style="display:none"';
        } else {
            $toolbarstyle = '';
            $openbarstyle = 'style="display:none"';
            $closebarstyle = '';
            if ($db_appifopen) {
                $appshortcut = trim($winddb['appshortcut'], ',');
                if (!empty($appshortcut) && $db_siteappkey) {
                    $appclient = L::loadClass('appclient');
                    $bottom_appshortcut = $appclient->userApplist($winduid, $appshortcut, 1);
                }
            }
        }
    }
    $db_menuinit = trim($db_menuinit, ',');
    runJob();
    require PrintEot('footer');
    if ($db_advertdb['Site.PopupNotice'] || $db_advertdb['Site.FloatLeft'] || $db_advertdb['Site.FloatRight'] || $db_advertdb['Site.FloatRand']) {
        require PrintEot('advert');
    }
    $output = ob_get_contents();
    if ($db_htmifopen) {
        $output = preg_replace("/\\<a(\\s*[^\\>]+\\s*)href\\=([\"|\\']?)((index|cate|thread|read|faq|rss)\\.php\\?[^\"\\'>\\s]+\\s?)[\"|\\']?/ies", "Htm_cv('\\3','<a\\1href=\"')", $output);
    }
    if ($db_redundancy && $SCR != 'post') {
        /*
        $output = str_replace(
        	array("\r","\n\n","\n\t","\n ",">\n","\n<","}\n","{\n",";\n","/\n","\t ",">\t","\t<","}\t","{\t",";\t","/\t",'  ','<!--<!---->','<!---->'),
        	array('',"\n",' ',' ','>','<','}','{',';','/',' ','>','<','}','{',';','/',' ','',''),
        	$output
        );
        */
        $output = str_replace(array("\r", '<!---->-->', '<!--<!---->', "<!---->\n", '<!---->', '<!-- -->', "<!--\n-->", "\t\t", '        ', "\n\t", "\n\n"), array('', '', '', '', '', '', '', "\n", "\n"), $output);
    } else {
        $output = str_replace(array('<!---->-->', '<!--<!---->', "<!---->\r\n", '<!---->', '<!-- -->', "\t\t\t"), '', $output);
    }
    if ($SCR != 'post') {
        $ceversion = defined('CE') ? 1 : 0;
        $output .= "<script language=\"JavaScript\" src=\"http://init.phpwind.net/init.php?sitehash={$GLOBALS[db_sitehash]}&v={$wind_version}&c={$ceversion}\"></script>";
    }
    if ($groupid == 'guest' && !defined('MSG') && GetGcache()) {
        require_once R_P . 'require/guestfunc.php';
        creatguestcache($output);
    }
    updateCacheData();
    echo ObContents($output);
    unset($output);
    N_flush();
    exit;
}
Пример #12
0
function quickPostMessage($message)
{
    $message = getLangInfo('msg', $message);
    echo $message;
    ajax_footer();
}
Пример #13
0
function showError($error)
{
    echo $error;
    ajax_footer();
    exit;
}
Пример #14
0
function showExtraMsg($msg)
{
    echo $msg;
    ajax_footer();
}
Пример #15
0
function kmdAjaxMessage($message, $type = 'error')
{
    $message = getLangInfo('msg', $message);
    echo $type . "\t" . $message;
    ajax_footer();
}
Пример #16
0
function ajaxExport($output)
{
    echo is_array($output) ? pwJsonEncode($output) : $output;
    ajax_footer();
    exit;
}
Пример #17
0
/**
 * @desc AJAX跳转
 *
 * @param String $msg -- 提示
 * @param String $jumpurl -- 跳转到URL
 */
function ajaxmsg($msg, $jumpurl = '')
{
    define('AJAX', 1);
    $msg = getLangInfo('cpmsg', $msg);
    $show = <<<EOT
<div style="padding:1.5em 3em">
\t{$msg}
</div>
<script type="text/javascript">
function skip(){
\tlocation.href = "{$jumpurl}";
}
setTimeout("skip()",2000);
</script>
EOT;
    echo $show;
    ajax_footer();
}
Пример #18
0
/**
 * @param unknown_type $output
 */
function ajaxExport($output)
{
    echo is_array($output) ? stripslashes(pwJsonEncode($output)) : $output;
    ajax_footer();
}
Пример #19
0
function deleteThreadsHander($tidarray)
{
    global $windid, $manager, $groupid;
    PostCheck();
    (!CkInArray($windid, $manager) || $groupid != 3) && Showmsg('mawhole_right');
    if ($tidarray == "") {
        Showmsg('data_error');
    }
    $tidarray = explode("|", $tidarray);
    if (!is_array($tidarray)) {
        Showmsg('data_error');
    }
    $forums = array();
    foreach ($tidarray as $v) {
        if ($v == "") {
            continue;
        }
        list($fid, $tid) = explode("_", $v);
        if (intval($fid) < 0 && intval($tid) < 0) {
            continue;
        }
        $forums[$fid][] = $tid;
    }
    $threadManager = L::loadclass('threadmanager');
    foreach ($forums as $fid => $threadIds) {
        $threadManager->deleteByThreadIds($fid, $threadIds);
    }
    echo getLangInfo('other', 'search_manager_success');
    ajax_footer();
}
Пример #20
0
function ajaxResponse($message, $flag, $html = '')
{
    echo '[{"message":\'' . $message . '\',"flag":\'' . $flag . '\',"html":\'' . $html . '\'}]';
    ajax_footer();
}
Пример #21
0
    if ($action != 'unread') {
        $notReadCount = (int) $messageServer->countNoticesNotRead($winduid);
        list($today, $yesterday, $tTimes, $yTimes, $mTimes) = getSubListInfo($noticeList);
    }
    $pages = numofpage($noticeCount, $page, $pageCount, "{$normalUrl}&action={$action}&");
} elseif ($action == 'checkover') {
    S::gp(array('rid', 'dir'), 'GP');
    if ($dir == 'previous') {
        $message = $messageServer->getUpNotice($winduid, $rid, $smstype);
    } else {
        $message = $messageServer->getDownNotice($winduid, $rid, $smstype);
    }
    if ($message) {
        echo "success\t";
    } else {
        echo "over\t";
    }
    ajax_footer();
}
$messageServer->resetStatistics(array($winduid), 'notice_num');
!defined('AJAX') && (include_once R_P . 'actions/message/ms_header.php');
require messageEot($subtype);
if (defined('AJAX')) {
    ajax_footer();
} else {
    pwOutPut();
}
function messageReplace($v)
{
    return nl2br($v);
}
Пример #22
0
/**
 * 输出页脚,并处理输出缓存中的内容
 */
function footer()
{
    global $db, $db_obstart, $db_footertime, $P_S_T, $mtablewidth, $db_ceoconnect, $wind_version, $imgpath, $stylepath, $footer_ad, $db_union, $timestamp, $db_icp, $db_icpurl, $db_advertdb, $groupid, $db_ystats_ifopen, $db_ystats_unit_id, $db_ystats_style, $pwServer, $db_ifcredit, $credit_pop, $db_foot, $db_mode, $db_modes, $shortcutforum, $_G, $winddb, $db_toolbar, $winduid, $db_menuinit, $db_appifopen, $db_job_ispop, $db_job_isopen, $db_siteappkey, $_Navbar, $db_statscode;
    defined('AJAX') && ajax_footer();
    $wind_spend = '';
    //$db_statscode = html_entity_decode($db_statscode);
    $ft_gzip = ($db_obstart ? 'Gzip enabled' : 'Gzip disabled') . $db_union[3];
    if ($db_footertime == 1) {
        $totaltime = number_format(pwMicrotime() - $P_S_T, 6);
        $qn = $db ? $db->query_num : 0;
        $wind_spend = "Total {$totaltime}(s) query {$qn},";
        //*Dev Code Start*//
        if ($GLOBALS['db_debug']) {
            include_once R_P . 'lang_change.php';
            $wind_spend .= "SQLtime:" . number_format($db->totaltime, 6);
            $wind_spend .= !function_exists('memory_get_usage') ? '' : ',Memory Usage:' . round(memory_get_usage() / 1024 / 1024, 4) . 'MB,';
            $_GET['debug'] && pwCache::writeover(D_P . "data/wind_spend.txt", SCR . ":\t" . $wind_spend . "\r\n", 'ab');
            $masterDb = $db->getMastdb();
            if ($masterDb->arr_query) {
                writeover(D_P . "data/sqllist.txt", $masterDb->arr_query, 'wb');
            }
        }
        //*Dev Code End*//
    }
    $ft_time = get_date($timestamp, 'm-d H:i');
    $db_icp && ($db_icp = "<a href=\"http://www.miibeian.gov.cn\" target=\"_blank\">{$db_icp}</a>");
    if ($db_toolbar) {
        if ($_COOKIE['toolbarhide']) {
            $toolbarstyle = 'style="display:none"';
            $openbarstyle = '';
            $closebarstyle = 'style="display:none"';
        } else {
            $toolbarstyle = '';
            $openbarstyle = 'style="display:none"';
            $closebarstyle = '';
            if ($db_appifopen) {
                $appshortcut = trim($winddb['appshortcut'], ',');
                if (!empty($appshortcut) && $db_siteappkey) {
                    $appshortcut = explode(',', $appshortcut);
                    $bottom_appshortcut = array();
                    $appclient = L::loadClass('appclient');
                    $bottom_appshortcut = $appclient->userApplist($winduid, $appshortcut, 1);
                }
            }
        }
    }
    $db_menuinit = trim($db_menuinit, ',');
    runJob();
    require PrintEot('footer');
    if ($db_advertdb['Site.PopupNotice'] || $db_advertdb['Site.FloatLeft'] || $db_advertdb['Site.FloatRight'] || $db_advertdb['Site.FloatRand']) {
        require PrintEot('advert');
    }
    pwOutPut();
}