Register Members List Search Today's Posts Mark Forums Read

Reply
 
Article Options
Gallery 2.1 and vBulletin 3.5.X integration
Brent H
Join Date: Sep 2004
Posts: 162

Poprocks on toast, yo.

Phoenix, AZ
by Brent H Brent H is offline 01 Apr 2006

This tutorial will outline the steps needed to integrate your vBulletin 3.5.X and Menalto Gallery 2.1 installations. The original thread located here has become a little too scattered, and since it's original focus was on the Gallery 2.0 and vBulletin 3.0 series, I think it'd be beneficial to start this new thread so that the information is more easily found for the 3.5.X and 2.1 series.

Before we begin, you should be aware that this tutorial assumes that you'll be placing your gallery in the root directory for your forums. My directory structure looks a little like this:

public_html/Vbulletin Files
and
public_html/gallery2/Gallery Files

As long as your gallery folder is located within your root vBulletin directory, this should work just fine.

Step 1:
Install Menalto Gallery 2.1. Remember to upload the "gallery2" folder INSIDE your root vBulletin directory!

Step 2:
Create a new file containing the following, and save it as gallery2.php:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

(or download the attached gallery2.php)

Step 3:
Find and edit the following code to suit your site setup:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

and

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Save and upload the file to your root vBulletin directory.

Step 4:
Create a new template in your style manager called gallery2 containing the following:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

And that's basically it! Your gallery should now be accessable via www.yoursite.com/gallery2.php or www.yoursite.com/forums/gallery2.php (depending on how you have it set up).

You can achieve further integration by using johnmont's plugins which will:
  1. Delete users from the Gallery when you delete them from the vBulletin control panel.
  2. Update user information in the gallery when they change their information in the User CP.
John has given me permission to post them The attached gallery-plugins.xml file will create two new plugins called Delete Gallery User and Update Gallery User. You'll need to edit both of these plugins after installation and change
Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

(it's the very first line in both of them) to match your site setup.

Hopefully this tutorial sparks a little more interest in this area and we can get some additional people contributing solutions to achieve tighter integration :banana:

As the integration progresses, I'll update this thread to keep everything together and accessable.

Enjoy!
Attached Files
File Type: php gallery2.php (5.5 KB, 749 views)
File Type: xml gallery-plugins.xml (1.8 KB, 719 views)

Last edited by Brent H; 02 Apr 2006 at 09:10..
Views: 78860
Reply With Quote
Comments
  #2  
Old 02 Apr 2006, 07:13
defcon_420's Avatar
defcon_420 defcon_420 is offline
 
Join Date: Jun 2004
I have an existing installation i wish to upgrade but my forum is already installed into /home directory

how would it work if if my directory structure looked like this
public_html/home/FORUM FILES HERE
public_html/gallery2/GALLERY FILES HERE

also is there a way so that "when a user uploads a photo into the forum that its automatically placed into the users gallery?"

Last edited by defcon_420; 02 Apr 2006 at 07:18.
Reply With Quote
  #3  
Old 02 Apr 2006, 08:04
Brent H's Avatar
Brent H Brent H is offline
 
Join Date: Sep 2004
Real name: Brent Hegnauer
I tried messing around with a directory structure like that a while back. You'd have to make sure that every reference to an external vBulletin file like

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

was changed to something like

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

The problem I ran in to was that it expected files referenced by global.php to be located in places that they aren't...

I'm sure it's possible, but you'd have to have someone more experienced in PHP tell you how to do it. With the new 2.1 version they changed some of the integration code and I read something about being able to put your directories wherever you wanted, but I haven't tried it yet. That's something you may have to ask about in Menalto's forums.

With the user album thing, are you talking about forum attachments or something else? As far as I know there's no way to have uploaded attachments be put directly into a user's photo album.

Last edited by Brent H; 02 Apr 2006 at 08:08.
Reply With Quote
  #4  
Old 02 Apr 2006, 08:26
defcon_420's Avatar
defcon_420 defcon_420 is offline
 
Join Date: Jun 2004
First of all thank you Brent so much for answering my questions .

Since i would need to move my VB installation to the webroot is there a way of upgrading from my current 3.0.13 to 3.5.4 keeping my data but moving my file structure so that my vb is installed into the webroot?

Yes i wanted the attachments to be put directly into the users photo albums. If gallery 2.1 cant do this, is there another photo gallery that does?

I wonder if there isnt a way to setup a cronjob to dump user attachments in the gallery once a day? whats your thoughts on this?

Last edited by defcon_420; 02 Apr 2006 at 08:28.
Reply With Quote
  #5  
Old 02 Apr 2006, 08:57
Brent H's Avatar
Brent H Brent H is offline
 
Join Date: Sep 2004
Real name: Brent Hegnauer
You can move your gallery installation by following the instructions here:
http://codex.gallery2.org/index.php/..._to_another.3F

You can move your vBulletin files without making any problems. Just move them over and edit your site URL in the Admin CP. I've done it many times.

As far as the attachments, I'd just disable them and have people upload them directly to the gallery. They can use image tags and just link to their photo

Edit: JohnMont has given me permission to upload his two gallery plugins... The first post has been updated.

Last edited by Brent H; 02 Apr 2006 at 09:11. Reason: Automerged Doublepost
Reply With Quote
  #6  
Old 02 Apr 2006, 09:46
defcon_420's Avatar
defcon_420 defcon_420 is offline
 
Join Date: Jun 2004
thanks alot Brent you have been very helpful and its awesome to see JohnMont has given permission to post his plugins.
This is starting to look good

Attachments are disabled via forum permissions in admincp

Also is there a way to get VBulletin to dump its attachments into a single folder or user defined folders so i can manually add them to the new photo gallery i'm about to install?

thx again

Last edited by defcon_420; 02 Apr 2006 at 16:57.
Reply With Quote
  #7  
Old 02 Apr 2006, 13:18
noj75's Avatar
noj75 noj75 is offline
 
Join Date: Nov 2004
Hi,

Have done all of the above. Getting this error when trying to view:

line: 98, Failed to create G2 user with extId [1]. Here is the error message from G2:
Error (ERROR_COLLISION)
in modules/core/classes/GalleryUser.class at line 154 (gallerycoreapi::error)
in modules/core/classes/GalleryEmbed.class at line 360 (galleryuser::create)
in /home/*****/public_html/boards/gallery2.php at line 95 (galleryembed::createuser)
in /home/*****/public_html/boards/gallery2.php at line 50

Any ideas please.

Kind regards.
Reply With Quote
  #8  
Old 02 Apr 2006, 13:41
Brent H's Avatar
Brent H Brent H is offline
 
Join Date: Sep 2004
Real name: Brent Hegnauer
Is your gallery2 folder inside your vbulletin root directory?
Reply With Quote
  #9  
Old 02 Apr 2006, 14:00
defcon_420's Avatar
defcon_420 defcon_420 is offline
 
Join Date: Jun 2004
i was getting that error when i logged in as admin, when i logged in as a normal user or went into gallery2.1 non embed it was fine... i created another user and gave them admin control.. i log in thru that now and i dont get the error.
Reply With Quote
  #10  
Old 02 Apr 2006, 15:38
johnmont johnmont is offline
 
Join Date: Feb 2006
This is most likely because the extID already exists in the gallery database. When a user is created in gallery, the VB userid is mapped to a different Gallery userid. This is done in case gallery is also run in standalone mode or for multiple domains.

How does this mapping work?

1. VB user has a userid=8

2. Added as a gallery user and given the g_userid=12

3. In the externalID map table, an entry is made linking 8--->12.

The problem is, that if the user is deleted from within the gallery app, the user is removed. But the entry in the externalID map table is not. So all deletion of users, etc. must be done via the embedding app. But the current version that's posted here does not allow that...it never has. I don't mean to complain about the original author, as I really appreciate their work, its simply that this feature wasn't really fully implemented. So I'm writing an improved one and will hopefully have it up this week. It will also support the mapping of primary VB group to gallery group as well.


Originally Posted by noj75
Hi,

Have done all of the above. Getting this error when trying to view:

line: 98, Failed to create G2 user with extId [1]. Here is the error message from G2:
Error (ERROR_COLLISION)
in modules/core/classes/GalleryUser.class at line 154 (gallerycoreapi::error)
in modules/core/classes/GalleryEmbed.class at line 360 (galleryuser::create)
in /home/*****/public_html/boards/gallery2.php at line 95 (galleryembed::createuser)
in /home/*****/public_html/boards/gallery2.php at line 50

Any ideas please.

Kind regards.

Last edited by johnmont; 02 Apr 2006 at 15:40.
Reply With Quote
  #11  
Old 03 Apr 2006, 09:01
tuanluu's Avatar
tuanluu tuanluu is offline
 
Join Date: Aug 2005
thanks it work great!
__________________
http://www.luuhoanggallery.net
Reply With Quote
  #12  
Old 03 Apr 2006, 11:04
Brent H's Avatar
Brent H Brent H is offline
 
Join Date: Sep 2004
Real name: Brent Hegnauer
No problem I had a tough time getting this to work because it was so spread out, and primarily had to do with the older versions... A huge thanks goes to johnmont for helping me through it and for providing his excellent coding.
Reply With Quote
  #13  
Old 03 Apr 2006, 17:46
albertsch9 albertsch9 is offline
 
Join Date: Apr 2006
Can someone help me?
The gallery2.php gives me only a white Page.
Reply With Quote
  #14  
Old 03 Apr 2006, 20:06
kompakt's Avatar
kompakt kompakt is offline
 
Join Date: Dec 2004
Real name: Ahmad
Thanks a lot for the update. I will be upgrading to 2.1 soon...
Reply With Quote
  #15  
Old 03 Apr 2006, 20:41
SilVert SilVert is offline
 
Join Date: Oct 2003
Originally Posted by Brent H
No problem I had a tough time getting this to work because it was so spread out, and primarily had to do with the older versions... A huge thanks goes to johnmont for helping me through it and for providing his excellent coding.
yea, it was kinda a pain since the old thread died off with support. but alas, we got it to work and now that somebody who knows PHP(Johnmount) is on this again, it might go places

Originally Posted by albertsch9
Can someone help me?
The gallery2.php gives me only a white Page.
you need to edit the gallery2.php(or whatever the name) files referance to the VBB template name.

did that make sence?

you created a VBB template called "X"(most likley Gallery). now you need to go into yout gallery2.php file and edit the referances that say "Y"(most likley Gallery2 if you copied Brent's code ) to say "X".. that better
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Article Options

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 19:19.

Layout Options | Width: Wide Color: