umming 发布的文章

后台内容列表展示字段样式定义在conf/Functions.php下面format_fields()函数里面

站点关闭模板路径在app\home\c\CommonController.php下面close()函数里面

站点验证码函数定义在\frphp\extend\Vercode.php下面Imagecode里

站点前台验证码函数app\home\c\CommonController.php下面vercode()函数里面

站点后台验证码函数\app\admin\c\LoginController.php下面vercode()函数里面

后台删除缩略图js函数deleteImage_auto()定义在\app\admin\t\tpl\common\fields.html文件

系统提示函数修改frphp\common\Functions.php

伪静态禁止某文件夹执行某种文件
apache:
RewriteRule (uploads|static/upload)/(.*).(php)$ – [F]
RewriteRule (static/template)/(.*).(html)$ – [F]
nginx:
location ~* ^/(uploads|static/upload)/.*.(php|php5)$ {
        deny all; 
}
location ~* ^/(static/template)/.*.(html)$ {
        deny all; 
}

极致cms系统定义信息提示方法使用的的alert(),缺少一些美感,该方法定义在\frphp\common\Functions.php里面function Success()和function Error()两个函数里面,找到方法引入layer.js,使用layer.msg(),代替alert(),可以简单修改弹出信息的样式,也可以自定义复杂的方法

找到conf/FunctionsExt.php。添加如下函数
function lazyImg($richText) {
    return preg_replace_callback(
        '/<img\s+([^>]*)\s*>/i',
        function ($matches) {
            $attributes = $matches[1];
            $newAttributes = str_replace('src=', 'data-src=', $attributes);
            return str_replace($attributes, $newAttributes, $matches[0]);
        },
        $richText
    );
}
找到/app/home/c/HomeController.php
找到 function jizhi_details($id){}函数里面
把$con = $details['body'];
改成$con = lazyImg($details['body']);
前端引入懒加载插件,即可完成

极致cms多行文本字段,编辑框给换行,如果想前台输出换行,官方文档给出了函数,
{fun nl2br($jz['字段名称'])};
如果想输出的内容外围添加标签,使用foreach循环输出,如下:
{foreach explode("\n",$jz['字段名称']) as $v}
{if($v)}
<p>{$v}</p>
{/if}
{/foreach}

1.给值:
打开aricle控制器找到addarticle()函数,在合适位置给值,
$data['ownurl'] = getRandChar(16).'.html';
这样添加内容就会自动生成自定义链接了;

2.后台列表预览按钮修改;
打开aricle控制器找到articlelist()函数,给view_url值做个判断,
if($v['ownurl']!=''){
  $v['view_url'] = gourl($v,$v['ownurl']);
}else{
  $v['view_url'] = gourl($v,$v['htmlurl']); 
}
3.同步复杂功能
自定义url是单独存在customurl表里的,所以以上方法添加后复制功能没法用,复制的内容url无法访问,复制文字控制器也要改;
 function copyarticle(){
 $id = $this->frparam('id');
 if($id){
 $data = M('article')->find(['id'=>$id]);
 unset($data['id']);
 $data['ownurl'] = getRandChar(15).'.html';
 $r = M('Article')->add($data);
 
 if($r){
     //查找添加的id
     $res =  M('Article')->find(['ownurl'=>$data['ownurl']]);
     $aid = $res['id'];
     //存入自定义url表
     $tes = M('customurl')->add(['molds'=>'article','url'=>$data['ownurl'],'tid'=>$data['tid'],'addtime'=>time(),'aid'=>$aid]);
 JsonReturn(array('code'=>0,'msg'=>JZLANG('复制成功!')));
 }else{
 JsonReturn(array('code'=>1,'msg'=>JZLANG('复制失败!')));
 }
 }
 }