Files
IPB/upload/sources/components_public/profile/gallery.php
T
2025-12-19 00:22:37 -08:00

153 lines
4.5 KiB
PHP

<?php
/*
+--------------------------------------------------------------------------
| Invision Power Board
| =============================================
| by Matthew Mecham
| (c) 2001 - 2006 Invision Power Services, Inc.
| http://www.invisionpower.com
| =============================================
| Web: http://www.invisionboard.com
| Licence Info: http://www.invisionboard.com/?license
+---------------------------------------------------------------------------
| > $Date: 2006-08-01 17:02:55 +0100 (Tue, 01 Aug 2006) $
| > $Revision: 425 $
| > $Author: matt $
+---------------------------------------------------------------------------
|
| > Personal Profile Portal Class: Blog
| > Module written by Matt Mecham
| > Date started: 2nd August 2006
|
+--------------------------------------------------------------------------
*/
/**
* Main content
*
*/
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
exit();
}
class profile_gallery
{
/**
* Global IPSCLASS
* @var object
*/
var $ipsclass;
/*-------------------------------------------------------------------------*/
// Return data
/*-------------------------------------------------------------------------*/
/**
* Returns a block of HTML back to the ajax handler
* which then replaces the inline content with the HTML
* returned.
*
*/
function return_html_block( $member=array() )
{
define( 'GALLERY_PATH', ROOT_PATH.'modules/gallery/' );
$this->ipsclass->load_language( 'lang_gallery' );
//-----------------------------------------
// Get gallery library and API
//-----------------------------------------
require_once( ROOT_PATH.'sources/api/api_core.php' );
require_once( ROOT_PATH . 'sources/api/gallery/api_gallery.php' );
require_once( ROOT_PATH . 'modules/gallery/lib/gallery_library.php' );
$this->glib = new gallery_lib();
$this->glib->ipsclass = $this->ipsclass;
//-----------------------------------------
// Create API Object
//-----------------------------------------
$gal_api = new api_gallery;
$gal_api->ipsclass = $this->ipsclass;
$gal_api->glib = & $this->glib;
//-----------------------------------------
// Get images
//-----------------------------------------
$images = $gal_api->return_gallery_data( $member['id'], 6, 0 );
//-----------------------------------------
// Get Image Library
//-----------------------------------------
require_once ROOT_PATH . 'modules/gallery/lib/imagelisting.php';
$img_list = new ImageListing();
$img_list->ipsclass =& $this->ipsclass;
$img_list->glib = $this->glib;
$img_list->init();
//-----------------------------------------
// Pass some values from API
//-----------------------------------------
$img_list->res = $gal_api->res;
$img_list->total_images = $gal_api->total;
//-----------------------------------------
// Ready to pull formatted stuff?
//-----------------------------------------
$output = "<script type='text/javascript'>var ids_to_imgs = new Array();</script>";
$output .= $img_list->img_html->container_row_top();
$output .= $img_list->get_html_listing( array( 'imgs_per_col' => 3,
'imgs_per_row' => 2,
'can_rate' => ( $this->ipsclass->vars['gallery_use_rate'] AND $this->ipsclass->member['g_rate'] ) ? 1 : 0,
) );
$output .= $img_list->img_html->container_row_bottom();
$output .= "<script type='text/javascript'>menu_do_global_init();</script>";
//-----------------------------------------
// Macros...
//-----------------------------------------
if ( ! is_array( $this->ipsclass->skin['_macros'] ) OR ! count( $this->ipsclass->skin['_macros'] ) )
{
$this->ipsclass->skin['_macros'] = unserialize( stripslashes($this->ipsclass->skin['_macro']) );
}
if ( is_array( $this->ipsclass->skin['_macros'] ) )
{
foreach( $this->ipsclass->skin['_macros'] as $row )
{
if ( $row['macro_value'] != "" )
{
$output = str_replace( "<{".$row['macro_value']."}>", $row['macro_replace'], $output );
}
}
}
$output = str_replace( "<#IMG_DIR#>", $this->ipsclass->skin['_imagedir'], $output );
$output = str_replace( "<#EMO_DIR#>", $this->ipsclass->skin['_emodir'] , $output );
return $output;
}
}
?>