无为清净楼资源网 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> 
标签:
|用文|文本|本文|文件|件实|实现|现的|的动|动态|态实|实时|时发|发布|布新|新闻|闻的|的程|程序|序|

无为清净楼资源网 Design By www.qnjia.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 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%。