Ok...so I'm trying to get a function to get information from an invisionfree forum...ie Active Members/Guests/Hidden Users....total posts....List of users currently on....stuff like that. I know you need to use file_get_contents() to get the code, but once I get that, I'm stuck. The page I'm specifically doing this for is http://omnimaga.dyndns.org/index.php?act=idx but it really should work for any invisionfree forum.
The information that i need is in this part of the string:
HTML Code:
<br /><!-- Board Stats --><!--IBF.QUICK_LOG_IN--><br /><div align='center'><a href='http://omnimaga.dyndns.org/index.php?amp;act=Stats&CODE=leaders'>The moderating team</a> |
<a href='http://omnimaga.dyndns.org/index.php?amp;act=Search&CODE=getactive'>Today's active topics</a> |
<a href='http://omnimaga.dyndns.org/index.php?amp;act=Stats'>Today's top 10 posters</a> |
<a href='http://omnimaga.dyndns.org/index.php?amp;act=Members&max_results=10&sort_key=posts&sort_order=desc'>Overall top 10 posters</a></div><br /><div class="tableborder"><div class="maintitle">Board Statistics</div><table cellpadding='4' cellspacing='1' border='0' width='100%'><tr><td class='pformstrip' colspan='2'>17 user(s) active in the past 60 minutes</td></tr><tr><td width="5%" class='row2'><img src='http://omnimaga.unitedti.org/sphere2.gif' border='0' alt=''></td><td class='row4' width='95%'><b>10</b> guests, <b>6</b> members, <b>1</b> anonymous members
<div class='thin'><a href='http://omnimaga.dyndns.org/index.php?amp;showuser=11'><span style='color:#009'><b>tenniskid493</b></span></a>,
<a href='http://omnimaga.dyndns.org/index.php?amp;showuser=104'><span style='color:#800'><b>Killerplayer</b></span></a>,
<a href='http://omnimaga.dyndns.org/index.php?amp;showuser=95'><span style='color:#800'><b>Super Speler</b></span></a>,
<a href='http://omnimaga.dyndns.org/index.php?amp;showuser=26'><span style='color:#005000'><b>Ranman</b></span></a>,
<a href='http://omnimaga.dyndns.org/index.php?amp;showuser=193'><span style='color:#800'><b>netham45</b></span></a>,
<a href='http://omnimaga.dyndns.org/index.php?amp;showuser=3'><span style='color:#005000'><b>rivereye</b></span></a></div>
Show detailed list by: <a href='http://omnimaga.dyndns.org/index.php?amp;act=Online&CODE=listall&sort_key=click'>Last Click</a>, <a href='http://omnimaga.dyndns.org/index.php?amp;act=Online&CODE=listall&sort_key=name&sort_order=asc&show_mem=reg'>Member Name</a></td></tr><tr><td class='pformstrip' colspan='2'>Today's Birthdays</td></tr><tr><td class='row2' width='5%' valign='middle'><img src='http://omnimaga.unitedti.org/sphere2.gif' border='0' alt=''></td><td class='row4' width='95%'><b></b> No members are celebrating a birthday today<br /></td></tr><tr><td class='pformstrip' colspan='2'>Board Statistics</td></tr><tr><td class='row2' width='5%' valign='middle'><img src='http://omnimaga.unitedti.org/sphere2.gif' border='0' alt=''></td><td class='row4' width="95%" align='left'>Our members have made a total of <b>14131</b> posts<br />We have <b>129</b> registered members<br />The newest member is <b><a href='http://omnimaga.dyndns.org/index.php?amp;showuser=199'>Weregoose</a></b><br />Most users ever online was <b>31</b> on <b>25 Sep, 2006, 22:21</b></td></tr></table></div>
Can someone help me out with the string manipulation to store the information into variables. I would need, the total number of posts, number of registered users, newest member, most users online and date, today's birthdays, the current list of active members, and # of active Members/Guests/Hidden Members.
$ar = explode('\n', $str);
foreach($ar as $line) {
$results = array();
$myData = preg_match('/yur pattern to match/', $line, $results);
if( $results )
// walk through the array or returned pattern matches.
Not gonna try to write the actual code for you but maybe that will get you pointed in the right direction.
Bookmarks