Jump to content

Download: Random Gallery Image


NiftyWolfie

Recommended Posts

File Name: Random Gallery Image
File Submitter: NiftyWolfie
File Submitted: 14 Nov 2010
File Updated: 01 Jun 2011
File Category: IP.Content Blocks

This feed block will show a single random image from the gallery. It only shows the image and nothing else. The image is clickable taking you to that image in your gallery.

*There is no CSS provided with this block as it uses the .general block CSS*


Update
For Gallery V4 owners you require the zip file.

Click here to download this file

Link to comment
  • 1 month later...
  • 5 weeks later...
  • 1 month later...

i have this error:

Fatal error: Uncaught exception 'Exception' with message 'glib is not an object' in /home/elbrollo/public_html/admin/sources/base/ipsRegistry.php:967 Stack trace: #0 /home/elbrollo/public_html/admin/sources/base/ipsRegistry.php(1060): ipsRegistry::getClass('glib') #1 /home/elbrollo/public_html/admin/applications_addon/ips/ccs/sources/pages.php(416) : eval()'d code(3660): ipsRegistry->__get('glib') #2 /home/elbrollo/public_html/admin/applications_addon/ips/ccs/sources/pages.php(416) : eval()'d code(3645): skin_ccs->__f__fd3d90a6a475386463118c9f931af9b4('Random Gallery ...', Array) #3 /home/elbrollo/public_html/admin/applications_addon/ips/ccs/sources/blocks/feed/data_sources/gallery.php(1141): skin_ccs->feed__generic_18('Random Gallery ...', Array) #4 /home/elbrollo/public_html/admin/applications_addon/ips/ccs/sources/blocks/feed/admin.php(497): feed_gallery->executeFeed(Array) #5 /home/elbrollo/public_html/admin/applications_addon/ips/ccs/sources/blocks/adminInterface.php(188): adminBlockHelper_feed->recacheBlock(Array) # in /home/elbrollo/public_html/admin/sources/base/ipsRegistry.php  on line 967

i have the same error if i make a new feed block with this code (that in all other IP.Content display images:

<php>require_once( IPSLib::getAppDir('gallery') . "/app_class_gallery.php" );

$_d = new app_class_gallery( $this->registry );</php>




<div style="  width: 861px; height: 110px; background-color: #3D3D3D; -moz-border-radius: 5px; -webkit-border-radius: 5px; padding: 10px; margin: 0px; border: 0px solid #000;" >

<div align="center">

        <br>

                <if test="is_array( $records ) && count( $records )">

                {parse striping="feed_striping" classes="row1,row2 altrow"}

                <foreach loop="$records as $r">

                <span style="   margin: 20px;"><a href='{$r['url']}' rel='bookmark' title='{$r['title']}'>{$this->registry->getClass('glib')->makeImageLink( $r, 1 )}</a>


                </span>

                </foreach>

                </if>

    </div>  

</div>

Link to comment

seems method above no longer works as ipcontent/ipgallery has changed the way it pulls images




a quick fix may be to build the thumbnail using the file names etc found in the template variables
eg



<img src='/forum/uploads/{$r['directory']}/tn_{$r['masked_file_name']}' width="100" height="100" class="galattach  " title='{$r['title']}' alt='{$r['title']}' id='' />

Link to comment

anyone know how to make images like Recently Updated Albums http://community.invisionpower.com/gallery/ with background image? i dont find this image.....



In your skin css open ipgallery.css you should have (if not, add) the following.

.galattach.cover_img_50 {

	background: url("{style_images_url}/gallery/50x50.png") no-repeat 4px 4px;

	padding: 13px;

}


.galattach.cover_img_75 {

	background: url("{style_images_url}/gallery/75x75.png") no-repeat 0px 0px;

	padding: 13px;

}


If you have the css code and do not have the images, you can get them below.
.

Link to comment
  • 3 weeks later...
  • 1 month later...

Hi mate,

I'm getting an error with this. I downloaded and imported the XML file, and I'm running Gallery 4.0.4. This is the error I get at the end of configuring the block and I go to save it:

Fatal error: Uncaught exception 'Exception' with message 'glib is not an object' in /home/talkford/public_html/admin/sources/base/ipsRegistry.php:967 Stack trace: #0 /home/talkford/public_html/admin/sources/base/ipsRegistry.php(1060): ipsRegistry::getClass('glib') #1 /home/talkford/public_html/admin/applications_addon/ips/ccs/sources/pages.php(416) : eval()'d code(10755): ipsRegistry->__get('glib') #2 /home/talkford/public_html/admin/applications_addon/ips/ccs/sources/pages.php(416) : eval()'d code(10740): skin_ccs->__f__8a9a46e9b9a2fd5642c45d9d02f6b9d1('Random Gallery ...', Array) #3 /home/talkford/public_html/admin/applications_addon/ips/ccs/sources/blocks/feed/data_sources/gallery.php(1141): skin_ccs->feed__generic_61('Random Gallery ...', Array) #4 /home/talkford/public_html/admin/applications_addon/ips/ccs/sources/blocks/feed/admin.php(497): feed_gallery->executeFeed(Array) #5 /home/talkford/public_html/admin/applications_addon/ips/ccs/sources/blocks/feed/admin.php(436): adminBlockHelper_feed->recacheBlock(Array) #6 in /home/talkford/public_html/admin/sources/base/ipsRegistry.php on line 967



I also get the same error when attempting to preview the block from within IP.Content.

Any ideas? It seems to centre around that 'glib', whatever that is.
Link to comment

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...