无为清净楼资源网 Design By www.qnjia.com
动态实时发布新闻的程序,可以根据发布时间,自动地排列显示顺序。新闻文件为存储在指定目录的文本文件组成,当有新闻的时候,程序会自动地将其显示出来,并且排列在页面的最开始部分。
<html>
<head>
<title>News</title>
</head>
<body bfcolor="#ffffff">
<h1>News</h1>
<div aligh="center">
<table border="0" cellspacing="5" cellpadding="10" width="90%" bgcolor="#e0e0e0">
<?php
include('locationfilename.php');
function createur1($text){
//新闻的文本文件中这样插入你的链接
//${http://mysite.ch}
//或是${http://mysite.ch|My homepage in}
//开始处理文本文件部分
$s=$text;
$a=strstr($s,'${');
if ($a){
$b=strstr($a,'}');
if ($b){
$la=strlen($a); $ls=strlen($s);
$s=substr($s,0,$ls-$la);
$a=substr($a,2);
$lb=strlen($b); $la=strlen($a);
$a=substr($a,0,$la-$lb); $b=substr($b,1);
$ta=strstr($a,"|");
if($ta){
$la=strlen($a); $lt=strlen($ta);
$linktext=substr($a,$la-$lt+1);
$a=substr($a,0,$la-$lt);
}
else{
$linktext=$a;
}
$s=$s."<a href="".$a."">".$linktext."</a>".$b;
}
}
return($s);
}
//在这里修改你的新闻文件存放目录
//切记,新闻文件必须是文本文件
$newspath="/home/htdocs/test/new/";
//设置数组
$newsfile=array();
//设置目录把柄
$hd=dir($newspath);
//获取全部文件,并将其存放在数组中
while($filename=$hd->read() ){
$s=strtolower($filename);
if (strstr($s,".txt")){
//检测最新修改日期
$lastchanged=filemtime($newspath.$filename);
$newsfile[$filename]=$lastchanged;
}
}
//文件排序
arsort($newsfile);
//输出文件
for(reset($newsfile); $key=key($newsfile); next($newsfile)){
$fa=file($newspath.$key);
$n=count($fa);
print "<tr><td>n";
print "<b>".date("d.m.Y - H:i:s",$newsfile[$key])."</b><br>n";
for($i=0; $i<$n; $i=$i+1){
$s=chop($fa[$i]);
$s=htmlspecialchars($s);
$s=createur1($s);
print $s."<br>n";
}
print "</td></tr>";
}
$hd->close();
?>
</body>
</html>
<html>
<head>
<title>News</title>
</head>
<body bfcolor="#ffffff">
<h1>News</h1>
<div aligh="center">
<table border="0" cellspacing="5" cellpadding="10" width="90%" bgcolor="#e0e0e0">
<?php
include('locationfilename.php');
function createur1($text){
//新闻的文本文件中这样插入你的链接
//${http://mysite.ch}
//或是${http://mysite.ch|My homepage in}
//开始处理文本文件部分
$s=$text;
$a=strstr($s,'${');
if ($a){
$b=strstr($a,'}');
if ($b){
$la=strlen($a); $ls=strlen($s);
$s=substr($s,0,$ls-$la);
$a=substr($a,2);
$lb=strlen($b); $la=strlen($a);
$a=substr($a,0,$la-$lb); $b=substr($b,1);
$ta=strstr($a,"|");
if($ta){
$la=strlen($a); $lt=strlen($ta);
$linktext=substr($a,$la-$lt+1);
$a=substr($a,0,$la-$lt);
}
else{
$linktext=$a;
}
$s=$s."<a href="".$a."">".$linktext."</a>".$b;
}
}
return($s);
}
//在这里修改你的新闻文件存放目录
//切记,新闻文件必须是文本文件
$newspath="/home/htdocs/test/new/";
//设置数组
$newsfile=array();
//设置目录把柄
$hd=dir($newspath);
//获取全部文件,并将其存放在数组中
while($filename=$hd->read() ){
$s=strtolower($filename);
if (strstr($s,".txt")){
//检测最新修改日期
$lastchanged=filemtime($newspath.$filename);
$newsfile[$filename]=$lastchanged;
}
}
//文件排序
arsort($newsfile);
//输出文件
for(reset($newsfile); $key=key($newsfile); next($newsfile)){
$fa=file($newspath.$key);
$n=count($fa);
print "<tr><td>n";
print "<b>".date("d.m.Y - H:i:s",$newsfile[$key])."</b><br>n";
for($i=0; $i<$n; $i=$i+1){
$s=chop($fa[$i]);
$s=htmlspecialchars($s);
$s=createur1($s);
print $s."<br>n";
}
print "</td></tr>";
}
$hd->close();
?>
</body>
</html>
无为清净楼资源网 Design By www.qnjia.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
无为清净楼资源网 Design By www.qnjia.com
暂无评论...
RTX 5090要首发 性能要翻倍!三星展示GDDR7显存
三星在GTC上展示了专为下一代游戏GPU设计的GDDR7内存。
首次推出的GDDR7内存模块密度为16GB,每个模块容量为2GB。其速度预设为32 Gbps(PAM3),但也可以降至28 Gbps,以提高产量和初始阶段的整体性能和成本效益。
据三星表示,GDDR7内存的能效将提高20%,同时工作电压仅为1.1V,低于标准的1.2V。通过采用更新的封装材料和优化的电路设计,使得在高速运行时的发热量降低,GDDR7的热阻比GDDR6降低了70%。
更新日志
2024年09月21日
2024年09月21日
- 《刘若英 滚石SACD精选》[ISO][1GB]
- 仙境传说新启航牧师怎么加点 牧师属性技能加点推荐
- 仙境传说新启航舞娘怎么加点 舞娘属性技能加点推荐
- 魔兽世界祖尔格拉布在哪 魔兽世界祖尔格拉布位置介绍
- 群星《名列前茅五大顶级发烧男声》2CD[DTS-WAV]
- 群星《经典再现·国语女声》2CD[DTS-WAV]
- 群星《十大民歌天后》2CD[DTS-WAV分轨]
- 《黑神话:悟空》浮屠牢是最糟糕的部分:但也是做得最好的
- 《艾诺提亚:失落之歌》PC版反向跳票!9月17日PC开玩
- 老外谈《黑神话:悟空》:在我心里10分 但它确实是8分游戏
- 陈秋霞.1977-温馨在我心(LP版)【歌林】【WAV+CUE】
- 张秀卿.2019-感情骗子【豪记】【WAV+CUE】
- 林隆璇.1993-收藏昨日【福茂】【WAV+CUE】
- 魔兽世界wlk德拉诺金钻如何获得 wlk德拉诺金钻获取方法介绍
- 魔兽世界wlk祖阿曼战熊如何获得 wlk祖阿曼战熊获取方式介绍