Support Forums | Demo Gallery [1.x] [2.x] | Downloads | News | Site Map ]
Nuked Gallery
  Create a FREE account or Login   As a guest, you don't have access to our FULL navigation system.
 Forum FAQForum FAQ   StatisticsStatistics   SearchSearch   UsergroupsUsergroups   FavoritesFavorites  

random images in forum

 
Post new topic   Reply to topic    NukedGallery.net Forum Index » phpBB Integration » phpBB3 / Gallery 2 Integration View previous topicPrinter friendly versionView next topic
Author Message
iain

User
User


Joined: Dec 26, 2007
Posts: 30

PostPosted: Fri Mar 14, 2008 11:19 am    Post subject: random images in forum Reply with quote

can I have four random images from my gallery on my forum first page, under the main banner?
how can I do that?


Thanks

Iain
www.lowriderforums.com
Back to top
Offline View user's profile Send private message Visit poster's website
AdBot
   Post subject: random images in forum  

Back to top
jettyrat

Moderator
Moderator


Joined: Nov 28, 2005
Posts: 1144

PostPosted: Fri Mar 14, 2008 2:04 pm    Post subject: Re: random images in forum Reply with quote

http://codex.gallery2.org/Gallery2:Modules:imageblock [gallery2.org]
Back to top
Offline View user's profile Send private message
iain

User
User


Joined: Dec 26, 2007
Posts: 30

PostPosted: Sat Mar 15, 2008 2:15 am    Post subject: Re: random images in forum Reply with quote

thankyou..................
Back to top
Offline View user's profile Send private message Visit poster's website
iain

User
User


Joined: Dec 26, 2007
Posts: 30

PostPosted: Mon Mar 17, 2008 6:31 am    Post subject: Re: random images in forum Reply with quote

Embarassed

I cant understand that.............
I seem to remember that url_fopen is not available on my server.

can anyone make it simpler for me? Embarassed
Back to top
Offline View user's profile Send private message Visit poster's website
iain

User
User


Joined: Dec 26, 2007
Posts: 30

PostPosted: Tue Mar 18, 2008 5:38 am    Post subject: Re: random images in forum Reply with quote

So I added this code to the end of my overall header.html and nothing happens.

Code: › <?php
 /* You'll have to change the /gallery2/ thing in the following 2 lines probably */
 require_once(dirname(__FILE__) . '/gallery/embed.php');
 $ret = GalleryEmbed::init(array('fullInit' => true, 'embedUri' => '/', 'g2Uri' => '/gallery/main.php'));
 if ($ret) {
     print 'GalleryEmbed::init failed, here is the error message: ' . $ret->getAsHtml();
     exit;
 }
 /*
  * See "Site admin" -> "image block" for all available options. the parameters are the same
  * as for the external imageblock
  */
 list ($ret, $bodyHtml, $headHtml) = GalleryEmbed::getImageBlock(array('blocks' => 'randomImage|randomImage|randomImage|randomImage',
                                                                 'show' => 'title|date'));
 if ($ret) {
     print 'GalleryEmbed::getImageBlock failed, here is the error message: ' . $ret->getAsHtml();
     exit;
 }
 /* $bodyHtml contains the image block. print it somewhere on your website */
 print $bodyHtml;
 /*
  * $headHtml is not required. if you use imageframes for your imageblocks, you need to print
  * $headHtml in the <head> section of your web page
  */
 ?>


I dont know where to put the css.... with the other code at the top of overall header or in the css file?
At this stage I dont think i've created an external image block to call have I ?
Have i put this code in the wrong place?
Back to top
Offline View user's profile Send private message Visit poster's website
jettyrat

Moderator
Moderator


Joined: Nov 28, 2005
Posts: 1144

PostPosted: Tue Mar 18, 2008 10:43 am    Post subject: Re: random images in forum Reply with quote

Well, at least you tried! Here are some of your problems -
1. php cannot go in the template files so easily. 'Allow php in templates' has to be enabled. (Either in the acp or config, I don't remember right off hand) And there are special tags for php in templates, which I don't recall either. This is all in the phpbb documentation.
2. require_once(dirname(__FILE__) . '/gallery/embed.php'); I'd be surprised if this returns the correct path.

I'd suggest you add your code to includes/functions.php - page_header() and use the template system to display the images. Also use g2helper.php to initiate Gallery and you won't have to worry about path settings.
Back to top
Offline View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    NukedGallery.net Forum Index » phpBB Integration » phpBB3 / Gallery 2 Integration View previous topicPrinter friendly versionView next topic

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours

Powered by phpBB © phpBB Group



Sponsors: Dedicated ServersDomain NamesWeb HostingDomain Name RegistrationDedicated Web HostingWeb Design New YorkCompare VoIPseo packagesSEO CompanyNew York Yellow PagesFind LocationsVOIP Phone ServiceNeckermannBluetooth HeadsetOnline internetSEOchina factoryDressesRestaurant Locatorandroid tablet

8th year online! 2003-2011
Legal • Use of this site consitutes agreement to the Acceptable Use Policy
Hosted by Implosion WorksSourceForge.net Logo • Theme by TonicMedia