自各儿积累phpCMS 二次开发(二)

WBOY
Release: 2016-06-13 12:35:12
Original
1593 people have browsed it

自己积累phpCMS 二次开发(二)
1.自己修改phpcms后台点击修改/添加内容,在浏览器的新窗口中打开。


   一、打开\phpcms\modules\content\templates  下的content_list.tpl.php文件
   二、找到添加内容      修改内容
   三、
   添加:

target="_blank">

   
   修改:

['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']}

    Related labels:
    source:php.cn
    Statement of this Website
    The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
    Popular Tutorials
    More>
    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!