PDA

View Full Version : Gallery 2.1 and vBulletin 3.5.X integration


Pages : [1] 2

Brent H
01 Apr 2006, 22:58
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 (http://www.vbulletin.org/forum/showthread.php?t=80478) 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 (http://codex.gallery2.org/index.php/Gallery2:Download). 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:
<?php

// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'gallery'); // change this depending on your filename

// ################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups
$phrasegroups = array(

);

// get special data templates from the datastore
$specialtemplates = array(

);

// pre-cache templates used by all actions
$globaltemplates = array(
'gallery2',
);

// pre-cache templates used by specific actions
$actiontemplates = array(

);

// ######################### REQUIRE BACK-END ############################

require_once('./global.php');

// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################

$navbits = array();
$navbits[$parent] = 'Gallery';
error_reporting(E_ALL );

$navbits = construct_navbits($navbits);
eval('$navbar = "' . fetch_template('navbar') . '";');

// #######################################################################
// ###################### Begin G2 INTEGRATION CODE ######################
// #######################################################################

$data = runGallery();
$data['title'] = (isset($data['title']) && !empty($data['title'])) ? $data['title'] : 'Gallery';

function runGallery() {
global $vbulletin, $userinfo;
require_once('/home/paranorm/public_html/gallery2/embed.php');

$data = array();

// If it's an anonymous user, set the g2 activeUser to null
$uid = $vbulletin->userinfo['userid'] = 0 ? '' : $vbulletin->userinfo['userid'];

// initiate G2
// You need to edit the following 4 lines to suit your VB3 & G2 installations
// This is set up for an install that looks like:
// public_html/VB/<vb files>
// public_html/gallery2/<gallery2 files>
// and also setup for a VB3 template name of 'gallery2'. If you have any
// differences, make those changes here!
// You might need to change 'loginRedirect' if you have your VB3 setup to
// where index.php is not the root page of VB3... Like if you've changed it
// to forums.php or something of the like.

$ret = GalleryEmbed::init(array('embedUri' => '/gallery2.php',
'g2Uri' => 'http://www.paranormalis.com/gallery2/',
'loginRedirect' => 'index.php',
'activeUserId' => $uid));
if ($ret)
{
if ($ret->getErrorCode() & ERROR_MISSING_OBJECT)
{
// Check if there's no G2 user mapped to the activeUserId
$ret = GalleryEmbed::isExternalIdMapped($uid, 'GalleryUser');
if ($ret && ($ret->getErrorCode() & ERROR_MISSING_OBJECT))
{
// User not mapped, create G2 user now
// Get Arguments for the new user:
$args['fullname'] = $vbulletin->userinfo['username'];
$args['username'] = $vbulletin->userinfo['username'];
$args['hashedpassword'] = $vbulletin->userinfo['password'];
$args['hashmethod'] = 'md5';
$args['email'] = $vbulletin->userinfo['email'];
$args['language'] = $vbulletin->userinfo['lang_code'];
$args['creationtimestamp'] = $vbulletin->userinfo['joindate'];

$retcreate = GalleryEmbed :: createUser($uid, $args);
if ($retcreate)
{
echo '<HR>line: '.__LINE__.', Failed to create G2 user with extId ['.$uid.']. Here is the error message from G2: <br />'.$retcreate->getAsHtml();
return false;
}
$ret = GalleryEmbed::checkActiveUser($uid);
if ($ret) {
print $ret->getAsHtml();
return false;
}
}
else
{
echo '<HR>line: '.__LINE__.', G2 did not return a success status. Here is the error message from G2: <br />'.$ret->getAsHtml();
return false;
}
}
else
{
echo '<HR>line: '.__LINE__.', G2 did not return a success status. Here is the error message from G2: <br />'.$ret->getAsHtml();
return false;
}
}

// user interface: disable sidebar in G2 and get it as separate HTML to put it into a block
//GalleryCapabilities::set('showSidebar', false);

// handle the G2 request
$g2moddata = GalleryEmbed::handleRequest();

// show error message if isDone is not defined
if (!isset($g2moddata['isDone'])) {
$data['bodyHtml'] = 'isDone is not defined, something very bad must have happened.';
return $data;
}
// die if it was a binary data (image) request
if ($g2moddata['isDone']) {
exit; /* uploads module does this too */
}

// put the body html from G2 into the xaraya template
$data['bodyHtml'] = isset($g2moddata['bodyHtml']) ? $g2moddata['bodyHtml'] : '';

// get the page title, javascript and css links from the <head> html from G2
$title = ''; $javascript = array(); $css = array();

if (isset($g2moddata['headHtml'])) {
list($data['title'], $css, $javascript) = GalleryEmbed::parseHead($g2moddata['headHtml']);
$data['headHtml'] = $g2moddata['headHtml'];
}

/* Add G2 javascript */
if (!empty($javascript)) {
foreach ($javascript as $script) {
$data['javascript'] .= "\n".$script;
}
}

/* Add G2 css */
if (!empty($css)) {
foreach ($css as $style) {
$data['css'] .= "\n".$style;
}
}

// sidebar block
if (isset($g2moddata['sidebarHtml']) && !empty($g2moddata['sidebarHtml'])) {
$data['sidebarHtml'] = $g2moddata['sidebarHtml'];
}

return $data;
}
// #######################################################################
// ####################### End G2 integration code #######################
// #######################################################################

eval('print_output("' . fetch_template('gallery2') . '");');

?>
(or download the attached gallery2.php)

Step 3:
Find and edit the following code to suit your site setup:
require_once('/home/paranorm/public_html/gallery2/embed.php'); and
$ret = GalleryEmbed::init(array('embedUri' => '/gallery2.php',
'g2Uri' => 'http://www.yoursite.com/gallery2/',
'loginRedirect' => 'index.php',
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:
$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>$headinclude
$data[headHtml]
</head>
<body>
$header
$navbar
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
<td class="tcat">Gallery</td>
</tr>
<tr>
<td class="alt1">$data[bodyHtml]</td>
</tr>
</table>
$footer
</body>
</html>

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:

Delete users from the Gallery when you delete them from the vBulletin control panel.
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 require_once('/home/paranorm/public_html/gallery2/embed.php''); (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!

defcon_420
02 Apr 2006, 06:13
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?"

Brent H
02 Apr 2006, 07:04
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
require_once('./global.php');
was changed to something like
require_once('../home/global.php');

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.

defcon_420
02 Apr 2006, 07:26
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?

Brent H
02 Apr 2006, 07:57
You can move your gallery installation by following the instructions here:
http://codex.gallery2.org/index.php/Gallery2:FAQ#How_can_I_move_my_gallery_installation_from_one_folder_to_another.3 F

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.

defcon_420
02 Apr 2006, 08:46
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

noj75
02 Apr 2006, 12:18
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.

Brent H
02 Apr 2006, 12:41
Is your gallery2 folder inside your vbulletin root directory?

defcon_420
02 Apr 2006, 13:00
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.

johnmont
02 Apr 2006, 14:38
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.


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.

tuanluu
03 Apr 2006, 08:01
thanks it work great!

Brent H
03 Apr 2006, 10:04
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.

albertsch9
03 Apr 2006, 16:46
Can someone help me?
The gallery2.php gives me only a white Page.

kompakt
03 Apr 2006, 19:06
Thanks a lot for the update. I will be upgrading to 2.1 soon...

SilVert
03 Apr 2006, 19:41
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 :)

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 ;)

albertsch9
03 Apr 2006, 19:47
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 ;)

I created a template named gallery2 the gallery2.php calls the template gallery2 and it dosent work:confused:

SilVert
03 Apr 2006, 19:49
I created a template named gallery2 the gallery2.php calls the template gallery2 and it dosent work:confused:
does it output just a white screen, or does it put your style with no content?

i had this problem, and resolved it. i am trying to remember how i fixed it

Brad
04 Apr 2006, 00:37
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
require_once('./global.php');
was changed to something like
require_once('../home/global.php');

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

Here is something helpful when you are dealing with problems like this. In whatever file you are using to call global.php (in this case a gallery file in another directory), use something like this:

// Full path to vBulletin
define('CWD', '/path/to/html/vBulletin');

// Call global.php
require_once(CWD . '/global.php');

// Get some custom functions from vBulletin directory
require_once(CWD . '/includes/functions_loo.php');

The CWD constant will insure that all calls to vBulletin files point to the right directory, even the ones vBulletin makes on its own when you include global.php. Just make sure you always use the constant in the require_once(); function and everything should work correctly (unless you set the wrong path!).

Hope that helps.

SilVert
04 Apr 2006, 01:52
Here is something helpful when you are dealing with problems like this. In whatever file you are using to call global.php (in this case a gallery file in another directory), use something like this:

// Full path to vBulletin
define('CWD', '/path/to/html/vBulletin');

// Call global.php
require_once(CWD . '/global.php');

// Get some custom functions from vBulletin directory
require_once(CWD . '/includes/functions_loo.php');

The CWD constant will insure that all calls to vBulletin files point to the right directory, even the ones vBulletin makes on its own when you include global.php. Just make sure you always use the constant in the require_once(); function and everything should work correctly (unless you set the wrong path!).

Hope that helps.

im not 100% why global.php is called, but i assume it is to get VBB to integrate correctly. but what is functions_loo.php usefull for?

SHoeSTeR
04 Apr 2006, 03:29
http://www.purephat.net/forum/gallery2.php

thats my problem a huge list of php errors

johnmont
04 Apr 2006, 03:38
Bottom line here is that the embed.php file can't be found.

Failed opening required '../forum/gallery2/embed.php'

The path to the embed.php is not correct in the gallery2.php file. If you correct that, this problem will go away....

defcon_420
04 Apr 2006, 03:53
http://www.purephat.net/forum/gallery2.php

thats my problem a huge list of php errors

/home/admin2/public_html/purephat/forum/gallery2.php on line 60

please correct me if i'm wrong but your path seems to be wrong.
Vbulletin should be installed into your public_html directory, not nested down so far. EG. /forums

Also your gallery2 should be installed into /public_html/gallery2

Here i asked the same question (http://www.vbulletin.org/forum/showpost.php?p=939642&postcount=2)
Here is the answer (http://www.vbulletin.org/forum/showpost.php?p=939686&postcount=3)
and here is how to move you existing installations :) (http://www.vbulletin.org/forum/showpost.php?p=939705&postcount=5)
hope this helps cause it works great for me!

Awesome job guys:banana:

albertsch9
04 Apr 2006, 13:00
does it output just a white screen, or does it put your style with no content?

i had this problem, and resolved it. i am trying to remember how i fixed it


it gives me only a white screen.

SilVert
04 Apr 2006, 20:01
it gives me only a white screen.

post your code, i think my problem was with the VBB template name in the integration script.

Brad
05 Apr 2006, 02:08
im not 100% why global.php is called, but i assume it is to get VBB to integrate correctly. but what is functions_loo.php usefull for?
It was just an example of calling a custom file, ignore it. :)

ztempuser
05 Apr 2006, 19:01
here is what get, i donno what to do, i tried to change things to see if it fixes it but nothing works
http://www.el-halawa.net/forum/gallery2.php

tuanluu
05 Apr 2006, 19:55
$ret = GalleryEmbed::init(array('embedUri' => '/gallery2.php',
'g2Uri' => 'http://www.yoursite.com/gallery2/',
'loginRedirect' => 'index.php',

if I edit this line the icon gallery will not show.

if I 'http://www.paranormalis.com/gallery2/

it work fine but there are differnt problem


For some reason when I try to upload a picture to album I will not should in the forum, but when I go direct too gallery2 it show.

does anyone has this problem or just me ?

SilVert
05 Apr 2006, 20:23
$ret = GalleryEmbed::init(array('embedUri' => '/gallery2.php',
'g2Uri' => 'http://www.yoursite.com/gallery2/',
'loginRedirect' => 'index.php',

if I edit this line the icon gallery will not show.

if I 'http://www.paranormalis.com/gallery2/

it work fine but there are differnt problem


For some reason when I try to upload a picture to album I will not should in the forum, but when I go direct too gallery2 it show.

does anyone has this problem or just me ?

do you have the "URL Rewrite" module configured/installed? if so, disable the module or go into the module and uncheck the "Show Item" check, and then save.
also known as the Mod Rewrite module from apache.

also, if your setup is like mine....
VBB: yoursite.com/forum/gallery.php
Gallery: wourstie.com/gallery/

you dont need the leading / in the embedUri if your setup is like mine...

g2uri should be "http://www.luuhoanggallery.com/gallery/" for you. or you can make the g2uri "/gallery/" and it will work. i just verified that on my site. so that might also help(i personaly like that better:)) jsut and FYI :).

ztempuser
05 Apr 2006, 20:41
silvert, do you know what could be causeing my errors?

i looked in my php.ini it says
url_rewriter.tags a=href,area=href,frame=src,form=,fieldset=

tuanluu
06 Apr 2006, 04:25
thank it work now thank very much... I have one more question.. do you know any smtp service that is free? I use to use yahoo but it seem like this gallery does not like yahoo stmp :(

SilVert
06 Apr 2006, 13:45
silvert, do you know what could be causeing my errors?

i looked in my php.ini it says
url_rewriter.tags a=href,area=href,frame=src,form=,fieldset=

what are your errors(i just looked back and only saw a link you posted:)). i looked at your gallery link you posted and other than no content, it looks ok to me...

what is wrong?

thank it work now thank very much... I have one more question.. do you know any smtp service that is free? I use to use yahoo but it seem like this gallery does not like yahoo stmp :(
no problem :)

you can run a SMTP service on your machine, thereticaly. are you on a shared server or a dedicated one?

if shared, contact your host and see what they say. if it is dedicated, im 99% sure there are some free SMTP services out there.

ztempuser
06 Apr 2006, 18:39
o wow silvertit workks when your im not logged in, when i am logged in it says

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/forum/gallery2.php at line 95 (galleryembed::createuser)
* in /home/********/public_html/forum/gallery2.php at line 50

SuperJETT
06 Apr 2006, 19:06
I guess I've got something going on with the plugins.
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/.bluster/superjett/x-h20.com/includes/class_dm_user.php(1548) : eval()'d code on line 10
That is the message I get when I try to change something in my usercp or try to logout. Also, when I do open www.x-h2o.com/gallery2.php or /gallery2/ I get the gallery, but no way to upload anything, I can only view.

Do I need to change some usergroup permissions or other?

defcon_420
06 Apr 2006, 19:10
o wow silvertit workks when your im not logged in, when i am logged in it says

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/forum/gallery2.php at line 95 (galleryembed::createuser)
* in /home/********/public_html/forum/gallery2.php at line 50

If you have User Albums enabled with Create Album When first accessed there is a way around this untill a code or mod can be made to fix it

1. Make a second ID in your own forum
2. Enter your gallery with new user and click YOUR ALBUM - top right (should have no error but no admin) then log out
3. log into gallery non embed as admin eg." www.yourdomain.com/gallery2/main.php" select groups then add the new user that you made in your forum as "Site Admin" and log out
4. Log in with Your 2nd forum ID and go to www.example.com/gallery2.php then click Users and delete your original Admin then log out
5. Go back to www.example.com/gallery2.php as Admin and click Your album then log out
6. Go back in with your 2nd forum ID then give your Admin account "Site Admin" status from within the gallery.
Congratulations you can now log in as admin without error

Johnmont found the reason why here (http://www.vbulletin.org/forum/showpost.php?p=939859&postcount=10)

hope that helps cause it worked for me :)

ztempuser
06 Apr 2006, 19:58
i think i might wait for the new codes to come out:P

I guess I've got something going on with the plugins.
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/.bluster/superjett/x-h20.com/includes/class_dm_user.php(1548) : eval()'d code on line 10
That is the message I get when I try to change something in my usercp or try to logout. Also, when I do open www.x-h2o.com/gallery2.php or /gallery2/ I get the gallery, but no way to upload anything, I can only view.

Do I need to change some usergroup permissions or other?
hey i started getting the same thing, either when i log out of my forum, or when i post a thread

Unable to add cookies, header already sent.
File: /home/*******/public_html/forum/includes/class_dm_user.php(1488) : eval()'d code
Line: 10
and at teh top of the page it says
Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/********/public_html/forum/includes/class_dm_user.php(1488) : eval()'d code on line 10

johnmont
06 Apr 2006, 22:28
Anyone up for helping me beta test my integration script with support of primary user group from VB?

Please PM me if you are....

defcon_420
07 Apr 2006, 09:25
Blackwidow
if you turn your URL Rewrite module off in gallery 2 admin your pictures should work, they have had alot of problems with that URL Rewrite module i have read over in menatlo's gallery forums. Also you should disable your registration module as the same users will come from your existing Vbulletin database.

Aken
07 Apr 2006, 12:10
So I haven't taken the time to do this yet, because of a bunch of web site moves and stuff....

But if this little tutorial works and I can integrate the two, I will LOVE YOU FOREVER. lol

SilVert
07 Apr 2006, 14:08
So I haven't taken the time to do this yet, because of a bunch of web site moves and stuff....

But if this little tutorial works and I can integrate the two, I will LOVE YOU FOREVER. lol

expect to give love ;)

Anyone up for helping me beta test my integration script with support of primary user group from VB?

Please PM me if you are....

im a bit weary, but as long as i can remove the code and it not hurt anything..i am down :)

i will be out of town all next week(carribean here i come!!) so when i come back i might be down if you dont have anybody yet.

yes, i know its not a PM ;)

johnmont
07 Apr 2006, 14:31
yes, i know its not a PM ;)

Ha ...no worries.

Hopefully it will be full go and debugged by then. Enjoy the warm weather!

albertsch9
07 Apr 2006, 19:30
post your code, i think my problem was with the VBB template name in the integration script.
I have created a Templatenamed gallery and the gallery2.php calls the template gallery.
The gallery2.php gives me only a white screen:tired:

The Chief
08 Apr 2006, 03:10
I guess I've got something going on with the plugins.
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/.bluster/superjett/x-h20.com/includes/class_dm_user.php(1548) : eval()'d code on line 10
That is the message I get when I try to change something in my usercp or try to logout. Also, when I do open www.x-h2o.com/gallery2.php or /gallery2/ I get the gallery, but no way to upload anything, I can only view.

Do I need to change some usergroup permissions or other?
I have the same error!!

anybody knows how this can be fixed??

yeah, there seems to be some bugs...

A big one also is that it takes ALOT of time to load...

hope it will come bug free soon :)

Clayton
08 Apr 2006, 19:19
thank you Brent H

will take a look at this when time allows as the whole vBadvanced Gallery story has become a tad difficult

thalamus
10 Apr 2006, 07:09
I guess I've got something going on with the plugins.
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/.bluster/superjett/x-h20.com/includes/class_dm_user.php(1548) : eval()'d code on line 10
That is the message I get when I try to change something in my usercp or try to logout.
I believe this is caused by a spurious ' in the "Update Gallery User" plugin - took me a little while to find, but it's actually in the first line of the code.

If you go to AdminCP -> Plugin System -> Plugin Manager, then click Edit against the Update Gallery User, you'll see the first line being something like this:
require_once('/home/xxxxxx/public_html/gallery2/embed.php'');
As you can see, there's an additional single quote at the end of the line... just remove it, and it should remove the error.

tuanluu
10 Apr 2006, 07:38
I think check your plugin there is a extra '

I think.. It work for me

defcon_420
10 Apr 2006, 09:36
anyone have any luck with getting the rewrite module to work embedded?
I either get my header images and no pic's in the gallery(broken links) or i get no header images (broken links) and pictures work in the gallery.. it seems to be redirecting the images outside of the gallery as well as the images inside.

d8tabyte
10 Apr 2006, 16:24
Ive been working on this for the past week and a half and my mind has finally gone numb. I get the same issues, I get it to work embeded, the second I upload a pic, white screen and gallery2.php becomes inaccessable. I give up until a better system is worked out.

As a side note, non embed works fine even after the issues with gallery2.php

defcon_420
10 Apr 2006, 16:39
i would suggest you hold out a little d8tabyte, johnmont has been beta testing new plugins and intergration script. I'll let him fill you in on what it does when he is ready to put it in production.

ztempuser
10 Apr 2006, 20:15
i have done some of the testing my self and i have found it to work, but now i also have a problem. i have uploaded images the my gallery2/ and my gallery2 works just fine, also i have no problems with mod normal users and super mods accessing the galler2.php page. but when they do the page comes out empty, i mean it has all the info like album names..... but no pictures are showing up what so ever just text in its placei would suggest you hold out a little d8tabyte, johnmont has been beta testing new plugins and intergration script. I'll let him fill you in on what it does when he is ready to put it in production.

defcon_420
11 Apr 2006, 03:40
this is because you have the URL rewrite module enabled .. go into your gallery admin then modules and disable or remove the modue
then your pictures will work

Elvin MotricÚ
11 Apr 2006, 11:45
I get these error messages when installing the plugins. They appear when a user tries to post a new thread:

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /usr/home/ry3944/domains/twilights.be/public_html/boards/includes/class_dm_user.php(1571) : eval()'d code on line 10


Unable to add cookies, header already sent.
File: /usr/home/ry3944/domains/twilights.be/public_html/boards/includes/class_dm_user.php(1571) : eval()'d code
Line: 10

And also my gallery2.php doesn't show gallery. It comes up empty if I don't use the standard vBulletin layout. My site uses another layout and in this one it doesn't show gallery.

http://boards.twilights.be/gallery2.php

EDIT: for some strange and twisted reason it does show the gallery in both layouts now. Though I still get the error when I activate the plugins

EDIT2: I've narrowed the source of the error down to the Update Gallery User Plugin.

Final EDIT: thanks to a friend who knows a bit more about php then me I've been able to resolve all problems. There was a problem with the settings of my webserver and one problem with the script. All matters resolved!

tuanluu
12 Apr 2006, 04:50
go to plug in manager edit two plug in one say delete and upadate gallery

find the line public_html or something similar and fix to you need

and check for the extra commo too take one out

I up ../gallery it work for me

ztempuser
13 Apr 2006, 03:26
but you know,? i have had it uninstalled for a while now, and it still is disabled, i guess thats not my problem what else could be cuuseing this to not let the pics show up?this is because you have the URL rewrite module enabled .. go into your gallery admin then modules and disable or remove the modue
then your pictures will work

tuanluu
13 Apr 2006, 05:33
does you gallery work alone?

defcon_420
13 Apr 2006, 08:27
Blackwidow one of your path's in the gallery2.php is incorrect.. play with the path settings
mines working great :)

ztempuser
13 Apr 2006, 22:15
:D your right lol i went back and read the whole script line by line and i found this
// the folder where you've installed gallery relative to httpd root. Should have trailing /
define('G2_URI', '/gallery2/');
it says /gallery2/ i have mine in /forum/gallery2/ now it works nice:D its a charm to have. but one thing im waiting for the fix for is for the adim to beable to see the gallery page, i know the instructions where given but i did not fully understand so i didn't try it, but im getting mad at the problem so i will try it in a few min lol.

defcon_420
14 Apr 2006, 00:27
ok, make another user, give them admin rights (non embedded e.g www.yoursite.com/gallery2/main.php)
then go in with the new admin embedded and delete your first admin, then re-enter him (eg. www.yoursite.com/gallery2.php)
thats it basically

ztempuser
14 Apr 2006, 01:12
man i finaly got it:) im so happy now lol, i still didn't get much of what you said lol, but i played around for about 30min and i got it:)
great thread guys:)

SilVert
17 Apr 2006, 14:44
anybody still with outstanding issues at this point?

JoshMount. im back, and the weather was so nice... now, about that plugin beta ;)

silkie
18 Apr 2006, 23:41
yup me. I've done what you said to do but I think I might be in a different situation. I'm using vb 3.5.4 with g2.1 and vbadvanced 2.1(also using update/delete members plugin) which means I have g2 in my root folder, vbadvanced in root (called portal) and forums directory under vb (portal)

ie:
home/
gallery2/
portal/forums/gallery2.php

I fixed the two plugins where it had the extra ' after embed. ie: require_once('/home/vampirec/public_html/gallery2/embed.php '');

then I did this:
ok, make another user, give them admin rights (non embedded e.g www.yoursite.com/gallery2/main.php)
then go in with the new admin embedded and delete your first admin, then re-enter him (eg. www.yoursite.com/gallery2.php)

that just didn't work. not under any circumstances. when the page loads (AFTER I log in) it shows my vb template, however the area where the gallery SHOULD be is empty and I have this error:

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 166 (gallerystatus::error)
in modules/core/classes/GalleryEmbed.class at line 300 (galleryuser::create)
in /home/vampirec/public_html/portal/forums/gallery2.php at line 95 (galleryembed::createuser)
in /home/vampirec/public_html/portal/forums/gallery2.php at line 50

if I'm NOT logged in I get this error:
line: 115, G2 did not return a success status. Here is the error message from G2:
Error (GALLERY_SUCCESS)
in at line 0


any clues on what the heck I did and where I might have gotten turned around?

defcon_420
19 Apr 2006, 02:53
i think your best off to move your exising installations as brent explained in THIS POST (http://www.vbulletin.org/forum/showpost.php?p=939686&postcount=3) the problem Brent ran in to was that it expected files referenced by global.php to be located in places that they aren't...

HERE (http://www.vbulletin.org/forum/showpost.php?p=939705&postcount=5) are the instruction to move your current installs

I use vbadvanced 2.1 on vbulletin 3.5.4 with gallery 2.1 and it all works great!

silkie
19 Apr 2006, 04:06
I must be having a super blonde moment because for some reason I just can't seem to catch on to this extremely simple newbie concept. are you saying you don't have your vb installed in your portal directory? don't you HAVE to have it in the portal directory? if that's the case where do you have your portal directory and how did you get around the whole forums having to be in the portal directory thing?

defcon_420
19 Apr 2006, 05:47
ie:
home/
gallery2/
portal/forums/gallery2.php


install your vbulleting into your webroot directory, install your portal into your webroot directory then install your gallery2 into /gallery2
so
vb = /
portal =/
and gallery2 = /gallery2

:banana:

silkie
19 Apr 2006, 14:12
ok I'll give that a try. I re-read the vba install file, it doesn't say it has to be in the portal directory. I'm not sure why I thought it had to be in the portal directory other than I was thinking of vbportal. thanks for the quick response defcon, hopefully I won't have to bother you anymore.

p.s. cute nanner! LOL

I don't know what I"ve done but now my css isn't working for my portal. it's working fine in my forums page though. look here maybe you can tell me what I"ve over looked (again)

portal:
www.vampirecommunity.com/forums/index.php

forums:
www.vampirecommunity.com/forums/forum.php

I renamed my forums to forum.php and put my portal in my forums directory and named it index.php still no go with my style

SilVert
19 Apr 2006, 15:47
i dont know anything about VBadvanced... so here is my .02 :)

it can work with your current structure... but you need to have the gallery.php file in your forums root(as far as i know, not the protal root). then the paths must be entered from that point... so if i am reading it correctly... it shoudl look like this:


$ret = GalleryEmbed::init(array('embedUri' => 'gallery2.php',
'g2Uri' => '/gallery2/',
'loginRedirect' => 'index.php',
'activeUserId' => $uid));

as long as it is in the forum directory, i think this will work for you... but you might also need to change the path for the global.php(mine is ./global.php since it is in the forum root).

silkie
19 Apr 2006, 15:50
I guess I'll get back to that as soon as I figure out why I lost my css style :(

gosh darn it! now I can't log in either

just moved my cmps_index.php (renamed to index.php) to root and it's still a no go with the style.

SilVert
19 Apr 2006, 20:09
the css on gallery will come along once you have all the paths correctly inserted. or they should.. i dont really have a test site to play with that has vbadvanced. i have plain jane VBB :)

silkie
19 Apr 2006, 21:16
I finally got my design back for the most part. I had to do a complete uninstall and then reinstall. I'm not sure why but it fixed it for the most part. there's a couple of tweaks I still have to redo but nothing major. now I can play with the gallery part.


oh and thanks for your help

I'm still getting this error on my gallery
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 166 (gallerystatus::error)
in modules/core/classes/GalleryEmbed.class at line 300 (galleryuser::create)
in /home/vampirec/public_html/forums/gallery2.php at line 95 (galleryembed::createuser)
in /home/vampirec/public_html/forums/gallery2.php at line 50

I'm going to try the way around this like earlier posted but I have one question.

I have more members than just myself...so when I make another ID do just make a new user period or does it matter what ID I give that user?

SilVert
21 Apr 2006, 18:04
I finally got my design back for the most part. I had to do a complete uninstall and then reinstall. I'm not sure why but it fixed it for the most part. there's a couple of tweaks I still have to redo but nothing major. now I can play with the gallery part.


oh and thanks for your help

I'm still getting this error on my gallery
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 166 (gallerystatus::error)
in modules/core/classes/GalleryEmbed.class at line 300 (galleryuser::create)
in /home/vampirec/public_html/forums/gallery2.php at line 95 (galleryembed::createuser)
in /home/vampirec/public_html/forums/gallery2.php at line 50

I'm going to try the way around this like earlier posted but I have one question.

I have more members than just myself...so when I make another ID do just make a new user period or does it matter what ID I give that user?

your error is cause you are trying to log into Gallery with the vbb admin account(aka acount #1), there is already a 1 created in gallery. that is the reason you are getting that error. or atleast in my experances :) if you jump into the gallery with another user account(created by VIA the script or not) it should work.

if you are using the plugin approach:
i belive the way it will work is that when a new user is created(VIA VBB), the plugin will be trigered and create an account in the gallery system... same idea when you delete a user account. but i am not using this method as of yet

if you are soley using the integration script:
when you hit the script for the 1st time(assumeing you have met all the pre req's) it will create your user account. once that is done the rest of the configuration is all done VIA gallery. if you delete a user out of VBB, you will have to delete the user manualy out of Gallery.

does that all make sence to you?

ztempuser
23 Apr 2006, 04:16
i have a few mod questions, how can i remove these from the bottom of my pages?
http://el-halawa.net/forum/gallery2/images/xhtml10.pnghttp://el-halawa.net/forum/gallery2/images/gallery.gifhttp://el-halawa.net/forum/gallery2/modules/core/data/g21-blackjack.pnghttp://el-halawa.net/forum/gallery2/modules/core/data/donate.png
also i'm useing the classic theme and at the top it has like this bar that tells you where your at *ex: if im in a sub album like lets say cars, so at the top it will say gallery/cars/ and they are links as well* (lol) well for some reason they are showing up to small on the gallery page on my forum, but in the normal gallery2/main.php the text is just fine

silkie
23 Apr 2006, 16:24
your error is cause you are trying to log into Gallery with the vbb admin account(aka acount #1), there is already a 1 created in gallery. that is the reason you are getting that error. or atleast in my experances if you jump into the gallery with another user account(created by VIA the script or not) it should work.

if you are using the plugin approach:
i belive the way it will work is that when a new user is created(VIA VBB), the plugin will be trigered and create an account in the gallery system... same idea when you delete a user account. but i am not using this method as of yet

if you are soley using the integration script:
when you hit the script for the 1st time(assumeing you have met all the pre req's) it will create your user account. once that is done the rest of the configuration is all done VIA gallery. if you delete a user out of VBB, you will have to delete the user manualy out of Gallery.

does that all make sence to you?

ok I'm following you there. I understand how it's reading that I already have user account. I tried entering with a different account and I even tried making that new account an admin but I still get an error. the other thing is that now matter who I try to log in as, I don't get the gallery to come up at all. All I get is my vbtemplate and a piece of text that says gallery but I can't click on any album or anything. it's as if there is no gallery and that error won't go away. here's the error I'm getting now:

line: 121, G2 did not return a success status. Here is the error message from G2:
Error (GALLERY_SUCCESS)
in at line 0

here's a screenshot of what it's doing.

SilVert
24 Apr 2006, 18:55
ok I'm following you there. I understand how it's reading that I already have user account. I tried entering with a different account and I even tried making that new account an admin but I still get an error. the other thing is that now matter who I try to log in as, I don't get the gallery to come up at all. All I get is my vbtemplate and a piece of text that says gallery but I can't click on any album or anything. it's as if there is no gallery and that error won't go away. here's the error I'm getting now:

line: 121, G2 did not return a success status. Here is the error message from G2:
Error (GALLERY_SUCCESS)
in at line 0

here's a screenshot of what it's doing.


what is on line 121? is it this:

else
{
echo '<HR>line: '.__LINE__.', G2 did not return a success status. Here is the error message from G2: <br />'.$ret->getAsHtml();
return false;
}

if so

make sure that the following section, looks like this:

// User not mapped, create G2 user now
// Get Arguments for the new user:
$args['fullname'] = $vbulletin->userinfo['username'];
$args['username'] = $vbulletin->userinfo['username'];
$args['hashedpassword'] = $vbulletin->userinfo['password'];
$args['hashmethod'] = 'md5';
$args['email'] = $vbulletin->userinfo['email'];
$args['language'] = $vbulletin->userinfo['lang_code'];
$args['creationtimestamp'] = $vbulletin->userinfo['joindate'];

im just guessing, i dont remember how i resolved that on my site...

silkie
27 Apr 2006, 15:46
yes that's exactly what's on line 121. here's my gallery2.php file, maybe I got it all screwed up.

SilVert
28 Apr 2006, 15:08
if you go into notepage(or most text editors) and do a Ctrl g, it will bring up a prompt asking what line to goto

on your line 121 it is a "}" which makes me think that it is extra... try removing it and see what it says...

silkie
30 Apr 2006, 01:41
if I do that it tells me this error:

Parse error: parse error, unexpected $ in /home/vampirec/public_html/forums/gallery2.php on line 177

defcon_420
01 May 2006, 01:48
Really dont want to hijack this thread so i'll keep it short with a link. Since most of the development with gallery2.1 intergration is going on here i hope someone else may have a better idea of this than me.
here a random gallery block that will display in vbAdvanced 2.1
i had been asking and asking for someone to make this but i managed to do it myself. I'm not a coder so any help is very welcome.
The only problem is it when u click on the picture in the CMPS it returns the image non embedded.. i'd really like to fix this or if someone else has any idea's how to make it work returning the photo embedded mode.

If you install it please click INSTALL :)

http://www.vbulletin.org/forum/showthread.php?t=114434

SilVert
01 May 2006, 18:13
if I do that it tells me this error:

Parse error: parse error, unexpected $ in /home/vampirec/public_html/forums/gallery2.php on line 177

what is your VBB gallery template called?

you have both gallery and gallery2 throughout your script.... for simplicity, it might be easyer to name the integration script and the template the same thing and then just use gallery or gallerys2 through the script when it needs to be mentione(only a reccomendation)

silkie
02 May 2006, 15:43
the integration script is gallery2.php and the template is gallery2 am I on the right track? or am I missing what you are asking me?

SilVert
02 May 2006, 17:21
the integration script is gallery2.php and the template is gallery2 am I on the right track? or am I missing what you are asking me?

fix line(says gallery, it should be gallery2 from the info in your prior post) 8. see what that changes... :)

silkie
03 May 2006, 19:30
everything now says gallery2 and I still keep getting the same message. it gives me my vb style and navbar and says forums>Gallery but nothing below that. just my footer. error message is still:

line: 119, G2 did not return a success status. Here is the error message from G2:
Error (GALLERY_SUCCESS)
in at line 0


here's my gallery2.php



<?php

// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'gallery2'); // change this depending on your filename

// ################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups
$phrasegroups = array(

);

// get special data templates from the datastore
$specialtemplates = array(

);

// pre-cache templates used by all actions
$globaltemplates = array(
'gallery2',
);

// pre-cache templates used by specific actions
$actiontemplates = array(

);

// ######################### REQUIRE BACK-END ############################

// Full path to vBulletin
define('CWD', '/home/vampirec/public_html/forums');

// Call global.php
require_once(CWD . '/global.php');

// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################

$navbits = array();
$navbits[$parent] = 'Gallery';
error_reporting(E_ALL );

$navbits = construct_navbits($navbits);
eval('$navbar = "' . fetch_template('navbar') . '";');

// #######################################################################
// ###################### Begin G2 INTEGRATION CODE ######################
// #######################################################################

$data = runGallery();
$data['title'] = (isset($data['title']) && !empty($data['title'])) ? $data['title'] : 'Gallery';

function runGallery() {
global $vbulletin, $userinfo;
require_once('/home/vampirec/public_html/gallery2/embed.php');

$data = array();

// If it's an anonymous user, set the g2 activeUser to null
$uid = $vbulletin->userinfo['userid'] = 0 ? '' : $vbulletin->userinfo['userid'];

// initiate G2
// You need to edit the following 4 lines to suit your VB3 & G2 installations
// This is set up for an install that looks like:
// public_html/VB/<vb files>
// public_html/gallery2/<gallery2 files>
// and also setup for a VB3 template name of 'gallery2'. If you have any
// differences, make those changes here!
// You might need to change 'loginRedirect' if you have your VB3 setup to
// where index.php is not the root page of VB3... Like if you've changed it
// to forums.php or something of the like.

$ret = GalleryEmbed::init(array('embedUri' => '/gallery2.php',
'g2Uri' => 'http://www.vampirecommunity.com/gallery2/',
'loginRedirect' => 'index.php',
'activeUserId' => $uid));
if ($ret)
{
if ($ret->getErrorCode() & ERROR_MISSING_OBJECT)
{
// Check if there's no G2 user mapped to the activeUserId
$ret = GalleryEmbed::isExternalIdMapped($uid, 'GalleryUser');
if ($ret && ($ret->getErrorCode() & ERROR_MISSING_OBJECT))
{
// User not mapped, create G2 user now
// Get Arguments for the new user:
$args['fullname'] = $vbulletin->userinfo['username'];
$args['username'] = $vbulletin->userinfo['username'];
$args['hashedpassword'] = $vbulletin->userinfo['password'];
$args['hashmethod'] = 'md5';
$args['email'] = $vbulletin->userinfo['email'];
$args['language'] = $vbulletin->userinfo['lang_code'];
$args['creationtimestamp'] = $vbulletin->userinfo['joindate'];

$retcreate = GalleryEmbed :: createUser($uid, $args);
if ($retcreate)
{
echo '<HR>line: '.__LINE__.', Failed to create G2 user with extId ['.$uid.']. Here is the error message from G2: <br />'.$retcreate->getAsHtml();
return false;
}
$ret = GalleryEmbed::checkActiveUser($uid);
if ($ret) {
print $ret->getAsHtml();
return false;
}
}
else
{
echo '<HR>line: '.__LINE__.', G2 did not return a success status. Here is the error message from G2: <br />'.$ret->getAsHtml();
return false;
}
}
else
{
echo '<HR>line: '.__LINE__.', G2 did not return a success status. Here is the error message from G2: <br />'.$ret->getAsHtml();
return false;
}
}

// user interface: disable sidebar in G2 and get it as separate HTML to put it into a block
//GalleryCapabilities::set('showSidebar', false);

// handle the G2 request
$g2moddata = GalleryEmbed::handleRequest();

// show error message if isDone is not defined
if (!isset($g2moddata['isDone'])) {
$data['bodyHtml'] = 'isDone is not defined, something very bad must have happened.';
return $data;
}
// die if it was a binary data (image) request
if ($g2moddata['isDone']) {
exit; /* uploads module does this too */
}

// put the body html from G2 into the xaraya template
$data['bodyHtml'] = isset($g2moddata['bodyHtml']) ? $g2moddata['bodyHtml'] : '';

// get the page title, javascript and css links from the <head> html from G2
$title = ''; $javascript = array(); $css = array();

if (isset($g2moddata['headHtml'])) {
list($data['title'], $css, $javascript) = GalleryEmbed::parseHead($g2moddata['headHtml']);
$data['headHtml'] = $g2moddata['headHtml'];
}

/* Add G2 javascript */
if (!empty($javascript)) {
foreach ($javascript as $script) {
$data['javascript'] .= "\n".$script;
}
}

/* Add G2 css */
if (!empty($css)) {
foreach ($css as $style) {
$data['css'] .= "\n".$style;
}
}

// sidebar block
if (isset($g2moddata['sidebarHtml']) && !empty($g2moddata['sidebarHtml'])) {
$data['sidebarHtml'] = $g2moddata['sidebarHtml'];
}

return $data;
}
// #######################################################################
// ####################### End G2 integration code #######################
// #######################################################################

eval('print_output("' . fetch_template('gallery2') . '");');

?>

SilVert
04 May 2006, 17:30
try this....

on line 77 change the following from
$ret = GalleryEmbed::init(array('embedUri' => '/gallery2.php',
to
$ret = GalleryEmbed::init(array('embedUri' => 'gallery2.php',

i am just shooting in the dark.. as i said, i really dont remember how i got it to work on my site :)

silkie
04 May 2006, 18:32
nope no change. it's just driving me nuts now.

SilVert
04 May 2006, 21:26
ooooooo

you deleted the user that you are attempting to run the script with correct?

2 things you can do.... either go into the ?externalid? table in the gallery DB and remove the users VBB ID number(admin is 1, you would be 2, that kinda stuff), or create a ANOTHER NEW user and then run the script with him again.

basically gallery does not ?ever? delete the external ID's of users. so you have to manualy manipulate the table to get them working agin. i am, about 70% sure that this is the problem... not 100% sadly ;)

ngocluyen
05 May 2006, 01:44
thanks it work great!thanks U so much !

Jayphen
06 May 2006, 05:53
Hmm after installing this it all seems to work fine (with the exception of the error when I log in myself.. I get that user collision error)

However, at random intervals, users are experiencing errors saying 'this post is identical to a post you have made in the past 5 minutes.. returning you to that thread now' .. and alot of posts seem to be going through twice.

edit: It only happens with the plugins installed

silkie
06 May 2006, 15:03
2 things you can do.... either go into the ?externalid? table in the gallery DB and remove the users VBB ID number(admin is 1, you would be 2, that kinda stuff), or create a ANOTHER NEW user and then run the script with him again.



I went into phpmyadmin and looked at my gallery db and in the externalid table I have 0 users and when I look at the users table I have 2 users. guest with is id 5 and silkie with id 19. shouldn't my id as admin be id 1?

SilVert
08 May 2006, 16:09
Hmm after installing this it all seems to work fine (with the exception of the error when I log in myself.. I get that user collision error)

However, at random intervals, users are experiencing errors saying 'this post is identical to a post you have made in the past 5 minutes.. returning you to that thread now' .. and alot of posts seem to be going through twice.

edit: It only happens with the plugins installed
sadly i dont know much abotu the plugin version.. i have only looked at the code, nothign else.... johnmount has not posted back abotu a beta of his plugin... :(

I went into phpmyadmin and looked at my gallery db and in the externalid table I have 0 users and when I look at the users table I have 2 users. guest with is id 5 and silkie with id 19. shouldn't my id as admin be id 1?

if i am understanding this correctly, the integration script is not working(duhhhh ;))... when it registeres the users, it should throw the VBB id in the externalid's table of Gallery2. which would mean that something is defined wrong in that upper section where you define paths. without knowing your system better/being in there it is hard for me to guess(sadly).

here is my script:

<?php

// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'gallery'); // change this depending on your filename

// ################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups
$phrasegroups = array(

);

// get special data templates from the datastore
$specialtemplates = array(

);

// pre-cache templates used by all actions
$globaltemplates = array(
'gallery',
);

// pre-cache templates used by specific actions
$actiontemplates = array(

);

// ######################### REQUIRE BACK-END ############################

require_once('./global.php');

// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################

$navbits = array();
$navbits[$parent] = 'Gallery';
error_reporting(E_ALL );

$navbits = construct_navbits($navbits);
eval('$navbar = "' . fetch_template('navbar') . '";');

// #######################################################################
// ###################### Begin G2 INTEGRATION CODE ######################
// #######################################################################

$data = runGallery();
$data['title'] = (isset($data['title']) && !empty($data['title'])) ? $data['title'] : 'Gallery';

function runGallery() {
global $vbulletin, $userinfo;
require_once('/home/httpd/vhosts/racersden.net/httpdocs/gallery/embed.php');

$data = array();

// If it's an anonymous user, set the g2 activeUser to null
$uid = $vbulletin->userinfo['userid'] = 0 ? '' : $vbulletin->userinfo['userid'];

// initiate G2
// You need to edit the following 4 lines to suit your VB3 & G2 installations
// This is set up for an install that looks like:
// public_html/VB/<vb files>
// public_html/gallery2/<gallery2 files>
// and also setup for a VB3 template name of 'gallery2'. If you have any
// differences, make those changes here!
// You might need to change 'loginRedirect' if you have your VB3 setup to
// where index.php is not the root page of VB3... Like if you've changed it
// to forums.php or something of the like.

$ret = GalleryEmbed::init(array('embedUri' => 'gallery.php',
'g2Uri' => '/gallery/',
'loginRedirect' => 'index.php',
'activeUserId' => $uid));

if ($vbulletin->userinfo[usergroupid] == 5 or $vbulletin->userinfo[usergroupid] == 6 or $vbulletin->userinfo[usergroupid] == 7 or $vbulletin->userinfo[usergroupid] == 11 or $vbulletin->userinfo[usergroupid] == 12)
{

if ($ret)
{
if ($ret->getErrorCode() & ERROR_MISSING_OBJECT)
{
// Check if there's no G2 user mapped to the activeUserId
$ret = GalleryEmbed::isExternalIdMapped($uid, 'GalleryUser');
if ($ret && ($ret->getErrorCode() & ERROR_MISSING_OBJECT))
{
// User not mapped, create G2 user now
// Get Arguments for the new user:
$args['fullname'] = $vbulletin->userinfo['username'];
$args['username'] = $vbulletin->userinfo['username'];
$args['hashedpassword'] = $vbulletin->userinfo['password'];
$args['hashmethod'] = 'md5';
$args['email'] = $vbulletin->userinfo['email'];
$args['language'] = $vbulletin->userinfo['lang_code'];
$args['creationtimestamp'] = $vbulletin->userinfo['joindate'];

$retcreate = GalleryEmbed :: createUser($uid, $args);
if ($retcreate)
{
echo '<HR>line: ' . $__LINE__ . ', Failed to create G2 user with extId ['.$uid.']. Here is the error message from G2: <br />'.$retcreate->getAsHtml();
return false;
}
$ret = GalleryEmbed::checkActiveUser($uid);
if ($ret) {
print $ret->getAsHtml();
return false;
}
}
else
{
echo '<HR>line: '.__LINE__.', G2 did not return a success status. Here is the error message from G2: <br />'. $ret->getAsHtml();
return false;
}
}
else
{
echo '<HR>line: '.__LINE__.', G2 did not return a success status. Here is the error message from G2: <br />'.$ret->getAsHtml();
return false;
}
}
}

// user interface: disable sidebar in G2 and get it as separate HTML to put it into a block
//GalleryCapabilities::set('showSidebar', true);

// handle the G2 request
$g2moddata = GalleryEmbed::handleRequest();

// show error message if isDone is not defined
if (!isset($g2moddata['isDone'])) {
$data['bodyHtml'] = 'isDone is not defined, something very bad must have happened.';
return $data;
}
// die if it was a binary data (image) request
if ($g2moddata['isDone']) {
exit; /* uploads module does this too */
}

// put the body html from G2 into the xaraya template
$data['bodyHtml'] = isset($g2moddata['bodyHtml']) ? $g2moddata['bodyHtml'] : '';

// get the page title, javascript and css links from the <head> html from G2
$title = ''; $javascript = array(); $css = array();

if (isset($g2moddata['headHtml'])) {
list($data['title'], $css, $javascript) = GalleryEmbed::parseHead($g2moddata['headHtml']);
$data['headHtml'] = $g2moddata['headHtml'];
}

/* Add G2 javascript */
if (!empty($javascript)) {
foreach ($javascript as $script) {
$data['javascript'] .= "\n".$script;
}
}

/* Add G2 css */
if (!empty($css)) {
foreach ($css as $style) {
$data['css'] .= "\n".$style;
}
}

// sidebar block
if (isset($g2moddata['sidebarHtml']) && !empty($g2moddata['sidebarHtml'])) {
$data['sidebarHtml'] = $g2moddata['sidebarHtml'];
}

return $data;
}
// #######################################################################
// ####################### End G2 integration code #######################
// #######################################################################

eval('print_output("' . fetch_template('gallery') . '");');

?>


forum is in racersden.net/forum
gallery is in racersden.net/gallery
template name is gallery
integration name is gallery.php

see if this helps you at all :)





For users using the ingegration script, i have put in the code to allow you to get vbb groups's to create accounts, all others will just be looking on as guests... the code needs to be put in after this code:
$ret = GalleryEmbed::init(array('embedUri' => 'gallery.php',
'g2Uri' => '/gallery/',
'loginRedirect' => 'index.php',
'activeUserId' => $uid));

the code is:
if ($vbulletin->userinfo[usergroupid] == 5 or $vbulletin->userinfo[usergroupid] == 6 or $vbulletin->userinfo[usergroupid] == 7 or $vbulletin->userinfo[usergroupid] == 11 or $vbulletin->userinfo[usergroupid] == 12)
{
replace the number(for my code it is 5, 6, 7, 11, and 12) with the VBB group number of your board. this can all be found in the adminCP if you look at the usergroups.

you will also need to put a "}" below the 2nd else statement, so it shoudl look like this:

else
{
echo '<HR>line: '.__LINE__.', G2 did not return a success status. Here is the error message from G2: <br />'.$ret->getAsHtml();
return false;
}
}
}



a bit confusing to explain, but its a pretty simple edit to the script :)

ragtek
11 May 2006, 19:17
i have the german version of the gallery and the board
there are troubles with de ń÷Ř because of the UTF-8
how can i solve that?

silkie
13 May 2006, 01:33
forum is in racersden.net/forum
gallery is in racersden.net/gallery
template name is gallery
integration name is gallery.php


silvert my forums is in vampirecommunity.com/forums
gallery is vampirecommunity.com/gallery2
template name is gallery2
integrations name is gallery2.php

that's why I can't figure out why it won't work. here's the snippets in gallery2.php where I have to set the paths and as far as I know it's the only places I"m supposed to edit anything.

// Full path to vBulletin
define('CWD', '/home/vampirec/public_html/forums');

// Call global.php
require_once(CWD . '/global.php');

function runGallery() {
global $vbulletin, $userinfo;
require_once('/home/vampirec/public_html/gallery2/embed.php');

$ret = GalleryEmbed::init(array('embedUri' => '/gallery2.php',
'g2Uri' => 'http://www.vampirecommunity.com/gallery2/',

silkie
15 May 2006, 15:35
I give up. I totally removed menalto's gallery and now I can't delete posts, add to reputation or anything because I'm getting this error

Warning: Unknown(/home/vampirec/public_html/gallery2/embed.php): failed to open stream: No such file or directory in /includes/class_dm_user.php(1571) : eval()'d code on line 1

Fatal error: (null)(): Failed opening required '/home/vampirec/public_html/gallery2/embed.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/vampirec/public_html/forums/includes/class_dm_user.php(1571) : eval()'d code on line 1

any idea's why or what I should do about it?

SilVert
15 May 2006, 18:44
on my site the gallery integration script HAS TO BE IN THE FORUM DIRECTORY.... im trying to work around that now so that the mod rewrite will work. but i haev had no sucess yet...

if i understand correctly.... try to diable the gallery plugin, im assuming you installed it since you are getting that error... or are you getting that error when you attempt to run the integration script?

i have the german version of the gallery and the board
there are troubles with de ń÷Ř because of the UTF-8
how can i solve that?

sadly i dont know much of anythign about foreign language installs

CoolHand_79
15 May 2006, 23:51
My site: Canuck Clan (http://www.canuckclan.com/vbullet/forums)

The Error occurs when logging out. However if you reload the page it reloads and you are indeed logged out. I first noticed this after installing gallery following THESE INSTRUCTIONS as well as installing the gallery plugins.

The Error at the top of the page:

Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/content/L/u/k/Lukeharris/html/vbullet/forums/includes/class_dm_user.php(1571) : eval()'d code on line 10

The Error in the text box that normal says cookies cleared:

Unable to add cookies, header already sent.
File: /home/content/L/u/k/Lukeharris/html/vbullet/forums/includes/class_dm_user.php(1571) : eval()'d code
Line: 10

Thanks,

Luke

PS: I just de-ativated the Delete Gallery User/Update Gallery User and the problem has disapeard.





UPDATE WITH MY GALLERY INTERGRATION


Well, I have tried to get this working and the gallery is working. I can view it by going to /vbullet/forums/gallery2/main.php

However the intergration does not work. It lists the album I creat but does not show any pictures. I have place the gallery2.php @ /vbullet/forums/gallery2.php

Any ideas?

Luke

SilVert
16 May 2006, 18:09
saldy i dotn know much abotu the plugin... i have recevied a copy from johnmount(and i forgot the 2nd guys username). i have yet to install it on my board. we are having CPU issues, and i dont really want to mess with it now that we are stable.... i will try soon hopefully...


UPDATE WITH MY GALLERY INTERGRATION


Well, I have tried to get this working and the gallery is working. I can view it by going to /vbullet/forums/gallery2/main.php

However the intergration does not work. It lists the album I creat but does not show any pictures. I have place the gallery2.php @ /vbullet/forums/gallery2.php

Any ideas?

Luke

just found your gallery and attempted to look at an images....

here is the path:
http://www.canuckclan.com/vbullet/forums/vbullet/forums/gallery2/main.php?g2_view=core.DownloadItem&g2_itemId=15&g2_serialNumber=1

look at the bold part... there are 1 to many of those in that path... edit the path in the gallery2.php file. i think it will be the g2uri, but im not 100%

CoolHand_79
16 May 2006, 22:50
Thanks, you nailed it. The gallery is now showing images. I guess I will have to mess around with the templates abit. Thanks a lot!


Luke
Canuck Clan (http://www.canuckclan.com/vbullet/forums)

silkie
17 May 2006, 20:48
now every post is posting in triplicate and I can't get rid of that message. any clues what I should do to fix it?

SilVert
17 May 2006, 20:52
now every post is posting in triplicate and I can't get rid of that message. any clues what I should do to fix it?


thats an odd one... you HAVE disabled the gallery plugin? if so try removing it. i dont know why it would be doing that... did you throw any other plugins or customizations in other than the gallery one?

Thanks, you nailed it. The gallery is now showing images. I guess I will have to mess around with the templates abit. Thanks a lot!


Luke
Canuck Clan (http://www.canuckclan.com/vbullet/forums)


glad i could help man :) do me a favor and check back every off and on to see if you can offer a hand :) im only here so often :)

silkie
18 May 2006, 05:33
OMG! LOL now that is something I forgot! thank you, I was freaking out trying to figure out to fix it. I plan to do a test board after I get my site done and when I do I"m going to have another go at this. I really like this gallery and wished it worked for me but for now I just want to get a gallery going. thanks alot for your help silvert I appreciate it.

SilVert
18 May 2006, 16:28
OMG! LOL now that is something I forgot! thank you, I was freaking out trying to figure out to fix it. I plan to do a test board after I get my site done and when I do I"m going to have another go at this. I really like this gallery and wished it worked for me but for now I just want to get a gallery going. thanks alot for your help silvert I appreciate it.

not a problem man... come over to RacersDen.net and look for me there if you dont heard form me here... i check this thread every day or so now, but in a few weeks who knows :)

sending me a PM here, there is no promise that i willg et back to you in a quick amoutn of time. it goes to my "spam" e-mail adress ;)

silkie
19 May 2006, 04:05
you do realize there's nothing "manly" about me don't you? LOL:cool:

I'll look for you over at racersden if I need you. thanks again.

SilVert
19 May 2006, 13:30
you do realize there's nothing "manly" about me don't you? LOL:cool:

I'll look for you over at racersden if I need you. thanks again.

well hello then ;) my bad, didnt mean to offend :)

silkie
19 May 2006, 18:17
ROFLMAO! absolutely no offense taken.

Webmist
20 May 2006, 05:19
Okay I've gone over everything with the users. I've checked user tables and they are duplicating into the gallery users nicely but I can't view any images. I keep getting this error. I have a fresh install of Gallery2 and one album. I run under the following:
Subdreamer is root/
Forums is forum/
Gallery2 is gallery2/


line: 115, G2 did not return a success status. Here is the error message from G2:
Error (GALLERY_SUCCESS)

* in at line 0


Warning: Cannot use a scalar value as an array in /gallery2.php on line 51

I changed the query to report to true and line #51 is the following:

$data['title'] = (isset($data['title']) && !empty($data['title'])) ? $data['title'] : 'Gallery';


Anyone want to take a shot at this?

SilVert
22 May 2006, 17:53
Okay I've gone over everything with the users. I've checked user tables and they are duplicating into the gallery users nicely but I can't view any images. I keep getting this error. I have a fresh install of Gallery2 and one album. I run under the following:
Subdreamer is root/
Forums is forum/
Gallery2 is gallery2/


line: 115, G2 did not return a success status. Here is the error message from G2:
Error (GALLERY_SUCCESS)

* in at line 0


Warning: Cannot use a scalar value as an array in /gallery2.php on line 51

I changed the query to report to true and line #51 is the following:

$data['title'] = (isset($data['title']) && !empty($data['title'])) ? $data['title'] : 'Gallery';


Anyone want to take a shot at this?

did you create an account and then remove it?

the #51 thing i dont know.... all the scripts have that, yours is reporting an error for some reason....

Webmist
23 May 2006, 01:02
did you create an account and then remove it?

the #51 thing i dont know.... all the scripts have that, yours is reporting an error for some reason....

Yes I did. I found the culprit though. I had a 2.1 beta developers kit installed and hadn't got it upgraded to full version on the site with vb yet. Once I did everything was fine.

Thanks for the help.

Smurky
23 May 2006, 03:35
Thanks for the hack, I use gallery2 but the performance of it is very poor, takes forever for pages to load but other scripts work just fine :p

SilVert
23 May 2006, 14:21
Thanks for the hack, I use gallery2 but the performance of it is very poor, takes forever for pages to load but other scripts work just fine :p

on my VBB site, it takes a few seconds longer than i would like on the original load, but once gallery is loaded and you navigate, it seems to be normal. but i am running on a dedicated server. maybe that is the difference?

on my phpbb site with gallery, it seems to be a bit slow. but that is a shared machine. so i dont know what else is on the machine....

there are 1 or 2 tweaks you can do within gallery to attempt to improve performance. i enabled the full acceleration for guests and partial for the users(i dont remember the module name, i think it was "Performance")...

redlabour
01 Jun 2006, 07:57
This tutorial will outline the steps needed to integrate your vBulletin 3.5.X and Menalto Gallery 2.1 installations.

Why did you not Post it as a Hack ?

I want to integrate it to my installed Hacks List. ;)

Brent H
02 Jun 2006, 10:47
I didn't release it as a hack because it wasn't me who coded the plugins or the php file. I know just enough PHP to be dangerous, so all I can really do is show people how I got things to work.

If I had released it as a hack, I'd also feel obligated to provide some kind of support, which I can't ;)

redlabour
02 Jun 2006, 12:27
You only have to uncheck the Box "supported". That┤s the same and makes more comfort for all of us.

Brent H
02 Jun 2006, 23:26
Still, it's not my code and there was more than one or two people involved in writing said code, so obtaining permission would be more trouble than it's worth for me... If you want to release this as a plugin, feel free to do so.

jerx
04 Jun 2006, 08:29
I like to show the user' s gallery in his profile. Does anybody know how to do this?

SilVert
06 Jun 2006, 15:02
I like to show the user' s gallery in his profile. Does anybody know how to do this?

got a link for me? it woudl most likley require you to modify one of the VBB templates.

there is a way to integrate gallery related pictures into an external webpage. so i assume its doiable, but i dont know about just x users images(without looking at it again)

if you do a search on gallery2.org, you might be able to find somebody who did the code for PHPBB(or something). if so post up a link, and i will see if i can decyfer what they are doing into VBB... odds are i cant, but somebody might be able to :)

Still, it's not my code and there was more than one or two people involved in writing said code, so obtaining permission would be more trouble than it's worth for me... If you want to release this as a plugin, feel free to do so.


JohnMount and 1 other person(i keep forgetting who it is) were working on the code. they sent me a copy that was not posted, but i have yet to have the time to install it and test it on my board. i sadly only have my LIVE site, and i dont reallllly want to risk blowing it up :)

balkanf
07 Jun 2006, 12:58
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 166 (gallerystatus::error)
in modules/core/classes/GalleryEmbed.class at line 300 (galleryuser::create)
in /home/vampirec/public_html/portal/forums/gallery2.php at line 95 (galleryembed::createuser)
in /home/vampirec/public_html/portal/forums/gallery2.php at line 50

if I'm NOT logged in I get this error:
line: 115, G2 did not return a success status. Here is the error message from G2:
Error (GALLERY_SUCCESS)
in at line 0
I also have this problem. I get the last error not only if i'm not logged in but even if logged in with a normal user.

I just made a fresh installation of gallery and placed it in my root directory

vb: http://www.balkanium.com/index.php
gallery: http://www.balkanium.com/gallery/main.php

There is only one gallery user (me). My vb already has many users. What should i do?

My gallery.php file:
<?php

// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'gallery'); // change this depending on your filename

// ################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups
$phrasegroups = array(

);

// get special data templates from the datastore
$specialtemplates = array(

);

// pre-cache templates used by all actions
$globaltemplates = array(
'gallery',
);

// pre-cache templates used by specific actions
$actiontemplates = array(

);

// ######################### REQUIRE BACK-END ############################

require_once('./global.php');

// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################

$navbits = array();
$navbits[$parent] = 'Gallery';
error_reporting(E_ALL );

$navbits = construct_navbits($navbits);
eval('$navbar = "' . fetch_template('navbar') . '";');

// #######################################################################
// ###################### Begin G2 INTEGRATION CODE ######################
// #######################################################################

$data = runGallery();
$data['title'] = (isset($data['title']) && !empty($data['title'])) ? $data['title'] : 'Gallery';

function runGallery() {
global $vbulletin, $userinfo;
require_once('/home/balkan/public_html/gallery/embed.php');

$data = array();

// If it's an anonymous user, set the g2 activeUser to null
$uid = $vbulletin->userinfo['userid'] = 0 ? '' : $vbulletin->userinfo['userid'];

// initiate G2
// You need to edit the following 4 lines to suit your VB3 & G2 installations
// This is set up for an install that looks like:
// public_html/VB/<vb files>
// public_html/gallery/<gallery files>
// and also setup for a VB3 template name of 'gallery'. If you have any
// differences, make those changes here!
// You might need to change 'loginRedirect' if you have your VB3 setup to
// where index.php is not the root page of VB3... Like if you've changed it
// to forums.php or something of the like.

$ret = GalleryEmbed::init(array('embedUri' => '/gallery.php',
'g2Uri' => 'http://www.balkanium.com/gallery/',
'loginRedirect' => 'index.php',
'activeUserId' => $uid));
if ($ret)
{
if ($ret->getErrorCode() & ERROR_MISSING_OBJECT)
{
// Check if there's no G2 user mapped to the activeUserId
$ret = GalleryEmbed::isExternalIdMapped($uid, 'GalleryUser');
if ($ret && ($ret->getErrorCode() & ERROR_MISSING_OBJECT))
{
// User not mapped, create G2 user now
// Get Arguments for the new user:
$args['fullname'] = $vbulletin->userinfo['username'];
$args['username'] = $vbulletin->userinfo['username'];
$args['hashedpassword'] = $vbulletin->userinfo['password'];
$args['hashmethod'] = 'md5';
$args['email'] = $vbulletin->userinfo['email'];
$args['language'] = $vbulletin->userinfo['lang_code'];
$args['creationtimestamp'] = $vbulletin->userinfo['joindate'];

$retcreate = GalleryEmbed :: createUser($uid, $args);
if ($retcreate)
{
echo '<HR>line: '.__LINE__.', Failed to create G2 user with extId ['.$uid.']. Here is the error message from G2: <br />'.$retcreate->getAsHtml();
return false;
}
$ret = GalleryEmbed::checkActiveUser($uid);
if ($ret) {
print $ret->getAsHtml();
return false;
}
}
else
{
echo '<HR>line: '.__LINE__.', G2 did not return a success status. Here is the error message from G2: <br />'.$ret->getAsHtml();
return false;
}
}
else
{
echo '<HR>line: '.__LINE__.', G2 did not return a success status. Here is the error message from G2: <br />'.$ret->getAsHtml();
return false;
}
}

// user interface: disable sidebar in G2 and get it as separate HTML to put it into a block
//GalleryCapabilities::set('showSidebar', false);

// handle the G2 request
$g2moddata = GalleryEmbed::handleRequest();

// show error message if isDone is not defined
if (!isset($g2moddata['isDone'])) {
$data['bodyHtml'] = 'isDone is not defined, something very bad must have happened.';
return $data;
}
// die if it was a binary data (image) request
if ($g2moddata['isDone']) {
exit; /* uploads module does this too */
}

// put the body html from G2 into the xaraya template
$data['bodyHtml'] = isset($g2moddata['bodyHtml']) ? $g2moddata['bodyHtml'] : '';

// get the page title, javascript and css links from the <head> html from G2
$title = ''; $javascript = array(); $css = array();

if (isset($g2moddata['headHtml'])) {
list($data['title'], $css, $javascript) = GalleryEmbed::parseHead($g2moddata['headHtml']);
$data['headHtml'] = $g2moddata['headHtml'];
}

/* Add G2 javascript */
if (!empty($javascript)) {
foreach ($javascript as $script) {
$data['javascript'] .= "\n".$script;
}
}

/* Add G2 css */
if (!empty($css)) {
foreach ($css as $style) {
$data['css'] .= "\n".$style;
}
}

// sidebar block
if (isset($g2moddata['sidebarHtml']) && !empty($g2moddata['sidebarHtml'])) {
$data['sidebarHtml'] = $g2moddata['sidebarHtml'];
}

return $data;
}
// #######################################################################
// ####################### End G2 integration code #######################
// #######################################################################

eval('print_output("' . fetch_template('gallery') . '");');

?>

Question: will all my vb users automatically get a user account in gallery?

SilVert
07 Jun 2006, 18:30
I also have this problem. I get the last error not only if i'm not logged in but even if logged in with a normal user.

I just made a fresh installation of gallery and placed it in my root directory

vb: http://www.balkanium.com/index.php
gallery: http://www.balkanium.com/gallery/main.php

There is only one gallery user (me). My vb already has many users. What should i do?

My gallery.php file:
<?php

// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'gallery'); // change this depending on your filename

// ################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups
$phrasegroups = array(

);

// get special data templates from the datastore
$specialtemplates = array(

);

// pre-cache templates used by all actions
$globaltemplates = array(
'gallery',
);

// pre-cache templates used by specific actions
$actiontemplates = array(

);

// ######################### REQUIRE BACK-END ############################

require_once('./global.php');

// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################

$navbits = array();
$navbits[$parent] = 'Gallery';
error_reporting(E_ALL );

$navbits = construct_navbits($navbits);
eval('$navbar = "' . fetch_template('navbar') . '";');

// #######################################################################
// ###################### Begin G2 INTEGRATION CODE ######################
// #######################################################################

$data = runGallery();
$data['title'] = (isset($data['title']) && !empty($data['title'])) ? $data['title'] : 'Gallery';

function runGallery() {
global $vbulletin, $userinfo;
require_once('/home/balkan/public_html/gallery/embed.php');

$data = array();

// If it's an anonymous user, set the g2 activeUser to null
$uid = $vbulletin->userinfo['userid'] = 0 ? '' : $vbulletin->userinfo['userid'];

// initiate G2
// You need to edit the following 4 lines to suit your VB3 & G2 installations
// This is set up for an install that looks like:
// public_html/VB/<vb files>
// public_html/gallery/<gallery files>
// and also setup for a VB3 template name of 'gallery'. If you have any
// differences, make those changes here!
// You might need to change 'loginRedirect' if you have your VB3 setup to
// where index.php is not the root page of VB3... Like if you've changed it
// to forums.php or something of the like.

$ret = GalleryEmbed::init(array('embedUri' => '/gallery.php',
'g2Uri' => 'http://www.balkanium.com/gallery/',
'loginRedirect' => 'index.php',
'activeUserId' => $uid));
if ($ret)
{
if ($ret->getErrorCode() & ERROR_MISSING_OBJECT)
{
// Check if there's no G2 user mapped to the activeUserId
$ret = GalleryEmbed::isExternalIdMapped($uid, 'GalleryUser');
if ($ret && ($ret->getErrorCode() & ERROR_MISSING_OBJECT))
{
// User not mapped, create G2 user now
// Get Arguments for the new user:
$args['fullname'] = $vbulletin->userinfo['username'];
$args['username'] = $vbulletin->userinfo['username'];
$args['hashedpassword'] = $vbulletin->userinfo['password'];
$args['hashmethod'] = 'md5';
$args['email'] = $vbulletin->userinfo['email'];
$args['language'] = $vbulletin->userinfo['lang_code'];
$args['creationtimestamp'] = $vbulletin->userinfo['joindate'];

$retcreate = GalleryEmbed :: createUser($uid, $args);
if ($retcreate)
{
echo '<HR>line: '.__LINE__.', Failed to create G2 user with extId ['.$uid.']. Here is the error message from G2: <br />'.$retcreate->getAsHtml();
return false;
}
$ret = GalleryEmbed::checkActiveUser($uid);
if ($ret) {
print $ret->getAsHtml();
return false;
}
}
else
{
echo '<HR>line: '.__LINE__.', G2 did not return a success status. Here is the error message from G2: <br />'.$ret->getAsHtml();
return false;
}
}
else
{
echo '<HR>line: '.__LINE__.', G2 did not return a success status. Here is the error message from G2: <br />'.$ret->getAsHtml();
return false;
}
}

// user interface: disable sidebar in G2 and get it as separate HTML to put it into a block
//GalleryCapabilities::set('showSidebar', false);

// handle the G2 request
$g2moddata = GalleryEmbed::handleRequest();

// show error message if isDone is not defined
if (!isset($g2moddata['isDone'])) {
$data['bodyHtml'] = 'isDone is not defined, something very bad must have happened.';
return $data;
}
// die if it was a binary data (image) request
if ($g2moddata['isDone']) {
exit; /* uploads module does this too */
}

// put the body html from G2 into the xaraya template
$data['bodyHtml'] = isset($g2moddata['bodyHtml']) ? $g2moddata['bodyHtml'] : '';

// get the page title, javascript and css links from the <head> html from G2
$title = ''; $javascript = array(); $css = array();

if (isset($g2moddata['headHtml'])) {
list($data['title'], $css, $javascript) = GalleryEmbed::parseHead($g2moddata['headHtml']);
$data['headHtml'] = $g2moddata['headHtml'];
}

/* Add G2 javascript */
if (!empty($javascript)) {
foreach ($javascript as $script) {
$data['javascript'] .= "\n".$script;
}
}

/* Add G2 css */
if (!empty($css)) {
foreach ($css as $style) {
$data['css'] .= "\n".$style;
}
}

// sidebar block
if (isset($g2moddata['sidebarHtml']) && !empty($g2moddata['sidebarHtml'])) {
$data['sidebarHtml'] = $g2moddata['sidebarHtml'];
}

return $data;
}
// #######################################################################
// ####################### End G2 integration code #######################
// #######################################################################

eval('print_output("' . fetch_template('gallery') . '");');

?>

Question: will all my vb users automatically get a user account in gallery?


try creating a new user, then log into gallery VIA the integration script... i think it will work fine... the issue(most likley) is that you had a user, then removed it. gallyer still have the VBB userid saved in the DB.. you would need to go into the DB and remove the VBB id from ?Ext IDs?.

majorxp
08 Jun 2006, 03:42
Don't manually create a user in g2 that has the same name as a vb user or you get the collision error.

I'm also right now working on a user import system for my board. I wasn't planning on releasing it, but if anyone wants it, I'll make it available - when I finish it.. The only reason you would need to import all the users is to have matching ids for an existing photo album....otherwise, the script on the original post will create them on the fly.


also...unless I missed it.. it is super important that you should deactivate G2's user registration module since all new users should register with VB (or don't install it).

ps- thanks brent....this is a great script and good info!!!

redlabour
08 Jun 2006, 18:46
Does it work with vBulletin 3.6 BETA ?

Jayphen
09 Jun 2006, 14:12
I'm also right now working on a user import system for my board. I wasn't planning on releasing it, but if anyone wants it, I'll make it available - when I finish it.. The only reason you would need to import all the users is to have matching ids for an existing photo album....otherwise, the script on the original post will create them on the fly.

Will this also solve the collision error?

I have a pre-existing G2 installation and have integrated it with vbulletin - however when I attempt to view it whilst logged in to vbulletin, I get the collision error.

majorxp
09 Jun 2006, 18:26
No. It won't solve your collision errors.

The collision error is a result of creating a new user outside the integration. As I said 2 posts up, you can't do that. What happens is when you visit the integrated G2 site, it first looks in a link table for your VB userid to find the appropriate G2 userid. When it can't find one (since you never registered inside the integrated G2) it then attempts to create a new user - with the same username - and then you will get the collision error.

There are a bunch of ways you can fix the error. If you are the only submitting user, just manually add the two userids in the useridmap table (I forget the exact name of the table offhand) and you will be set. If you have a lot of users, you could delete all the users in G2 (but lose who the owner is of each picture).

Frankly, the best option if you have more than a few users, is to edit the gallery.php script so that after it checks for id in the link table it looks for matching usernames. If it finds one, then insert the link record rather than going straight to creating a new user. If someone does bother to make this addition, it should be part of the default gallery.php people use.

SilVert
13 Jun 2006, 20:15
No. It won't solve your collision errors.

The collision error is a result of creating a new user outside the integration. As I said 2 posts up, you can't do that. What happens is when you visit the integrated G2 site, it first looks in a link table for your VB userid to find the appropriate G2 userid. When it can't find one (since you never registered inside the integrated G2) it then attempts to create a new user - with the same username - and then you will get the collision error.

There are a bunch of ways you can fix the error. If you are the only submitting user, just manually add the two userids in the useridmap table (I forget the exact name of the table offhand) and you will be set. If you have a lot of users, you could delete all the users in G2 (but lose who the owner is of each picture).

Frankly, the best option if you have more than a few users, is to edit the gallery.php script so that after it checks for id in the link table it looks for matching usernames. If it finds one, then insert the link record rather than going straight to creating a new user. If someone does bother to make this addition, it should be part of the default gallery.php people use.


wahooo, somebody to help with support!!! ;)

how are you going(or planning) on getting your script/plugin to work with gallery? a similar way to the plugin mentioned earlyer in this thread, or some other way that i am unaware of :)

majorxp
13 Jun 2006, 20:29
I have the script completed.

It is a one time use script that will copy the users from your existing VB database into a clean G2 database.

There are going to be very few folks who want this (or could use it). The only purpose (I know of) is if you have an existing photo album and you import the photoalbum into G2, then you will need to have all the IDs matched before it will work correctly.

If anyone wants it, I'll release it.

dtdesign
15 Jun 2006, 15:08
maybe someone can shed some light on this for me

Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 3 bytes) in ..../forum/gallery2/modules/imageblock/classes/ImageBlockHelper.class on line 248

george

SilVert
15 Jun 2006, 20:49
I have the script completed.

It is a one time use script that will copy the users from your existing VB database into a clean G2 database.

There are going to be very few folks who want this (or could use it). The only purpose (I know of) is if you have an existing photo album and you import the photoalbum into G2, then you will need to have all the IDs matched before it will work correctly.

If anyone wants it, I'll release it.

i could see that being usefull fro certain types of sites... specially if they are migrating from photpost or something and want all their users to be imported into gallery :)

not me personaly, but i coudl see some instances where it might be usefull :)

maybe someone can shed some light on this for me

Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 3 bytes) in ..../forum/gallery2/modules/imageblock/classes/ImageBlockHelper.class on line 248

george

thats a new one to me... you might want to post on the gallery2 forums to see what that is about... http://www.gallery2.org . once you starte to get INTO gallery, i can only really troubleshoot simple problems :)

Do have any themes installed?

nikhilphp
16 Jun 2006, 03:27
Hi
I am getting blank page for gallary 2.

I have just tried to debug the things, You can see the userid there
http://aquariumboard.com/forums/gallery2.php

I have installed gallary2 at location
( http://aquariumboard.com/forums/gallery/main.php )

I have created the templated in style manager also and name it "gallery2".

can anyone plz help me out.

#### here is the code #####
<?php

// ####################### SET PHP ENVIRONMENT ###########################
#error_reporting(E_ALL & ~E_NOTICE);

// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'gallery2'); // change this depending on your filename

// ################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups
$phrasegroups = array(

);

// get special data templates from the datastore
$specialtemplates = array(

);

// pre-cache templates used by all actions
$globaltemplates = array(
'gallery2',
);

// pre-cache templates used by specific actions
$actiontemplates = array(

);

// ######################### REQUIRE BACK-END ############################

require_once('./global.php');

// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################

$navbits = array();
$navbits[$parent] = 'Gallery';
#error_reporting(E_ALL );

$navbits = construct_navbits($navbits);
eval('$navbar = "' . fetch_template('navbar') . '";');

// #######################################################################
// ###################### Begin G2 INTEGRATION CODE ######################
// #######################################################################

$data = runGallery();
$data['title'] = (isset($data['title']) && !empty($data['title'])) ? $data['title'] : 'Gallery';

function runGallery() {
global $vbulletin, $userinfo;
#require_once('/home/paranorm/public_html/gallery2/embed.php');

require_once('gallery/embed.php');
$data = array();

// If it's an anonymous user, set the g2 activeUser to null
$uid = $vbulletin->userinfo['userid'] = 0 ? '' : $vbulletin->userinfo['userid'];

// initiate G2
// You need to edit the following 4 lines to suit your VB3 & G2 installations
// This is set up for an install that looks like:
// public_html/VB/<vb files>
// public_html/gallery2/<gallery2 files>
// and also setup for a VB3 template name of 'gallery2'. If you have any
// differences, make those changes here!
// You might need to change 'loginRedirect' if you have your VB3 setup to
// where index.php is not the root page of VB3... Like if you've changed it
// to forums.php or something of the like.
print "User id is $uid";
$ret = GalleryEmbed::init(array('embedUri' => 'gallery2.php',
'g2Uri' => 'http://aquariumboard.com/forums/gallery/',
'loginRedirect' => 'index.php',
'activeUserId' => $uid));
if ($ret)
{
if ($ret->getErrorCode() & ERROR_MISSING_OBJECT)
{
// Check if there's no G2 user mapped to the activeUserId
$ret = GalleryEmbed::isExternalIdMapped($uid, 'GalleryUser');
if ($ret && ($ret->getErrorCode() & ERROR_MISSING_OBJECT))
{
// User not mapped, create G2 user now
// Get Arguments for the new user:
$args['fullname'] = $vbulletin->userinfo['username'];
$args['username'] = $vbulletin->userinfo['username'];
$args['hashedpassword'] = $vbulletin->userinfo['password'];
$args['hashmethod'] = 'md5';
$args['email'] = $vbulletin->userinfo['email'];
$args['language'] = $vbulletin->userinfo['lang_code'];
$args['creationtimestamp'] = $vbulletin->userinfo['joindate'];

$retcreate = GalleryEmbed :: createUser($uid, $args);
if ($retcreate)
{
echo '<HR>line: '.__LINE__.', Failed to create G2 user with extId ['.$uid.']. Here is the error message from G2: <br />'.$retcreate->getAsHtml();
return false;
}
$ret = GalleryEmbed::checkActiveUser($uid);
if ($ret) {
print $ret->getAsHtml();
return false;
}
}
else
{
echo '<HR>line: '.__LINE__.', G2 did not return a success status. Here is the error message from G2: <br />'.$ret->getAsHtml();
return false;
}
}
else
{
echo '<HR>line: '.__LINE__.', G2 did not return a success status. Here is the error message from G2: <br />'.$ret->getAsHtml();
return false;
}
}

// user interface: disable sidebar in G2 and get it as separate HTML to put it into a block
//GalleryCapabilities::set('showSidebar', false);

// handle the G2 request
$g2moddata = GalleryEmbed::handleRequest();

// show error message if isDone is not defined
if (!isset($g2moddata['isDone'])) {
$data['bodyHtml'] = 'isDone is not defined, something very bad must have happened.';
return $data;
}
// die if it was a binary data (image) request
if ($g2moddata['isDone']) {
exit; /* uploads module does this too */
}

// put the body html from G2 into the xaraya template
$data['bodyHtml'] = isset($g2moddata['bodyHtml']) ? $g2moddata['bodyHtml'] : '';

// get the page title, javascript and css links from the <head> html from G2
$title = ''; $javascript = array(); $css = array();

if (isset($g2moddata['headHtml'])) {
list($data['title'], $css, $javascript) = GalleryEmbed::parseHead($g2moddata['headHtml']);
$data['headHtml'] = $g2moddata['headHtml'];
}

/* Add G2 javascript */
if (!empty($javascript)) {
foreach ($javascript as $script) {
$data['javascript'] .= "\n".$script;
}
}

/* Add G2 css */
if (!empty($css)) {
foreach ($css as $style) {
$data['css'] .= "\n".$style;
}
}

// sidebar block
if (isset($g2moddata['sidebarHtml']) && !empty($g2moddata['sidebarHtml'])) {
$data['sidebarHtml'] = $g2moddata['sidebarHtml'];
}

return $data;
}
// #######################################################################
// ####################### End G2 integration code #######################
// #######################################################################

eval('print_output("' . fetch_template('gallery2') . '");');

?>
##########

dinodonk
17 Jun 2006, 04:19
thanks for this great hack, i got gallery working.

but there's a minor error with style :

<link rel="stylesheet" type="text/css" href="album/modules/icons/iconpacks/paularmstrongdesigns/icons.css"/>
<script type="text/javascript" src="album/modules/search/SearchBlock.js"></script>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>Gallery</title>
<link rel="stylesheet" type="text/css" href="album/themes/matrix/theme.css"/>


forum located at root/forum/<forumfiles>
gallery2 at root/album/<albumfiles>
gallery2.php at root/forum/gallery2.php

Please help to fix this style issue.


Thanks!!!

nikhilphp
18 Jun 2006, 10:15
$ret = GalleryEmbed::init(array('embedUri' => 'gallery2.php',
'g2Uri' => 'http://aquariumboard.com/forums/gallery/',
'loginRedirect' => 'index.php',
'activeUserId' => $uid));

this function does not give me the output ..

do any one have any idea about this.

SilVert
19 Jun 2006, 17:28
Nikhilphp: change this line to reflect your location, and remove the "#"
#require_once('/home/paranorm/public_html/gallery2/embed.php');
see if that does it...

thanks for this great hack, i got gallery working.

but there's a minor error with style :

<link rel="stylesheet" type="text/css" href="album/modules/icons/iconpacks/paularmstrongdesigns/icons.css"/>
<script type="text/javascript" src="album/modules/search/SearchBlock.js"></script>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>Gallery</title>
<link rel="stylesheet" type="text/css" href="album/themes/matrix/theme.css"/>


forum located at root/forum/<forumfiles>
gallery2 at root/album/<albumfiles>
gallery2.php at root/forum/gallery2.php

Please help to fix this style issue.


Thanks!!!

no idea with this one... got a link for me?

dinodonk
21 Jun 2006, 03:06
Nikhilphp: change this line to reflect your location, and remove the "#"
#require_once('/home/paranorm/public_html/gallery2/embed.php');
see if that does it...



no idea with this one... got a link for me?
solved...
just change $ret to:
$ret = GalleryEmbed::init(array('embedUri' => '/forum/gallery2.php',

also is there any way to make url rewrite module works? i would like to have member gallery url like www.domain.com/gallery/username

Thanks

SilVert
21 Jun 2006, 14:45
solved...
just change $ret to:
$ret = GalleryEmbed::init(array('embedUri' => '/forum/gallery2.php',

also is there any way to make url rewrite module works? i would like to have member gallery url like www.domain.com/gallery/username

Thanks

yes and no.... the problem is with embed mode. when you are embeded the links all goto /forum/gallery(in my case atleast). and my gallery is located at /gallery. i made a synthetic link on the linux box and that did not resolve it either(synthetic link makes a folder act as a link to another location, so /forum/gallery would point to /gallery). i would need to spend more time on it to make it work 100%, and all it does is frustrate the hell out of me when i mess with it.

i know for a FACT that the "Download Item" part works. and i think that i have the Watermark working... if you have gallery in non embed mode, it will all work 1000% correctly. but then your links in embed mode will not work correctly...

MovetoNYC
24 Jun 2006, 06:07
How would i go about doing this ...


I have my vBulletin at www.movetonyc.com/forums
(which would be /public_html/forum)
then I have a add-on domain with the same hosting for my domain name www.photommunity.com and that would be
/public_html/photommunity

Could I install the gallery scrpit in the photommunity folder and have it stand alone for when people go to photommunity.com but also have it work for the intergration with movetonyc.com/forum ?

If you don't understand what i am saying i want to have a part of the photommunity to be used for movetonyc.com but i want the gallery to be other things too for a totally different back-boned site?

Understand? if not il try to explain it better.

majorxp
24 Jun 2006, 06:44
If you want the images to be totally different for each gallery, then set them up as a multi-site installation.....sorry to do this, but the G2 manual will be a better reference than I can.

then have your core at
/public_html/gallery2

your embedded site 1 at
/public_html/forum/gallery2

and your other one at
/public_html/photommunity/gallery2



If you want the same gallery on both sites, then you will have to do some redirects...

...hopefully that makes sense.

MovetoNYC
24 Jun 2006, 19:58
That sounds really confusing, so I think I'll just make a gallery on photommunity.com and say meh with the vB intergration until I can afford photopost or something i dunno.

SilVert
29 Jun 2006, 14:42
i am not 100% on the multi site either. but if you install it to a location that BOTH sites can hit(say /public_html. not web viewable, but shared). then all that is required is a few files(to start with) on each site and they will have a referance back to the shared install location. i am not sure what has to be viewable to a internet browser for gallery to work.

i assume all would be fine with a integrated gallery with VBB on one site and a standalone on the other side. to my knowledge they would not be aware of eachother. but that is just a guess on my part :) let me know if you have any other questions, i can see if i have any insight for you :)

majorxp
29 Jun 2006, 18:02
That sounds really confusing, so I think I'll just make a gallery on photommunity.com and say meh with the vB intergration until I can afford photopost or something i dunno.\


It is actually very easy. The install wizard does all of the work for you.

SilVert
03 Jul 2006, 19:36
\


It is actually very easy. The install wizard does all of the work for you.


thats what i was attempting to get at :)

keith455
09 Jul 2006, 06:16
Also, when I do open www.x-h2o.com/gallery2.php or /gallery2/ I get the gallery, but no way to upload anything, I can only view.

Do I need to change some usergroup permissions or other?

I'm having this issue right now.
Here's my setup.
httpdocs/forums
httpdocs/gallery2
httpdocs/forums/gallery2.php

when i go to gallery2.php it's embeded into VB but it's like the users are viewing as a guest. They can't upload or do any of the normal gallery user functions.
I did put 1 user into the admin group through the standalone gallery2 and it can upload but something's still doesn't seem right.

I looked in the DB and the VB users are being created as they use the gallery2.php but i'm thinking there's some permission problem or something.

I've been trying to get a gallery/photo Album on my site for awhile and have tried them all and I like G2 the best if i could only get it to work.

Any Ideas?? Thanks

majorxp
09 Jul 2006, 06:44
Keith

Instead of this:

httpdocs/forums
httpdocs/gallery2
httpdocs/forums/gallery2.php


Use this:

httpdocs/forums
httpdocs/forums/gallery2
httpdocs/forums/gallery2.php

I tried the same thing as you did - and never got it working. Once I put the gallery folder in the forums folder, everything started working.

SilVert
11 Jul 2006, 20:51
I'm having this issue right now.
Here's my setup.
httpdocs/forums
httpdocs/gallery2
httpdocs/forums/gallery2.php

when i go to gallery2.php it's embeded into VB but it's like the users are viewing as a guest. They can't upload or do any of the normal gallery user functions.
I did put 1 user into the admin group through the standalone gallery2 and it can upload but something's still doesn't seem right.

I looked in the DB and the VB users are being created as they use the gallery2.php but i'm thinking there's some permission problem or something.

I've been trying to get a gallery/photo Album on my site for awhile and have tried them all and I like G2 the best if i could only get it to work.

Any Ideas?? Thanks


try disabling all of the URL Rewrite modules.... if that does not work, post up your gallery2.php and i can give it a once over to see if anythign jumps out. i have my board/gallery setup the same way

/gallery/
/forum/
/forum/gallery.php

fringehead
18 Jul 2006, 22:21
I'd like to upgrade the forum but don't want to break the gallery...

Thanks,


Sean

SilVert
21 Jul 2006, 15:58
i am not on 3.6, probobly wont be for some time :)

plus its in beta, not good for me.

twitch
21 Jul 2006, 16:15
actually RC2 now

kallenapp
24 Jul 2006, 07:25
Hi,

is it posible to open the Gallery in a new window? when i open it withe the gallery2.php, my layout ist broken.


maybe there ist a way tho sync the users only with a cronjob?

thx for help

Keyser520
27 Jul 2006, 04:52
// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'gallery'); // change this depending on your filename

Ok...so what do I change in the above?

And how do I create a new template?

And where do I set permissions so that I can select who gets to upload and who doesn't?

-Thanks!

SilVert
27 Jul 2006, 15:09
Hi,

is it posible to open the Gallery in a new window? when i open it withe the gallery2.php, my layout ist broken.


maybe there ist a way tho sync the users only with a cronjob?

thx for help

i dont see why opening in a new window would break it... you can go straight to your gallery.php file without going to the front page of your board...

Ok...so what do I change in the above?

And how do I create a new template?

And where do I set permissions so that I can select who gets to upload and who doesn't?

-Thanks!

if you have a template in VBB it would need to be named "gallery" with the code you quoted.

there is a step by step at the begining fo the thread of how to do all this. to get to your styles you haev to log into the adminCP, then "Styles & Templates", style manager, select your style, then create a new template...

coachjohns
28 Jul 2006, 01:31
Getting this Error:

Fatal error: main(): Failed opening required '/homepages/11/d155644365/htdocs/forums/gallery2/modules/core/classes/GalleryUtilities.class' (include_path='.:/usr/local/lib/php') in /homepages/11/d155644365/htdocs/forums/gallery2/install/index.php on line 45

Keyser520
28 Jul 2006, 05:26
I'm getting some really strange looking crap and error messages.. Please check it out.


www.gargleblasterblues.com/forums/gallery2.php

I don't really care about "integrating" it into my vbulletin pages. What I want is to be able to have it interact with the vbulletin database, so I don't have to create new users, etc, etc, etc. How can I just make the two databases link together and be all happy like?

SilVert
28 Jul 2006, 14:38
I'm getting some really strange looking crap and error messages.. Please check it out.


www.gargleblasterblues.com/forums/gallery2.php

I don't really care about "integrating" it into my vbulletin pages. What I want is to be able to have it interact with the vbulletin database, so I don't have to create new users, etc, etc, etc. How can I just make the two databases link together and be all happy like?

the problem you are seeing is either due to a wrong path or the URL Rewrite module. i cant remember which. but i would disable the URL Rewrite. it is fairly advanced and a PITA. i have my gallery working, but i cant use 98% of the rewrite rules...

there is a "plugin" that would do what you want, BUT the people that were developing it have stoped using "gallery" and are now using something else. they sent me a copy, but i dont feel like messing with a working copy of my board. if you go back to the 1st post and send the guy that made the plugin a PM, he might be able to send it to you. i just dont know what state it is in.

Getting this Error:

Fatal error: main(): Failed opening required '/homepages/11/d155644365/htdocs/forums/gallery2/modules/core/classes/GalleryUtilities.class' (include_path='.:/usr/local/lib/php') in /homepages/11/d155644365/htdocs/forums/gallery2/install/index.php on line 45

lets start from the top...
where is your website located?
where is your gallery install located?
what is your websites adress?

fudge55
31 Jul 2006, 15:25
Ok, i've gone through this thread and it seems that others has the same problem, but i couldn't find the answer...

Install is done and it's working well, except one thing, the international characters. If i call the gallery2 the 'usual' way, it's ok.

When i view the source i can see this:

<h2> GalÚria </h2>

When i use the embedded version, the same lines look this way:

<h2> Gal?Őria </h2>

It seems that the core module outputs something else when i use the embedded version. I don't know why... Any solutions?

2 screens are attached...

SilVert
01 Aug 2006, 16:15
Ok, i've gone through this thread and it seems that others has the same problem, but i couldn't find the answer...

Install is done and it's working well, except one thing, the international characters. If i call the gallery2 the 'usual' way, it's ok.

When i view the source i can see this:

<h2> GalÚria </h2>

When i use the embedded version, the same lines look this way:

<h2> Gal?Őria </h2>

It seems that the core module outputs something else when i use the embedded version. I don't know why... Any solutions?

2 screens are attached...

hmm, thats odd... i wish i had an anwser for you. i think this is a Gallery problem not a integration script problem. have you looked around on Gallery2.org to see if there is any talk about this issue on there?

i think it is probobly due to the "embed mode" not undertanding other languages like the standard mode is(not the integration script), but i really dont know how to resolve that.

sorry i cant help more man. let me know if you run across anythign else, il see what i can do to help :)

kallenapp
03 Aug 2006, 11:10
Ok, i've gone through this thread and it seems that others has the same problem, but i couldn't find the answer...

Install is done and it's working well, except one thing, the international characters. If i call the gallery2 the 'usual' way, it's ok.

When i view the source i can see this:

<h2> GalÚria </h2>

When i use the embedded version, the same lines look this way:

<h2> Gal?Őria </h2>

It seems that the core module outputs something else when i use the embedded version. I don't know why... Any solutions?

2 screens are attached...


Gallery2 is using only utf-8. you must convert your vb-database to utf-8 an set this to the default chareset in vbulletin.

m0nde
03 Aug 2006, 12:57
This tutorial will outline the steps needed to integrate your vBulletin 3.5.X and Menalto Gallery 2.1 installations.Everything went very smoothly and I am able to browse the gallery by itself.

But, when I launch gallery2.php, I get the following while logged in as myself:

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/bostonlo/public_html/forums/gallery2.php at line 95 (galleryembed::createuser)
* in /home/bostonlo/public_html/forums/gallery2.php at line 50

Also, if someone logs out, they get this message:

Unable to add cookies, header already sent.
File: /home/bostonlo/public_html/forums/includes/class_dm_user.php(1571) : eval()'d code
Line: 10

Thanks in advance for any help.

fringehead
04 Aug 2006, 01:54
i am not on 3.6, probobly wont be for some time :)

plus its in beta, not good for me.


3.6 is out. Anyone upgrading? :D

Sean

SilVert
09 Aug 2006, 19:05
3.6 is out. Anyone upgrading? :D

Sean

it is out now. i am goign to wait a month+ for it to be out. i dont need/want to be the 1st to find any odd bugs...

Everything went very smoothly and I am able to browse the gallery by itself.

But, when I launch gallery2.php, I get the following while logged in as myself:

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/bostonlo/public_html/forums/gallery2.php at line 95 (galleryembed::createuser)
* in /home/bostonlo/public_html/forums/gallery2.php at line 50

Also, if someone logs out, they get this message:

Unable to add cookies, header already sent.
File: /home/bostonlo/public_html/forums/includes/class_dm_user.php(1571) : eval()'d code
Line: 10

Thanks in advance for any help.

you are attempting to log in with userid 1 which is the gallery admin, which maps out to the VB admin(userid=1).

log in as yourself, the only way to resolve this is to go into the DB and manualy hack some values out. i havent done this in months so i dont remember which ones. it is earlyer in this thread, i think the tabel in the DB was existingusers or somethign along those lines.

dtdesign
16 Aug 2006, 14:28
Has anyone an idea where the sidebar is constructed from so I can add images instead of text, it seems to be taking it's style layout from the VB style but I don't think adding a heap of style code to that from the gallery style will do much

Akagi
18 Aug 2006, 10:47
hi, my setup is as follows:

vbulletin 3.5.3

/home/public_html/forums/<forum files>
/home/public_html/gallery/<gallery files>
/home/public_html/forums/gallery.php

my gallery.php is like this:
<?php

// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'gallery'); // change this depending on your filename

// ################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups
$phrasegroups = array(

);

// get special data templates from the datastore
$specialtemplates = array(

);

// pre-cache templates used by all actions
$globaltemplates = array(
'gallery',
);

// pre-cache templates used by specific actions
$actiontemplates = array(

);

// ######################### REQUIRE BACK-END ############################
require_once('./global.php');

// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################

$navbits = array();
$navbits[$parent] = 'Gallery';

$navbits = construct_navbits($navbits);
eval('$navbar = "' . fetch_template('navbar') . '";');

// #######################################################################
// ###################### Begin G2 integration code ######################
// #######################################################################
$data = runGallery();
$data['title'] = (isset($data['title']) && !empty($data['title'])) ? $data['title'] : 'Gallery';

function runGallery() {
global $vbulletin, $userinfo;
require_once('../gallery/embed.php');

$data = array();

// if anonymous user, set g2 activeUser to null
$uid = $vbulletin->userinfo['userid'] = 0 ? '' : $vbulletin->userinfo['userid'];

// initiate G2
// you need to edit the following 4 lines to suite your VB3/G2 install!!!
// this is setup for a install that looks like:
// public_html/VB/<vb files>
// public_html/gallery2/<gallery2 files>
// and also setup for a VB3 tempalte name of 'gallery2'. if you have any
// differences, make those changes here!
// you might need to change 'loginRedirect' if you have your VB3 setup to
// where index.php is not the root page of VB3... i.e. if you've changed it
// to forums.php or something of the like.
$ret = GalleryEmbed::init(array('embedUri' => 'gallery.php',
'embedPath' => '/forum',
'relativeG2Path' => '../gallery',
'loginRedirect' => 'index.php',
'activeUserId' => $uid));
if ($ret->isError())
{
if ($ret->getErrorCode() & ERROR_MISSING_OBJECT)
{
// check if there's no G2 user mapped to the activeUserId
$ret = GalleryEmbed::isExternalIdMapped($uid, 'GalleryUser');
if ($ret->isError() && ($ret->getErrorCode() & ERROR_MISSING_OBJECT))
{
// user not mapped, map create G2 user now
// Get Arguments for the new user:
$args['fullname'] = $vbulletin->userinfo['username'];
$args['username'] = $vbulletin->userinfo['username'];
$args['hashedpassword'] = $vbulletin->userinfo['password'];
$args['hashmethod'] = 'md5';
$args['email'] = $vbulletin->userinfo['email'];
$args['language'] = $vbulletin->userinfo['lang_code'];
$args['creationtimestamp'] = $vbulletin->userinfo['joindate'];


$retcreate = GalleryEmbed :: createUser($uid, $args);
if (!$retcreate->isSuccess())
{
echo '<HR>line: '.__LINE__.', Failed to create G2 user with extId ['.$uid.']. Here is the error message from G2: <br />'.$retcreate->getAsHtml();
return false;
}
$ret = GalleryEmbed::checkActiveUser($uid);
if ($ret->isError()) {
print $ret->getAsHtml();
return false;
}
}
else
{
echo '<HR>line: '.__LINE__.', G2 did not return a success status. Here is the error message from G2: <br />'.$ret->getAsHtml();
return false;
}
}
else
{
echo '<HR>line: '.__LINE__.', G2 did not return a success status. Here is the error message from G2: <br />'.$ret->getAsHtml();
return false;
}
}

// user interface: disable sidebar in G2 and get it as separate HTML to put it into a block
//GalleryCapabilities::set('showSidebar', false);

// handle the G2 request
$g2moddata = GalleryEmbed::handleRequest();

// show error message if isDone is not defined
if (!isset($g2moddata['isDone'])) {
$data['bodyHtml'] = 'isDone is not defined, something very bad must have happened.';
return $data;
}
// die if it was a binary data (image) request
if ($g2moddata['isDone']) {
exit; /* uploads module does this too */
}

// put the body html from G2 into the xaraya template
$data['bodyHtml'] = isset($g2moddata['bodyHtml']) ? $g2moddata['bodyHtml'] : '';

// get the page title, javascript and css links from the <head> html from G2
$title = ''; $javascript = array(); $css = array();

if (isset($g2moddata['headHtml'])) {
list($data['title'], $css, $javascript) = GalleryEmbed::parseHead($g2moddata['headHtml']);
$data['headHtml'] = $g2moddata['headHtml'];
}

/* Add G2 javascript */
if (!empty($javascript)) {
foreach ($javascript as $script) {
$data['javascript'] .= "\n".$script;
}
}

/* Add G2 css */
if (!empty($css)) {
foreach ($css as $style) {
$data['css'] .= "\n".$style;
}
}

// sidebar block
if (isset($g2moddata['sidebarHtml']) && !empty($g2moddata['sidebarHtml'])) {
$data['sidebarHtml'] = $g2moddata['sidebarHtml'];
}

return $data;
}
// #######################################################################
// ####################### End G2 integration code #######################
// #######################################################################

eval('print_output("' . fetch_template('gallery') . '");');

?>

it gives this error
Fatal error: Call to undefined function: iserror()

any idea how to solve it?

noox
20 Aug 2006, 10:33
In the plugin which creates and updates the gallery user seems to be an error:

line 33:
Instead of $ret = GalleryEmbed::isExternalIdMapped($uid,$args);

it should be:$ret = GalleryEmbed::isExternalIdMapped($uid, 'GalleryUser');

Else isExternalIdMapped always returned an error - but not the expected 'ERROR_MISSING_OBJECT'. So the script always tries to update an existing user.

Akagi
20 Aug 2006, 15:40
In the plugin which creates and updates the gallery user seems to be an error:

line 33:
Instead of $ret = GalleryEmbed::isExternalIdMapped($uid,$args);

it should be:$ret = GalleryEmbed::isExternalIdMapped($uid, 'GalleryUser');

Else isExternalIdMapped always returned an error - but not the expected 'ERROR_MISSING_OBJECT'. So the script always tries to update an existing user.

is this in reference to my post above?

noox
20 Aug 2006, 15:51
no, it should be referenced to the initial post with the plugin attachment. The error is in the .xml file.

Akagi
21 Aug 2006, 14:50
no, it should be referenced to the initial post with the plugin attachment. The error is in the .xml file.

i see...
anyone managed to get this working on my kinda setup?

thenetbox
26 Aug 2006, 15:59
Hi, integration worked nicely in 3.6

So getting URL Rewrite to work wasn't too difficult.
After getting integration working:
1) Go to Vbulletin and create a new account called anything. I called mine "Administrator"
2) Then I went to http://yourdomain.com/gallery2 and logged in as the site admin.
3) Go to usergroups and add the account created in step 1 (administrator) to the Site Admin group
4) Go to Vbulletin and log off and log on as the account created in step 1 (administrator)
5) Go to http://yourdomain.com/gallery2.php
6) Inside the embedded gallery go to Site Admin.
7) Go to Modules and activate URL rewrites
8) Go create an .htaccess in your root folder /home/yourdir/public_html . Give it 666 permissions
9) Now in the URL rewrites area (embedded mode ie. inside gallery2.php) of site admin click on Setup and you'll get a new embedded option. Here enter the path of the new .htaccess (/home/yourdir/public_html/) and then below that enter the public path (if room then just type / )
10) Click save and now you'll be able to use URL_Rewrites with the fancy shmancy URLs

http://yourdomain.com/v/username/ should work now.



My question:

I'm trying to figure out if it is possible to import a users gallery into his profile. Has any one attempted that? Since the usernames are the same in gallery and vbulletin would it be possible to import using the username?

SilVert
28 Aug 2006, 20:57
Has anyone an idea where the sidebar is constructed from so I can add images instead of text, it seems to be taking it's style layout from the VB style but I don't think adding a heap of style code to that from the gallery style will do much


so you want to add images instead of "add item"(text) right??? im sure if you look at some of the styles, you can do it... i dont know off the top of my head. try looking it up on Gallery2.org?

hi, my setup is as follows:

vbulletin 3.5.3

/home/public_html/forums/<forum files>
/home/public_html/gallery/<gallery files>
/home/public_html/forums/gallery.php

my gallery.php is like this:
<?php

// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'gallery'); // change this depending on your filename

// ################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups
$phrasegroups = array(

);

// get special data templates from the datastore
$specialtemplates = array(

);

// pre-cache templates used by all actions
$globaltemplates = array(
'gallery',
);

// pre-cache templates used by specific actions
$actiontemplates = array(

);

// ######################### REQUIRE BACK-END ############################
require_once('./global.php');

// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################

$navbits = array();
$navbits[$parent] = 'Gallery';

$navbits = construct_navbits($navbits);
eval('$navbar = "' . fetch_template('navbar') . '";');

// #######################################################################
// ###################### Begin G2 integration code ######################
// #######################################################################
$data = runGallery();
$data['title'] = (isset($data['title']) && !empty($data['title'])) ? $data['title'] : 'Gallery';

function runGallery() {
global $vbulletin, $userinfo;
require_once('../gallery/embed.php');

$data = array();

// if anonymous user, set g2 activeUser to null
$uid = $vbulletin->userinfo['userid'] = 0 ? '' : $vbulletin->userinfo['userid'];

// initiate G2
// you need to edit the following 4 lines to suite your VB3/G2 install!!!
// this is setup for a install that looks like:
// public_html/VB/<vb files>
// public_html/gallery2/<gallery2 files>
// and also setup for a VB3 tempalte name of 'gallery2'. if you have any
// differences, make those changes here!
// you might need to change 'loginRedirect' if you have your VB3 setup to
// where index.php is not the root page of VB3... i.e. if you've changed it
// to forums.php or something of the like.
$ret = GalleryEmbed::init(array('embedUri' => 'gallery.php',
'embedPath' => '/forum',
'relativeG2Path' => '../gallery',
'loginRedirect' => 'index.php',
'activeUserId' => $uid));
if ($ret->isError())
{
if ($ret->getErrorCode() & ERROR_MISSING_OBJECT)
{
// check if there's no G2 user mapped to the activeUserId
$ret = GalleryEmbed::isExternalIdMapped($uid, 'GalleryUser');
if ($ret->isError() && ($ret->getErrorCode() & ERROR_MISSING_OBJECT))
{
// user not mapped, map create G2 user now
// Get Arguments for the new user:
$args['fullname'] = $vbulletin->userinfo['username'];
$args['username'] = $vbulletin->userinfo['username'];
$args['hashedpassword'] = $vbulletin->userinfo['password'];
$args['hashmethod'] = 'md5';
$args['email'] = $vbulletin->userinfo['email'];
$args['language'] = $vbulletin->userinfo['lang_code'];
$args['creationtimestamp'] = $vbulletin->userinfo['joindate'];


$retcreate = GalleryEmbed :: createUser($uid, $args);
if (!$retcreate->isSuccess())
{
echo '<HR>line: '.__LINE__.', Failed to create G2 user with extId ['.$uid.']. Here is the error message from G2: <br />'.$retcreate->getAsHtml();
return false;
}
$ret = GalleryEmbed::checkActiveUser($uid);
if ($ret->isError()) {
print $ret->getAsHtml();
return false;
}
}
else
{
echo '<HR>line: '.__LINE__.', G2 did not return a success status. Here is the error message from G2: <br />'.$ret->getAsHtml();
return false;
}
}
else
{
echo '<HR>line: '.__LINE__.', G2 did not return a success status. Here is the error message from G2: <br />'.$ret->getAsHtml();
return false;
}
}

// user interface: disable sidebar in G2 and get it as separate HTML to put it into a block
//GalleryCapabilities::set('showSidebar', false);

// handle the G2 request
$g2moddata = GalleryEmbed::handleRequest();

// show error message if isDone is not defined
if (!isset($g2moddata['isDone'])) {
$data['bodyHtml'] = 'isDone is not defined, something very bad must have happened.';
return $data;
}
// die if it was a binary data (image) request
if ($g2moddata['isDone']) {
exit; /* uploads module does this too */
}

// put the body html from G2 into the xaraya template
$data['bodyHtml'] = isset($g2moddata['bodyHtml']) ? $g2moddata['bodyHtml'] : '';

// get the page title, javascript and css links from the <head> html from G2
$title = ''; $javascript = array(); $css = array();

if (isset($g2moddata['headHtml'])) {
list($data['title'], $css, $javascript) = GalleryEmbed::parseHead($g2moddata['headHtml']);
$data['headHtml'] = $g2moddata['headHtml'];
}

/* Add G2 javascript */
if (!empty($javascript)) {
foreach ($javascript as $script) {
$data['javascript'] .= "\n".$script;
}
}

/* Add G2 css */
if (!empty($css)) {
foreach ($css as $style) {
$data['css'] .= "\n".$style;
}
}

// sidebar block
if (isset($g2moddata['sidebarHtml']) && !empty($g2moddata['sidebarHtml'])) {
$data['sidebarHtml'] = $g2moddata['sidebarHtml'];
}

return $data;
}
// #######################################################################
// ####################### End G2 integration code #######################
// #######################################################################

eval('print_output("' . fetch_template('gallery') . '");');

?>

it gives this error
Fatal error: Call to undefined function: iserror()

any idea how to solve it?

i had the iserror() problem a while ago. mine was related to using a RC of gallery and trying to integrate it. i will post all of my integration none the less though. see if i am hitting a setting you missed :)

<?php

// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'gallery'); // change this depending on your filename

// ################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups
$phrasegroups = array(

);

// get special data templates from the datastore
$specialtemplates = array(

);

// pre-cache templates used by all actions
$globaltemplates = array(
'gallery',
);

// pre-cache templates used by specific actions
$actiontemplates = array(

);

// ######################### REQUIRE BACK-END ############################

require_once('./global.php');

// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################

$navbits = array();
$navbits[$parent] = 'Gallery';
error_reporting(E_ALL );

$navbits = construct_navbits($navbits);
eval('$navbar = "' . fetch_template('navbar') . '";');

// #######################################################################
// ###################### Begin G2 INTEGRATION CODE ######################
// #######################################################################

$data = runGallery();
$data['title'] = (isset($data['title']) && !empty($data['title'])) ? $data['title'] : 'Gallery';

function runGallery() {
global $vbulletin, $userinfo;
require_once('/home/httpd/vhosts/racersden.net/httpdocs/gallery/embed.php');

$data = array();

// If it's an anonymous user, set the g2 activeUser to null
$uid = $vbulletin->userinfo['userid'] = 0 ? '' : $vbulletin->userinfo['userid'];

// initiate G2
// You need to edit the following 4 lines to suit your VB3 & G2 installations
// This is set up for an install that looks like:
// public_html/VB/<vb files>
// public_html/gallery2/<gallery2 files>
// and also setup for a VB3 template name of 'gallery2'. If you have any
// differences, make those changes here!
// You might need to change 'loginRedirect' if you have your VB3 setup to
// where index.php is not the root page of VB3... Like if you've changed it
// to forums.php or something of the like.

$ret = GalleryEmbed::init(array('embedUri' => 'gallery.php',
'g2Uri' => '/gallery/',
'loginRedirect' => 'index.php',
'activeUserId' => $uid));

if ($vbulletin->userinfo[usergroupid] == 5 or $vbulletin->userinfo[usergroupid] == 6 or $vbulletin->userinfo[usergroupid] == 7 or $vbulletin->userinfo[usergroupid] == 11 or $vbulletin->userinfo[usergroupid] == 12)
{

if ($ret)
{
if ($ret->getErrorCode() & ERROR_MISSING_OBJECT)
{
// Check if there's no G2 user mapped to the activeUserId
$ret = GalleryEmbed::isExternalIdMapped($uid, 'GalleryUser');
if ($ret && ($ret->getErrorCode() & ERROR_MISSING_OBJECT))
{
// User not mapped, create G2 user now
// Get Arguments for the new user:
$args['fullname'] = $vbulletin->userinfo['username'];
$args['username'] = $vbulletin->userinfo['username'];
$args['hashedpassword'] = $vbulletin->userinfo['password'];
$args['hashmethod'] = 'md5';
$args['email'] = $vbulletin->userinfo['email'];
$args['language'] = $vbulletin->userinfo['lang_code'];
$args['creationtimestamp'] = $vbulletin->userinfo['joindate'];

$retcreate = GalleryEmbed :: createUser($uid, $args);
if ($retcreate)
{
echo '<HR>line: ' . $__LINE__ . ', Failed to create G2 user with extId ['.$uid.']. Here is the error message from G2: <br />'.$retcreate->getAsHtml();
return false;
}
$ret = GalleryEmbed::checkActiveUser($uid);
if ($ret) {
print $ret->getAsHtml();
return false;
}
}
else
{
echo '<HR>line: '.__LINE__.', G2 did not return a success status. Here is the error message from G2: <br />'. $ret->getAsHtml();
return false;
}
}
else
{
echo '<HR>line: '.__LINE__.', G2 did not return a success status. Here is the error message from G2: <br />'.$ret->getAsHtml();
return false;
}
}
}

// user interface: disable sidebar in G2 and get it as separate HTML to put it into a block
//GalleryCapabilities::set('showSidebar', true);

// handle the G2 request
$g2moddata = GalleryEmbed::handleRequest();

// show error message if isDone is not defined
if (!isset($g2moddata['isDone'])) {
$data['bodyHtml'] = 'isDone is not defined, something very bad must have happened.';
return $data;
}
// die if it was a binary data (image) request
if ($g2moddata['isDone']) {
exit; /* uploads module does this too */
}

// put the body html from G2 into the xaraya template
$data['bodyHtml'] = isset($g2moddata['bodyHtml']) ? $g2moddata['bodyHtml'] : '';

// get the page title, javascript and css links from the <head> html from G2
$title = ''; $javascript = array(); $css = array();

if (isset($g2moddata['headHtml'])) {
list($data['title'], $css, $javascript) = GalleryEmbed::parseHead($g2moddata['headHtml']);
$data['headHtml'] = $g2moddata['headHtml'];
}

/* Add G2 javascript */
if (!empty($javascript)) {
foreach ($javascript as $script) {
$data['javascript'] .= "\n".$script;
}
}

/* Add G2 css */
if (!empty($css)) {
foreach ($css as $style) {
$data['css'] .= "\n".$style;
}
}

// sidebar block
if (isset($g2moddata['sidebarHtml']) && !empty($g2moddata['sidebarHtml'])) {
$data['sidebarHtml'] = $g2moddata['sidebarHtml'];
}

return $data;
}
// #######################################################################
// ####################### End G2 integration code #######################
// #######################################################################

eval('print_output("' . fetch_template('gallery') . '");');

?>


the part of my script that looks like this:
if ($vbulletin->userinfo[usergroupid] == 5 or $vbulletin->userinfo[usergroupid] == 6 or $vbulletin->userinfo[usergroupid] == 7 or $vbulletin->userinfo[usergroupid] == 11 or $vbulletin->userinfo[usergroupid] == 12)
is for locking down usergroups to create usernames... if you compare the usergroups on your board you will notice, admins, supermods, mods etc match. i have a few custom groups i have allowed access :)

Hi, integration worked nicely in 3.6

So getting URL Rewrite to work wasn't too difficult.
After getting integration working:
1) Go to Vbulletin and create a new account called anything. I called mine "Administrator"
2) Then I went to http://yourdomain.com/gallery2 and logged in as the site admin.
3) Go to usergroups and add the account created in step 1 (administrator) to the Site Admin group
4) Go to Vbulletin and log off and log on as the account created in step 1 (administrator)
5) Go to http://yourdomain.com/gallery2.php
6) Inside the embedded gallery go to Site Admin.
7) Go to Modules and activate URL rewrites
8) Go create an .htaccess in your root folder /home/yourdir/public_html . Give it 666 permissions
9) Now in the URL rewrites area (embedded mode ie. inside gallery2.php) of site admin click on Setup and you'll get a new embedded option. Here enter the path of the new .htaccess (/home/yourdir/public_html/) and then below that enter the public path (if room then just type / )
10) Click save and now you'll be able to use URL_Rewrites with the fancy shmancy URLs

http://yourdomain.com/v/username/ should work now.



My question:

I'm trying to figure out if it is possible to import a users gallery into his profile. Has any one attempted that? Since the usernames are the same in gallery and vbulletin would it be possible to import using the username?


i will test that on my site sometime this week hopefully(doubtfull knowing my schedule though ;))

there is a way to haev Gallery on a external page. there is some code i saw somewhere. so if you can tell it to look in VBB ID x directory in Gallery, i dont see why not :)

Akagi
29 Aug 2006, 11:58
thanks SilVert!!! it's finally working fine now!

One question, i installed the plugin on the first page..apparently, it deletes gallery users and update the vb users to gallery..why is it that it doesn't really mirror the vb users in gallery? still see the same default gallery users on my gallery site admin

Svobi
29 Aug 2006, 12:26
Hiyas!
I got a gallery2 with about 180 Users and I'm interested in using them together with or within vBull. How do these scripts / hacks work exactely? Is this possible what I want?

Cheers! :D

SilVert
30 Aug 2006, 20:23
thanks SilVert!!! it's finally working fine now!

One question, i installed the plugin on the first page..apparently, it deletes gallery users and update the vb users to gallery..why is it that it doesn't really mirror the vb users in gallery? still see the same default gallery users on my gallery site admin

glad i could help. i know i focused a TON of time into getting the script to work when i had that error :)

can you be a bitmore specific with your question? they are two seperate Databases, they both track users differently. if you look at the database table ?externalid's? it mapps the VBB userid to the gallery userid. that table is there for the sole purpose of integration.

is that the anwser you were looking for?

Hiyas!
I got a gallery2 with about 180 Users and I'm interested in using them together with or within vBull. How do these scripts / hacks work exactely? Is this possible what I want?

Cheers! :D

so you already have Gallery installed and VBB installed but as 2 seperate entities all together correct?

without creating a SQL script, manualy manipulating the table in gallery, or getting the plugin to work, i dont really see an easyer way to do it.

as far as i know there is no automated script out there already to do what you are looking for. now i can help you with what i know about the gallery and vbb ID's to track ID's and groups :)

Svobi
30 Aug 2006, 21:59
so you already have Gallery installed and VBB installed but as 2 seperate entities all together correct?

without creating a SQL script, manualy manipulating the table in gallery, or getting the plugin to work, i dont really see an easyer way to do it.

as far as i know there is no automated script out there already to do what you are looking for. now i can help you with what i know about the gallery and vbb ID's to track ID's and groups :)

Hiyas!

No, atm I only got a gallery2 installed but I'm looking for a board solution to add! I already know vBull so of course this is my first idea if it'd work to bring the gallery users into vBull - syncing or whatever. If this works flawless I'd prefer it more then seeking fore phpBB solution.... :D

Jon.
06 Sep 2006, 18:05
Having problems :(

I'm running 3.6, and when i visit the gallery2.php logged in as me (member #1) it gives me the error that m0nde gets. When i log out completely, or log in as someone else, i just get a blank screen with no source code. Any ideas?

EDIT

I wasn't using the skin that i'd put the template in :blush:

Now, though, there's this php error at the top:
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/jonf/public_html/forum/gallery2.php at line 95 (galleryembed::createuser)
* in /home/jonf/public_html/forum/gallery2.php at line 50

and my forum below with nothing under the "Gallery" header.

Screenies:
http://img347.imageshack.us/my.php?image=09062006191204wz8.jpg
http://img347.imageshack.us/my.php?image=09062006191231xz2.jpg

EDIT2
Only happens when logged in as me. Everyone else gets a working page, but no images in the gallery section...
http://img347.imageshack.us/my.php?image=09062006191554uh5.jpg

EDIT3

Ok, plan B. Could somebody alter the gallery2.php file so that it just creates the user accounts for the gallery? I can then add a redirect or link to the main gallery. I understand this isn't really the place to ask, but i wondered if anyone else had done the same.

Akagi
07 Sep 2006, 09:53
glad i could help. i know i focused a TON of time into getting the script to work when i had that error :)

can you be a bitmore specific with your question? they are two seperate Databases, they both track users differently. if you look at the database table ?externalid's? it mapps the VBB userid to the gallery userid. that table is there for the sole purpose of integration.

is that the anwser you were looking for?


actually, the problem that i'm having is that the VBB users ain't mapped on my gallery user database. VBB has 6k users and gallery has only 2. Any idea?

Jon.
09 Sep 2006, 20:10
Are you getting your users to visit the gallery2.php file? To my knowledge, it won't auto-create them until you visit that page.

SilVert
13 Sep 2006, 22:04
Having problems :(

I'm running 3.6, and when i visit the gallery2.php logged in as me (member #1) it gives me the error that m0nde gets. When i log out completely, or log in as someone else, i just get a blank screen with no source code. Any ideas?

EDIT

I wasn't using the skin that i'd put the template in :blush:

Now, though, there's this php error at the top:
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/jonf/public_html/forum/gallery2.php at line 95 (galleryembed::createuser)
* in /home/jonf/public_html/forum/gallery2.php at line 50

and my forum below with nothing under the "Gallery" header.

Screenies:
http://img347.imageshack.us/my.php?image=09062006191204wz8.jpg
http://img347.imageshack.us/my.php?image=09062006191231xz2.jpg

EDIT2
Only happens when logged in as me. Everyone else gets a working page, but no images in the gallery section...
http://img347.imageshack.us/my.php?image=09062006191554uh5.jpg

EDIT3

Ok, plan B. Could somebody alter the gallery2.php file so that it just creates the user accounts for the gallery? I can then add a redirect or link to the main gallery. I understand this isn't really the place to ask, but i wondered if anyone else had done the same.

the problem is that you are using ID #1 in VBB, in gallery #1 is already assigned so you are getting a collision of sorts.... i know i have mentioned how to fix this previously so i dotn truthfully remember EXACTLY how to resolve this. but here is somewhat what i remember:

there is a table in the gallery 2 database called ?extIDs?(external ID's). this table houses the VBB user ID and then maps it to the Gallery 2 user ID. so if you find the gallery users ID 1, map it to VBB's userID 1. i THINK that will do it. if not it is something along those lines.

Are you getting your users to visit the gallery2.php file? To my knowledge, it won't auto-create them until you visit that page.

actually, the problem that i'm having is that the VBB users ain't mapped on my gallery user database. VBB has 6k users and gallery has only 2. Any idea?

he speaks the troof! ;)

the integration script HAS TO BE VISITED for VBB/Gallery to integrate. how it works is basically as 2 totaly seperate islands with a small bridge. so when you cross the brodge you get an account. if you do not cross the bridge, you dont get an account.

hows that for a beach like explination ;)

Codeman05
17 Sep 2006, 13:57
Hi SilVert,

Quick question that maybe you can help me with. I have a few different usergroups on my board and I would like to have different quotas for them in the gallery 2 integration.

I've already setup corresponding usergroups in Gallery 2 with the same usergroup names and IDs as those on the forum.

Should the Update/Integration script be reading my members usergroup ID off of the forum and setting that same ID into Gallery (because it is not).....or do I need to modify the script?

Everything else is working great however


Edit
One other issue I have noticed is that users trying to use Gallery remote are unable to authenticate. Not a huge deal, I just wanted to make sure this was "normal"

SilVert
18 Sep 2006, 15:00
Hi SilVert,

Quick question that maybe you can help me with. I have a few different usergroups on my board and I would like to have different quotas for them in the gallery 2 integration.

I've already setup corresponding usergroups in Gallery 2 with the same usergroup names and IDs as those on the forum.

Should the Update/Integration script be reading my members usergroup ID off of the forum and setting that same ID into Gallery (because it is not).....or do I need to modify the script?

Everything else is working great however


Edit
One other issue I have noticed is that users trying to use Gallery remote are unable to authenticate. Not a huge deal, I just wanted to make sure this was "normal"


i was experimenting with the group memberships a while ago, and never made much headway. it was mostly due to not haveing the script work originaly. but i think it is possible.... basically you would haev the create user part go through, then insert some code saying if in this VBB group ID put them in the Gallery group.

it is doable, but i dont haev the code infront of me :)

Gallery remote, i belive that problem has to do with pointing to the wrogn location. if your deisgn is:
root\gallery
root\forum
root\forum\gallery.php

you would have to point the Remote to root/gallery to get it to work... i dont think the remote understands embed'd sites.....

Codeman05
18 Sep 2006, 22:08
Thanks, I'll play with the script a bit and see what I can come up with.

As far as the remote goes, the "imbedded java upload client" isn't working as well. I'll double check the paths but I think they were correct.

Thanks for the help!

Akagi
19 Sep 2006, 11:37
he speaks the troof! ;)

the integration script HAS TO BE VISITED for VBB/Gallery to integrate. how it works is basically as 2 totaly seperate islands with a small bridge. so when you cross the brodge you get an account. if you do not cross the bridge, you dont get an account.

hows that for a beach like explination ;)

thanks for the clarification guys!
it's working great now cheers!

GrandAmGuru
21 Sep 2006, 20:50
I posted this up over on the menalto forums too in hopes of a resolution for a funky problem.

I'm integrating Gallery2 into my vBulletin script (which is essentially done). The problem I have is the folder navigation within the Gallery. Say I have a folder called Jeremy under the main Gallery. If I'm in the Jeremy folder and want to navigate back to Gallery (by clicking the breadcrumb link under the Gallery logo) it does a random google search on 'forum'. The same holds true for any nested folders. If you try to go up the breadcrumb trail it's doing that random search.

Codeman05
23 Sep 2006, 03:13
Thanks, I'll play with the script a bit and see what I can come up with.

As far as the remote goes, the "imbedded java upload client" isn't working as well. I'll double check the paths but I think they were correct.

Thanks for the help!

Still no luck, this is what I'm getting with the java upload...
"Upload error: Upload failed: 'user id: 5 doesn't have permission: core.addDataItem for item id: 22'."

Any suggestions?

GrandAmGuru
25 Sep 2006, 15:33
Ok, disregard my previous post. I have the gallery working fully outside the forum. When I view it from an embedded view, something is up with the style. I don't have all the navigation links like I do when I view outside the forum.

Check the screen caps below.


I known when I was monkeying around with it before it did this same thing, and I ended up completely removing and reinstalling. Could it possibly be a corrupted style or something?

fishhub
28 Sep 2006, 07:34
My installation completed and things work fine, except the link below user within VB once click on error comes out:->

You don't have permission to access /forum/gallery2/g2data/albums/xxxxx/ on this server.

Can any kind soul help? Thanks.

xitrum
03 Oct 2006, 17:54
Hi all,

I follow instructions to install gallery2 on the same root folder as my forum and everything seems to work ok. I was able to upload and view images as standalone version:

http://<mydomain>/forum/gallery2/main.php

but when I switch to the embeded version:

http://<mydomain>/forum/gallery2.php

I don't see any thumbnails in my gallery? Any idea. TIA for you help.

-xitrum

PS. Gallery 2.1, VBB 3.6

Chet T16
04 Oct 2006, 19:39
Can anyone tell me what to remove from the gallery code posted so that it is a purely visual integration?

xitrum
04 Oct 2006, 23:11
OK. I tried again with a new installation on my local machine and everything seems to work (now even thumbnails displayed when i access gallery2.php) ...except when I add a new item to the album.

After uploaded a new photo, the browser refresh with this URL:

http://<mydomain>/gallery2.php?g2_view=core.ItemAdmin&g2_subView=core.ItemAddConfirmation&g2_itemId=7&g2_statusId=x5a383bbd&g2_navId=x58f76c22

It should have been:

http://<mydomain>/forum/gallery2.php?g2_view=core.ItemAdmin&g2_subView=core.ItemAddConfirmation&g2_itemId=7&g2_statusId=x5a383bbd&g2_navId=x58f76c22

So the script actually pickup only the basename of the domain name. If I insert /forum to the URL and refresh then it works!

Can someone please help showing me how to fix this problem? TIA.

-xitrum
===================================================================
I think I found the problem now. It was with these 2 lines in gallery2.php file

$ret = GalleryEmbed::init(array('embedUri' => '/forum/gallery2.php',
'g2Uri' => 'http://<full domain name>/forum/gallery2/',

The first line must have full path from the root of httpd. The second line should have the full domain name.

Everything works now. Thanks. Great mod.

xitrum
==============================================================================
Man... I am having a headache with this and almost giving up now.. Wonder if anyone with the same problem or anyone can help out with this.

My standalone gallery2 works fine with:

http://<mydomainurl>/forum/gallery2/main.php

but when I tried the embeded version, I lost the theme and only the text display so it take up a lot of screen real estate:

http://<mydomainurl>/forum/gallery2.php

I have gallery2 installed as:

$htdocs/forum/gallery2

On my local test machine, the embeded version display correct theme. Only the production env it doesn't display correctly. Don't know what the differences are. There must be a very simple explanation to this! PLEASE HELP. TIA

xitrum

xitrum
05 Oct 2006, 17:35
====================================================
I found out that the path to images directory is not correct when using the
embeded gallery link. Images link shown:

http://<domainurl>/forum/images/galleryLogo_sm.gif

instead of:

http://<domainurl>/forum/gallery2/images/galleryLogo_sm.gif

where:

Forum installed at: http://<domainurl>/forum

Gallery2 installed at: http://<domainurl>/forum/gallery2

Can someone please shed some light on this issue? TIA.

-xitrum

brvheart
10 Oct 2006, 19:23
I am having the issue of having created a user with the userid of 1 bumping with the one that VB has for me as an admin.

I am not clear on how to fix this even though I have been reading this thread all day :(

Could someone please give me a hand?

SilVert
17 Oct 2006, 18:16
wow, i go away for a month and i haev 500 questions ;)

Still no luck, this is what I'm getting with the java upload...
"Upload error: Upload failed: 'user id: 5 doesn't have permission: core.addDataItem for item id: 22'."

Any suggestions?

can you post the code that you have inserted into the integration script? i will haev to look around in the code again to see if i can find the right code to pull..

Ok, disregard my previous post. I have the gallery working fully outside the forum. When I view it from an embedded view, something is up with the style. I don't have all the navigation links like I do when I view outside the forum.

Check the screen caps below.


I known when I was monkeying around with it before it did this same thing, and I ended up completely removing and reinstalling. Could it possibly be a corrupted style or something?

the issue is realted to the URL REWRITE!!!! the rewrite does not play well with "embed mode". somebody said in this thread they had it working, but i haev yet to have it all working... remove all of the check boxes and add them in 1 by one... i only have 2 or 3 things workin with the rewrite....

My installation completed and things work fine, except the link below user within VB once click on error comes out:->

You don't have permission to access /forum/gallery2/g2data/albums/xxxxx/ on this server.

Can any kind soul help? Thanks.
where is your path pointing?

give me this info:
webadress:
forum lacation:
gallery location:
where the integration file is:



Hi all,

I follow instructions to install gallery2 on the same root folder as my forum and everything seems to work ok. I was able to upload and view images as standalone version:

http://<mydomain>/forum/gallery2/main.php

but when I switch to the embeded version:

http://<mydomain>/forum/gallery2.php

I don't see any thumbnails in my gallery? Any idea. TIA for you help.

-xitrum

PS. Gallery 2.1, VBB 3.6

im going to blame this one on the URL rewrite again.... try to uncheck everything, validate it all works, then check things one by one till they stop working...

right now, i bet that if you look at where the links point it is saying something like <site name> gallery/v/xxxx/xxxx. the key is that v. that is from the url rewrite. and the embed mode does not understand that very well...


Can anyone tell me what to remove from the gallery code posted so that it is a purely visual integration?

can you give me more detail on what you are looking for?

====================================================
I found out that the path to images directory is not correct when using the
embeded gallery link. Images link shown:

http://<domainurl>/forum/images/galleryLogo_sm.gif

instead of:

http://<domainurl>/forum/gallery2/images/galleryLogo_sm.gif

where:

Forum installed at: http://<domainurl>/forum

Gallery2 installed at: http://<domainurl>/forum/gallery2

Can someone please shed some light on this issue? TIA.

-xitrum


i really hate to say this again.. but looks like URL rewrite... try disabling all of the rewrite and see if it works fine...

GrandAmGuru
17 Oct 2006, 18:24
the issue is realted to the URL REWRITE!!!! the rewrite does not play well with "embed mode". somebody said in this thread they had it working, but i haev yet to have it all working... remove all of the check boxes and add them in 1 by one... i only have 2 or 3 things workin with the rewrite....


I've gone and completely uninstalled the url rewrite module and the thumbnails work. As soon as I enable any portion of it. thumbs are gone. Either way it strips the navigation stuff and replaces it with basic text

Chet T16
17 Oct 2006, 18:32
can you give me more detail on what you are looking for?


I'm using the gallery as a database for scans from magazines and newspapers etc so i only need 1 user to be able to upload and be admin, all of the other existing vB members only need access as a guest.

Since posting this question i have managed to get it working the way i wanted, even tho accounts are being created the users can't add or edit to the gallery. Originally i was importing users from phpBB and that was leading to admin conflicts etc

xitrum
18 Oct 2006, 04:41
Thanks Silvert. I got my gallery working ok now. I think it's the path that's not correct. My only problem is that when the user access gallery2.php the first time. The embeded script create a user in the gallery2 database but the password isn't correct. Using the same password, user can't login to the standalone gallery. This is not a big deal since user can access the gallery after login to the forum.
Another note, is there a mod to display the most recent added albums or most view images, etc... I thought I saw it somewhere but couldn't find it. That would be a nice feature especially when you have a lot of nested albums.
Great mod and great work. Thanks a million.

-xitrum

SilVert
18 Oct 2006, 13:18
I'm using the gallery as a database for scans from magazines and newspapers etc so i only need 1 user to be able to upload and be admin, all of the other existing vB members only need access as a guest.

Since posting this question i have managed to get it working the way i wanted, even tho accounts are being created the users can't add or edit to the gallery. Originally i was importing users from phpBB and that was leading to admin conflicts etc somewhere in this thread i put some code inplace that will only create user accounts if they are in X VBB group... if they are not in the group they will only view as guest :)

Thanks Silvert. I got my gallery working ok now. I think it's the path that's not correct. My only problem is that when the user access gallery2.php the first time. The embeded script create a user in the gallery2 database but the password isn't correct. Using the same password, user can't login to the standalone gallery. This is not a big deal since user can access the gallery after login to the forum.
Another note, is there a mod to display the most recent added albums or most view images, etc... I thought I saw it somewhere but couldn't find it. That would be a nice feature especially when you have a lot of nested albums.
Great mod and great work. Thanks a million.

-xitrum
sure thing. sorry it took me so long to get back to you(been SLAMMED at work) if i even helped at all ;)

the standalone password is explained somewhere. when VBB assignes the password it injevts "salt(<password>)" or something like that into the password. so it will work fine embed, but when you goto the standalone version, you would have to enter salt(insertpasswordhere). im 99% sure that is the right "frase" but i cant remember EXACLTY what it is. it has been documented somewhere. it might be in the gallery integration script for versions prior to 3.5(aka 3.0)

thereis somethign inside of gallery called ?imageblock? i think that allows you to view a random image etc. there is also a way to point to a gallery image or gallery via an external site. i have not messed with this at all, but i knwo it exists. now if it wil do the most recent images etc, i do not know. sorry, i dont have all the anwsers :( ;)

syclone13
20 Oct 2006, 05:08
Just to jump in because I didn't see it noted elsewhere in the thread...

I installed everything and it is functioning just fine, images and all work, users are created in the gallery2 database, however the users dont seem to have any rights in gallery2. I can't figure out what group they are a part of in g2 as they dont seem to be listed as members of any of the groups that exist.

I have a barebones g2 install so I'm wondering if its some config options, some modules I didn't install or if I'm missing something.

The users viewing the embeded gallery get logged in as it shows their usernames in the view, but they just dont have access to upload or do anything beyond view the gallery.

xitrum
20 Oct 2006, 16:03
I believe they are in "Registered User" group by default.

Codeman05
22 Oct 2006, 15:21
can you post the code that you have inserted into the integration script? i will haev to look around in the code again to see if i can find the right code to pull..


This what you want?


require_once('/www/site/www/beta/embed.php');
$ret = GalleryEmbed::init();

if ($ret) {
// echo $ret->getAsHtml();
}


// Set fullname based upon custom fields
$fullname=$this->existing['field13'] ." ". $this->existing['field14'];


// Set the array for updating
$args['fullname'] = $fullname ;
$args['username'] = $this->existing['username'];
$args['hashedpassword'] = $this->existing['password'];
$args['hashmethod'] = 'md5';
$args['email'] = $this->existing['email'];
$args['language'] = $this->existing['lang_code'];
$args['creationtimestamp'] = $this->existing['joindate'];

//$this->existing['usergroupid']

// Get the userid
$uid = $vbulletin->userinfo['userid'];

//$this->existing['userid']


$ret = GalleryEmbed::isExternalIdMapped($uid,$args);

//Now if no user exists, we'll create one
//If user exists, we'll update existing user

if ($ret && ($ret->getErrorCode() & ERROR_MISSING_OBJECT)) {

$ret2 = GalleryEmbed::createUser($uid,$args);

}else {

$ret2 = GalleryEmbed::updateUser($uid,$args);

}


if ($ret2) {

// echo "ret2: ". $ret2->getAsHtml() ;
}


and this is the error I recieve using the java applet template:
Upload error: Upload failed: 'user id: 5 doesn't have permission: core.addDataItem for item id: 1007'.

I get the same error when trying to upload on 2 different user accounts

well, I don't know what I did, but it works now lol.

I do have another question though if anyone can help.

I have a couple of "premium usergroups" on our forum and I would like to be able to give them a larger quota in the gallery. Any suggestions on how to modify the creation/update scripts to get it to translate a forum groupID into the gallery group?

Dimitrio
23 Oct 2006, 01:34
This is not longer working or not working as intended.

When I am not logged as administrator, the page appears in blank. And when I am logged in as administrator, I get several errors.

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/veguild/public_html/forums/gallery2.php at line 95 (galleryembed::createuser)
* in /home/veguild/public_html/forums/gallery2.php at line 50

And yes installed the plugins, but they are not working.

SilVert
30 Oct 2006, 17:53
This what you want?

and this is the error I recieve using the java applet template:
Upload error: Upload failed: 'user id: 5 doesn't have permission: core.addDataItem for item id: 1007'.

I get the same error when trying to upload on 2 different user accounts

well, I don't know what I did, but it works now lol.

I do have another question though if anyone can help.

I have a couple of "premium usergroups" on our forum and I would like to be able to give them a larger quota in the gallery. Any suggestions on how to modify the creation/update scripts to get it to translate a forum groupID into the gallery group?


not what i meant... i just went into /gallery/modules/core/admineditgroupuser.inc and found the code THEY USE. i have not attempted to make this work.... I think this is the right code "$ret = GalleryCoreApi::addUserToGroup($user->getId(), $groupId);". but there is a check right above this code in that file to make sure the users is not already in that group.

i am no coding guru so i wont be able to make thiw work without alot of time invested. i have the knowledge of how it shoudl be done, but i dont know how to impliment somethign like this. sorry guys.. but you can easily look into what each page does if you look in the folder where this file reside. maybe it will help you out.

if anybody does figure it out, plese post up the code. i would love to us it. right now my code is working, but it is the wrong way IMO...

so, Codeman05, i can give you the code that i have to create users and not create users, but i do not have anythign inplace RIGHT NOW that would allow for what you want... sorry. wish i did.

This is not longer working or not working as intended.

When I am not logged as administrator, the page appears in blank. And when I am logged in as administrator, I get several errors.



And yes installed the plugins, but they are not working.

this is the classic problem(which if you would read back i have stated 500 times by now) of you trying to log into Gallery with the VBB user number 1, most likley Admin.

you have to go into the gallery DB and manipulate the ExtID's table to point user #1 in gallery to #1 in VBB... i have said this a bunch of times...


PLEASE SEACH PEOPLE.

weeno
01 Nov 2006, 21:28
is there a demo of this?

arn

SilVert
09 Nov 2006, 17:02
is there a demo of this?

arn

if you want...
Http://www.racersden.net/forum/gallery.php

chevy01xtreme
15 Nov 2006, 14:20
I've done everything as stated, changed the necessary items, but now I get this error when viewing my gallery.php (what i named it)

Fatal error: Call to a member function on a non-object in /home/sonezero/public_html/forum/global.php on line 241

Dimitrio
16 Nov 2006, 15:30
not what i meant... i just went into /gallery/modules/core/admineditgroupuser.inc and found the code THEY USE. i have not attempted to make this work.... I think this is the right code "$ret = GalleryCoreApi::addUserToGroup($user->getId(), $groupId);". but there is a check right above this code in that file to make sure the users is not already in that group.

i am no coding guru so i wont be able to make thiw work without alot of time invested. i have the knowledge of how it shoudl be done, but i dont know how to impliment somethign like this. sorry guys.. but you can easily look into what each page does if you look in the folder where this file reside. maybe it will help you out.

if anybody does figure it out, plese post up the code. i would love to us it. right now my code is working, but it is the wrong way IMO...

so, Codeman05, i can give you the code that i have to create users and not create users, but i do not have anythign inplace RIGHT NOW that would allow for what you want... sorry. wish i did.



this is the classic problem(which if you would read back i have stated 500 times by now) of you trying to log into Gallery with the VBB user number 1, most likley Admin.

you have to go into the gallery DB and manipulate the ExtID's table to point user #1 in gallery to #1 in VBB... i have said this a bunch of times...


PLEASE SEACH PEOPLE.

how can I do that"?

Ok is working at the moment, but unfortunately is not showing up some of the images that it should show up, like the blackjack image, etc..

http://www.veguild.org/forums/gallery2.php

N8R
29 Nov 2006, 01:42
Alright, I have a question dealing with this, so lets see if I can make sense.

I decided to make the gallery stand alone because of problems with embedding, and I wanted to use the url rewrite. Anyway, what I need to figure out is how to still have the gallery recognize when a user is logged in, so they don't have to register in the gallery as well, like how the embedded gallery worked, where if they were logged into the forum, they were logged into the gallery... any ideas on how to do this?

btw I am using vb 3.6.3

Mr Peabody
01 Dec 2006, 23:13
Howdy

Just installed this yesterday and must have spent a hour reading over this thread.
My issue has been mentioned before but im unclear as how to fix it.

Basically everything works, when users view the gallery it automatically makes them a account however they are just a guest and cannot add pictures etc.
I manually changed my account to admin so it works for me,. Is it the forum structure? I have my forum installed into the main directory and not under /forum. mine is as follows

/gallery2
/forum here in root
/gallery.php

any help would be appreciated.

cthree
04 Dec 2006, 02:25
I am having the issue of having created a user with the userid of 1 bumping with the one that VB has for me as an admin.

I am not clear on how to fix this even though I have been reading this thread all day :(

Could someone please give me a hand?

My Only advice is to NEVER use the default #1 Admin account that any package creates, including VB. ALL authenticated applications create at least 1 account and that account is ALWAYS #1. Using this account is like logging on and using your server as root. Bad idea. First thing you should do with VB is make yourself an account #2 that you will use and abandon/disable/delete user id #1.

Now you can integrate with other packages without clashing :) I'm not sure why this best practice is not in the manual but it should be as your first post install step.

N8R
07 Dec 2006, 20:50
No one has any help for me?

SilVert
09 Dec 2006, 22:26
how can I do that"?

Ok is working at the moment, but unfortunately is not showing up some of the images that it should show up, like the blackjack image, etc..

http://www.veguild.org/forums/gallery2.php
i jsut responded to your PM, but it is most likley due to your URL_Rewrite... they dotn work so well with VBB and embed mode. i disabled most of them.... if not ALL of them. i have spend countless hours in attempting to get it to work with the mod rewrite(an apache thing, that callery calls URL Rewrite :))




Alright, I have a question dealing with this, so lets see if I can make sense.

I decided to make the gallery stand alone because of problems with embedding, and I wanted to use the url rewrite. Anyway, what I need to figure out is how to still have the gallery recognize when a user is logged in, so they don't have to register in the gallery as well, like how the embedded gallery worked, where if they were logged into the forum, they were logged into the gallery... any ideas on how to do this?

btw I am using vb 3.6.3

what you want is EXACTLY what the integration is for... there are really no other benefits to haveing the integration script. the script is to enable VBB to create users in Gallery.... soley... you can custom script other things...

Howdy

Just installed this yesterday and must have spent a hour reading over this thread.
My issue has been mentioned before but im unclear as how to fix it.

Basically everything works, when users view the gallery it automatically makes them a account however they are just a guest and cannot add pictures etc.
I manually changed my account to admin so it works for me,. Is it the forum structure? I have my forum installed into the main directory and not under /forum. mine is as follows

/gallery2
/forum here in root
/gallery.php

any help would be appreciated.

can you send me a link to what you mean? the users when they are CREATED shoudl come in as "users" not guests.... or that is how i remember it working.. look at the some of the gallery sections in the admin panel and see if there is a config setting that is not right :)

My Only advice is to NEVER use the default #1 Admin account that any package creates, including VB. ALL authenticated applications create at least 1 account and that account is ALWAYS #1. Using this account is like logging on and using your server as root. Bad idea. First thing you should do with VB is make yourself an account #2 that you will use and abandon/disable/delete user id #1.

Now you can integrate with other packages without clashing :) I'm not sure why this best practice is not in the manual but it should be as your first post install step.

EXACTLY... but if you want to fix it you HAVE TO go into the gallery database and edit the extid's table.. the user in gallery that is number 1 needs to point to the VBB admin ID, i dotn remember it off the top of my head, but it is easy enough to find out :)

No one has any help for me?

never i refuse!!@! ;)

work has been so busy that i get home and dont feel like looking online AT ALL... my computer is off most of the time anyway nowadays :)

jonathanhodd
12 Dec 2006, 08:21
Ive just installed gallery 2.1.2 on vb3.6.4 and just thought i'd share my experiences based on having vb installed under /forums and the gallery under /forums/gallery2

After following the instructions in the first post none of the g2 images/javascript/css files were being called correctly (the html was showing src="forums/gallery2.." instead of src="/forums/gallery2..")

The important variables were originally set like this:

require_once('/home/thrasher/public_html/forums/gallery2/embed.php');
'embedUri' => '/gallery2.php'
'g2Uri' => 'http://www.mysite.com/forums/gallery2'

i found changing these two got everything working:

'embedUri' => 'gallery2.php'
'g2Uri' => '/forums/gallery2'

SilVert
14 Dec 2006, 20:27
Ive just installed gallery 2.1.2 on vb3.6.4 and just thought i'd share my experiences based on having vb installed under /forums and the gallery under /forums/gallery2

After following the instructions in the first post none of the g2 images/javascript/css files were being called correctly (the html was showing src="forums/gallery2.." instead of src="/forums/gallery2..")

The important variables were originally set like this:

require_once('/home/thrasher/public_html/forums/gallery2/embed.php');
'embedUri' => '/gallery2.php'
'g2Uri' => 'http://www.mysite.com/forums/gallery2'

i found changing these two got everything working:

'embedUri' => 'gallery2.php'
'g2Uri' => '/forums/gallery2'



i still have to upgrade.. thanks for the headsup man!

Mr Peabody
15 Dec 2006, 20:15
can you send me a link to what you mean? the users when they are CREATED shoudl come in as "users" not guests.... or that is how i remember it working.. look at the some of the gallery sections in the admin panel and see if there is a config setting that is not right :)

Sorry for the late reply.
I've attached a pic with a dummy user I made to show you what I mean. There are no options to add pics when a new account is made automatically.
Cheers
Travis

scan-pa
15 Dec 2006, 20:17
Never mind, I figured it out.

Fatal error: Call to a member function on a non-object in /home/********/public_html/forum/gallery2.php on line ###

this error is caused by deleting a user in gallery2's user db, but not removing there external id from the db. after I did that, it all works again.

extremesanity
17 Dec 2006, 09:59
There are no options to add pics when a new account is made automatically.I believe this is caused by permission problems.

The problems I have so far with this integration are:
- no default sub-album built for each new user
- users can set own permissions and settings for albums (I don't need 5 mb raw pictures on my web server)

The script needs to built a default album set off of the main gallery album permissions, then set permissions for the each user and the registered user group automatically.

Is it supposed to do that now or is that something I need to add?

scan-pa
17 Dec 2006, 16:46
I believe this is caused by permission problems.

The problems I have so far with this integration are:
- no default sub-album built for each new user
- users can set own permissions and settings for albums (I don't need 5 mb raw pictures on my web server)

The script needs to built a default album set off of the main gallery album permissions, then set permissions for the each user and the registered user group automatically.

Is it supposed to do that now or is that something I need to add?

Do you have your vB 3.6.4 usergroup permisions set in the gallery2.php file?
It should go after this line (aprox line 76)
'activeUserId' => $uid));

Add this line after:
----------------------------------------
if ($vbulletin->userinfo[usergroupid] == 5 or $vbulletin->userinfo[usergroupid] == 6 or $vbulletin->userinfo[usergroupid] == 7 or $vbulletin->userinfo[usergroupid] == 39 or $vbulletin->userinfo[usergroupid] == 43)
{
----------------------------------------

Change the number after the == to whatever vB usergroups ID# you want to allow Album & photo posting access to.

and add a } after this line of the 2nd. else statement to make 3 }

ex:
Should look like this (aprox line to add in area of line 123:

if ($ret) {
print $ret->getAsHtml();
return false;
}
}
else
{
echo '<HR>line: '.__LINE__.', G2 did not return a success status. Here is the error message from G2: <br />'.$ret->getAsHtml();
return false;
}
}
else
{
echo '<HR>line: '.__LINE__.', G2 did not return a success status. Here is the error message from G2: <br />'.$ret->getAsHtml();
return false;
}
}
} //<----- Add this } //

-------------------------------------------

With the owner admin account on gallery 2 be sure edit your guest, regestered user permisions for the main gallery page.


hope that helps.

extremesanity
20 Dec 2006, 02:09
With the owner admin account on gallery 2 be sure edit your guest, regestered user permisions for the main gallery page.Yeah, thats the problem, those instructions aren't included in the original post.

Basically the way I did it was I logged into the standalone login as the admin and created a gallery. I then set permissions on that gallery to allow registered users to create albums of their own.

The problem arises because a register user has way to much freedom when creating their own album. I want a user to be able to create sub-albums, but force them to use the settings from the parent albums so they are not uploading 2000 pixel images.

In addition, the standalone version will create a default album for the user and switch them to that album when they are first created. The integration script does not yet do that. I will probably change that here fairly soon, as soon as I can get the permissions problem figured out.

reverse1312
21 Dec 2006, 14:29
Hello All,

my question :

Would it be possible

- to have Gallery on one server and vB on another (to save bandwidth on the vB server ) and though just 1 login system ?

or

- to have Gallery and vB on the same server (which would share the same registration process) and store all the media files on another server ?

By other server I mean another domain

Thanks

rjdpa
27 Dec 2006, 19:09
I'm getting this error when trying to add a user in the VB Admin Control Panel after installing the plugins. I modified the paths and followed all of the directions...

User Manager

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/rjmdiam/public_html/olfaithful/forums/includes/class_dm_user.php(1657) : eval()'d code on line 10

Aken
29 Dec 2006, 08:51
For anyone who experienced blank pages: I kept getting a normal page when every unregistered guest got a blank one. Turns out it was simply a matter of I had added the 'gallery2' template to one style set, and my default style set was something different.

Felt really stupid, but at least it was an easily fix :) Just something to keep in mind!

SilVert
29 Dec 2006, 20:37
Do you have your vB 3.6.4 usergroup permisions set in the gallery2.php file?
It should go after this line (aprox line 76)
'activeUserId' => $uid));

Add this line after:
----------------------------------------
if ($vbulletin->userinfo[usergroupid] == 5 or $vbulletin->userinfo[usergroupid] == 6 or $vbulletin->userinfo[usergroupid] == 7 or $vbulletin->userinfo[usergroupid] == 39 or $vbulletin->userinfo[usergroupid] == 43)
{
----------------------------------------

Change the number after the == to whatever vB usergroups ID# you want to allow Album & photo posting access to.

and add a } after this line of the 2nd. else statement to make 3 }

ex:
Should look like this (aprox line to add in area of line 123:

if ($ret) {
print $ret->getAsHtml();
return false;
}
}
else
{
echo '<HR>line: '.__LINE__.', G2 did not return a success status. Here is the error message from G2: <br />'.$ret->getAsHtml();
return false;
}
}
else
{
echo '<HR>line: '.__LINE__.', G2 did not return a success status. Here is the error message from G2: <br />'.$ret->getAsHtml();
return false;
}
}
} //<----- Add this } //

-------------------------------------------

With the owner admin account on gallery 2 be sure edit your guest, regestered user permisions for the main gallery page.


hope that helps.

this guy has the right idea! that code that you are talking about is the code that i contributed... i did not create the thread so i have no editing power over it :)

side note: a few weeks ago i edited Gallery2's site to point to MY gallery integration so that people know this project is still alive :) just to make you all aware :)


Hello All,

my question :

Would it be possible

- to have Gallery on one server and vB on another (to save bandwidth on the vB server ) and though just 1 login system ?

or

- to have Gallery and vB on the same server (which would share the same registration process) and store all the media files on another server ?

By other server I mean another domain

Thanks

i dont see why not, gallery and VBB on separate servers is probably do able as well as gallery and VBB on the same server, btu the image store on another server is easyer to do IMO...

gallery and VBB on another server: i think woudl be more complicated. you would have to point the integration script to the other server, im not sure how happy VBB/Gallery would be with this, but i dont see why it would not work :)

VBB and Gallery on the same, images on another: this is the easyer of the two to do(i think). when you install gallery just point the image store directory to the other server(or however your prefered method would be) and then go forth like normal. depending how gallery acts with this all woudl be fine. this question would be better directed at Gallery2.org though... they know the software much better than I. i can only guess as of to how it works :)




I'm getting this error when trying to add a user in the VB Admin Control Panel after installing the plugins. I modified the paths and followed all of the directions...

User Manager

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/rjmdiam/public_html/olfaithful/forums/includes/class_dm_user.php(1657) : eval()'d code on line 10

i have never used the plugin and had it working. but all i can recommend is that you tripple check the paths and the variables they want.. aka absolute path and... the other path, whatever its name is :)

Codeman05
30 Dec 2006, 19:22
I have a very strange problem. If you guys could help out that would be great.

So far this plugin has been working great. However, I recently noticed that Page 10 of the main album index does not work...everything else is fine.

If you go to page 10, here is the error you get

Error (ERROR_MISSING_OBJECT) : Missing object for 4871

* in modules/core/classes/GalleryStorage/GalleryStorageExtras.class at line 1852 (GalleryCoreApi::error)
* in modules/core/classes/GalleryStorage/GalleryStorageExtras.class at line 109 (GalleryStorageExtras::_identifyEntities)
* in modules/core/classes/GalleryStorage.class at line 293 (GalleryStorageExtras::loadEntities)
* in modules/core/classes/helpers/GalleryEntityHelper_simple.class at line 82 (GalleryStorage::loadEntities)
* in modules/core/classes/GalleryCoreApi.class at line 2382 (GalleryEntityHelper_simple::loadEntitiesById)
* in modules/core/classes/GalleryTheme.class at line 1243 (GalleryCoreApi::loadEntitiesById)
* in themes/classic/theme.inc at line 118 (GalleryTheme::loadCommonTemplateData)
* in modules/core/classes/GalleryTheme.class at line 916 (ClassicTheme::showAlbumPage)
* in modules/core/classes/GalleryView.class at line 325 (GalleryTheme::loadTemplate)
* in main.php at line 386 (GalleryView::doLoadTemplate)
* in main.php at line 87
* in modules/core/classes/GalleryEmbed.class at line 192
* in /data/www/jeeps-offroad.com/www/image-hosting.php at line 124 (GalleryEmbed::handleRequest)
* in /data/www/site.com/www/image-hosting.php at line 50
* in /data/www/site.com/www/vbseo.php at line 846
* in /data/www/site.com/www/vbseo.php at line 3


I'm not sure what is causing this, and why it is only this one page that is effected. Any ideas?

RobParker
04 Jan 2007, 14:50
I'm having a bit of a strange problem and I was hoping someone could help.

Using this embedded in the latest VB.

The front page of the gallery works fine but when I go into an album to actually look at what's in it it seems to come out of embedded mode and is displayed full screen. It now no longer appears embedded despite the URL still being something like gallery2.php?g2_itemId=206.

TheHeartSmasher
10 Jan 2007, 21:28
Where are the demos, screenshots, etc. for this from the author in the main post.

SilVert
25 Jan 2007, 15:14
I have a very strange problem. If you guys could help out that would be great.

So far this plugin has been working great. However, I recently noticed that Page 10 of the main album index does not work...everything else is fine.

If you go to page 10, here is the error you get


I'm not sure what is causing this, and why it is only this one page that is effected. Any ideas?
did you move or modify and of the gallery files? the embed script requires no manipulation of files other than the integration script.... and twekaing yoru gallery itself :)


I'm having a bit of a strange problem and I was hoping someone could help.

Using this embedded in the latest VB.

The front page of the gallery works fine but when I go into an album to actually look at what's in it it seems to come out of embedded mode and is displayed full screen. It now no longer appears embedded despite the URL still being something like gallery2.php?g2_itemId=206.

im not sure, but it seems like the URL Rewrite might be messing things up? have you looked into that?

Where are the demos, screenshots, etc. for this from the author in the main post.

i am not the author, just a guy who supports it...
http://www.RacersDen.net/forum/gallery.php is my gallery... thats about the best i got for you...

OpalCat
04 Feb 2007, 07:05
Pardon me for sounding like an idiot, but I'm about frothing at the mouth in frustration after spending over an hour on this, and searching here and at the Gallery site does NO good because it gets way too many search results, exactly zero of which have anything to do with answering my question. Namely: What the holy heck am I supposed to actually DO with the "gallery-plugins.xml" file? Keep in mind that this is also my first real attempt to use Gallery2 (been too happy with Gallery1 on my other sites for all these years) so if this is some incredibly well known process in G2, I don't know it because I haven't used G2 before.

I'll be over here in the corner whimpering and twitching, awaiting some kind soul's response --->

I am adding this gallery as part of upgrading vbulletin, and so this is all on a test server at the moment. Anyway, I have the thing installed and quasi-functional, but as soon as you click on an album, you are whisked out of the embedded environment. Why?

http://test.fathom.org/forums/gallery2.php

All_Starzes
21 Feb 2007, 10:24
I have a big Problem.
I have install the vb Version 3.6.4 and Gallery 2.1

When i logged in as MŘcke it gives the follow problem...

line: 98, Failed to create G2 user with extId [2152]. Here is the error message from G2:
Error (ERROR_STORAGE_FAILURE)

* in modules/core/classes/GalleryStorage/GalleryStorageExtras.class at line 317 (GalleryCoreApi::error)
* in modules/core/classes/GalleryStorage.class at line 304 (GalleryStorageExtras::saveEntity)
* in modules/core/classes/GalleryEntity.class at line 317 (GalleryStorage::saveEntity)
* in modules/core/classes/GalleryUser.class at line 212 (GalleryEntity::save)
* in modules/core/classes/GalleryEmbed.class at line 365 (GalleryUser::save)
* in /var/www/web0/html/ni/gallery2.php at line 95 (GalleryEmbed::createUser)
* in /var/www/web0/html/ni/gallery2.php at line 50

I think that is the collation.... the gallery works on utf8 and my board in ISO...
i dont know really...
I hope some people can help me!!!!:confused: :confused: :confused:

cgray24
22 Feb 2007, 22:53
Hey guys,

Thanks for all the Great work and help here! I was able to install the embed and everything thing works.

The problem im having now is the same as others and the Gallery Remote doesnt connect with anything other than the admin account (the one im assuming was already in Gallery to begin with)

No other user, admin privileges or not, can get it to connect. It gives error


"Invalid username/password.

If your Gallery is embedded inside a CMS like PostNuke, you need to use the "native" (non-embedded) Gallery URL to log in, as well as the native Gallery user and password. You can test these by trying to go the native URL and trying to log in.
"

Since the users getting the error get it on the same URL that the admin user/pass works, im assuming this problem is because of the way vb has set the passwords or something in gallery.

My folder stucture is
www/forum/
www/forum/gallery



Im hoping someone smarter than me here has figured this out? Remote is a great desire for our needs, any help would be appreciated.

Moon!
01 Mar 2007, 19:43
Thank you very much for putting this together, I am very pleased with the end results and how easy it was me to do.

cthree
05 Mar 2007, 13:15
There is a bug in the first post, Step 2:

$uid = $vbulletin->userinfo['userid'] = 0 ? '' : $vbulletin->userinfo['userid'];

should be:

$uid = $vbulletin->userinfo['userid'] == 0 ? '' : $vbulletin->userinfo['userid'];

sross
05 Mar 2007, 22:23
Hi can someone tell me how to make it so i can use my gallery2 css instead of my vbull?

see i need my gallery to run through gallery2.php so it integrates, but i want my gallery style to be untouched. I tried removing navbar,header,footer etc from the template but it's still not looking like my standalone gallery the fonts etc are messed up.. thanks for any help!

I have another issue maybe someone can help with. My users have nicknames but for their gallery album names they want to use their real name. I found I could use the owner field in gallery2, they can enter their full name and this shows on the gallery page. However this mod seems to remove the "your account" link. I need this link to be accessible so they can edit their "full name" under gallery, any ideas how to re-enable the link?

Another problem. my users have no link to add content items. When i enabled the block that did have this option they could all control data throughout the gallery eventhough as far as i could tell they should not have been able to. hope someone can help..

gr8save
07 Mar 2007, 23:19
I have a big Problem.
I have install the vb Version 3.6.4 and Gallery 2.1

When i logged in as MŘcke it gives the follow problem...

line: 98, Failed to create G2 user with extId [2152]. Here is the error message from G2:
Error (ERROR_STORAGE_FAILURE)

* in modules/core/classes/GalleryStorage/GalleryStorageExtras.class at line 317 (GalleryCoreApi::error)
* in modules/core/classes/GalleryStorage.class at line 304 (GalleryStorageExtras::saveEntity)
* in modules/core/classes/GalleryEntity.class at line 317 (GalleryStorage::saveEntity)
* in modules/core/classes/GalleryUser.class at line 212 (GalleryEntity::save)
* in modules/core/classes/GalleryEmbed.class at line 365 (GalleryUser::save)
* in /var/www/web0/html/ni/gallery2.php at line 95 (GalleryEmbed::createUser)
* in /var/www/web0/html/ni/gallery2.php at line 50

I think that is the collation.... the gallery works on utf8 and my board in ISO...
i dont know really...
I hope some people can help me!!!!:confused: :confused: :confused:

I had the same problem. In my default Gallery 2 install I had a user 'admin' and I also had an 'admin' account with VB. To solve my problem I renamed my gallery 2 admin account to admin1 and it solved the problem. I guess the two accounts were incompatable as they had different passwords.

Hope that helps.

TheHeartSmasher
29 Mar 2007, 19:18
I only have a few problems now:

1. When I logout of vbulletin I recieve errors

At the top of the screen

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/username/public_html/testing/forums/includes/class_dm_user.php(1657) : eval()'d code on line 57


Vbulletin Message

Unable to add cookies, header already sent.
File: /home/username/public_html/testing/forums/includes/class_dm_user.php(1657) : eval()'d code
Line: 57


Which is the same error message but if I refresh or click logout again it works.

Sunbeam25
03 Apr 2007, 13:04
This is all working. Thanks for the thread guys, very useful. As ever, I want just a little bit more :)

Having added a new user in gallery2.php, I'd like to assign the user to an existing user group at the same time. Anyone done this? Another parameter on the same command, or another command?

I'll fight through and work it out if I have to, but it'll probably take one of you guys seconds to point me in the right direction.

Thanks

Alan

nonamer69
04 Apr 2007, 04:20
Hey guys, just curious... Does this integration work with the latest vbulletin 3.6.5

I've been reading through the posts here but not really anyone is clearly stating what version of vb they're using. I'm really disatisfied with vbgallery and photopost as members are not allowed to assign thumbnails to their albums. This is why I want to go to Gallery2

thanks a lot,
nonamer66

opaa
05 Apr 2007, 19:49
Great Hack =] It's running very good an the install was easy - top !!

snerd
09 Apr 2007, 17:03
Forgive a noob question, but where do I insert the style code in Step #4?

Thanks,
snerd

raiderlax
21 Apr 2007, 19:06
Anyone please, does this work with 3.6.5???

Thanks in advance.

scan-pa
21 Apr 2007, 19:23
I run this and vB 3.6.5

no problems yet.

SoftDux
11 May 2007, 12:33
Has anyone used this method to allow both public & private galleries?

I want to setup a public gallery, which requires registration in order to upload photos. New users shold be able to upload only 20 photos, but as their ranks increase in the forums (either via posts, rankings, voting of photos, or other methods, they are added to groups with higher upload limitits.

I also want to have adult orientated galleries, but only want to allow access to people older than 18 to browse / upload photos in these galleries.

So, ideally it shouldn't allow people to access gallery directly

any suggestions?

specmav
14 May 2007, 05:09
I only have a few problems now:

1. When I logout of vbulletin I recieve errors

At the top of the screen

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/username/public_html/testing/forums/includes/class_dm_user.php(1657) : eval()'d code on line 57



Vbulletin Message


Which is the same error message but if I refresh or click logout again it works.


I am recieveing this error as well, could someone please help HeartSmasher and myself.

Thanks

carmichael1973
18 May 2007, 15:29
I have this setup and working with one exception. Whenever I (or my members) upload images, we get the infamous "Page Cannot be Displayed" message! Although the path still shows http://uvuit.com/forums/gallery2.php . I can refresh the page and I am back at the gallery home page. When I click on "Your Album" link, I see that the images DID UPLOAD.

My question is: How can I get this to redirect back to the the previous page? Or the member album for that matter!

I also noticed the same thing happens when I make any setting changes from the embedded script.

Any advice would be great!

OK I fixed it! I changed the following with the full URL of my gallery2 files:

$ret = GalleryEmbed::init(array('embedUri' => 'http://www.uvuit.com/forums/gallery2.php',
'g2Uri' => 'http://www.uvuit.com/forums/gallery2/',
'loginRedirect' => 'index.php',
'activeUserId' => $uid));
if ($ret)

I do have one more question though! How can I get this to allow $vbpoptions[bbdir] so I don't have cookie issues when someone logs in at uvuit.com instead of www.uvuit.com ?

Quote:
Originally Posted by TheHeartSmasher
I only have a few problems now:

1. When I logout of vbulletin I recieve errors

At the top of the screen

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/username/public_html/testing/forums/includes/class_dm_user.php(1657) : eval()'d code on line 57



Vbulletin Message


Which is the same error message but if I refresh or click logout again it works.


I am recieveing this error as well, could someone please help HeartSmasher and myself.

Thanks


I was getting this error as well then I disbaled the two plugins. Those two plugins were causing errors all over vb (i.e. post thread, post reply, post anything, login, logout etc.)

I know that's not a fix for the problem since the plugins are designed (theoretically) to resolve collision issues when users are deleted.

I have the gallery working and functioning fine...other than the REWRITE.

Now for my problem:

How can I add a link on my members PROFILE page to go directly to their album? Now if REWRITE actually worked with the EMBEDDED version it would be no problem.

If I'm looking at this correctly, with Redirect disable the member albums resolve to something like this http://mysite.com/forums/gallery2.php?g2_itemId=51 where itemId=51 is the member Album.

I'm sure theres a way to call the members "Gallery User ID" and obtain this updated number automatically and insert it into the LINK to the Member Album. But I can't figure it out. Any help here would be most appreciated!

karlm
19 May 2007, 00:11
Just done this with 3.6.6 (3.6.7 underneath but displays as 3.6.6) and it went flawlessly... as far as i can see, it operates flawlessly too.

Good job guys!

carmichael1973
19 May 2007, 04:12
Just done this with 3.6.6 (3.6.7 underneath but displays as 3.6.6) and it went flawlessly... as far as i can see, it operates flawlessly too.

Good job guys!

Were you able to add a link in the Members Profile to view their Album?

targa_freak
19 May 2007, 11:50
does it works on 3.6.x too?

karlm
20 May 2007, 05:56
Were you able to add a link in the Members Profile to view their Album?
I didnt' get around to that - atm, i'm keeping the album out of reach of 90% of my members so i (and a few select members) can beta test it prior to letting the rest of my community know of it. I want it to be 100% before they get to use it.
Hence, I'm not going to link from the postbit just yet... nearer the time, I'll make a conditional (so only x-groups) can see the link on a user's postbit.
When I do that, I'll leave a comment here to let you know how it went... :)

scan-pa
20 May 2007, 20:41
I updated the forums to 3.6.7pl and all I get are errors now.

How do I remove everything to do with this mod and gallery 2

here is some of the errors I get when people come to my forum main page and forum index page and admin login page:

Warning: rename(/tmp/0.incndrdBN,/home/centram2/CPAg2data/cache/module/thumbnail/0/0/0.inc) [function.rename (http://www.centralpafire.com/forum/function.rename)]: Permission denied in /gallery2/modules/core/classes/GalleryPlatform.class on line 487

Warning: mkdir(/home/centram2/CPAg2data/cache) [function.mkdir (http://www.centralpafire.com/forum/function.mkdir)]: Permission denied in /gallery2/modules/core/classes/GalleryPlatform.class on line 624

Warning: rename(/tmp/0.incjeNH1a,/home/centram2/CPAg2data/cache/module/rss/0/0/0.inc) [function.rename (http://www.centralpafire.com/forum/function.rename)]: Permission denied in /gallery2/modules/core/classes/GalleryPlatform.class on line 487

Warning: mkdir(/home/centram2/CPAg2data/cache) [function.mkdir (http://www.centralpafire.com/forum/function.mkdir)]: Permission denied in /gallery2/modules/core/classes/GalleryPlatform.class on line 624

Warning: rename(/tmp/0.incJIcqty,/home/centram2/CPAg2data/cache/module/panorama/0/0/0.inc) [function.rename (http://www.centralpafire.com/forum/function.rename)]: Permission denied in /gallery2/modules/core/classes/GalleryPlatform.class on line 487

Warning: mkdir(/home/centram2/CPAg2data/cache) [function.mkdir (http://www.centralpafire.com/forum/function.mkdir)]: Permission denied in /gallery2/modules/core/classes/GalleryPlatform.class on line 624

Warning: rename(/tmp/0.inczi6mWV,/home/centram2/CPAg2data/cache/module/publishxp/0/0/0.inc) [function.rename (http://www.centralpafire.com/forum/function.rename)]: Permission denied in /gallery2/modules/core/classes/GalleryPlatform.class on line 487

Warning: mkdir(/home/centram2/CPAg2data/cache) [function.mkdir (http://www.centralpafire.com/forum/function.mkdir)]: Permission denied in /gallery2/modules/core/classes/GalleryPlatform.class on line 624

Warning: rename(/tmp/0.inc53owqj,/home/centram2/CPAg2data/cache/module/sizelimit/0/0/0.inc) [function.rename (http://www.centralpafire.com/forum/function.rename)]: Permission denied in /gallery2/modules/core/classes/GalleryPlatform.class on line 487

Warning: mkdir(/home/centram2/CPAg2data/cache) [function.mkdir (http://www.centralpafire.com/forum/function.mkdir)]: Permission denied

-----------------------------------------------------------------------------

I just want to delete this whole mess and remove it from the system.

Any advice on doing that to restore my forums?

also getting these errors:

Warning: Unknown(/home/centram2/public_html/forum/gallery2/embed.php): failed to open stream: No such file or directory in /includes/class_dm_user.php(1668) : eval()'d code on line 1
Fatal error: (null)() [function.require]: Failed opening required '/home/centram2/public_html/forum/gallery2/embed.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/centram2/public_html/forum/includes/class_dm_user.php(1668) : eval()'d code on line 1

bjornstrom
23 May 2007, 21:20
I need to run gallery on a dedicated server - is this possible?

We're running a loadbalanced webserver farm for our vb and that would not be compatible with gallery since the uploaded pictures would be evenly spread over 4 servers.

skunker
02 Jun 2007, 14:53
I need someone to do this for me. PM me and I'll pay. Thanks.

dotJoel
03 Jun 2007, 14:22
Is it possible to use this mod without embedding the gallery ? All I really want to do is Synch my users.... But keep the gallery stand alone from the forum.

Also has anyone had any success not running the gallery in a subdirectory of their forum ?

Regards,

Joel

jklap
10 Jun 2007, 06:02
Joel,

Sure, my g2 and vb are in separate folders-- the trick is that global.php sets up CWD as the current working directory-- and if you are calling/including global.php from outside of the vb directory you have a problem. I made a change to global.php:

if( !defined(CWD) ) {
define('CWD', (($getcwd = getcwd()) ? $getcwd : '.'));
}

And then in my embed code (most people here seem to be naming their embed file gallery2.php), I simply do the following:

define('CWD', '/var/www/html/vb');
require_once(CWD . '/global.php');

Then, continuing on, I include g2 stuff:

require_once('/var/www/html/g2/embed.php');

Then you init as usual and go on your merry way.

Also, I've noticed that if you are including vb SIMPLY so you can use $vbulletin->userinfo['userid'] to pass into g2, you do not seem to need to include vb/global.php, you can include vb/includes/init.php instead-- it's faster as it doesn't load up a bunch of stuff not needed.

Another side note. If you want to make sure that accessing g2 pages keeps the vb session alive, include the vb stuff as mentioned above, but also make sure to call exec_shut_down() near the end of your script-- this makes vb flush out the session to the db, which then keeps the session alive.

I should note though that I'm not using the vb templating system (fetch_template('gallery2')) to accomplish my display (as this thread discusses). Instead, I simply take the output from the runGallery() call and embed it directly in html in the same script. My script ends up looking like this (obviously pseudocode):


set THIS_SCRIPT
include vb/includes/init.php
include g2/embed.php
get userid from $vbulletin->userinfo['userid']
GalleryEmbed::init( 'embedUrl' => '<<points to this script such as /regstuf/g2.php>>'
'g2Url' => '<<points to url for g2 directory such as /g2/'
'activeUserId' => $userid
)
$data = GalleryEmbed::handleRequest();
check isDone, if so, return
parse header into javascript,title and css

<html>
<head>
echo $data['javascript']
echo $data['css']
</head>
<body>
stuff......
echo $data['bodyHtml']
</body>
</html>

exec_shut_down();


The above is the basics, you should also include error checking and such, I just didn't bother typing.

Also, this works in 3.6.6, 3.6.7 and 3.6.7 PL1

Before you ask me a question, make sure you read this whole thead, cause if you ask something dumb that can be answered by looking at the code or reading this thread like 'what do you mean by set THIS_SCRIPT' or how do you do 'set THIS_SCRIPT, I will ignore you. Think before you ask.



Next....



Looks to me like file access permission errors. Maybe your webserver can no longer can write to your g2data directory?

Your last error leads me to believe your plugins have a path to your embed.php file and embed.php is no longer where it should be.

Look at the paths in the errors and figure out what it's complaining about-- it's all there.


I updated the forums to 3.6.7pl and all I get are errors now.

How do I remove everything to do with this mod and gallery 2

here is some of the errors I get when people come to my forum main page and forum index page and admin login page:

Warning: rename(/tmp/0.incndrdBN,/home/centram2/CPAg2data/cache/module/thumbnail/0/0/0.inc) [function.rename (http://www.centralpafire.com/forum/function.rename)]: Permission denied in /gallery2/modules/core/classes/GalleryPlatform.class on line 487

Warning: mkdir(/home/centram2/CPAg2data/cache) [function.mkdir (http://www.centralpafire.com/forum/function.mkdir)]: Permission denied in /gallery2/modules/core/classes/GalleryPlatform.class on line 624

Warning: rename(/tmp/0.incjeNH1a,/home/centram2/CPAg2data/cache/module/rss/0/0/0.inc) [function.rename (http://www.centralpafire.com/forum/function.rename)]: Permission denied in /gallery2/modules/core/classes/GalleryPlatform.class on line 487

Warning: mkdir(/home/centram2/CPAg2data/cache) [function.mkdir (http://www.centralpafire.com/forum/function.mkdir)]: Permission denied in /gallery2/modules/core/classes/GalleryPlatform.class on line 624

Warning: rename(/tmp/0.incJIcqty,/home/centram2/CPAg2data/cache/module/panorama/0/0/0.inc) [function.rename (http://www.centralpafire.com/forum/function.rename)]: Permission denied in /gallery2/modules/core/classes/GalleryPlatform.class on line 487

Warning: mkdir(/home/centram2/CPAg2data/cache) [function.mkdir (http://www.centralpafire.com/forum/function.mkdir)]: Permission denied in /gallery2/modules/core/classes/GalleryPlatform.class on line 624

Warning: rename(/tmp/0.inczi6mWV,/home/centram2/CPAg2data/cache/module/publishxp/0/0/0.inc) [function.rename (http://www.centralpafire.com/forum/function.rename)]: Permission denied in /gallery2/modules/core/classes/GalleryPlatform.class on line 487

Warning: mkdir(/home/centram2/CPAg2data/cache) [function.mkdir (http://www.centralpafire.com/forum/function.mkdir)]: Permission denied in /gallery2/modules/core/classes/GalleryPlatform.class on line 624

Warning: rename(/tmp/0.inc53owqj,/home/centram2/CPAg2data/cache/module/sizelimit/0/0/0.inc) [function.rename (http://www.centralpafire.com/forum/function.rename)]: Permission denied in /gallery2/modules/core/classes/GalleryPlatform.class on line 487

Warning: mkdir(/home/centram2/CPAg2data/cache) [function.mkdir (http://www.centralpafire.com/forum/function.mkdir)]: Permission denied

-----------------------------------------------------------------------------

I just want to delete this whole mess and remove it from the system.

Any advice on doing that to restore my forums?

also getting these errors:

Warning: Unknown(/home/centram2/public_html/forum/gallery2/embed.php): failed to open stream: No such file or directory in /includes/class_dm_user.php(1668) : eval()'d code on line 1
Fatal error: (null)() [function.require]: Failed opening required '/home/centram2/public_html/forum/gallery2/embed.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/centram2/public_html/forum/includes/class_dm_user.php(1668) : eval()'d code on line 1

dotJoel
11 Jun 2007, 16:32
Alright,

Before I attempt using the unembeded version I thought I would try the mod first.

http://www.appozone.com/test/gallery.php

Looks like for some reason it includes /test/test/ twice and thus does not display any images.

Any advice appreciated.

Regards,

.Joel

snapshotz
15 Jun 2007, 15:59
i know this isn't a solution for all..but this integration never seems to be solid.
you are better off going with vbdrupal and integrating gallery..I do this on my site with no problems with full group synch between platforms.

cash7c3
17 Jun 2007, 02:27
cool hack

jklap
18 Jun 2007, 15:11
i know this isn't a solution for all..but this integration never seems to be solid.
you are better off going with vbdrupal and integrating gallery..I do this on my site with no problems with full group synch between platforms.

As far as this integration being stable, once it is configured and setup right (which is where just about every posted issue I've seen is concerned), there are no stability issues, in fact it is very clean and doesn't contain the overhead of a CMS system- of course this last point is only relevant to those that don't want nor need a CMS.

zincpony
28 Jun 2007, 03:55
anyway to set up access to only admins and super & general mods and have a second gallery for everyone to post into?

and will this work with vb 3.6.7 and gallery 2.2.2??

jklap
29 Jun 2007, 13:19
Basically, all the ideas here are valid for 3.6.X. I'm running 3.6.7 PL1 (uh, as I meantioned above), and Gallery 2.2.1 (although I've looked at the change list for 2.2.2 and I don't see much that would effect it except for the Download image rewriting fix, but thats pretty narrow and only valid if you are using main.php for core.DownloadItem).

and will this work with vb 3.6.7 and gallery 2.2.2??

zincpony
04 Jul 2007, 04:00
hmmmm, i dont understand what it is that i am doing wrong. when i try to visit gallery2.php its loads up completely empty.

i followed the installation closely, but it doesnt work.

i have it set up as

...site/forum
&
...site/forum/gallery2/

Enigma Aus
28 Jul 2007, 06:12
hmmmm, i dont understand what it is that i am doing wrong. when i try to visit gallery2.php its loads up completely empty.

i followed the installation closely, but it doesnt work.

i have it set up as

...site/forum
&
...site/forum/gallery2/

I followed it correctly and everything did work...
This tutorial doesn't clarify the correct dir for embedding gallery and vb

My structure is this

...site/forum>vbfiles
&
...site/forum/gallery2/>gallery2 files

The template loads but my images think there at ....site/forum/forum/gallery2

I cant seem to find a way to fix it... :mad:

oldgoat
29 Jul 2007, 00:57
hello to all
i followed the installation instructions and installed gallery 2.1.1, the program installed properly, everything is working as expected, except the navbar links from vbulletin do not show up, as a standalone product the gallery works fine, it also works as a forum link . I am running vbulletin 3.5.4, the url to the site is http://www.freemovie-downloads.net/gallery2/main.php
I have spent over two days trying to figure out what is not working. I cant get gallery2 to be embedded as part of vbulletin. I need some input as to what can be wrong.

vbulletin is in /httpdocs/forum
gallery2 is in /httpdocs/gallery2
gallery2.php is in /httpdocs/forum

gallery2.php

<?php



// ####################### SET PHP ENVIRONMENT ###########################

error_reporting(E_ALL & ~E_NOTICE);



// #################### DEFINE IMPORTANT CONSTANTS #######################

define('NO_REGISTER_GLOBALS', 1);

define('THIS_SCRIPT', 'gallery2'); // change this depending on your filename



// ################### PRE-CACHE TEMPLATES AND DATA ######################

// get special phrase groups

$phrasegroups = array(



);



// get special data templates from the datastore

$specialtemplates = array(



);



// pre-cache templates used by all actions

$globaltemplates = array(

'gallery2',

);



// pre-cache templates used by specific actions

$actiontemplates = array(



);



// ######################### REQUIRE BACK-END ############################



require_once('./global.php');



// #######################################################################

// ######################## START MAIN SCRIPT ############################

// #######################################################################



$navbits = array();

$navbits[$parent] = 'Gallery';

error_reporting(E_ALL );



$navbits = construct_navbits($navbits);

eval('$navbar = "' . fetch_template('navbar') . '";');



// #######################################################################

// ###################### Begin G2 INTEGRATION CODE ######################

// #######################################################################



$data = runGallery();

$data['title'] = (isset($data['title']) && !empty($data['title'])) ? $data['title'] : 'Gallery';



function runGallery() {

global $vbulletin, $userinfo;

require_once('usr/local/psa/home/vhosts/freemovie-downloads.net/httpdocs/gallery2/embed.php');



$data = array();



// If it's an anonymous user, set the g2 activeUser to null

$uid = $vbulletin->userinfo['userid'] = 0 ? '' : $vbulletin->userinfo['userid'];



// initiate G2

// You need to edit the following 4 lines to suit your VB3 & G2 installations

// This is set up for an install that looks like:

// public_html/VB/<vb files>

// public_html/gallery2/<gallery2 files>

// and also setup for a VB3 template name of 'gallery2'. If you have any

// differences, make those changes here!

// You might need to change 'loginRedirect' if you have your VB3 setup to

// where index.php is not the root page of VB3... Like if you've changed it

// to forums.php or something of the like.



$ret = GalleryEmbed::init(array('embedUri' => 'gallery2.php',

'g2Uri' => 'gallery2/',

'loginRedirect' => 'index.php',

'activeUserId' => $uid));

if ($ret)

{

if ($ret->getErrorCode() & ERROR_MISSING_OBJECT)

{

// Check if there's no G2 user mapped to the activeUserId

$ret = GalleryEmbed::isExternalIdMapped($uid, 'GalleryUser');

if ($ret && ($ret->getErrorCode() & ERROR_MISSING_OBJECT))

{

// User not mapped, create G2 user now

// Get Arguments for the new user:

$args['fullname'] = $vbulletin->userinfo['username'];

$args['username'] = $vbulletin->userinfo['username'];

$args['hashedpassword'] = $vbulletin->userinfo['password'];

$args['hashmethod'] = 'md5';

$args['email'] = $vbulletin->userinfo['email'];

$args['language'] = $vbulletin->userinfo['lang_code'];

$args['creationtimestamp'] = $vbulletin->userinfo['joindate'];



$retcreate = GalleryEmbed :: createUser($uid, $args);

if ($retcreate)

{

echo '<HR>line: '.__LINE__.', Failed to create G2 user with extId ['.$uid.']. Here is the error message from G2: <br />'.$retcreate->getAsHtml();

return false;

}

$ret = GalleryEmbed::checkActiveUser($uid);

if ($ret) {

print $ret->getAsHtml();

return false;

}

}

else

{

echo '<HR>line: '.__LINE__.', G2 did not return a success status. Here is the error message from G2: <br />'.$ret->getAsHtml();

return false;

}

}

else

{

echo '<HR>line: '.__LINE__.', G2 did not return a success status. Here is the error message from G2: <br />'.$ret->getAsHtml();

return false;

}

}



// user interface: disable sidebar in G2 and get it as separate HTML to put it into a block

//GalleryCapabilities::set('showSidebar', false);



// handle the G2 request

$g2moddata = GalleryEmbed::handleRequest();



// show error message if isDone is not defined

if (!isset($g2moddata['isDone'])) {

$data['bodyHtml'] = 'isDone is not defined, something very bad must have happened.';

return $data;

}

// die if it was a binary data (image) request

if ($g2moddata['isDone']) {

exit; /* uploads module does this too */

}



// put the body html from G2 into the xaraya template

$data['bodyHtml'] = isset($g2moddata['bodyHtml']) ? $g2moddata['bodyHtml'] : '';



// get the page title, javascript and css links from the <head> html from G2

$title = ''; $javascript = array(); $css = array();



if (isset($g2moddata['headHtml'])) {

list($data['title'], $css, $javascript) = GalleryEmbed::parseHead($g2moddata['headHtml']);

$data['headHtml'] = $g2moddata['headHtml'];

}



/* Add G2 javascript */

if (!empty($javascript)) {

foreach ($javascript as $script) {

$data['javascript'] .= "\n".$script;

}

}



/* Add G2 css */

if (!empty($css)) {

foreach ($css as $style) {

$data['css'] .= "\n".$style;

}

}



// sidebar block

if (isset($g2moddata['sidebarHtml']) && !empty($g2moddata['sidebarHtml'])) {

$data['sidebarHtml'] = $g2moddata['sidebarHtml'];

}



return $data;

}

// #######################################################################

// ####################### End G2 integration code #######################

// #######################################################################



eval('print_output("' . fetch_template('gallery2') . '");');



?>

thanks in advance