mg8
09-28-2003, 10:23 AM
Ok. This is what the file will look like:
[c olor= orange]1[/ color][ c olor=green]12,000 [ /color]name
Well, it just repeats with different rank, post count (which is the 12k) and the name.
Well, I want to read the file and then use the 12k number and subtract (use gmp_sub) it from a new number and then store it in a variable.
The entire script so far is this:
<?php
set_time_limit(100777);
$firstmarkup = "";
$markup1 = "";
$secondmarkup = "";
$fourthmarkup = "";
$three = trim($thirdmarkup);
echo ("DragonBall Member Update<br><br>");
$names=file("names.txt");
for($i=0;$i<sizeof($names);$i++){
$fname="http://users.ign.com/about/".trim($names[$i]);
$userpage=fread(fopen($fname,"r"),900000);
eregi('Posts:</B> </td>
([ ]*)?<td class="BoardRowB">(.*)? <a href(.*)?view latest posts', $userpage,$regs);
$mu[$names[$i]]=str_replace(",","",$regs[2]);
}
arsort($mu, SORT_NUMERIC);
$rank=0;
$srank=0;
while(list($name,$pc) = each($mu)){
$rank++;
echo "$firstmarkup$rank$markup1 ".ereg_replace("(.+)(.{3})$","\\1,\\2",$pc)."
$secondmarkup$name$three$name$fourthmarkup <br>";
}
echo "<br>Top 10<br><br>";
while($srank<10) {
$srank++;
echo "$srank $mu<BR>";
}
?>
When I run the script, I will copy what it prints out and then save it as a text file (which will be used as the old number to compare with).
This may be real confusing.
Basically, I want it to print out how many posts he has gained since the last time I ran the script.
Thanks :)
[c olor= orange]1[/ color][ c olor=green]12,000 [ /color]name
Well, it just repeats with different rank, post count (which is the 12k) and the name.
Well, I want to read the file and then use the 12k number and subtract (use gmp_sub) it from a new number and then store it in a variable.
The entire script so far is this:
<?php
set_time_limit(100777);
$firstmarkup = "";
$markup1 = "";
$secondmarkup = "";
$fourthmarkup = "";
$three = trim($thirdmarkup);
echo ("DragonBall Member Update<br><br>");
$names=file("names.txt");
for($i=0;$i<sizeof($names);$i++){
$fname="http://users.ign.com/about/".trim($names[$i]);
$userpage=fread(fopen($fname,"r"),900000);
eregi('Posts:</B> </td>
([ ]*)?<td class="BoardRowB">(.*)? <a href(.*)?view latest posts', $userpage,$regs);
$mu[$names[$i]]=str_replace(",","",$regs[2]);
}
arsort($mu, SORT_NUMERIC);
$rank=0;
$srank=0;
while(list($name,$pc) = each($mu)){
$rank++;
echo "$firstmarkup$rank$markup1 ".ereg_replace("(.+)(.{3})$","\\1,\\2",$pc)."
$secondmarkup$name$three$name$fourthmarkup <br>";
}
echo "<br>Top 10<br><br>";
while($srank<10) {
$srank++;
echo "$srank $mu<BR>";
}
?>
When I run the script, I will copy what it prints out and then save it as a text file (which will be used as the old number to compare with).
This may be real confusing.
Basically, I want it to print out how many posts he has gained since the last time I ran the script.
Thanks :)