"; ?>
'' ) { $sql = "SELECT a.ID, a.date, a.title, a.body, a.name, c.id, c.path FROM thetkbearcrew.tbl_news a LEFT JOIN thetkbearcrew.tbl_members b ON b.userid = a.name left join tkbearcrewgallery.`plogger_pictures` c on IFNULL(b.profilepic,2909) = c.id where a.id = '$id' ORDER BY a.date DESC"; } else { $sql = "SELECT a.ID, a.date, a.title, a.body, a.name, c.id, c.path FROM thetkbearcrew.tbl_news a LEFT JOIN thetkbearcrew.tbl_members b ON b.userid = a.name left join tkbearcrewgallery.`plogger_pictures` c on IFNULL(b.profilepic,2909) = c.id where DATE_FORMAT(a.date,'%M') = '".$rmonth."' and DATE_FORMAT(a.date,'%Y') = '".$ryear."' ORDER BY a.date DESC;"; } $result = mysql_query($sql) or die(mysql_error()); // keeps getting the next row until there are no more to get while($row = mysql_fetch_array( $result )) { $sql2 = "select count(*) from thetkbearcrew.`tbl_news_comments` a where approved <> '0' and a.parent_id = '".$row[0]."'"; $result2 = mysql_query($sql2) or die(mysql_error()); // keeps getting the next row until there are no more to get while($row2 = mysql_fetch_array( $result2 )) { $count= $row2[0]; }; $imageurl = explode("/",$row[6]); $url1=str_replace(" ","_","http://www.tkbearcrew.com/gallery/thumbs/".$row[5]."-".$imageurl[2]); $url1=str_replace("(","_",$url1); $url1=str_replace(")","_",$url1); // drop down values PRINT "

".$row[2]."

Posted by ".$row[4]." on ".$row[1]." Comments (".$count.")

".nl2br($row[3])."

View / Post Comments (".$count.")

"; } print "

"; if ($pageing1 > 9){print "<<-- NEWER POSTS - - - - - - - - - - - - - - - - - - ";} elseif ($pageing1 > 0){print "<<-- NEWER POSTS - - - - - - - - - - - - - - - - - - ";} if(mysql_num_rows($result) > 9){print" OLDER POSTS-->>

";} ?>