Fehler wichtig

Begonnen von oliver, 16 Mai 2003, 09:42:43

⏪ vorheriges - nächstes ⏩

0 Mitglieder und 1 Gast betrachten dieses Thema.

oliver

Hallo Leutz

bin gerade dabei einen Tabellengenerator zubasteln doch es ist noch ein kleiner Fehler in der Textarea drin.

Wenn das modul geöffnet wird ist in der textarea der footer mit dem copyright drin. Wie kann ich das unterdrücken.

Link:  http://www.b-e-hosting.de/modules.php?name=Tabellen


[Editiert am 16/5/2003 von oliver]

jubilee

Hallo !
Dafür müsste man sich den Quellcode des Moduls wohl etwas genauer
ansehen.
MfG
jubilee

oliver

 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<style>
.highlighttext{
background-color:yellow;
font-weight:bold;
}
</style>

<script language="Javascript">
<!--
// Funciona en IE y NS (copiar al clipboard solo en IE)
var copytoclip=1

function HighlightAll(theField) {
var tempval=eval("document."+theField)
tempval.focus()
tempval.select()
if (document.all&©toclip==1){
therange=tempval.createTextRange()
therange.execCommand("Copy")
}
}
//-->
</script>


<link rel="StyleSheet" href="../tools.css" type="text/css" />

<script language="javascript" type="text/javascript">

<!--

/* EEEK!

 * Does your mom know, that you are here checking other people's code?

 * Oh behave!

 *                                                /Chris

 */

function do_table(border,cp,cs,co,path,ro,fill,backcol,xalign,yalign,fontdef,cla){

// border = borderwidth

// cp = cellpadding

// cs = cellspacing

// co = collumnwidths

// path = image path

// ro = number of rows

// fill = fill with text

// backcol =  background color

// xalign = x-align inside TD

// yalign = y-align inside TD

// fontdef = <FONT> Definititions

// cla = style sheet class

message="<table width=\"1\" border=\""+border+"\" cellpadding=\""+cp+"\" cellspacing=\""+cs+"\">\n";

message=message+"\t<tr>\n";

cells=co.split(",")

for (i=0;i<=cells.length-1;i++){

message=message+"\t\t<td width=\""+cells[i]+"\"><img src=\""+path+"\" width=\""+cells[i]+"\" height=\"1\" alt=\"\"></td>\n";

}

message=message+"\t</tr>\n";

for (r=1;r<=ro;r++){

message=message+"\t<tr>\n";

for (i=0;i<=cells.length-1;i++){

message=message+"\t\t<td align=\""+xalign+"\" valign=\""+yalign+"\""

if (backcol != ''){message=message+" bgcolor=\""+backcol+"\">\n"}

else{message=message+">\n";}

if (fontdef != "no"){message=message+"\t\t\t<font "+fontdef+" >\n";}

if (cla != "no"){message=message+"\t\t\t\t<div class=\""+cla+"\">\n";}

if (fill != "no") {message=message+"\t\t\t\t\t"+(r)+"_"+(i+1)+"\n"}

if (cla != "no"){message=message+"\t\t\t\t</div>\n";}

if (fontdef != "no"){message=message+"\t\t\t</font>\n";}

message=message+"\t\t</td>\n";

}

message=message+"\t</tr>\n";

}

message=message+"</table>"

document.forms.f.code.value=message

}

function generate(){

bo=document.forms.f.bo.value

cs=document.forms.f.cs.value

cp=document.forms.f.cp.value

co=document.forms.f.co.value

path=document.forms.f.path.value

ro=document.forms.f.ro.value

if (document.forms.f.fill.checked==true) fill="yes"

if (document.forms.f.fill.checked==false) fill="no"

backcol=document.forms.f.backcol.value

xalign=document.f.xalign.options[document.f.xalign.selectedIndex].value

yalign=document.f.yalign.options[document.f.yalign.selectedIndex].value

if (document.forms.f.isccs.checked==true) cla=document.forms.f.ccsname.value

if (document.forms.f.isccs.checked==false) cla="no"

if (document.forms.f.isfont.checked==true) fontdef=" face=\""+document.forms.f.fontart.value+"\" size=\""+document.forms.f.fontsiz.value+"\" color=\""+document.forms.f.fontcol.value+"\""

if (document.forms.f.isfont.checked==false) fontdef="no"

do_table(bo,cp,cs,co,path,ro,fill,backcol,xalign,yalign,fontdef,cla)

}

//-->

</script>

</head>
<body>
<?php
#### generated by www.fhost.de ####
if (!eregi("modules.php", $PHP_SELF)) {
   die ("You can't access this file directly...");

}
require_once("mainfile.php");
$module_name = basename(dirname(__FILE__));
get_lang($module_name);
include("header.php");
$index = 0;
OpenTable();
echo"<form name=\"f\">"
  . "  <p> </p>"
  . "  <table width=\"80%\"  align=\"center\" border=\"1\" cellpadding=\"5\" cellspacing=\"0\" bordercolor=\"#000000\">"
  . "    <tr>"
  . "      <td><table width=\"98%\"  border=\"0\" cellpadding=\"5\" cellspacing=\"0\" bordercolor=\"#333333\">"
  . "          <tr>"
  . "            <td width=\"50%\" bgcolor=\"#999999\"><div align=\"center\"><strong><table>"
  . "                Definitionen</strong></div></td>"
  . "            <td width=\"50%\"><div align=\"left\"><span class=\"label\">Borderwidth:</span>"
  . "                <input type=\"text\" size=10 name=\"bo\" class=\"input\" />"
  . "                <br clear=\"all\" />"
  . "                <span class=\"label\">Cellpadding:</span>  "
  . "                <input type=\"text\" size=10 name=\"cp\" class=\"input\" />"
  . "                <br clear=\"all\" />"
  . "                <span class=\"label\">Cellspacing:   </span>"
  . "                <input type=\"text\" size=10 name=\"cs\" class=\"input\" />"
  . "              </div></td>"
  . "          </tr>"
  . "          <tr>"
  . "            <td bgcolor=\"#999999\"><div align=\"center\"><strong><td> meta"
  . "                Definitionen</strong></div></td>"
  . "            <td><div align=\"left\"><span class=\"label\">td Breiten, trennte von",":</span>"
  . "                <input type=\"text\" size=30 name=\"co\" class=\"input\" />"
  . "                <br clear=\"all\" />"
  . "                <span class=\"label\">Reihen:</span>      "
  . "                <input type=\"text\" size=10 name=\"ro\" class=\"input\" />"
  . "                <br clear=\"all\" />"
  . "                <span class=\"label\">leeres gif:</span>"
  . "                <input type=\"text\" size=10 name=\"path\" class=\"input\" />"
  . "              </div></td>"
  . "          </tr>"
  . "          <tr>"
  . "            <td bgcolor=\"#999999\"><div align=\"center\"><strong><td> Definitionen</strong></div></td>"
  . "            <td><div align=\"left\"><span class=\"label\">Hintergrundfarbe:   </span>"
  . "                <input type=text size=7 name=\"backcol\" class=\"input\" />"
  . "                <input type=\"checkbox\" name=\"fill\" />"
  . "                füllen Sie Zellen mit x_x <br clear=\"all\" />"
  . "                <span class=\"label\">waagerechte Ausrichtung:</span>"
  . "                <select name=\"xalign\" class=\"input\">"
  . "                  <option value=\"left\">links</option>"
  . "                  <option value=\"center\">mitte</option>"
  . "                  <option value=\"right\">rechts</option>"
  . "                </select>"
  . "                <br clear=\"all\" />"
  . "                <span class=\"label\">senkrechte Ausrichtung:</span>   "
  . "                <select name=\"yalign\" class=\"input\">"
  . "                  <option value=\"top\">oben</option>"
  . "                  <option value=\"middle\">mitte</option>"
  . "                  <option value=\"bottom\">unten</option>"
  . "                </select>"
  . "              </div></td>"
  . "          </tr>"
  . "          <tr>"
  . "            <td bgcolor=\"#999999\"><div align=\"center\"><strong>"
  . "                <input type=\"checkbox\" name=\"isfont\">"
  . "                <font>Definitionen</strong></div></td>"
  . "            <td><div align=\"left\"><span class=\"label\">face:  </span>"
  . "                <input type=text size=\"10\" name=\"fontart\" class=\"input\" />"
  . "                <br clear=\"all\" />"
  . "                <span class=\"label\">Farbe :</span>"
  . "                <input type=text size=10 name=\"fontcol\" class=\"input\" />"
  . "                <br clear=\"all\" />"
  . "                <span class=\"label\">Größe:</span>   "
  . "                <input type=text size=10 name=\"fontsiz\" class=\"input\" />"
  . "              </div></td>"
  . "          </tr>"
  . "          <tr>"
  . "            <td bgcolor=\"#999999\"><div align=\"center\"><strong>"
  . "                <input type=\"checkbox\" name=\"isccs\">"
  . "                ccs-Definitionen</strong></div></td>"
  . "            <td><div align=\"left\"><span class=\"label\">klassifizieren Sie einenNamen:</span>"
  . "                <input type=\"text\" size=\"7\" name=\"ccsname\" class=\"input\" />"
  . "              </div></td>"
  . "          </tr>"
  . "          <tr>"
  . "            <td bgcolor=\"#999999\"> </td>"
  . "            <td> </td>"
  . "          </tr>"
  . "          <tr>"
  . "            <td bgcolor=\"#999999\"> <div align=\"center\">"
  . "                <input name=\"button\" type=\"button\" class=\"input\" onClick=\"generate()\" value=\"Tabelle erstellen\" />"
  . "              </div></td>"
  . "            <td>.::CODE::. <a class=\"highlighttext\" href=\"javascript:HighlightAll('f.code')\">kopieren</a><br clear=\"all\" /> <textarea name=\"code\" rows=\"6\" cols=\"50\" class=\"inputbi\" />"
  . "            </td>"
  . "          </tr>"
  . "          <tr>"
  . "            <td> </td>"
  . "            <td> </td>"
  . "          </tr>"
  . "        </table></td>"
  . "    </tr>"
  . "  </table>"
  . "  <h4> </h4>"
  . "  <h4> </h4>"
  . ""
  . "  <h4> </h4>"
  . ""
  . "  <h4> </h4>"
  . ""
  . "  <h4> </h4>"
  . ""
  . ""
  . ""
  . "  <h4> </h4>"
  . ""
  . ""
  . ""
  . "  <br clear=\"all\" />"
  . "  <br clear=\"all\" />"
  . ""
  . "<br clear=\"all\" />"
  . "</form>"
 ."";
CloseTable();
include("footer.php");

?>
</body>
</html>  

jubilee

.........................brrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
schüttel ........................................................
Willst Du dir da nicht nochmal grundsätzliche Gedanken über den Aufbau des Moduls machen ??
MfG
jubilee

oliver

nee hab gleich den modulmaker dafür genommen.
hst du schon was gefunden woran das liegen kann

jubilee

Hmmm ....
Also, ich würde das ja alles nach PHP umsetzen.
Das ganze Mischwerk aus HTML, JavaScript, PHP gefällt mir überhaupt nicht. Ausserdem ist da nichts in JavaScript geschrieben, was Du nicht auch mit PHP realisieren kannst.
Wundert mich sowieso, das Du bei der Konstruktion keine Fehler angezeigt bekommst.
Wie dem auch sei, ich denke der Fehler liegt in dieser Funktion :
Zitatfunction HighlightAll(theField)
{
var tempval=eval("document."+theField)
tempval.focus()
tempval.select()
if (document.all&Å toclip==1){
therange=tempval.createTextRange()
therange.execCommand("Copy")
}
Das Ding scheint die gesammte Seite in die Dein Modul erscheint, mit in das
Textarea-Feld zu kopieren (bis Du dann das erste mal den Button anklickst).
MfG
jubilee



[Editiert am 16/5/2003 von SiteAdmin jubilee]

[Editiert am 16/5/2003 von SiteAdmin jubilee]