createhtml.inc.php

来自「采用模块化开发」· PHP 代码 · 共 69 行

PHP
69
字号
<?php
defined('IN_PHPCMS') or exit('Access Denied');

@set_time_limit(600);

$channelid = intval($channelid);
$channelid or showmessage($LANG['illegal_parameters'], $referer);

require_once PHPCMS_ROOT.'/module/'.$mod.'/include/global.func.php';
require_once PHPCMS_ROOT.'/module/'.$mod.'/include/area.class.php';

$referer=isset($referer) ? $referer : "?mod=$mod&file=$file&channelid=$channelid";

if(isset($action) && strpos($action, ','))
{
	$actions=explode(',', $action);
	$action=$actions[0];
	unset($actions[0]);
	$actions=implode(',', $actions);
	$referer='?mod='.$mod.'&file='.$file.'&action='.$actions.'&channelid='.$channelid;
}

switch($action){

case 'index':

	createhtml("index");
	showmessage($LANG['channel_home_update_success'], $referer);
	break;

case 'list'://鏍忕洰

	if(isset($_SESSION['temp_cat_name'.$mod]))
	{
		include PHPCMS_ROOT.'/data/temp/'.$_SESSION['temp_cat_name'.$mod];
		$catids = array_shift($cats_array);
		if(!$catids)
		{
			unlink(PHPCMS_ROOT.'/data/temp/'.$_SESSION['temp_cat_name'.$mod]);
			unset($_SESSION['temp_cat_name'.$mod]);
			showmessage($LANG['update_success'],'?mod='.$mod.'&file=createhtml&channelid='.$channelid);
		}
		array_save($cats_array,"\$cats_array",PHPCMS_ROOT.'/data/temp/'.$_SESSION['temp_cat_name'.$mod]);
		$referer = '?mod='.$mod.'&file='.$file.'&action='.$action.'&channelid='.$channelid;
	}
	if(empty($catids) && !isset($catidss))
	{
		$catids = array();
		foreach($CATEGORY as $r)
		{
			$catids[]=$r['catid'];
		}
	}

	if(is_array($catids))
	{
		$_SESSION['temp_cat_name'.$mod] = 'T'.$PHP_TIME.'.php';
		array_save($catids,"\$cats_array",PHPCMS_ROOT.'/data/temp/'.$_SESSION['temp_cat_name'.$mod]);
		showmessage($LANG['updating'].$LANG['category'],'?mod='.$mod.'&file='.$file.'&action='.$action.'&channelid='.$channelid);
	}
	elseif(is_numeric($catids))
	{
		$catid = $catids;//
		createhtml('list');
		showmessage($LANG['category'].' ['.$CATEGORY[$catids]['catname'].'] '.$LANG['update_success'], $referer);
	}
	break;

case 'per_list'://鍒嗘

⌨️ 快捷键说明

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