•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 374,019 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,751 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 3645 | Replies: 0
![]() |
I found this script to convert my phpbb threads and so forth to htm as an archiver.
I can see the forums , then you click and can see the topics, then you click and it becomes a blank page where the posts are suppose to be.
Any guesses?
location of archive www.religiousforums.com/parkweb/archiver/
here is the code:
[PHP] <?php
//####################################################################################
//### phpBB2 HTML Archiver
//## Script created by http://ScriptWiz.com##
//### Copyright info MUST stay on the bottom of all scripts ####
//#### Visit http://www.ScriptWiz.com/phpbb-html-archiver.html for full release and instructions ####
//####################################################################################
//configure archiver
$title = "Religious Forums Chat and Debate;";
$domain = "http://www.religiousforums.com";
$bburl = "http://www.religiousforums.com/parkweb/";
$path = "/parkweb/archiver/"; //this is path from the root folder like /archive/
//no need to change anything below this line
$asked = substr($_SERVER['REQUEST_URI'],strlen($path));
//-----------------------------------------------------------------
function GetForumsByCategory($cid)
{
global $domain,$path;
$level = 2;
$res = mysql_query("select forum_id,forum_name,forum_desc from ".FORUMS_TABLE." where cat_id=$cid and auth_view=0 order by forum_order");
$started = false;
$indent = str_repeat("\t",$level);
while ($row = mysql_fetch_row($res))
{
if (!$started)
{
$started = true;
echo $indent."<ul>\n";
}
echo $indent."\t<li><h$level><a href=\"$domain$path".preparename($row[1])."-{$row[0]}/\">{$row[1]}</a></h$level><br><a href='$domain$path".preparename($row[1])."-{$row[0]}.html' style='color:black'>{$row[2]}</a></li>\n";
}
if ($started)
echo $indent."</ul>\n";
}
//-----------------------------------------------------------------
function ExtractExtension($filename)
{
return strtolower(substr($filename,strrpos($filename,'.')+1));
}
//-----------------------------------------------------------------
function PrepareName($s)
{
$abc = "1234567890abcdefghijklmnopqrstuvwxyz_";
$s = strtolower($s);
$r = "";
for($i=0;$i<strlen($s);$i++)
{
if (strpos($abc,$s[$i])!==false)
$r .= $s[$i];
if (($s[$i]==' ')&&($r[strlen($r)-1]!=' '))
$r .= ' ';
}
$r = trim($r);
return str_replace(' ','-',$r);
}
//-----------------------------------------------------------------
function webousshutdown()
{
die('<div align=center><b><a href="http://Scriptwiz.com/scriptwiz-phpbb-html-archiver.html" target="_new">ScriptWiz.com phpbb HTML Archiver</a></b> - Created by <a href="http://www.ScriptWiz.com/">ScriptWiz.com</a> and released by <a href="http://www.skinz.org/">Skinz.org</a><br></div></body></html>');
}
register_shutdown_function("webousshutdown");
$webous = array();
if (ExtractExtension($asked)=='htm')
{//someone wants to read SEF thread
ob_start();
echo "<base href=\"$bburl/\">\n";
$asked = substr($asked,0,-4);
$webous = array();
$webous['t'] = substr($asked,strrpos($asked,'-')+1);
if (strpos($webous['t'],'_')!==false)
list($webous['t'],$webous['start']) = explode('_',$webous['t']);
$_GET = array_merge($_GET,$webous);
$HTTP_GET_VARS = array_merge($HTTP_GET_VARS,$webous);
extract($webous);
chdir("./..");
require ("viewtopic.php");
die("");
}
if (ExtractExtension($asked)=='html')
{
ob_start();
echo "<base href=\"$bburl/\">\n";
$asked = substr($asked,0,-5);
if (substr($asked,0,6)=='member')
{//show profile
$webous = array('mode'=>'viewprofile');
$webous['u'] = substr($asked,strrpos($asked,'-')+1);
$_GET = array_merge($_GET,$webous);
$HTTP_GET_VARS = array_merge($HTTP_GET_VARS,$webous);
extract($webous);
chdir("./..");
require ("profile.php");
}
else{
$webous = array();
$webous['f'] = substr($asked,strrpos($asked,'-')+1);
$_GET = array_merge($_GET,$webous);
$HTTP_GET_VARS = array_merge($HTTP_GET_VARS,$webous);
extract($webous);
chdir("./..");
require ("viewforum.php");
}
die();
}
//it's not a wrapper, we shall to show some listing: index, members of topis
$phpbb_root_path = './../';
require ("./../config.php");
DEFINE ("IN_PHPBB","WEBOUS");
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
require ("./../includes/constants.php");
@mysql_connect ($dbhost,$dbuser,$dbpasswd) or Die("Database Server is Busy. Try later.");
@mysql_select_db ($dbname) or Die("Database Server is Busy. Try later.");
if (($asked=="members")||($asked=="members/"))
{
echo "<html><title>$title Forum Members</title>\n";
include ("./header.htm");
$res = mysql_query("select user_id,username from ".USERS_TABLE." where user_id>0 and user_active=1 order by username");
echo "<h1>Forum members</h1>\n<ul>";
while ($row = mysql_fetch_row($res))
{
echo "\t<li><a href=\"$domain{$path}member-".PrepareName($row[1])."-{$row[0]}.html\">{$row[1]}</a></li>\n";
}
echo "</ul>\n";
die();
}
if (strpos($asked,'-')!==false)
{//seemes to be forum listing
$id = intval(substr($asked,strrpos($asked,'-')+1));
$res = mysql_query("select forum_name from ".FORUMS_TABLE." where forum_id=$id");
$forum = mysql_fetch_row($res);
if (!$forum) die("Forum not found");
$res = mysql_query("select config_value from ".CONFIG_TABLE." where config_name='posts_per_page'");
$set = mysql_fetch_row($res); $onp = $set[0];
//here we will list all topics from $id forum
echo "<html><title>$title {$forum[0]} topics</title>\n";
include ("./header.htm");
$res = mysql_query("select topic_id,topic_title,topic_replies from ".TOPICS_TABLE." where forum_id=$id order by topic_last_post_id desc");
echo "<h1>{$forum[0]} topics</h1>\n<ul>";
while ($row = mysql_fetch_row($res))
{
$name = PrepareName($row[1]);
echo "\t<li><a href=\"$domain$path$name-{$row[0]}.htm\">{$row[1]}</a>";
$total = $row[2]+1;
$last = intval($total/$onp+1);
if ($total % $onp == 0) $last--;
if ($last>1)
{
echo " (";
for($p=1;$p<=$last;$p++)
{
if ($p>1) echo " ";
$r = ($p-1)*$onp;
echo "<a href=\"$domain$path$name-{$row[0]}_$r.htm\">$p</a>";
}
echo ")";
}
echo "</li>\n";
}
echo "</ul>\n";
die();
}
//showing index:
echo "<html><title>$title Forum Archive</title>\n";
include ("./header.htm");
echo "<ul>";
$res = mysql_query("select cat_id,cat_title from ".CATEGORIES_TABLE." order by cat_order ASC");
while ($row = mysql_fetch_row($res))
{
echo "\t<li><h1>{$row[1]}</h1></li>\n";
GetForumsByCategory($row[0]);
}
echo "\t<li><h1><a href=\"$domain$path"."members/\">Forum Members</a></h1><br>Alphabetical list of all members</li>\n";
echo "</ul>";
mysql_close();
?> [/PHP]
I can see the forums , then you click and can see the topics, then you click and it becomes a blank page where the posts are suppose to be.
Any guesses?
location of archive www.religiousforums.com/parkweb/archiver/
here is the code:
[PHP] <?php
//####################################################################################
//### phpBB2 HTML Archiver
//## Script created by http://ScriptWiz.com##
//### Copyright info MUST stay on the bottom of all scripts ####
//#### Visit http://www.ScriptWiz.com/phpbb-html-archiver.html for full release and instructions ####
//####################################################################################
//configure archiver
$title = "Religious Forums Chat and Debate;";
$domain = "http://www.religiousforums.com";
$bburl = "http://www.religiousforums.com/parkweb/";
$path = "/parkweb/archiver/"; //this is path from the root folder like /archive/
//no need to change anything below this line
$asked = substr($_SERVER['REQUEST_URI'],strlen($path));
//-----------------------------------------------------------------
function GetForumsByCategory($cid)
{
global $domain,$path;
$level = 2;
$res = mysql_query("select forum_id,forum_name,forum_desc from ".FORUMS_TABLE." where cat_id=$cid and auth_view=0 order by forum_order");
$started = false;
$indent = str_repeat("\t",$level);
while ($row = mysql_fetch_row($res))
{
if (!$started)
{
$started = true;
echo $indent."<ul>\n";
}
echo $indent."\t<li><h$level><a href=\"$domain$path".preparename($row[1])."-{$row[0]}/\">{$row[1]}</a></h$level><br><a href='$domain$path".preparename($row[1])."-{$row[0]}.html' style='color:black'>{$row[2]}</a></li>\n";
}
if ($started)
echo $indent."</ul>\n";
}
//-----------------------------------------------------------------
function ExtractExtension($filename)
{
return strtolower(substr($filename,strrpos($filename,'.')+1));
}
//-----------------------------------------------------------------
function PrepareName($s)
{
$abc = "1234567890abcdefghijklmnopqrstuvwxyz_";
$s = strtolower($s);
$r = "";
for($i=0;$i<strlen($s);$i++)
{
if (strpos($abc,$s[$i])!==false)
$r .= $s[$i];
if (($s[$i]==' ')&&($r[strlen($r)-1]!=' '))
$r .= ' ';
}
$r = trim($r);
return str_replace(' ','-',$r);
}
//-----------------------------------------------------------------
function webousshutdown()
{
die('<div align=center><b><a href="http://Scriptwiz.com/scriptwiz-phpbb-html-archiver.html" target="_new">ScriptWiz.com phpbb HTML Archiver</a></b> - Created by <a href="http://www.ScriptWiz.com/">ScriptWiz.com</a> and released by <a href="http://www.skinz.org/">Skinz.org</a><br></div></body></html>');
}
register_shutdown_function("webousshutdown");
$webous = array();
if (ExtractExtension($asked)=='htm')
{//someone wants to read SEF thread
ob_start();
echo "<base href=\"$bburl/\">\n";
$asked = substr($asked,0,-4);
$webous = array();
$webous['t'] = substr($asked,strrpos($asked,'-')+1);
if (strpos($webous['t'],'_')!==false)
list($webous['t'],$webous['start']) = explode('_',$webous['t']);
$_GET = array_merge($_GET,$webous);
$HTTP_GET_VARS = array_merge($HTTP_GET_VARS,$webous);
extract($webous);
chdir("./..");
require ("viewtopic.php");
die("");
}
if (ExtractExtension($asked)=='html')
{
ob_start();
echo "<base href=\"$bburl/\">\n";
$asked = substr($asked,0,-5);
if (substr($asked,0,6)=='member')
{//show profile
$webous = array('mode'=>'viewprofile');
$webous['u'] = substr($asked,strrpos($asked,'-')+1);
$_GET = array_merge($_GET,$webous);
$HTTP_GET_VARS = array_merge($HTTP_GET_VARS,$webous);
extract($webous);
chdir("./..");
require ("profile.php");
}
else{
$webous = array();
$webous['f'] = substr($asked,strrpos($asked,'-')+1);
$_GET = array_merge($_GET,$webous);
$HTTP_GET_VARS = array_merge($HTTP_GET_VARS,$webous);
extract($webous);
chdir("./..");
require ("viewforum.php");
}
die();
}
//it's not a wrapper, we shall to show some listing: index, members of topis
$phpbb_root_path = './../';
require ("./../config.php");
DEFINE ("IN_PHPBB","WEBOUS");
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
require ("./../includes/constants.php");
@mysql_connect ($dbhost,$dbuser,$dbpasswd) or Die("Database Server is Busy. Try later.");
@mysql_select_db ($dbname) or Die("Database Server is Busy. Try later.");
if (($asked=="members")||($asked=="members/"))
{
echo "<html><title>$title Forum Members</title>\n";
include ("./header.htm");
$res = mysql_query("select user_id,username from ".USERS_TABLE." where user_id>0 and user_active=1 order by username");
echo "<h1>Forum members</h1>\n<ul>";
while ($row = mysql_fetch_row($res))
{
echo "\t<li><a href=\"$domain{$path}member-".PrepareName($row[1])."-{$row[0]}.html\">{$row[1]}</a></li>\n";
}
echo "</ul>\n";
die();
}
if (strpos($asked,'-')!==false)
{//seemes to be forum listing
$id = intval(substr($asked,strrpos($asked,'-')+1));
$res = mysql_query("select forum_name from ".FORUMS_TABLE." where forum_id=$id");
$forum = mysql_fetch_row($res);
if (!$forum) die("Forum not found");
$res = mysql_query("select config_value from ".CONFIG_TABLE." where config_name='posts_per_page'");
$set = mysql_fetch_row($res); $onp = $set[0];
//here we will list all topics from $id forum
echo "<html><title>$title {$forum[0]} topics</title>\n";
include ("./header.htm");
$res = mysql_query("select topic_id,topic_title,topic_replies from ".TOPICS_TABLE." where forum_id=$id order by topic_last_post_id desc");
echo "<h1>{$forum[0]} topics</h1>\n<ul>";
while ($row = mysql_fetch_row($res))
{
$name = PrepareName($row[1]);
echo "\t<li><a href=\"$domain$path$name-{$row[0]}.htm\">{$row[1]}</a>";
$total = $row[2]+1;
$last = intval($total/$onp+1);
if ($total % $onp == 0) $last--;
if ($last>1)
{
echo " (";
for($p=1;$p<=$last;$p++)
{
if ($p>1) echo " ";
$r = ($p-1)*$onp;
echo "<a href=\"$domain$path$name-{$row[0]}_$r.htm\">$p</a>";
}
echo ")";
}
echo "</li>\n";
}
echo "</ul>\n";
die();
}
//showing index:
echo "<html><title>$title Forum Archive</title>\n";
include ("./header.htm");
echo "<ul>";
$res = mysql_query("select cat_id,cat_title from ".CATEGORIES_TABLE." order by cat_order ASC");
while ($row = mysql_fetch_row($res))
{
echo "\t<li><h1>{$row[1]}</h1></li>\n";
GetForumsByCategory($row[0]);
}
echo "\t<li><h1><a href=\"$domain$path"."members/\">Forum Members</a></h1><br>Alphabetical list of all members</li>\n";
echo "</ul>";
mysql_close();
?> [/PHP]
Hacks for vBulletin here
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb PHP Marketplace
Similar Threads
- phpbb v vBulletin - from an SEO point of view (Growing an Online Community)
- [For Hire] Freelance phpBB Installation Services (Post your Resume)
- PhpBB vs VBulletin (Growing an Online Community)
- Would love constructive criticism for my redesigned NFL site (Website Reviews)
- 404 Error - Page not found (DaniWeb Community Feedback)
- How to change thread titles in the archive section (Search Engine Optimization)
Other Threads in the PHP Forum
- Previous Thread: Can't see mysql records using php in any browser
- Next Thread: Having trouble with links on PHP site! Any help would be great!


Linear Mode