mirror of https://github.com/1099438829/apeblog
文章增加是否跳转
This commit is contained in:
parent
9441414f9e
commit
8a208aa775
|
|
@ -87,6 +87,7 @@ class Article extends AuthController
|
||||||
['is_hot', 0],
|
['is_hot', 0],
|
||||||
['theme', 'detail.html'],
|
['theme', 'detail.html'],
|
||||||
['link_str', ''],
|
['link_str', ''],
|
||||||
|
['is_jump', 0],
|
||||||
['cover_path', ''],
|
['cover_path', ''],
|
||||||
['display', 1],
|
['display', 1],
|
||||||
['tags', ''],
|
['tags', ''],
|
||||||
|
|
|
||||||
|
|
@ -118,8 +118,18 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-12">
|
<div class="form-group col-md-12">
|
||||||
<label for="link_str">外链</label>
|
<label for="link_str">外链</label>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-xs-10">
|
||||||
<input type="text" class="form-control" name="link_str" id="link_str" placeholder="外链">
|
<input type="text" class="form-control" name="link_str" id="link_str" placeholder="外链">
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col-xs-2">
|
||||||
|
<select class="form-control" id="is_jump" name="is_jump" size="1">
|
||||||
|
<option value="0">不跳转</option>
|
||||||
|
<option value="1">跳转</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="form-group col-md-12">
|
<div class="form-group col-md-12">
|
||||||
<label for="keywords">seo关键字</label>
|
<label for="keywords">seo关键字</label>
|
||||||
<input type="text" class="form-control" id="keywords" name="keywords"
|
<input type="text" class="form-control" id="keywords" name="keywords"
|
||||||
|
|
|
||||||
|
|
@ -138,8 +138,17 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-12">
|
<div class="form-group col-md-12">
|
||||||
<label for="link_str">外链</label>
|
<label for="link_str">外链</label>
|
||||||
<input type="text" class="form-control" name="link_str" id="link_str" placeholder="外链"
|
<div class="row">
|
||||||
value="{$info.link_str}">
|
<div class="col-xs-10">
|
||||||
|
<input type="text" class="form-control" name="link_str" id="link_str" placeholder="外链" value="{$info.link_str}">
|
||||||
|
</div>
|
||||||
|
<div class="col-xs-2">
|
||||||
|
<select class="form-control" id="is_jump" name="is_jump" size="1">
|
||||||
|
<option value="0" {if $info.is_jump == 0}selected{/if}>不跳转</option>
|
||||||
|
<option value="1" {if $info.is_jump == 1}selected{/if}>跳转</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-12">
|
<div class="form-group col-md-12">
|
||||||
<label for="keywords">seo关键字</label>
|
<label for="keywords">seo关键字</label>
|
||||||
|
|
|
||||||
|
|
@ -114,6 +114,7 @@ class Document extends BaseModel
|
||||||
if ($data['is_hot']) $data['is_hot'] = 1;
|
if ($data['is_hot']) $data['is_hot'] = 1;
|
||||||
if ($data['display']) $data['display'] = 1;
|
if ($data['display']) $data['display'] = 1;
|
||||||
if ($data['is_top']) $data['is_top'] = 1;
|
if ($data['is_top']) $data['is_top'] = 1;
|
||||||
|
if ($data['is_jump']) $data['is_jump'] = 1;
|
||||||
//判断是否主键冲突
|
//判断是否主键冲突
|
||||||
$info = $this->where("alias", $data['alias'])->find();
|
$info = $this->where("alias", $data['alias'])->find();
|
||||||
if ($info && (!empty($data['id']) && $info->id != $data['id'])) {
|
if ($info && (!empty($data['id']) && $info->id != $data['id'])) {
|
||||||
|
|
|
||||||
|
|
@ -435,7 +435,8 @@ function make_category_url($item)
|
||||||
function make_detail_url($item)
|
function make_detail_url($item)
|
||||||
{
|
{
|
||||||
//根据栏目类型,生成栏目url
|
//根据栏目类型,生成栏目url
|
||||||
if ($item['link_str']) {
|
//详情根据是否跳转外链来生成
|
||||||
|
if ($item['link_str'] && $item['is_jump']) {
|
||||||
return $item['link_str'];
|
return $item['link_str'];
|
||||||
} else {
|
} else {
|
||||||
return url($item['type'].'/detail', ['id'=>$item['alias']?:$item['id']])->build();
|
return url($item['type'].'/detail', ['id'=>$item['alias']?:$item['id']])->build();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue