Ejemplo n.º 1
0
function PrintDeepMenu($act,$tablename,$parentid,$maxlevel,$level,$activearr)
{
    global $par,$langadd;

    //делаем выборку всех видимых пунктов меню уровня
    $sql1 = "SELECT * FROM $tablename WHERE parentid=$parentid AND hide=0 ORDER BY prior";
    $res1 = mysql_query($sql1);
    $nrows1 = mysql_num_rows($res1);
    if($nrows1>0)
    {
        echo '<ul>';
        while($line1 = mysql_fetch_array($res1,MYSQL_ASSOC))
        {
            $url1 = GetSeoUrl($act,$line1['id'],$line1);

            echo '<li '.TrueStr(in_array($line1['id'],$activearr),' class="active" ').' ><a href="'.$url1.'">'.htmlspecialchars($line1['title'.$langadd]).'</a>';

            //если пункт активный - раскрываем подкатегории
            if(in_array($line1['id'],$activearr))
            {
                PrintDeepMenu($act,$tablename,$line1['id'],$maxlevel,$level+1,$activearr);
            }
            echo '</li>';
        }
        echo '</ul>';
    }
}
Ejemplo n.º 2
0
	function PrintComentsBlock($materialid,$tabletype =1, $comentstype = 1,$revers=0,$start=0,$limit=0,$linkstr='')
	{
		if($tabletype==1) $tablename = "coments";
			
?>
		<style>
			.comentstable1 { border:0px; width:100%; }
			.comentname { font-size:13px; font-weight:bold;}
			.comentdate { font-size:12px; color:#808080; font-weight:normal; }
			.comment_text {}
			
			.mess_answer_a { font-weight:bold; font-size:12px; }
			
			
			.coment_p_title { color:#f5821f; font-weight:bold; padding-bottom:10px; padding-top:5px; }
			
			.comentdiv { border-left:1px dashed #c7c7c7; border-bottom:1px dashed #c7c7c7;}
			
		</style>

		<script>
            function ShowComents()
            {
                document.getElementById('startcoments').style.display = 'block';
/*
			   setEqualHeight($("#content > div"));
			   setEqualHeight($("#wrapper > div"));
			   $("#content .left").css({'height': $(".menubar").outerHeight()});
*/		   
            }

			function ShowComForm(p)
			{
				document.getElementById('comform'+p).style.display = 'block';
			}
			</script>

<?
		echo '
		<a name="startcoments"></a>
		<div id="startcoments" style="display:block;">

			<div class="comments">

			<div style="border-bottom: 1px dashed #ccc; padding-top:5px;"></div>
			
			';
			
	
			if(isset($_SESSION['badcode']) && $_SESSION['badcode']==1)
			{
				$_SESSION['badcode'] = 0;
				echo '<div style="color:red; font-size:18px; text-align:center;">Введен неверный код.</div>';
			}

			$sqlpager = "SELECT COUNT(id) AS ccc FROM $tablename WHERE parentid=$materialid AND hide=0 AND parentcomid=0 AND comentstype=$comentstype ";
			PrintPager($sqlpager,$linkstr,TrueStr($limit!=0,$limit,10),'#startcoments');
			
			PrintComents($materialid,0,1,$tabletype,$comentstype,$revers,$start,$limit);
			
			
			echo '</div>


			<div class="clear_div"></div>';
			
			PrintComentsForm($materialid,$tabletype,$comentstype);
			
		echo '
		</div>';
	}