function Article($id) { $app = iCMS::run('article', 'article', 'object'); $htm = $app->article($id); $htm or iPHP::alert("文章所属栏目URL规则设置问题! 此栏目下的文章不能生成静态,请修改栏目的访问模式和URL规则"); $total = $htm[1]['page']['total']; $title = $htm[1]['title']; iFS::check_ext($htm[1]['iurl']->path) or iPHP::alert("文件类型不合法,禁止生成!<hr />请更改栏目->URL规则设置->内容规则"); iFS::mkdir($htm[1]['iurl']->dir); iFS::write($htm[1]['iurl']->path, $htm[0]); if ($total >= 2) { for ($ap = 2; $ap <= $total; $ap++) { $htm = $app->article($id, $ap); $fpath = iPHP::p2num($htm[1]['iurl']->pagepath, $ap); iFS::write($fpath, $htm[0]); } } unset($app, $htm); return $title; }
<?php /** * iCMS - i Content Management System * Copyright (c) 2007-2012 idreamsoft.com iiimon Inc. All rights reserved. * * @author coolmoo <*****@*****.**> * @site http://www.idreamsoft.com * @licence http://www.idreamsoft.com/license.php * @version 6.0.0 * @$Id: category.php 179 2013-03-29 03:21:28Z coolmoo $ */ require dirname(__FILE__) . '/iCMS.php'; iCMS::run();