For me to post here with a problem - means that im desperate! Im getting firstly redeclare errors for google tap,
Code:
Fatal error: Cannot redeclare replace_for_mod_rewrite() (previously declared in /usr/home/*******/public_html/header.php:44) in /usr/home/*******/public_html/header.php on line 44
- this is because the googletap start is in my header, so i copied and renamed header.php to header2.php removing the google tap start stuff. Subsequently im getting header redeclare header errors. If I try and remove the head() I get all kinds of other errors, if i move the theme stuff i get table errors OK im going to post the ORIGINAL header.
Code:
<?php
/************************************************************************/
/* PHP-NUKE: Advanced Content Management System */
/* ============================================ */
/* */
/* Copyright (c) 2002 by Francisco Burzi */
/* http://phpnuke.org */
/* */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License. */
/************************************************************************/
if (eregi("header.php",$_SERVER['PHP_SELF'])) {
Header("Location: index.php");
die();
}
#Start of Google Tap Header
global $nextgen_name, $prefix, $db;
// Google Tap On or Off, 1=On, 0=Off
$next_gen_ob = 1;
//Used for main module or a module without a name
if ($nextgen_name == "") {
$sql = "SELECT main_module FROM ".$prefix."_main";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$mainmod_name = $row[main_module];
$nextgen_name = $mainmod_name;
}
//Make the path to the GT-NExtGEn Files
$nextgen_path = "GoogleTap/GT-".$nextgen_name.".php";
if ($next_gen_ob == 1) {
if (file_exists($nextgen_path)) {
ob_start();
} else {
$next_gen_ob = 0;
}
}
function replace_for_mod_rewrite(&$s, $nextgen_path) {
//Check to see if file exists before continuing
if (file_exists($nextgen_path)) {
include($nextgen_path);
}
$s = preg_replace($urlin, $urlout, $s);
return $s;
} #End of Google Tap Header
require_once("mainfile.php");
##################################################
# Include some common header for HTML generation #
##################################################
$header = 1;
function head() {
global $slogan, $sitename, $banners, $nukeurl, $Version_Num, $artpage, $topic, $hlpfile, $user, $hr, $theme, $cookie, $bgcolor1, $bgcolor2, $bgcolor3, $bgcolor4, $textcolor1, $textcolor2, $forumpage, $adminpage, $userpage, $pagetitle;
$ThemeSel = get_theme();
include("themes/$ThemeSel/theme.php");
include("includes/blocker.php");
echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n";
echo "<html>\n";
echo "<head>\n";
#echo "<title>$sitename $pagetitle</title>\n";
include("includes/dynamic_titles.php");
#include("includes/blocker.php");
include("includes/meta.php");
include("includes/javascript.php");
if (file_exists("themes/$ThemeSel/images/favicon.ico")) {
echo "<link REL=\"shortcut icon\" HREF=\"themes/$ThemeSel/images/favicon.ico\" TYPE=\"image/x-icon\">\n";
}
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright (c) 2003 osCommerce
Released under the GNU General Public License
*/
if (!eregi("modules.php", $_SERVER['PHP_SELF'])) { die ("You can't access this file directly..."); } $index = 1;
include("header.php");
require('config.php');
As you can probably tell this is a very large Tell a friend modification to send an email to the admin from the user to ask a question about a product.
ANY help would be hugely appreciated to: 1. Remove Googletap error (this goes away if i remove from header) 2. Remove header redeclare error (ive tried changing include header to require_once but that didnt improve things).
Richard
Last edited by Rikk03 on Sun Apr 11, 2004 2:21 am; edited 1 time in total
No, - short urls are deactivated, - thanks for the response - one more thing checked and removed from the equation.
Code:
Fatal error: Cannot redeclare replace_for_mod_rewrite() (previously declared in /usr/home/*******/public_html/header.php:44) in /usr/home/*******/public_html/header.php on line 44
The replace for mod_rewrite error occurs whether google tap is active or not. When active it works for the whole shopping cart - complete google tap.
The other file ask_a_question.php is a file ive added to my catelog that pulls the product information from the database and put it in an email to the site admin, and the user can ask a question. The error arises with the email form - although it works fine. If i create a second header.php - renamed removing the google tap start then the error goes away, but then i get a cannot redeclare header error.
I guess im trying to figure out the best way to fix all the errors arising - i cant figure out - if i try and get rid of the header error then i get a table error ...........I just cant win.
I don't understand why you get the cannot redeclare header when using the header2.php file in ask_a_question.php it seems as though something is calling the standard header.php still? Or at least the header();
I just haven't used GT2 at all.
Is header.php fired by some other piece of GT2 ?
I'd be tempted to put a @ in front of the line and see if it will work when ignoring errors.
@replace_for_mod_rewrite()
Not that this is a real answer because header() must be being called into play someplace.
View next topic View previous topic
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum