Der Code is folgendermaßen aufgebaut:
Ich habe eine index.php Die alles includet.
Diese Datei includet Folgende Dateien:
[CODE]<?php
include(‚includes.php‘);
if($_GET[‚login‘]==1){echo’‚;}
if(isLogin()==false){
echo‘
body{
background-image:url(„bilder/backgroundimage.png“);
}
‚;
echo‘
body{margin-left: auto;
margin-right: auto;
line-height:250%;width:auto;margin:1em 20%;text-align: left;
‚;
$logout=$_GET[‚logout‘];
if($logout==1) {
echo‘‚;}
echo‘‚;
echo‘
'.$spr[Username].': |
'.$spr[Password].': |
|
---|
';
} else {
echo’PHP-OS ‚.getUsername().‘';
echo"
/*demo page css*/
div.windows{ font: 62.5% 'Trebuchet MS', sans-serif; margin: 50px;}
.demoHeaders { margin-top: 2em; }
#dialog_link {padding: .4em 1em .4em 20px;text-decoration: none;position: relative;}
#dialog_link span.ui-icon {margin: 0 5px 0 0;position: absolute;left: .2em;top: 50%;margin-top: -8px;}
ul#icons {margin: 0; padding: 0;}
ul#icons li {margin: 2px; position: relative; padding: 4px 0; cursor: pointer; float: left; list-style: none;}
ul#icons span.ui-icon {float: left; margin: 0 4px;}
";
echo’
';
echo’
';
include('generateWindow.php');
echo'
';
include('generateWindowFunctions.php');
include('generateDesktop.php');
echo'
';include('generateWindowBoxen.php'); echo'
';
} [/CODE]
GenerateDesktop[INDENT]Hohl alle Desktopicoons aus der Datenbank und zeigt sie an.
[CODE]<?php
/* Ehemalig
echo'
‚;
*/
echo‘
body{
background-image:url(„system/user_backgrounds/‚.getUsername().‘.jpg“);
}
‚;
$desktopSQL=mysql_query(„SELECT * FROM desktop“);
$desktopAnzahl=mysql_num_rows($desktopSQL);
$found=0;
$searchid=0;
while($desktopAnzahl!=$found){
$searchid++;
$desktopWhileSQL=mysql_query(„SELECT * FROM desktop WHERE positionID = '“.$searchid."‘");
$desktopRow=mysql_fetch_array($desktopWhileSQL);
if($desktopRow[ID]!=‚‘){
echo’
|
'.$spr['desktop'.$desktopRow[namevariable]].' |
';
$found++;
}
}
//Eigene Desktop Icoons
$desktopSQL=mysql_query(„SELECT * FROM owndesktop“);
$desktopAnzahl=mysql_num_rows($desktopSQL);
$found=0;
$searchid=0;
while($desktopAnzahl!=$found){
$searchid++;
$desktopWhileSQL=mysql_query(„SELECT * FROM owndesktop WHERE positionID = '“.$searchid.„'“);
$desktopRow=mysql_fetch_array($desktopWhileSQL);
if($desktopRow[ID]!=‚‘){
echo’
|
'.$desktopRow[namevariable].' |
';
$found++;
}
}[/CODE][/INDENT]GenerateWindows
Holt alle fenster aus der Datenbank
[CODE]<?php
$windowsSQL=mysql_query(„SELECT * FROM windows“);
$windowsAnzahl=mysql_num_rows($windowsSQL);
$found=0;
$searchid=0;
while($windowsAnzahl!=$found){
$searchid++;
$windowsWhileSQL=mysql_query(„SELECT * FROM windows WHERE ID = '“.$searchid.„'“);
$windowsRow=mysql_fetch_array($windowsWhileSQL);
if($windowsRow[ID]!=‚‘){
echo’
'.$windowsRow[content].'
';
$found++;
}
}
//Eigene Fenster
$windowsSQL=mysql_query(„SELECT * FROM ownwindows“);
$windowsAnzahl=mysql_num_rows($windowsSQL);
$found=0;
$searchid=0;
while($windowsAnzahl!=$found){
$searchid++;
$windowsWhileSQL=mysql_query(„SELECT * FROM ownwindows WHERE ID = '“.$searchid.„'“);
$windowsRow=mysql_fetch_array($windowsWhileSQL);
if($windowsRow[ID]!=‚‘){
echo’
'.$windowsRow[content].'
';
$found++;
}
}
[/CODE]GenerateWindow Functions
Erstellt die Functionen zu den Fenstern
<?php
$windowsSQL=mysql_query("SELECT * FROM windows");
$windowsAnzahl=mysql_num_rows($windowsSQL);
$found=0;
$searchid=0;
echo"<script type='text/javascript'>
$(function(){
// Datepicker
$('#datepicker').datepicker();";
while($windowsAnzahl!=$found){
$searchid++;
$windowsWhileSQL=mysql_query("SELECT * FROM windows WHERE ID = '".$searchid."'");
$windowsRow=mysql_fetch_array($windowsWhileSQL);
if($windowsRow[ID]!=''){
//open: openWindow(".$windowsRow[openID].",".$windowsRow[boxID].")
echo"
$('#".$windowsRow[openID]."').dialog({
autoOpen: ".$windowsRow[autoOpen].",
title: '".$spr['window'.$windowsRow[windowName]]."',
width:600,
zIndex: 1
$windowsRow[sonst]";
if($windowsRow[OKButtonText]!='' OR $windowsRow[CancelButtonText]!=''){
echo',
buttons: {';
if($windowsRow[OKButtonText]!=''){
echo"'".$spr[buttonOK]."': function() {
".$windowsRow[OKButtonFunction]."
}";
}
if($windowsRow[CancelButtonText]!=''){
echo",'".$spr[buttonCancel]."': function() {
".$windowsRow[CancelButtonFunction]."
}";
}
echo'}'; }
echo"
});";
$found++;
}
}
//Eigene Fenster
$windowsSQL=mysql_query("SELECT * FROM ownwindows");
$windowsAnzahl=mysql_num_rows($windowsSQL);
$found=0;
$searchid=0;
while($windowsAnzahl!=$found){
$searchid++;
$windowsWhileSQL=mysql_query("SELECT * FROM ownwindows WHERE ID = '".$searchid."'");
$windowsRow=mysql_fetch_array($windowsWhileSQL);
if($windowsRow[ID]!=''){
echo"
$('#own".$windowsRow[openID]."').dialog({
autoOpen: ".$windowsRow[autoOpen].",
title: '".$windowsRow[windowName]."',
width:600,
zIndex: 1,
maxHeight: 400,
$windowsRow[sonst]";
if($windowsRow[OKButtonText]!='' OR $windowsRow[CancelButtonText]!=''){
echo',
buttons: {';
if($windowsRow[OKButtonText]!=''){
echo"'".$windowsRow[OKButtonText]."': function() {
".$windowsRow[OKButtonFunction]."
}";
}
if($windowsRow[CancelButtonText]!=''){
echo",'".$windowsRow[CancelButtonText]."': function() {
".$windowsRow[CancelButtonFunction]."
}";
}
echo'}'; }
echo"
});";
$found++;
}
}
echo"
$('#editFile').dialog({
autoOpen: false,
title: '".$spr['windowEditFile']."',
width:600,
zIndex: 1});
});
</script>";
Problem steht oben