Jump to content


Tutorial info Visit support topic

  • Added on: Feb 12 2011 01:22 PM
  • Date Updated: Feb 12 2011 02:11 PM
  • Views: 9971
 


* * * * *
0 Ratings

Last XX Images

Last X/XX images in a IP.Content Page

Posted by Nostaglia on Feb 12 2011 01:22 PM
This is for IP.content 2.1.2 page & for IP.Gallery 3.2.2


For RAW PHP IP.Content page ONLY
(the Screenshot may be different on your website, since i use a custom skin)

Demo:

http://nordensbilder.com

last xx images in content.png


Add the code in in a RAW PHP page in IP.Content!

/* Init */
$return  = "";
$to_show = 15;


EOF;
/* Add our custom CSS code */
$this->registry->output->addToDocumentHead( 'inlinecss', $css );
$this->registry->output->addToDocumentHead( 'importcss',  $this->settings['public_dir'] . 'style_css/' .  $this->registry->output->skin['_csscacheid'] . '/ipgallery.css'  );


/* Set our HTML */
$return = <<<EOF
    	<div id="left_bar">
    	<div class="gallery_row row2">
EOF;

/* Load up our Gallery stuff */
require_once( IPSLib::getAppDir( 'gallery' ) . '/app_class_gallery.php' );
$app_class_gallery = new app_class_gallery( ipsRegistry::instance() );
require( GALLERY_LIBS . 'lib_imagelisting.php' );
$img_list = new lib_imagelisting( $this->registry );

/* Get the images */
$img_list->mod = false;
$img_list->getListingData( array( 'st'      	=> 0,
                            	'show'      	=> $to_show,
                            	'approve'   	=> 1,
                            	'sort_key'  	=> 'i.id',
                            	'order_key' 	=> 'DESC',
                            	'allow_cats'   => $this->registry->category->getAllowedCats(),
                            	'allow_albums' => $this->registry->glib->getAllowedAlbums(),
                    	)   	);

/* Build the image list */
$return .= $img_list->getHtmlListing();

/* Finish up the HTML */
$return .= <<<EOF
    	</div>
</div>
EOF;

/* Print the results */
print $return;


How to add more or less images:

1) at the top of the code:
/
* Init */
$return  = "";
$to_show = 15;

ONLY edit the number! as here: its 15

Powered by Tutorials 1.4.1 © 2017, by Michael McCune
IPB Skin By Virteq