php 文章调用类代码

2019-04-09 00:19:42王冬梅

} elseif ($CateId>0) {
$this->SqlCateId=' AND `cateid` ='.$CateId;
}
if ($CateId==0) $this->SqlCateId='';
/*
$CateId=$this->CateId;
$this->SqlCateTitleId=' AND `id` ='.$CateId;
*/
//显示区域
$Area=$this->Area;
if ($Area>0) {
$Area+=0;
$this->SqlArea= ' AND `area'.$Area.'` =1';
}
//状态
$this->SqlFlag= ' AND `flag` = '. $this->Flag;
//列表中不显示
$this->SqlNotShow= ' AND `notshowlist` = '. $this->notshowlist;
//图片
$Pic = $this->Pic;
if ($Pic==1){
$this->SqlPic= ' AND (`pic1` <>"" or `pic2`<>"") ';
}else {
$this->SqlPic= '';
}
//视频
$Video = $this->Video;
if ($Video==1){
$this->SqlVideo= ' AND `isvideo`=1 ';
}else {
$this->SqlVideo= '';
}
//额外加入的查询
$AndWhere = $this->AndWhere;
if ($AndWhere<>''){
$this->SqlWhere = ' And ' . $AndWhere;
}
//排序
$this->SqlOrder= ' ORDER BY `'.$this->OrderBy.'` '.$this->OrderSort;
if ($this->OrderBy2!='') $this->SqlOrder.= ' ,`'.$this->OrderBy2.'` '.$this->OrderSort2;
//显示个数
$this->SqlLimit= ' LIMIT '.$this->BeginCount.', '.$this->Count.';';
}
/**
* 清除,置为默认
*/
function Clear(){
$this->CateId = 0; //栏目编号 0,可以为一个栏目编号, 或者多个栏目。例如:12, 或者12,13
$this->Count = 10; //记录数 10
$this->TitleCount = 20; //文字显示数 20
$this->BeginCount = 0; //起始记录数 0
$this->OrderBy = 'id'; //排序字段 默认以id字段排序
$this->OrderSort = 'DESC'; //排序顺序 默认DESC,倒序
$this->Area = 0; //显示区域 0,全部显示
$this->Flag = ISSUEFLAG; //显示文章状态 2,2为 已保存 已发布
$this->Pic = 0; //仅调用有图片的 0,1为仅调用有图的
$this->Video = 0; //仅调用有视频的 0,1为仅调用视频的
$this->notshowlist = 0; //不显示不在列表中的 0,不显示, 1 显示
$this->AndWhere = ''; //额外加入的查询
$this->Loop = 0; //循环列表 0,
$this->Template = ''; //模板
}
/**
* 返回文章内容字符串
*
* {<li class="xxx"><a href="{html}" title="{title}" >{title|20}{title2|20}</a>点击数:{hits} {memo|20} 日期:{posttime|H:i:s y-m-d}</li>}
* 说明如下, 产生一个循环模板,{}里面的说明如下
* html 链接,优先显示跳转链接
* title 标题,加|线后面的参数:1、为字数显示限制,2、为字数限制后是否显示省略符号, title为优先显示title, title2为优先显示title2
* hits 点击率
* posttime 提交时间,后面的参数为日期格式化方法
* memo 调用文字,加|线后面的参数:1、为字数显示限制,2、为字数限制后是否显示省略符号
* loop 循环变量
*
* @return 文章列表
相关文章 大家在看