Gallery & Geeklog Problems: Wrapper Issues?

rkgermano

Joined: 2004-12-31
Posts: 2
Posted: Fri, 2004-12-31 06:09

I have searched the forums and read the documentation and this seems to be a new problem without a resolution that I can find. I am experiencing a problem with partial intergration of Geeklog 1.3.10 and Gallery 1.4.4 p14. I am experiencing a problem with the look and feel of the site and Geeklog is not wrapping completely around Gallery. As of right now, I can only get the bottom of Geeklog to wrap around gallery. Geeklog is passing the security back to Gallery and allowing Geeklog users that are logged in, to properly access and edit their photos in Gallery. I spent the last two days troubleshooting the issue without much luck. I installed Geeklog 1.3.10 first as a fresh install followed by a new install of Gallery 1.4.4. I followed the wizard in Gallery and setup Gallery to be embedded in Geeklog during Gallery's configuration process. No probelms with the install. Gallery and Geeklog are working great seperately. I saw some forum posts about issues with the Gallery wrapper.header, wrapper.header.default, wrapper.footer, wrapper.footer.default and a recommendation to delete these files to fix the problem. This did not help (got an error about missing files), but I did notice that 'GeekLog' in the wrapper.footer and wrapper.footer.default where two differenet alpha cases (GeekLog and geeklog). I changed this to match and the Geeklog footer now appears correctly. I tried the samething with the Header files, but no luck. I am stumped and looking for help. I have a feeling it has something to do wrapper.header files, but my coding skills are limited and am hacking along. I am posting my Gallery header and footer files out here for review. Any suggestion are appreciated. Thanks

wrapper.header


global $GALLERY_EMBEDDED_INSIDE;

if ($GALLERY_EMBEDDED_INSIDE == 'GeekLog) {
	/* Display header and left blocks */
	COM_siteHeader();
}

?>

wrapper.header.default

// $Id: wrapper.header.default,v 1.20 2004/03/31 21:11:43 jenst Exp $
// This header file detects whether Gallery is embedded in any 
// known PHP applications and then decorates Gallery appropriately.

global $GALLERY_EMBEDDED_INSIDE;
global $GALLERY_EMBEDDED_INSIDE_TYPE;

if(isset($GALLERY_EMBEDDED_INSIDE)) {
	global $PHP_SELF;

	if (
		($GALLERY_EMBEDDED_INSIDE_TYPE == 'postnuke' && !defined("LOADED_AS_MODULE")) ||
		($GALLERY_EMBEDDED_INSIDE_TYPE == 'phpnuke' && !eregi("modules.php", $PHP_SELF)) ||
		($GALLERY_EMBEDDED_INSIDE_TYPE == 'nsnnuke' && !eregi("modules.php", $PHP_SELF)) ||
		($GALLERY_EMBEDDED_INSIDE_TYPE == 'phpBB2' && !defined("LOADED_AS_MODULE"))
	) {
			die ("You can't access this file directly...");
	}

	switch ($GALLERY_EMBEDDED_INSIDE_TYPE) {

	case 'phpnuke':
	case 'postnuke':

		/*
		 * Nuke owns the  tag and doesn't share.  So, if we want to get our
		 * style sheet in place we've got to intercept Nuke's header and modify it 
		 * to insert a few lines of our own in place.  We could speed this process 
		 * up greatly if we cached the results and saved it somewhere handy (like
		 * the session) but then we'd be vulnerable to attack by somebody who has
		 * write permissions in the directory that the session files live.  They
		 * could create a bogus session file, set that ID into their cookie and 
		 * then pass their own code into our eval() below.
		 */
		$header = "";
		if ($fd = fopen("header.php", "r")) {
			while (!feof($fd)) {
				$line = fgets($fd, 1024);
				$line = str_replace('
				$line = str_replace(' ?>', '', $line);
				$header .= $line;
				if (strstr($line, "
					$links = getStyleSheetLink();
					$links = str_replace('"', '"', $links);
					$header .= 'echo "' . $links . 'n";' . "n";
				}
			}
		}

		/*
		 * We can control whether we see the right side blocks
		 * by setting the value of the $index variable.  To
		 * see the blocks, set $index to 1.  To hide them set
		 * $index to 0.  We default to 0 to leave more room for
		 * the photos.  If you change this value, you should
		 * also change it in wrapper.footer
		 *
		 * Note that we save the current value of $index in
		 * $tmp_index and restore it when we're done.  If we
		 * don't do this, navigation won't work!
		 */
		global $index;
		$tmp_index = $index;
		$index = 0;

		eval($header);

		OpenTable();

		$index = $tmp_index;
	break;

	case 'phpBB2':
		/*
		 * PhpBB2 uses a templating system and also owns the HEAD tags. The 
		 * easiest way at the moment to tackle this issue is therefore to 
		 * simply make sure we don't call this function if phpBB2 is being used
		 * and put the style sheet link into the template manually
		 */
		
		global $phpbb_root_path;
		global $template;
		global $db;
		global $theme, $lang, $images;
		global $board_config;
		global $phpEx;
		global $userdata, $u_login_logout;
		global $s_privmsg_new, $s_last_visit;
		global $l_privmsgs_text_unread, $l_privmsgs_text, $l_online_users;
		global $page_title, $nav_links_html;
			
		// Sort out the page title
		$page_title .= $gallery->app->galleryTitle;

		// Verify that the $phpbb_root_path isn't overwritten with a remote exploit
		if (!realpath($phpbb_root_path)) {
                	print _("Security violation") ."n";
			exit;
		} else {
			if (! defined("PHPBB_ROOT_PATH")) {
				define("PHPBB_ROOT_PATH", $phpbb_root_path);
			}
			include (PHPBB_ROOT_PATH . "includes/page_header.php");
		}
	break;

	case 'GeekLog':
		/* 
		** Display header and left blocks 
		*/
		echo COM_siteHeader( );
	break;

	}
}
?>
wrapper.footer


global $GALLERY_EMBEDDED_INSIDE;

if ($GALLERY_EMBEDDED_INSIDE == 'GeekLog') {
    	/*
    	 * We can control whether we see the right side blocks
    	 * by setting passing a parameter to COM_siteFooter.
    	 * To see the blocks, pass true; to hide them pass false.
    	 */

	echo COM_siteFooter( false );
}

?>
wrapper.footer.default

// $Id: wrapper.footer.default,v 1.11 2004/03/21 16:51:32 jenst Exp $
// This header file detects whether Gallery is embedded in any 
// known PHP applications and then decorates Gallery appropriately.

global $GALLERY_EMBEDDED_INSIDE_TYPE;

switch($GALLERY_EMBEDDED_INSIDE_TYPE) {
	case 'phpnuke':
	case 'postnuke':

		/*
		 * We can control whether we see the right side blocks
		 * by setting the value of the $index variable.  To
		 * see the blocks, set $index to 1.  To hide them set
		 * $index to 0.  We default to 0 to leave more room for
		 * the photos.  If you change this value, you should
		 * also change it in wrapper.header
		 */
		global $index;
		$index = 0;

		CloseTable();
		include('footer.php');
	break;

	case 'phpBB2':
		/*
		** PhpBB2 doesn't require the OpenTable() function or any of the
		** other functions that are native to Nuke.
		*/

		global $phpbb_root_path;
		global $userdata;
		global $phpEx;
		global $gen_simple_header;
		global $template;
		global $board_config;
		global $db;
		global $do_gzip_compress;
		global $lang;
		
		include (PHPBB_ROOT_PATH . "includes/page_tail.php");
	break;

	case 'GeekLog':
	
	/*
	** We can control whether we see the right side blocks
	** by setting passing a parameter to COM_siteFooter.
	** To see the blocks, pass true; to hide them pass false.
	*/

		echo COM_siteFooter( false );
	break;

}
?>
 
signe
signe's picture

Joined: 2003-07-27
Posts: 2322
Posted: Fri, 2004-12-31 06:32

You should get rid of the wrapper.header and wrapper.footer.

The .default files contain the code you need - the non .default files are only for changes that you made for your own site.

There's a typo in the wrapper.header file. 'Geeklog ... notice the missing ' at the end.

 
rkgermano

Joined: 2004-12-31
Posts: 2
Posted: Fri, 2004-12-31 07:05

Removing the non .default files worked! Thank you very much. I also checked the missing ' at the end. It was in my code on the site, but I must have messed it up when I put it out in the post. Regardless, it took me deleting both the non-default files for it to work correctly. Thank you very much!

Rich