HEX
Server: Apache/2.4.59 (Debian)
System: Linux skycube.cz 4.19.0-25-amd64 #1 SMP Debian 4.19.289-2 (2023-08-08) x86_64
User: ilya (534)
PHP: 7.3.31-1~deb10u7
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
Upload Files
File: /var/www/ilya/data/www/kamforum.ru/modules/gallery/lib/containerlisting.php
<?php
/*
+--------------------------------------------------------------------------
|   Invision Gallery Module v<#VERSION#>
|   ========================================
|   by Adam Kinder
|   (c) 2001 - 2005 Invision Power Services
|   http://www.invisionpower.com
|   ========================================
|   Email: adam@invisionpower.com
+---------------------------------------------------------------------------
|   > Date December 18, 2005, 4:59 pm
|   > Release f5ba00991bc63895d988f560e497967f
|   > Main Module
|   > Original Script written by Joshua Williams
|	> $Id$
+---------------------------------------------------------------------------
*/


/**
* Library/Container Listing
*
* Handles printing  image listings
* and such.
*
* @package		Gallery
* @subpackage	Library
* @author   	Adam Kinder
* @version		<#VERSION#>
* @since 		1.3
*/

    class ContainerListing
    {
        var $res = '';
        var $ipsclass;
        var $glib;
        var $img_html;
        var $category_cache = array();

        function ContainerListing()
        {
         
        }
        
        function ContainerInit() {
        	/*
            * Fatal error bug fix */
            if( !is_object( $this->ipsclass->compiled_templates['skin_gallery_imagelisting'] ) ) {
        	   	$this->ipsclass->load_template('skin_gallery_imagelisting');                       
            }
            $this->img_html = $this->ipsclass->compiled_templates['skin_gallery_imagelisting'];
        }

        /**
         * ImageListing::get_listing_data()
         * 
         * @param array $params
         * @return nothing
         **/
        function get_listing_data( $params )
        {	
			if( $params['album'] )
			{
				$this->album_mode = 1;
	            // Get Albums
    	        $this->ipsclass->DB->cache_add_query( 'get_album_list', 
				 			   array( 'pre'              => "a",
								 	  'SORT_KEY'         => 'name',
    	                              'ORDER_KEY'        => 'asc',
    	                              'st'               => intval( $ibforums->input['st'] ),
    	                              'gallery_user_row' => 100,
    	                              'mid'              => " AND a.member_id={$params['member_id']}",
				 				   ), 'gallery_sql_queries'      );									 
			}
			else
			{
				$this->album_mode = 0;
   	        	$this->ipsclass->DB->cache_add_query( 'get_mem_posted_categories', 
				 			   array( 
				 			          'mid'        => $params['member_id'],
				 			          'allow_cats' => $params['category_cache'],
				 				   ), 'gallery_sql_queries'      );									 
					
			}
            $this->res = $this->ipsclass->DB->simple_exec();
            
            $this->total_items = $DB->get_num_rows( $this->res );
        }

        /**
         * ImageListing::get_html_listing()
		 * 
         * @param array $options
         * @return string
         **/
        function get_html_listing( $options=array() )
        {
  			if( $this->total_items )
  			{
                $output .= $this->img_html->container_row_top();  			
                $output .= $this->img_html->view_begin_row();
                
                while( $i = $this->ipsclass->DB->fetch_row( $this->res ) )
                {
                    if( $col_count >= 2 )
                    {
                        $output .= $this->img_html->view_end_row();
                        $output .= $this->img_html->view_begin_row();
                        $col_count = 0;
                    }
                    $col_count++;
                    
                    $i['image'] = $this->glib->make_image_link( $i, $i['thumbnail'] );
                    $i['date']    = $this->ipsclass->get_date( $i['date'], 'LONG' );
                    $i['member']    = $this->glib->make_name_link( $i['member_id'], $i['mname'] );
					
					if( $this->album_mode )
					{				
	                    $output .= $this->img_html->view_album_row( $i );
	                }
	                else
	                {
	                    $output .= $this->img_html->view_cat_row( $i );	                
	                }

                }
                
                if( $col_count != 0 )
                {
                    $output .= $this->img_html->view_end_row();
                } 
                
                $output .= $this->img_html->container_row_bottom();  			
                
  			}
  			else
  			{
                $output .= $this->img_html->basic_row( 'none_found' );  			
  			}
  			
  			return $output;
        }
    }
?>