G2 and phpBB3 with no mods to phpBB

gasmasher

Joined: 2008-12-02
Posts: 2
Posted: Wed, 2008-12-03 02:02

I wrote a simple script this weekend that allows users of a phpBB3 forum to link G2 media in phpBB3 posts. This isn't the most efficient but I wanted something that required no modifications to phpBB or G2.

http://www.devcollective.org/files/hook_gallery2-1.0.tar.gz

Installation
- Unpack hook_gallery2-1.0.tar.gz to some temp directory
tar xzf hook_gallery2-1.0.tar.gz
- Copy the single file hook_gallery2.php to the phpBB include/hooks directory
cp hook_gallery2.php /var/www/htdocs/phpBB3/include/hooks
- Read the top of hook_gallery2.php and make any changes to the constants as needed to point to your G2 installation
- Make a post with the tag [g2:<gallery_item_id>]

You can define a custom BBCode in phpBB3 that makes it easier for users
- Open the administrator control panel
- Click the Posting tab
- 'Add a new BBCode'
- Set BBCode Usage to [g2]{NUMBER}[/g2]
- Set HTML replacement to [G2:{NUMBER}]
- Set Help Line to whatever you want. I use 'Insert an image from the Gallery'
- Check Display on Posting Page to include a g2 button on the message posting screen

Hopefully this will be useful to others doing integration projects.