So, hier hast Du
last_topics.php (für PHP4)
Code: Alles auswählen
<div style="padding:3px;background-color:transparent;">
<?php
$kendoo = "<a style=\"display:block;float:right;\" href=\"http://kfa-teampage.pytalhost.com/\" title=\"kfa-teampage\" onclick=\"window.open(this.href); return false;\"><span style=\"font-size:xx-small;color:red;\">© KenDoo</span></a>";
function xml2ary(&$string) {
$parser = xml_parser_create();
xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);
xml_parse_into_struct($parser, $string, $vals, $index);
xml_parser_free($parser);
$mnary = array();
$ary = &$mnary;
foreach ($vals as $r) {
$t = $r['tag'];
if($r['type'] == 'open') {
if(isset($ary[$t])) {
if(isset($ary[$t][0])) $ary[$t][] = array();
else $ary[$t] = array($ary[$t], array());
$cv = &$ary[$t][count($ary[$t])-1];
}
else $cv = &$ary[$t];
if(isset($r['attributes'])) {
foreach ($r['attributes'] as $k => $v) $cv['_a'][$k] = $v;
}
$cv['_c'] = array();
$cv['_c']['_p'] = &$ary;
$ary = &$cv['_c'];
}
elseif($r['type'] == 'complete') {
if(isset($ary[$t])) {
if(isset($ary[$t][0])) $ary[$t][] = array();
else $ary[$t] = array($ary[$t], array());
$cv = &$ary[$t][count($ary[$t])-1];
}
else $cv = &$ary[$t];
if(isset($r['attributes'])) {
foreach ($r['attributes'] as $k => $v) $cv['_a'][$k] = $v;
}
$cv['_v'] = (isset($r['value']) ? $r['value'] : '');
}
elseif($r['type'] == 'close') {
$ary = &$ary['_p'];
}
}
_del_p($mnary);
return $mnary;
}
function _del_p(&$ary) {
foreach ($ary as $k => $v) {
if($k === '_p') unset($ary[$k]);
elseif(is_array($ary[$k])) _del_p($ary[$k]);
}
}
$xml=xml2ary(file_get_contents('pfad zur/forum.xml'));
if(!$xml) {
echo "Keine Daten verfügbar";
}
else {
for($i=0;$i<5;$i++){
$typ = $xml['ResultSet']['_c']['topic'][$i]['_c']['typ']['_v'];
$subject = $xml['ResultSet']['_c']['topic'][$i]['_c']['subject']['_v'];
$zeit = $xml['ResultSet']['_c']['topic'][$i]['_c']['zeit']['_v'];
$starter = $xml['ResultSet']['_c']['topic'][$i]['_c']['starter']['_v'];
$poster = $xml['ResultSet']['_c']['topic'][$i]['_c']['poster']['_v'];
$colour = $xml['ResultSet']['_c']['topic'][$i]['_c']['colour']['_v'];
$p_id = $xml['ResultSet']['_c']['topic'][$i]['_c']['p_id']['_v'];
$t_id = $xml['ResultSet']['_c']['topic'][$i]['_c']['t_id']['_v'];
$f_id = $xml['ResultSet']['_c']['topic'][$i]['_c']['f_id']['_v'];
$views = $xml['ResultSet']['_c']['topic'][$i]['_c']['views']['_v'];
$replies = $xml['ResultSet']['_c']['topic'][$i]['_c']['replies']['_v'];
switch ($typ){
case 3: $icon = "announce_unread.gif"; $title = "Announcement"; break;
case 2: $icon = "announce_unread.gif"; $title = "Global Announcement"; break;
case 1: $icon = "sticky_unread.gif"; $title = "Sticky"; break;
default: $icon = "topic_unread.gif"; $title = "Topic";
}
echo "<img src=\"images/".$icon."\" width=\"14\" height=\"15\" alt=\"".$title."\" /> <a style=\"color:#0B4A70;\" href=\"Pfad zum Forum/viewtopic.php?f=".$f_id."&t=".$t_id."&p=".$p_id."#p".$p_id."\" title=\"".$subject."\" onclick=\"window.open(this.href); return false;\">".((strlen($subject)>40)?utf8_substr($subject,0 , 40)."...":$subject)."<img src=\"images/pfeil.gif\" width=\"16\" height=\"7\" alt=\"zum Beitrag\" /></a><br />\n<span style=\"font-size:x-small;\">by: <strong><span style=\"color:".(($colour)?"#".$colour:"black").";\">".$poster."</span></strong> started by: ".$starter." (Replies: ".$replies.", Views: ".$views.")<br />\n".date("D d.M Y, H:i a", $zeit)."</span><br />\n\n";
}
}
print $kendoo;
?>
</div>
Wie Du siehst, war es echt ein Haufen Arbeit => Scheiß PHP4

Wenn Du den Link zu meiner Page nicht willst, bitte ich Dich zumindest an anderer Stelle in Deiner Page einen Link zu meiner Page zu setzen, du weißt ja Backlinks kann man nie genug haben
ich würde auch einen zu Deiner setzen dann,
mfg kendoo