Jump to content

phpBB reader


mattd8752

Recommended Posts

I am working on a site that can open and read phpBB forums and read things like: the sections they have, the ids for each forum (what this current script is doing) and things like that, listing everything you can possibly obtain from the forums in a report, how many user groups, how many posts they have, everything!  Well, thats the base of everything, but right now I have the code:

 

<?php
function between($beg, $end, $str){
$a = explode($beg, $str, 2);
$b = explode($end, $a[1]);
return $beg . $b[0] . $end;
}

// Get a file into an array.  In this example we'll go through HTTP to get
// the HTML source of a URL.
$lines = file('http://www.phpbb.com/phpBB/');
$var = '';
$running = 'yes';
// Loop through our array, show HTML source as HTML source; and line numbers too.
foreach ($lines as $line_num => $line) {

if($running == 'yes'){
$var = between('viewforum.php?f=', '"', $line);

}
}
$var = str_replace('viewforum.php?f=', '', $var);
$replace = array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '<', '>', '=', '(', ')', '|', '/', '.', '\'', '_', '-', '"', '?', ':', ';', '&');
$var = str_replace($replace, '', $var);
echo $var;




?>

which returns nothing.  I realize that is VERY messy.  If you have any ideas of how I should redo them, please post.  I am almost positive I am going to have to do this, so please post solutions, or possible ways to redo this.  I need to separate the forum ids.  I also need to be able read things like how many views their are in each section (so I can give a total) and how many posts (for a total again).  If anyone has any solutions please post em.  I hope someone can get me started on a new code, or show me how to effectively mod my code.

Link to comment
https://forums.phpfreaks.com/topic/37951-phpbb-reader/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.