<?php ob_start(); echo "Hello World!"; $content = ob_get_contents();//取得php页面输出的全部内容 $fp = fopen("archives/2005/05/19/0001.html", "w"); fwrite($fp, $content); fclose($fp); ?>
都在上面了其他我就不说了!有问题留言,回复周期较长。
<?php //使用方法,在后台任意一个栏目添加一个其他页面的 模板,此文件为模板页面。 //然后直接访问你增加的模板页面既可以生产全部文章的静态。生成完成后关闭此页即可 // 有问题联系QQ3216572 或者上网站 ucms.vip $gid =(int)$_GET['page']; if(empty($gid)){ echo "<script>location.href='?page=1'</script>"; }else{ $gid++ ?> {$set=array()} {$set['cids']=1;2;3;4;5;6;7;8;9;10;11;12} {$set['pagesize']=10} {$set['page']=page} {$articles=alist($set)} {loop $articles['list'] as $a} {host}{$a['link']}<br> {$a1=$a['link']} <?php $alen=strlen($a1); ?> {if $alen>5} {$turl=$a['link']} <?php $pats = pathinfo($turl); $dir = $pats['dirname'].'/'; if(!is_dir($dir)) { @mkdirs($dir, 0777); // @fclose(fopen($dir.'/index.htm', 'w')); } $url2="你的域名http://baidu.com_addref".$turl; $content = file_get_contents($url2); $fp = fopen(".".$turl, "a+"); fwrite($fp, $content); fclose($fp); ?> {else} <?php exit("生成文章结束"); ?> {/if} {/loop} <?php echo "<script>location.href='?page=".$gid."'</script>"; } function mkdirs($pathname, $mode = 0755){ is_dir(dirname($pathname)) || mkdirs(dirname($pathname), $mode); return is_dir($pathname) || @mkdir($pathname, $mode); } ?>