Location: PHPKode > projects > Open ShareLive > F3-OSL-pre_alpha-2005_05_30/out_csv.php
<?php
/******************************************************************************
*
*    Open ShareLive (main site code)
*    Copyright (C) 2002-2005  ShareLive
*
*    This program is free software; you can redistribute it and/or
*    modify it under the terms of the GNU General Public License
*    as published by the Free Software Foundation; either version 2
*    of the License, or (at your option) any later version.
*
*    This program is distributed in the hope that it will be useful,
*    but WITHOUT ANY WARRANTY; without even the implied warranty of
*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*    GNU General Public License for more details.
*
*    You should have received a copy of the GNU General Public License
*    along with this program; if not, write to the Free Software
*    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*
******************************************************************************/

if ($_GET['time']) {
echo 'You can\'t do that!';
die;
}
if (!$_GET['age']) {
echo "Please supply an age";
die;
}
$c=$_GET['age'];
$c=$c+1;
$c=$c-1;
$_GET['age']=$c;
if ($c<100) {
echo "Age is too small. Must be at least 100 seconds.";
die;
}
if ($c>19000) {
echo "Age is too small. Must be six hours or less.";
die;
}
$_GET['time']=time()-$c;
include('Connections/Default.php');
$r=mysql_query("SELECT `str_short`,`cat_id`,`rel_id` FROM `sl_shares` WHERE `network`='5' AND `req_state`='2' AND `reqrel_date` > '".$_GET['time']."' ORDER BY `rel_id` DESC");
if ($r) {
if (mysql_num_rows($r)) {
while ($c=mysql_fetch_row($r)) {
$cc=mysql_query("SELECT `displayname` FROM `sl_categories` WHERE `cat_id` = '".$c[1]."'");
if ($cc) {
if (mysql_num_rows($cc)) {
$rt=mysql_fetch_row($cc);
echo "\"".$c[0]."\",\"".$rt[0]."\",http://www.sharelive.com/view.php?pid=".$c[2]."\"\r\n";
}
}
}
} else {
echo "Error, Please accept our apologies. Our database may be overloaded.";
}
} else {
echo "Error, Please accept our apologies. Our database may be overloaded.";
}
?>
Return current item: Open ShareLive