Seite 1 von 1

was ist daran falsch?

Verfasst: 21.04.2004 21:37
von erazerhead
wollte die meine variablen in einer externen datei definieren....

das ist die datei:
<?php
//Benötigte Dateien und Variablen von phpBB
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'common.'.$phpEx);

include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'includes/constants.'.$phpEx);
include($phpbb_root_path . 'includes/template.'.$phpEx);
include($phpbb_root_path . 'includes/sessions.'.$phpEx);
include($phpbb_root_path . 'includes/auth.'.$phpEx);
include($phpbb_root_path . 'includes/functions.'.$phpEx);
include($phpbb_root_path . 'includes/db.'.$phpEx);
include($phpbb_root_path . 'extension.inc');

//Session auslesen und Benutzer-Informationen laden
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);


$template->assign_vars(array(
'tableoben' => implode("",file("./templates/grey/tableoben.tpl")),
'tableunten' => implode("",file("./templates/grey/tableunten.tpl")),

'U_NEWS' => append_sid('news.'.$phpEx),
'U_LABEL' => append_sid('label.'.$phpEx),
'U_ARTISTS' => append_sid('artists.'.$phpEx),
'U_ARTICLES' => append_sid('articles.'.$phpEx),
'U_DOWNLOADS' => append_sid('downloads.'.$phpEx),
'U_CONTACT' => append_sid('contact.'.$phpEx),
'U_LINKS' => append_sid('links.'.$phpEx))
);
?>

dann kommt:

Code: Alles auswählen

Fatal error: Cannot redeclare class template in G:\localhost\htdocs\NUSTYLE\includes\template.php on line 30

Verfasst: 21.04.2004 21:44
von andreasOymann
wenn die oben gepostete Datei template.php heißt, wundert mich, daß es darin die Zeile

Code: Alles auswählen

include($phpbb_root_path . 'includes/template.'.$phpEx);
gibt...

Verfasst: 21.04.2004 21:46
von erazerhead
nein sie heißt vars.php

Verfasst: 21.04.2004 23:11
von PhilippK
Bindest du die Datei irgendwo ein oder rufst du die direkt auf?

Gruß, Philipp

Verfasst: 21.04.2004 23:14
von erazerhead
aaalso: ich wollte dann die vars.php in jede andere includen, habs jez probeweise in der viewforum.php

Verfasst: 21.04.2004 23:20
von PhilippK
Hast du in der anderen Datei dann die init_userprefs() auskommentiert?

Gruß, Philipp

Verfasst: 21.04.2004 23:23
von erazerhead
nein: was ist das? :D

sry noobattack