live scores

Started on the old forum in March 2011 · view the original in the archive · old links redirect here

#live-scores

10 replies · 1,094 views · started 15 years ago · 1 min read

4 participants
Kirsty Developer · 59 posts #1

can anyone help me with live scores all that comes up is this page refreshes every 2mins the code i have for live scores is

<?php
define('WCS',true);
include('./core/main.inc');
header_type();
cleardata();
if(ipbanned(ip(),browser())){
if(!shield(getuid_sid($sid))){
echo head_tag("Ip Blocked!!!",0,0);
echo ipbanned_msg();
echo foot_tag();
exit();
}
}
if(!islogged($sid)){
echo head_tag("Error!!!",0,0);
echo session_expired();
echo foot_tag();
exit();
}
if(banned(getuid_sid($sid))){
echo head_tag("Error!!!",1,getnick_sid($sid));
echo banned_msg($sid);
echo foot_tag();
exit();
}
mysql_query("UPDATE users SET browser='".browser()."', ipaddress='".ip()."', host='".subno()."' WHERE id='".getuid_sid($sid)."'");

////////////////////////////////////////MAIN PAGE
if($action=="main")
{
addonline(getuid_sid($sid),"Checking Footy Scores","");
$nick=getnick_sid($sid);
echo head_tag(getnick_sid($sid)."@Live Scores",1,getnick_sid($sid));

$title="<b>Live Football 
Scores</b>";

      echo "<meta http-equiv=\"refresh\" content=\"120; url=scores.php?action=main&sid=$sid\">";

  $main.= "<p align=\"center\">";
$main.="Scores refresh every 2 mins<br/><br/>";
//$feed = "http://www.scorespro.com/rss/live-soccer.xml";

$feed = "http://www.soccerstand.com/rss/soccer/en/today";

$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 = 50;
  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], $title1 );
  eregi("<link>(.*)</link>",$items[$i+1], $url );
  eregi("<description>(.*)</description>",$items[$i+1], $description);

  #$title1[1] = str_replace("'", "", $title1[1]);
  $title1[1] = str_replace("& ", "&", $title1[1]);
$main.="<small>";
  $main.= $title1[1].'<br/><br/>';
$main.="</small>";
  }
}
if ($npage <= $npages and $npage>1) $gline_rew = '<a href="'.$_SERVER["PHP_SELF"].'?npage='.($npage-1).'"&sid=$sid>Prev</a> ';
if ($npages > 1 and $npage<$npages) $gline_next = ' <a href="'.$_SERVER["PHP_SELF"].'?npage='.($npage+1).'"&sid=$sid>Next</a>';
//$main.= "<br/>Page {$npage} of {$npages}<br/>".$gline_rew.$gline_next."<br/>";

    $main.= "</p>";    

  $main.= "<p align=\"center\">";
$L1="$sixkey<a $key6 href=\"./inbox/inbox.php?sid=$sid\">Inbox</a>";
$L2="$sevenkey<a $key7 href=\"./buds/buds.php?sid=$sid\">BuddyList</a>";
$L3="$eightkey<a $key8 href=\"./chat/public.php?sid=$sid\">Chat</a>";
$L4="$ninekey<a $key9 href=\"./forums/forums.php?sid=$sid\">Forums</a>";
$L5="$zerokey<a $key0 href=\"./main.php?sid=$sid\"><img src=\"./images/home.gif\" alt=\"\"/>Main Menu</a>";
echo xhtml($sid,$title,1,$L1,$L2,$L3,$L4,$L5,0,0,0,$main);
echo foot_tag();
exit;
}

else if($action=="admin")
{
addonline(getuid_sid($sid),"Requesting Admin","");
$nick=getnick_sid($sid);
echo head_tag(getnick_sid($sid)."@Requesting Admin",1,getnick_sid($sid));

$title="<b>Admin Request</b>";
  $main.= "<p align=\"center\">";

    $ownid[0]=1;
    $who=$_GET["whoid"];
    $whoid=$_GET["who"];
  $message = $_POST["message"];
  $message3 = "AUTOMATED PM[br/][br/]".$nick." has requested to be site admin, please contact them directly regarding this matter";

    //mysql_query("INSERT INTO ibwf_private SET text='".$message3."', byuid='".$uid."', touid='".$ownid[0]."', unread='1', timesent='".time()."'");

   autopm($message3, $ownid[0]);

	$main.="<br/>You have requested an admin job, The site owner will contact you as soon as possible regarding your request<br/>";

$L1="$sixkey<a $key6 href=\"./inbox/inbox.php?sid=$sid\">Inbox</a>";
$L2="$sevenkey<a $key7 href=\"./buds/buds.php?sid=$sid\">BuddyList</a>";
$L3="$eightkey<a $key8 href=\"./chat/public.php?sid=$sid\">Chat</a>";
$L4="$ninekey<a $key9 href=\"./forums/forums.php?sid=$sid\">Forums</a>";
$L5="$zerokey<a $key0 href=\"./main.php?sid=$sid\"><img src=\"./images/home.gif\" alt=\"\"/>Main Menu</a>";
echo xhtml($sid,$title,1,$L1,$L2,$L3,$L4,$L5,0,0,0,$main);
echo foot_tag();
exit;
}
?>

</html>

is there something that needs to go in the database or something missing to get these scores working?

tkreturns Developer · 98 posts #2
<?php echo '<meta http-equiv=Refresh content="0;url=index.php?reload=1">'; ?>

Set content to wateva yu want, content="1" equals 1 sec

ASK FOR HELP

Kirsty Developer · 59 posts #3

im wanting live scores to show up not the refresh

tkreturns Developer · 98 posts #4

........

i am not sure if its working or not but still chk it out.

<?php
define('WCS',true);
include('./core/main.inc');
header_type();
cleardata();
if(ipbanned(ip(),browser())){
if(!shield(getuid_sid($sid))){
echo head_tag("Ip Blocked!!!",0,0);
echo ipbanned_msg();
echo foot_tag();
exit();
}
}
if(!islogged($sid)){
echo head_tag("Error!!!",0,0);
echo session_expired();
echo foot_tag();
exit();
}
if(banned(getuid_sid($sid))){
echo head_tag("Error!!!",1,getnick_sid($sid));
echo banned_msg($sid);
echo foot_tag();
exit();
}
mysql_query("UPDATE users SET browser='".browser()."', ipaddress='".ip()."', host='".subno()."' WHERE id='".getuid_sid($sid)."'");

////////////////////////////////////////MAIN PAGE
if($action=="main")
{
addonline(getuid_sid($sid),"Checking Footy Scores","");
$nick=getnick_sid($sid);
echo head_tag(getnick_sid($sid)."@Live Scores",1,getnick_sid($sid));

$title="<b>Live Football 
Scores</b>";

      echo "<meta http-equiv=\"refresh\" content=\"120; url=scores.php?action=main&sid=$sid\">";

  $main.= "<p align=\"center\">";
$main.="Scores refresh every 2 mins<br/><br/>";
$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 = 50;
  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], $title1 );
  eregi("<link>(.*)</link>",$items[$i+1], $url );
  eregi("<description>(.*)</description>",$items[$i+1], $description);

  #$title1[1] = str_replace("'", "", $title1[1]);
  $title1[1] = str_replace("& ", "&", $title1[1]);
$main.="<small>";
  $main.= $title1[1].'<br/><br/>';
$main.="</small>";
  }
}
if ($npage <= $npages and $npage>1) $gline_rew = '<a href="'.$_SERVER["PHP_SELF"].'?npage='.($npage-1).'"&sid=$sid>Prev</a> ';
if ($npages > 1 and $npage<$npages) $gline_next = ' <a href="'.$_SERVER["PHP_SELF"].'?npage='.($npage+1).'"&sid=$sid>Next</a>';
//$main.= "<br/>Page {$npage} of {$npages}<br/>".$gline_rew.$gline_next."<br/>";

    $main.= "</p>";    

  $main.= "<p align=\"center\">";
$L1="$sixkey<a $key6 href=\"./inbox/inbox.php?sid=$sid\">Inbox</a>";
$L2="$sevenkey<a $key7 href=\"./buds/buds.php?sid=$sid\">BuddyList</a>";
$L3="$eightkey<a $key8 href=\"./chat/public.php?sid=$sid\">Chat</a>";
$L4="$ninekey<a $key9 href=\"./forums/forums.php?sid=$sid\">Forums</a>";
$L5="$zerokey<a $key0 href=\"./main.php?sid=$sid\"><img src=\"./images/home.gif\" alt=\"\"/>Main Menu</a>";
echo xhtml($sid,$title,1,$L1,$L2,$L3,$L4,$L5,0,0,0,$main);
echo foot_tag();
exit;
}

else if($action=="admin")
{
addonline(getuid_sid($sid),"Requesting Admin","");
$nick=getnick_sid($sid);
echo head_tag(getnick_sid($sid)."@Requesting Admin",1,getnick_sid($sid));

$title="<b>Admin Request</b>";
  $main.= "<p align=\"center\">";

    $ownid[0]=1;
    $who=$_GET["whoid"];
    $whoid=$_GET["who"];
  $message = $_POST["message"];
  $message3 = "AUTOMATED PM[br/][br/]".$nick." has requested to be site admin, please contact them directly regarding this matter";

    //mysql_query("INSERT INTO ibwf_private SET text='".$message3."', byuid='".$uid."', touid='".$ownid[0]."', unread='1', timesent='".time()."'");

   autopm($message3, $ownid[0]);

	$main.="<br/>You have requested an admin job, The site owner will contact you as soon as possible regarding your request<br/>";

$L1="$sixkey<a $key6 href=\"./inbox/inbox.php?sid=$sid\">Inbox</a>";
$L2="$sevenkey<a $key7 href=\"./buds/buds.php?sid=$sid\">BuddyList</a>";
$L3="$eightkey<a $key8 href=\"./chat/public.php?sid=$sid\">Chat</a>";
$L4="$ninekey<a $key9 href=\"./forums/forums.php?sid=$sid\">Forums</a>";
$L5="$zerokey<a $key0 href=\"./main.php?sid=$sid\"><img src=\"./images/home.gif\" alt=\"\"/>Main Menu</a>";
echo xhtml($sid,$title,1,$L1,$L2,$L3,$L4,$L5,0,0,0,$main);
echo foot_tag();
exit;
}
?>

</html>

i am not sure if its working or not but still chk it out.

<?php
define('WCS',true);
include('./core/main.inc');
header_type();
cleardata();
if(ipbanned(ip(),browser())){
if(!shield(getuid_sid($sid))){
echo head_tag("Ip Blocked!!!",0,0);
echo ipbanned_msg();
echo foot_tag();
exit();
}
}
if(!islogged($sid)){
echo head_tag("Error!!!",0,0);
echo session_expired();
echo foot_tag();
exit();
}
if(banned(getuid_sid($sid))){
echo head_tag("Error!!!",1,getnick_sid($sid));
echo banned_msg($sid);
echo foot_tag();
exit();
}
mysql_query("UPDATE users SET browser='".browser()."', ipaddress='".ip()."', host='".subno()."' WHERE id='".getuid_sid($sid)."'");

////////////////////////////////////////MAIN PAGE
if($action=="main")
{
addonline(getuid_sid($sid),"Checking Footy Scores","");
$nick=getnick_sid($sid);
echo head_tag(getnick_sid($sid)."@Live Scores",1,getnick_sid($sid));

$title="<b>Live Football 
Scores</b>";

      echo "<meta http-equiv=\"refresh\" content=\"120; url=scores.php?action=main&sid=$sid\">";

  $main.= "<p align=\"center\">";
$main.="Scores refresh every 2 mins<br/><br/>";
$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 = 50;
  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], $title1 );
  eregi("<link>(.*)</link>",$items[$i+1], $url );
  eregi("<description>(.*)</description>",$items[$i+1], $description);

  #$title1[1] = str_replace("'", "", $title1[1]);
  $title1[1] = str_replace("& ", "&", $title1[1]);
$main.="<small>";
  $main.= $title1[1].'<br/><br/>';
$main.="</small>";
  }
}
if ($npage <= $npages and $npage>1) $gline_rew = '<a href="'.$_SERVER["PHP_SELF"].'?npage='.($npage-1).'"&sid=$sid>Prev</a> ';
if ($npages > 1 and $npage<$npages) $gline_next = ' <a href="'.$_SERVER["PHP_SELF"].'?npage='.($npage+1).'"&sid=$sid>Next</a>';
//$main.= "<br/>Page {$npage} of {$npages}<br/>".$gline_rew.$gline_next."<br/>";

    $main.= "</p>";    

  $main.= "<p align=\"center\">";
$L1="$sixkey<a $key6 href=\"./inbox/inbox.php?sid=$sid\">Inbox</a>";
$L2="$sevenkey<a $key7 href=\"./buds/buds.php?sid=$sid\">BuddyList</a>";
$L3="$eightkey<a $key8 href=\"./chat/public.php?sid=$sid\">Chat</a>";
$L4="$ninekey<a $key9 href=\"./forums/forums.php?sid=$sid\">Forums</a>";
$L5="$zerokey<a $key0 href=\"./main.php?sid=$sid\"><img src=\"./images/home.gif\" alt=\"\"/>Main Menu</a>";
echo xhtml($sid,$title,1,$L1,$L2,$L3,$L4,$L5,0,0,0,$main);
echo foot_tag();
exit;
}

else if($action=="admin")
{
addonline(getuid_sid($sid),"Requesting Admin","");
$nick=getnick_sid($sid);
echo head_tag(getnick_sid($sid)."@Requesting Admin",1,getnick_sid($sid));

$title="<b>Admin Request</b>";
  $main.= "<p align=\"center\">";

    $ownid[0]=1;
    $who=$_GET["whoid"];
    $whoid=$_GET["who"];
  $message = $_POST["message"];
  $message3 = "AUTOMATED PM[br/][br/]".$nick." has requested to be site admin, please contact them directly regarding this matter";

    //mysql_query("INSERT INTO ibwf_private SET text='".$message3."', byuid='".$uid."', touid='".$ownid[0]."', unread='1', timesent='".time()."'");

   autopm($message3, $ownid[0]);

	$main.="<br/>You have requested an admin job, The site owner will contact you as soon as possible regarding your request<br/>";

$L1="$sixkey<a $key6 href=\"./inbox/inbox.php?sid=$sid\">Inbox</a>";
$L2="$sevenkey<a $key7 href=\"./buds/buds.php?sid=$sid\">BuddyList</a>";
$L3="$eightkey<a $key8 href=\"./chat/public.php?sid=$sid\">Chat</a>";
$L4="$ninekey<a $key9 href=\"./forums/forums.php?sid=$sid\">Forums</a>";
$L5="$zerokey<a $key0 href=\"./main.php?sid=$sid\"><img src=\"./images/home.gif\" alt=\"\"/>Main Menu</a>";
echo xhtml($sid,$title,1,$L1,$L2,$L3,$L4,$L5,0,0,0,$main);
echo foot_tag();
exit;
}
?>

</html>

ASK FOR HELP

subzero Super moderator Fellow · 3,954 posts #5

eregi is out of date function

Use

preg_match

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... _______…

Kirsty Developer · 59 posts #6

is this correct subzero

subzero wrote: eregi is out of date function

Use

preg_match

so i need to change

if( eregi("<item>(.*)</item>", $raw, $rawitems ) ) { $items = explode("<item>", $rawitems[0]);

to

if( preg_match("<item(.*)</item>", $raw, $rawitems ) ) { $items = explode("<item>", $rawitems[0]);

arnage Lead · 811 posts #7
if(preg_match("/<item(.*)</item>/i", $raw, $rawitems ) ) {
$items = explode("<item>", $rawitems[0]);

Need /

<!DOCTYPE html PUBLIC "-//***WAPFORUM**.**RS***
Kirsty Developer · 59 posts #8

arnage wrote:

if(preg_match("/<item(.*)</item>/i", $raw, $rawitems ) ) {
$items = explode("<item>", $rawitems[0]);

Need /

i tried

if(preg_match("/<item(.*)</item>/i", $raw, $rawitems ) ) { $items = explode("<item>", $rawitems[0]);

and

if( preg_match("<item(.*)</item>", $raw, $rawitems ) ) { $items = explode("<item>", $rawitems[0]);

but they just bring up errors

i tried messing around with it to get it to work but no joy, does anyone have a working scores.php please

subzero Super moderator Fellow · 3,954 posts #9

Sample

if (preg_match('/.jpg/i', $file))
if (preg_match("/<item(.*)</item>/i", $raw, $rawitems ) )) {
$items = explode("<item>", $rawitems[0]);

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... _______…

Kirsty Developer · 59 posts #10

subzero wrote: Sample

if (preg_match('/.jpg/i', $file))
if (preg_match("/<item(.*)</item>/i", $raw, $rawitems ) )) {
$items = explode("<item>", $rawitems[0]);

so i need to put if (preg_match('/.jpg/i', $file)) in the script with if (preg_match("/<item(.*)</item>/i", $raw, $rawitems ) )) { $items = explode("<item>", $rawitems[0]);

subzero Super moderator Fellow · 3,954 posts #11

No that is only a sample lol

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... _______…

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