News

Started on the old forum in June 2006 · view the original in the archive · old links redirect here

24 replies · 1,758 views · started 20 years ago · 1 min read

2 participants
CLINT #1

With this code u display news on ur site. First create a page called page1.php and add this code.

<?
header("Content-type: text/vnd.wap.wml; charset=ISO-8859-1"); 
echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>"; 
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"
\"http://www.wapforum.org/DTD/wml_1.1.xml\">"; 

$TimeZone="8"; ////Change the TimeZone accordingly!
$New_Time = time() + ($TimeZone * 60 * 60);
$Date=date("D dS F, Y",$New_Time); 
$Time=date("H:i",$New_Time); 

$site = "http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/uk/rss.xml";

echo "<wml>";
echo "<card id=\"News\" title=\"LAND OF WAP NEWS\">";
echo"<p align=\"center\"><img src=\"news.gif\" alt=\"news\"/>
[size="1"]$Date
$Time[/size]

";
echo "[b]UK News[/b]
";

$fp = @fopen($site,"r");
while(!feof($fp)) $raw .= @fgets($fp, 4096);
fclose($fp);
if( eregi("<item>(.*)</item>", $raw, $rawitems ) ) {
$items = explode("<item>", $rawitems[0]);
for( $i =0; $i<count($items); $i++ ) {
  eregi("<title>(.*)</title>",$items[$i+1], $title );
  eregi("<link>(.*)</link>",$items[$i+1], $url );
  eregi("<description>(.*)</description>",$items[$i+1], $description);

echo "[size="1"]<a href=\"page2.php?go=$go&id=$i\">$title[1]</a>[/size]
";
}
}
?>

---

[size="1"][url="http://landofwap.net"]LandOfWap.net[/url][/size]</p>
<?
echo "</card>";
echo "</wml>";
?>

Now create a page2.php and add this

<?
header("Content-type: text/vnd.wap.wml; charset=ISO-8859-1"); 
echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>"; 
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"
\"http://www.wapforum.org/DTD/wml_1.1.xml\">"; ?>
<?
echo "<wml>";
echo "<card id=\"News\" title=\"LAND OF WAP NEWS\">";
echo"<p align=\"center\"><img src=\"news.gif\" alt=\"news\"/></p>";

$site = "http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/uk/rss.xml";
$fp = @fopen($site,"r");
while(!feof($fp)) $raw .= @fgets($fp, 4096);
fclose($fp);
if( eregi("<item>(.*)</item>", $raw, $rawitems ) ) {
$items = explode("<item>", $rawitems[0]);
for( $i =0; $i<1; $i++ ) {
  eregi("<title>(.*)</title>",$items[$id+1], $title );
  eregi("<link>(.*)</link>",$items[$i+1], $url );
  eregi("<description>(.*)</description>",$items[$id+1], $description);
echo "

[size="1"][u]$title[1][/u]
$description[1][/size]</p>";
}
}

echo "

[size="1"]<a href=\"page1.php?go=$go\">back</a>[/size]</p>";
echo "</card>";
echo "</wml>";
?>
naveen-PHP LEARNER #5

Yeah mate...its cool....

tittatwap #6

super thanks

abhisar #7

Ok.will try that.

abhisar #9

Its is giving error like this.

Proxy Error

The proxy server received an invalid response from an upstream server. The proxy server could not handle the request GET /__addyour_proxy/page1.php.

Reason: Error reading from remote server.

for info see http://wap.hugetop.com/page1.php

naveen-PHP LEARNER #10

make sure you specify the RSS site correctly. Or make sure you have PHP3+.

subzero Super moderator Fellow · 3,954 posts #11

Its is giving error like this.

Proxy Error

The proxy server received an invalid response from an upstream server. The proxy server could not handle the request GET /__addyour_proxy/page1.php.

Reason: Error reading from remote server.

for info see http://wap.hugetop.com/page1.php

cant host that on addyour.net cant bro i tryed and did not get any where

Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!


SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…

CLINT #12

That looks like a server problem. Maybe they wont allow news feeds.

subzero Super moderator Fellow · 3,954 posts #13

Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!


SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…

abhisar #14

Ya.It was a server error.Works fine on 6te.net

abhisar #17

Thats good.You need not to find them.They are the best.The yahoo feeds dont work.

lamar-wap #18

its cool but dont work on all hosts lol.......

lamar-wap #20

its pretty cool.......

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close