File: /home/httpd/html/tubeshemale.com/public_html/includes/inc.custom_rss.php
<?
include('admin/db.php');
$bad = array('?','!',' ','&','*','$','#','@');
$good = array('','','-','','','','','');
if(!is_numeric($_GET[id])) {
exit("Invalid ID");
}
if(is_numeric($_GET[limit])) {
$limit = $_GET[limit];
}
else {
$limit = 100;
}
header('Content-type: text/xml; charset=UTF-8');
$rssResult = mysql_query("SELECT * FROM rss_feed WHERE record_num = '$_GET[id]'");
if(mysql_num_rows($rssResult) < 1) {
exit("Invalid Feed");
}
$rssRow = mysql_fetch_array($rssResult);
echo $rssRow[top];
$result = mysql_query("SELECT * FROM content WHERE enabled = 1 AND photos =0 ORDER BY encoded_date DESC LIMIT $limit");
while($row = mysql_fetch_array($result)) {
$link = "$basehttp/videos/".urlencode(strtolower(str_replace($bad,$good,$row[title])))."-".$row[record_num].".html";
if($row[embed]) {
$thumb_main = "$thumb_url/embedded/$row[record_num].jpg";
$thumb1 = $thumb_main;
$thumb2 = $thumb_main;
$thumb3 = $thumb_main;
$thumb4 = $thumb_main;
$thumb5 = $thumb_main;
$thumb6 = $thumb_main;
$thumb7 = $thumb_main;
$thumb8 = $thumb_main;
$thumb9 = $thumb_main;
$embed = $row[embed];
}
else {
$dirname = str_replace('.flv','',$row[orig_filename]);
$subdir = $row[filename][0].'/'.$row[filename][1].'/'.$row[filename][2].'/'.$row[filename][3].'/'.$row[filename][4].'/';
$dirname = $subdir.$dirname;
$thumb_main = "$thumb_url/$dirname/$row[orig_filename]-$row[main_thumb].jpg";
$thumb1 = "$thumb_url/$dirname/$row[orig_filename]-1.jpg";
$thumb2 = "$thumb_url/$dirname/$row[orig_filename]-2.jpg";
$thumb3 = "$thumb_url/$dirname/$row[orig_filename]-3.jpg";
$thumb4 = "$thumb_url/$dirname/$row[orig_filename]-4.jpg";
$thumb5 = "$thumb_url/$dirname/$row[orig_filename]-5.jpg";
$thumb6 = "$thumb_url/$dirname/$row[orig_filename]-6.jpg";
$thumb7 = "$thumb_url/$dirname/$row[orig_filename]-7.jpg";
$thumb8 = "$thumb_url/$dirname/$row[orig_filename]-8.jpg";
$thumb9 = "$thumb_url/$dirname/$row[orig_filename]-9.jpg";
if($row[hotlinked]) { $fileurl = $row[hotlinked]; } else { $fileurl = $row[filename]; }
$embed = '<object id="flvPlayer" height="588" width="475" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"><param name="flashvars" value="settings='.$basehttp.'/playerConfig.php?'.rawurlencode($fileurl).'"/><param name="movie" value="'.$basehttp.'/player.swf"/><param name="src" value="'.$basehttp.'/player.swf"/><param name="allowscriptaccess" value="always"/><param name="allowfullscreen" value="true"/><embed src="'.$basehttp.'/player.swf?settings='.$basehttp.'/playerConfig.php?'.$basehttp.'" quality=high width="588" height="475" name="flvPlayer" wmode="window" allowScriptAccess="always" allowfullscreen="true" flashvars="settings='.$basehttp.'/playerConfig.php?'.rawurlencode($fileurl).'" type="application/x-shockwave-flash" pluginpage="http://www.macromedia.com/go/getflashplayer" displayclick=link></embed>';
}
unset($catstring); $cresult = mysql_query("SELECT pornstars.name, pornstars.record_num FROM pornstars, content_pornstars WHERE content_pornstars.content = '$row[record_num]' AND content_pornstars.pornstar = pornstars.record_num GROUP BY pornstars.record_num ORDER BY name ASC"); while($crow = mysql_fetch_array($cresult)) { $catstring .= "$crow[name], "; } $catstring = substr($catstring,0,-2);
$pornstars = $catstring;
unset($catstring); $cresult = mysql_query("SELECT niches.name, niches.record_num FROM niches, content_niches WHERE content_niches.content = '$row[record_num]' AND content_niches.niche = niches.record_num GROUP BY niches.record_num ORDER BY name ASC"); while($crow = mysql_fetch_array($cresult)) { $catstring .= "$crow[name], "; } $catstring = substr($catstring,0,-2);
$categories = $catstring;
$replace = array('{title}', '{keywords}', '{embed}', '{description}', '{url}', '{thumb_main}', '{thumb1}', '{thumb2}', '{thumb3}', '{thumb4}', '{thumb5}', '{thumb6}', '{thumb7}', '{thumb8}', '{thumb9}', '{pornstars}', '{categories}', '{lengthsec}', '{length}');
$with = array($row[title], $row[keywords], $embed, $row[description], $link, $thumb_main, $thumb1, $thumb2, $thumb3, $thumb4, $thumb5, $thumb6, $thumb7, $thumb8, $thumb9, $pornstars, $categories, $row[length], sec2time($row[length]));
echo str_replace($replace,$with,$rssRow[feed]);
}
?>
<? echo $rssRow[bottom]; ?>
<? exit(); ?>