1 then don't even bother showing it cuz it requires special permissions if (!empty($f)) { $boardrequest = db_query("SELECT ID_BOARD,ID_CAT,name,lastUpdated,description,memberGroups FROM {$db_prefix}boards WHERE ID_BOARD = '$f'", __FILE__, __LINE__); $row = mysql_fetch_assoc($boardrequest); if (substr($row['memberGroups'],0,1) < 2) { $cat_id = $row['ID_CAT']; $board_id = $row['ID_BOARD']; $boardname = "(".$row['name'].")"; $boarddescription = $row['description']; $pubDate = gmdate('D, d M Y H:i:s',$row['lastUpdated']) . ' GMT'; mysql_free_result($boardrequest); //May as well get the category name too $catrequest = db_Query("SELECT name FROM {$db_prefix}categories WHERE ID_CAT = '$cat_id'",__FILE__,__LINE__); $catinfo = mysql_fetch_assoc($catrequest); $catname = $catinfo['name']; mysql_free_result($catrequest); // Get each topics for a particular forum. $request = db_query("SELECT ID_TOPIC,ID_FIRST_MSG,numReplies FROM {$db_prefix}topics WHERE ID_BOARD = '$board_id' ORDER BY ID_TOPIC DESC LIMIT 15", __FILE__, __LINE__); $topics = array(); $topic_info_labels = Array('first_msg','numreplies'); while ($row = mysql_fetch_assoc($request)) { if (!empty($row['ID_TOPIC'])) $topics[$row['ID_TOPIC']] = Array($row['ID_FIRST_MSG'],$row['numReplies']); } mysql_free_result($request); //make our where clause for grabbing the msgs $msg_where = " WHERE "; foreach ($topics as $id=>$info_array) { $msg_where .= "ID_MSG=".$info_array[0]." OR "; } $msg_where = substr($msg_where,0,-4); //echo $msg_where; // One query to grab all the messages we need $postrequest = db_Query("SELECT ID_MSG,ID_TOPIC,ID_MEMBER,posterTime,subject,posterName,body from {$db_prefix}messages".$msg_where." order by ID_MSG DESC",__FILE__,__LINE__); $postIndex = Array(); while ($row = mysql_fetch_assoc($postrequest)) { $postIndex[$row['ID_MSG']]['time'] = $row['posterTime']; $postIndex[$row['ID_MSG']]['subject'] = $row['subject']; $postIndex[$row['ID_MSG']]['auth_id'] = $row['ID_MEMBER']; $postIndex[$row['ID_MSG']]['name'] = $row['posterName']; $postIndex[$row['ID_MSG']]['body'] = $row['body']; $postIndex[$row['ID_MSG']]['topic_id'] = $row['ID_TOPIC']; } } else { // Dump in some crud info $catname = ""; $boardname = ""; $topics = Array(); } } get_rss_header($feed); echo " \r\n"; echo "\t ".$mbname, !empty($boardname) ? " - ".$catname." ".$boardname : ""," \r\n"; echo "\t ".$boardurl." \r\n"; echo "\t ".$boarddescription." \r\n"; echo "\t ".$pubDate." \r\n"; echo "\t ".$webmaster_email." \r\n"; echo "\t ".$gen_name." \r\n"; if (!empty($postIndex)) { foreach ($postIndex as $id=>$post) { $date = gmdate('D, d M Y H:i',$post['time']) . ' GMT'; $author = "Posted by ".$post['name']." on "; $news_time = "".$date.""; $link = $scripturl."?topic=".$post['topic_id'].".msg".$id."#msg".$id; $numcomments = $topics[$post['topic_id']][1]; $commentline = "\r\n
Comments: $numcomments
\r\n"; $postbyline = "
".$author.$news_time."
\r\n"; $postbody = doUBBC($post['body'],false); $postbody = html_entity_decode($postbody); $postbody = utf8_encode($postbody); $postbody = "
".$postbody."
\r\n"; $postbody = str_replace(" target=\"_blank\"","",$postbody); $postbody = str_replace("border=\"0\"","style=\"border: 0px;\"",$postbody); echo "\r\n"; echo "\t".$post['subject']." \r\n"; echo "\t".$link." \r\n"; echo "\t".$date." \r\n"; echo "\t\r\n"; echo "\t\t","",$postbody); echo $postbody; echo $commentline; echo " ]]>\r\n"; echo "\t\r\n"; echo "\r\n"; } } get_rss_footer(); } ?>