function cpmessage($msgkey, $url_forward='', $second=1, $values=array()) {
	global $_SGLOBAL, $_SC, $_SCONFIG, $_TPL, $_SN, $space;
	
	//去掉广告
	$_SGLOBAL['ad'] = array();

	include_once(S_ROOT.'./language/lang_cpmessage.php');
	if(isset($_SGLOBAL['cplang'][$msgkey])) {
		$message = lang_replace($_SGLOBAL['cplang'][$msgkey], $values);
	} else {
		$message = $msgkey;
	}
	
	//显示
	obclean();
	
	//菜单激活
	$menuactive = array('index' => ' class="active"');
	
	if(!empty($url_forward)) {
		$second = $second * 1000;
		$message .= "<script>setTimeout(\"window.location.href ='$url_forward';\", $second);</script>";
	}
	include template('admin/tpl/message');
	exit();
}
Exemple #2
0
function capi_showmessage_by_data($msgkey, $code = 1, $data = array())
{
    obclean();
    //去掉广告
    $_SGLOBAL['ad'] = array();
    //语言
    include_once S_ROOT . './language/lang_showmessage.php';
    if (isset($_SGLOBAL['msglang'][$msgkey])) {
        $message = lang_replace($_SGLOBAL['msglang'][$msgkey], $values);
    } else {
        $message = $msgkey;
    }
    $r = array();
    $r['code'] = $code;
    $r['data'] = $data;
    $r['msg'] = $message;
    $r['action'] = $msgkey;
    capi_mkjson($r, $_REQUEST['callback']);
}
Exemple #3
0
function cpmessage($msgkey, $url_forward = '', $second = 1, $values = array())
{
    global $_SGLOBAL, $_SC, $_SCONFIG, $_TPL, $_SN, $space;
    // remove the ads
    $_SGLOBAL['ad'] = array();
    include_once S_ROOT . 'language/' . $_SCONFIG['language'] . '/lang_cpmessage.php';
    //vot
    if (isset($_SGLOBAL['cplang'][$msgkey])) {
        $message = lang_replace($_SGLOBAL['cplang'][$msgkey], $values);
    } else {
        $message = $msgkey;
    }
    //显示
    obclean();
    //Menu Active Punkt
    $menuactive = array('index' => ' class="active"');
    if (!empty($url_forward)) {
        $second = $second * 1000;
        $message .= "<script>setTimeout(\"window.location.href ='{$url_forward}';\", {$second});</script>";
    }
    include template('admin/tpl/message');
    exit;
}
Exemple #4
0
function cplang($key, $vars = array())
{
    global $_SGLOBAL;
    include_once S_ROOT . './language/lang_cp.php';
    if (isset($_SGLOBAL['cplang'][$key])) {
        $result = lang_replace($_SGLOBAL['cplang'][$key], $vars);
    } else {
        $result = $key;
    }
    return $result;
}
Exemple #5
0
function myshowmessage($strmessage, $isfile)
{
    global $_SGLOBAL;
    echo '---' . $isfile;
    if ($isfile) {
        //语言
        include_once S_ROOT . './language/lang_showmessage.php';
        //echo $_SGLOBAL['msglang'][$strmessage];
        if (isset($_SGLOBAL['msglang'][$strmessage])) {
            $message = lang_replace($_SGLOBAL['msglang'][$strmessage]);
        } else {
            $message = $msgkey;
        }
        return $message;
        //fwrite($file_pointer, $strmessage.'\r\n');
    } else {
        showmessage($strmessage);
    }
}
Exemple #6
0
function cplang($key, $vars = array())
{
    global $_SGLOBAL, $_SC, $_SCONFIG;
    //vot
    //DEBUG
    //echo 'cplang(): '.S_ROOT.'language/'.$_SCONFIG['language'].'/lang_cp.php'."<br>";
    include_once S_ROOT . 'language/' . $_SCONFIG['language'] . '/lang_cp.php';
    //vot
    if (isset($_SGLOBAL['cplang'][$key])) {
        $result = lang_replace($_SGLOBAL['cplang'][$key], $vars);
    } else {
        $result = $key;
    }
    return $result;
}
 function showmessage($msgkey, $url_forward = '', $second = 1, $values = array())
 {
     global $_SGLOBAL;
     $CI =& get_instance();
     $output = ob_get_contents();
     if ($output) {
         ob_end_clean();
     }
     $CI->lang->load('show_message');
     $message = $CI->lang->line($msgkey);
     if ($message) {
         $message = lang_replace($message, $values);
     } else {
         $message = $msgkey;
     }
     if (empty($_SGLOBAL['inajax']) && $url_forward && empty($second)) {
         header("HTTP/1.1 301 Moved Permanently");
         header("Location: {$url_forward}");
         exit;
     } else {
         if ($_SGLOBAL['inajax']) {
             if ($url_forward) {
                 $message = "<a href=\"{$url_forward}\">{$message}</a><ajaxok>";
             }
             $message = "<a href=\"javascript:;\" onclick=\"javascript:JqueryDialog.Close();\" class=\"float_del\">X</a><div class=\"popupmenu_inner\"><span class='showmessagespan'>" . $CI->lang->line('box_title') . "</span> {$message}</div>";
             ob_start();
             if ($CI->input->get('inajax')) {
                 $message = "<root><![CDATA[" . trim($message) . "]]></root>";
             }
             echo $message;
             exit;
         } else {
             if ($url_forward) {
                 $message = "<a href=\"{$url_forward}\">{$message}</a><script>setTimeout(\"window.location.href ='{$url_forward}';\", " . $second * 1000 . ");</script>";
             }
             $CI->load->library(array('layout', 'session', 'MY_Cart'));
             $CI->load->helper('view');
             $context = array();
             $attribute = $CI->session->userdata('attribute');
             $context['mi']['user']['attribute'] = $attribute;
             $context['is_login'] = ($attribute & 1) == 1 ? 1 : 0;
             $context['ls'] = $CI->session->userdata('uid') ? '1' : '0';
             $context['lastview_shop'] = $CI->session->userdata('lastview_shop');
             $context['styles'] = array('base.css');
             $context['scripts'] = array('plugin/jquery-1.7.2.min.js', 'base.js');
             $context['search'] = array('key' => '', 'type' => 'item', 'cate' => 'all');
             $context['usertype'] = $CI->session->userdata('type');
             $context['account'] = $CI->session->userdata('account');
             $context['login_time'] = $CI->session->userdata('login_time');
             $context['ip'] = $CI->input->ip_address();
             $context['message'] = $message;
             $context['second'] = $second;
             $context['url_forward'] = $url_forward;
             $context["locate"] = $CI->session->userdata('locate');
             $context['address_count'] = 1;
             $context['menu_active'] = false;
             $context['submenu_show'] = false;
             $context['submenu_content'] = '';
             $context['subcate_list'] = array();
             $context['pay_items'] = $CI->my_cart->pay_items();
             $context['siteurl'] = $CI->config->item('base_url');
             $context['imgurl'] = $CI->config->item('img_url');
             $context['seo']['title'] = $CI->config->item('seo_title');
             $context['seo']['keywords'] = $CI->config->item('seo_keywords');
             $context['seo']['desc'] = $CI->config->item('seo_desc');
             $CI->layout->template('showmessage', $context);
         }
     }
 }