Page 1 of 1

G2 Mod Fehlermeldung

Posted: Wed Jan 24, 2007 2:00 pm
by tholler
Hallo,
nachdem endlich alles läuft, bekomme ich jetzt noch eine FM beim Einsatz von G2 Mod.

Code: Select all

Fatal error: Undefined class name 'loggermanager' in /homepages/12/d69262032/htdocs/modules/G2Mod/G2Mod.module.php on line 194
Das auskommentieren der Zeile bringt in der Folgezeile direkt die nächste FM.

CMSMS: 1.0.4 (aktuell)
G2 Mod: 0.1

Die anderen Tips im Forum beruhen immer nur auf Version 0.xx. Ich glaube nicht, dass es mit 1.0.4 funktioniert.

G2 ist in ein Unterverzeichnis gallery2 installiert und läuft.

Bitte dringend um Hilfe.

Ach ja: System von 1&1

Re: G2 Mod Fehlermeldung

Posted: Wed Jan 24, 2007 3:31 pm
by cyberman
Kann ich so nicht bestätigen. Mit meiner Anleitung

http://forum.cmsmadesimple.org/index.ph ... l#msg27687

hab ich es in einer CMS 1.04 installiert bekommen. Es stimmen zwar ein paar Pfade noch nicht, aber grundsätzlich bekomme ich keine Fehlermeldung.

PS: Meine Gallery2-Version schien mit der neuesten AdoDB-Version nicht zurecht zu kommen, du solltest daher die aus dem /lib-Verzeichnis von Gallery2 verwenden ...

[gelöscht durch Administrator]

Re: G2 Mod Fehlermeldung

Posted: Wed Jan 24, 2007 9:48 pm
by tholler
Hallo,
so langsam bin ich am Rande eines Nervenzusammenbruchs; wieso funktioniert es bei Dir und bei mir nicht.

Die Anleitung habe ich Schritt für Schritt befolgt; der Erfolg: Sobald ich das G2mod aktiviere, kommt auf der CMSMS-Startseite die selbe Fehlermeldung wie bei Aufrug des G2Mod im Admin. Es bleibt auch immer bei der selben FM.

EInen verzweifelten Gruß

:-\ :-\ :-\

Re: G2 Mod Fehlermeldung

Posted: Thu Jan 25, 2007 8:53 am
by cyberman
Mea culpa, mea culpa, mea maxima culpa  ...

Irgendwie hat eine gehackte/modifizierte Version von G2mod den Weg auf meine Platte gefunden und ich hab das Modul nur aus meiner 0.13er Version kopiert ;D.

Da auf der Projektseite die Möglichkeit zur Übersendung von Patches deaktiviert ist und das Forum seit dem Update scheinbar die Textanhänge zerstört, poste ich hier einfach mal den kompletten Code:

Code: Select all

<?php

/**
 * CMS Made Simple module for integrating Gallery 2
 * modified for use with CMSms 1.0.x by someone from forum
 * 
 * This code is licensed under the GPL
 * 
 * @author Alexander Bierbrauer
 * @version 0.1a
 *
 */
class G2Mod extends CMSModule
{
	var $g2data;
	
	function GetName()
	{
		return 'G2Mod';
	}

	function GetFriendlyName()
	{
		return 'G2Mod';
	}

	function IsPluginModule()
	{
		return true;
	}

	function HasAdmin()
	{
		return true;
	}

	function GetVersion()
	{
		return '0.1';
	}
	
	function GetAuthor()
	{
		return 'Alexander Bierbrauer';
	}

	function GetAuthorEmail()
	{
		return 'abierbrauer@gmx.org';
	}

	function GetAdminDescription()
	{
		return 'Gallery 2 CMS module';
	}
	
	function VisibleToAdminUser()
	{
		return true;
	}

	function SetParameters()
	{/*
		$this->CreateParameter('sortasc', 'true', $this->lang('helpsortasc'));
		$this->CreateParameter('sortby', 'news_date', $this->lang('helpsortby'));
		$this->CreateParameter('detailtemplate', 'sometemplate.tpl', $this->lang('helpdetailtemplate'));
		$this->CreateParameter('summarytemplate', 'sometemplate.tpl', $this->lang('helpsummarytemplate'));
		$this->CreateParameter('moretext', 'more...', $this->lang('helpmoretext'));
		$this->CreateParameter('category', 'category', $this->lang('helpcategory'));
		$this->CreateParameter('makerssbutton', 'true', $this->lang('helpmakerssbutton'));
		$this->CreateParameter('dateformat', '%b %d, %Y', $this->lang('helpdateformat'));
		$this->CreateParameter('number', '5', $this->lang('helpnumber'));
		$this->mCachable = false;*/
	}
	
	function openGallery2($page)
	{
		require_once(dirname(__FILE__) . $this->GetPreference('g2_embed_php'));
		
		$g2_relative = $this->GetPreference('g2_relative'); // '/../../../gallery2/'
		$g2_embedding = $this->GetPreference('g2_embedding'); // '/cms'
		
		// $log =& LoggerManager::getLogger('G2Mod.module.php');
		// $log->debug('openGallery2');
		
		$ret = GalleryEmbed::init(array('embedUri' => 'index.php?page='.$page, embedPath => $g2_embedding, 'relativeG2Path' => $g2_relative,
           								'loginRedirect' => null, 'activeUserId' => null));
		if($ret->isError())
		{
			$ret->getAsHtml();
			exit;
  		}

		$g2data = GalleryEmbed::handleRequest();
		if($g2data['isDone'])
		{
			// exit; // G2 has already sent output (redirect or binary data)
		}

  		// Use $g2data['headHtml'] and $g2data['bodyHtml']
  		// to display G2 content inside embedding application
  		// if you don't want to use $g2data['headHtml'] directly, you can get the css,
  		// javascript and page title separately by calling...
  		$this->g2data= $g2data;
  		
  		return true;
	}

	function Install()
	{
		// default paths if gallery 2 is the cms directory
		// /cms/gallery/...
		$this->SetPreference('g2_relative', '/../../gallery2');
		$this->SetPreference('g2_embedding', '');
		$this->SetPreference('g2_embed_php', '/../../gallery2/embed.php'); // '/../../../gallery2/embed.php'
	}

	function InstallPostMessage()
	{
		return $this->Lang('installation succesful');
	}

	function Upgrade($oldversion, $newversion)
	{
	}

	function Uninstall()
	{
		$this->RemovePreference('g2_relative');
		$this->RemovePreference('g2_embedding');
		$this->RemovePreference('g2_embed_php');
	}
	
	function showGallery()
	{ 
        if(isset($this->g2data))
			{
            if (isset($this->g2data['headHtml'])) {
                list($title, $css, $javascript) = GalleryEmbed::parseHead($this->g2data['headHtml']);
                print $css[0];
            }
            print $this->g2data['bodyHtml'];
			}
			elseif($this->openGallery2($this->cms->variables['page_id']))
         {
            if (isset($this->g2data['headHtml'])) {
                list($title, $css, $javascript) = GalleryEmbed::parseHead($this->g2data['headHtml']);
                print $css[0];
            }
            print $this->g2data['bodyHtml'];
			}
	}
	
	function showAdminSection(&$id)
	{
		#The tabs
		print $this->StartTabHeaders();
		print $this->SetTabHeader("paths","Gallery2 path settings");
		print $this->EndTabHeaders();
		
		#The content of the tabs
		print $this->StartTabContent();
		print $this->StartTab("paths");
		
		print $this->CreateFormStart($id, 'admin_updatepaths');
			print '<table';
			print '<tr><td>relative path:</td><td>'.$this->CreateInputText($id,'g2_relative',$this->GetPreference('g2_relative'),50).'</td></tr>';
			print '<tr><td>embedding path:</td><td>'.$this->CreateInputText($id,'g2_embedding',$this->GetPreference('g2_embedding'),50).'</td></tr>';
			print '<tr><td>relative path to embed.php:</td><td>'.$this->CreateInputText($id,'g2_embed_php',$this->GetPreference('g2_embed_php'),50).'</td></tr>';
			print '<tr><td colspan=2></td></tr>';
			print '<tr><td colspan=2>'.$this->CreateInputSubmit($id, 'submitbutton', 'OK').'</td></tr>';
			print '</table>';
		print $this->CreateFormEnd();
		print $this->EndTab();
	}
	
	function adminUpdatePaths(&$id,&$params)
	{
		$this->SetPreference('g2_relative', $params['g2_relative']);
		$this->SetPreference('g2_embedding', $params['g2_embedding']);
		$this->SetPreference('g2_embed_php', $params['g2_embed_php']);
		
		$this->showAdminSection($id);
	}

	function DoAction($action, $id, $params, $returnid = -1)
	{
		// $log =& LoggerManager::getLogger('G2Mod.module.php');
		// $log->debug('Starting DoAction');

		$db = $this->cms->db;
		switch ($action)
		{
			case "default":
			 	$this->showGallery();
				break;
			case 'defaultadmin':
				$this->showAdminSection($id);
				break;
			case 'admin_updatepaths':
				$this->adminUpdatePaths($id,$params);
				break;
		}
	}

    function FriendlyName()
	{
		return 'G2Mod';
	}

	function ModuleName()
	{
		return 'G2Mod';
	}

	function IsDefaultPossible()
	{
		return TRUE;
	}

	function GetChangeLog()
	{
		
	print '
		<ul>
		<li>
		<p>Version: 0.1</p>		
		<p>first offical release including administration for gallery 2 paths</p>
		</li>
		';
	}
	
	function GetHelp($lang='en_US')
	{
		return '
		<ul>
		<li>install Gallery 2 into your cms directory, e.g.: /cms/gallery2 and set it up</li>
		<li>install this module</li>
		<li>place the module tag in a page you want and are you are done !</li>
		<li>if you installed gallery 2 in another path, then you will have to change the paths in the module\'s admin section</li>
		<li>there\'s no need to edit files !</li>
		</ul>
		';
	}
}

?>
Der Code wurde nur so geändert, damit es funktioniert - die vorhandenen Dubletten habe ich nicht entfernt.

Re: G2 Mod Fehlermeldung

Posted: Mon Aug 06, 2007 5:57 am
by 47er
Hallo Cyberman, habe mir von beiden Programmen (CMSMS und G2) die aktuelle Version installiert, beide funktionieren. Nun ja, wie gehts jetzt weiter, habe diverse Dinge ausprobiert zur EInbindung, nichts klappt  :-[

thx