Hallo liebe Forenten,
ich habe einen php-Funktions-Konflikt zwischen Wordpress und einer Komponente unter Joomla. Im Forum von Joomlaos habe ich schon mehrfach gepostet, aber keine Hilfe erhalten können. Vielleicht gibt es hier jemanden, der mir mit der php-Funktion helfen kann.
Die Joomla-Komponente (com_jcalpro), die neue Termine aus einem Kalender anzeigt, meldet folgenden Fehler:
Fatal error: Cannot redeclare load_template() (previously declared in [...]/components/com_jd-wp/wp-includes/functions.php:2076) in [...]/components/com_jcalpro/include/functions.inc.php on line 1224
Die Funktion in der functions.php sieht so aus:
function load_template($file) {
global $posts, $post, $wp_did_header, $wp_did_template_redirect, $wp_query,
$wp_rewrite, $wpdb;
extract($wp_query->query_vars);
require_once($file);
}
Die Funktion in der functions.inc.php so:
function load_template()
{
global $THEME_DIR, $CONFIG_EXT, $database, $template_header, $template_footer, $meta_content, $lang_general;
$use_extcal_db_header = false;
$use_extcal_db_footer = false;
$use_extcal_db_meta = false;
$header_content = '';
$footer_content = '';
$meta_content = '';
/* // retrieve template data from db
$query = "SELECT * FROM ".$CONFIG_EXT['TABLE_TEMPLATES'];
$result = extcal_db_query($query);
while ($row = extcal_db_fetch_array($result))
{
switch($row['template_type']) {
case "header":
$use_extcal_db_header = $row['template_status']?true:false;
$header_content = $row['template_value'];
break;
case "footer":
$use_extcal_db_footer = $row['template_status']?true:false;
$footer_content = $row['template_value'];
break;
case "meta":
if($row['template_status']) $meta_content = $row['template_value'];
break;
default:
}
} */
$database->setQuery( "SELECT name FROM #__jcalpro_themes WHERE published= '1'" );
$themeName = $database->loadResult();
$CONFIG_EXT['theme'] = $themeName;
if ( !file_exists($CONFIG_EXT['FS_PATH']."themes/{$CONFIG_EXT['theme']}/theme.php" ) )
{
$CONFIG_EXT['theme'] = 'default';
}
if (file_exists($CONFIG_EXT['FS_PATH']."themes/".$CONFIG_EXT['theme']."/" . TEMPLATE_FILE)) {
$template_file = $CONFIG_EXT['FS_PATH']."themes/".$CONFIG_EXT['theme']."/" . TEMPLATE_FILE;
} else die("<b>JCAL Pro critical error</b>:<br />Unable to load template file ".TEMPLATE_FILE."!</b>");
$template = fread(fopen($template_file, 'r'), filesize($template_file));
// Header processing
if($use_extcal_db_header) {
$cal_pos = strpos($template, "<body ");
$template_header = substr($template, 0, $cal_pos);
$template_header .= html_decode($header_content);
} else {
$cal_pos = strpos($template, "{CONTENT}");
$template_header = substr($template, 0, $cal_pos);
}
$signature = '<a href="http://dev.anything-digital.com/" target="_blank">JCal Pro Calendar <span style="color:orange"> ' . CALENDAR_VERSION . '</span></a>';
if(strpos(" ".$lang_general['signature'],"%s"))
$signature = sprintf($lang_general['signature'], $signature);
else
$signature = $lang_general['signature'] . " " . $signature;
$add_signature = '<div class="atomic" style="color:#CCCCCC;">'.$signature.'</div><br />';
// Footer processing
if($use_extcal_db_footer) {
$template_footer = $add_signature.html_decode($footer_content);
} else {
$cal_pos = strpos($template, "{CONTENT}");
$template = str_replace("{CONTENT}", $add_signature ,$template);
$template_footer = substr($template, $cal_pos);
}
$add_version_info = '<!--ExtCalendar '.$CONFIG_EXT['release_name'].'--></body>';
$template_footer = ereg_replace("</body[^>]*>",$add_version_info,$template_footer);
}
Alles anzeigen
Offensichtlich gibt es einen Konflikt mit diesen beiden Funktionen, ich bin aber kein php-Experte (eigentlich nicht mal Laie), vielleicht kann mir jemand weiterhelfen?
Danke!