<?php
include("../config.php");

$today = date("Ymd");
$sql   = "select mid_size_image, girl_name from pic_of_day where display_date = '$today' AND nude_flag = 'Y'";
$result = mysql_query($sql);
$row = mysql_fetch_array($result);

if(mysql_affected_rows() < 1){
	$imagename = "1170454312-thumb.jpg";
	$girlname  = "Shyla Stylz";
	}else{
	$imagename = $row[0];
	$girlname  = $row[1];
	}
	$today = $today;
	$textabove = "Picture of the day brought to you by Naughty America";
	
?>

function create_potd (affiliate_id, thumb_width, thumb_height, font, fontclr, thesize, track, no_text){
	if (no_text == '1') {
var mytext = '<table width=200><TR><TD align=center><B><font face=' + font + ' color=' + fontclr + ' size=' + thesize + '></B></TD></TR><TR><TD align=center><A href=http://potd.naughtyamericadaily.com?affil=' + affiliate_id + '&track=' + track + '><img src=http://potd.naughtyamerica.com/files/new/<? echo $imagename; ?> border=0 width=' + thumb_width + ' height=' + thumb_height + '></TD></TR><TR><TD align=center><font face=' + font + ' color=' + fontclr + ' size=' + thesize + '></TD></TR></table>';
	}else{
var mytext = '<table width=200><TR><TD align=center><B><font face=' + font + ' color=' + fontclr + ' size=' + thesize + '><? echo $textabove; ?></B></TD></TR><TR><TD align=center><A href=http://potd.naughtyamericadaily.com?affil=' + affiliate_id + '&track=' + track + '><img src=http://potd.naughtyamerica.com/files/new/<? echo $imagename; ?> border=0 width=' + thumb_width + ' height=' + thumb_height + '></TD></TR><TR><TD align=center><font face=' + font + ' color=' + fontclr + ' size=' + thesize + '><? echo $girlname; ?><BR><? echo $today; ?></TD></TR></table>';
		
		}

document.write (mytext);
}

<?
mysql_close($link);
?>