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 Block on seperate page

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

Beginner
Beginner


Joined: Oct 27, 2006
Posts: 8

PostPosted: Thu Jan 03, 2008 11:48 am    Post subject: Random Block on seperate page Reply with quote

I have an index.html front page and phpbb in a forums dir and gallery 2 in a gallery dir. What I wanted to do is pull a couple random images from the gallery and place them in the index.html.

I tried the:

Code: ›
<?php @readfile('http://www.usaoffroading.com/gallery/main.php?g2_view=imageblock.External&g2_blocks=randomImage&g2_show=title'); ?>


I also tried linking to the embeded gallery:

Code: ›
<?php @readfile('http://www.usaoffroading.com/forums/gallery2.php?g2_view=imageblock.External&g2_blocks=randomImage&g2_show=title'); ?>


but nothing is showing up. Does anyone have this working, is it because gallery is embeded or do I have something incorrect?
and what would be the best way to test for errors? firebug on firefox?

Thanks
Richard
Back to top
Offline View user's profile Send private message
AdBot
   Post subject: Random Block on seperate page  

Back to top
Curbob

Beginner
Beginner


Joined: Oct 27, 2006
Posts: 8

PostPosted: Thu Jan 03, 2008 11:52 am    Post subject: Re: Random Block on seperate page Reply with quote

it must be something I've done incorrectly in my index.html because if I add:

http://www.usaoffroading.com/forums/gal ... _show=none

to my browser, an image comes up..
Back to top
Offline View user's profile Send private message
jettyrat

Moderator
Moderator


Joined: Nov 28, 2005
Posts: 1044

PostPosted: Thu Jan 03, 2008 1:48 pm    Post subject: Re: Random Block on seperate page Reply with quote

Try this -
http://codex.gallery2.org/Gallery2:GalleryEmbed:getImageBlock [gallery2.org]
Back to top
Offline View user's profile Send private message
Curbob

Beginner
Beginner


Joined: Oct 27, 2006
Posts: 8

PostPosted: Fri Jan 04, 2008 2:25 pm    Post subject: Re: Random Block on seperate page Reply with quote

that worked great! thanks

just FYI for anyone doing this, It still wouldn't work using index.html but copied it as index.php and it all worked fine

Thanks again!
Back to top
Offline View user's profile Send private message
2KLiX

Beginner
Beginner


Joined: Aug 03, 2008
Posts: 9

PostPosted: Thu Sep 25, 2008 4:47 am    Post subject: Re: Random Block on seperate page Reply with quote

I am trying to get this image block to work on my phpbb3 forum but don't know exactly how to edit the paths correctly. Could anyone help me get these sorted.
Thanks
Matt
Back to top
Offline View user's profile Send private message
jettyrat

Moderator
Moderator


Joined: Nov 28, 2005
Posts: 1044

PostPosted: Thu Sep 25, 2008 9:07 am    Post subject: Re: Random Block on seperate page Reply with quote

What paths?

Here is the basic code to put 4 random images across the top of your forum:
Code: › Open styles/prosilver/overall_header.html
Find:
       <!-- IF S_BOARD_DISABLED and S_USER_LOGGED_IN and (U_MCP or U_ACP) -->
      <div id="message" class="rules">
         <div class="inner"><span class="corners-top"><span></span></span>
            <strong>{L_INFORMATION}:</strong> {L_BOARD_DISABLED}
         <span class="corners-bottom"><span></span></span></div>
      </div>
      <!-- ENDIF -->

Replace With:
       <!-- IF S_BOARD_DISABLED and S_USER_LOGGED_IN and (U_MCP or U_ACP) -->
      <div id="message" class="rules">
         <div class="inner"><span class="corners-top"><span></span></span>
            <strong>{L_INFORMATION}:</strong> {L_BOARD_DISABLED}
         <span class="corners-bottom"><span></span></span></div>
      </div>
       <!-- ELSEIF not S_GALLERY2 -->
      <div class="navbar">
         <div class="inner"><span class="corners-top"><span></span></span>
            <div style="text-align: center;">{G2_IMAGES}</div>
         <span class="corners-bottom"><span></span></span></div>
      </div>
      <!-- ENDIF -->

Open includes/functions.php
Find:
   // The following assigns all _common_ variables that may be used at any point in a template.
   $template->assign_vars(array(
      'SITENAME'                  => $config['sitename'],

Replace With:
   if (!empty($config['g2i_fullPath']) && !empty($config['g2i_embedUri']) && !empty($config['g2i_g2Uri']) && !empty($config['g2i_activeAdminId']))
   {
      require_once($phpbb_root_path . 'g2helper.' . $phpEx);
      $g2h = new g2helper();
      $g2_images = trim(str_replace(array('<div class="one-image">', '</div>'), array('', ''), $g2h->fetchImageBlock($user)));

   }
   else
   {
      $g2_images = $user->lang['OBTAIN_SETTINGS_FAILED'];
   }

   // The following assigns all _common_ variables that may be used at any point in a template.
   $template->assign_vars(array(
      'G2_IMAGES'                  => $g2_images,
      'SITENAME'                  => $config['sitename'],

Open g2helper.php
Find:
}

?>

Before, Add:
   function fetchImageBlock($user)
   {
      $this->init($user);

      list ($ret, $g2_images) = GalleryEmbed::getImageBlock(array('blocks' => 'randomImage|randomImage|randomImage|randomImage', 'show' => 'none'));
      if (isset($ret))
      {
         trigger_error('getImageBlock error' . $user->lang['G2_ERROR'] . $ret->getAsHtml(), E_USER_ERROR);
      }

      $this->done();

      return $g2_images;
   }
Back to top
Offline View user's profile Send private message
PoPoutdoor

Wizard
Wizard


Joined: Jan 20, 2006
Posts: 109

PostPosted: Fri Sep 26, 2008 12:43 am    Post subject: Re: Random Block on seperate page Reply with quote

Good! I can add g2 Image block to the portal page with this Very Happy
Back to top
Offline View user's profile Send private message
jettyrat

Moderator
Moderator


Joined: Nov 28, 2005
Posts: 1044

PostPosted: Fri Sep 26, 2008 12:46 pm    Post subject: Re: Random Block on seperate page Reply with quote

If you want the images to display vertically (side panel, etc.), take out the code that does a str_replace on the div class and just use the output from $g2h->fetchImageBlock() as is.

(You can also modify the css file instead of using the str_replace to get the images horizontal, as the gallery codex suggests.)
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 Issues » 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: Web HostingDedicated ServersDomain NamesDomain Name RegistrationDedicated Web HostingSearch Engine OptimisationSEOWeb Design New YorkSEO Web DesignWeb hosting AustraliaSEO

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