options['forum_use_rss']) { $mingleforum->setup_links(); if(is_numeric($_GET['topic'])) //is_numeric will prevent SQL injections $topic = $_GET['topic']; else $topic = 'all'; if($topic == "all"){ $posts = $wpdb->get_results("SELECT * FROM {$mingleforum->t_posts} ORDER BY `date` DESC LIMIT 20"); $title = get_bloginfo('name')." ".__("Forum Feed", "mingleforum").""; $description = __("Forum Feed", "mingleforum"); } else{ $posts = $wpdb->get_results("SELECT * FROM $mingleforum->t_posts WHERE parent_id = $topic ORDER BY `date` DESC LIMIT 20"); $description = __("Forum Topic:", "mingleforum")." - ".$mingleforum->get_subject($topic); $title = get_bloginfo('name')." ".__("Forum", "mingleforum")." - ".__("Topic: ", "mingleforum")." ".$mingleforum->get_subject($topic); } $link = $mingleforum->home_url; header ("Content-type: application/rss+xml"); echo ("\n"); ?> <?php echo $title; ?> forum_get_group_from_post($post->parent_id); $groups = $wpdb->get_var("select usergroups from {$mingleforum->t_forums} where id = {$catid}"); $groups = maybe_unserialize($groups); if(empty($groups)) //don't show protected group posts in the feed { $link = $mingleforum->get_paged_threadlink($post->parent_id); $title = $post->subject; echo "\n ".htmlspecialchars($title)."\n ".htmlspecialchars($mingleforum->output_filter($post->text, ENT_NOQUOTES))."\n ".htmlspecialchars($link)."\n feeds@r.us\n ".date("r", strtotime($post->date))."\n ".htmlspecialchars($link."&guid=$post->id")." \n\n"; } } echo " "; } else echo "".__("Feeds are disabled", "mingleforum")."";