fAlbum Wordpress Problem

V

VersatileMind

unregistriert
Thread Starter
Dabei seit
30.08.2006
Beiträge
172
Reaktionspunkte
2
Hi Userschaft,

ich benutze seit einigen Monaten WordPress v2.0.4 um mein privates Weblog zu betreiben. Im Prinzip funktioniert alles ganz gut.

Seit Samstag versuche ich ein PlugIn namens fAlbum in meine WebSite zu integrieren. Das ist ein PlugIn, das automatisch Fotoalben von FlickR sucht und sie auf der eigenen Website präsentiert.

Für die Integration des PlugIns habe ich mir ein TestBlog eingerichtet. Falls was schief geht, soll dies nicht den HauptBlog betreffen. Wenn ihr im TestBlog auf Gallerie klickt, seht ihr schon, dass das PlugIn installiert ist, und die Alben bereits angezeigt werden.

Der Fehler, den ich mir absolut nicht erklären kann, tritt auf, wenn man auf eines dieser Alben klickt, um sich die Bilder darin anzusehen.

Code:
Fatal error: Call to undefined function get_option() in /wp-content/plugins/falbum/wp/FAlbum_WP.class.php on line 39

Ich weiß nicht, wieso diese Meldung erscheint. Ich habe jede PlugIn-Version >0.6 ausrpobiert. Seit Sonntag suche ich in jedem deutsch- und englischsprachigen Forum nach einer Lösung. Ohne Erfolg. Vielleicht weiß ja hier jemand, was die Meldung bedeutet, oder sagar, was man dagegen tun kann.


Vielen Dank schon einmal für eure Mühen.
 
Zuletzt bearbeitet:
Hört sich nach einer nicht inkludierten Funktionsbibliothek an. Kannst Du mal nachsehen, wo die Funktion definiert wurde und überprüfen, ob diese PHP Datei per include(); eingebunden wurde?

2nd
 
Hier ein Auszug aus der in der Meldung genannten Falbum_WP.class.php

Zeile 24 bis 140 .... die benannte Zeile 39 habe ich fett hervorgehoben. Ich hoffe das hilft.


Code:
require_once (dirname(__FILE__).'/../FAlbum.class.php');

class FAlbum_WP extends FAlbum {

	function FAlbum_WP() {
		parent :: FAlbum();		
		
		// Setup localization 
		include_once (ABSPATH.'wp-includes/streams.php');
		include_once (ABSPATH.'wp-includes/gettext.php');
		load_plugin_textdomain(FALBUM_DOMAIN);				
		
	}

	function get_options() {
		[B]$falbum_options = get_option('falbum_options');[/B]
		return $falbum_options;
	}

	/* Gets info from Cache Table */
	function _get_cached_data($key, $cache_option = FALBUM_CACHE_EXPIRE_SHORT) {
		$data = null;

		if ($cache_option != FALBUM_REFRESH_CACHE || $cache_option != FALBUM_DO_NOT_CACHE) {

			global $wpdb, $table_prefix;

			$table = $table_prefix.'falbum_cache';

			$expired = null;

			if ($this->show_private == 'true') {
				$key .= '-private';
			}

			if ($this->can_edit == 'true') {
				$key .= '-edit';
			}

			//get existing data from db
			$output = $wpdb->get_row("SELECT data, (UNIX_TIMESTAMP(expires) - UNIX_TIMESTAMP()) expires FROM ".$table." WHERE ID='".md5($key)."'");
			if (isset ($output)) {
				$data = unserialize($output->data);
				$expires_value = $output->expires;
				if ($expires_value < 0) {
					$data = null;
				}
			}

			$this->logger->debug('cache get - key - '.$key.'<br />'.'cache - '. (isset ($data) ? 'hit' : 'miss'));

		}

		return $data;
	}

	/* Function to store the data in the cache table */
	function _set_cached_data($key, $data, $cache_option = FALBUM_CACHE_EXPIRE_SHORT) {
		global $wpdb, $table_prefix;

		$table = $table_prefix.'falbum_cache';

		if ($this->show_private == 'true') {
			$key .= '-private';
		}

		if ($this->can_edit == 'true') {
			$key .= '-edit';
		}

		$this->logger->debug('cache set - key - '.$key);

		$wpdb->query("REPLACE INTO $table SET ID='".md5($key)."', data='".addslashes(serialize($data))."', expires=DATE_ADD(NOW(), INTERVAL $cache_option SECOND)");
	}

	function _clear_cached_data() {
		global $wpdb, $table_prefix;
		$fa_table = $table_prefix."falbum_cache";
		$wpdb->query("DELETE from ".$fa_table."");
	}

	/* Outputs a true or false variable for showing private photos based on the registered user level */
	function _show_private() {

		$PrivateAlbumChoice = false;
		if (strtolower($this->options['show_private']) == 'true') {
			global $user_level;

			$u_level = $user_level;
			if (!isset ($u_level)) {
				$u_level = 0;
			}

			if ($u_level >= $this->options['view_private_level']) {
				$PrivateAlbumChoice = true;
			}
		}

		return $PrivateAlbumChoice;
	}

	function _can_edit() {
		global $user_level;
		$can_edit = false;

		$u_level = $user_level;
		if (!isset ($u_level)) {
			$u_level = 0;
		}

		if ($u_level >= $this->options['can_edit_level']) {
			$can_edit = true;
		}

		return $can_edit;
	}

}

Die Funktion wird über ein Template (falbum.php) im THeme-Verzeichnis inkludiert ....
 
Ich meine mich zu erinnern, da auch was geändert zu haben, bevor es hier lief.

Schau mal, ob es in FAlbum.class.php (liegt eine Ebene höher als FAlbum_WP.class.php) eine Funktion get_option() gibt, oder ob die _get_option heißt.

Matt
 
Ja, gibt es zwei mal ... habs dick hervorgehoben

Auszug 1: Zeile 37 bis 68

class FAlbum {

var $options = none;

var $can_edit;
var $show_private;

var $has_error;
var $error_detail;

var $logger;

function FAlbum() {

require_once FALBUM_PATH.'/lib/Log.php';

$this->has_error = false;
$this->error_detail = null;

$this->options = $this->get_options();

$this->can_edit = $this->_can_edit();
$this->show_private = $this->_show_private();

if ($this->can_edit == true) {
$conf = array ('title' => 'FAlbum Log Output');
//$this->logger = & Log :: factory('fwin', 'LogWindow', '', $conf);
//$this->logger = & Log :: factory('display', 'LogWindow', '', $conf);
$this->logger = & Log :: factory('null', 'LogWindow');
} else {
$this->logger = & Log :: factory('null', 'LogWindow');
}

Auszug 2: Zeile 1363 bis 1386

Code:
		if (!is_null($photo)) {
			if (!isset ($xpath)) {
				return;
			}
			$photo = $this->_get_photo_id($xpath, $photo);
			//$this->logger->debug("photo-$photo");
			$photo_title = $xpath->getData("//photo[@id='$photo']/@title");
		}

		$title = __(Photos, FALBUM_DOMAIN);
		if (isset ($album_title)) {
			$title .= '&nbsp;'.$sep.'&nbsp;'.$album_title;
		}
		if (isset ($photo_title)) {
			$title .= '&nbsp;'.$sep.'&nbsp;'.$photo_title;
		}

		return $title;
	}

[B]	function get_options() {[/B]
		$falbum_options = array ();
		return $falbum_options;
	}

Hoffe, dass das einem von euch etwas sagt :rolleyes:
 
Werds im schlimmsten Fall alles runter schmeißen und ein anderes PlugIn versuchen. Ist nur schade, da Falbum wohl das optisch schönste sein soll ... Danke nochmal.
 
Zurück
Oben Unten