025
21.12.2005, 14:02
Tubgirl
|
Nun, das Problem ist ja nicht der Spalten-Name. Vorher habe ich ja versucht, eine Spalte namens "script" zu bearbeiten... das ging auch nur teilweise (siehe Post 000).
Sowohl escapen als auch umbenennen habe ich probiert, beides ohne Ergebnis. Der Query ist ganz sicher nicht das Problem, schließlich kann ich den ja auch in phpmyadmin einfügen und er fluppt. Ich werde jetzt mal das ganze Script Stück für Stück reduzieren bis es läuft. Schließlich ging das Testscript von 014 ja auch. Irgendwo wird man doch wohl das Problem festnageln können!
--
|
|
Profil || Suche
|
026
21.12.2005, 15:17
Tubgirl
|
Ich hab' die Ursache. Auch wenn ich es nicht verstehe.
Das Problem liegt hier:
<?php $tpl->display('scripts/content_text.tpl.php'); ?>
Jup, diese (und nur diese) Template-Datei, auch wenn sie nach einem Query eingebunden wird, verhindert irgendwie dass der Query "ankommt". Ich habe das mit mehreren anderen Scripts auf zwei verschiedenen Servern getestet. Wenn dieses Ding angezeigt wird, geht nichts mehr. Was eigentlich recht befremdlich ist, steht doch nichts besonders drin. Es ist nur ein Haufen HTML und etwas php.
<?php global $settings; ?>
<?=$TPL['message']?>
<form action="<?php print $settings['prepath']; ?>id=<?php print $_REQUEST['id']; ?>&action=do_edit&node=<?php print $_REQUEST['node']; ?>" method="post">
<fieldset> <legend>Text bearbeiten</legend>
<table cellpadding="2" cellspacing="2"> <tr> <td>Schriftformatierung: </td> <td><button type="button" onClick="inserttag('b', 'text1')"><b>F</b></button> <button type="button" onClick="inserttag('i', 'text1')"><i>K</i></button> <button type="button" onClick="inserttag('u', 'text1')"><span style="text-decoration:underline;">U</span></button></td> </tr> <tr> <td>Schriftfarbe: </td> <td><select name="select" onChange="insertcolor(this.options[this.selectedIndex].value, 'text1')"> <option value="0" style="font-weight:bold;">Farbe auswählen</option> <option value="blue" style="color:blue">Blue</option> [Ganz viele Farben zur Auswahl] <option value="silver" style="color:silver">Silver</option> </select></td> </tr> <tr> <td>Überschrift einfügen</td> <td><select name="select" onChange="insertheading(this.options[this.selectedIndex].value, 'text1')"> <option value="0" style="font-weight:bold;">Ebene auswählen</option> <option value="1">Ebene 1</option> <option value="2">Ebene 2</option> <option value="3">Ebene 3</option> <option value="4">Ebene 4</option> <option value="5">Ebene 5</option> <option value="6">Ebene 6</option> </select></td> </tr> <tr> <td rowspan="2">Links einfügen</td> <td><input type="button" value=" WWW-Link " onClick="inserttag('url', 'text1')" /></td> </tr> <tr> <td><input type="button" value=" Mail-Link " onClick="inserttag('mail', 'text1')" /></td> </tr> <tr> <td>Bild einfügen</td> <td><table cellpadding="2" cellspacing="2"> <tr> <td><select name="image" id="imageselect" onChange="document.preview.src='image.inc.php?type=thumb&id=' + this.options[this.selectedIndex].value">
<?php if(empty($TPL['gallery'])) { print '<option value="0" style="font-weight:bold;">Keine Bilder vorhanden</option>'; } else { print '<option value="0" style="font-weight:bold;">Bild auswählen</option>'; foreach($TPL['gallery'] as $image) { print '<option value="'.$image[0].'">'.$image[1].'</option> '; } } ?>
</select></td> <td><select name="orientation" id="orientation"> <option value="0" style="font-weight:bold;">Ausrichtung auswählen</option> <option value="default">Standard</option> <option value="left">Linksbündig</option> <option value="right">Rechtsbündig</option> <option value="center">Zentriert</option> </select></td> </tr> <tr> <td><a href="<?php print $settings['prepath']; ?>id=16">Neues Bild hochladen</a> <br /> <input type="button" value=" Dieses Bild einfügen " onClick="insertimage(document.getElementById('imageselect').options[document.getElementById('imageselect').selectedIndex].value, document.getElementById('orientation').options[document.getElementById('orientation').selectedIndex].value, 'text1')" /></td> <td><img src="" alt="Bild-Vorschau" id="preview" /></td> </tr> </table> </td> </tr> <tr> <td colspan="2"><textarea name="text1" id="text1" cols="50" rows="10"><?=$TPL['text']?></textarea></td> </tr> <tr> <td>Text speichern</td> <td><input type="submit" name="submit" value="Speichern" /></td> </tr> <tr> <td>Felder zurücksetzen</td> <td><input type="submit" name="submit" value="Reset" /></td> </tr> </table> </fieldset> </form>
<p> Dieser Seitenbereich ist ein <b>Text</b>. <br /> Sie können diesen Bereich in einen Script-Bereich verwandeln. Dabei geht eventuell vorhandener Text <b>verloren</b>. <br /> <a href="<?php print $settings['prepath']; ?>id=<?php print $_REQUEST['id']; ?>&action=convert&node=<?php print $_REQUEST['node']; ?>">Diesen Bereich in einen Script-Bereich umwandeln.</a> </p> ?>
--
Dieser Beitrag wurde am 21.12.2005 um 15:35 von -Sir_Pepe- bearbeitet.
|
|
Profil || Suche
|
027
21.12.2005, 15:18
Tubgirl
|
Falls das für irgendwen Sinn macht, und er einen Blick in die Template-Klasse werfen möchte:
<?php class template { var $TEMPLATE_DIR = 'templates/Test-Alpha/'; var $PLUGIN_DIR = 'template_plugins/'; var $TEMPLATE_VARS = array(); var $ECHO_VARS = array();
function templatedir($tpl_dir) { if(!is_dir($tpl_dir)) { exit('<b>Schwerer Fehler</b>: Der Template-Pfad '.$tpl_dir.' falsch!'); } $this->TEMPLATE_DIR = $tpl_dir; } function assign($key, $val=null) { $this->TEMPLATE_VARS[$key] = $val; } function add_echo($val) { $this->ECHO_VARS[] = $val; }
function display($tpl_file) { if(!is_file($this->TEMPLATE_DIR . $tpl_file)) { exit('<b>Schwerer Fehler</b>: Es existiert keine Template-Datei '.$tpl_file.'! (Suche in '.$this->TEMPLATE_DIR.')'); } $TPL = &$this->TEMPLATE_VARS; $ECHO = &$this->ECHO_VARS; include($this->TEMPLATE_DIR.$tpl_file); } function tpl_func($func_name) { $func_file = $this->PLUGIN_DIR.$func_name.'.inc.php'; if(!is_file($func_file)) { exit('<b>Schwerer Fehler</b>: Es existiert keine Funktion '.$func_name.'! (Suche unter '.$func_file.')'); } include_once($func_file); $code = "return $func_name("; if(func_num_args() > 1) { $args = array_slice(func_get_args(), 1); for($x=0; $x<count($args); $x++) { if($x>0) { $code .= ','; } $code .= '$args['.$x.']'; } } $code .= ");"; return eval($code); } }
?>
--
|
|
Profil || Suche
|
028
21.12.2005, 15:53
Kriz
|
<?=$TPL['message']?>
Ich bin zwar nicht mehr ganz so firm mit PHP, aber muß das an dieser Stelle nicht
<?php=$TPL['message']?>
heißen? Falls nicht, Post ignorieren ;)
--
K:R-I)Z++ "CSS ist cascading style sheets. Und nicht so'n Ranzspiel." - dp In memory of Voice ( 2005/03/30)
|
|
Profil || Suche
|
029
21.12.2005, 16:07
theDon
|
Wenn Shorttags aus sind, sollt das einfach ignoriert werden.
--
\o tanz den naziprau! o/
And more than ever, I hope to never fall, Where enough is not the same it was before
|
|
Profil || Suche
|
030
21.12.2005, 18:49
Jim Panse
|
was mich verwirrt, ist dieses "="-Zeichen. wat dat denn? o_O
@pepe: was mir an der template-klasse sauer aufstösst ist das eval(). da gehen bei mir sämtliche alarmglocken los! eval() kann man IMMER durch einen anderen (weniger gefährlicheren) ausdruck ersetzen!
--
|
|
Profil || Suche
|
031
21.12.2005, 19:01
Megge
|
du kennst <?=$var?> nicht, aber willst für alle eval()s ein equivalent wissen? Ich zweifle an deiner PHP-Kompetenz
--
|
|
Profil || Suche
|
032
21.12.2005, 19:02
theDon
|
Jim Panse postete eval() kann man IMMER durch einen anderen (weniger gefährlicheren) ausdruck ersetzen! Ja, zur Not muss man halt PHP in PHP implementieren... Ob das dann allerdings sicherer ist, wage ich zu bezweifeln. Es gibt Situationen, in denen man eval() durchaus nutzen kann. Das Thwboard macht das auch.
3. <? echo 'this is the simplest, an SGML processing instruction'; ?> <?= expression ?> This is a shortcut for "<? echo expression ?>" http://www.php.net/manual/en/language.basic-syntax.php#language.basic-syntax.phpmode
--
\o tanz den naziprau! o/
And more than ever, I hope to never fall, Where enough is not the same it was before
Dieser Beitrag wurde am 21.12.2005 um 19:03 von theDon bearbeitet.
|
|
Profil || Suche
|