|
|
|
<?php
// for more info visit:
// http://www.dtheatre.com/dthg.php3
$link_prefix = " o ";
$link_postfix = "<BR>\n";
$cache_file = "/tmp/dtheatre.com.cache";
$cache_time = 3600;
$max_items = 10;
$target = "_top";
// End of customizations
$backend = "http://www.dtheatre.com/backend.php3?xml=yes";
$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) {
// echo "$errstr ($errno)<br>\n";
// exit;
} else {
$fpwrite = fopen($cache_file, 'w');
if(!$fpwrite) {
// echo "$errstr ($errno)<br>\n";
// exit;
} else {
while(! feof($fpread) ) {
$buffer = ltrim(Chop(fgets($fpread, 256)));
if (($buffer == "<item>") && ($items < $max_items)) {
$title = ltrim(Chop(fgets($fpread, 256)));
$url = ltrim(Chop(fgets($fpread, 256)));
$title = ereg_replace( "<title>", "", $title );
$title = ereg_replace( "</title>", "", $title );
$url = ereg_replace( "<url>", "", $url );
$url = ereg_replace( "</url>", "", $url );
fputs($fpwrite, "$link_prefix<A HREF=\"$url\" TARGET=\"$target\">$title</A>$link_postfix");
$items++;
}
}
}
fclose($fpread);
}
fclose($fpwrite);
}
if (file_exists($cache_file)) {
include($cache_file);
}
?> |
|
| AITSH Errorbot Categories : Complete Programs, HTML and PHP, HTTP | | | phpCards - PHP/mySQL postcard script with web based admin to add, edit, and delete cards and categories. Very easy to install. Categories : PHP, Complete Programs, HTML and PHP, MySQL | | | Check parameters validity. Paranoia was designed to check the validity of the parameters that a php page will receive after a form submission. It can be used to check the variables sent by POST or GET Categories : Algorithms, HTML and PHP, PHP, Variables | | | Sed, a coder's best friend. This lovely linux command allows you to swap strings in a file. Great for changing a variable name in a script with
multiple files. Categories : HTML and PHP, HTML and PHP | | | A very simple way to build and do a hierarchical html categories browser without javascript , just using html php and mySql
Categories : HTML and PHP, Databases, Algorithms, PHP, MySQL | | | PHP4 HTTP Compression Speeds up the Web Categories : PHP, Zlib, HTML and PHP, HTTP, Network | | | PHP mySQL learning example This is a complete program to modify tables
in a mySQL database on a nice and neat way. Categories : PHP, MySQL, Complete Programs, HTML and PHP | | | Browse a MySQL database & draw a tree view & load final items into a template page. Categories : MySQL, Complete Programs, Algorithms, PHP, Databases | | | AITSH Guestbook Categories : Complete Programs, HTML and PHP, Databases, MySQL | | | A simple bubblesort that takes 2 arrays as argument.The first one is the actual data used for sorting, the second is data that will "tag along" with the first array, for instance a descriptive text about the data in the first array. Categories : Algorithms, Arrays, PHP, Complete Programs | | | AITSH Statistics Categories : Complete Programs, Databases, HTML and PHP, Sessions, PHP | | | This is a redirection program which is as good as the come.to v3 url
redirection, complete with admin interface all clients stored in mysql
Categories : PHP, MySQL, Ecommerce, HTML and PHP, Complete Programs | | | This script shows you the 7th latest php items from the mailing list archive on zend.com Categories : HTML, HTML and PHP, HTTP, PHP | | | Pseudo Non Parsed Header. Output to the the browser as the script runs. Categories : PHP, HTTP, HTML and PHP | | | Paginating the mySQL data Categories : PHP, Algorithms, Databases, MySQL, HTML and PHP | |
|
|
|