Advertisement
ruslanx144

Untitled

Nov 14th, 2016
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.08 KB | None | 0 0
  1. <?php
  2. session_start();
  3. ?>
  4. <?php
  5.  
  6. include("system_header.php");
  7.  
  8.  
  9.  
  10. ?>
  11. <?php include("header.php");?>
  12. <a href="userlogin.php">Login/Sign up</a>
  13. <h1>Photo Gallery</h1>
  14.  
  15. <p class="breadcrumb"><a href="/">home</a> &gt; gallery</p>
  16.  
  17. <?php if(count($categories_array)<=0){?>
  18. <p>There are no photo categories, create one or more categories before uploading photos</p>
  19. <?php } ?>
  20.  
  21.  
  22. <?php if(count($categories_array)>0){?>
  23.    
  24.        
  25. <div>
  26.  
  27.     <?php foreach($categories_array as $photo_category=>$photos_array){?>
  28.    
  29.         <?php
  30.         $category_thumbnail = $gallery_url."/layout/pixel.gif";
  31.         if(file_exists('files/'.$photo_category.'/thumbnail.jpg')){
  32.             $category_thumbnail = $gallery_url.'/'.rawurlencode($photo_category).'.jpg';
  33.         }
  34.        
  35.         $category_url = $gallery_url.'/'.rawurlencode($photo_category);
  36.         ?>
  37.        
  38.         <span class="category_thumbnail_span" style="width:<?php echo $settings_thumbnail_width;?>px; height:<?php echo $settings_thumbnail_height+20;?>px;">
  39.         <a class="category_thumbnail_image" href="<?php echo $category_url;?>" style="width:<?php echo $settings_thumbnail_width;?>px; height:<?php echo $settings_thumbnail_height;?>px; background-image:url('<?php echo $gallery_url;?>/layout/lens_48x48.png');" title="<?php echo htmlentities(ucwords(str_replace('-', ' ', $photo_category)), ENT_QUOTES, "UTF-8");?>">
  40.         <img src="<?php echo $category_thumbnail;?>" width="<?php echo $settings_thumbnail_width;?>" height="<?php echo $settings_thumbnail_height;?>" alt="<?php echo htmlentities(ucwords(str_replace('-', ' ', $photo_category)), ENT_QUOTES, "UTF-8");?>" />
  41.         </a>
  42.         <a class="category_thumbnail_title" href="<?php echo $category_url;?>" title="<?php echo htmlentities(ucwords(str_replace('-', ' ', $photo_category)), ENT_QUOTES, "UTF-8");?>">
  43.         <?php echo htmlentities(str_replace('-',' ', truncate_by_letters($photo_category, 16, '..')), ENT_QUOTES, "UTF-8");?> (<?php echo count($photos_array);?>)
  44.         </a>
  45.         </span>
  46.    
  47.  
  48.     <?php } ?>
  49.  
  50. </div><!-- end of categories container -->
  51.  
  52. <?php } ?>
  53.  
  54.  
  55. <?php include("footer.php");?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement