0){$where .= " AND $article_file.ArtCat='$ArtCat'";} }else{ $ArtCat = 0; } */ /* If not set category, set main category as default. Get related sub categories */ if(!isset($ArtCat)){ $ArtCat = 0; } $InCat = GetCat($ArtCat); /* Search Category */ $query = "SELECT COUNT(ArtCat) AS Total FROM $article_catfile WHERE (ArtCat IN $InCat AND (ArtDesc LIKE '%$term%' OR ArtExpl LIKE '%$term%'))"; $get_countcat = mysql_query($query, $db); $countcat_row = @mysql_fetch_array($get_countcat); $numrec_cat = $countcat_row[Total]; if(!isset($g_column) || $g_column < 1){ $g_column = 1; } $td_width = round(100/$g_column,0) . "%"; $i = 0; if($numrec_cat > 0){ $output = << EOF; $query = "SELECT * FROM $article_catfile WHERE (ArtCat IN $InCat AND (ArtDesc LIKE '%$term%' OR ArtExpl LIKE '%$term%')) ORDER BY ArtDesc ASC"; $get_cats = mysql_query($query, $db); while($get_rows = mysql_fetch_array($get_cats)){ $i++; if($i % $g_column == 1){ $output .= "\n"; } $img_to_show_thumb = ""; if($get_rows[ArtThumb] != ""){ if(file_exists("$base_imgpath/$get_rows[ArtThumb]")){ $img_to_show_thumb = ""; } } $output .= ""; if($i % $g_column == 0){ $output .= ""; } } if($i % $g_column != 0){ while($i % $g_column != 0){ $output .= ""; $i++; } $output .= ""; } $output .= "
$T_CATEGORY: $term
"; $output .= $img_to_show_thumb . "" . $get_rows[ArtDesc] . "
$get_rows[ArtExpl]"; $output .= "
 
"; } /* Search News */ $where .= " AND ($article_file.ArtCat IN $InCat)"; $get_count = mysql_query("SELECT COUNT(ArtID) AS Total FROM $article_file LEFT JOIN $members_file ON ($members_file.MbID = $article_file.ArtPostBy) WHERE $where",$db); $count_row = @mysql_fetch_array($get_count); $numrec = $count_row[Total]; $numpage = intval($numrec/$perpage); if($numrec % $perpage){ $numpage++; } $output .= << EOF; if($numrec > 0){ $query = "SELECT * FROM $article_file LEFT JOIN $article_catfile ON ($article_catfile.ArtCat=$article_file.ArtCat) LEFT JOIN $members_file ON ($members_file.MbID=$article_file.ArtPostBy) WHERE $where ORDER BY $article_file.ArtTitle ASC LIMIT $pos,$perpage"; $get_news = mysql_query($query,$db); $i = 0; while($get_rows = mysql_fetch_array($get_news)){ $pretty_time = pretty_time($get_rows[ArtDate],1); if($get_rows[MbEmail] != ""){ $u_realname = "$get_rows[MbName]"; }else{ $u_realname = $get_rows[MbName]; } $CatStructure = GetParrentCat($get_rows['ArtCat'],"wmview.php",1); if(($i%2) == "1"){ $bgcolor = $botrowcol; }else{ $bgcolor = $ctrrowcol; } $output .= << EOF; $i++; } }else{ $output .= << EOF; } $output .= "
$T_SRC_RST $term
$get_rows[ArtTitle] $get_rows[ArtDesc]
$T_SRC_NFO
"; } /* $get_cats = mysql_query("SELECT * FROM $article_catfile ORDER BY ArtDesc ASC",$db); $catoption = ""; */ $catoption = GetTreeCat(); $catoption = preg_replace("/ArtPCat/i", "ArtCat", $catoption); $pattern = "/" . $T_MAINCATEGORY . "/"; $catoption = preg_replace($pattern, $T_SRC_ACA, $catoption); $size=20; $s_perpage = array("10", "25", "50"); $s_perpage_opt = ""; $as_key = ""; } $searchform = <<
$T_SRC_KEY  $as_key$T_KEYWORD  $as_phrase$T_PHRASE $T_SRC_CAT$catoption $T_SRC_OPT$cj_check $T_TITLE   $cl_check $T_LEAD   $ci_check $T_CONTENT   $ca_check $T_AUTHOR   $cs_check $T_ALL $T_SRC_PPG
$s_perpage_opt 
EOF; if(!isset($output)){$output="";} $output = theme_opencenter_box($T_SRC_JDL) . $searchform . $output . theme_closecenter_box(); if($numpage > 1){ $output .= pagespan("$PHP_SELF?term=$term&perpage=$perpage&cj=$cj&cl=$cl&ci=$ci&ca=$ca&cs=$cs&keyphrase=$keyphrase&ArtCat=$ArtCat", $T_NEWS, $T_WITH_S); } /* ------------------------------------ * * Push what we got above on the screen * * ------------------------------------ */ flush(); include("$base_themepath/$theme/header.php"); include("$base_themepath/$theme/body-inside-open.php"); echo $output; /* echo ""; echo "

Managed by WMNews, PHP & MySQL"; */ include("$base_themepath/$theme/body-inside-close.php"); include("$base_themepath/$theme/footer.php"); ?>