";
//connie adding left navigation code-------------------
// linkCategories2($category_id);
//showLeftMenu($category_id);
echo " | ";
$pageNr = empty($_REQUEST['page'])? 1 : $_REQUEST['page'];
function getSiblings($category_id){
$sql="select parent_id from Link_Category where category_id = $category_id";
$result= mysql_query($sql);
$row=mysql_fetch_row($result);
$parent=$row[0];
// echo "Parent:$parent:";
if ($parent==1)
return false;
$siblings=array();
$rez=mysql_query("select category_id,category_nm from Link_Category where parent_id = $parent order by category_nm asc");
while ($row=mysql_fetch_row($rez)){
$siblings[$row[0]]=$row[1];
}
return $siblings;
}
function getNextSibling($siblings, $category_id){
for($i=0;$i0)
return $siblings[$i-1];
}
return $siblings[count($siblings)-1];
}
//connie: end left navigation code--------------
function showHouses(){
global $origCategory,$category_nm,$category_id;
$sibl=getSiblings($category_id); // get the categories on the same level with the current one.
if(!empty($sibl)) {
$prev_sibl=getPrevSibling(array_keys($sibl), $category_id);
$next_sibl=getNextSibling(array_keys($sibl), $category_id);
}
echo " - ".parentPath($origCategory," class=llinks","Y")." ";
echo "";
$state=(getCommunityState());
$city=(getCommunityCity());
if ($prev_sibl)
echo " ";
echo "$category_nm";
if($next_sibl)
echo " ";
echo "".subList($origCategory," class=llinks","Y")."
";
echo " ";
// now image paths are stored and read from DB. Connie set to random 3-4-8 used to be weight asc
$sql = "select link_id, house, link_nm, weight from Link where category_id = $category_id and weight < 7 order by RAND()";
$result = mysql_query($sql) or die ("An error occurred: " . mysql_error());
$showgarden=true;
$houseCnt=0;
$columns = 4;
$arr=array();
$arr2=array();
echo "";
while ($row=mysql_fetch_row($result)){
if ($row[1]){
$showgarden=false;
$houseCnt++;
if ( ! trim( $row[2] ) )
$row[2] = "Enter here";
$weight=$row[3];
if ( $houseCnt % $columns == 0 ){
if ($weight==6) {
$arr[]=" | ";
$arr2[]="". wordwrap($row[2], 30 , " " ) ." | ";
} else {
$arr[]=" | ";
$arr2[]="". wordwrap($row[2], 30 , " " ) ." | ";
}
echo "" . implode($arr) . " ";
echo "" . implode($arr2) . " ";
$arr=array();$arr2=array();
} else {
if ($weight==6) {
$arr[]=" | ";
$arr2[]=" | ";
} else {
$arr[]=" | ";
$arr2[]=" | ";
}
}
}
}
if ( count($arr) > 0 ){
echo "" . implode($arr) . " ";
echo "" . implode($arr2) . " ";
}
echo " ";
if ($showgarden)
echo "
";
//Map, weather nav table
echo "
"; //end map, weather nav
global $campaign_id,$term,$community_id,$blob_id,$catCnt,$category_nm;
$parentRow = sqlRow("SELECT category_nm, parent_id, blob_id, hit_cnt FROM Link_Category WHERE category_id=$category_id");
$blob_id=$parentRow[2];
$catCnt = $parentRow[3];
$parent_id = $parentRow[1];
if ($blob_id >0) {
echo "";
echo showBlob($blob_id);
echo " ";
}
//end of houses
}//showDir
/* deleted by Dan on 15.03.06 ! image paths are stored and read from DB
$cRow[3]=addslashes($cRow[3]);
if ($cRow[3]) {
echo "\n";
} else {
echo "
";
}
*/
$isApprover=checkRole(12,$comm);
if ($btn=="")
$btn=$dbtn;
if ($btn != "") {
if ($term != "")
;//doSearch($community_id,$campaign_id,$term);
}
if ($bar=="N") {
// don't show the navigation tool
echo "\n";
} else {
;//del by dan=linkCategories($category_id);
}
$pageNr = empty($_REQUEST['page'])? 1 : $_REQUEST['page'];
//echo $gCommunityURL ." , id: ". $gCommunityID . " - " . getCommunityID();
if (empty($term)){
showHouses();
// linkCategories($category_id);
listLinks($category_id,$pageNr,$term);
} else
searchLinks($term,getCommunityID());
echo " |