function related($temppostid='') { global $wpdb, $table_prefix, $max_related, $post, $RelatedText, $single; if ($single && $post->post_title != "") { $stuff = addslashes($post->post_title); $sql = "SELECT ID,post_title,post_content,post_excerpt,post_date, MATCH(post_title,post_content) AGAINST ('$stuff') AS score FROM ".$table_prefix."posts WHERE MATCH (post_title,post_content) AGAINST ('$stuff') and post_status = 'publish' and post_type = 'post' and id <> $temppostid LIMIT 0,$max_related"; $searches = $wpdb->get_results($sql); if($searches){ echo "
\n"; } } }