Hiho,
ich versuch grade aus nem Tutorial nen Quelltext zu verstehn weil ich so was ähnliches machen will.
Bin eigentlich auch schon dahinter gekommen, nur ich komm net genau drauf was die Klasse
macht.
Wäre net wenn mir das einer mal schön auskommentieren könnte
Danke schonmal im Vorraus!
MFG,
sven
Hier das PHP:
[AdminKommentar] Bitte benutze in Zukunft die [ php ] Klammern [ /php ], sonst wird's unübersichtlich, ok?[/Kommentar]
ich versuch grade aus nem Tutorial nen Quelltext zu verstehn weil ich so was ähnliches machen will.
Bin eigentlich auch schon dahinter gekommen, nur ich komm net genau drauf was die Klasse
macht.
Wäre net wenn mir das einer mal schön auskommentieren könnte
Danke schonmal im Vorraus!
MFG,
sven
Hier das PHP:
PHP:
<?php class newLink {
var $lnk;
var $text;
var $method;
var $target;
function newLink($str) {
$lines = explode(",",$str);
$this->lnk = $lines[0];
$this->text = $lines[1];
$this->target = $lines[2];
$this->method = $lines[3];
}
}
function parseFile($file) {
$lines = file($file);
for($a=0;$a<count($lines);$a++)
$out[$a] = new newLink($lines[$a]);
return $out;
}
function getLinkList($lnk) {
for($a=0;$a<count($lnk);$a++)
$htm.= '<a href="'.$lnk[$a]->lnk.'" target="'.$lnk[$a]->target.'">'.$lnk[$a]->text.'</a><br>';
return $htm;
}
$links = parseFile("linkList.txt");
$linkhtm = getLinkList($links);
if($_GET&&$_GET["link"]) {
$aktInhalt = implode("", file($_GET["link"]));
}
else
$aktInhalt = "Template html ...<br> einfach auf einen Link klicken";
?>
[AdminKommentar] Bitte benutze in Zukunft die [ php ] Klammern [ /php ], sonst wird's unübersichtlich, ok?[/Kommentar]