Показать сообщение отдельно
  #34 (permalink)  
Старый 13.01.2013, 22:21
Аспирант
Отправить личное сообщение для Alex45 Посмотреть профиль Найти все сообщения от Alex45
 
Регистрация: 12.01.2013
Сообщений: 37

Вот файл, в котором делаем замену. Что же в нем удалить, а что оставить? Хотя бы чтобы проверить работу.
<div align="right"><h2><img src="<?=$im?>/gal.gif" alt="Категория" > <a href='#' onClick="details('id_8888888');return false;" style="cursor:pointer"><?=

$lang[99]?></a></h2></div>
<?

if (@$_GET['city'])
{
	$from_city_query = mysql_query ("SELECT city_name FROM jb_city WHERE city_translit = '".$_GET['city']."' LIMIT 1"); 
	if (mysql_num_rows ($from_city_query) == 1)
	{
		$from_city = mysql_fetch_assoc ($from_city_query); $city_from_search = " AND city = '".$from_city['city_name']."' ";
		$GLOBALS['city_name_from_tips'] = $from_city['city_name']; $GLOBALS['start_for_links'] = "city/".$_GET['city']."/";
		$GLOBALS['end_for_links'] = "sort/city_asc/page/1/";
	} else  echo "<HTML><HEAD><META HTTP-EQUIV='Refresh' CONTENT='0; URL=".$h."/'></HEAD></HTML>";
}
else
{
		$GLOBALS['start_for_links'] = ""; $GLOBALS['end_for_links'] = "sort/date_desc/page/1/";
}

$GLOBALS['host'] = $h;
function listcat2($id, $sub, $city_from_search)
{
 	$categories = mysql_query("SELECT * FROM jb_board_cat WHERE root_category = $id");
	while($category = mysql_fetch_array($categories)) 
	{	
 		$count = mysql_num_rows(mysql_query("SELECT * FROM jb_board WHERE id_category='".$category['id']."' ".@$city_from_search));
 		$query = mysql_query("SELECT * FROM jb_board_cat WHERE root_category = ".$category['id']);
		@$count_subcat_in_the_cat = mysql_num_rows($query);
		if (@$count_subcat_in_the_cat) {$br = ""; $bold = " b ";} else {$br = "<br />"; $bold = "";}
 		echo ($category['img']!="")?"<img onmouseover=\"Tip('".$category['name_cat'].": ".$category['description']."')\" align=left src=\"".$GLOBALS

['host']."/upload/cat/".$category['img']."\">":" ";
 		if (@$GLOBALS['city_name_from_tips']) $tip_city = " ".$lang[538]." ".$GLOBALS['city_name_from_tips']; else $tip_city = "";
		for($i = 0; $i < $sub; $i++) echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
 		if(!@$count) echo "<span class=\"dark_red $bold\" href=\"".$GLOBALS['host']."/advertisement/".@$GLOBALS['start_for_links']."nesting/".

$category['id']."/".@$GLOBALS['end_for_links']."\">".$category['name_cat']."</span>$br";
 		else echo "<a class=\"$bold\" onmouseover=\"Tip('".$count." ".PluralForm($count,$lang[262],$lang[263],$lang[264])." ".$lang[262]." ".

$category['description'].$tip_city."')\" href=\"".$GLOBALS['host']."/advertisement/".@$GLOBALS['start_for_links']."nesting/".$category['id']."/".@$GLOBALS

['end_for_links']."\">".$category['name_cat']."</a>$br";
		$root = 0;
		listcat2($category['id'], $sub+1, $city_from_search);
	}
}
echo "<div id=\"id_8888888\" style=\"DISPLAY: none;\">";
$categories = mysql_query("SELECT * FROM jb_board_cat WHERE root_category = 0 ORDER by name_cat ASC"); 
while($category = mysql_fetch_array($categories)) 
{
	$sub = 1;
	$query = mysql_query("SELECT * FROM jb_board_cat WHERE root_category = ". $category['id']); 
	$count_subcat = mysql_num_rows($query);
	echo "<div style=\"margin-top:15px;\">";//
	echo ($category['img']!="")?"<div style=\"float:left; margin-right:10px;\">
<img onmouseover=\"Tip('".$category['name_cat'].": ".$category['description']."')\" align=left src=\"".$GLOBALS['host']."/upload/cat/".$category

['img']."\"></div>":" ";
	echo "<H4><a href=# onClick=\"details(9999".$category['id'].");return false;\" style=\"cursor:pointer\">".$category['name_cat']."</a></H4>";
	$root = 0; 
	if(@$count_subcat > 0)
	{
		echo "<div align=right id=\"9999".$category['id']."\" style=\"DISPLAY: none; width=50%\">";
		listcat2($category['id'], $sub, @$city_from_search);
		echo "</div>";
	}
	echo "</div>";
}
echo "<br /><br /></div>";
?>
Ответить с цитированием