neue Seite in das Template System einbinden
Verfasst: 13.08.2005 17:32
Hallo,
folgende Seite habe ich in das Template System eingebunden:
Und hierfür folgende TPL Datei erstellt:
Ich bekomme eine Fehlermeldung, die ich nicht nachvollziehen kann:
http://paludarium.pipidae.de/cgi/phpBB2 ... rchive.php
Danke und Gruß Martin
folgende Seite habe ich in das Template System eingebunden:
Code: Alles auswählen
<?php
//Benötigte Dateien und Variablen von phpBB
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
$phpmn_table_prefix = "news_";
$archive_table = $phpmn_table_prefix.'archive';
//Session auslesen und Benutzer-Informationen laden
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
if ( !file_exists($phpbb_root_path . 'language/lang_' . $language . '/lang_main_phpmn.'.$phpEx) )
{
$language = 'german';
}
include($phpbb_root_path . 'language/lang_' . $language . '/lang_main_phpmn.' . $phpEx);
// QUERY TO GET THE ARCHIVES SENT BY ALL NEWSLETTERS
$query = " SELECT archive_id, archive_subject, archive_body, FROM_UNIXTIME(archive_timestamp, '%d/%m/%Y') AS timestamp
FROM $archive_table";
// IS ISSET NEWSID THEN SHOW THE INDIVIDUAL ARCHIVE SELECTED BY THE USER
IF (isset($_GET['newsid']))
$query .= " WHERE archive_id = '".$_GET['newsid']."'
LIMIT 0,1";
ELSE
$query .= ' ORDER BY archive_timestamp DESC';
$result = @mysql_query($query);
// IF THERE ARE ANY ARCHIVES AT ALL THEN DECIDE TO PRINT THE INDIVIDUAL OR LIST
IF (mysql_num_rows($result) > 0)
{
// IS ISSET NEWSID THEN SHOW THE INDIVIDUAL ARCHIVE SELECTED BY THE USER
IF (isset($_GET['newsid']))
{
$row = mysql_fetch_array($result);
extract($row);
$template->assign_block_vars('detail', array(
'VOLUME' => $archive_id,
'DATE' => $timestamp,
'SUBJECT' => stripslashes($archive_subject),
'BODY' => stripslashes(nl2br($archive_body))
)
);
}
// ELSE SHOW ALL THE NEWSLETTERS SENT SO THE USER CAN SELECT AN INDIVIDUAL ONE
ELSE
{
WHILE ($row = mysql_fetch_array($result))
{
extract($row);
$template->assign_block_vars('list', array(
'VOLUME' => $archive_id,
'DATE' => $timestamp,
'SUBJECT' => stripslashes($archive_subject)
)
);
}
}
}
// IF THERE ARE NO ARCHIVES THEN SHOW THIS MESSAGE
ELSE
{
}
/*
+----------------------------------------------------------
| Start output the page
+----------------------------------------------------------
*/
$page_title = $lang['PHPMN_ARCHIVE'];
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
$template->set_filenames(array(
'phpmn_archive' => 'phpmn_archive.tpl')
);
//
// Generate the page
//
$template->pparse('phpmn_archive');
//Footer - nur dann weglassen, wenn du auch den Header weglässt
include($phpbb_root_path . 'includes/phpmn_footer.'.$phpEx);
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
?>
Code: Alles auswählen
<table width="100%" cellspacing="0" cellpadding="2" border="0">
<tr>
<td><span class="gensmall">
<!-- BEGIN switch_user_logged_in -->
{LAST_VISIT_DATE}<br />
<!-- END switch_user_logged_in -->
{CURRENT_TIME}<br />
</span><span class="nav"><a href="{U_INDEX}" class="nav">{L_INDEX}</a> -> <a href="{U_PHPMN}" class="nav">{L_PHPMN}</a> -> <a href="{U_PHPMN_ARCHIVE}" class="nav">{L_PHPMN_ARCHIVE}</a></span>
</td>
</tr>
</table>
<TABLE Width="100%" Cellspacing=1 Cellpadding=1 Border=1 Align="center" class="forumline">
<!-- BEGIN detail-->
<TR>
<TD class="row1" Width=100><P><B>{L_PHPMN_VOLUME}:</TD>
<TD class="row1"><P>{detail.VOLUME}</TD>
</TR>
<TR>
<TD class="row1"><P><B>{L_PHPMN_DATE}:</TD>
<TD><P>{detail.DATE}</TD>
</TR>
<TR>
<TD class="row1"><P><B>{L_PHPMN_SUBJECT}:</TD>
<TD class="row1"><P>{detail.SUBJECT}</TD>
</TR>
<TR>
<TD class="row1" Valign=Top><P><B>{L_PHPMN_BODY}:</TD>
<TD class="row1"><P>{detail.BODY}</TD>
</TR>
<TR>
<TD class="row1" Colspan=2 Align=Center><BR><P><INPUT Type=Button Value="{L_PHPMN_BACK}" onClick=history.back()><BR><BR></TD>
</TR>
<!-- END detail -->
</TABLE>
<TABLE Width="100%" Cellspacing=1 Cellpadding=1 Border=1 Align="center" class="forumline">
<th>{L_PHPMN_VOLUME}</th><th>{L_PHPMN_DATE}</th><th>{L_PHPMN_SUBJECT}</th><th>{L_PHPMN_SELECT}</th>
<!-- BEGIN list-->
<TR Valign=Top>
<TD class="row1"><P>{list.VOLUME}</TD>
<TD class="row1"><P>{list.DATE}</TD>
<TD class="row1"><P>{list.SUBJECT}</TD>
<TD class="row1"><P><BUTTON onClick=location="phpmn_archive.php?newsid={L_PHPMN_SELECT}">Select</BUTTON>
</TR>
<!-- END list -->
<TR>
<TD class="row1" width="100%"><P>{L_PHPMN_NOARCHIVE}</TD>
</TR>
</TABLE>
http://paludarium.pipidae.de/cgi/phpBB2 ... rchive.php
Danke und Gruß Martin