How To Make A Livescore Script?

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

    How To Make A Livescore Script?

    How to make livescore like this?
    http://wapiz.wapiz.biz/rezservis/fudbal.php

    #2
    Code:
    <?php
    header("Content-type: text/vnd.wap.wml;");
    echo "<?xml version=\"1.0\"?>";
    echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"". " \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
    echo "<wml>";
    echo "<card title=\"Live Scores\">";
    echo "<p align=\"left\">\n";
    echo "[size="1"]\n";
    
    echo "Live Score:
    ---
    ";
    $feed = "http://www.scorespro.com/rss/live-soccer.xml";
    $fp = @fopen($feed,"r");
    while(!feof($fp)) $raw .= @fgets($fp, 4096);
    fclose($fp);
    if( eregi("<item>(.*)</item>", $raw, $rawitems ) ) {
    $items = explode("<item>", $rawitems[0]);
    
      $p = 5;
      if ($npage == "")$npage = "1";
      $countfile= count($items);
      $countfile=$countfile-2;
      $first=($npage*$p)-$p;
      $npages = ceil($countfile / $p);
      $items = array_reverse($items);
      $next_arrays=($first+($p-1));
      if($next_arrays>$countfile)$next_arrays=$countfile;
      for ($i=($first); $i <= $next_arrays; $i++) {
      eregi("<title>(.*)</title>",$items[$i+1], $title );
      eregi("<link>(.*)</link>",$items[$i+1], $url );
      eregi("<description>(.*)</description>",$items[$i+1], $description);
    
      #$title[1] = str_replace("&#39;", "", $title[1]);
      $title[1] = str_replace("& ", "&amp;", $title[1]);
      echo $title[1].&#39;
    &#39;;
    
      }
    }
    if ($npage <= $npages and $npage>1) $gline_rew = &#39;[url="&#39;.$_SERVER["]Prev[/url] &#39;;
    if ($npages > 1 and $npage<$npages) $gline_next = &#39; [url="&#39;.$_SERVER["]Next[/url]&#39;;
    echo "
    ---
    Page {$npage} of {$npages}
    ".$gline_rew.$gline_next."
    ---
    ";
    
    echo "[/size]\n";
    echo "</p>";
    echo "</card>";
    echo "</wml>";
    ?>
    Advertise your mobile site for FREE with AdTwirl

    Comment


      #3
      Gumslone thanks a lot!!!

      Comment


        #4
        thats real good gumslone i put it on my site n just made it web by replacing header




        PHP Code:
        <?php

        include("config.inc.php");

        header("Cache-Control: no-cache, must-revalidate");
        echo 
        "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>";
        echo 
        "<!DOCTYPE html PUBLIC \"-//WAPFORUM//DTD XHTML Mobile 1.0//EN\"\"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\">";
        echo 
        "<html xmlns=\"http://www.w3.org/1999/xhtml\">";

            echo 
        "<head>";
            echo 
        "<title>$stitle</title>";
            echo 
        "<link rel=\"StyleSheet\" type=\"text/css\" href=\"theme/theme.css\" />";
            echo 
        "</head>";

        ?>

        <head>
        <META HTTP-EQUIV="Refresh" Content="10">
        </head>
        <?php

            
        echo "<body>";


        echo 
        "<p align=\"center\">";

        echo 
        "Live Score:
        ---
        "
        ;
        $feed "http://www.scorespro.com/rss/live-soccer.xml";
        $fp = @fopen($feed,"r");
        while(!
        feof($fp)) $raw .= @fgets($fp4096);
        fclose($fp);
        if( 
        eregi("<item>(.*)</item>"$raw$rawitems ) ) {
        $items explode("<item>"$rawitems[0]);

          
        $p 5;
          if (
        $npage == "")$npage "1";
          
        $countfilecount($items);
          
        $countfile=$countfile-2;
          
        $first=($npage*$p)-$p;
          
        $npages ceil($countfile $p);
          
        $items array_reverse($items);
          
        $next_arrays=($first+($p-1));
          if(
        $next_arrays>$countfile)$next_arrays=$countfile;
          for (
        $i=($first); $i <= $next_arrays$i++) {
          
        eregi("<title>(.*)</title>",$items[$i+1], $title );
          
        eregi("<link>(.*)</link>",$items[$i+1], $url );
          
        eregi("<description>(.*)</description>",$items[$i+1], $description);

          
        #$title[1] = str_replace("'", "", $title[1]);
          
        $title[1] = str_replace("& ""&amp;"$title[1]);
          echo 
        $title[1].'
        '
        ;

          }
        }
        if (
        $npage <= $npages and $npage>1$gline_rew '[url="'.$_SERVER["]Prev[/url] ';
        if (
        $npages > 1 and $npage<$npages$gline_next = ' [url="'.$_SERVER["]Next[/url]';
        echo 
        "
        ---
        Page 
        {$npage} of {$npages}
        "
        .$gline_rew.$gline_next."
        ---
        "
        ;

        echo 
        "</small>\n";
        echo 
        "</p>";
        echo 
        "</body>";
        echo 
        "</html>";
        ?>
        Last edited by arnage; 11.09.12, 18:18.

        Comment


          #5
          Hey guys,

          Is this still working? How to implement it?

          Comment

          Working...
          X