select($PHPBBDB); } # Run The query if (is_array($PHPBBEXCLUDED)) { $counter = 0; $countermax = count($PHPBBEXCLUDED) -1; # Construct Excluded Query $EXCLUDED_FORUM = "AND "; foreach ($PHPBBEXCLUDED as $EXCLUDED) { $EXCLUDED_FORUM .= "forum_id !=$EXCLUDED"; if ($counter < $countermax ) { $EXCLUDED_FORUM .= " AND "; } $counter++; } // Added WHERE TOPIC_APPROVED = 1 to the following, creditz Ashish http://www.microstrategy101.com/ if ($prt_phpbb_dbinsecureon == "1") { $results = $phpbbdb->get_results("SELECT * FROM $TOPIC_TABLE WHERE TOPIC_APPROVED = 1 $EXCLUDED_FORUM ORDER BY topic_time DESC LIMIT $LIMIT"); } else { $results = $wpdb->get_results("SELECT * FROM $TOPIC_TABLE WHERE TOPIC_APPROVED = 1 $EXCLUDED_FORUM ORDER BY topic_time DESC LIMIT $LIMIT"); } } else { # No excluded Query if ($prt_phpbb_dbinsecureon == "1") { $results = $phpbbdb->get_results("SELECT * FROM $TOPIC_TABLE WHERE TOPIC_APPROVED = 1 ORDER BY topic_time DESC LIMIT $LIMIT"); } else { $results = $wpdb->get_results("SELECT * FROM $TOPIC_TABLE WHERE TOPIC_APPROVED = 1 ORDER BY topic_time DESC LIMIT $LIMIT"); } } if ($results){ echo ""; } else { echo "

phpBB Error -$TOPIC_TABLE

"; } if ($prt_phpbb_dbinsecureon != "1") { # Connect back to wordpress :-) $wpdb->select(DB_NAME); } ?>