自各兒積累phpCMS 二次開發(二)

來源:互聯網
上載者:User
自己積累phpCMS 二次開發(二)
1.自己修改phpcms後台點擊修改/新增內容,在瀏覽器的新視窗中開啟。


一、開啟\phpcms\modules\content\templates 下的content_list.tpl.php檔案
二、找到新增內容 修改內容
三、
添加:&pc_hash="


target="_blank">

修改:&id=&pc_hash=

['pc_hash'];?>" target="_blank">


2.修改網站後台登陸頁面,和後台首頁資訊!


第一是標題:一個是admin_site_title、website_manage,這是後台管理標題參數,還有一個後台登入的標題參數,phpcms_logon。
分別在/phpcms/languages/zh-cn/admin.lang.php的第9行、第668行,/phpcms/languages/zh-cn/system.lang.php的第9行。
其他的參數也都可以看著修改,還有個copyright參數,可以改下,後台登入的的底部資訊。
第二是登入成功後首頁:首頁的展示資訊,模板在/phpcms/modules/admin/templates/main.tpl.php,後台首頁自訂添加修改。
第三是背景logo圖片,樣式檔案在/statics/css/zh-cn-system.css,第37行.header .logo。
基本上後台就這些需要改的,後台需要改的頁面模板基本都在/phpcms/modules的幾個檔案夾。


3.除某一兩個欄目外迴圈出所有的欄目。
例:
{loop subcat(9,0,0,$siteid) $r}
{if $r['catid']==10 }{/if}
{if $r['catid']==11 }{/if}

  • {$r[catname]}



    • {loop subcat($r[catid],0,0,$siteid) $w}
    • {$w[catname]}

    • {/loop}


  • {/loop}


    4.phpCMS格式化時間的多種方式。
    a\標準型:{date('Y-m-d H:i:s', $rs['inputtime'])} 輸出為:2010-12-31 13:15:10
    b\拆分型:{date('Y',$rs[inputtime])}年{date('m',$rs[inputtime])}月{date('d',$rs[inputtime])}日 輸出為:2010年12月31日
    c\擴充型:
    {date('Y',$inputtime);} 4位年份 輸出為:2010 或 2011
    {date('y',$inputtime);} 2位年份 輸出為:10 或 11
    {date('F',$inputtime);} 英文月份全稱 輸出為:January 到 December
    {date('M',$inputtime); } 英文月份縮寫 輸出為:Jan 到 Dec
    {date('m',$inputtime);} 前置字元為零數字月份 輸出為:01 到 12
    {date('n',$inputtime); } 數字月份 輸出為:1 到 12
    {date('d',$inputtime);} 前置字元為零日期 輸出為:01 到 31
    {date('j',$inputtime);} 日期 輸出為:1 到 31
    {date('l',$inputtime);} 英文星期全稱 輸出為:Sunday 到 Saturday
    {date('D',$inputtime);} 英文星期縮寫 輸出為:Mon 到 Sun
    {date('N',$inputtime);} 格式數字星期 輸出為:1 到 7


    5..phpcms V9編輯器的批量去除超連結功能
    1、批量去除超連結:
    開啟 statics/js/ckeditor/ckeditor.js
    找到
    $.execCommand('unlink',false,null);
    修改為:
    $.execCommand('unlink',false,true);
    2、上傳圖片自動添加ALT參數
    修改 statics/js/ckeditor/plugins/image/dialogs/image.js
    找到
    accessKey:'T','default':''
    替換成
    accessKey:'T','default':$('#title').val()
    3、修改編輯器斷行符號換行

    or

    開啟檔案 \statics\js\ckeditor\config.js 把裡面的
    config.enterMode = CKEDITOR.ENTER_BR;
    config.shiftEnterMode = CKEDITOR.ENTER_P;
    修改為
    config.enterMode = CKEDITOR.ENTER_P;
    config.shiftEnterMode = CKEDITOR.ENTER_BR;
    4、給編輯器添加一鍵排版功能
    修改
    phpcms\libs\classes欄目下的
    form.class.php找到['Maximize'], 在它下面添加['autoformat'],儲存即可。
    找到statics\js\ckeditor檔案夾下的config.js 檔案
    找到
    config.extraPlugins = 'capture';
    修改為:
    config.extraPlugins = 'capture,autoformat';
    儲存即可。
    修改後記得更新緩衝,清除cookies。


    6.顯示指定id的欄目名稱 (例子這裡catid=22){$CATEGORYS[22]['catname']}

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.