Seite 1 von 1

PHP in phpBB-Templates nutzen?

Verfasst: 30.08.2003 14:18
von Craxx
Ich habe mein phpBB komplett in meine Seite eingebaut, allerdings wil ich oben einen Werbebanner haben der durch phpAdsNew generiert wird.

Ich habe den nötigen PHP Code in das overall_header.tpl File gesteckt, klappt so aber leider nicht.

Also dachte ich mir ich nehme einfach den ganzen Quelltext aus dem overall_header.tpl bis zur ersten phpBB Anweisung und mache es ins index.php im Root des phpBB. Leider weiss ich nicht so recht wohin ich das machen muss.

Weiss jemand wohin ich es schreiben muss in der index.php oder hat jemand eine andere Idee wie ich das ganze lösen kann?

Verfasst: 30.08.2003 14:33
von enrico
########################################################
## Mod Title: Php in templates
## Mod Version: 3.0
## Author: Ryan McLaughlin < ryanmc2@hotmail.com >
## Description: This mod allows simple php to be inserted
## into the .tpl files.
##
## Installation Level: (easy)
## Installation Time: 1 Minute
## Files To Edit: template.php
## Included Files: template.php
##
##############################################################
## For Security Purposes, This MOD Cannot Be Posted Or Added
## At Any Non-Official phpBB Site
##############################################################
##
## Author Note:
##
## I have included the template.php (v 1.10) file with the
## mod already in place. just copy my file over the origianl file.
## Or follow the instructions below to install it into your own file.
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up
## All Files Related To This MOD
##############################################################

#
#-----[ OPEN ]------------------------------------------
#
/phpBB2/includes/template.php

#
#-----[ FIND ]------------------------------------------
#
$code_lines[$i] = chop($code_lines[$i]);

#
#-----[ AFTER, ADD ]------------------------------------------
#
if (preg_match('/<\?php/', $code_lines[$i]))
{
$code_lines[$i] = str_replace('<?php', '', $code_lines[$i]);
while (!preg_match('/\?>/', $code_lines[$i])) {
$i++;
}
if (preg_match('/\?>/', $code_lines[$i])){
$code_lines[$i] = str_replace('?>', '', $code_lines[$i]);
}
}
else {
#
#-----[ FIND ]------------------------------------------
#
// Bring it back into a single string of lines of code.

#
#-----[ BEFORE, ADD ]------------------------------------------
#
} -- this ends the else from above

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM

Verfasst: 30.08.2003 15:39
von Craxx
Klappt mit dieser Anleitung nicht. Habe es aber hinbekommen mit einer anderen Anleitung.

Verfasst: 30.08.2003 17:47
von enrico
hmm, komisch. bei mir hatte es mit dieser geklappt. naja, hauptsache es funkioniert bei dir jetzt.