php文章の呼び出しコード
70736 ワード
呼び出し方法は以下の通りです。
$Template= '<li class="xxx">[<a href="{catedir}">{catetitle}</a>]<a href="{html}" title="{title}" >{title|6}{title2|20}</a> :{hits} :{posttime|H:i:s}</li>';
$Article=new Article();
$Article->Template=$Template;
$Article->CateId=30;
DebugStr(' ');
DebugStr($Article->getArticleListByCateId());
$Template='<li class="xxx"><a href="{html}" title="{title}" >{title}</a> :{hits} :{posttime|Y-m-d H:i:s}</li>';
$Article->Template=$Template;
$Article->CateId=30;
DebugStr($Article->getArticleListByCateId($Template, 30));
$Template='<a href="{html}" title="{title}" >{title}</a> :{posttime}<br>';
$Article->Template=$Template;
$Article->CateId=28;
DebugStr($Article->getArticleListByCateId($Template, 28));
類コードは以下の通りです。
<?php
/**
* , 、
* PHP5
*
* :
* getArticleListByCateId();
*
* @author Zerolone
* @version 2011-3-14 9:53:42
*
* 2011-1-31 10:11:07 getCatePreviewUrl getPreviewUrl
*/
class Article {
public $CateId = 0; // 0, , 。 :12, 12,13
public $Count = 10; // 10
public $TitleCount = 20; // 20
public $BeginCount = 0; // 0
public $OrderBy = 'id'; // id
public $OrderSort = 'DESC'; // DESC,
public $OrderBy2 = ''; // 2
public $OrderSort2 = ''; // 2
public $Area = 0; // 0,
public $Flag = ISSUEFLAG; // 2,2
public $Pic = 0; // 0,1
public $Video = 0; // 0,1
public $notshowlist= 0; // 0, , 1
public $AndWhere = ''; //
public $Loop = 0; // 0,
public $Template = ''; //
public $IdList = ''; //Id ,
//
protected $SqlCateId = ''; // Sql
protected $SqlCateTitleId = ''; // Sql
protected $SqlArea = ''; // Sql
protected $SqlFlag = ''; //
protected $SqlNotShow = ''; //
protected $SqlPic = ''; //
protected $SqlVideo = ''; //
protected $SqlOrder = ''; //
protected $SqlLimit = ''; //
protected $SqlWhere = ''; //
public $SqlStr = ''; //
/**
* Sql
*
*/
function InitSql(){
//
$CateId=$this->CateId;
if (strpos($CateId, ',')) {
$this->SqlCateId=' AND `cateid` in ('.$CateId.')';
} 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
*/
function getArticleListByCateId(){
$this->InitSql();
$Str_Loop = '';
$ReturnString = '';
$Template = $this->Template;
//
$SqlStr = 'SELECT * FROM `'.DB_TABLE_PRE . 'view_article`';
$SqlStr.= ' WHERE 1=1';
$SqlStr.=$this->SqlNotShow; //
$SqlStr.=$this->SqlCateId; //
$SqlStr.=$this->SqlArea; //
$SqlStr.=$this->SqlFlag; //
$SqlStr.=$this->SqlPic; //
$SqlStr.=$this->SqlVideo; //
$SqlStr.=$this->SqlWhere; //
$SqlStr.=$this->SqlOrder; //
$SqlStr.=$this->SqlLimit; //
$this->SqlStr=$SqlStr;
$this->OrderBy2 = '';
$this->OrderSort2 = '';
// 1
@preg_match('/{title\|([\d].+?)}/i', $Template, $matches);
@$title_count = $matches[1];
// 2
@preg_match('/{title2\|([\d].+?)}/i', $Template, $matches);
@$title2_count = $matches[1];
//
@preg_match('/{memo\|([\d].+?)}/i', $Template, $matches);
@$memo_count = $matches[1];
//
@preg_match('/{posttime\|(.+?)}/i', $Template, $matches);
@$posttime_format=$matches[1];
//
$Template = preg_replace('/({title\|[\d].+?})/i', '{title}', $Template);
$Template = preg_replace('/({title2\|[\d]+.?})/i', '{title2}', $Template);
$Template = preg_replace('/({posttime\|.+?})/i', '{posttime}', $Template);
$Template = preg_replace('/({memo\|[\d].+?})/i', '{memo}', $Template);
//loop
$loop = $this->Loop;
$MyDatabase=Database::Get();
$MyDatabase->SqlStr = $SqlStr;
if ($MyDatabase->Query ()) {
$DB_Record_Arr = $MyDatabase->ResultArr;
foreach ( $DB_Record_Arr as $DB_Record ) {
$id = $DB_Record['id'];
$this->IdList .= $id . ',';
$title = $DB_Record['title'];
$title_full = $title;
$title2 = $DB_Record['title2'];
$titlestrip = strip_tags($title);
$memo = $DB_Record['memo'];
$posttime = $DB_Record['posttime'];
$reurl = $DB_Record['reurl'];
$url = $DB_Record['html'];
$hits = $DB_Record['hits'];
$titlecolor = $DB_Record['titlecolor'];
$catetitle = $DB_Record['catetitle'];
$catedir = $DB_Record['catedir'];
$catedesc = $DB_Record['catedesc'];
$Str_Loop = $Template;
//
// , ,
if ($reurl<>''){
$html = $reurl;
}else {
$html = SITE_URL . SITE_FOLDER . ARTICLEURL . $url;
}
$pic1 = $DB_Record['pic1'];
$pic2 = $DB_Record['pic2'];
if ($pic2<>''){
$pic = $pic2;
}else{
$pic = $pic1;
}
// //
if ($title_count) $title = subString($title, $title_count);
if ($title2_count) $title2 = subString($title2, $title2_count);
if ($memo_count) $memo = subString($memo, $memo_count);
// , Style
if ($titlecolor<>'') $title = '<font style="color:'.$titlecolor.'">'.$title.'</font>';
//
if ($posttime_format!=''){
$posttime=date($posttime_format, $posttime);
}else {
$posttime=date('Y-m-d H:i', $posttime);
}
//
//
$Arr_Search = array('{id}', '{title_full}', '{title}', '{title2}', '{titlestrip}', '{memo}', '{html}', '{hits}', '{posttime}', '{catetitle}', '{catedir}', '{pic}', '{pic1}', '{pic2}', '{loop}', '{catedesc}');
$Arr_Replace = array($id, $title_full, $title, $title2, $titlestrip, $memo, $html, $hits, $posttime, $catetitle, $catedir, $pic, $pic1, $pic2, $loop++, $catedesc);
$Str_Loop=str_replace($Arr_Search, $Arr_Replace, $Str_Loop);
$ReturnString.=$Str_Loop;
}
}
//
$this->Clear();
return $ReturnString;
}
/**
* html
*/
function DefaultHtml(){
$html='';
$this->InitSql();
//-------------------0
$SqlStr = 'SELECT `html` FROM `'.DB_TABLE_PRE . 'view_article`';
$SqlStr.= ' WHERE 1=1';
$SqlStr.=$this->SqlCateId;//
$SqlStr.=$this->SqlFlag;//
$SqlStr.=$this->SqlOrder;//
$SqlStr.=$this->SqlLimit;//
$MyDatabase=Database::Get();
$MyDatabase->SqlStr = $SqlStr;
if ($MyDatabase->Query ()) {
$html = $MyDatabase->ResultArr [0][0];
}
return $html;
}
/**
*
* @param $id
*/
static public function getCateHTML($id){
$html = '';
$SqlStr = 'SELECT `dir` FROM `'.DB_TABLE_PRE . 'article_cate`';
$SqlStr.= ' WHERE `id`='.$id;
$MyDatabase=Database::Get();
$MyDatabase->SqlStr = $SqlStr;
if ($MyDatabase->Query ()) {
$html = $MyDatabase->ResultArr [0][0];
}
return $html;
}
/**
*
*/
function getCateTitle(){
$CateTitle='';
//-------------------0
$SqlStr = 'SELECT `title` FROM `'.DB_TABLE_PRE . 'view_article`';
$SqlStr.= ' WHERE 1=1';
$SqlStr.=$this->SqlCateTitleId; //
$MyDatabase=Database::Get();
$MyDatabase->SqlStr = $SqlStr;
if ($MyDatabase->Query ()) {
$CateTitle = $MyDatabase->ResultArr [0][0];
}
return $CateTitle;
}
/**
* 2011-1
*/
function getArticListDate(){
//
$CateId=$this->CateId;
if (strpos($CateId, ',')) {
$this->SqlCateId=' AND `cateid` in ('.$CateId.')';
} elseif ($CateId>0) {
$this->SqlCateId=' AND `cateid` ='.$CateId;
}
$cateList='';
$intCount=0;
$strSearch=''; //
$strMonth=''; //
// -
$year=date("Y",time());
$month=date("m",time());
//
$SqlStr = 'SELECT COUNT( * ) from `'.DB_TABLE_PRE . 'view_article`'.' WHERE DATE_FORMAT(`posttime`, \'%Y\')=\''.$year.'\'';
//
$SqlStr.=$this->SqlCateId;
$MyDatabase->SqlStr = $SqlStr;
$MyDatabase=Database::Get();
if ($MyDatabase->Query ()) {
$intCount = $MyDatabase->ResultArr [0][0];
$cateList.=' <li class="lev1"><a href="#" class="year">'.$year.' ('.$intCount.')</a></li>';
}
//
for($i=$month;$i>0;$i--){
if (strlen($i)==1){
$strSearch= $year . '-0' . $i;
}else{
$strSearch= $year . '-' . $i;
}
switch ($i) {
case 1:
$strMonth=' ';
break;
case 2:
$strMonth=' ';
break;
case 3:
$strMonth=' ';
break;
case 4:
$strMonth=' ';
break;
case 5:
$strMonth=' ';
break;
case 6:
$strMonth=' ';
break;
case 7:
$strMonth=' ';
break;
case 8:
$strMonth=' ';
break;
case 9:
$strMonth=' ';
break;
case 10:
$strMonth=' ';
break;
case 11:
$strMonth=' ';
break;
case 12:
$strMonth=' ';
break;
}
$SqlStr = 'SELECT COUNT( * ) from `'.DB_TABLE_PRE.'article` WHERE DATE_FORMAT(`posttime`, \'%Y-%m\')=\''.$strSearch.'\'';
//
$SqlStr.=$this->SqlCateId;
$MyDatabase->SqlStr = $SqlStr;
if ($MyDatabase->Query () ) {
$DB_Record = $MyDatabase->ResultArr [0];
$intCount = $DB_Record[0];
if($intCount>0){
$cateList.=' <li class="lev2"><a href="#" class="year">'.$strMonth.' ('.$intCount.')</a></li>';
}
}
}
// 9
for($i=$year-1;$i>$year-10;$i--){
$SqlStr = 'SELECT COUNT( * ) from `'.DB_TABLE_PRE.'article` WHERE DATE_FORMAT(`posttime`, \'%Y\')=\''.$i.'\'';
//
$SqlStr.=$this->SqlCateId;
$MyDatabase->SqlStr = $SqlStr;
if ($MyDatabase->Query () ) {
$DB_Record = $MyDatabase->ResultArr [0];
$intCount = $DB_Record[0];
if($intCount>0){
$cateList.=' <li class="lev1"><a href="#" class="year">'.$i.' ('.$intCount.')</a></li>';
}
}
}
return $cateList;
}
/**
* , 。
*
* @param $parentid
*
*/
function getTitleListByCateId($parentid){
$CateTitleList='';
//-------------------0------1------2
$SqlStr = 'SELECT `title`, `id`, `url` FROM `'.DB_TABLE_PRE . 'view_article`';
$SqlStr.= ' WHERE parentid=' . $parentid;
$SqlStr.= ' ORDER BY `level` ASC;';
$MyDatabase=Database::Get();
$MyDatabase->SqlStr = $SqlStr;
if ($MyDatabase->Query ()) {
$DB_Record_Arr = $MyDatabase->ResultArr;
foreach ( $DB_Record_Arr as $DB_Record ) {
if($DB_Record[2]==''){
$CateTitleList.= '<a href="article.php?id='.$DB_Record[1].'">'.$DB_Record[0].'</a> ';
}else{
$CateTitleList.= '<a href="'.$DB_Record[2].'?id='.$DB_Record[1].'">'.$DB_Record[0].'</a> ';
}
}
}
return $CateTitleList;
}
/**
* , 。
* @param $cateid
* @param $limit
* @param $prev
*/
function getArticlePicListByCateId($cateid, $limit, $prev=''){
$str_return='';
//-------------------0------1------2---------3-------4--------5
$SqlStr = 'SELECT `title`, `id`, `reurl`, `html`, `pic1`, `memo` FROM `'.DB_TABLE_PRE . 'view_article`';
$SqlStr.= ' WHERE `cateid`=' . $cateid;
$SqlStr.= ' AND `flag`=' . ARTICLE_FLAG;
$SqlStr.= ' AND `pic1`!=\'\'';
$SqlStr.= ' ORDER BY `order` ASC, `id` DESC';
$SqlStr.= ' LIMIT ' . $limit;
//echo $SqlStr;
$MyDatabase=Database::Get();
$MyDatabase->SqlStr = $SqlStr;
if ($MyDatabase->Query ()) {
$DB_Record_Arr = $MyDatabase->ResultArr;
foreach ( $DB_Record_Arr as $DB_Record ) {
$DB_Record[0] = subString($DB_Record[0], 18);
$DB_Record[5] = subString($DB_Record[5], 56);
$url= $DB_Record[3];
if($DB_Record[2]!='') $url= $DB_Record[2];
$str_return.= '<dl>';
$str_return.= '<dd><a href="'.$url.'"><img src="'.$DB_Record[4].'" width="110" height="85" /></a></dd>';
$str_return.= '<dt><a href="'.$url.'">'.$DB_Record[0].'</a>'.$DB_Record[5].'<a href="'.$url.'" class="view"> </a></dt>';
$str_return.= '</dl>';
}
}
return $str_return;
}
/**
* ID, 。
*
* @param $id
*
*/
function getSIdById($id){
$ReturnContent='';
//------------------0------1
$SqlStr = 'SELECT `id` FROM `'.DB_TABLE_PRE . 'view_article`';
$SqlStr.= ' WHERE `parentid`=' . $id;
$SqlStr.= ' ORDER BY `level` DESC';
// echo $SqlStr;
$MyDatabase=Database::Get();
$MyDatabase->SqlStr = $SqlStr;
if ($MyDatabase->Query ()) {
$ReturnContent = $MyDatabase->ResultArr [0][0];
}
return $ReturnContent;
}
/**
*
* @param $id
*/
function getCateTitleById($id){
$CateTitle='';
//-------------------0
$SqlStr = 'SELECT `title` FROM `'.DB_TABLE_PRE . 'view_article`';
$SqlStr.= ' WHERE 1=1';
$SqlStr.= ' AND `id`='.$id;
$MyDatabase=Database::Get();
$MyDatabase->SqlStr = $SqlStr;
if ($MyDatabase->Query ()) {
$CateTitle = $MyDatabase->ResultArr [0][0];
}
return $CateTitle;
}
/**
* ID
* @param $id
*/
function getParentCateIdById($id){
$CateTitle='';
//--------------------0
$SqlStr = 'SELECT `parentid` FROM `'.DB_TABLE_PRE . 'view_article`';
$SqlStr.= ' WHERE 1=1';
$SqlStr.= ' AND `id`='.$id;
$MyDatabase=Database::Get();
$MyDatabase->SqlStr = $SqlStr;
if ($MyDatabase->Query ()) {
$CateTitle = $MyDatabase->ResultArr [0][0];
}
return $CateTitle;
}
/**
* ,
* @param $id
*/
static public function UpdateHits($id){
//-------------------0
$SqlStr = 'UPDATE `' . DB_TABLE_PRE . 'article`';
$SqlStr.= ' SET `hits`=`hits`+1';
$SqlStr.= ' WHERE 1=1';
$SqlStr.= ' AND `id`='.$id;
$MyDatabase=Database::Get();
$MyDatabase->SqlStr = $SqlStr;
$MyDatabase->ExecuteQuery ();
}
/**
* ,
* @param $id
*/
static public function GetHits($id){
$ReturnContent='';
//-------------------0
$SqlStr = 'SELECT `hits` FROM `' . DB_TABLE_PRE . 'article`';
$SqlStr.= ' WHERE 1=1';
$SqlStr.= ' AND `id`='.$id;
// var_dump($SqlStr);
$MyDatabase=Database::Get();
$MyDatabase->SqlStr = $SqlStr;
if ($MyDatabase->Query ()) {
$ReturnContent = $MyDatabase->ResultArr [0][0];
}
return $ReturnContent;
}
/**
* ,
* @param $id
*/
function getContentById($id){
$ReturnContent='';
//-------------------0
$SqlStr = 'SELECT `content` FROM `'.DB_TABLE_PRE . 'view_article`';
$SqlStr.= ' WHERE 1=1';
$SqlStr.= ' AND `id`='.$id;
$MyDatabase=Database::Get();
$MyDatabase->SqlStr = $SqlStr;
if ($MyDatabase->Query ()) {
$ReturnContent = $MyDatabase->ResultArr [0][0];
}
return $ReturnContent;
}
/**
* ,
* @param $id
*/
function getUrlById($id){
$ReturnContent='';
//------------------0
$SqlStr = 'SELECT `reurl` FROM `'.DB_TABLE_PRE . 'view_article`';
$SqlStr.= ' WHERE 1=1';
$SqlStr.= ' AND `id`='.$id;
$MyDatabase=Database::Get();
$MyDatabase->SqlStr = $SqlStr;
if ($MyDatabase->Query ()) {
$ReturnContent = $MyDatabase->ResultArr [0][0];
if($ReturnContent==''){
$ReturnContent='article_details.php?id='.$id;
}
}
return $ReturnContent;
}
/**
* ,
* @param $id
*/
function getHTMLById($id){
$ReturnContent='';
//------------------0
$SqlStr = 'SELECT `html` FROM `'.DB_TABLE_PRE . 'view_article`';
$SqlStr.= ' WHERE 1=1';
$SqlStr.= ' AND `id`='.$id;
$MyDatabase=Database::Get();
$MyDatabase->SqlStr = $SqlStr;
if ($MyDatabase->Query ()) $ReturnContent = $MyDatabase->ResultArr [0][0];
return $ReturnContent;
}
/**
* ,
* @param $id
* @param $cateid
*/
function getPrevById($id, $cateid){
$ReturnContent=' ';
//------------------0
$SqlStr = 'SELECT `title`, `html` FROM `'.DB_TABLE_PRE . 'view_article`';
$SqlStr.= ' WHERE 1=1';
$SqlStr.= ' AND `id`<'.$id;
$SqlStr.= ' AND `cateid`='.$cateid;
$SqlStr.= ' AND `flag`=' . ARTICLE_FLAG;
$SqlStr.= ' ORDER BY `order` ASC, `id` desc';
$MyDatabase=Database::Get();
$MyDatabase->SqlStr = $SqlStr;
if ($MyDatabase->Query ()) $ReturnContent = '<a href="'.$MyDatabase->ResultArr [0][1].'">'. subString($MyDatabase->ResultArr [0][0], 100) . '</a>';
return $ReturnContent;
}
/**
* ,
*
* @param $id
* @param $cateid
*/
function getNextById($id, $cateid){
$ReturnContent=' ';
//------------------0
$SqlStr = 'SELECT `title`, `html` FROM `'.DB_TABLE_PRE . 'view_article`';
$SqlStr.= ' WHERE 1=1';
$SqlStr.= ' AND `id`>'.$id;
$SqlStr.= ' AND `cateid`='.$cateid;
$SqlStr.= ' AND `flag`=' . ARTICLE_FLAG;
$SqlStr.= ' ORDER BY `order` ASC, `id` desc';
$MyDatabase=Database::Get();
$MyDatabase->SqlStr = $SqlStr;
if ($MyDatabase->Query ()) $ReturnContent = '<a href="'.$MyDatabase->ResultArr [0][1].'">'. subString($MyDatabase->ResultArr [0][0], 100) . '</a>';
return $ReturnContent;
}
/**
* level,
* @param $level
*/
function getNavByLevel($level){
$ReturnContent=SITE_NAV;
$ReturnContent.=ARTICLE_NAV;
//$level=substr($level, 0, 2);
//$level='01010101';
$level_list='';
$level_len=strlen($level);
for ($i=2; $i<$level_len;$i+=2){
$level_list.=substr($level,0,$i) . ',';
}
$level_list.=$level;
// DebugStr( $level_list);
$SqlStr = 'SELECT * FROM `'.DB_TABLE_PRE . 'view_article`';
$SqlStr.= ' WHERE `level` in (' .$level_list . ')';
$SqlStr.= ' ORDER BY `level` ASC;';
$MyDatabase=Database::Get();
$MyDatabase->SqlStr = $SqlStr;
if ($MyDatabase->Query ()) {
$levels = $MyDatabase->ResultArr;
foreach ($levels as $level){
$ReturnContent.=' <a href="'.$level['dir'].'">'.$level['title'].' ></a>';
}
}
return $ReturnContent;
}
/**
* , , , 。
* @param $cateid
*/
function getPartByCateId($cateid){
$strReturn='<dl>';
$id=0;
$SqlStr = 'SELECT * FROM `'.DB_TABLE_PRE . 'view_article`';
$SqlStr.= ' WHERE `cateid` =' .$cateid;
$SqlStr.= ' AND `flag` ='.ARTICLE_FLAG;
$SqlStr.= ' AND `pic1` !=\'\'';
$SqlStr.= ' ORDER BY `order` ASC, `id` DESC';
$SqlStr.= ' LIMIT 1;';
$MyDatabase=Database::Get();
$MyDatabase->SqlStr = $SqlStr;
// DebugStr($SqlStr);
if ($MyDatabase->Query ()) {
$article = $MyDatabase->ResultArr[0];
$id = $article['id'];
$strReturn.='<dd><a href="'.$article['html'].'"><img src="'.$article['pic1'].'" width="145" height="120" /></a></dd>';
}
$strReturn.='<dt>';
//
$SqlStr = 'SELECT * FROM `'.DB_TABLE_PRE . 'view_article`';
$SqlStr.= ' WHERE `cateid` =' .$cateid;
$SqlStr.= ' AND `flag` ='.ARTICLE_FLAG;
$SqlStr.= ' AND `id` !='.$id;
$SqlStr.= ' ORDER BY `order` ASC, `id` DESC';
$SqlStr.= ' LIMIT 6;';
$MyDatabase=Database::Get();
$MyDatabase->SqlStr = $SqlStr;
if ($MyDatabase->Query ()) {
$articles = $MyDatabase->ResultArr;
$i=1;
foreach ($articles as $article){
if ($i==1){
$strReturn.='<a href="'.$article['html'].'" class="topic">'.subString($article['title'],34).'</a>';
}else{
$strReturn.='<a href="'.$article['html'].'">'.subString($article['title'],50).'</a>';
}
$i++;
}
}
$strReturn.='</dt></dl>';
return $strReturn;
}
/**
* , Level
* @param $id
*/
function getLevelById($id){
$ReturnContent='';
$SqlStr = 'SELECT `Level` FROM `'.DB_TABLE_PRE . 'article_cate`';
$SqlStr.= ' WHERE 1=1';
$SqlStr.= ' AND `id`='.$id;
$MyDatabase=Database::Get();
$MyDatabase->SqlStr = $SqlStr;
if ($MyDatabase->Query ()) $ReturnContent = $MyDatabase->ResultArr [0][0];
return $ReturnContent;
}
/**
*
*
* @param $flag
* @return
*/
public static function printFlag ( $flag = 0 ){
switch ( $flag ){
case 0:
return "<Font color=\"#FF0000\"> </Font>";
case 1:
return "<Font color=\"#009900\"> </Font> <Font color=\"#FF0000\"> </Font>";
case 2:
return "<Font color=\"#009900\"> </Font>";
default:
return " ";
}
}
/**
* HTML
*
* @param $flag
* @return
*/
public static function printHtmlFlag ( $flag= 0 ){
switch ( $flag ){
case 0:
return "<Font color=\"#FF0000\"> </Font>";
case 1:
return "<Font color=\"#009900\"> </Font>";
default:
return " ";
}
}
/**
*
*
* @param $flag
* @return
*/
public static function printVideoFlag ( $flag= 0 ){
switch ( $flag ){
case 1:
return '<Font color="red"><b> </b></Font>';
default:
return '';
}
}
/**
*
*
* @param $flag
* @return
*/
public static function printIssueFlag ( $flag = 0 ){
switch ( $flag ){
case 1:
return "<Font color=\"#FF0000\"> </Font>";
case 2:
return "<Font color=\"#009900\"> </Font>";
default:
return " ";
}
}
/**
*
*
* @param $dir
* @param $cateid
*/
public static function canCreateDir($dir, $cateid){
$can=true;
// ,
if ($dir==''){
$can=false;
}
//
if (strpos(CANTDIR, '|'. $dir . '|')){
$can=false;
}
//
//-------------------0
$SqlStr = 'SELECT `dir` FROM `'.DB_TABLE_PRE . 'article_cate`' ;
$SqlStr.= ' WHERE `dir`=\'' . $dir . '\'';
$SqlStr.= ' AND `id`<>\'' . $cateid . '\'';
$MyDatabase=Database::Get();
$MyDatabase->SqlStr = $SqlStr;
if ($MyDatabase->Query ()) $can=false;
//
return($can);
}
/**
* ,
* @param $cateid
*/
public static function getCatePreviewUrl($cateid){
$template_url ='';
$SqlStr = ' SELECT `template_url`';
$SqlStr.= ' FROM `'.DB_TABLE_PRE.'view_articlecate` ';
$SqlStr.= ' WHERE `id`='.$cateid;
$SqlStr.= ' LIMIT 1';
$MyDatabase=Database::Get();
$MyDatabase->SqlStr = $SqlStr;
if ($MyDatabase->Query ()){
$template_url = $MyDatabase->ResultArr [0][0];
}
return($template_url);
}
/**
* ,
* @param $cateid
*/
public static function getPreviewUrl($id){
$template_url ='';
$SqlStr = ' SELECT `template_url`';
$SqlStr.= ' FROM `'.DB_TABLE_PRE.'view_articlelist` ';
$SqlStr.= ' WHERE `id`='.$id;
$SqlStr.= ' LIMIT 1;';
$MyDatabase=Database::Get();
$MyDatabase->SqlStr = $SqlStr;
if ($MyDatabase->Query ()){
$template_url = $MyDatabase->ResultArr [0][0];
}
return($template_url);
}
/**
* HTML
* @param $id id, ,
* @param $posttime ,
*
* @return
*/
function UpdateHTML($id, $posttime=''){
// ,
if ($posttime==''){
$posttime=time();
}else{
$posttime=strtotime($posttime);
}
$ArticlePath = date("ym",$posttime) . '/'. date("d",$posttime);
if (createFolder(ARTICLEPATH, $ArticlePath)){
$html = ARTICLEURL . $ArticlePath . '/' . date( "His", time() ) . rand( 1000, 9999 ) . '.html';
$MyDatabase=Database::Get();
$ArrField=array('html');
$ArrValue=array($html);
$MyDatabase->Update('article', $ArrField, $ArrValue, '`id`='.$id);
return($html);
}
}
/**
* HTML
* @param $id
*/
function HTML($id){
}
/**
*
*
* @param $id
*/
function getCate($cateid){
$level = $this->getLevelById($cateid);
$level_len= strlen($level) / 2 ;
//level
$level_str='0';
for ($i=1;$i<=$level_len;$i++){
$level_str.= ','.substr($level,0, 2*$i);
}
$navbar = '<a href="'. SITE_URL .'"> </a> >';
$SqlStr = ' SELECT * ';
$SqlStr.= ' FROM `'. DB_TABLE_PRE . 'article_cate`';
$SqlStr.= ' WHERE `level` in ('.$level_str.')';
$SqlStr.= ' ORDER BY `level` ASC';
$MyDatabase=Database::Get();
$MyDatabase->SqlStr = $SqlStr;
if ($MyDatabase->Query ()) {
$DB_Record_Arr = $MyDatabase->ResultArr;
foreach ( $DB_Record_Arr as $DB_Record ) {
$html = $DB_Record['id'];
if ($DB_Record['url']!='') $html=$DB_Record['url'];
$navbar.=' <a href="' . SITE_URL . SITE_FOLDER . CATEURL . $html .'/index.html">'. $DB_Record['title'] .'</a> >';
}
}
return $navbar;
}
}
?>
データベース
--
-- `mc_article`
--
CREATE TABLE IF NOT EXISTS `mc_article` (
`id` int(10) unsigned NOT NULL auto_increment COMMENT ' ',
`comment` tinyint(3) unsigned NOT NULL COMMENT ' ',
`comments` tinyint(3) unsigned NOT NULL COMMENT ' ',
`commentcheck` tinyint(3) unsigned NOT NULL COMMENT ' ',
`posttime` int(10) unsigned NOT NULL COMMENT ' ',
`title` varchar(255) NOT NULL COMMENT 'Title',
`title2` varchar(255) default NULL COMMENT 'Title2',
`content` text COMMENT 'Content',
`flag` tinyint(1) NOT NULL default '0' COMMENT ' ',
`cateid` int(10) unsigned NOT NULL default '0' COMMENT ' ',
`sourceid` mediumint(8) unsigned NOT NULL default '0',
`reurl` varchar(255) default NULL COMMENT ' ',
`hits` mediumint(8) unsigned NOT NULL default '0' COMMENT ' ',
`author` varchar(255) default NULL COMMENT ' ',
`from` varchar(255) default NULL COMMENT ' ',
`keyword` varchar(255) default NULL COMMENT ' ',
`order` tinyint(4) unsigned NOT NULL default '99' COMMENT ' ',
`memo` text COMMENT ' ',
`pic1` varchar(255) default NULL COMMENT ' ',
`pic2` varchar(255) default NULL COMMENT ' ',
`userid` int(10) unsigned NOT NULL default '0' COMMENT ' ',
`html` varchar(255) default NULL COMMENT ' ',
`ishtml` tinyint(3) unsigned NOT NULL default '0' COMMENT ' ',
`area` int(10) unsigned NOT NULL default '0' COMMENT ' ',
`custom1` varchar(255) default NULL COMMENT ' 1',
`custom2` varchar(255) default NULL COMMENT ' 2',
`custom3` varchar(255) default NULL COMMENT ' 3',
`custom4` varchar(255) default NULL COMMENT ' 4',
`custom5` varchar(255) default NULL COMMENT ' 5',
`res_id` int(10) unsigned NOT NULL default '0',
`special` varchar(255) default NULL,
`area1` tinyint(1) unsigned NOT NULL default '0',
`area2` tinyint(1) unsigned NOT NULL default '0',
`area3` tinyint(1) unsigned NOT NULL default '0',
`area4` tinyint(1) unsigned NOT NULL default '0',
`area5` tinyint(1) unsigned NOT NULL default '0',
`isvideo` tinyint(1) unsigned NOT NULL default '0' COMMENT ' ',
`notshowlist` tinyint(4) NOT NULL default '0' COMMENT ' ',
`titlecolor` varchar(7) default NULL COMMENT ' ',
`url` varchar(255) default NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Article' AUTO_INCREMENT=87 ;
--
-- `mc_article`
--
INSERT INTO `mc_article` (`id`, `comment`, `comments`, `commentcheck`, `posttime`, `title`, `title2`, `content`, `flag`, `cateid`, `sourceid`, `reurl`, `hits`, `author`, `from`, `keyword`, `order`, `memo`, `pic1`, `pic2`, `userid`, `html`, `ishtml`, `area`, `custom1`, `custom2`, `custom3`, `custom4`, `custom5`, `res_id`, `special`, `area1`, `area2`, `area3`, `area4`, `area5`, `isvideo`, `notshowlist`, `titlecolor`, `url`) VALUES
(1, 0, 0, 0, 0, ' ', '', '<DL>\r
<DD> </DD>\r
<DT><FONT style="BACKGROUND-COLOR: #0000ff" color=#800000>【 】</FONT> <FONT color=#ff0000> </FONT> 、 , 、 。 2008 4 。<BR> <STRONG> , </STRONG> , 。 、 、 、 , 、 , 。<BR> 、 , 、 、 、 。 , , 。 , , 。 , , 。</DT>\r
<P class=clrB></P></DL>', 0, 28, 0, '', 2, '', '', '', 255, '', '', '', 1, NULL, 0, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, 0, 0, 0, 0, '', NULL),
(2, 0, 0, 0, 0, ' ', '', ' ', 1, 28, 0, '', 0, '', '', '', 255, '', '', '', 1, NULL, 0, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, 0, 0, 0, 0, '', NULL),
(3, 0, 0, 0, 0, ' ', '', '<P><IMG alt="" src="http://localhost/article_pic/0912/28/0238278236.jpg" align=left border=0> 。 。 。 。 。 。</P>\r
<P> 。</P>', 0, 28, 0, '', 0, '', '', '', 255, '', '', '', 1, NULL, 0, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, 0, 0, 0, 0, '', NULL),
(4, 0, 0, 0, 0, ' ', '', '<DL>\r
<DD><IMG height=188 src="http://localhost/img/mxz.png" width=188></DD>\r
<DT><SPAN class="mb5 fs14 fwB lh24 borB1S-CCC"> </SPAN> , , 、 。 , , , , , 。<A class=details href="http://localhost/manage/article/add.php?id=3#"></A></DT>\r
<P class=clrB></P></DL>', 1, 28, 0, '', 0, '', '', '', 255, '', '', '', 1, NULL, 0, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, 0, 0, 0, 0, '', NULL),
(5, 0, 0, 0, 0, ' ', '', ' ', 1, 28, 0, '', 0, '', '', '', 255, '', '', '', 1, NULL, 0, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, 0, 0, 0, 0, '', NULL),
(6, 0, 0, 0, 0, ' ', '', ' ', 1, 28, 0, '', 0, '', '', '', 255, '', '', '', 1, NULL, 0, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, 0, 0, 0, 0, '', NULL),
(7, 0, 0, 0, 0, ' ', '', ' ', 1, 28, 0, '', 0, '', '', '', 255, '', '', '', 1, NULL, 0, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, 0, 0, 0, 0, '', NULL),
(8, 0, 0, 0, 0, ' ', '', '<P> <STRONG> </STRONG> <FONT color=#800000> </FONT> <FONT style="BACKGROUND-COLOR: #008000"> </FONT> </P>\r
<P><IMG src="http://localhost//article_pic/0911/30/1431034426.jpg"></P>\r
<P> </P>\r
<P> </P>', 1, 28, 0, '', 9, '', '', '', 255, '', '', '', 1, NULL, 0, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, 0, 0, 0, 0, '', NULL),
(9, 0, 0, 0, 0, 'QQ ', '', '<UL>\r
<LI> :15874233</LI>\r
<LI> :17068255</LI>\r
<LI> :15874233</LI>\r
<LI> :17068255</LI>\r
<LI>realflow :15874233</LI></UL>', 1, 28, 0, '', 1, '', '', '', 255, '', '', '', 1, NULL, 0, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, 0, 0, 0, 0, '', NULL),
(73, 0, 0, 0, 1277028682, ' ', '', '', 2, 30, 0, '', 3, '', '', '', 99, '', '', '', 1, '/article//1006/20/1811352579.html', 1, 0, ' ', '12121', '', '', '', 0, NULL, 0, 0, 0, 0, 0, 0, 0, '', NULL),
(74, 0, 0, 0, 1277028699, ' ', '', '', 2, 31, 0, '', 0, '', '', '', 99, '', '', '', 1, '/article//1006/20/1811471203.html', 1, 0, ' ', '12312321', '', '', '', 0, NULL, 0, 0, 0, 0, 0, 0, 0, '', NULL),
(76, 0, 0, 0, 1277118129, 'testestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestes', '', 'testestetseteste', 2, 39, 0, '', 4, '', '', '', 99, ' ', '', '', 0, '/article//1006/21/1902177805.html', 1, 0, '', '', '', '', '', 0, NULL, 0, 0, 0, 0, 0, 0, 0, '', NULL),
(77, 0, 0, 0, 1277131621, ' ', '', ' ', 1, 28, 0, '', 0, 'Zerolone', ' ', '', 99, '', '', '', 1, '/article//1006/21/2247453051.html', 0, 0, '', '', '', '', '', 0, NULL, 0, 0, 0, 0, 0, 0, 0, '', NULL),
(72, 0, 0, 0, 1277028648, 'sadfsadfsadfdas', '', '', 2, 30, 0, '', 0, '', '', '', 99, '', '', '', 1, '/article//1006/20/1811205532.html', 1, 0, ' ', '10000', '', '', '', 0, NULL, 0, 0, 0, 0, 0, 0, 0, '', NULL),
(14, 0, 0, 0, 0, ' ', '', ' ', 1, 35, 0, '', 0, '', '', '', 255, '', '/article_pic/0912/04/0844078459.jpg', '', 1, NULL, 0, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, 0, 0, 0, 0, '', NULL),
(15, 0, 0, 0, 0, ' ', '', ' ', 1, 35, 0, '', 0, '', '', '', 255, '', '/article_pic/0912/04/0844164124.bmp', '', 1, NULL, 0, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, 0, 0, 0, 0, '', NULL),
(16, 0, 0, 0, 0, ' ', '', '<P> </P>', 1, 35, 0, '', 0, '', '', '', 255, '', '/article_pic/0912/04/0844291726.jpg', '', 1, NULL, 0, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, 0, 0, 0, 0, '', NULL),
(17, 0, 0, 0, 0, ' ', '', '<P> </P>', 1, 35, 0, '', 0, '', '', '', 255, '', '/article_pic/0912/04/0844416262.jpg', '', 1, NULL, 0, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, 0, 0, 0, 0, '', NULL),
(18, 0, 0, 0, 0, ' ', '', '<P> </P>', 1, 35, 0, '', 0, '', '', '', 255, '', '/article_pic/0912/04/0844532108.jpg', '', 1, NULL, 0, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, 0, 0, 0, 0, '', NULL),
(19, 0, 0, 0, 0, ' ', '', '<P> </P>', 1, 35, 0, '', 2, '', '', '', 255, '', '/article_pic/0912/04/0845122279.jpg', '', 1, NULL, 0, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, 0, 0, 0, 0, '', NULL),
(20, 0, 0, 0, 0, ' ', '', '<P> </P>', 1, 35, 0, '', 46, '', '', '', 255, '', '/article_pic/0912/04/1431094003.jpg', '/article_pic/0912/04/1431094003.jpg', 1, NULL, 0, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, 0, 0, 0, 0, '', NULL),
(21, 0, 0, 0, 0, ' ', '', '<P> </P>', 1, 34, 0, '', 2, '', '', '', 255, '', '/article_pic/0912/04/0913295177.jpg', '', 1, NULL, 0, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, 0, 0, 0, 0, '', NULL),
(22, 0, 0, 0, 0, ' 1', '', ' ', 1, 16, 0, '', 22, '', '', '', 255, '', '/article_pic/0912/04/1401331809.jpg', '', 1, NULL, 0, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, 0, 0, 0, 0, '', NULL),
(23, 0, 0, 0, 0, ' 12', '', ' ', 1, 16, 0, '', 0, '', '', '', 255, '', '/article_pic/0912/04/1401463623.jpg', '', 1, NULL, 0, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, 0, 0, 0, 0, '', NULL),
(24, 0, 0, 0, 0, ' 3', '', '<P> </P>', 1, 16, 0, '', 1, '', '', '', 255, '', '/article_pic/0912/04/1402003098.jpg', '', 1, NULL, 0, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, 0, 0, 0, 0, '', NULL),
(25, 0, 0, 0, 0, ' 4', '', '<P> </P>', 1, 16, 0, '', 3, '', '', '', 255, '', '/article_pic/0912/04/1402126768.jpg', '', 1, NULL, 0, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, 0, 0, 0, 0, '', NULL),
(26, 0, 0, 0, 0, ' ', '', '<P> </P>', 1, 36, 0, '', 0, '', '', '', 255, '', '/article_pic/0912/04/1415452249.jpg', '/article_pic/0912/04/1415548027.jpg', 1, NULL, 0, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, 0, 0, 0, 0, '', NULL),
(27, 0, 0, 0, 0, ' ', '', ' , , 。 , , MSN , 、 、 、 、 、 、GE、 , QQ 、 QQ 、MSN 。<BR> , 《 》、《 》、《 》、《 》、《 》 。 《 》 2008 7 , 09 7 9 。 , 。<BR>2008 , “wacom ” “wacom ” , 。<BR> 、 , 、 。 2008 4 。<BR><IMG src="/article_pic/0912/04/1442358107.jpg">', 1, 28, 0, '', 0, '', '', '', 255, '', '', '', 1, NULL, 0, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, 0, 0, 0, 0, '', NULL),
(28, 0, 0, 0, 0, ' 2 2 2 2 2 2 2 2', '', '<P> 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2</P>', 1, 28, 0, '', 2, '', '', '', 255, ' 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2', '/upload/1006/15/1134514548.png', '', 1, '/article//1006/15/1134525311.html', 1, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, 0, 0, 0, 0, '', NULL),
(29, 0, 0, 0, 1276572840, ' 1 1 1 1 1', '', '<P> </P>', 2, 28, 0, '', 6, '', '', '', 255, ' ', '/upload/1006/15/1133493635.png', '', 1, '/article//1006/15/1134008735.html', 1, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, 0, 0, 0, 0, '', NULL),
(30, 0, 0, 0, 0, ' ', '', '<P> </P>', 2, 28, 0, '', 1, '', '', '', 255, '', '', '', 1, NULL, 1, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, 0, 0, 0, 0, '', NULL),
(31, 0, 0, 0, 0, ' ', '', '<P> </P>', 2, 28, 0, '', 1, '', '', '', 255, '', '', '', 1, NULL, 1, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, 0, 0, 0, 0, '', NULL),
(32, 0, 0, 0, 0, ' ', '', '<P> </P>', 2, 28, 0, '', 1, '', '', '', 255, '', '', '', 1, NULL, 1, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, 0, 0, 0, 0, '', NULL),
(33, 0, 0, 0, 0, ' ', '', '<P> </P>', 2, 28, 0, '', 1, '', '', '', 255, '', '', '', 1, NULL, 1, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, 0, 0, 0, 0, '', NULL),
(34, 0, 0, 0, 0, ' ', '', '<P> </P>', 2, 28, 0, '', 2, '', '', '', 255, '', '', '', 1, NULL, 1, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, 0, 0, 0, 0, '', NULL),
(35, 0, 0, 0, 1276572301, ' ', '', '<P> </P>', 2, 28, 0, '', 2, '', '', '', 255, '', '', '', 1, '/article//1006/15/1125011128.html', 1, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, 0, 0, 0, 0, '', NULL),
(36, 0, 0, 0, 1276571931, ' China English AllArticle Review', '', '<P> </P>', 1, 28, 0, '111111111', 3, ' ', 'China', '', 1, '', '', '', 1, '/article//1006/15/1118525811.html', 1, 0, '', '', '', '', '', 0, NULL, 0, 0, 0, 0, 0, 0, 0, '', NULL),
(37, 0, 0, 0, 0, ' ', '', ' ', 1, 7, 0, '', 0, '', '', '', 255, '', '', '', 1, NULL, 0, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, 0, 0, 0, 0, '', NULL),
(38, 0, 0, 0, 0, ' ', '', ' ', 1, 7, 0, '', 2, '', '', '', 255, '', '', '', 1, NULL, 0, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, 0, 0, 0, 0, '', NULL),
(39, 0, 0, 0, 0, ' ', '', ' ', 1, 7, 0, '', 0, '', '', '', 255, '', '', '', 1, NULL, 0, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, 0, 0, 0, 0, '', NULL),
(40, 0, 0, 0, 0, ' ', '', '', 1, 5, 0, '/lyrics.php', 0, '', '', '', 255, '', '', '', 1, NULL, 0, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, 0, 0, 0, 0, '', NULL),
(41, 0, 0, 0, 0, ' ', '', ' ', 1, 5, 0, '', 0, '', '', '', 255, '', '', '', 1, NULL, 0, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, 0, 0, 0, 0, '', NULL),
(42, 0, 0, 0, 0, ' ', '', ' ', 1, 5, 0, '', 4, '', '', '', 255, '', '', '', 1, NULL, 0, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, 0, 0, 0, 0, '', NULL),
(84, 0, 0, 0, 1277559750, ' ', '', '<P> </P>\r
<P> </P>\r
<P> </P>\r
<P> </P>\r
<P> </P>\r
<P> </P>\r
<P> 1111111111 </P>\r
<P> 222222222222222222 <IMG height=250 alt="" src="/upload/1006/21/2312095366.jpg" width=324></P>\r
<P></P>\r
<P> 33333333 。</P>', 1, 39, 0, '', 27, 'Zerolone', 'Us', 'aaaa', 99, '', '', '', 0, '/article//1006262142309349.html', 1, 0, '', '', '', '', '', 0, NULL, 0, 0, 0, 0, 0, 0, 0, '', NULL),
(48, 0, 0, 0, 1277132550, ' 3', '', '<P> 3</P>\r
<P> 3</P>\r
<P> 3</P>\r
<P> 3</P>\r
<P> 3</P>\r
<P> 3</P>\r
<P> 3</P>\r
<P> 3</P>\r
<P> 3</P>\r
<P> 3</P>\r
<P> 3</P>\r
<P> 3</P>\r
<P> 3</P>\r
<P> 3</P>\r
<P> 3</P>\r
<P> 3</P>\r
<P> 3</P>\r
<P> 3</P>\r
<P> 3</P>\r
<P> 3</P>\r
<P> 3</P>\r
<P> 3</P>\r
<P> 3</P>\r
<P> 3</P>\r
<P> 3</P>\r
<P> 3</P>\r
<P> 3</P>\r
<P> 3</P>\r
<P> 3</P>\r
<P> 3</P>\r
<P> 3</P>\r
<P> 3</P>\r
<P> 3</P>\r
<P> 3</P>\r
<P> 3</P>\r
<P> 3</P>\r
<P> 3</P>\r
<P> 3</P>\r
<P> 3</P>\r
<P> 3</P>\r
<P> 3</P>\r
<P> 3</P>\r
<P> 3</P>\r
<P> 3</P>\r
<P> 3</P>', 2, 28, 0, 'aaa.php', 1, '', '', '', 255, ' 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3', '', '', 1, '/article//1006/21/2302306528.html', 1, 0, '', '', '', '', '', 0, NULL, 0, 0, 0, 0, 0, 0, 0, '', NULL),
(49, 0, 0, 0, 1277132514, ' ', '', '<P> <FONT face= > </FONT><FONT face= _GB2312 size=6> <FONT size=3> </FONT><FONT size=7> <FONT color=#800000> <FONT color=#000000><FONT size=6> </FONT><FONT size=3> </FONT></FONT><FONT size=7><FONT color=#000000> </FONT><FONT color=#800000> <FONT color=#000000><FONT size=6> </FONT><FONT size=3> </FONT></FONT><FONT size=7><FONT color=#000000> </FONT><FONT color=#800000> </FONT></FONT></FONT></FONT></FONT></FONT></FONT><FONT size=7> </FONT> </P>\r
<P> <STRONG> </STRONG> </P>', 2, 1, 0, '', 11, '', '', '', 255, '', '', '', 1, '/article//1006/21/2301543267.html', 1, 0, '', '', '', '', '', 0, NULL, 0, 0, 0, 0, 0, 0, 0, '', NULL),
(50, 0, 0, 0, 1277132501, ' 2', '', ' 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2', 2, 1, 0, '', 6, '', '', '', 255, '', '', '', 1, '/article//1006/21/2301418250.html', 1, 0, '', '', '', '', '', 0, NULL, 0, 0, 0, 0, 0, 0, 0, '', NULL),
(51, 0, 0, 0, 1277132482, ' 1', '', ' 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1', 2, 1, 0, '', 18, '', '', '', 255, '', '', '', 1, '/article//1006/21/2301226130.html', 1, 0, '', '', '', '', '', 0, NULL, 0, 0, 0, 0, 0, 0, 0, '', NULL),
(53, 0, 0, 0, 1276570387, ' ', '', ' <FONT color=#ff0000> </FONT> <STRONG> </STRONG> ', 2, 28, 0, '', 0, '', '', '', 2, '', '', '', 1, '/article//1006/15/1049558883.html', 1, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, 0, 0, 0, 0, '', NULL),
(75, 0, 0, 0, 1277041879, ' ', '', ' ', 2, 38, 0, '', 0, '', '', '', 99, '', '/upload/1006/20/2151417687.jpg', '', 1, '/article//1006/20/2151438545.html', 1, 0, '', '', '', '', '', 0, NULL, 0, 0, 0, 0, 0, 0, 0, '', NULL),
(57, 0, 0, 0, 1276567102, '1、 ', '', '<P><A href="http://localhost/build_info.php?id=60#">1、 </A> </P>\r
<P><A href="http://localhost/build_info.php?id=60#"></A> </P>', 2, 38, 0, '', 12, 'Zerolone', 'China', '', 1, '', '', '', 1, '/article//1006/15/0958238672.html', 1, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, 0, 0, 0, 0, '', NULL),
(58, 1, 10, 0, 1276091400, ' - - 10 ', '', '<IMG src="http://localhost/upload/1006/09/2000133895.gif">', 2, 39, 0, '', 3, ' ', 'China', '', 255, '', '', '', 1, '/article//1006/09/2156568810.html', 1, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, 0, 0, 0, 0, '', NULL),
(59, 0, 0, 0, 1276092641, ' - ', '', ' - - 5 - - 5 - - 5 - - 5 ', 2, 39, 0, '', 0, '', '', '', 255, '', '', '', 1, '/article//1006/09/2211306069.html', 1, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, 0, 0, 0, 0, '', NULL),
(60, 1, 3, 1, 1276092641, ' - - 3 ', '', ' - - 3 - - 3 - - 3 - - 3 - - 3 - - 3 ', 2, 39, 0, '', 2, '', '', '', 255, '', '', '', 1, '/article//1006/09/2211373089.html', 1, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, 0, 0, 0, 0, '', NULL),
(61, 1, 11, 1, 1276567135, '2、 、 ', '', '<A href="http://localhost/build_info.php?id=60#">2、 、 </A>', 2, 38, 0, '', 0, ' ', 'China', '', 2, '', '', '', 1, '/article//1006/15/0959101794.html', 1, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, 0, 0, 0, 0, '', NULL),
(62, 1, 3, 1, 1276567135, '3、 ', '', '<A href="http://localhost/build_info.php?id=60#">3、 </A> ', 2, 38, 0, '', 2, '', '', '', 3, '', '', '', 1, '/article//1006/15/0959241646.html', 1, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, 0, 0, 0, 0, '', NULL),
(63, 0, 0, 0, 1276567135, '4、 ', '', '<U><FONT color=#800080>4、 </FONT></U>', 2, 38, 0, '', 0, '', '', '', 4, '', '', '', 1, '/article//1006/15/1003181891.html', 1, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, 0, 0, 0, 0, '', NULL),
(67, 0, 0, 0, 1276567500, '5、 ', '', '<U><FONT color=#800080>5、 </FONT></U>', 2, 38, 0, '', 0, '', '', '', 5, '', '', '', 1, '/article//1006/15/1005471305.html', 1, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, 0, 0, 0, 0, '', NULL),
(68, 0, 0, 0, 1276567550, '6、 ', '', '<U><FONT color=#800080>6、 </FONT></U>', 2, 38, 0, '', 0, '', '', '', 6, '', '', '', 1, '/article//1006/15/1005599659.html', 1, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, 0, 0, 0, 0, '', NULL),
(69, 0, 0, 0, 1277028113, ' xxxxxxxx', '', '', 2, 29, 0, '', 1, '', '', '', 99, '', '', '', 1, '/article//1006/20/1802538786.html', 1, 0, '32 ', '', '', '', '', 0, NULL, 0, 0, 0, 0, 0, 0, 0, '', NULL),
(70, 0, 0, 0, 1277028175, '1sdafadsfa', '', '', 2, 29, 0, '', 0, '', '', '', 99, '', '', '', 1, '/article//1006/20/1803088642.html', 1, 0, '99 ', '', '', '', '', 0, NULL, 0, 0, 0, 0, 0, 0, 0, '', NULL),
(71, 0, 0, 0, 1277028189, ' ', '', '', 2, 29, 0, '', 0, '', '', '', 99, '', '', '', 1, '/article//1006/20/1803414657.html', 1, 0, '198 ', '', '', '', '', 0, NULL, 0, 0, 0, 0, 0, 0, 0, '', NULL),
(80, 1, 3, 1, 1277543456, '111111111111', NULL, 'asfadsfas3432432', 1, 4, 0, NULL, 0, NULL, NULL, '', 99, NULL, NULL, NULL, 112929, NULL, 0, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, 0, 0, 0, 0, NULL, NULL),
(81, 1, 3, 1, 1277543472, '111111111111', NULL, 'asfad[b]sfas3[/b]432432[z_newline]safdsaffdsaf[z_newline]sadfsafasfasfsafas[z_newline]adsfad[i]sfdsafafa[/i]fsfsf', 1, 4, 0, NULL, 0, NULL, NULL, '', 99, NULL, NULL, NULL, 112929, NULL, 0, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, 0, 0, 0, 0, NULL, NULL),
(83, 1, 3, 1, 1277543825, '1111111111111222222', NULL, 'asfad[b]sfas3[/b]432432[z_newline]safdsaffdsaf[z_newline]sadfsafasfasfsafas[z_newline]adsfad[i]sfdsafafa[/i]fsfsf', 2, 4, 0, NULL, 10, NULL, NULL, '', 99, NULL, NULL, NULL, 112929, '/article//1006/26/1717055304.html', 1, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, 0, 0, 0, 0, NULL, NULL),
(85, 0, 0, 0, 1279628931, 'asdf', NULL, 'dsaffddsafas', 1, 1, 0, NULL, 0, NULL, NULL, NULL, 99, NULL, NULL, NULL, 112929, '/article//1007/20/2028517174.html', 0, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, 0, 0, 0, 0, NULL, NULL);
分類構造
-- --------------------------------------------------------
--
-- `mc_article_cate`
--
CREATE TABLE IF NOT EXISTS `mc_article_cate` (
`id` int(10) unsigned NOT NULL auto_increment,
`parentid` int(10) default NULL,
`level` char(50) default NULL,
`title` char(100) default NULL,
`templateid` int(10) default NULL,
`forumid` int(10) default NULL,
`catetemplateid` int(10) default NULL,
`dir` char(100) default NULL,
`kind` tinyint(4) default '0' COMMENT ' ',
`pagesize` tinyint(4) default '0' COMMENT ' ',
`specialid` int(10) default '0' COMMENT ' ',
`url` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='cate' AUTO_INCREMENT=40 ;
--
-- `mc_article_cate`
--
INSERT INTO `mc_article_cate` (`id`, `parentid`, `level`, `title`, `templateid`, `forumid`, `catetemplateid`, `dir`, `kind`, `pagesize`, `specialid`, `url`) VALUES
(1, 0, '01', ' ', 9, NULL, 9, '/test/', 0, 0, 0, ''),
(3, 0, '03', ' ', NULL, NULL, NULL, 'getbuild', 0, 0, 0, ''),
(4, 0, '04', ' ', NULL, NULL, NULL, '/asdf/', 0, 0, 0, ''),
(5, 0, '05', ' ', NULL, NULL, NULL, NULL, 0, 0, 0, ''),
(6, 0, '06', ' ', NULL, NULL, NULL, NULL, 0, 0, 0, ''),
(7, 0, '07', ' ', NULL, NULL, NULL, NULL, 0, 0, 0, ''),
(38, 0, '17', ' ', 2, NULL, 2, 'baodian', 0, 0, 0, ''),
(25, 6, '0601', ' ', NULL, NULL, NULL, NULL, 0, 0, 0, 'works.php'),
(26, 6, '0602', ' ', NULL, NULL, NULL, NULL, 0, 0, 0, 'works.php'),
(28, 0, '08', ' ', NULL, NULL, NULL, NULL, 0, 0, 0, ''),
(29, 3, '0301', ' ', NULL, NULL, NULL, 'getbuild/new', 0, 0, 0, ''),
(30, 3, '0302', ' ', NULL, NULL, NULL, 'getbuild/this', 0, 0, 0, ''),
(31, 3, '0303', ' ', NULL, NULL, NULL, 'getbuild/next', 0, 0, 0, ''),
(32, 25, '060101', ' ', NULL, NULL, NULL, NULL, 0, 0, 0, ''),
(33, 25, '060102', ' ', NULL, NULL, NULL, NULL, 0, 0, 0, ''),
(34, 25, '060103', ' ', NULL, NULL, NULL, NULL, 0, 0, 0, ''),
(35, 25, '060104', ' ', NULL, NULL, NULL, NULL, 0, 0, 0, ''),
(36, 26, '060201', ' ', NULL, NULL, NULL, NULL, 0, 0, 0, ''),
(39, 1, '0101', 'sf', 9, NULL, 2, '/test/sub/', 0, 0, 0, '');
ビューコード:
-- `mc_view_article`
CREATE VIEW `mc_view_article` AS select `mc_article`.`id` AS `id`,`mc_article`.`comment` AS `comment`,`mc_article`.`comments` AS `comments`,`mc_article`.`commentcheck` AS `commentcheck`,`mc_article`.`posttime` AS `posttime`,`mc_article`.`title` AS `title`,`mc_article`.`title2` AS `title2`,`mc_article`.`content` AS `content`,`mc_article`.`flag` AS `flag`,`mc_article`.`cateid` AS `cateid`,`mc_article`.`sourceid` AS `sourceid`,`mc_article`.`reurl` AS `reurl`,`mc_article`.`hits` AS `hits`,`mc_article`.`author` AS `author`,`mc_article`.`from` AS `from`,`mc_article`.`keyword` AS `keyword`,`mc_article`.`order` AS `order`,`mc_article`.`memo` AS `memo`,`mc_article`.`pic1` AS `pic1`,`mc_article`.`pic2` AS `pic2`,`mc_article`.`userid` AS `userid`,`mc_article`.`html` AS `html`,`mc_article`.`ishtml` AS `ishtml`,`mc_article`.`area` AS `area`,`mc_article`.`custom1` AS `custom1`,`mc_article`.`custom2` AS `custom2`,`mc_article`.`custom3` AS `custom3`,`mc_article`.`custom4` AS `custom4`,`mc_article`.`custom5` AS `custom5`,`mc_article`.`res_id` AS `res_id`,`mc_article`.`special` AS `special`,`mc_article`.`area1` AS `area1`,`mc_article`.`area2` AS `area2`,`mc_article`.`area3` AS `area3`,`mc_article`.`area4` AS `area4`,`mc_article`.`area5` AS `area5`,`mc_article`.`isvideo` AS `isvideo`,`mc_article`.`titlecolor` AS `titlecolor`,`mc_article`.`url` AS `url`,`mc_article`.`notshowlist` AS `notshowlist`,`mc_article_cate`.`parentid` AS `parentid`,`mc_article_cate`.`level` AS `level`,`mc_article_cate`.`title` AS `ctitle`,`mc_article_cate`.`templateid` AS `templateid`,`mc_article_cate`.`forumid` AS `forumid`,`mc_article_cate`.`catetemplateid` AS `catetemplateid`,`mc_article_cate`.`dir` AS `dir`,`mc_article_cate`.`kind` AS `kind`,`mc_article_cate`.`pagesize` AS `pagesize`,`mc_article_cate`.`specialid` AS `specialid`,`mc_article_cate`.`url` AS `curl` from (`mc_article` join `mc_article_cate` on((`mc_article`.`cateid` = `mc_article_cate`.`id`)));