is a PHP script designed to place linuxfreak.org news headlines into your site.

Source: Internet
Author: User
Tags chop include php script
<?php

Bi Bolo monggole Huen!
//
v2.0.5
?
Include ("linuxfreak.php3");
?>
dreamphp boy = Sunboy

$link _prefix = "O";
$link _postfix = "<br>n";
$cache _file = "/tmp/linuxfreak2.cache";
$cache _time = 1200;
$max _items = 8;
$target = "_top";

End of customizations


$backend = "HTTP://WWW.LINUXFREAK.ORG/BACKEND/LINUXFREAK.RDF";

$items = 0;
$time = Split ("", Microtime ());

Srand (Double) microtime () *1000000);
$cache _time_rnd = 300-rand (0, 600);

if ((!) ( File_exists ($cache _file)) | | ((Filectime ($cache _file) + $cache _time-$time [1]) + $cache _time_rnd < 0) | | (! (FileSize ($cache _file)) ) {

$fpread = fopen ($backend, ' R ');
if (! $fpread) {
} else {

$fpwrite = fopen ($cache _file, ' W ');
if (! $fpwrite) {
} else {

while (! feof ($fpread)) {

$buffer = LTrim (Chop (fgets ($fpread, 256));

if (($buffer = = "<item>") && ($items < $max _items)) {
$title = LTrim (Chop (fgets ($fpread, 256));
$link = LTrim (Chop (fgets ($fpread, 256));

$title = ereg_replace ("<title>", "", $title);
$title = ereg_replace ("</title>", "", $title);
$link = ereg_replace ("<link>", "", $link);
$link = ereg_replace ("</link>", "", $link);

Fputs ($fpwrite, "$link _prefix<a href=" $link "target=" $target "> $title </A> $link _postfix");

$items + +;
}
}
}
Fclose ($fpread);
}
Fclose ($fpwrite);
}
if (file_exists ($cache _file)) {
Include ($cache _file);
}
?>


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.