fix: nav
This commit is contained in:
@@ -41,6 +41,8 @@ class ContentController extends Controller
|
||||
} else {
|
||||
$result = $this->model->findContentAll($mcode, get('keyword', 'vars'));
|
||||
}
|
||||
} elseif (! ! $scode = get('scode', 'int')) {
|
||||
$result = $this->model->findContent($mcode, $scode, '');
|
||||
} else {
|
||||
$result = $this->model->getList($mcode);
|
||||
}
|
||||
@@ -120,7 +122,7 @@ class ContentController extends Controller
|
||||
alert_back('文章标题不能为空!');
|
||||
}
|
||||
|
||||
if ($filename && ! preg_match('/^[a-zA-Z0-9\-]+$/', $filename)) {
|
||||
if ($filename && ! preg_match('/^[a-zA-Z0-9\-\/]+$/', $filename)) {
|
||||
alert_back('内容URL名称只允许字母、数字、横线组成!');
|
||||
}
|
||||
|
||||
@@ -129,6 +131,11 @@ class ContentController extends Controller
|
||||
$description = escape_string(clear_html_blank(substr_both(strip_tags($_POST['content']), 0, 150)));
|
||||
}
|
||||
|
||||
// 无缩略图时,自动提取文章第一张图为缩略图
|
||||
if (! $ico && preg_match('/<img\s+.*?src=\s?[\'|\"](.*?(\.gif|\.jpg|\.png|\.jpeg))[\'|\"].*?[\/]?>/i', decode_string($content), $srcs) && isset($srcs[1])) {
|
||||
$ico = $srcs[1];
|
||||
}
|
||||
|
||||
// 缩放缩略图
|
||||
if ($ico) {
|
||||
resize_img(ROOT_PATH . $ico, '', $this->config('ico.max_width'), $this->config('ico.max_height'));
|
||||
@@ -437,7 +444,7 @@ class ContentController extends Controller
|
||||
alert_back('文章标题不能为空!');
|
||||
}
|
||||
|
||||
if ($filename && ! preg_match('/^[a-zA-Z0-9\-]+$/', $filename)) {
|
||||
if ($filename && ! preg_match('/^[a-zA-Z0-9\-\/]+$/', $filename)) {
|
||||
alert_back('内容URL名称只允许字母、数字、横线组成!');
|
||||
}
|
||||
|
||||
@@ -446,6 +453,11 @@ class ContentController extends Controller
|
||||
$description = escape_string(clear_html_blank(substr_both(strip_tags($_POST['content']), 0, 150)));
|
||||
}
|
||||
|
||||
// 无缩略图时,自动提取文章第一张图为缩略图
|
||||
if (! $ico && preg_match('/<img\s+.*?src=\s?[\'|\"](.*?(\.gif|\.jpg|\.png|\.jpeg))[\'|\"].*?[\/]?>/i', decode_string($content), $srcs) && isset($srcs[1])) {
|
||||
$ico = $srcs[1];
|
||||
}
|
||||
|
||||
// 缩放缩略图
|
||||
if ($ico) {
|
||||
resize_img(ROOT_PATH . $ico, '', $this->config('ico.max_width'), $this->config('ico.max_height'));
|
||||
|
||||
@@ -66,29 +66,9 @@ class ContentSortController extends Controller
|
||||
foreach ($tree as $value) {
|
||||
$this->count ++;
|
||||
$this->outData[$this->count] = new \stdClass();
|
||||
$this->outData[$this->count]->id = $value->id;
|
||||
$this->outData[$this->count]->blank = $this->blank;
|
||||
$this->outData[$this->count]->name = $value->name;
|
||||
$this->outData[$this->count]->subname = $value->subname;
|
||||
$this->outData[$this->count]->scode = $value->scode;
|
||||
$this->outData[$this->count]->pcode = $value->pcode;
|
||||
$this->outData[$this->count]->mcode = $value->mcode;
|
||||
$this->outData[$this->count]->listtpl = $value->listtpl;
|
||||
$this->outData[$this->count]->contenttpl = $value->contenttpl;
|
||||
$this->outData[$this->count]->ico = $value->ico;
|
||||
$this->outData[$this->count]->pic = $value->pic;
|
||||
$this->outData[$this->count]->keywords = $value->keywords;
|
||||
$this->outData[$this->count]->description = $value->description;
|
||||
$this->outData[$this->count]->outlink = $value->outlink;
|
||||
$this->outData[$this->count]->sorting = $value->sorting;
|
||||
$this->outData[$this->count]->status = $value->status;
|
||||
$this->outData[$this->count]->filename = $value->filename;
|
||||
$this->outData[$this->count]->type = $value->type;
|
||||
$this->outData[$this->count]->urlname = $value->urlname;
|
||||
$this->outData[$this->count]->create_user = $value->create_user;
|
||||
$this->outData[$this->count]->update_user = $value->update_user;
|
||||
$this->outData[$this->count]->create_time = $value->create_time;
|
||||
$this->outData[$this->count]->update_time = $value->update_time;
|
||||
foreach ($value as $k => $v) {
|
||||
$this->outData[$this->count]->$k = $v;
|
||||
}
|
||||
|
||||
if ($value->son) {
|
||||
$this->outData[$this->count]->son = true;
|
||||
|
||||
@@ -101,6 +101,10 @@ class ExtFieldController extends Controller
|
||||
$mysql = 'TEXT';
|
||||
$sqlite = 'TEXT(10000)';
|
||||
break;
|
||||
case '10': // 多图
|
||||
$mysql = 'varchar(1000)';
|
||||
$sqlite = 'TEXT(1000)';
|
||||
break;
|
||||
default:
|
||||
$mysql = 'varchar(200)';
|
||||
$sqlite = 'TEXT(200)';
|
||||
|
||||
@@ -188,6 +188,11 @@ class SingleController extends Controller
|
||||
$description = escape_string(clear_html_blank(substr_both(strip_tags($_POST['content']), 0, 150)));
|
||||
}
|
||||
|
||||
// 无缩略图时,自动提取文章第一张图为缩略图
|
||||
if (! $ico && preg_match('/<img\s+.*?src=\s?[\'|\"](.*?(\.gif|\.jpg|\.png|\.jpeg))[\'|\"].*?[\/]?>/i', decode_string($content), $srcs) && isset($srcs[1])) {
|
||||
$ico = $srcs[1];
|
||||
}
|
||||
|
||||
// 缩放缩略图
|
||||
if ($ico) {
|
||||
resize_img(ROOT_PATH . $ico, '', $this->config('ico.max_width'), $this->config('ico.max_height'));
|
||||
|
||||
Reference in New Issue
Block a user