Ostatnio dodane zdjęcia

selekcjoner

Avatar: selekcjoner

2013-04-27 13:18

W pliku core/pages.php znajdź:

 // end function generatePageParents 


i zamień na:


// end function generatePageParents



  /**
  * Last Added Photo
  * @return string
  */
  
public function lastAddedPhoto( ){
    global 
$lang$config;

    
$oFFS FlatFilesSerialize::getInstance( );
    
$aFiles $oFFS->getDataDB_PAGES_FILES );
   
    
$iCount count$aFiles );
    if( isset( 
$aFiles ) && is_array$aFiles ) && $iCount ){
      foreach( 
$aFiles as $iFile => $aData ){
        if( 
$aData['iPhoto'] == ){ 
          
$aSort[] = Array( $aData['iFile'], $iFile );
        }
      } 
// end foreach
    
}
   
    if( isset( 
$aSort ) ){
      
rsort$aSort );

      
$iMax 2;
      
      if( 
$iCount $iMax )
        
$iCount $iMax;

      
$content null;
      
      for( 
$i 0$i $iCount$i++ ){
        
$aData $aFiles[$aSort[$i][1]];
        
$aData['sLinkName'] = $this->aPages[$aData['iPage']]['sLinkName'];
        
$aData['sAlt'] = isset( $aData['sDescription'] ) ? $aData['sDescription'] : null;
 
        
$content .= '<li>'.( isset( $aData['sLinkName'] ) ? '<a href="'.$aData['sLinkName'].'">' null ).'<img src="'.$GLOBALS['config']['dir_files'].$GLOBALS['config']['images_sizes'][$aData['iSize2']].'/'.$aData['sFileName'].'" alt="'.$aData['sAlt'].'" />'.( isset( $aData['sLinkName'] ) ? '</a>' null );

        if( !empty( 
$aData['sDescription'] ) )
            
$content .= '<h3>'.( isset( $aData['sLinkName'] ) ? '<a href="'.$aData['sLinkName'].'">' null ).$aData['sDescription'].( isset( $aData['sLinkName'] ) ? '</a>' null ).'</h3>';

          
$content .= '</li>';
      } 
// end for

    
}
    return 
'<div id="lastPhoto"><div class="type">Foto</div><div class="content">'.$content.'</div></div>';
  } 
// end function lastAddedPhoto   



W templates/default/style.css dodaj:


#lastPhoto{margin-bottom:10px;padding:5px 20px;}
#lastPhoto li{margin:5px 0 10px 0;background:inherit;color:#5d6771;text-align:center;}
#lastPhoto .type{margin-top:10px;padding:5px 13px 10px;font-size:1.667em;font-weight:bold;color:#fff;background:#326e9c url('img/menu4_bg.png') no-repeat left bottom;}
#lastPhoto .content{padding:8px 10px;list-style:none;border-bottom:2px solid #01476e;line-height:1.5em;text-align:center;}
#lastPhoto img{padding:1px;background:#c0bfbf;border:4px solid #eee;-webkit-box-shadow:0 0 10px rgba(48,47,47,.4);box-shadow:0 0 4px rgba(48,47,47,.4);}
#lastPhoto img:hover{border:4px solid #c9cdce;}
#lastPhoto h3{font-size:1.1em;padding:5px 0;}
#lastPhoto a{text-decoration:none;}
#lastPhoto a:hover{background:inherit;color:#666;text-decoration:underline;}
#lastPhoto .price, #lastPhoto .noPrice{padding:2px 0 0;background:inherit;color:#c22463;}
#lastPhoto strong{padding:0 2px 0 5px;font-weight:bold;}
#lastPhoto .price em{padding:0;background:inherit;color:#666;font-style:normal;}
#lastPhoto .price span{color:#666;font-weight:bold;padding-left:5px;}



W templates/default/_header.php znajdź:


<?php echo $oPage->throwMenu2$iContent); // content of left menu ?>  


i zamień na:

<?php echo $oPage->throwMenu2$iContent); 
          echo 
$oPage->lastAddedPhoto( );  // content of left menu ?> 




Ilość ostatnio dodanych zdjęć ustawiamy w zmiennej: $iMax = 2;

» Quick.Cms v5.x

simlution.org

Do góry
o nas | kontakt