select($lnx_PRT_options['prt_phpbb_db']); } # Run The query - SQL Querey restructuring by Number3NL if (is_array($lnx_PRT_options['prt_phpbb_exclued'])) { $counter = 0; $countermax = count($lnx_PRT_options['prt_phpbb_exclued']) -1; # Construct Excluded Query $EXCLUDED_FORUM = "AND "; foreach ($lnx_PRT_options['prt_phpbb_exclued'] as $EXCLUDED) { $EXCLUDED_FORUM .= "forum_id !=$EXCLUDED"; if ($counter < $countermax ) { $EXCLUDED_FORUM .= " AND "; } $counter++; } } else { $EXCLUDED_FORUM = ""; } # Added WHERE TOPIC_APPROVED = 1 to the following, creditz Ashish http://www.microstrategy101.com/ $sql_query = "SELECT * FROM $lnx_PRT_options[prt_phpbb_tt] WHERE TOPIC_APPROVED = 1 $EXCLUDED_FORUM $EXCLUDED_FORUM ORDER BY"; if ($lnx_PRT_options['prt_phpbb_latest_topic'] == "1") { $sql_query .= " topic_last_post_time"; // Sort by Post Date/Time } else { $sql_query .= " topic_time"; // Sort by Topic Date/Time } $sql_query .= " DESC LIMIT $LIMIT"; # Execute SQL Query if ($lnx_PRT_options['prt_phpbb_dbinsecureon'] == "1") { $results = $phpbbdb->get_results($sql_query); } else { $results = $wpdb->get_results($sql_query); } # Build the recent (active) topics now if ($results){ echo '"; } else { echo "

phpBB Error - $lnx_PRT_options[prt_phpbb_tt]

"; // No Results! } if ($lnx_PRT_options['prt_phpbb_dbinsecureon'] != "1") { # Connect back to wordpress :-) $wpdb->select(DB_NAME); } ?>