Are you first timer at lazacode.org? Why not join us and start exchange your programming knowledge with everyone. Register today!

PHP - Condition within condition

0 votes
25 views
added Nov 14 in PHP by LC Marshal Lieutenant (14,830 points)
<!-- banderole ads time condition -->  
<?php
  $today      = date('c');
  $startdate  = date('c', mktime(0,0,0,11,13,2018)); // Example: Hour, Minute, Second, Month, Day, Year
  $enddate    = date('c', mktime(23,59,59,11,12,2020)); 
  if ($today >= $startdate && $today < $enddate) :
?>  
  <?php if (drupal_is_front_page()): ?>
  <div class="banderole">   
    <div class="banderole-content">   
      <span class="slide-close"><i class="ion-close"></i></span>    
      <div class="slide-trigger">   
        <div id='div-gpt-ad-xxxxxxxxxxx-0'></div>   
        <script>    
          googletag.cmd.push(function() {     
            googletag.display('div-gpt-ad-xxxxxxxxxxx-0');    
          });   
        </script>         
      </div>    
      <div class="slide-trigger trigger"></div>     
       <!-- /181891612/ListDev_Banderole -->
      <div id='div-gpt-ad-xxxxxxxxxxx-0'></div>   
      <script>    
        googletag.cmd.push(function() {     
          googletag.display('div-gpt-ad-xxxxxxxxxxx-0');    
        });       
      </script>   
    </div>    
  </div>
  <?php else :?>
    <div class="banderole-ros">   
      <div class="banderole-content ros">   
        <span class="slide-close"><i class="ion-close"></i></span>    
        <div class="slide-trigger">   
          <div id='div-gpt-ad-xxxxxxxxxxx-0'></div>   
          <script>    
            googletag.cmd.push(function() {     
              googletag.display('div-gpt-ad-xxxxxxxxxxx-0');    
            });   
          </script>         
        </div>    
        <div class="slide-trigger trigger"></div>     
         <!-- /181891612/ListDev_Banderole -->
        <div id='div-gpt-ad-xxxxxxxxxxx-0'></div>   
        <script>    
          googletag.cmd.push(function() {     
            googletag.display('div-gpt-ad-xxxxxxxxxxx-0');    
          });       
        </script>   
      </div>    
    </div>
  <?php endif;?> 

<?php else :?>
  <!-- do nothing -->
<?php endif;?> 
 

 

Please log in or register to response this reference.

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...