Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Aiheen aloitti: Xpresskonami - elokuu 03, 2013, 02:46:23 AP

Otsikko: [ADMIN] Help me force this script to wap2
Kirjoitti: Xpresskonami - elokuu 03, 2013, 02:46:23 AP
Admin i try to fix this script to wap2 e.g url/wap2 but it did not display the wap2, plz help  me to fix it wap2

$rss = new DOMDocument();
$rss->load('http://www.sitename.net/index.php?action=.xml;type=rss;sa=news;limit=10;boards=3,10,11,14,15,16,47,50,55,2,4,6,7,23,33,24,26,21,32,36,29,27,31,28,25,30,57,51,38,39,40');
$feed = array();
foreach ($rss->getElementsByTagName('item') as $node) {
$item = array (
'title' => $node->getElementsByTagName('title')->item(0)->nodeValue,
'desc' => $node->getElementsByTagName('description')->item(0)->nodeValue,
'link' => $node->getElementsByTagName('link')->item(0)->nodeValue,
'date' => $node->getElementsByTagName('pubDate')->item(0)->nodeValue,
);
array_push($feed, $item);
}
echo '<p><strong><div class="titlebg"> Topics </div></strong><br />';
$limit = 10;
for($x=0;$x<$limit;$x++) {
$title = str_replace(' & ', ' &amp; ', $feed[$x]['title']);
$link = $feed[$x]['link'];
$description = $feed[$x]['desc'];
$date = date('l F d, Y', strtotime($feed[$x]['date']));
echo '<div class="rssdisplay"><strong><li> <a href="'.$link.'" title="'.$title.'">'.$title.'</a></li></strong>'.$date.'</div>';
}
Otsikko: Re: [ADMIN] Help me force this script to wap2
Kirjoitti: johnpaul2k2 - elokuu 03, 2013, 04:38:04 AP
if i may ask,

what is the function of this script? what exactly do you want the script to be doing?
Otsikko: Re: [ADMIN] Help me force this script to wap2
Kirjoitti: Xpresskonami - elokuu 03, 2013, 05:48:19 AP
To display the latest topic
Otsikko: Re: [ADMIN] Help me force this script to wap2
Kirjoitti: johnpaul2k2 - elokuu 03, 2013, 01:41:29 IP
why not use the SIMPLE PORTAL MOD   

http://custom.simplemachines.org/mods/index.php?mod=1104


inside it's blocks, there is a block for recent post

you can also follow the mod support

http://www.simplemachines.org/community/index.php?topic=227599.0;topicseen
:)