FINDING THE SUPERGAYS

global $wpdb;
$q_limit = 1;

$errMsg = 0;

if( isset($_GET['start']) ){

$start = $_GET['start'];

}else{

$start = 0;

}

$filePath = home_url( '/' )."?page_id=62";

$nquery = mysql_query("select * from ".$wpdb->prefix.”posts p, “.$wpdb->prefix.”term_relationships tr,”.$wpdb->prefix.”term_taxonomy tt where tt.term_id=3 and tr.term_taxonomy_id=tt.term_taxonomy_id and p.ID=tr.object_id “);

$no_rows= mysql_num_rows($nquery);

$q1 = mysql_query(“select * from “.$wpdb->prefix.”posts p, “.$wpdb->prefix.”term_relationships tr, “.$wpdb->prefix.”term_taxonomy tt where tt.term_id=3 and tr.term_taxonomy_id=tt.term_taxonomy_id and p.ID=tr.object_id order by p.ID desc LIMIT $start , $q_limit”);

//echo $no_rows;
paginate($start,$q_limit,$no_rows,$filePath,”);
echo ‘
‘;

while($fq1= mysql_fetch_array($q1))
{

echo ‘

‘.$fq1[post_title].’

‘;

if ( (function_exists(‘the_post_thumbnail’)) && (has_post_thumbnail($fq1[ID])) ){

echo get_the_post_thumbnail($fq1[ID],array(500,500,true)).’

‘;
//the_post_thumbnail(‘thumbnail’);
}

echo ‘

‘.$fq1[post_content].’

‘;
}
echo ‘
‘;
paginate($start,$q_limit,$no_rows,$filePath,”);

?>