php.net新闻拦截!

<script type="text/javascript"> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
<script type="text/javascript"> </script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
<?
//请自己修改下面变量.
$newsnum=7;
$space=20;
$width=400;
$headclass="class5";
$lowerclass="class6";
//变量设置结束.

print "<html><head><link rel=stylesheet href=dark.css></head><body>";

$opened=$QUERY_STRING;
if ($opened=="") { $opened="-1"; }

print "<table><tr><td class=class5><a target=_blank href=http://www.php.net>www.php.net</a></td></tr>";

$file=file('http://www.php.net');

$where="";
$a=0;
while ($a<count($file)) {
    $file[$a]=chop ($file[$a]);
    if ($file[$a]=="<!--http://www.php.net/-->") {
        $where=$a;
        break 1;
    }
    $a++;
}

$file=file('http://www.php.net');
$a=$where+1;
$b=0;
while ($b<$newsnum) {
      if (substr($file[$a],0,4)=="<h3>" & substr($file[$a],-6,5)=="</h3>" | substr($file[$a],0,4)=="<h3>" & substr($file[$a],-7,5)=="</h3>") {
        $from=$to;
         $to=$a;
    }

    if ($to==$a & $from!="") {
        $c=$from;
        if ($b==$opened) {
            while ($c<$to) {
                if (substr($file[$c],0,9)=="<img src=") {
                    $file[$c]="";
                }
                $file[$c]=eregi_replace("src="","src="http://www.php.net/",$file[$c]);
                $file[$c]=eregi_replace("href="","href="http://www.php.net/",$file[$c]);
                $file[$c]=eregi_replace("<h3>","</td></tr><tr><td width=$width class=$headclass><a href=$php_SELF?-1>",$file[$c]);
                $file[$c]=eregi_replace("</h3>","</a></td></tr><tr><td width=$width class=$lowerclass>",$file[$c]);
                print $file[$c];
                $c++;
            }
        } else {
            if (substr($file[$c],0,9)=="<img src=") {
                $file[$c]="";
            }
            $file[$c]=eregi_replace("src="","src="http://www.php.net/",$file[$c]);
            $file[$c]=eregi_replace("href="","href="http://www.php.net/",$file[$c]);
            $file[$c]=eregi_replace("<h3>","</td></tr><tr><td width=$width class=$headclass><a href="$php_SELF?$b">",$file[$c]);
            $file[$c]=eregi_replace("</h3>","</a></td></tr><tr><td width=$width class=$lowerclass>",$file[$c]);
            print $file[$c];
        }
        $b++;
    }
    $a++;
}
print "</table>";
print "</body></head>";
?>  
<script type="text/javascript"> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
<script type="text/javascript"> </script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值