function LatestImages($maxnr) { $query = "SELECT id,catname,name,url,tn_url,photograph,date FROM images WHERE status='1' ORDER BY id DESC"; $result = pg_query($query) or die("Query failed"); print '
";
print(makelinkimage($cfg_homepage ."/view_image.php?id=".$line["id"] . "&gallery=5" , "http://astronet.se/".$line["tn_url"]));
print " "; print " | ";
print '';
FontColor("Arial", 12, "#000000");
print str_replace("00:00:00", "", $line["date"]) . " "; print "" . utf8_encode($line["catname"]) . " " .utf8_encode($line["name"]) . " "; print "Fotograf: " . utf8_encode($line["photograph"]). " "; $image = new Image; $image->GetImage_ID($line["id"]); if ($image->topic>0) { $latest_query = "SELECT post_id, topic_id, poster_id, post_time, forum_id from phpbb3_posts WHERE topic_id='" . $image->topic . "' ORDER BY post_time DESC"; $latest_result = mysql_query($latest_query) or die ('Error occured during topic check! '.mysql_error()); $latest_topic = mysql_fetch_array($latest_result); print(makelinkint("phpBB3/viewtopic.php?t=".$image->topic, "» Diskutera bilden ")); print(makelinkint($cfg_homepage . "/phpBB3/viewtopic.php?t=".$latest_topic['topic_id'] ."&p=" . $latest_topic['post_id']."#p".$latest_topic['post_id'], '')); $topic_query = "SELECT topic_id FROM phpbb3_posts WHERE topic_id='" . $image->topic . "'"; $topic_result = mysql_query($topic_query) or die ('Error occured during topic check! '.mysql_error()); $topics = mysql_num_rows($topic_result) - 1; if ($topics > 0) { if ($topics == 1) { print(" " . $topics . " kommentar"); } else { print(" " . $topics . " kommentarer"); } } } print " "; EndFont(); print " |