Template-Hack |
Beatstyler
Mitglied
Dabei seit: 09.12.07
Beiträge: 14
Forenversion: 3.0
|
|
Dies ist eine vorgefertigte Schablone.
Bitte fülle soviel aus, wie dir nur Möglich ist, du kannst auch gerne noch mehr Angaben machen.
Template-Hack
Könnte mir bitte mal einer dabei helfen, da ich irgendwas falsch mache
Fehlermeldung:
Link zum Forum oder Screenshot:
nichts
|
|
10.12.07 14:49 |
E-Mail
Finden
Als Freund hinzufügen
|
|
mikes
gesperrt! 27/04/08
Dabei seit: 23.12.06
Beiträge: 405
Herkunft: worpswede bei bremen Forenversion: 2.3; 2.2
|
|
Hi,
Na das nenne ich mal ne super Fehlerbeschreibung
Wie wärs mit ner Fehlermedung, genauere Angaben wo es nicht weiter geht?
|
|
10.12.07 15:18 |
Finden
Als Freund hinzufügen
|
|
XeRanoN
Mitglied
Dabei seit: 23.04.04
Beiträge: 1.298
Fähigkeiten: WBB Lite 1 Profi Forenversion: Lite 1.0
|
|
Frag am besten im Supportthread des entsprechenden Hacks nach
.
|
|
10.12.07 15:19 |
E-Mail
Finden
Als Freund hinzufügen
|
|
Beatstyler
Mitglied
Dabei seit: 09.12.07
Beiträge: 14
Forenversion: 3.0
Themenstarter
|
|
Parse error: syntax error, unexpected ';', expecting T_FUNCTION in /data/apache/users/kilu.de/beatstyler/www/acp/lib/class_tpl_file.php on line 114
Wie kann ich die Datei install_templates.php aufrufen
|
|
10.12.07 15:54 |
E-Mail
Finden
Als Freund hinzufügen
|
|
XeRanoN
Mitglied
Dabei seit: 23.04.04
Beiträge: 1.298
Fähigkeiten: WBB Lite 1 Profi Forenversion: Lite 1.0
|
|
Zitat: |
Original von XeRanoN
Frag am besten im Supportthread des entsprechenden Hacks nach
. |
+:
Parse error: Einbaufehler...
+:
Datei einfach im Browser öffnen...
|
|
10.12.07 16:23 |
E-Mail
Finden
Als Freund hinzufügen
|
|
mikes
gesperrt! 27/04/08
Dabei seit: 23.12.06
Beiträge: 405
Herkunft: worpswede bei bremen Forenversion: 2.3; 2.2
|
|
Hi,
Also, ich hatte den noch gerade gestern eingabaut, geht wunderbar.
Datei im Broswer öffnen -> Datei anklicken (rechts) -> öffnen mit -> Browser wählen
|
|
10.12.07 17:17 |
Finden
Als Freund hinzufügen
|
|
Beatstyler
Mitglied
Dabei seit: 09.12.07
Beiträge: 14
Forenversion: 3.0
Themenstarter
|
|
Irgendwo soll da en fehler sein.
class_tpl_file.php
<?php
class tpl {
var $templates = array();
var $subvariablepackid = 0;
var $templatefolders = array();
var $imagefolders = array();
var $images = array();
/* constuctor */
function tpl($templatepackid=0,$subvariablepackid=1,$prefix="") {
global $db, $n;
$this->subvariablepackid = $subvariablepackid;
if(!$templatepackid) $this->templatefolders[] = $prefix."templates";
$result = $db->query("SELECT * FROM bb".$n."_templatepacks");
while($row = $db->fetch_array($result)) $templatepacks[$row['templatepackid']] = $row;
while($templatepackid != 0) {
$this->templatefolders[] = $prefix.$templatepacks[$templatepackid]['templatefolder'];
if($templatepacks[$templatepackid]['parent_templatepackid']==-1) {
$this->templatefolders[] = $prefix."templates";
break;
}
else $templatepackid = $templatepacks[$templatepackid]['parent_templatepackid'];
}
$result = $db->query("SELECT * FROM bb".$n."_subvariablepacks LEFT JOIN bb".$n."_subvariables USING (subvariablepackid) WHERE
variable = '{imagefolder}'");
while($row = $db->fetch_array($result)) $subvariablepacks[$row['subvariablepackid']] = $row;
$varlist = "''";
while($subvariablepackid != 0) {
$this->imagefolders[] = $subvariablepacks[$subvariablepackid]['substitute'];
$subvariablepackid = $subvariablepacks[$subvariablepackid]['parent_subvariablepackid'];
}
}
/* get template */
function get($templatename) {
if(!isset($this->templates[$templatename])) {
for ($j=0;$j<count($this->templatefolders);$j++) {
if(file_exists($this->templatefolders[$j]."/$templatename.tpl")) {
$this->templates[$templatename]=str_replace("\"","\\\"",implode("",file($th
is->templatefolders[$j]."/$templatename.tpl")));
break;
}
}
return $this->templates[$templatename];
}
/* print template */
function output($template) {
headers::send();
$template = $this->replacevars($template);
print($template);
}
/* replace vars */
function replacevars($template) {
global $db, $n, $pmpopup, $PHP_SELF;
$hash="";
if(strstr($template,"<title>")) {
$hash = md5(uniqid(microtime()));
$x = strpos($template,"<title>");
$y = strpos($template,"</title>");
$temp = substr($template,$x,$y-$x+
;
$template = substr($template,0,$x) . $hash . substr($template,$y+
;
}
preg_match_all("/(\{imagefolder\})\/([^\"\?\&]*\.(gif|jpg|jpeg|bmp|png))/si
U", $template, $matches);
for($j=0; $j<count($matches[0]); $j++) {
if(!isset($this->images[$matches[2][$j]])) {
for ($k=0;$k<count($this->imagefolders);$k++) {
if(file_exists($this->imagefolders[$k]."/".$matches[2][$j])) {
$this->images[$matches[2][$j]] = $this->imagefolders[$k]."/".$matches[2][$j];
break;
}
}
}
$tmp = $matches[1][$j]."/".$matches[2][$j];
$template = str_replace($tmp,$this->images[$matches[2][$j]],$template);
}
$result = $db->query("SELECT variable,substitute FROM bb".$n."_subvariables WHERE subvariablepackid = '".$this->subvariablepackid."'");
while($row = $db->fetch_array($result)) {
if(isset($row['variable']) && $row['variable'] && isset($row['substitute'])
&& $row['substitute']) {
switch($row['variable']) {
case "<body":
$template = $this->str_replace($row['variable'],$row['substitute'],$template); break;
case "{css}":
$template = $this->str_replace($row['variable'],$row['substitute'],$template); break;
case "{cssfile}":
$template = $this->str_replace($row['variable'],$row['substitute'],$template); break;
case "{imagelogo}":
$template = $this->str_replace($row['variable'],$row['substitute'],$template); break;
case "{!DOCTYPE}":
$template = $this->str_replace($row['variable'],$row['substitute'],$template); break;
case "{imagefolder}": break;
default:
$template = str_replace($row['variable'],$row['substitute'],$template);
}
}
}
if($hash!="") $template = str_replace($hash,$temp,$template);
return $template;
}
function str_replace($search,$replace,$text) {
if(strstr($text,$search)) {
$x = strpos($text,$search);
return substr($text,0,$x) . $replace . substr($text,$x+strlen($search));
}
else return $text;
}
}
?>
|
|
10.12.07 19:10 |
E-Mail
Finden
Als Freund hinzufügen
|
|
Beatstyler
Mitglied
Dabei seit: 09.12.07
Beiträge: 14
Forenversion: 3.0
Themenstarter
|
|
105 - 115
}
function str_replace($search,$replace,$text) {
if(strstr($text,$search)) {
$x = strpos($text,$search);
return substr($text,0,$x) . $replace . substr($text,$x+strlen($search));
}
else return $text;
}
}
?>
|
|
10.12.07 19:20 |
E-Mail
Finden
Als Freund hinzufügen
|
|
Beatstyler
Mitglied
Dabei seit: 09.12.07
Beiträge: 14
Forenversion: 3.0
Themenstarter
|
|
ja die habe bearbeitet, hänge mal beide dateien mit an
wie es hier vorgegeben ist.
###########################################################################
###################################################
suche in acp/lib/class_tpl_file.php
-----------------------
function tpl($templatepackid=0,$subvariablepackid=1,$prefix="") {
$this->subvariablepackid = $subvariablepackid;
$this->templatefolder = $prefix."templates";
}
-----------------------
und ersetze es durch
-----------------------
function tpl($templatepackid=0,$subvariablepackid=1,$prefix="") {
global $db, $n;
$this->subvariablepackid = $subvariablepackid;
if(!$templatepackid) $this->templatefolders[] = $prefix."templates";
$result = $db->query("SELECT * FROM bb".$n."_templatepacks");
while($row = $db->fetch_array($result)) $templatepacks[$row['templatepackid']] = $row;
while($templatepackid != 0) {
$this->templatefolders[] = $prefix.$templatepacks[$templatepackid]['templatefolder'];
if($templatepacks[$templatepackid]['parent_templatepackid']==-1) {
$this->templatefolders[] = $prefix."templates";
break;
}
else $templatepackid = $templatepacks[$templatepackid]['parent_templatepackid'];
}
$result = $db->query("SELECT * FROM bb".$n."_subvariablepacks LEFT JOIN bb".$n."_subvariables USING (subvariablepackid) WHERE variable = '{imagefolder}'");
while($row = $db->fetch_array($result)) $subvariablepacks[$row['subvariablepackid']] = $row;
$varlist = "''";
while($subvariablepackid != 0) {
$this->imagefolders[] = $subvariablepacks[$subvariablepackid]['substitute'];
$subvariablepackid = $subvariablepacks[$subvariablepackid]['parent_subvariablepackid'];
}
}
-----------------------
|
|
10.12.07 19:36 |
E-Mail
Finden
Als Freund hinzufügen
|
|
|