User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 373,933 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 3,155 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: 3641 | Replies: 0
Reply
Join Date: Feb 2004
Posts: 56
Reputation: rex_b is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 0
rex_b's Avatar
rex_b rex_b is offline Offline
Junior Poster in Training

phpBB thread archive

  #1  
May 14th, 2004
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]
Hacks for vBulletin here
AddThis Social Bookmark Button
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb PHP Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the PHP Forum

All times are GMT -4. The time now is 6:16 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC