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/sources/portal_plugins/gallery.php
<?php

/*
+--------------------------------------------------------------------------
|   Invision Power Board v2.1.5
|   =============================================
|   by Matthew Mecham
|   (c) 2001 - 2005 Invision Power Services, Inc.
|   http://www.invisionpower.com
|   =============================================
|   Web: http://www.invisionboard.com
|   Time: Wed, 04 Jan 2006 19:53:17 GMT
|   Release: 2d174325a5cb8288fdab03b953f0e659
|   Licence Info: http://www.invisionboard.com/?license
+---------------------------------------------------------------------------
|   > $Date: 2005-12-30 23:02:19 +0000 (Fri, 30 Dec 2005) $
|   > $Revision: 109 $
|   > $Author: bfarber $
+---------------------------------------------------------------------------
|
|   > PORTAL PLUG IN MODULE: Gallery
|   > Module written by Matt Mecham
|   > Date started: Tuesday 2nd August 2005 (12:56)
+--------------------------------------------------------------------------
*/

/**
* Portal Plug In Module
*
* Portal Gallery functions
*
* @package		InvisionPowerBoard
* @subpackage	PortalPlugIn
* @author		Matt Mecham
* @copyright	Invision Power Services, Inc.
* @version		2.1
*/

/**
* Portal Gallery In Module
*
* Portal Blog functions
* Each class name MUST be in the format of:
* ppi_{file_name_minus_dot_php}
*
* @package		InvisionPowerBoard
* @subpackage	PortalPlugIn
* @author		Matt Mecham
* @copyright	Invision Power Services, Inc.
* @version		2.1
*/
class ppi_gallery
{
	/**
	* IPS Global object
	*
	* @var string
	*/
	var $ipsclass;
	var $glib;
	var $img_list;
	var $category;

	/**
	* Array of portal objects including:
	* good_forum, bad_forum
	*
	* @var array
	*/
	var $portal_object = array();
	
	/*-------------------------------------------------------------------------*/
 	// INIT
	/*-------------------------------------------------------------------------*/
 	/**
	* This function must be available always
	* Add any set up here, such as loading language and skins, etc
	*
	*/
 	function init()
 	{
 		/*
 		* Root path  */
 		$this->ipsclass->gallery_root = "./modules/gallery/";
 		
 		if( !is_dir( $this->ipsclass->gallery_root ) )
 		{
	 		return;
 		}
 		
 		/*
 		* Load up gallery's library file */
 		require( $this->ipsclass->gallery_root.'lib/gallery_library.php' );
        $this->glib = new gallery_lib();
        $this->glib->ipsclass = &$this->ipsclass;
        
		/*
		* Image listing */
		require( $this->ipsclass->gallery_root . 'lib/imagelisting.php' );
		$this->img_list = new ImageListing();
        	$this->img_list->ipsclass =& $this->ipsclass;
            $this->img_list->glib =& $this->glib;
        $this->img_list->init();
        
        /*
        * Lang and template */
        $this->ipsclass->load_language( 'lang_gallery' );
        $this->ipsclass->load_template( 'skin_gallery_portal' );
 	}
 	
 	/*-------------------------------------------------------------------------*/
	// MAIN FUNCTION
	/*-------------------------------------------------------------------------*/
	/**
	* Main function
	*
	* @return VOID
	*/
	function gallery_show_random_image()
	{
 		if( !is_dir( $this->ipsclass->gallery_root ) )
 		{
	 		return;
 		}
 				
		//-----------------------------------------
		// INIT
		//-----------------------------------------
		$this->ipsclass->DB->build_query( array(
				'select'	=>	'*',
				'from'		=>	'gallery_images',
				'where'		=>	'approved=1',
				'order'		=>	'RAND()',
				'limit'		=>	array( 0,1 ) ) 
		);
		$this->ipsclass->DB->exec_query();
		$i = $this->ipsclass->DB->fetch_row();
		$image = $this->glib->make_image_link( $i, $i['thumbnail'] );
 		return $this->ipsclass->compiled_templates['skin_gallery_portal']->tmpl_random_image_wrap( $image );
  	}

}

?>