乡下人产国偷v产偷v自拍,国产午夜片在线观看,婷婷成人亚洲综合国产麻豆,久久综合给合久久狠狠狠9

  • <output id="e9wm2"></output>
    <s id="e9wm2"><nobr id="e9wm2"><ins id="e9wm2"></ins></nobr></s>

    • 分享

      織夢(mèng)DedeCMS提示信息框的修改,修改ShowMsg方法函數(shù)

       地圖阿甘 2014-04-08

      織夢(mèng)DedeCMS系統(tǒng),處處都在用到提示信息,但是這個(gè)提示框,前臺(tái)后臺(tái)一層不變,太死板了,可能有很多人都有過去修改它的想法,只是苦于不知道去哪里改。今天我就來說說這個(gè)吧,DedeCMS的所有提示信息都是用ShowMsg方法進(jìn)行處理的,這個(gè)函數(shù)存放在/include/common.func.php  源代碼如下:

      01/**
      02 *  短消息函數(shù),可以在某個(gè)動(dòng)作處理后友好的提示信息
      03 *
      04 * @param     string  $msg      消息提示信息
      05 * @param     string  $gourl    跳轉(zhuǎn)地址
      06 * @param     int     $onlymsg  僅顯示信息
      07 * @param     int     $limittime  限制時(shí)間
      08 * @return    void
      09 */
      10function ShowMsg($msg, $gourl, $onlymsg=0, $limittime=0)
      11{
      12    if(empty($GLOBALS['cfg_plus_dir'])) $GLOBALS['cfg_plus_dir'] = '..';
      13 
      14    $htmlhead  = "<html>\r\n<head>\r\n<title>DedeCMS提示信息</title>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\" />\r\n";
      15    $htmlhead .= "<base target='_self'/>\r\n<style>div{line-height:160%;}</style></head>\r\n<body leftmargin='0' topmargin='0' bgcolor='#FFFFFF'>".(isset($GLOBALS['ucsynlogin']) ? $GLOBALS['ucsynlogin'] : '')."\r\n<center>\r\n<script>\r\n";
      16    $htmlfoot  = "</script>\r\n</center>\r\n</body>\r\n</html>\r\n";
      17 
      18    $litime = ($limittime==0 ? 1000 : $limittime);
      19    $func = '';
      20 
      21    if($gourl=='-1')
      22    {
      23        if($limittime==0) $litime = 5000;
      24        $gourl = "javascript:history.go(-1);";
      25    }
      26 
      27    if($gourl=='' || $onlymsg==1)
      28    {
      29        $msg = "<script>alert(\"".str_replace("\"","“",$msg)."\");</script>";
      30    }
      31    else
      32    {
      33        //當(dāng)網(wǎng)址為:close::objname 時(shí), 關(guān)閉父框架的id=objname元素
      34        if(preg_match('/close::/',$gourl))
      35        {
      36            $tgobj = trim(preg_replace('/close::/', '', $gourl));
      37            $gourl = 'javascript:;';
      38            $func .= "window.parent.document.getElementById('{$tgobj}').style.display='none';\r\n";
      39        }
      40         
      41        $func .= "      var pgo=0;
      42      function JumpUrl(){
      43        if(pgo==0){ location='$gourl'; pgo=1; }
      44      }\r\n";
      45        $rmsg = $func;
      46        $rmsg .= "document.write(\"<br /><div style='width:450px;padding:0px;border:1px solid #DADADA;'>";
      47        $rmsg .= "<div style='padding:6px;font-size:12px;border-bottom:1px solid #DADADA;background:#DBEEBD url({$GLOBALS['cfg_plus_dir']}/img/wbg.gif)';'><b>DedeCMS 提示信息!</b></div>\");\r\n";
      48        $rmsg .= "document.write(\"<div style='height:130px;font-size:10pt;background:#ffffff'><br />\");\r\n";
      49        $rmsg .= "document.write(\"".str_replace("\"","“",$msg)."\");\r\n";
      50        $rmsg .= "document.write(\"";
      51         
      52        if($onlymsg==0)
      53        {
      54            if( $gourl != 'javascript:;' && $gourl != '')
      55            {
      56                $rmsg .= "<br /><a href='{$gourl}'>如果你的瀏覽器沒反應(yīng),請(qǐng)點(diǎn)擊這里...</a>";
      57                $rmsg .= "<br/></div>\");\r\n";
      58                $rmsg .= "setTimeout('JumpUrl()',$litime);";
      59            }
      60            else
      61            {
      62                $rmsg .= "<br/></div>\");\r\n";
      63            }
      64        }
      65        else
      66        {
      67            $rmsg .= "<br/><br/></div>\");\r\n";
      68        }
      69        $msg  = $htmlhead.$rmsg.$htmlfoot;
      70    }
      71    echo $msg;
      72}

      可以看出ShowMsg有四個(gè)參數(shù),第一個(gè)參數(shù)是提示的信息,第二個(gè)就參數(shù)是跳轉(zhuǎn)的地址,如果設(shè)置為-1的話,就是返回上一個(gè)頁面,第三個(gè)參數(shù)其它就是定義是用alert()彈出提示框,還是顯示提示信息,第四個(gè)參數(shù)就是信息提示頁面顯示多久再進(jìn)行跳轉(zhuǎn),默認(rèn)是1秒種。修改這個(gè)提示框比較簡(jiǎn)單了,直接替換對(duì)應(yīng)的文字

      這個(gè)提示框的CSS也是寫在內(nèi)部的,如果我們需要修改,可以在這里直接修改源碼,甚至我們還可以為這個(gè)ShowMsg函數(shù)增加一個(gè)參數(shù),然后根據(jù)這個(gè)參數(shù),顯示不同的效果。

        本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào)。
        轉(zhuǎn)藏 分享 獻(xiàn)花(0

        0條評(píng)論

        發(fā)表

        請(qǐng)遵守用戶 評(píng)論公約

        類似文章 更多