I replaced the global.php file with the one from the PowerGallery update & now the error is gone. I would still like to know what happened & why the gallery just stopped working & that error came up. Nothing was changed. Is there a bug in this software? Here's a copy of the entire global.php that had the error. Please advise.
<?php
require_once(realpath($abs_prefix . '../') . '/Connections/powergallery.php');
mysql_select_db($database_powergallery);
$GLOBALS['wa_settings'] = array();
$result = mysql_query('SELECT * FROM wa_settings');
while($row = mysql_fetch_assoc($result)) {
$GLOBALS['wa_settings'][$row['name']] = $row['value'];
}
#####
$pg_config = array(
'path' => $GLOBALS['wa_settings']['pg_root'],
'html_prefix' => $GLOBALS['wa_settings']['pg_root'] . substr($abs_file, strpos($abs_file, '/galleries/') + 1) . '/'
);
#####
if(!function_exists('get_gallery')) {
function get_gallery($url) {
global $abs_prefix, $pg_config;
$gallery = array(
'title' => '',
'images' => array()
);
//load using url (requires fopen wrapper support)
$sxe = @simplexml_load_file($url);
//failed (likely due to no fopen wrapper support)
//try loading via include file and XML string
if(!$sxe) {
ob_start();
$connections_prefix = realpath($abs_prefix . '../') + '/';
$args = substr($url, strpos($url, '?') + 1);
$args_array = explode('&', $args);
foreach($args_array as $arg) {
$arg_array = explode('=', $arg);
$_GET[$arg_array[0]] = $arg_array[1];
}
$_SERVER['PHP_SELF'] = $pg_config['path'] . 'fakey.php';
$no_xml_header = true;
include(realpath($abs_prefix . '../mediarss.php'));
$sxe = simplexml_load_string(ob_get_contents());
ob_end_clean();
}
if($sxe) {
//gallery info
$gallery['title'] = $sxe->channel->title;
//images
$images = array();
foreach($sxe->channel->item as $item) {
$media = $item->children('http://search.yahoo.com/mrss/');
$thumbnail = $media->thumbnail->attributes();
$full = $media->content->attributes();
$supersize = $media->supersize ? $media->supersize->attributes() : false;
$images[] = array(
'title' => htmlspecialchars(strval($media->title)),
'description' => htmlspecialchars(strval($media->description)),
'thumb' => array('url' => strval($thumbnail['url']), 'width' => strval($thumbnail['width']), 'height' => strval($thumbnail['height'])),
'fullsize' => array('url' => strval($full['url']), 'width' => strval($full['width']), 'height' => strval($full['height'])),
'supersize' => empty($supersize) ? array() : array('url' => strval($supersize['url']), 'width' => strval($supersize['width']), 'height' => strval($supersize['height']))
);
}
$gallery['images'] = $images;
}
return $gallery;
}
}
if(!function_exists('get_mediarss_url')) {
function get_mediarss_url($args) {
return $GLOBALS['wa_settings']['pg_rooturl'] . 'mediarss.php?' . $args;
}
}
?>