PHP Nuke + G2

drumicube

Joined: 2005-01-07
Posts: 32
Posted: Mon, 2005-02-14 23:13

Concerning the Id, i have never found anything to get it without a SQL request, and this code is very standard (it comes from a very used user login block). If you know something better, i'm really interessed !

But, you're idea is very good, i thought the Id number was necessary, but lately i noticed username are also supported (anything in fact, right ?), this should work and i will get it without database request.
I will map username instead for next code release. :D

Concerning the Hook, i haven't give it a try yet, but i think it's quite annoying. I haven't seen any block or module doing such things, i'm quite sure the only solution will be to edit the CMS itself during user registration/modification or removal, ouch...
I agree also with this approach, if no mapping is available why not creating the user on the fly ?
I will greatly reduced the integration process for most of the CMS, no ?

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Mon, 2005-02-14 23:53

@ExternalId: Yes, you can use the username instead of the uid. But I consider that a bad hack. Are you sure usernames are unique in phpnuke? externalId must be something unique and uid is certainly unique. I'd use uid, but try to find a way to get it without a db query. Ask another php nuke dev, there must be some global var or function that returns the bloody current user or uid.

@hook: i'm quite sure phpnuke doesn't feature events and hooks. phpnuke is old and obsolete. sorry for that statement, but compared to the "new kids on the block", it's really obsolete. And if it has no event / hook system, it doesn't make sense to hack something like that together just for this module.
I'd keep following the idea of mindless, create users on the fly and things like that.

 
drumicube

Joined: 2005-01-07
Posts: 32
Posted: Tue, 2005-02-15 23:28

@InternalId: i have fixed this, and it was quite stupid !
(the cookiedecode give me the id), so i'm now working stricly on ID and removed the sql request...
I will check further if i can gain more and even get rid of the cookiedecode call: I'm not quite sure bout that , it could be a security issue, i will search the web to know more.

@Admin Stuff, i have follow the advice from mindless, i'm now using fetchUsersForGroup to get the admin ID. I have now all i need to correctly map G2 admins to phpnuke: so i will focus myself on the multiple admins problem. Why not creating a tiny interface allowing the end user to map admins has he would like ?

I have also added the update users function, no problem to report about it.

I'm quite confident about the rest, except the hook of course...

 
c4actbe
c4actbe's picture

Joined: 2004-09-01
Posts: 83
Posted: Thu, 2005-02-17 22:28

Hey,
I tried to use the same approach to embbed G2 into cpg-nuke 9,
but i get this error:

Fatal error: Cannot redeclare class bbcode in /home/c4actbe/portablemediaplayers.com/modules/gallery/lib/bbcode/bbcode.class on line 15:

15 class BBCode {

i tried to temp. rename this class but it introduced even more probems
in gallery/lib/smarty_plugins/modifier.markup.php on line 84 etc

any ideas how to resolve this?
thanks!

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Thu, 2005-02-17 23:22

oh, that's just great. I expected to have some conflicts with adodb, but bbcode? well then. we will have to examine the differences between bbcode in cpg and g2 and think about solutions. stay tuned.

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Tue, 2005-02-22 00:08

We can rename the bbcode class to avoid this. We should do so -- this is going to be a conflict point for us. That's why I named all the core classes GalleryXxx so that we didn't have some random class named User that conflicted with a class of the same name in *Nuke :-)

Valiant, if you want to rename the bbcode class to something else (GalleryBbcode?) I'll happily review the change.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Tue, 2005-02-22 06:32

maybe later, got exams these days...
but i consider it as a task.

 
c4actbe
c4actbe's picture

Joined: 2004-09-01
Posts: 83
Posted: Tue, 2005-03-01 23:35

Did anyone bump into the problem that thumbs of top level albums are not loading under nuke?

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Tue, 2005-03-01 23:47

1. do the thumbs show up correctly if G2 is not embedded? just browse to the standalone G2 url.

2. only thumbs of top level albums, everything else works? thumbs of subalbums work?
"not loading" indicates incorrect urls. could you check what urls are produced for the top level thumbs in the <a href="..."><img src="..."/></a> tags?
and as a comparison urls that are from thumbs that work?

 
c4actbe
c4actbe's picture

Joined: 2004-09-01
Posts: 83
Posted: Thu, 2005-03-03 13:29

1. Yes. Everything is OK in standalone.
2. thumbs of top level albums AND thumbs in sidebar (all on index.php?name=gallery2). if i click on any of the thumbs - from that point everything works fine: i can see thumbnails of subalbums, photos... in sidebar too....

example of picture address on the top level [embedded and missing]:
index.php?name=gallery2gallery/main.php&g2_view=core:DownloadItem&g2_itemId=45&g2_serialNumber=4

example of picture address on the top level [standalone]:
gallery/main.php?g2_view=core:DownloadItem&g2_itemId=45&g2_serialNumber=4

example of picture address on the NON-top level [embedded and OK]:
gallery/main.php?g2_view=core:DownloadItem&g2_itemId=44&g2_serialNumber=2

example of picture address on NON top level [standalone]:
gallery/main.php?g2_view=core:DownloadItem&g2_itemId=44&g2_serialNumber=2

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Thu, 2005-03-03 13:35

index.php?name=gallery2gallery/main.php&g2_view=core:DownloadItem&g2_itemId=45&g2_serialNumber=4
-> obviously, for some reason, G2 doesn't recognize the url of the top album.
is your gallery online, can i see it ?
what's the url of the top album?
what's the relative path you use?

is this now cpg-nuke? FYI: the bbcode issue will be resolved in a few days.

 
c4actbe
c4actbe's picture

Joined: 2004-09-01
Posts: 83
Posted: Thu, 2005-03-03 15:03

yes, it is an OLD cpgnuke... bbcode problem was with new version.
check your PM for link information.

_______

Actual gallery is in nukeroot/gallery/ folder

thanks!

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Fri, 2005-03-04 21:48

c4actbe, the bbcode issue should now be gone. I fixed this after the beta release, so you have to get the most recent cvs version, perhaps tomorrows nightly snapshot. you can check lib/bbcode/bbcode.class, if the class name is BBCode, it's still the old version. if it's GalleryBbcode, it's fixed.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Mon, 2005-03-28 20:52
 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Tue, 2005-03-29 18:20

drumicube has updated his phpnuke integration. i don't know if this css things are fixed, but some user stuff has been improved, he says. take a look at the second Readme...

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Tue, 2005-03-29 20:17

drumicube included the css fix from dmovali. the next nightly snapshot will have the improved phpnuke integration.

drumicube, feel free to announce the changes yourself ;)

 
drumicube

Joined: 2005-01-07
Posts: 32
Posted: Wed, 2005-03-30 11:52

Thanks to dmolavin the CSS issue is now solved !
You can now fully mix phpnuke themes and G2 Layouts & Templates without interference. It works quite well...
The last CVS commitment contains this CSS update.

To access the G2 Admin panel, simply log yourself as the admin in phpnuke, it's the same process as in phpnuke: Admin login override Normal user login.

Minors updates have also been added, i have cleaned and tested the module in most various situations to check for errors messages, it should be ok. But if you find something wrong please send us a feedback.

TODO: The user integration is still static, and i'm actually working on account sync: The main entry point i have choosen is the following. G2 user will be added on the fly, if the mapping between G2 and phpnuke failed ! If you have a better suggestion, feel free to propose it !

 
drumicube

Joined: 2005-01-07
Posts: 32
Posted: Thu, 2005-03-31 22:52

Ok good news, i have user creation on the fly and it works nicely !
Here is a sample of how it's done:

Just after the G2 init in the main index.php of the module:

$ret = GalleryEmbed::init(array(
'embedUri' => $g2embedparams[embedUri],
'relativeG2Path' => $g2embedparams[relativeG2Path],
'loginRedirect' => $g2embedparams[loginRedirect],
'activeUserId' => "$uid",
'activeLanguage' =>$g2currentlang));

I insert this:

				// ---------------------------------------------
				// if g2 user don't exists create him on the fly
				// ---------------------------------------------
				
				if ($ret->isError() && ($ret->getErrorCode() & ERROR_MISSING_OBJECT)) {
					
						// full reinit of G2 as the first one failed (through a datastorage error if not done)
						$initret = GalleryEmbed :: init(array ('embedUri' => $g2embedparams[embedUri], 
																				'relativeG2Path' => $g2embedparams[relativeG2Path],
																				'loginRedirect' => $g2embedparams[loginRedirect],
																				'activeUserId' => '', 
																				'activeLanguage' => $g2currentlang, 
																				'fullInit' => $fullInit));
						if (!$initret->isSuccess()) {
							echo'G2 did not return a success status upon an init request. Here is the error message from G2: <br /> [#(1)]'.$initret->getAsHtml();
							return false;
						}
					
						// Load all existing phpnuke <-> G2 mappings
						list ($listret, $mapsbyentityid, $mapsbyexternalid) = g2getallexternalIdmappings();
						if (!$listret) 
						{
							return false;
						}
					
						$query='SELECT user_id, name, username, user_password, user_email, user_lang,  user_regdate FROM '.$user_prefix."_users WHERE `user_id`='".$uid."'";
						$result=$db->sql_query($query);
						
						$sqluserdata		= $db->sql_fetchrow($result);
						$nukeuser_regdate	= $sqluserdata['user_regdate'];

						list( $regmonth, $regday, $regyear ) = split( " ", $nukeuser_regdate );
						$regphpusertimestamp = mktime( 0, 0, 0, $regmonth, $regday, $regyear );
						$nukeuser_lang		= $sqluserdata['user_lang'];
						$nukeuser_uname		= $sqluserdata['username'];
				
						// Get Arguments for the new user:
						$args['fullname']  	=	$sqluserdata['name'];
						$args['username'] 	= $nukeuser_uname;
						$args['hashedpassword'] =	$sqluserdata['user_password'];
						$args['hashmethod'] = 	'md5';
						$args['email'] 		=	$sqluserdata['user_email'];
						$args['language']	=	$Phpnuke2G2Lang[$nukeuser_lang];
						$args['creationtimestamp']	=	$regphpusertimestamp;
						
						if (!isset ($mapsbyexternalid[$nukeuser_id])) 
						{
								$retcreate = GalleryEmbed :: createUser($uid, $args);
								if (!$retcreate->isSuccess()) 
								{
									g2_message('Failed to create G2 user with extId ['.$uid.']. Here is the error message from G2: <br />'.$retcreate->getAsHtml());
									return false;
								}
								
								if (!g2addexternalMapEntry($nukeuser_uname, $uid, 0)) 
								{
					     			return false;
					   		}
					   		
					   		// fully reload the main page, for the new user to take effect
					   		header("Location: modules.php?name=gallery2");
						}
				}
				// ----------------------------
		    // End user creation on the fly
		    // ----------------------------

It's just a sample and it's not finished yet (certainly tomorow), so excuse me in advance if everything is not correct (return in erorr case for instance...)

Some questions which made me suspicious:
- May i have ERROR_MISSING_OBJECT for something else than missing user ? Should i need to fine tune this test ?
- Is the reinit of G2 really necessary ?
- Recalling the page with a header function after user creation is correct ?
- What about calling all this stuff in an external php file as it is only called once ?

Feel free to give your comments...

Of course, it will not manage User update or removal ! :wink:

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Thu, 2005-03-31 23:24

drumicube, yes that how i imagined it would be done.
basically, it's quite good. I will have to change GalleryEmbed::init to give you another return value 'cause at the moment, we actually don't know where the "error_missing_object" comes from. it doesn't have to be a missing user... but for now, this is a good approach. you can't do it better 'cause we don't give you more information. stay tuned.

Quote:
echo'G2 did not return a success status upon an init request. Here is the error message from G2: <br /> [#(1)]'.$initret->getAsHtml();

the [#(1)] style is only valid for xaraya. in xaraya, #(1) gets replaced by an argument. phpnuke works differently. so just omit this [#(1)] thing.

Quote:
g2getallexternalIdmappings

1. why do you do this? 2. why do you check "if (!isset ($mapsbyexternalid[$nukeuser_id]))" ? because you are not sure about the error_missing_object?

@reinit: good as it is. but $fullInit does not have to be parametrizable there, you want a fullinit.

- after the user creation, you want to call GalleryEmbed::done(); and then call GalleryEmbed::init() again, but this time with the $uid again and after this, call handlerequest.

i don't understand your last two questions.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Fri, 2005-04-01 01:01

New GalleryEmbed method: isExternalIdMapped($externalId, $entityType).
Useful to create users on-the-fly, i.e. to verify that the cause for an
error is that there is no corresponding G2 user for activeUserId.

Usage:

$ret = GalleryEmbed::init(...activeUserId => $uid, ...);
if ($ret->isError()) {
    if ($ret->getErrorCode() & ERROR_MISSING_OBJECT) {

        // check if the 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
            $ret = GalleryEmbed::createUser(....);
            // check $ret error code
            $ret = GalleryEmbed::checkActiveUser($activeUserId);
            // check $ret error code
        } else {
            // a real problem, handle it, i.e. raise error or echo error message
        }
    } else { 
        // a real problem, handle it, i.e. raise error or echo error message
    }
}

$g2data = GalleryEmbed::handleRequest();

forget the additional ::init and done() calls mentioned in the previous posts.

 
dmolavi
dmolavi's picture

Joined: 2002-12-05
Posts: 573
Posted: Fri, 2005-04-01 15:50

http://www.nukedgallery.net/postp8324.html#8324

has a method of breaking up the phpNuke user database into segments of 100 users to prevent php max execution time errors on large databases. it does *not* use the new embed method described above, as I didn't read this post until after I finished my code.

 
drumicube

Joined: 2005-01-07
Posts: 32
Posted: Tue, 2005-04-05 11:28

Don't care about it, i have updated your addon to take advantage of new embed method.
Thanks for your contribution.

 
drumicube

Joined: 2005-01-07
Posts: 32
Posted: Wed, 2005-04-06 19:54

here is the new update:

				$ret = GalleryEmbed::init(array(
		           'embedUri' => $g2embedparams[embedUri],
		           'relativeG2Path' => $g2embedparams[relativeG2Path],
		           'loginRedirect' => $g2embedparams[loginRedirect],
		           'activeUserId' => "$uid",
		           'activeLanguage' =>$g2currentlang));

				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
									$query='SELECT user_id, name, username, user_password, user_email, user_lang,  user_regdate FROM '.$user_prefix."_users WHERE `user_id`='".$uid."'";
									$result=$db->sql_query($query);
									
									$sqluserdata		= $db->sql_fetchrow($result);
									$nukeuser_regdate	= $sqluserdata['user_regdate'];
			
									list( $regmonth, $regday, $regyear ) = split( " ", $nukeuser_regdate );
									$regphpusertimestamp = mktime( 0, 0, 0, $regmonth, $regday, $regyear );
									$nukeuser_lang		= $sqluserdata['user_lang'];
									$nukeuser_uname		= $sqluserdata['username'];
							
									// Get Arguments for the new user:
									$args['fullname']  	=	$sqluserdata['name'];
									$args['username'] 	= $nukeuser_uname;
									$args['hashedpassword'] =	$sqluserdata['user_password'];
									$args['hashmethod'] = 	'md5';
									$args['email'] 		=	$sqluserdata['user_email'];
									$args['language']	=	$Phpnuke2G2Lang[$nukeuser_lang];
									$args['creationtimestamp']	=	$regphpusertimestamp;
									
									$retcreate = GalleryEmbed :: createUser($uid, $args);
									if (!$retcreate->isSuccess()) 
									{
										echo 'Failed to create G2 user with extId ['.$uid.']. Here is the error message from G2: <br />'.$retcreate->getAsHtml();
										return false;
									}
									
									if (!g2addexternalMapEntry($nukeuser_uname, $uid, 0)) 
									{
						     			return false;
						   		}
						   		
						   		// Full G2 reinit with the new created user
									$ret = GalleryEmbed :: init(array ('embedUri' => $g2embedparams[embedUri], 
																							'relativeG2Path' => $g2embedparams[relativeG2Path],
																							'loginRedirect' => $g2embedparams[loginRedirect],
																							'activeUserId' => "$uid",
																							'activeLanguage' => $g2currentlang, 
																							'fullInit' => 'true'));
			        } 
			        else 
			        {
			            echo 'G2 did not return a success status. Here is the error message from G2: <br />'.$ret->getAsHtml();
			        }
			    } 
			    else 
			    {
			        echo 'G2 did not return a success status. Here is the error message from G2: <br />'.$ret->getAsHtml();
			    }
			  }

The good thing is: Thanks to you, now it works without the header location call.
I have also updated the admin module to export a maximum of 100 users by pass, it should prevent max time execution error for large database import.
Please dmolavi tells me if it fails again !

As usual Valiant, i send you the code right now for a CVS update.

Cheers.

 
dmolavi
dmolavi's picture

Joined: 2002-12-05
Posts: 573
Posted: Mon, 2005-04-11 20:05

new problem, clean, fresh G2 install (0.9.9 core):
http://www.nukedgallery.net/modules.php?name=gallery2

The error message wrote:
Failed to create G2 user with extId [admin]. Here is the error message from G2:
Error (ERROR_BAD_PARAMETER)

* in embed.php at line 248 (gallerystatus::error)
* in index.php at line 423 (galleryembed::createuser)
* in /home/nuk3dari/public_html/modules.php at line 49

Note that the standalone is fine:
http://www.nukedgallery.net/modules/gallery2/main.php

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Mon, 2005-04-11 20:32

dmolavi, does php-nuke not have user ids (uid)? this would be the only reason why it is mapping users with the username...

the line that stopped the process was if (empty($extUserId) || empty($args['username'])) {

i looked at the php-nuke mod code in index.php, it looks ok.

drumicube,
one question though. 1. why are there spaces between the GalleryEmbed and the :: and the method names?? (and the indenting of your files is extreme!).
$retcreate = GalleryEmbed :: createUser($uid, $args);

 
dmolavi
dmolavi's picture

Joined: 2002-12-05
Posts: 573
Posted: Tue, 2005-04-12 11:20

no, the line that failed is this:

$retcreate = GalleryEmbed :: createUser($uid, $args);
if (!$retcreate->isSuccess()) 
{
   echo 'Failed to create G2 user with extId ['.$uid.']. Here is the error message from G2: <br />'.$retcreate->getAsHtml();
	return false;
}

phpnuke's uid field is "user_id"...not "uid"...the problem is that when logged into phpnuke as admin, the uid gets set to "admin", which screws up this sql:

$query='SELECT user_id, name, username, user_password, user_email, user_lang,  user_regdate FROM '.$user_prefix."_users WHERE `user_id`='".$uid."'";

if i'm not logged into phpnuke as admin, it works just fine, which might explain why you can't see the error message :)

actually, why is it calling the createuser method anyway? i'm not trying to create a new user, just view the album. does the embedding now create a user everytime someone just tries to view the gallery?

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Tue, 2005-04-12 13:28

actually, the error occurs where is said, but that's another story.
however, you asked why it tries to create a user for admin.
because G2 says externalId = 'admin' isn't mapped yet. i guess 'admin' isn't the right externalId (uid in php-nuke).
i hope you can debug this with drumicube...

 
dmolavi
dmolavi's picture

Joined: 2002-12-05
Posts: 573
Posted: Tue, 2005-04-12 15:48

got a fix.
All changes in drumicube's index.php file...
Find:
global $db,$user_prefix;

Replace with:
global $db,$user_prefix,$admin;

Find:

if (is_admin($admin)) 
{
	// we log as an admin
	$uid='admin';
}

Replace with:

if (is_admin($admin)) 
{
    $admin_array = base64_decode($admin);
    $admin_array = explode(":", $admin_array);
	$admin_user = $admin_array[0];
	$query='SELECT user_id FROM '.$user_prefix."_users WHERE `username`='".$admin_user."'";
	$result=$db->sql_query($query);
	$sqluserdata = $db->sql_fetchrow($result);
	$uid = $sqluserdata[0];
}
 
tf5_bassist

Joined: 2004-08-14
Posts: 8
Posted: Fri, 2005-05-27 19:30

Alright... So i made those changes in the index.php file in the modules folder... and this is what it gave me:

Failed to create G2 user with extId [3]. Here is the error message from G2:
Error (ERROR_COLLISION)

* in modules/core/classes/GalleryUser.class at line 167 (gallerystatus::error)
* in modules/core/classes/GalleryEmbed.class at line 283 (galleryuser::create)
* in /home/down-pou/public_html/boredom/modules/gallery2/index.php at line 217 (galleryembed::createuser)
* in /home/down-pou/public_html/boredom/modules.php at line 43

Sorry, such file doesn't exist...

I'm completely confused on how to get this to work, been on it for two days now... and i can't even get to the G2 module admin page in PHPNuke.. all changes to gallery2.php i've been hand-editing. Speaking of which, here's what i have in that file:

<?
$g2embedparams = array (
  'embedphpfile' => '/home/down-pou/public_html/boredom/gallery2',
  'embedUri' => 'http://boredom.down-pour.net/modules.php?name=gallery2',
  'relativeG2Path' => '/home/down-pou/public_html/boredom/gallery2/',
  'loginRedirect' => 'modules.php?name=Your_Account',
  'activeUserId' => '0',
);
$g2mainparams = array (
  'showSidebar' => 'false',
);
$g2configurationdone = 'true'; ?>

it looks right to me... Any suggestions?

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Fri, 2005-05-27 19:52

- 'activeUserId' => '' for anonymous users, not '0'.

  'embedUri' => 'http://boredom.down-pour.net/modules.php?name=gallery2',
  'relativeG2Path' => '/home/down-pou/public_html/boredom/gallery2/', 

all wrong. perhaps the rest is wrong too, don't know.

  'embedUri' => 'modules.php?name=gallery2',
  'relativeG2Path' => 'gallery2/', 

but this won't change the error you have there. don't know why you get it. perhaps you should start from scratch, empty the database table g2_externalIdmap and try again.

 
tf5_bassist

Joined: 2004-08-14
Posts: 8
Posted: Fri, 2005-05-27 20:01

i could... although i went through and did this as SOON as i got it working in standalone... This install isn't even 24 hours old yet... would there be a problem if i'm only running PHPNuke 7.0?

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Fri, 2005-05-27 20:04

tf5_bassist, who knows. probably the guys at www.nukedgallery.net know more.

 
Brujo

Joined: 2002-10-26
Posts: 20
Posted: Sat, 2005-06-11 21:11

Hi, i installed the latest CSV embeded G2 in phpnuke 7.6 for testing and i found a small issue. If i enter the Gallery, all german umlauts in the left Navigation Blocks of Nuke are changed in some other Characters (like G�stebuch and not as Gästebuch). If i leave the gallery the Umlauts are shown normal again.

BTW in the G2 Menus the Umlauts are shown correctly only in Phpnuke not

Brujo

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sat, 2005-06-11 21:25

make sure the <meta charset of phpnuke is utf-8

 
Grayhawlk

Joined: 2005-07-25
Posts: 2
Posted: Tue, 2005-07-26 18:21

Trying to put G2 into PHP-Nuke 7.5
When I attempt to embed it into Nuke via the Admin panel I get the follwoing error:

 Warning: main(modules/gallery2/admin/language/lang-english.php): failed to open stream: No such file or directory in /home/moggle/public_html/admin/case/case.gallery2.php on line 23 
  
 Warning: main(): Failed opening 'modules/gallery2/admin/language/lang-english.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/moggle/public_html/admin/case/case.gallery2.php on line 23 
  
 Warning: main(modules/gallery2/modules/gallery2/admin/index.php): failed to open stream: No such file or directory in /home/moggle/public_html/admin/case/case.gallery2.php on line 33 
  
 Warning: main(modules/gallery2/modules/gallery2/admin/index.php): failed to open stream: No such file or directory in /home/moggle/public_html/admin/case/case.gallery2.php on line 33 
  
 Warning: main(): Failed opening 'modules/gallery2/modules/gallery2/admin/index.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/moggle/public_html/admin/case/case.gallery2.php on line 33
 
dmolavi
dmolavi's picture

Joined: 2002-12-05
Posts: 573
Posted: Tue, 2005-07-26 18:22

yeah, you've got some old files there. you need to download the new integration package.

 
skl

Joined: 2005-08-17
Posts: 7
Posted: Wed, 2005-08-17 18:27

Hi boys!

I'm integrated gallery 2 to nuke 7. Everything is fine, but,,,

I need to change gallery's charset from utf-8 to iso-... becuase in nuke i'm using iso and many special characters looks funny when gallery module loaded.
I'm modificated all the files in po and local directories with no results. Still utf-8...
searched in any other files for utf-8 with no results!!! it's impossible! i'm going crazy!

How can i change it??? (change nuke to utf-8 is certainly the worst answer!!! i tried already :D)
Is anybody know it on this planet?

After the integration the Hungarian language changed to English. I can select all languages on the site administration page, but in every cases everything still in English. i can't figure out the reason.

Help me dudes!

 
dmolavi
dmolavi's picture

Joined: 2002-12-05
Posts: 573
Posted: Wed, 2005-08-17 18:37

when you say "everything still in English", are you referring to the G2 admin panel in phpnuke when it asks for your embedURI, etc?

 
skl

Joined: 2005-08-17
Posts: 7
Posted: Wed, 2005-08-17 18:43

no! the whole gallery page in english except 1 word "galéria" in hungarian

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Wed, 2005-08-17 18:44

po files are not used at runtime.. you must compile them into mo files. run lib/tools/po/update-all-translations.pl or do gmake install in each po dir.
also change the charset in the header applied in GalleryTranslator.class.

 
skl

Joined: 2005-08-17
Posts: 7
Posted: Wed, 2005-08-17 18:48

sounds good!! will report the results

thnx

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Wed, 2005-08-17 18:54

skl, oh, there's also a UTF-8 <meta> tag added in GalleryTemplateAdapter.class, function head(). (maybe not used in your embedded env, not sure.. check html source of page to see if meta tag for UTF-8 is in there)

 
skl

Joined: 2005-08-17
Posts: 7
Posted: Wed, 2005-08-17 21:36

i don't have this directory lib/tools/.... in my full package downloaded from here:
http://codex.gallery2.org/index.php/Gallery2:Download#Packages

 
skl

Joined: 2005-08-17
Posts: 7
Posted: Wed, 2005-08-17 23:56

i found the tools in the developers pack alreary! but i don't know how to use...

i made a little mod. in nuke to by-pass the charset prob.

in my theme in theme.php i repleaced

blocks(left);

with

if ( strstr ( $name , "gallery2" ) ) {
  /* no left blocks when gallery pages loads*/
}
else {
  blocks(left);
}

+ $name given to themeheader's globals

in this case only the nukes header visible only beside gallery.

Anyway, i changed the charset but the same prob. appeared in gallery as in nuke before.

my big prob is still the language. i can select any languages, the gallery always shown in english only. I can't realise how is it possible, but if i delete all english "locale" directories, gallery still works in english as before :)

i tried to print out the variables in index.php

after this line:

$g2currentlang = $phpnuke2G2Lang[$currentlang];

included :

echo $g2currentlang;
echo $currentlang;

if nuke in english the result was "en english"
in hungarian "hu hungarian"

so, nuke give the information and gallery reveive it as well.

what is the prob???

Could you help me?

 
jjaomni

Joined: 2003-06-17
Posts: 11
Posted: Thu, 2005-08-18 01:46

any news on mod_rewrite support?

 
dmolavi
dmolavi's picture

Joined: 2002-12-05
Posts: 573
Posted: Thu, 2005-08-18 11:17

the embedded rewrite module will make friendly urls for you

 
SanderBroek

Joined: 2005-08-23
Posts: 11
Posted: Tue, 2005-08-23 21:00

I got this message:

Error (ERROR_PLATFORM_FAILURE) : 
in modules/core/classes/GalleryTemplate.class at line 260 (gallerystatus::error) 
in modules/core/classes/GalleryTemplate.class at line 200 (gallerytemplate::_initcompiledtemplatedir) 
in modules/core/classes/GalleryTheme.class at line 961 (gallerytemplate::fetch) 
in modules/core/classes/GalleryView.class at line 285 (matrixtheme::loadtemplate) 
in main.php at line 289 (showitemview::doloadtemplate) 
in main.php at line 90
in modules/core/classes/GalleryEmbed.class at line 155
in /home/httpd/vhosts/hockeybase.nl/httpdocs/modules/gallery2/index.php at line 137 (galleryembed::handlerequest) 
in /home/httpd/vhosts/hockeybase.nl/httpdocs/modules.php at line 55

I took these steps:

- Installed G2 succesfully
- Installed integration package
- carried out integration configuration
- exported users succesfully
- activated module

After accessing the module i got my website with above message. I'm using phpnuke 7.7. I don't have the foggiest idea what's going wrong.

 
dmolavi
dmolavi's picture

Joined: 2002-12-05
Posts: 573
Posted: Tue, 2005-08-23 23:23
 
SanderBroek

Joined: 2005-08-23
Posts: 11
Posted: Wed, 2005-08-24 05:59
dmolavi wrote:
http://www.nukedgallery.net/postt1843.html has your answer.

I read this thread before posting here. But it didn't solve the problem. Checked permissions again a few secs ago, but the complete g2data-folder is set to 777.

 
ArcAiN6

Joined: 2005-09-02
Posts: 24
Posted: Sun, 2005-09-04 05:23

Just wondering if there is a workaround yet for Impervious's particular situation... as phpnuke's claim to fame sort of is the fact that one can simply addon to it by adding thier content to the modules directory...
wich i have done... now have gallery2 in folder called gallery.../var/www/modules/gallery/ but php nuke wants to load " main.php or something instead of index.php, i input this url : http://www.sinful-flesh.com/modules.php?name=gallery
and get a 404 with this URL in the URL box
http://www.sinful-flesh.com/main.php

redirects gone haywire??? i think gallery is trying to load main.php but trying to load it from / instead of /modules/gallery/ URI issue?