ansar2000

چطوری میشه چند موقعیت رو با هم یکجا شرطی کرد!؟

8 پست در این موضوع

چطوری میشه چند موقعیت رو با هم یکجا شرطی کرد!؟دستورش رو میخوام!

Share this post


Link to post
Share on other sites
آموزش ووکامرس قالب جوملا قالب وردپرس قالب رایگان وردپرس قالب رایگان جوملا هاست نامحدود هاست جوملا هاست لاراول هاست وردپرس هاست ارزان هاست ربات تلگرام خرید دامنه آموزش ساخت ربات تلگرام با php آموزش html و css آموزش لاراول آموزش cPanel آموزش php آموزش سئو وردپرس آموزش امنیت وردپرس آموزش وردپرس آموزش فرم ساز RSform آموزش سئو جوملا آموزش فروشگاه ساز Hikashop آموزش فروشگاه ساز ویرچومارت آموزش طراحی سایت آگهی تبلیغاتی آموزش امنیت جوملا آموزش طراحی سایت فروش فایل آموزش طراحی قالب ریسپانسیو با Helix آموزش جوملا 3 آموزش ساخت ربات دکمه ی شیشه ای آموزش ساخت ربات همکاری در فروش آموزش ساخت ربات جذب ممبر آموزش ساخت ربات ضد اسپم آموزش ساخت ربات پیوست فایل سورس ربات مدیر گروه | ربات مدیر گروه همسریابی

منظورتون از چند موقعیت با هم چیه؟بستگی به شرایط وعملکرد وموقعیت متفاوت است دقیق توضیح بدین وبگین از چه قالبی استفاده میکنید

Share this post


Link to post
Share on other sites

درود

از این آموزش استفاده کنید هر تعداد موقعیت شرطی که نیاز دارید رو می تونید ایجاد کنید.

Share this post


Link to post
Share on other sites

ارسال شده در (ویرایش شده)

منظورتون از چند موقعیت با هم چیه؟بستگی به شرایط وعملکرد وموقعیت متفاوت است دقیق توضیح بدین وبگین از چه قالبی استفاده میکنید

منظورم اینه که چندتا موقعیت که زیر هم هستند و در دایو های زیر هم رو یکجا غیرفعال کنم و بجای اون قسمت content یا همون محتوای قالب عرضش زیاد بشه وجای اون رو پرکنه.یعنی با غیر فعال کردن ماژول های سمت چپ اون موقعیت ها رو نشون نده وبجای اون content عرضش زیاد بشه و جای اون رو کامل بگیره!چیکار باید کنم؟ضمنا قالبم روی لوکال هستش.

کدphpقالبم:


<?php defined( '_JEXEC' ) or die( 'Restricted access' );
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<jdoc:include type="head" />
<title><a href="khatesorkh.ir"></a></title>
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/system/css/system.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/system/css/general.css" type="text/css" />


<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/farmandari/css/template.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/farmandari/images/body-bg.png" type="text/css" />

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<link rel="stylesheet" type="text/css"/>


</head>


<body>

<div id="wrapper">

<div id="header">
<a href="khatesorkh.ir"></a>

<jdoc:include type="modules" name="header" />
</div>

<div id="menu">
<jdoc:include type="modules" name="menu" />

</div>

<div id="breadcrumbs">
<jdoc:include type="modules" name="breadcrumbs" />
</div>

<div id="container">

<div id="right-sidebar">

<?php if($this->countModules('right-sidebar1')) : ?>
<div class="block"></div>
<div class="block-content"><jdoc:include type="modules" name="right-sidebar1" /></div>
<?php endif; ?>

<?php if($this->countModules('right-sidebar2')) : ?>
<div class="block2"></div>
<div class="block-content"><jdoc:include type="modules" name="right-sidebar2" /></div>
<?php endif; ?>

<?php if($this->countModules('right-sidebar3')) : ?>
<div class="block3"></div>
<div class="block-content"><jdoc:include type="modules" name="right-sidebar3" /></div>
<?php endif; ?>

<?php if($this->countModules('right-sidebar4')) : ?>
<div class="block4"></div>
<div class="block-content"><jdoc:include type="modules" name="right-sidebar4" /></div>
<?php endif; ?>

<?php if($this->countModules('right-sidebar5')) : ?>
<div class="block5"></div>
<div class="block-content-owghat"><jdoc:include type="modules" name="right-sidebar5" /></div>
<?php endif; ?>

</div>



<div id="content">
<div class="titr"><jdoc:include type="modules" name="titr" /></div>
<?php if($this->countModules('slideshow')) : ?>
<div class="slideshow"><jdoc:include type="modules" name="slideshow" /></div>
<?php endif; ?>
<div class="content-content"><jdoc:include type="component" /></div>

<?php if($this->countModules('position-right')) : ?>
<div class="block-content1"><div class="header-news1"></div><jdoc:include type="modules" name="position-right" /></div>
<?php endif; ?>
<?php if($this->countModules('position-left')) : ?>
<div class="block-content2"><div class="header-news2"></div><jdoc:include type="modules" name="position-left" /></div>
<?php endif; ?>
</div>


<div id="left-sidebar2">

<?php if($this->countModules('news1')) : ?>
<div class="block"></div>
<div class="block-content"><jdoc:include type="modules" name="news1" /></div>
<?php endif; ?>

<?php if($this->countModules('hot-news')) : ?>
<div class="block-content-new1"><div class="block-header1"></div><jdoc:include type="modules" name="hot-news" /></div>
<?php endif; ?>

<div class="block-content-new2"><div class="block-header2"></div><jdoc:include type="modules" name="advertise1" /></div>



<?php if($this->countModules('nazarsanji')) : ?>
<div class="block3"></div>
<div class="block-content3"><jdoc:include type="modules" name="nazarsanji" /></div>
<?php endif; ?>

</div>

<br style="clear: both"/>

</div>


<div id="footer">


<div class="block-content"><jdoc:include type="modules" name="copyright" /></div>

</div>


</div>

</body>



</html>

کد css:


#wrapper {width:1349px;height:auto; background: url(../images/body-bg.gif);margin: auto}

body {width:1349px auto;margin:0 auto;background-color: white;font-family:tahoma; font-size: 9.25pt}

a:link{text-decoration: none; color: blue}
a:visited{text-decoration: none; color: blue}
a:hover{text-decoration: none; color: red;}




#header{max-width:100% auto;height: 200px; background: url(../images/sorkh.png); border-radius:10px;padding-left:5%}

#container{width:100%;height:auto; margin:auto}
#menu{max-width:auto;height: 34px;background: url(../images/menunew.png);display:block; border-radius: 10px;margin-top:0.25%;padding-right:0.5%;}

#menu .dj-main{width:auto;font-family:tahoma;font-size:8pt;font-weight:none;float:right;border-radius:10px;direction:rtl}



#*****nagsearch{float:left;text-align:right;margin-left:1%;margin-top:0.5%;direction:rtl;}
.gsearch{border-radius:5px;background-color:#f0e7d6;font-family:tahoma}
.gseachbox{border-radius:3px;background-color:silver;font-family:tahoma}
#breadcrumbs{background: white;max-width: 100%; height: auto ;display: block; font-family: tahoma; margin-top: 2px; border-radius: 10px;padding-right: 1%;text-align:right}


#right-sidebar{width:20%;height:auto;background-color:none;float:right;margin-right:0.75%;margin-top:0.15%;margin-bottom:0.5%;direction:rtl;border-radius:10px}
#right-sidebar .block{width:100% auto;height:30px;background: url(../images/menu-asli.png);margin-right:0.5%;margin-top:2%;direction:rtl;text-align:center;border-radius:10px}
#right-sidebar .block2{width:100% auto;height:30px;background: url(../images/shohadanew.png);margin-right:0.5%;margin-top:2%;direction:rtl;text-align:center;border-radius:10px}
#right-sidebar .block3{width:100% auto;height:30px;background: url(../images/owghat-header.png);margin-right:0.5%;margin-top:2%;direction:rtl;text-align:center;border-radius:10px}
#right-sidebar .block4{width:100% auto;height:30px;background: url(../images/owghat-header.png);margin-right:0.5%;margin-top:2%;direction:rtl;text-align:center;border-radius:10px}

#right-sidebar .block5{width:100% auto;height:30px;background: url(../images/owghat-header.png);margin-right:0.5%;margin-top:2%;direction:rtl;text-align:center;border-radius:10px}
#right-sidebar .block-content-owghat{min-width:100%;height:auto;background-color:#ffffff;border-radius:10px;direction:rtl;padding-bottom:2%;padding-top:5%;}

#right-sidebar .block-content{min-width:100%;height:auto;background-color:#ffffff;border-radius:10px;padding-right:1%;padding-left:1%;padding-bottom:2%;padding-top:5%}



#content{width:42%;height:auto;float:right;background-color:#ffffff;margin-right:0.5%;margin-top:0.5%;margin-bottom:0.5%;border-radius:10px;direction:rtl}

#content .titr{max-width:100%;height:30px;background: url(../images/titr2.png);direction:rtl;text-align:right;border-radius:10px;}

#content .slideshow{width:95% auto;height:255px auto;border-radius:10px;margin-right:2%;margin-left:2%;margin-top:1%;}

#content .content-content{max-width:100%;height:auto;text-align:right;padding-right:2%;padding-left:2%;padding-bottom:2%;border-radius:10px;direction:rtl}

#content .block-content1{width:49%;height:auto;display:block;text-align:right;float:right;border-radius:5px;margin-top:0.5%;padding-right:0.5%}
#content .block-content1 .header-news1{width:100%;height:30px;display:block;text-align:right;float:right;border-radius:5px;background-color:blue}


#content .block-content2{width:49%;height:auto;display:block;text-align:right;float:left;border-radius:5px;margin-top:0.5%;padding-right:0.5%}
#content .block-content2 .header-news2{width:100%;height:30px;display:block;text-align:right;float:left;border-radius:5px;background-color:blue}



img{
   opacity: 1;
   transition: opacity .25s ease-in-out;
   -moz-transition: opacity .25s ease-in-out;
   -webkit-transition: opacity .25s ease-in-out;}
img:hover {opacity: 0.5;border-radius:10px}

#left-sidebar2{width:35.75%;height:auto;background-color:none;float:left;margin-left:0.75%;margin-top:0.25%;direction:rtl;border-radius:10px;}

#left-sidebar2 .block{width:100%;height:30px;background: url(../images/defa.png);margin-left:0.5%;margin-top:0.5%;text-align:center;border-radius:10px}
#left-sidebar2 .block-content{width:100%;height:auto;background-color:#ffffff;border-radius:10px;padding-top:2%;text-align:right;float:left}



#left-sidebar2 .block-content-new1{width:59%;height:auto;float:right;background-color:#ffffff;border-radius:10px;margin-top:0.5%;}
#left-sidebar2 .block-content-new1 .block-header1{width:100%;height:30px;background: url(../images/anavin-new.png);padding-right:2%}


#left-sidebar2 .block-content-new2{width:39%;height:auto;float:left;display:block;background-color:#ffffff;border-radius:10px;margin-top:0.5%}
#left-sidebar2 .block-content-new2 .block-header2{width:100%;height:30px;background: url(../images/barnameha4.gif);display:block}

#left-sidebar2 .block3{width:60%;height:30px;background: url(../images/nazarsanji-new.png);float:right;margin-right:0.5%;margin-top:0.5%;direction:rtl;text-align:center;border-radius:10px}
#left-sidebar2 .block-content3{width:60%;height:auto;float:right;border-radius:10px;background-color:#ffffff;margin-bottom:0.5%}




#polldiv_1{direction:rtl; text-align: right;padding-right:1%}



#footer{max-width:100%;height: 150px;background: url(../images/footer.png);text-align: center; padding-top: 2%;border-radius:10px}
#footer .block-content{width:45%; height: auto;float:left; text-align: center;background:#4647af;margin-left: 35%;margin-top:3%;border-radius: 10px;position:relative}
#footer .block-content .dj-main{width:auto;font-family: tahoma;font-size:12pt;float:right;border-radius:10px;direction:rtl}

ویرایش شده در توسط ansar2000

Share this post


Link to post
Share on other sites

اگر بخواهیم در یک دایو در صورت نبود یا غیر فعال بودن ماژول نمایش داده نشه مثل دستور زیر عمل کنید

<?php if ($this->countModules('right')): ?>
   	<div id="right">
	<jdoc:include type="modules" name="right" style="xhtml" />
	</div><!--right-->
       <?php endif; ?>

به این ترتیب اگر در دایو right ماژولی فعال نبود دایو نمایش داده نمیشه

Share this post


Link to post
Share on other sites

حلا فرض کنید شما در سمت راست سایت 3 دایو به اسم ها ی right2 right3 right4 دارید و در سمت چپ اون کانتنت هست

و میخواهید اگر هر کدوم از این دایوها فعل بود عرض کانتنت کمتر و اگر همگی غیر فعال بودند عرض کانتنت بیشتر شده و جای خالی اون رو پر کنه

برای این کار از الگوی زیر استفاده کنید

<?php if ($this->countModules('right2')) {?>
<div id="content" style="width: 700px;"> <jdoc:include type="component" /> </div>
<?php } else { ?>
<?php if ($this->countModules('right3')) {?>
<div id="content" style="width: 700px;"> <jdoc:include type="component" /> </div>
<?php } else { ?>
<?php if ($this->countModules('right4')) {?>
<div id="content" style="width: 700px;"> <jdoc:include type="component" /> </div>
<?php } else { ?>
<div id="content" style="width: 950px;"> <jdoc:include type="component" /> </div>
<?php } ?>
<?php } ?>
<?php } ?>

در پناه حق

التماس دعا

Share this post


Link to post
Share on other sites

سلام.مشکل من اینه که دایو های تو در تو دارم.مثلا یک ستون که یک دابو هست و داخل اون دایو سه تا دایو دیگر هست که توی اون دایوها ماژول ها قرار داره...نمی دونم چطوری چندتا دایو رو کلا با هم غیرفعال کنم و بجای اون قسمت کناری اون عرضش زیاد بشه.کمک کنید...!

Share this post


Link to post
Share on other sites

درود مهندس زارع توضیح کامل دادند شما برای هر موقعیت مانند بالا عمل کنید.طولش رو نسبت به موقعیت هاتون اعمال کنید یاحق

Share this post


Link to post
Share on other sites

برای ارسال نظر یک حساب کاربری ایجاد کنید یا وارد حساب خود شوید

برای اینکه بتوانید نظر ارسال کنید نیاز دارید که کاربر سایت شوید

ایجاد یک حساب کاربری

برای حساب کاربری جدید در انجمن ما ثبت نام کنید. عضویت خیلی ساده است !


ثبت نام یک حساب کاربری جدید

ورود به حساب کاربری

دارای حساب کاربری هستید؟ از اینجا وارد شوید


ورود به حساب کاربری