Coppermine gallery bridged to phpbb3
Posted October 15th 2013, 6:56am
Ok.. on the suggestion of Dion, here's my experience of installing Coppermine and bridging it to my phpbb forum.

I need to preface this with some info.
I am a novice when it comes to coding of any kind (see my previous problem for supporting evidence ;) ), I get by and fortunately have worked out where to go for help when I need it.

The basic install was as easy as I'd hoped, went very smooth.
Managing the config was a little tedious but I got there (only had to redo it completely once, followed by a couple of tweaks)

As advised, I tested it standalone before attempting bridging and it all looked as it should.

The bridging gave me some problems. These were largely due to the groups settings (I'd checked the box to use the group settings from our board)
On my forum our admin team are not in the Administrators group. This meant that when I finished the bridging I wasn't authorised to do anything and was seen as a regular user.

To get over this I added myself to the Administrators group. First time round I used it as a secondary group but needed to have it as my primary.

Once I'd done that, everything was great.

Added the link to my forum header and announced it to my users.

It'd be great to get some proper integration, my users are already asking for embedding options (there is a plugin but it was written for software version 1.4 and the current is 1.5) so I'm hoping someone (Dion.. here's my plea :D ) will get round to it.

This is my forum http://www.oldschoolmtb.org.uk/forum/index.php
And the gallery http://www.oldschoolmtb.org.uk/gallery/

Only changes I've made are to the favicon(s) and logo. The style isn't quite right but it's close enough for me not to worry about.

It's early days yet, less than 24hours in, and I need to dig out my hdd with my pics on so I can get some albums started.
Hopefully my users will populate it and make the effort worthwhile.
φ
Posts: 11
Joined: October 14th 2013, 7:43am
Location: Mid-Suffolk, UK
Likes Given: 2
1
#2
Coppermine gallery bridged to phpbb3
Posted October 15th 2013, 11:09am
I found the ZIP file of Coppermine modifications I made for a client. I'm going to install Coppermine on a test board and make sure the modifications work with the current version of phpBB.

If everything checks out OK, I'll post the modifications here. Among other things, it gives the user the ability to insert personal gallery images directly into phpBB posts.
φ
Posts: 1599
Joined: March 12th 2009, 11:00pm
Location: Uncertain due to momentum
Likes Given: 26
Likes Received: 357
Coppermine gallery bridged to phpbb3
Posted October 15th 2013, 2:47pm
That'd be grand, look forward to it.

My users haven't exactly embraced it yet but I live in hope.
φ
Posts: 11
Joined: October 14th 2013, 7:43am
Location: Mid-Suffolk, UK
Likes Given: 2
Coppermine gallery bridged to phpbb3
Posted October 15th 2013, 7:11pm
Don't know whether everything is installed properly, but the modified Coppermine is now available at gallery/index.php and should be accessible to all members. I'd suggest uploading an image or two into your personal gallery.

To see an integrated feature, click the Post a reply button at the top or bottom of this page to go to the main editor. If you uploaded an image, you will see a new BBcode button labeled Gallery. Clicking that button will display thumbnails of your pesonal gallery, and clicking on a thumbnail will insert the gallery image into the post.

Let me know how it works.
φ
Posts: 1599
Joined: March 12th 2009, 11:00pm
Location: Uncertain due to momentum
Likes Given: 26
Likes Received: 357
Coppermine gallery bridged to phpbb3
Posted October 16th 2013, 6:08pm
Image

Wow.. that looks like it works just fine..
φ
Posts: 11
Joined: October 14th 2013, 7:43am
Location: Mid-Suffolk, UK
Likes Given: 2
1
#6
Coppermine gallery bridged to phpbb3
Posted October 16th 2013, 7:05pm
Great! I'll make a post either later tonight or tomorrow which will include the modifications to Coppermine, and some brief instructions.

I'll follow it up with the modifications on the phpBB side to enable album access when posting, as well as a few other goodies. Please note that the phpBB modifications assume that Coppermine and phpBB share the same database -- if they do not, you will need to make some changes to the code.
φ
Posts: 1599
Joined: March 12th 2009, 11:00pm
Location: Uncertain due to momentum
Likes Given: 26
Likes Received: 357
phpBB Integration with Coppermine Gallery
Posted October 17th 2013, 4:08pm
Since there were so many files and changes, I decided to make this easy. The following ZIP file contains the modified versions of selected CPG files that will better integrate Coppermine Gallery with phpBB3. The files are compatible with CPG versions 1.5.20 - 1.5.24 (and probably with future 1.5.x versions as well).

IMPORTANT NOTES
While CPG will work normally, these modifications are optimized for CPG being set up with no public galleries.

In addition, it is assumed that you have enabled bridging with phpBB3 and have verified that it is working correctly.

dd_cpg.zip
148.32 KiB  |  Downloaded 552 times

To use, un-ZIP the above file and copy the files to the appropriate directories. The diondesigns directory should be copied to the themes directory in the CPG installation. Once the files are copied to their correct locations, start CPG and go to the Config page. Select the Themes option and change the theme to diondesigns.

At this point you're all set for the next step, which is to modify phpBB3 to take advantage of the new integration!
φ
Posts: 1599
Joined: March 12th 2009, 11:00pm
Location: Uncertain due to momentum
Likes Given: 26
Likes Received: 357
Coppermine gallery bridged to phpbb3
Posted October 17th 2013, 7:30pm
OK, on to some integration! First up: users being able to insert images from their personal gallery into posts.

Open the posting_editor.html template file and find:

	<div id="smiley-box">

Above this line, add:

<div style="position:relative">

Next, find the following line:

<!-- IF $EXTRA_POSTING_OPTIONS eq 1 -->

Above this line, add:

<!-- IF GALLERY_THUMBS -->
<style type="text/css">.gal_th{display:inline-block;margin:2px 5px;padding:3px;width:100px;overflow:hidden;font-family:Arial;font-size:11px;font-weight:bold;vertical-align:top}.gal_img{cursor:pointer;max-width:100px;max-height:100px}</style>
<div id="gallery-box" class="bg0" style="display:none;position:absolute;top:0;left:0;padding:5px;width:80%;max-height:265px;overflow:auto;border:1px solid #777;text-align:center"><div class="bg3" style="margin-bottom:5px;padding:3px 0 5px;font-size:14px;font-weight:bold">Click on an image to insert it into your post:</div>{GALLERY_THUMBS}</div>
<!-- ENDIF -->

</div>

Now save the file. Next, open the posting_buttons.html template file and find:

	<!-- IF S_BBCODE_FLASH -->

Above this line, add:

	<!-- IF GALLERY_THUMBS -->
<input type="button" class="button2 textbutton" title="Insert an image from your personal gallery" onclick="togglediv('gallery-box')" onfocus="this.blur()" value="Gallery" />
<!-- ENDIF -->

Save the file. Finally, open posting.php and find:

// Start assigning vars for main posting page ...
$template->assign_vars(array(

Replace these lines with:

//	MODIFICATION by Dion Designs to support insertion of gallery images into posts
$galthumbs = '';
$catid = intval($user->data['user_id']) + 10000;
$sql = 'SELECT p.filepath, p.filename, p.title
FROM cpg15x_albums a, cpg15x_pictures p
WHERE a.category = ' . strval($catid) . '
AND a.aid = p.aid';
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) {
$src_url = generate_board_url() . '/gallery/albums/' . $row['filepath'];
$galthumbs .= '<div class="gal_th"><img class="gal_img" src="' . $src_url . 'thumb_' . $row['filename'] . '" onclick="insert_text(\'[img]' . $src_url . $row['filename'] . '[/img]\');document.getElementById(\'gallery-box\').style.display=\'none\'" /><br /><span class="gal_title">' . $row['title'] . '</span></div>';
}
$db->sql_freeresult($result);

// Start assigning vars for main posting page ...
$template->assign_vars(array(
'GALLERY_THUMBS' => $galthumbs,
// END MODIFICATION

You might need to make some minor modifications to what you just added. The above code assumes that CPG has been installed into the ./gallery directory of the phpBB installation. If it has been installed elsewhere, you will need to change this line:

	$src_url = generate_board_url() . '/gallery/albums/' . $row['filepath'];

so it points to the CPG installation. In addition, the above code assumes that CPG and phpBB share the same database and you used the default CPG table prefix. If either of these are not true, you will need to change this line:

		FROM cpg15x_albums a, cpg15x_pictures p

so the CPG data is properly accessed.

Once you have done these, save the file, and the modifications are complete. Your users will now be able to insert images from their personal gallery into posts.
φ
Posts: 1599
Joined: March 12th 2009, 11:00pm
Location: Uncertain due to momentum
Likes Given: 26
Likes Received: 357
Coppermine gallery bridged to phpbb3
Posted October 18th 2013, 7:26pm
Thanks for posting these Dion... just 2 questions before I get down and dirty with it..

First, earlier you mentioned that these were set up under the consideration that phpbb and cpg used the same database.
Mine don't, are the code changes for that tricky?
**edit to add** just seen the info in the previous post, can't see how or what would need changing in that line of code.. I have no problem trying to get to grips with it but a pointer or 2 would be most welcome

Second, I haven't set my installation up for users to have personal galleries. Not quite sure why I did it that way but I did.
Should I allow personal galleries and have the current uploads moved into them or will it be ok to leave as is?
φ
Posts: 11
Joined: October 14th 2013, 7:43am
Location: Mid-Suffolk, UK
Likes Given: 2
Coppermine gallery bridged to phpbb3
Posted October 18th 2013, 8:12pm
Something that I want to point out, is it just me that I feel that there hardly any permissions for coppermine like there is for the phpbb gallery mod? Example you can delete your own images but on one else?
φ
Posts: 115
Joined: May 26th 2013, 12:17am
Likes Given: 60
Likes Received: 7
Coppermine gallery bridged to phpbb3
Posted October 18th 2013, 8:18pm
Image
φ
Posts: 115
Joined: May 26th 2013, 12:17am
Likes Given: 60
Likes Received: 7
Coppermine gallery bridged to phpbb3
Posted October 18th 2013, 8:33pm
If your CPG database is different than the phpBB database, then it becomes a little tricky. Let's assume your CPG database is named coppermine.

The first thing you must do is check the CPG config.inc.php file and the phpBB config.php file. Is the database user the same? If not, then the phpBB database user MUST have SELECT privileges to the CPG database. If so, then we're good to go. If not, make sure that the phpBB user has that privilege.

The following line:

		FROM cpg15x_albums a, cpg15x_pictures p

must then be changed to:

		FROM coppermine.cpg15x_albums a, coppermine.cpg15x_pictures p

in order for phpBB to access the CPG database.

As for personal galleries, every change I've made assumes that users have personal galleries. So yeah, make sure to allow personal galleries. ;) You can leave uploads where they are, but phpBB will not see any of them. It's up to you whether you want to move the uploads to users' personal galleries.
φ
Posts: 1599
Joined: March 12th 2009, 11:00pm
Location: Uncertain due to momentum
Likes Given: 26
Likes Received: 357
Coppermine gallery bridged to phpbb3
Posted October 18th 2013, 8:45pm
Daniel said:
Something that I want to point out, is it just me that I feel that there hardly any permissions for coppermine like there is for the phpbb gallery mod? Example you can delete your own images but on one else?

One might argue that the phpBB Gallery MOD has an insane number of permissions that make it extremely hard to set up and use. ;) Actually this is my biggest complaint with most phpBB MODs -- they have FAR too many permissions and options, the vast majority of which are unnecessary.

In CPG, admins can delete images from any user, but individual users can only delete their own images. If you install CPG, look at the Config page -- it's the CPG version of the phpBB ACP. (The CPG Config user interface is MUCH better than the phpBB ACP!)
φ
Posts: 1599
Joined: March 12th 2009, 11:00pm
Location: Uncertain due to momentum
Likes Given: 26
Likes Received: 357
Coppermine gallery bridged to phpbb3
Posted October 18th 2013, 8:56pm
Point taken, I used to use myBB and I just had to get away from it ASAP - I just didn't feel that I was in control of anything.

Dion said:
Daniel said:
Something that I want to point out, is it just me that I feel that there hardly any permissions for coppermine like there is for the phpbb gallery mod? Example you can delete your own images but on one else?

One might argue that the phpBB Gallery MOD has an insane number of permissions that make it extremely hard to set up and use. ;) Actually this is my biggest complaint with most phpBB MODs -- they have FAR too many permissions and options, the vast majority of which are unnecessary.

In CPG, admins can delete images from any user, but individual users can only delete their own images. If you install CPG, look at the Config page -- it's the CPG version of the phpBB ACP. (The CPG Config user interface is MUCH better than the phpBB ACP!)
φ
Posts: 115
Joined: May 26th 2013, 12:17am
Likes Given: 60
Likes Received: 7
Coppermine gallery bridged to phpbb3
Posted October 20th 2013, 4:34pm
Thanks Dion, I'll try to get to grips with this in the next few days. Something's come up and I need to clear that before I can focus on this.

As far as phpbb gallery goes, I tried to install it twice and failed twice. I'm very new to coding and that but, with automod and the instructions, it should be a breeze. And it wasn't.
Add to that there's no support for the mod now either (apart from a mention of an update for phpbb3.1), I gave up.

Installing and setting up cpg was easy.. now all I have to do is get my ageing grey matter around these mods and it'll be sweet.
φ
Posts: 11
Joined: October 14th 2013, 7:43am
Location: Mid-Suffolk, UK
Likes Given: 2
Coppermine gallery bridged to phpbb3
Posted October 20th 2013, 8:33pm
identiti66 said:
As far as phpbb gallery goes, I tried to install it twice and failed twice. I'm very new to coding and that but, with automod and the instructions, it should be a breeze. And it wasn't.
Add to that there's no support for the mod now either (apart from a mention of an update for phpbb3.1), I gave up.

Installing and setting up cpg was easy.. now all I have to do is get my ageing grey matter around these mods and it'll be sweet.

I've suspected that the only reason phpBB Gallery isn't marked as abandoned is because the author is on the development team.

I also agree that CPG is much easier to install and set up -- and it has many more features. And most important, it doesn't require phpBB to work. This becomes an issue when a board becomes popular...MODs like phpBB Gallery and mChat strain server resources compared to standalone applications like CPG and AJAX Chat.
φ
Posts: 1599
Joined: March 12th 2009, 11:00pm
Location: Uncertain due to momentum
Likes Given: 26
Likes Received: 357
Coppermine gallery bridged to phpbb3
Posted October 21st 2013, 4:59pm
Dion said:
identiti66 said:
As far as phpbb gallery goes, I tried to install it twice and failed twice. I'm very new to coding and that but, with automod and the instructions, it should be a breeze. And it wasn't.
Add to that there's no support for the mod now either (apart from a mention of an update for phpbb3.1), I gave up.

Installing and setting up cpg was easy.. now all I have to do is get my ageing grey matter around these mods and it'll be sweet.

I've suspected that the only reason phpBB Gallery isn't marked as abandoned is because the author is on the development team.

I also agree that CPG is much easier to install and set up -- and it has many more features. And most important, it doesn't require phpBB to work. This becomes an issue when a board becomes popular...MODs like phpBB Gallery and mChat strain server resources compared to standalone applications like CPG and AJAX Chat.


While that is a good point, it can also be more work if you needed to ban someone- Need to log into more than one CP to ban someone but then that just me, again.
φ
Posts: 115
Joined: May 26th 2013, 12:17am
Likes Given: 60
Likes Received: 7
Coppermine gallery bridged to phpbb3
Posted October 21st 2013, 5:42pm
Daniel said:
Need to log into more than one CP to ban someone but then that just me, again.

Actually that is not true when phpBB bridging is enabled. The CPG user database is then ignored, so a ban in phpBB will ban the user from CPG as well.

This assumes that the CPG _users table in the database only contains the admin/founder account. This is the default state of the table if CPG is installed and then phpBB bridging is enabled.
φ
Posts: 1599
Joined: March 12th 2009, 11:00pm
Location: Uncertain due to momentum
Likes Given: 26
Likes Received: 357
Coppermine gallery bridged to phpbb3
Posted October 21st 2013, 10:19pm
Looks like I will need to take a look at it again, even though I didn't like it that much.

Also testing your setup, it saying that one need to be logged in to post a comment yet I'm already logged in
φ
Posts: 115
Joined: May 26th 2013, 12:17am
Likes Given: 60
Likes Received: 7
Coppermine gallery bridged to phpbb3
Posted January 15th 2014, 8:06am
Thanks for this. Just trying to get it to work now.

I've followed all the instructions for PHPBB3 above and made the modifications. There is nothing new op the posting page except for the new 'gallery' button in the BBCode bar. Clicking on it does nothing.

However, everything is there. If I view the source code, I can see the coppermine links to the gallery thumbnails, but the DIV containing the thumbnails is not showing.

Any advice?
φ
Posts: 6
Joined: December 18th 2013, 9:38am
Likes Given: 2

Who is online

Users browsing this forum: No registered users and 0 guests