Warning: The author of this contribution does not provide support for it anymore.

phpBB Gallery

Integrations outside phpBB - phpBB Gallery

Integrations outside phpBB

by nickyb713 » Wed Nov 30, 2011 6:09 am

Is it possible to use parts of this mod outside of phpBB on the same site? For instance, if I would like to display 4+ recent or random images on another section of my site would it be possible to do this?
nickyb713
Registered User
Posts: 46
Joined: Sun May 08, 2011 11:15 pm
Contact:

Re: Integrations outside phpBB

by nickvergessen » Sat Dec 03, 2011 10:11 am

No Support via PM
User avatar
nickvergessen
Former Team Member
Posts: 4397
Joined: Mon Apr 30, 2007 5:33 pm
Location: Stuttgart, Germany
Name: Joas Schilling
Contact:

Re: Integrations outside phpBB

by nickyb713 » Sat Dec 03, 2011 6:34 pm

Awesome thanks!
nickyb713
Registered User
Posts: 46
Joined: Sun May 08, 2011 11:15 pm
Contact:

Re: Integrations outside phpBB

by nickyb713 » Sun Dec 04, 2011 6:50 pm

So i've been trying to modify some of the code in the first link to work on external pages because i'm trying to get gallery to work on my site's primary index file. I'm not very proficient in php, but i think everything is working. The only think i'm stuck on is figuring out what to put for the includes line to display the gallery information from the second link.

Here's what i've been working with at the top of my index.php file.(**** out my id)

Code: Select all

<?php
define('IN_PHPBB', true);
$phpbb_root_path = "/home/****************/public_html/legionsoflettow.com/forums/";
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
include($phpbb_root_path . 'gallery/common.' . $phpEx); //gotting errors using common and index

$user->session_begin();
$auth->acl($user->data);
$user->setup();
?>


Any help or ideas will be greatly appreciated.
nickyb713
Registered User
Posts: 46
Joined: Sun May 08, 2011 11:15 pm
Contact:

Re: Integrations outside phpBB

by nickyb713 » Sun Dec 04, 2011 7:50 pm

I'm starting to think that this is all i need at the to of my page and that the common.php file should reference all the functions and other files that I'll need for gallery.

Code: Select all

      <?php
      
      define('IN_PHPBB', true);
$phpbb_root_path = "/home/zomgli5/public_html/legionsoflettow.com/forums/";
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);

$user->session_begin();
$auth->acl($user->data);
$user->setup();
?>


This is what i have placed inside the body of my content where i want gallery to be displayed:

Code: Select all

      <?php


$gallery_block = new phpbb_gallery_block();
$gallery_block->set_modes(array('random'));
$gallery_block->set_display_options(array());
$gallery_block->set_nums(array('rows' => 1, 'columns' => 3, 'comments' => 0, 'contests' => 0));
$gallery_block->set_pegas(true);
$gallery_block->add_albums(0, 1, 2);
$gallery_block->add_users(0, 1, 2);
$gallery_block->display();
?>


I'm still trying to figure out why nothing is being displayed because everything looks like it should work, but i'm pulling my hair out in the process.
nickyb713
Registered User
Posts: 46
Joined: Sun May 08, 2011 11:15 pm
Contact:

Re: Integrations outside phpBB

by nickyb713 » Wed Dec 07, 2011 1:10 am

I've been told that my top bit of code is correct, and my browser isn't producing any errors:

Code: Select all

<?php
define('IN_PHPBB', true);
$phpbb_root_path = './forums/';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);

$user->session_begin();
$auth->acl($user->data);
$user->setup();
?>


This bit is from the generator suggested by nick, but for some reason nothing is popping up. The people who I've spoken with could not confirm if this would work or not, but am i missing something? This is embedded in the body:

Code: Select all

<?php
$gallery_block = new phpbb_gallery_block();
$gallery_block->set_modes(array('random'));
$gallery_block->set_display_options(array());
$gallery_block->set_nums(array('rows' => 1, 'columns' => 3, 'comments' => 0, 'contests' => 0));
$gallery_block->set_pegas(true);
$gallery_block->add_albums(0, 1, 2);
$gallery_block->add_users(0, 1, 2);
$gallery_block->display();
?>


Any help would be greatly appreciated. This is all i need to get working for the site to be good to go.
nickyb713
Registered User
Posts: 46
Joined: Sun May 08, 2011 11:15 pm
Contact: