Page 1 of 1

Problem with the OGG link

Posted: Thu Sep 28, 2006 10:16 am
by Jza
I found issues triying to download the Ogg file for yesterday's show.

Posted: Thu Sep 28, 2006 10:36 am
by Patrick
How are you trying to download the file? Manually? There may be an issue with a particular mirror. Try it a couple times. Each time it will go to the next mirror.

Posted: Thu Sep 28, 2006 10:49 am
by Jza
I see thanks for the tech support.

Posted: Thu Sep 28, 2006 10:51 am
by Patrick
Jza wrote:I see thanks for the tech support.
You're welcome!

Posted: Fri Sep 29, 2006 3:40 pm
by Jza
hey pat can you open me the source for the randomizer, I am looking for a randomizer script for the OOo site so we dont have users scrolling down throught he mirror list. Thanks.

Posted: Tue Oct 03, 2006 8:48 am
by Gomer_X
Jza wrote:hey pat can you open me the source for the randomizer, I am looking for a randomizer script for the OOo site so we dont have users scrolling down throught he mirror list. Thanks.
Linc wrote the PHP for the mirror script. Generally it's a bad idea to open the code to an internet facing script unless you've had sufficient time to test it for security.

If you ask nice Linc might tell you what PHP function he used to pick a random mirror.

Posted: Tue Oct 03, 2006 10:18 am
by Linc
Gomer_X wrote:
Jza wrote:hey pat can you open me the source for the randomizer, I am looking for a randomizer script for the OOo site so we dont have users scrolling down throught he mirror list. Thanks.
Linc wrote the PHP for the mirror script. Generally it's a bad idea to open the code to an internet facing script unless you've had sufficient time to test it for security.

If you ask nice Linc might tell you what PHP function he used to pick a random mirror.
The majority of it looks like this:

Code: Select all

<?
if(!isset($_GET['fname'])) { header("Location: http://tllts.org"); exit; }
$fname=$_GET['fname'];

$db = mysql_connect("$host", "$username", "$password");
mysql_select_db("$database",$db);
$query = "select link from mirror where link like '%$fname%'";
$result = mysql_query($query,$db) or die(mysql_error());
$recs = mysql_num_rows($result);
$counter='0';
while ($myrow = mysql_fetch_array($result))
        {
        $counter++;
        $link[$counter]=$myrow['link'];
        }

srand((double)microtime()*1000000); 
$mirrorno=rand(0,$recs);
if ($mirrorno=='0')
        {
        $query = "select link from audio where link like '%$fname%'";
        $result = mysql_query($query,$db) or die(mysql_error());
        while ($myrow = mysql_fetch_array($result))
                {
                $link[$counter]=$myrow['link'];
                }
        }

header("Location: $link[$mirrorno]");
?>
Basically, there is a table that holds the links of all the shows that are hosted on a mirror. The script queries that table for all the url's with that show and randomly picks one of them and redirects to that mirror.

Posted: Tue Oct 03, 2006 11:18 pm
by Jza
Great, thanks.