TWLan Forum

Full Version: Admintools selber erstellen
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hallo,

nachdem es dasd Thema "Eigene Admintools erstellen" nicht mehr gibt, will ich euch was fragen:
Wiesso teigt er mir nur "Cheaten" an?
extern_modules:
PHP Code:
<?php
 $screenname 
"Cheaten";
 
$toolname "Cheattool";
?>
actions:
PHP Code:
<?php
 $cheat 
"Mit diesem Tool kannst du Cheaten";
  
$tpl->assign('Cheattol'$cheat);
?>
templates:
PHP Code:
<html>
<
body>
  <
h3>Cheaten</h3>
   {
$cheaten}
</
body>
</
html
vielleicht, weil du $cheaten nicht definiert hast?
Du musst bei "action" schon etwas hinschreiben z.B.

PHP Code:
$cheaten "Bla Bla.." 
Ich kann nicht gut php!
oder ein paar Textkästen hinmachen z.B.:

PHP Code:
<html>
<
body>
 <
h1>Cheaten</h1>
<
form action="?Cheaten.php" method="POST">
<
input type="Text" name="Hauptgebäude">
<
textarea name="PHP" cols="30" rows="15">
</
body>
</
html

Oder soetwas..
(04.05.2009, 13:41)Yannici Wrote: [ -> ]Du musst bei "action" schon etwas hinschreiben z.B.

PHP Code:
$cheaten "Bla Bla.." 
Ich kann nicht gut php!

Falsch.

@Markus4897: Wenn überhaupt musst du {$Cheattol} ins Template schreiben, damit ein Output der Variable $cheaten vorhanden ist.
Muss ich nicht den Pfad eingeben?
Mit {$Cheattool} gehts auch nicht.

Also nochmal:
actions, cheaten.php
PHP Code:
<?php
 $cheat 
"Mit diesem Tool kannst du Cheaten";
  
$tpl->assign('Cheattol'$cheat);
?>
extern_modules, cheaten.php
PHP Code:
<?php
 $screenname 
"Cheaten";
 
$toolname "Cheattool";
?>
templates, index_cheaten.tpl
PHP Code:
<html>
<
body>
  <
h3>Cheaten</h3>
   {
$Cheattool}
</
body>
</
html

Aber muss ich, wenn ich etwas ändern will, das in actions schreiben?
du musst
PHP Code:
{$Cheattol
eingeben, dann geht es.
Aber wenn ich in index_cheaten.php Textfelder mache, wieso macht er dann keinen Zeilenmbruch oder erkennt ihn nicht?
Du darfst sie nicht index_cheaten.PHP nennen sonder index_cheaten.tpl !
Das ist wichtig, sonst wird es nicht als Template angenommen.
Meinte ich ja. Die Datei heißt index_cheaten.tpl
Zeilenumbrüche gehen ja so:

PHP Code:
<broder <br/> 

hast du das so?
Ja, ich habe es jetzt mit
Code:
<table>...</table>
gemacht.
Und das funktioniert?
Ja, das geht
Okay, dann ist ja in Ordnung.