Mambo and G2 embedding

rza

Joined: 2005-05-08
Posts: 34
Posted: Mon, 2005-07-18 07:04

has this error been fixed yet?

Fatal error: Call to undefined function: getorderby() in /var/www/html/gallery2/modules/core/classes/helpers/GalleryChildEntityHelper_simple.class on line 480

 
michiel_1981

Joined: 2005-05-19
Posts: 430
Posted: Mon, 2005-07-18 07:28

rza,

yes it has, but some time ago. i don't know when.

grtz,
Michiel

 
JackBreech

Joined: 2005-02-24
Posts: 22
Posted: Mon, 2005-07-18 20:41

cpzhao!!!

That installation seems almost perfect! How did you get it setup?

 
kdizzle

Joined: 2005-07-06
Posts: 27
Posted: Thu, 2005-07-21 07:21

Hello,

I have one great looking site until I hit gallery and there are these errors at the top:

Warning: Cannot modify header information - headers already sent in /srv/www/htdocs/Mambo/index.php on line 214

Warning: Cannot modify header information - headers already sent in /srv/www/htdocs/Mambo/index.php on line 215

Warning: Cannot modify header information - headers already sent in /srv/www/htdocs/Mambo/index.php on line 216

Warning: Cannot modify header information - headers already sent in /srv/www/htdocs/Mambo/index.php on line 217

Warning: Cannot modify header information - headers already sent in /srv/www/htdocs/Mambo/index.php on line 218

Has this issue been solved?

Almost forgot:

Gallery version = 2.0-beta-3+ core 0.9.31
PHP version = 4.3.10 apache2handler
Webserver = Apache/2.0.53 (Linux/SUSE)
Database = mysql 4.1.10a
Toolkits = ArchiveUpload, Exif, Gd, ImageMagick, NetPBM, Thumbnail
Operating system = Linux apbio 2.6.11.4-21.7-default #1 Thu Jun 2 14:23:14 UTC 2005 x86_64
Browser = Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4

 
michiel_1981

Joined: 2005-05-19
Posts: 430
Posted: Thu, 2005-07-21 09:48

kdizzle,

no not yet, i'm trying to reproduce on msas, your number 3 to report it.

regards,
Michiel

 
kdizzle

Joined: 2005-07-06
Posts: 27
Posted: Thu, 2005-07-21 14:56

Thank you,

I sent you a pm with my site and user info just in case.

I don't know if this helps or not, but all the modules work with gallery2 except the SWmenu free. On the gallery component I can see the title of the SWmenuFree block but I can't see any menu choices. This happens only on the gallery component.

 
kdizzle

Joined: 2005-07-06
Posts: 27
Posted: Fri, 2005-07-22 06:23

Okay, I looked around on mamboserver and found this thread (and a few like it).
http://forum.mamboserver.com/showthread.php?t=30691&highlight=modify+header

This basicaly says there is a blank line or space outside of the <?php........?> tags.

So I figure it isn't in the mambo directory sice I only get the errors:


Warning: Cannot modify header information - headers already sent in /srv/www/htdocs/Mambo/index.php on line 214

Warning: Cannot modify header information - headers already sent in /srv/www/htdocs/Mambo/index.php on line 215

Warning: Cannot modify header information - headers already sent in /srv/www/htdocs/Mambo/index.php on line 216

Warning: Cannot modify header information - headers already sent in /srv/www/htdocs/Mambo/index.php on line 217

Warning: Cannot modify header information - headers already sent in /srv/www/htdocs/Mambo/index.php on line 218

WHEN I use the gallery component.

I ssh in and open the component directory and find:
footer.php gallery2.php userfuncs.php version.php

I then open gallery2.php and find it appears all goobltygooked up. I see characters I have never seen using vim before. The file appears to all be on one line with no breaks at all.

So I ftp the gallery2.php file back to my home computer and open it with notepad.....same thing it appears to have no structure other than it is all on one line. Obviously the component works so it makes me think the garbeled file has a space causing the error.

Could somebody post a clan version of the gallery2.php file so I can try to use it?

Michiel let me know if I am way off and I'll stop.

 
michiel_1981

Joined: 2005-05-19
Posts: 430
Posted: Fri, 2005-07-22 06:56

kdizzle,

Hi,
i think i found the problem, i think it are mac returns you are seeing in the file, and they aren't correctly read or something.
Could you post a screenshot?

i'll look if i can some how change this setting to use common returns when saving insteas of the apple's returns.

Regards,
Michiel

 
kdizzle

Joined: 2005-07-06
Posts: 27
Posted: Fri, 2005-07-22 15:55

The ssh progarm I use is putty.

 
volksman

Joined: 2005-07-22
Posts: 12
Posted: Fri, 2005-07-22 15:56

I see the same things in my copy. Basically ^M characters all over the place. I used dos2unix to convert them but the problem persists.

 
kdizzle

Joined: 2005-07-06
Posts: 27
Posted: Fri, 2005-07-22 16:32

I was hoping this was it but I haven't got it yet.

I ftp'ed the 4 files to my local machine and opened them in word pad and they looked fine.

I opend the com_gallery2 directory and rm all the files.
I then used vim to create a new file for each and then I pasted via ssh into the new document. Now I don't see the M's all over the place but the error still exists.

What has me stumped is the error appears to be in the index.php but it only happens when I use the gallery component.

 
volksman

Joined: 2005-07-22
Posts: 12
Posted: Fri, 2005-07-22 17:41

I'm pretty sure it is that gallery is sending header info and so is mambo.....only problem is I'm too new to PHP to understand how to fix it....

 
tassos

Joined: 2005-07-22
Posts: 4
Posted: Fri, 2005-07-22 22:17

The issue with the ^M can easily be solved if you filter the files with the utility mac2unix that should be available on most Linux installations. This is because the files seem to stem from a Mac environment. The newline convention is different in Unix/WinDos/Mac.
In Unix/Linux there is only a Linefeed (LF)
In Mac there is only a Carriage Return (CR)
In Win-Doses there is both CR/LF (The dos2unix utility fixes those)

But this will not solve you the problem with the "Warning: Cannot modify header information ..." This must originalte in the fact that both Mambo and Gallery send page header information and PHP does not like that. This warning appears frequenty in various php related developments and the cause could be the one described in http://de.php.net/header

 
phpsurf

Joined: 2005-07-24
Posts: 1
Posted: Sun, 2005-07-24 11:18

Hi guys, I'm new to Mambo, so I'm not sure of the impacts of this.
But it seems that the reason of the problem is that both Mambo and Gallery send headers.

The problem I found comes from Mambo : Mambo sends its own headers after calling the embedded component.

Have a look at the file index.php at the root of your Mambo installation.
The headers between lines 194 and 198 :

header( 'Expires: Mon, 26 Jul 1997 05:00:00 GMT' );
header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s' ) . ' GMT' );
header( 'Cache-Control: no-store, no-cache, must-revalidate' );
header( 'Cache-Control: post-check=0, pre-check=0', false );
header( 'Pragma: no-cache' );

sould be sent before the block that is just before, between lines 177 and 190 :

ob_start();
if ($path = $mainframe->getPath( 'front' )) {
	$task = mosGetParam( $_REQUEST, 'task', '' );
	$ret = mosMenuCheck( $Itemid, $option, $task, $gid );
	if ($ret) {
		require_once( $path );
	} else {
		mosNotAuth();
	}
} else {
	echo _NOT_EXIST;
}
$_MOS_OPTION['buffer'] = ob_get_contents();
ob_end_clean();

Hope this will help.
Now one should open that issue on the Mambo devlist.
If someone is more aware than me of Mambo, maybe he could follow up that fix.

 
jeff260z
jeff260z's picture

Joined: 2005-07-20
Posts: 26
Posted: Mon, 2005-07-25 00:55

I'm having the same header warnings.

Warning: Cannot modify header information - headers already sent in /usr/local/psa/home/vhosts/mysite/httpdocs/index.php on line 194

Warning: Cannot modify header information - headers already sent in /usr/local/psa/home/vhosts/mysite/httpdocs/index.php on line 195

Warning: Cannot modify header information - headers already sent in /usr/local/psa/home/vhosts/mysite/httpdocs/index.php on line 196

Warning: Cannot modify header information - headers already sent in /usr/local/psa/home/vhosts/mysite/httpdocs/index.php on line 197

Warning: Cannot modify header information - headers already sent in /usr/local/psa/home/vhosts/mysite/httpdocs/index.php on line 198

 
michiel_1981

Joined: 2005-05-19
Posts: 430
Posted: Mon, 2005-07-25 12:16

jeff260z, phpsurf, kdizzle,

is there a line with "output started at ..." with these warnings?

please post this also? Only in embedded or also in standalone?

regards,
Michiel

 
tassos

Joined: 2005-07-22
Posts: 4
Posted: Mon, 2005-07-25 15:32

Displaying such warnings depends on the setting of the display_errors switch in your php.ini file. Especially on production sites (hosted web-spaces) this is likely to be "Off". Only if this is "On" such warning will go through.

May I ask those of you that use the gallery2 component for mambo and have not these problems to check the settings of the display_errors switch?

Regards,
Tasos

 
michiel_1981

Joined: 2005-05-19
Posts: 430
Posted: Mon, 2005-07-25 17:11

tassos,

i have full report on, and i don't recieve the warnings.

regards,
michiel

 
kdizzle

Joined: 2005-07-06
Posts: 27
Posted: Tue, 2005-07-26 04:46

My php.ini says:
error_reporting = E_ALL & ~E_NOTICE

Still getting the errors.

 
kdizzle

Joined: 2005-07-06
Posts: 27
Posted: Tue, 2005-07-26 05:13
michiel_1981 wrote:
jeff260z, phpsurf, kdizzle,

is there a line with "output started at ..." with these warnings?

No

Quote:
please post this also? Only in embedded or also in standalone?

regards,
Michiel

I only receive the errors in embed mode and only when the gallery 2 componnent.

 
michiel_1981

Joined: 2005-05-19
Posts: 430
Posted: Tue, 2005-07-26 05:58

Hi,

the people with the header problem, do you have gzip enabled or not?

regards,
Michiel

 
kdizzle

Joined: 2005-07-06
Posts: 27
Posted: Tue, 2005-07-26 06:22

I do not have gzip enabled.

 
michiel_1981

Joined: 2005-05-19
Posts: 430
Posted: Tue, 2005-07-26 06:26

kdizzle,

could you try it with gzip enabled.

regards,
Michiel

 
kdizzle

Joined: 2005-07-06
Posts: 27
Posted: Tue, 2005-07-26 07:06

I tried it both ways.

I just did s cvs update to:

 Gallery version = 2.0-beta-4 core 0.9.32
PHP version = 4.3.10 apache2handler
Webserver = Apache/2.0.53 (Linux/SUSE)
Database = mysql 4.1.10a
Toolkits = ArchiveUpload, Exif, Gd, ImageMagick, NetPBM, Thumbnail
Operating system = Linux apbio 2.6.11.4-21.7-default #1 Thu Jun 2 14:23:14 UTC 2005 x86_64
Browser = Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4 

When I turn on maximum error reporting I get the in the component

Notice: Undefined index: id.rootAlbum in /srv/www/htdocs/Mambo/components/com_gallery2/userfuncs.php on line 343

In the random image module I get this

Notice: Use of undefined constant randomImage - assumed 'randomImage' in /srv/www/htdocs/Mambo/modules/mod_gallery_block.php on line 48

I have no idea if these errors mean anything I am just trying to be thorough in my explanation.

The only other strange thing is the way that the module " SWmenuFree" does not appear when the gellery2 com is in use. I can see the title of the block but none of the menus.

edit **I just noticed I mentioned the menu issue before.**

 
malthazor

Joined: 2003-04-03
Posts: 33
Posted: Tue, 2005-07-26 14:35

I tried turning on gzip with no change. Only see errors when embedded, standalone works fine.

Quote:
Gallery version = 2.0-beta-4 core 0.9.32
PHP version = 4.3.4 apache2handler
Webserver = Apache/2.0.49 (Linux/SuSE)
Database = mysql 4.0.18
Toolkits = ArchiveUpload, Exif, Ffmpeg, Gd, ImageMagick, NetPBM, Thumbnail
Operating system = Linux livingroom 2.6.5-7.155.29-default #1 Thu Jun 2 12:07:05 UTC 2005 i686
Browser = Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6

Interesting we are both running SuSE, wonder if others with the header issue are too?

 
volksman

Joined: 2005-07-22
Posts: 12
Posted: Tue, 2005-07-26 19:19

nope...I'm on Slackware 10.1 and I get the issue. I also have gzip enabled.

I got rid of the error by setting display_errors = Off in php.ini and restarting apache but I know that the error is still there and that isn't a permanent fix....

 
michiel_1981

Joined: 2005-05-19
Posts: 430
Posted: Tue, 2005-07-26 19:38

volksman,

i know that volksman, i'm working on it, but my best gues at the moment is that there is being a file included containing white spaces outside <?php ?> markers.

regards,
Michiel

[edit]
typo

 
jeff260z
jeff260z's picture

Joined: 2005-07-20
Posts: 26
Posted: Wed, 2005-07-27 02:26

There are no other lines of code displayed. These are the only lines shown. This only happens with the componant displayed. Things work correctly otherwise. It's just that this code is displayed in the mambo header when accessing the componant.

 
michiel_1981

Joined: 2005-05-19
Posts: 430
Posted: Wed, 2005-07-27 15:12

People with the header problem, could you replace the header lines in index.php in the mambo root directory with these lines, and see what happens. If any info is put out at the top of your page, copy/paste it here please!

after you have don this remove the "else" rule and you won't be heaving these errors any more. this isn't a permanent fix, but i like to now what is already sent and where it's coming from, thxs

if (!headers_sent()){
header( 'Expires: Mon, 26 Jul 1997 05:00:00 GMT' );
header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s' ) . ' GMT' );
header( 'Cache-Control: no-store, no-cache, must-revalidate' );
header( 'Cache-Control: post-check=0, pre-check=0', false );
header( 'Pragma: no-cache' );
} else {
print_r(apache_response_headers());
}

regards,
Michiel

 
malthazor

Joined: 2003-04-03
Posts: 33
Posted: Wed, 2005-07-27 15:45

I made the change and the only line I get is:

Quote:
Array ( [X-Powered-By] => PHP/4.3.4 [Transfer-Encoding] => chunked [Content-Type] => text/html; charset=UTF-8 )

 
blisswhisper

Joined: 2005-07-04
Posts: 3
Posted: Wed, 2005-07-27 15:47

I did the header replacement, and instead of the "headers already sent" messages I got this at the top of the page:

Array ( [X-Powered-By] => PHP/4.3.10 [Keep-Alive] => timeout=15, max=100 [Connection] => Keep-Alive [Transfer-Encoding] => chunked [Content-Type] => text/html; charset=UTF-8 )

I also did a complete re-install of the latest snapshot and component just to make sure it wasn't some glitch with upgrading and still have the header problem.

 
michiel_1981

Joined: 2005-05-19
Posts: 430
Posted: Wed, 2005-07-27 16:29

blisswhisper,

the only one i can think of that belongs to gallery2 and his component is " text/html charset=UTF-8"

the rest isn't set by gallery2 or his component!

strange thing, waiting for other to report.

regards,
Michiel

 
kdizzle

Joined: 2005-07-06
Posts: 27
Posted: Thu, 2005-07-28 04:22

Here is mine:

Array ( [X-Powered-By] => PHP/4.3.10 [Expires] => Thu, 19 Nov 1981 08:52:00 GMT [Cache-Control] => private [Pragma] => no-cache [Keep-Alive] => timeout=15, max=100 [Connection] => Keep-Alive [Transfer-Encoding] => chunked [Content-Type] => text/html; charset=UTF-8 )

Thanks michiel.

 
buffman

Joined: 2005-07-18
Posts: 9
Posted: Fri, 2005-07-29 16:58

I'm having the exact same problem as kdizzle.

Here is mine:

Array ( [X-Powered-By] => PHP/4.3.10 [Connection] => close [Transfer-Encoding] => chunked [Content-Type] => text/html; charset=UTF-8 )

Thanks! Let me know if I can provide any other info.

 
rfloyd

Joined: 2004-08-31
Posts: 7
Posted: Fri, 2005-07-29 18:26

Same problem here.

Array ( [X-Powered-By] => PHP/5.0.4 [Keep-Alive] => timeout=15, max=79 [Connection] => Keep-Alive [Transfer-Encoding] => chunked [Content-Type] => text/html; charset=UTF-8 )

Need anything else?

 
artemido
artemido's picture

Joined: 2005-02-08
Posts: 24
Posted: Fri, 2005-07-29 19:01

you can fix this with a simple perl command (dos2unix won't fix the problem because as opposed to having a carriage return + a line feed (the former of which would be removed by dos2unix) the scripts simply has a carriage return...). Keep in mind that _all_ of the files have this problem. (yay for someone doing their coding in notepad for mac or something!) Anyway, here's how you fix it if you're running a *ux* OS:

perl -e "s/\r/\n/g;" -pi < filename >

Fixing this will not remedy the header error (still seeing that), but it will make it easier to hack around in the code... :D

kdizzle wrote:
Okay, I looked around on mamboserver and found this thread (and a few like it).
http://forum.mamboserver.com/showthread.php?t=30691&highlight=modify+header

This basicaly says there is a blank line or space outside of the <?php........?> tags.

So I figure it isn't in the mambo directory sice I only get the errors:


Warning: Cannot modify header information - headers already sent in /srv/www/htdocs/Mambo/index.php on line 214

Warning: Cannot modify header information - headers already sent in /srv/www/htdocs/Mambo/index.php on line 215

Warning: Cannot modify header information - headers already sent in /srv/www/htdocs/Mambo/index.php on line 216

Warning: Cannot modify header information - headers already sent in /srv/www/htdocs/Mambo/index.php on line 217

Warning: Cannot modify header information - headers already sent in /srv/www/htdocs/Mambo/index.php on line 218

WHEN I use the gallery component.

I ssh in and open the component directory and find:
footer.php gallery2.php userfuncs.php version.php

I then open gallery2.php and find it appears all goobltygooked up. I see characters I have never seen using vim before. The file appears to all be on one line with no breaks at all.

So I ftp the gallery2.php file back to my home computer and open it with notepad.....same thing it appears to have no structure other than it is all on one line. Obviously the component works so it makes me think the garbeled file has a space causing the error.

Could somebody post a clan version of the gallery2.php file so I can try to use it?

Michiel let me know if I am way off and I'll stop.

 
artemido
artemido's picture

Joined: 2005-02-08
Posts: 24
Posted: Fri, 2005-07-29 19:12

same problem with the header messages, but when I add the code suggested to my mamboroot index.php, I get an error:

The XML page cannot be displayed 
Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later. 


--------------------------------------------------------------------------------

Invalid at the top level of the document. Error processing resource 'http://www.ramzvents.com/index.php?option=com_gallery2...

Array
^
 
buffman

Joined: 2005-07-18
Posts: 9
Posted: Sat, 2005-07-30 09:25

Thanks Artemido!

I was wondering about the PHP format anomalies myself. After running your perl command I was able to see it in a much more readable format. =)

I was able to fix my problems with the random image block and gallery component by simply commenting out the IF statements where the error messages stated. I'm pretty much clueless when it comes to PHP, but commenting out those lines doesnt' seem to affect the functionality.

I no longer have error messages and everything seems to be working fine. If anyone needs help or have questions what I did let me know. You can also view my 'working' Mambo/Gallery integration at http://tkeeler.webhop.net

Thanks for all your help guys!

p.s. - I wasn't getting the 'cannot modify header information' error message so I'm not sure if this will/wont work for you!

 
michiel_1981

Joined: 2005-05-19
Posts: 430
Posted: Sat, 2005-07-30 10:48

buffman,

what error where you having and what did you fix, please report this to me or post it here, so i can see if i can put it in the next version, so other can directly benefit from this,

thxs and regards,
Michiel

 
buffman

Joined: 2005-07-18
Posts: 9
Posted: Sat, 2005-07-30 17:39

Hi Michiel!

I was getting 2 different errors:

This one was on the random image block:

Notice: Use of undefined constant randomImage - assumed 'randomImage' in /srv/www/htdocs/Mambo/modules/mod_gallery_block.php on line 77

and this one I was getting when I browsed images through the gallery component:

Notice: Undefined index: id.rootAlbum in /srv/www/htdocs/Mambo/components/com_gallery2/userfuncs.php on line 401

When I didn't see a solution in this forum, I went looking through the code to see what I could do. The formatting for the files was all wierd (it looked like it was on 1 single line) so I used artemido's perl command tip to reformat the files:

perl -e "s/\r/\n/g;" -pi < filename >

This didnt' fix the problem but did let me see the code better. I started hacking around - i'm totally clueless when it comes to PHP. This is just a workaround and I wouldn't call it a fix.

Here's the code I commented out:

For the random image block error I commented this out in userfuncs.php:

//if($block == randomImage OR $block == recentImage OR $block == viewedImage OR $block == dailyImage OR $block == weeklyImage OR $block == monthlyImage OR $block == specificItem){
//$css = $itemframe;
//} else {
//$css = $albumframe;
//}

and for the gallery component I commented this out in mod_gallery.block.php:

//      if($g2_Config['id.rootAlbum'] != $item->getId()){
//              $mainframe->AppendPathway($path);
//      }

I have no clue what they do, but it didn't seem to break anything and made the error messages go away.

Maybe you could explain to us what they do and what it might break?

Thanks a million for creating these modules and components - they're great!

Let me know if you have any questions!

p.s. - How did you get the gallery2 stats module on your dev site?

 
michiel_1981

Joined: 2005-05-19
Posts: 430
Posted: Sat, 2005-07-30 20:18

Notice: Use of undefined constant randomImage - assumed 'randomImage' in /srv/www/htdocs/Mambo/modules/mod_gallery_block.php on line 77

Bug is fixed, correct code shown below!

Notice: Undefined index: id.rootAlbum in /srv/www/htdocs/Mambo/components/com_gallery2/userfuncs.php on line 401

try resaving your config, do you use a different DB for mambo and gallery2?

if($block == 'randomImage' OR $block == 'recentImage' OR $block == 'viewedImage' OR $block == 'dailyImage' OR $block == 'weeklyImage' OR $block == 'monthlyImage' OR $block == 'specificItem'){
$css = $itemframe;
} else {
$css = $albumframe;
}

is the correct code

regards,
Michiel

 
jeff260z
jeff260z's picture

Joined: 2005-07-20
Posts: 26
Posted: Sun, 2005-07-31 01:20

I get these warnings;

Warning: Cannot modify header information - headers already sent in /usr/local/psa/home/vhosts/atlanticz.ca/httpdocs/index.php on line 194

Warning: Cannot modify header information - headers already sent in /usr/local/psa/home/vhosts/atlanticz.ca/httpdocs/index.php on line 195

Warning: Cannot modify header information - headers already sent in /usr/local/psa/home/vhosts/atlanticz.ca/httpdocs/index.php on line 196

Warning: Cannot modify header information - headers already sent in /usr/local/psa/home/vhosts/atlanticz.ca/httpdocs/index.php on line 197

Warning: Cannot modify header information - headers already sent in /usr/local/psa/home/vhosts/atlanticz.ca/httpdocs/index.php on line 198

This is my system info:

Gallery version = 2.0-beta-4 core 0.9.32
PHP version = 4.3.10 apache2handler
Webserver = Apache/2.0.52 (Unix) mod_ssl/2.0.52 OpenSSL/0.9.7d mod_python/3.0.3 Python/2.2.2 FrontPage/5.0.2.2635 PHP/4.3.10 mod_webapp/1.2.0-dev
Database = mysql 4.1.7
Toolkits = Gd, Thumbnail
Operating system = FreeBSD thunder.stormweb.net 5.3-RELEASE FreeBSD 5.3-RELEASE #1: Fri Jan 28 17:48:38 UTC 2005 root@:/usr/obj/usr/src/sys/GENERIC i386
Browser = Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6

 
crusinone

Joined: 2005-07-31
Posts: 1
Posted: Sun, 2005-07-31 05:27

ok this is what i did to fix the header problem per the earlier header post move th 4 header lines 194-198 in mambo's index.php to 178 just before the other block he mentioned . This worked and resolved the error for me and so far its not having any negitive side effects on any other mambo modules/components . The only problem i am still having is with the album component, its not pointing to the base one , its pointing to one of the sub albums, i have to click on its parent to get access to the others under the mambo administrator album management component

 
jeff260z
jeff260z's picture

Joined: 2005-07-20
Posts: 26
Posted: Sun, 2005-07-31 15:50
michiel_1981 wrote:
Notice: Use of undefined constant randomImage - assumed 'randomImage' in /srv/www/htdocs/Mambo/modules/mod_gallery_block.php on line 77

Bug is fixed, correct code shown below!

Notice: Undefined index: id.rootAlbum in /srv/www/htdocs/Mambo/components/com_gallery2/userfuncs.php on line 401

try resaving your config, do you use a different DB for mambo and gallery2?

if($block == 'randomImage' OR $block == 'recentImage' OR $block == 'viewedImage' OR $block == 'dailyImage' OR $block == 'weeklyImage' OR $block == 'monthlyImage' OR $block == 'specificItem'){
$css = $itemframe;
} else {
$css = $albumframe;
}

is the correct code

regards,
Michiel

Michiel when you say bug is fixed do you mean the header problem? Also which file do I modify? Do I modify line 77 of file mod_gallery_block.php with this code Notice: Undefined index: id.rootAlbum in /srv/www/htdocs/Mambo/components/com_gallery2/userfuncs.php on line 401 ?

 
jeff260z
jeff260z's picture

Joined: 2005-07-20
Posts: 26
Posted: Sun, 2005-07-31 17:22

crusinone I moved the header lines in the mambo index.php file and the errors are gone. Things seem to work fine but what else could this potentially do? Security issues?

 
michiel_1981

Joined: 2005-05-19
Posts: 430
Posted: Sun, 2005-07-31 19:46

jeff260z,

the "Notice: Use of undefined constant randomImage " is fixed

the "id.rootAlbum " i asked you if you installed your gallery2 on a different database?

header, bug is known but i haven't found made fix yet.

regards,
Michiel

 
buffman

Joined: 2005-07-18
Posts: 9
Posted: Sun, 2005-07-31 20:30

Hi Michiel - the bug fix worked, thanks!

As far as the 'Undefined index: id.rootAlbum' error -

I resaved the config but still get that error message. Yes, I am using a different database - gallery2 and mambo - both mysql databases. Is this not allowed? Would I be better off using the same database?

michiel_1981 wrote:
Notice: Use of undefined constant randomImage - assumed 'randomImage' in /srv/www/htdocs/Mambo/modules/mod_gallery_block.php on line 77

Bug is fixed, correct code shown below!

Notice: Undefined index: id.rootAlbum in /srv/www/htdocs/Mambo/components/com_gallery2/userfuncs.php on line 401

try resaving your config, do you use a different DB for mambo and gallery2?

if($block == 'randomImage' OR $block == 'recentImage' OR $block == 'viewedImage' OR $block == 'dailyImage' OR $block == 'weeklyImage' OR $block == 'monthlyImage' OR $block == 'specificItem'){
$css = $itemframe;
} else {
$css = $albumframe;
}

is the correct code

regards,
Michiel

 
michiel_1981

Joined: 2005-05-19
Posts: 430
Posted: Mon, 2005-08-01 06:48

buffman,

i haven't fixed the 2 database install, i'm working on it.

regards,
Michiel

 
michiel_1981

Joined: 2005-05-19
Posts: 430
Posted: Mon, 2005-08-01 07:31

buffman,

in the userfuncs.php
around line 350 there is this code:

if($g2_Config['databasequel']!=1){
		$gallery2_db = new database( $g2_Config['hostname'],   $g2_Config['username'], $g2_Config['password'], $g2_Config['database'], $g2_Config['tablePrefix'] );
		$query = 'SELECT '.$g2_Config['columnPrefix'].'parameterName, '.$g2_Config['columnPrefix'].'parameterValue'
			. ' FROM '.$g2_Config['tablePrefix'].'PluginParameterMap'
			. ' WHERE '.$g2_Config['columnPrefix'].'pluginType = \'module\''
			. " AND $sql";
			$gallery2_db->setQuery( $query );
			$data = $gallery2_db->query();
	} else {
	global $database;	
		$query = 'SELECT '.$g2_Config['columnPrefix'].'parameterName, '.$g2_Config['columnPrefix'].'parameterValue'
			. ' FROM '.$g2_Config['tablePrefix'].'PluginParameterMap'
			. ' WHERE '.$g2_Config['columnPrefix'].'pluginType =\'module\''
			. " AND $sql";
			$database->setQuery( $query );
			$data = $database->query();
}

this the newest version, and includes connection for second database, replace the code with the one above and try saving again. Check if the error is gone.

regards,
Michiel

 
jhvl

Joined: 2005-08-01
Posts: 2
Posted: Mon, 2005-08-01 10:22

I have the last version of Gallery2 integrated with mambo 4.5.2 using the gallery2 component (2.06) and everything works just great.

I have added the gallery2 random image block module and it also works fine, but it creates problem with the text display in Mambo (in news or elsewhere) : all the accentuated characters (my site is in french) disappear and are replaced with question marks. If I remove the image block module everything goes back to normal.

Could not find a solution to this in the forum. Has anybody a clue about what the problem could be ?

regards
jh