Seite 1 von 1

Neue Variable für Forum-Index

Verfasst: 24.05.2005 11:10
von MacMario
Hallo!

Ich habe das Problem, dass ich eine neue Variable so einbinden müsste, dass sie auf der Index-Seite verfügbar ist.

Derzeit ist die Variable nur in der rechten Spalte verfügbar, also im overall_footer.tpl.

Im index_body.tpl bleibt das Feld aber leer.

Wo muss ich die Variable eintragen, damit sie auch im index_body.tpl verfügbar ist?

ÜBer sie Forensuche habe ich leider keine Antwort gefunden :(

Danke schon mal für Eure Antworten :)

LG,
Mario

Verfasst: 24.05.2005 11:44
von Christian Benz
Hallo,

da müßte dir die Dokumentation weiterhelfen.

Unter Template-Dateien ist jeweils festgehalten, welche php-Datei(en) jeweils für die tpl-Datei "zuständig" ist/sind.

Gruß,
Chris

Verfasst: 24.05.2005 13:37
von MacMario
Ja, da war ich schon, habe meiner Meinung nach auch alles richtig in der index.php eingefügt, aber anscheinend passt das doch nicht :(

Gibt es nicht eine Datei in der variablen angegeben werden können die überall verfügbar sind?

Verfasst: 24.05.2005 13:54
von Leuchte
Ja, die page_header.php in includes/

Verfasst: 24.05.2005 14:14
von MacMario
Danke :)

Leider funktionierts immer noch nicht, habe ich hier was falsch gemacht?

Code: Alles auswählen

// 
// The following assigns all _common_ variables that may be used at any point 
// in a template. 
// 
$template->assign_vars(array(  
 'ITFRecentPosts_news' => $ITFRecentPosts_news,
	'SITENAME' => $board_config['sitename'],
	'SITE_DESCRIPTION' => $board_config['site_desc'],
......
Im Template overall_header.tpl habe ich "{ITFRecentPosts_news}" eingefügt.

Verfasst: 24.05.2005 14:16
von saerdnaer
hast du denn auch $ITFRecentPosts_news an der stelle auch definiert?

Verfasst: 24.05.2005 14:28
von MacMario
In der index.php:

Code: Alles auswählen

.....
include_once ($phpbb_root_path . 'extension.inc');
include_once ($phpbb_root_path . 'common.' . $phpEx);
include_once ($phpbb_root_path . 'includes/bbcode.' . $phpEx);


include_once ($phpbb_root_path . 'mods/phpbb_fetch_all/common.' . $phpEx);
include_once ($phpbb_root_path . 'mods/phpbb_fetch_all/stats.' . $phpEx);
include_once ($phpbb_root_path . 'mods/phpbb_fetch_all/users.' . $phpEx);
include_once ($phpbb_root_path . 'mods/phpbb_fetch_all/polls.' . $phpEx);
include_once ($phpbb_root_path . 'mods/phpbb_fetch_all/posts.' . $phpEx);
include_once ($phpbb_root_path . 'mods/phpbb_fetch_all/forums.' . $phpEx);

$recent_news = phpbb_fetch_posts(array(13, 11));
if (isset($recent_news)) { 
    $ITFRecentPosts_news = '';
     for ($i = 0; $i < count($recent_news); $i++) { 
        $ITFRecentPosts_news .=  '<table width="100%" bgcolor="#ffffff">
        <tr>
        <td align="left" valign="top" width="10">&rsaquo;&rsaquo;&nbsp;</TD><td align="left" valign="top"><a href="'.append_sid($phpbb_root_path . 'viewtopic.php?p=' . $recent_news[$i]['post_id'] . '#' . $recent_news[$i]['post_id']).'" class="navlink">'.$recent_news[$i]['topic_title']; 
        if ($recent_news[$i]['topic_trimmed']) { $ITFRecentPosts_news .=  '...'; } 
        $ITFRecentPosts_news .= '</a></td>
        </tr>
        </table>';
    }
    $ITFRecentPosts_news .= '';
}                                    
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);

?>

Verfasst: 24.05.2005 20:48
von MacMario
Hilfe :cry: ich komm nicht weiter :(