<?php if ($_GET['p'] >= 100){ ?>
<?php
	$query = "select obd_0.name, obd_0.jobid, tblTag_0.p_tag from obd_0, tblTag_0 where tblTag_0.p_tag = " . $obase[($_GET['p'] - 100)/2][5] . " and tblTag_0.word_id = obd_0.jobid ORDER BY jobid desc limit 0, 10";
	$result = mysql_query($query);
	$num_result = mysql_num_rows($result);
	if ($num_result){
		echo "<div class='bl_w'><span class='div_bbig2'>Проекты в тему</span></div><div class='bl_w2 lft'>";
		for ($i=0; $i<$num_result; $i++){
			$row = mysql_fetch_array($result);
			echo setmode("project.php?u=" . $row['jobid'], 0) . " <a href='/project.php?u=" . $row['jobid'] . "'>" . stripslashes($row['name']) . "</a> ";
		}
	}else{
		$query = "select * from obd_0 ORDER BY jobid desc limit 0, 7";
		$result = mysql_query($query);
		$num_result = mysql_num_rows($result);

		echo "<div class='bl_w'><span class='div_bbig2'>Последние проекты</span></div><div class='bl_w2 lft'>";
		for ($i=0; $i<$num_result; $i++){
			$row = mysql_fetch_array($result);
			echo setmode("project.php?u=" . $row['jobid'], 0) . "</sub> <a href='/project.php?u=" . $row['jobid'] . "'>" . stripslashes($row['name']) . "</a> ";
		}
				
	}
	echo "</div>";
}else{
	$tmp1 = "";
	$tmp2 = 1;
	for ($i=1; $i<=count($obase); $i++){
		if ($obase[$i][5] == "808" and $_GET['p'] == 8){ $tmp1 .= "<sub>" . $tmp2++ . "</sub> <a href='/online.php?p=" . (99 + $i*2) . "'>" . $obase[$i][0] . "</a> "; }
	}
	if ($tmp1 <> ""){echo "<div class='sm'><span class='bld'>Базы онлайн в тему: </span>" . $tmp1 . "</div>";}
	
} ?>
