Seite 1 von 1

admin_header.php on line 63

Verfasst: 18.02.2004 22:19
von Gast
hi,

kann mir jemand weiterhelfen?

habe seltsamen fehler nach add header link installation.

Code: Alles auswählen

Parse error: parse error in /home/muvera/biker.aloeverashop-online.de/admin/admin_header.php on line 63
gruß
streetdog

Verfasst: 19.02.2004 01:04
von Elvis
dan poste doch mal die Zeilen aus dr entsprechenden Datei von Zeile 50 - 70.

Verfasst: 19.02.2004 08:54
von Gast
hi elvis,

erstmal vielen dank für deine antwort.
ich glaube, da stimmt irgendetwas mit der installation nicht.

hier mal der komplette code:

Code: Alles auswählen

<?php
/***************************************************************************
 *                              admin_board.php
 *                            -------------------
 *   begin                : Thursday, Jul 12, 2001
 *   copyright            : (C) 2001 The phpBB Group
 *   email                : support@phpbb.com
 *
 *   $Id: admin_board.php,v 1.51.2.1 2002/05/12 00:47:39 psotfx Exp $
 *
 *
 ***************************************************************************/

define('IN_PHPBB', 1);

if( !empty($setmodules) )
{
	$file = basename(__FILE__);
	$module['Tools']['Add link in phpBB Header'] = "$file";
	$module['Tools']['Register'] = "http://www.dseitz.de/extra/info.php";
	return;
}

//
// Let's set the root dir for phpBB
//
$phpbb_root_path = "./../";
require($phpbb_root_path . 'extension.inc');
require('./pagestart.' . $phpEx);


function style_array()
{
	global $db;

	$sql = "SELECT template_name
		FROM " . THEMES_TABLE . "
		ORDER BY template_name";
	if ( !($result = $db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, "Couldn't query themes table", "", __LINE__, __FILE__, $sql);
	}


	while ( $row = $db->sql_fetchrow($result) )
	{
		$style_array[] = $row['template_name'];
	}
	
	return $style_array;
}


//
// This small thing checks who is accessing the page
// If it is not the main admin the script dies.
// Removing or editing this may be a big security risk.
// Don't touch it 
//
if ( $userdata['user_id'] != '2' )
{
		message_die(GENERAL_MESSAGE, 'Only the main admin is allowed to view this page !'); 
}

//
// Here we are checking if the tool has
// already been installed or not
//
$test = implode(' ' , file($phpbb_root_path . 'templates/subSilver/overall_header.tpl'));
$test = explode('<!--#-->', $test);

//
// Just our Standard Header
//
echo '<h1>Link im Header von phpBB einfügen</h1><hr>';


if ( $test['1'] != '<!--install-->') 
{
	echo 'Das Setup hat entdeckt, das das Tool noch nicht installiert ist<br />';
	echo 'Installiere...<i>';
	flush();

	$styles = style_array();

	foreach($styles as $style)
	{
		echo '<br />Installiere für Template: ' . $style;
		flush();
		$name = $phpbb_root_path . 'templates/' . $style . '/overall_header.tpl';
		$file = file($name);
		$fi = implode('', $file);

		$write = str_replace('{PRIVATE_MESSAGE_INFO}</a>&nbsp;' , '{PRIVATE_MESSAGE_INFO}</a>&nbsp;<!--#--><!--install--><!--#-->' , $fi);

		$fp = fopen($name, 'r+');
	
		fputs($fp, $write);
		fclose($fp);
		echo '<br />Installiert für ' .$style;
		flush();
		
	}
	echo '</i><br />Installation abgeschlossen<br />';
	echo '<a href="admin_header.php">Tool öffnen</a>';
	echo '<hr>';
	include('./page_footer_admin.'.$phpEx);
	
}
if ($add)
{
	$styles = style_array();
	
	$link = '&nbsp;<a href="' . $ziel . '"><img src="' . $board_config['script_path'] . $bild .'" width="13" height="13" target="' . $target . '" border="0" alt="' . $name . '" title="' . $name . '" hspace="3" align="top" />' . $name . '</a>';
	echo 'Füge ' . $link . ' hinzu<i>';
	foreach($styles as $style)
	{
		echo '<br />Erstelle Link für: ' . $style;
		flush();
		$name = $phpbb_root_path . 'templates/' . $style . '/overall_header.tpl';
		$file = file($name);
		$fi = implode('', $file);

		$write = str_replace('<!--#--><!--install--><!--#-->' , '<!--#--><!--install--><!--#-->' . $link, $fi);

		$fp = fopen($name, 'r+');
	
		fputs($fp, $write);
		fclose($fp);
		echo '<br />Link erstellt für ' .$style;
		flush();
		
	}
	echo '</i><br />Link wurde hinzugefügt<br />';
	echo '<a href="admin_header.php">Neuen Link hinzufügen</a>';
	echo '<hr>';
	include('./page_footer_admin.'.$phpEx);
}
else
{
	$template->set_filenames(array(
		'body' => 'admin/admin_header.tpl')
	);

	$tpl = style_array();
	$template->assign_vars(array(

		'TEMPLATE' => $tpl['0'])
	);

	$template->pparse('body');
}
//
// That's all folks
//
echo '<hr>';
include('./page_footer_admin.'.$phpEx);
?>
gruß
streetdog

Verfasst: 20.02.2004 10:49
von Gast
hm!!!!

hat keiner eine lösung?

gruß
streetdog

Verfasst: 20.02.2004 12:37
von Elvis
habemal in der Originalen Datei admin_board.php nbachgeschaut da steht folgendes von Zeile 60 - 73

Code: Alles auswählen

			if( !$db->sql_query($sql) )
			{
				message_die(GENERAL_ERROR, "Failed to update general configuration for $config_name", "", __LINE__, __FILE__, $sql);
			}
		}
	}

	if( isset($HTTP_POST_VARS['submit']) )
	{
		$message = $lang['Config_updated'] . "<br /><br />" . sprintf($lang['Click_return_config'], "<a href=\"" . append_sid("admin_board.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>");

		message_die(GENERAL_MESSAGE, $message);
	}
}
jetzt müssteste nurnoch gucken was Du da verändert hattest vorher/nachher, da ich nicht weis welche Mods Du eingebaut hast.

Denke mal das Du das vergessen hast

Code: Alles auswählen

		}
	}
hier drunter zusetzten

Code: Alles auswählen

if ( $userdata['user_id'] != '2' )
{
      message_die(GENERAL_MESSAGE, 'Only the main admin is allowed to view this page !');
}
also 3 Klammern am Ende

Verfasst: 20.02.2004 14:17
von Gast
funzt auch nicht!

wenn ich das tool im admin aufrufe, dann kommt diese meldung:

Das Setup hat entdeckt, das das Tool noch nicht installiert ist
Installiere...
Installiere für Template: subSilver
Warning: fopen(./../templates/subSilver/overall_header.tpl): failed to open stream: Permission denied in /home/muvera/biker.aloeverashop-online.de/admin/admin_header.php on line 96

Warning: fputs(): supplied argument is not a valid stream resource in /home/muvera/biker.aloeverashop-online.de/admin/admin_header.php on line 98

Warning: fclose(): supplied argument is not a valid stream resource in /home/muvera/biker.aloeverashop-online.de/admin/admin_header.php on line 99

Installiert für subSilver
Installation abgeschlossen
Tool öffnen

gruß streetdog

Verfasst: 20.02.2004 14:18
von Elvis
wennde das mit dem EasyModInstaller (EMI) gemacht hast, mußte die Zeile (n) von Handanpassen, oder die der Anleitung vom Mod.