News script


Posted on 16th Feb 2014 07:03 pm by admin

Hi ...

I am not sure if this is the rite place to post this but if its not sorry

i am new here and need help with my cricket scores script now the code works well i just cant get the next or prev to work

so when i click next it stays on the same page with the same items this is my code

Code: <?php
$ShowBookmark = "False";
include 'Include/Header.php';
?>
<div class="hd2"><center><font face="Verdana" size="3"><b>Daily Cricket News</b></font></center></div>
<?php

extract($_REQUEST);

$feed = "http://content-www.cricinfo.com/rss/content/feeds/news/0.xml";
$fp = @fopen($feed,"r");
if(!$fp)
{
echo"Cannot Connect to read info<br/>";
echo"Try Again Later <br/>";
} else
{
while(!feof($fp)) $raw .= @fgets($fp, 4096);
fclose($fp);
if( eregi("<item>(.*)</item>", $raw, $rawitems ) ) {
$items = explode("<item>", $rawitems[0]);

$m4u_items_per_page = 5;
if ($m4u == "")$m4u = "1";
$countfile= count($items);
$countfile=$countfile-2;
$first=($m4u*$m4u_items_per_page)-$m4u_items_per_page;
$m4u_pages = ceil($countfile / $m4u_items_per_page);


$next_arrays=($first+($m4u_items_per_page-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);
eregi("<pubDate>(.*)</pubDate>",$items[$i+1], $pubDate);


$url[1] = str_replace("<![CDATA[", "", $url[1]);
$url[1] = str_replace("]]>", "", $url[1]);
$url[1] = str_replace("<![CDATA[", "", $url[1]);
$title[1] = str_replace("'", "", $title[1]);
$title[1] = str_replace("&amp;", "&", $title[1]);
$title[1] = str_replace("&lt;", "<", $title[1]);
$title[1] = str_replace("&gt;", ">", $title[1]);
$title[1] = str_replace("<![CDATA[", "", $title[1]);
$title[1] = str_replace("]]>", "", $title[1]);
$description[1] = str_replace("&amp;", "&", $description[1]);
$description[1] = str_replace("&lt;", "<", $description[1]);
$description[1] = str_replace("&gt;", ">", $description[1]);
$description[1] = str_replace("'", "'", $description[1]);
$description[1] = str_replace("<![CDATA[", "", $description[1]);
$description[1] = str_replace("]]>", "", $description[1]);


echo '<font face="Verdana" size="2"><u><b> '.$title[1].'</font></u></b>
';
echo '<font face="Verdana" size="2">'.$description[1].'</font>

';

}
}
}

if ($m4u_pages>1) {

echo "<hr/>";
echo "Page {$m4u} of {$m4u_pages}<br/>";
}
if ($m4u <= $m4u_pages and $m4u>1) $m4u_prew = '<a href="news.php?npage='.($m4u-1).'"><- prev<br/></a> ';
if ($m4u_pages > 1 and $m4u<$m4u_pages) $m4u_next = ' <a href="news.php?npage='.($m4u+1).'">next -></a>';
if ($m4u_pages>1) {
echo "<b>".$m4u_prew.$m4u_next."</b><br/>";
}
?>

<div class="menu">


</div>
<tr style="font-color:#85859c;"><td style="width:10px;"><img src="Images/Logos/Logo_Back.gif"></td><td>
<font face="Verdana" size="2"><b><a href="index.php?cmd=100">Back</b></font></a>

</td></tr>
</table>
<hr>

<?php include 'Include/Footer.php'; Log_Hit("CricketNews"); ?>

No comments posted yet

Your Answer:

Login to answer
123 Like 25 Dislike
Previous forums Next forums
Other forums

Why does first ever HttpSendRequest take longer?
I promise this isn't as simple as it sounds. I'm wondering why the the first ever call to HttpSendRe

Header redirect
Hello ive got a problem ive got form with its action set to itself.
Code: <form id="f

Parse multirow HTML table
Hello all,
I have a site I am working on. Its a sports site and I am trying to add stats to a DB

How to have a log of all the status a VIM document had been ?
Hi guys,

I’m using SAP Invoice Management plugin and the /OPT/VIM_ANALYTICS transa

Extending Exception to contain method name
I was wondering, if there's a way to extend Exception in such a way, that it would contain name of a

How can i steam a video on my PHP site? (non YouTube)
Basically I have a PHP site and don't want to give page rank to YouTube. I just want to stream a bas

Transferring session variables into MySQL
I am trying to transfer $_SESSION variables into MySQL. However there is an error in my MySQL statem

preg_replace question
Hello!!

I hope someone can help me with preg_replace.

I load two tables from an extern

Weekly Calendar
Hi, I am looking at creating a weekly calendar. The calendar will read from Monday - Sunday. Does an

php require help needed
Ok i tried to use the search funtion but the word require is everywhere.

i'm really new to cr

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash