du wolltest wissen, wie meine scripts aussehen? hier ein schönes beispiel ... ich blicke da sogar ( manchmal ) durch
Edit by JoelH :
Mit dem php Tag sieht es noch besser aus.
PHP-Code:
<?php
$includestring = "options.php"; // gibt den <head> usw mit aus!
include("$includestring");
$links = parser(nl2br($links));
$rechts = parser(nl2br($rechts));
$mitte = parser(nl2br($mitte));
echo "
</head>
<body bgcolor=\"#$bgcolor\" text=\"#$font_color\" scroll=\"auto\">
<script language=\"javascript\">
Hauptfenster = this.window;
Hauptfenster.name = 'TPS';
bruch = 0;
</script>
<table class=\"main\" align=\"center\" cellspacing=\"0\">
<tr height=\"100\">
<td class=\"t_page\" colspan=\"3\" background=\"img/bg_pic.jpg\"> <font class=\"norm\"><a name=\"top\">$links</font> </td>
<td width=\"120\"><img src=\"grafx/space.gif\" height=\"97\" width=\"1\"><font class=\"norm\">$rechts </font></td>
</tr> <tr>
<td colspan=\"4\" class=\"t_nav\">
<table align=\"center\">
<tr>
";
$them = mysql_query(" select * from tps_themen where p_name='$p_name' and unter='' order by sortiert");
$themes = mysql_num_rows($them); $i=1; $umb=1;
while($row = mysql_fetch_array($them)) {
$i <= $themes;
if($thema == $row[name]) {
echo "
<td bgcolor=\"$bgcolor\" align=\"center\">
"; } else {
echo "
<td bgcolor=\"$light_color\" align=\"center\">
"; }
echo "
<font class=\"norm\"><b><a href=\"tps.php?thema=$row[name]\">- $row[name] -</a></b></font></td>
";
$vergleich = $i/6;
$vergleich2 = $i/8;
$vergleich3 = $i/11;
if(!$tmp = strchr($vergleich, ".") and $themes > (6*$umb)) {
echo "<script language=\"javascript\">
if(screen.width <= 800) {
document.write('</tr><tr>');
bruch = 6;
}
</script>"; $umb = $umb +1;
}
if(!$tmp = strchr($vergleich2, ".") and $themes > (8*$umb)) {
echo "<script language=\"javascript\">
if(screen.width <= 1280) {
document.write('</tr><tr>');
bruch = 8;
}
</script>"; $umb = $umb +1;
}
if(!$tmp = strchr($vergleich3, ".") and $themes > (11*$umb)) {
echo "<script language=\"javascript\">
if(screen.width >= 1280) {
document.write('</tr><tr>');
bruch = 11;
}
</script>"; $umb = $umb +1;
}
if($i == $themes) {
echo "<script language=\"javascript\">
alle = bruch * $umb;
rest = alle - $themes;
i = 1;
while(i <= rest) {
document.write('<td bgcolor=\"#$light_color\"> </td>');
i++;
}
</script>";
}
$i++;
}
echo "
</tr>
</table>
</td>
</tr> <tr>
<td width=\"150\" valign=\"top\" class=\"t_left\" align=\"left\">
<img src=\"grafx/space.gif\" width=\"150\" height=\"1\">
<table align=\"center\"class=\"them\" cellspacing=\"0\" width=\"148\">
";
$navi = mysql_query(" select name,members from tps_themen where unter='$thema' and p_name='$p_name' order by sortiert ");
$zusammen = mysql_num_rows($navi);
if($zusammen <= "0") {
echo "
<tr>
<th class=\"t_nav\"><font class=\"norm\">- No Pages found -</font></th>
</tr>
";
}
$i = "0";
while($row = mysql_fetch_array($navi)) {
$i <= $zusammen;
if($i == "0") {
$to_sel = $row[name];
$memb = $row[members];
}
echo "
<tr>
<th class=\"t_nav\"><font class=\"norm\">$row[name]"; if($row[members] > "") {
echo "<img src=\"img/key.gif\" alt=\"Geschützter Bereich "$memb"\">"; } echo "</font></th>
</tr>
";
$pages = mysql_query(" select * from tps_pages where u_thema = '$row[name]' and thema='$thema' and p_name='$p_name' order by sortiert ");
if($zahl = mysql_num_rows($pages) <= "0") {
echo "
<tr>
<th class=\"page\"><font class=\"norm\">- No Pages found -</font></th>
</tr>
";
}
$hh = "0";
while($page = mysql_fetch_array($pages)) {
$hh <= $zahl;
echo "
<tr>
";
if((!isset($pagetoload)) and ($hh == "0") and ($i == "0")) {
echo "
<td class=\"page_hell\">
"; } else {
if($page[ID] == $pagetoload) {
echo "
<td class=\"page_hell\">
"; } else {
echo "
<td class=\"page\">
"; } }
echo "
<font class=\"norm\"><a href=\"tps.php?thema=$thema&pagetoload=$page[ID]\">- $page[name]</a></font></td>
</tr>
";
$hh++;
$i++;
}
}
echo "
<tr>
<td class=\"last_page\" align=\"center\"><font class=\"klein\"><b>
";
echo date('d.m.Y');
echo "
</font></b>
</td>
</tr>
</table>
";
$t_links = mysql_query("select ID,thema,name from tps_pages where p_name='$p_name' and top_link='1' order by thema,u_thema,sortiert");
if(mysql_num_rows($t_links) > 0) {
echo "
<font class=\"klein\"><b>TopLinks:
";
while($row = mysql_fetch_array($t_links)) {
echo "
<li><a href=\"tps.php?thema=$row[thema]&pagetoload=$row[ID]\">$row[name]</a></li>
";
}
}
echo "
</td>
<td colspan=\"2\" width=\"100%\" height=\"95%\" valign=\"top\">
";
if($member == "") {
echo "
<img src=\"grafx/space.gif\" width=\"1\" height=\"1\">
"; } else {
echo "<p><font class=\"klein\">Willkommen zurück <b>$member!</b> Ihr letzter Besuch war $last_visit </font></p>";
}
if(!isset($pagetoload)) {
$load_page = mysql_query(" select * from tps_pages where p_name='$p_name' and thema='$thema' and u_thema='$to_sel' order by u_thema,sortiert limit 1 ");
while($row = mysql_fetch_array($load_page)) {
$pagetoload = $row[ID];
}
}
if($pagetoload <= 0) {
echo "
<font class=\"ueber\">Seite wird gerade überarbeitet! </font><p>
<font class=\"norm\">Bitte gedulden Sie sich etwas ... </font>
";
} else {
$ermittel = mysql_query(" select art,u_thema from tps_pages where ID='$pagetoload' ");
while($row = mysql_fetch_array($ermittel)) {
$page = $row[0];
$unter = $row[u_thema];
}
$secu = mysql_query("select members from tps_themen where name = '$unter' ");
while($seci = mysql_fetch_array($secu)) { $bereich = $seci[0]; }
if($bereich > "") {
$guck = mysql_query(" select listen from tps_user where name='$member' and p_name='$p_name' and status > 0 ");
while($roww = mysql_fetch_array($guck)) { $all = $roww[listen]; }
$teil = explode(",", $all); $many = count($teil); $j=0;
while($j <= $many) { if($teil[$j] == $bereich) { $found = "ok"; } $j++; }
if($found == "ok") {
$includestring = "pages/$page";
include("$includestring");
} else {
$grab = mysql_query("select * from tps_members where p_name='$p_name' and name='$bereich' ");
while($txt = mysql_fetch_array($grab)) { $reg = $txt[on_reg]; }
echo "
<table class=\"inhalt\" align=\"center\">
<tr>
<td valign=\"top\">
<font class=\"ueber\">Geschützter Bereich <i>\"$bereich\"</i> <br><br></font>
<font class=\"norm\"><b>Leider konnten Ihre Daten nicht gefunden werden.
Bitte geben Sie Ihre Benutzerdaten ein!</b><hr class=\"sign\">
<div align=\"center\" class=\"log\"><form name=\"login\" action=\"mem_log.php\" method=\"post\">
<b>Ihr Benutzername:<br>
<input type=\"text\" name=\"nick\" size=\"30\"> <br>
Ihr Passwort: <br>
<input type=\"password\" name=\"pass\" size=\"30\"> <br>
<input type=\"checkbox\" name=\"save\" value=\"on\" checked> </b>Einstellungen speichern? <br><br>
<input type=\"hidden\" name=\"liste\" value=\"$bereich\">
<input type=\"hidden\" name=\"page\" value=\"$pagetoload\">
<input type=\"submit\" value=\"Login\"></div>
</form>
<hr class=\"sign\">
<div class=\"log\"><form name=\"login\" action=\"mem_to_do.php\" method=\"post\">
<b>Haben Sie Ihr Passwort vergessen? Login Name:
<input type=\"hidden\" name=\"page\" value=\"$pagetoload\">
<input type=\"text\" name=\"name\" size=\"15\"> <input type=\"submit\" value=\"Go -->\">
</form>
";
if($reg == "yes") {
echo "Falls Sie noch nicht registriert sind, klicken Sie bitte <a href=\"mem_to_do.php?new_mem=yes&page=$pagetoload&liste=$bereich\">hier!</a>";
} else {
echo "Falls Sie noch kein Passwort haben, klicken Sie bitte <a href=\"mem_to_do.php?new_pass=no&page=$pagetoload&liste=$bereich\">hier!</a>";
}
echo "
</div>
</td>
</tr>
</table>
";
}
} else {
// hier musste ich kürzen, weil man nur 10000 zeichen eimngeben
// geht im nächsten posting weiter :)
Mit dem php Tag sieht es noch besser aus.
Kommentar