⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 article.php

📁 phpcms网站管理系统  很不错的 有需要的就下载看看八 
💻 PHP
字号:
<?php
/*
*####################################################
* PHPCMS v3.0.0 - Advanced Content Manage System.
* Copyright (c) 2005-2006 phpcms.cn
*
* For further information go to http://www.phpcms.cn/
* This copyright notice MUST stay intact for use.
*####################################################
*/
if(!$_CHA[htmlcreatetype]) return false;

$articleid = intval($articleid);
if(!$articleid) return false;

$r = $db->get_one("SELECT * FROM ".TABLE_ARTICLE." WHERE articleid=$articleid and channelid=$channelid");
if(!$r['articleid']) return false;
@extract($r);

if($linkurl)
{
	$p->set_type("path");
	$filepath = $p->get_itemurl($articleid,$addtime);
	$f->create(dirname($filepath));
	file_write($filepath,"<script language='javascript'>location.href='".$linkurl."';</script>");
	return true;
}

$templateid = $templateid ? $templateid : $_CAT['defaultitemtemplate'];
$skinid = $skinid ? $skinid : $_CAT['defaultitemskin'];
$skindir = $skinid ? PHPCMS_PATH."skin/".$skinid : $skindir;

$p->set_catid($catid);
$adddate = date('Y-m-d H:i:s',$addtime);
$position = cat_posurl($catid);

$p->set_type("url");
$itemurl = "http://".$PHP_DOMAIN.$p->get_itemurl($articleid,$addtime);

$meta_title = $title."-".$_CHA['channelname'];
$meta_keywords = $keywords.",".$_CAT['meta_keywords'].",".$_CHA['meta_keywords'].",".$_CHA['channelname'];
$meta_description = $_CAT['meta_description']."-".$_CHA['meta_description']."-".$_CHA['channelname'];

if($paginationtype==1)
{
	$charnumber = strlen($content);
	$pagenumber = ceil($charnumber/$maxcharperpage);
	$contents = $content;
}
elseif($paginationtype==2)
{
	$contents = explode('[next]',$content);
	$pagenumber = count($contents);
}

if($pagenumber>1)
{
	for($i=0;$i<$pagenumber;$i++)
	{
		$page = $i+1;
		if($paginationtype==1)
		{
			$start = $i*$maxcharperpage;
			$end = $page*$maxcharperpage;
			$end = $end > $charnumber ? $charnumber : $end;
			$content = get_substr($contents,$start,$end);
		}
		elseif($paginationtype==2)
		{
			$content = $contents[$i];
		}
		ob_start();
		$p->set_type("url");
		$pages = articlepage($articleid,$addtime,$pagenumber,$page);
		include template($templateid,"article","content");
		$data = ob_get_contents();
		ob_clean();
		$p->set_type("path");
		$filepath = $p->get_itemurl($articleid,$addtime,$page);
		$f->create(dirname($filepath));
		file_write($filepath,$data);
	}
}
else
{
	ob_start();
	$p->set_type("url");
	include template($templateid,"article","content");
	$data = ob_get_contents();
	ob_clean();
	$p->set_type("path");
	$filepath = $p->get_itemurl($articleid,$addtime);
	$f->create(dirname($filepath));
	file_write($filepath,$data);
}

return TRUE;
?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -