0)
{
*/
global $wpdb;
$cat_id_qry = "SELECT cat_id from ".$wpdb->prefix."category_ids";
$rec = mysql_query($cat_id_qry);
$list = array();
while($res = mysql_fetch_assoc($rec))
{
$list[] = $res['cat_id'];
}
//print_r($list);
$lists = implode(",",$list);
if(count($list)>0)
{
$csql_rec = $wpdb->get_results("select * from ".$table_prefix."terms where name='Conditions'");
$init_letter = $_GET['R'];
$sql_rec = $wpdb->get_results("select * from ".$table_prefix."terms wpt,".$table_prefix."term_taxonomy wptt where wpt.name like '".$init_letter."%' and wptt.taxonomy = 'category' and wpt.term_id = wptt.term_id and wpt.term_id not in(".$lists.")");
}
else
{
$csql_rec = $wpdb->get_results("select * from ".$table_prefix."terms where name='Conditions'");
$init_letter = $_GET['R'];
$sql_rec = $wpdb->get_results("select * from ".$table_prefix."terms wpt,".$table_prefix."term_taxonomy wptt where wpt.name like '".$init_letter."%' and wptt.taxonomy = 'category' and wpt.term_id = wptt.term_id");
}
//echo "select * from ".$table_prefix."terms wpt,".$table_prefix."term_taxonomy wptt where wpt.name like '".$init_letter."%' and wptt.taxonomy = 'category' and wpt.term_id = wptt.term_id and wpt.term_id not in(".$lists.")";
//$sql_rec = $wpdb->get_results($sql);
if(count($sql_rec) > 0)
{
foreach($sql_rec as $c_rec){
$ttid = $c_rec->term_taxonomy_id;
$tid = $c_rec->term_id;
$name = $c_rec->name;
$description = $c_rec->description;
$cat_link = $c_rec->term_id;
?>
60, 'hide_empty' => false ));
echo "".$name."";
?>
ID.' hjhjjhj';
endwhile;
?>
get_results("select * from ".$table_prefix."posts wpp,".$table_prefix."term_relationships wpr where wpr.term_taxonomy_id = '$ttid' and wpr.object_id = wpp.ID and wpp.post_status = 'publish' and wpp.post_type = 'post'");
$i=1;
$pcontent='';
foreach($psql_rec as $psql_res){
$aid = $psql_res->ID;
$post_heading = $psql_res->post_title;
?>
'.short_read('100',$psql_res->post_content,get_permalink($psql_res->ID)).'
';
$line_div .= '
';
$i++;
?>
60, 'hide_empty' => false ));
echo "".$name."";
?>
ID.' hjhjjhj';
endwhile;
?>
get_results("select ID,post_title from ".$table_prefix."posts wpp,".$table_prefix."term_relationships wpr where wpr.term_taxonomy_id = '$ttid' and wpr.object_id = wpp.ID and wpp.post_status = 'publish' and wpp.post_type = 'post'");
$i=1;
$pcontent='';
foreach($psql_rec as $psql_res){
$aid = $psql_res->ID;
$post_heading = $psql_res->post_title;
?>