News

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    News

    With this code u display news on ur site.
    First create a page called page1.php and add this code.
    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&amp;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
    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\">"; ?>
    <?
    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>";
    ?>

    #2
    This code has got good potential, check out http://landofwap.net/news

    Comment


      #3
      HI
      Frnd its Realy Good.

      Comment


        #4
        Very good,incredible for wap

        Comment


          #5
          Yeah mate...its cool....

          Comment


            #6
            super thanks

            Comment


              #7
              Ok.will try that.

              Comment


                #8
                I am using it ,it is pretty cool

                Comment


                  #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

                  Comment


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

                    Comment


                      #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[/b]

                      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...
                      _______
                      Info & Tips
                      php.net
                      w3schools.com

                      Comment


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

                        Comment


                          #13
                          try www.6te.net
                          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...
                          _______
                          Info & Tips
                          php.net
                          w3schools.com

                          Comment


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

                            Comment

                            Working...
                            X