Code Search for Developers
 
 
  

mirrors.php from guliverkli at Krugle


Show mirrors.php syntax highlighted

<?php

session_start();

require '../include/MySmarty.class.php';
require '../include/DataBase.php';

$http_host = split(':', $_SERVER['HTTP_HOST']);
$db_host = addslashes($http_host[0]);

$db->query(
	"select scheme, host, port, path, name, (to_days(NOW()) - to_days(lastseen)) as lastseen_days ".
	"from mirror where host <> '$db_host' order by lastseen desc ");

$mirrors = array();

while($row = $db->fetchRow())
{
	$url = "{$row['scheme']}://{$row['host']}";
	if($row['port'] != 80 && $row['port'] != 0) $url .= ":{$row['port']}";
	$url .= $row['path'];
	// MAYDO: verify url, skip unreachable
	$mirrors[] = array('url' => $url, 'name' => $row['name'], 'days' => $row['lastseen_days']);
}

$smarty->assign('mirrors', $mirrors);

$smarty->display('main.tpl');

?>



See more files for this project here

guliverkli

Home of VobSub, Media Player Classic (MPC) and other misc utils.

Project homepage: http://sourceforge.net/projects/guliverkli
Programming language(s): C,C++,PHP
License: other

  css/
    default.css
    flip.css
  img/
    bluehdrbig.gif
    bluehdrmid.gif
    bluehdrsmall.gif
    del.gif
    note.png
    redhdrbig.gif
    redhdrmid.gif
    redhdrsmall.gif
    video.gif
  script/
    flip.js
    overlib.js
    overlib_mini.js
  converter.php
  dl.php
  index.php
  mirrors.php
  signin.php
  signout.php
  test.php
  ul.php