Beamin1 -
Joined: 25 Oct 2003 Posts: 27
|
Posted: Wed Aug 25, 2004 10:26 am Post subject: Problem soved....Thanks |
|
|
php script problem and cant get any help on the phpbb forums.. wondering if anyone can helpme here possibly.....
Quote: |
Warning: fopen(http://p196.ezboard.com/fbrothersofdarknessfrm3?page=1): failed to open stream: HTTP request failed! HTTP/1.1 502 Bad Gateway in C:\Program Files\Abyss Web Server\htdocs\forums\phpbb2\admin\ezboard.convert.php on line 207
ERROR: http://p196.ezboard.com/fbrothersofdarknessfrm3?page=1 could not be opened sql_error: Table 'forums.phpbb_ezboard_conversion' doesn't exist |
this is the section of the php script referenced in the error
Quote: |
this is line 207 $f = fopen ($fname, "r");
if ($f == false)
{
fatal_error ("ERROR: $fname could not be opened");
}
$buffer = "";
while ($line=fgets($f,5000)) |
this is the entire script... its alot of code... but figure it could be useful in figuring out the probelm
Quote: | <?PHP
/***************************************************************************
* ezboard.convert.php
* -------------------
* begin : Sunday, 22 July 2002
* author : Rob Bellaart
* email : bellaart@ghanaweb.com
*
* modified : Monday, 13 January 2003
* author : Chris Burke
* email : serotonin@earthlink.net
*
* modified : Monday, 07 July 2003
* author : Jamie Tatum
* email : jt@killsdead.com
*
* purpose : converts an ezboard forum to a phpbb format
*
***************************************************************************/
/***************************************************************************
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
***************************************************************************/
include ("ezboard.parsing.php");
include ("convert_user.php"); // Chris Burke (serotonin@earthlink.net) modified code
chdir ("../");
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
include($phpbb_root_path . 'includes/bbcode.'.$phpEx);
define('EZBOARD_CONVERSION', 'phpbb_ezboard_conversion');
// modify the following parameters where needed
$root_url = "changed"; // points to ezboard forum (destination)
$forum_name = "trading post"; // name of existing (empty) destination
$default_password = "comet"; // default password to be assigned to all users
$debug = "N"; // set to "Y" to print sql commands
$closeThreadImage="closeThread.gif"; // set to name of image used for closed threads
$multiple_pages = "Y"; // set to "Y" if forum contains > 1 pages
$strip_html = "N"; // set to "Y" to strip (most) html from bodytext
$enable_sigs = "N"; // Set to "Y" to enable sigs on the new phpBB postings. This can result in double sigs
// (one from EZBoard and one from phpBB)
$strip_crlf = "Y"; // set to "Y" to strip cr/lf from bodytext (most useful when strip_html is "N")
$track_seconds = "N"; // set to "Y" if your board tracks post time like: 6/07/03 8:30:05 AM
// If you end up with a lot of migrated posts that have an hour but no minute,
// set $track_seconds to "N".
$use_curl = "y"; // set to "Y" to use curl to migrate your ezboard. fopen is better supported by more ISP's
// and easier to setup. curl supports cookies and thus allows you to login to your ezboard
// and migrate hidden forums. Requires all the following variables to be set
$ezboard_username = "changed"; // your ezboard username
$ezboard_pass = "changed"; // your ezboard password
$ezboard_login = "changed"; // the login form. if unsure, change at least the server (pubxx) to match your forum.
$ezboard_boardname = "changed"; // the board name without the preceeding b: bnorrathsstudio becomes norrathsstudio
$curl_writepath = "/phpbb/admin/ezboard"; // a writeable directory relative to the directory this script is in, for instance:
// /phpbb/admin/ezboard - you may need to change permissions to make this directory
// world writable (chmod 777 ezboard) so the script can output the cookie data
// Modified JT - Pick max_executiontime for the user. According to the docs I have seen, this ini setting has to be a non-zero value
// and defaults to 30.
$max_executiontime = ((ini_get ("max_execution_time") / 3) + 1); // Pick a safe, reasonable time limit based on current ini setting
// $max_executiontime = 15; // maximum allowed time to run script
// logs an error-message in case of an fatal_error
function fatal_error ($message)
{
global $db;
@$sql_error = $db->sql_error();
$message = "<font color=\"red\" size=5>$message sql_error: " .$sql_error["message"]."</font>";
die ($message);
}
// executes an sql command woth error handling
function exec_sql ($sql)
{
global $db, $debug;
if ($debug == "Y")
{
echo "debug: $sql<br>";
}
if ( !$result = $db->sql_query($sql) )
{
fatal_error ("database error $sql");
}
return ($result);
}
// force a reload of the current script
function reload ()
{
echo "<script language=\"Javascript\">\n".
"<!--\n".
"document.location.reload();\n".
"//-->\n".
"</script>\n";
}
// checks whether the execution_time of the script is within the limits set by the provider
function check_execution_time ()
{
global $max_executiontime, $start_time;
if (time()-$start_time < $max_executiontime)
{
return (true);
}
return (false);
}
// Added JT - use cURL to log in to ezboard. Store the cookie from ezboard. if the
// script gets hungry, it will eat the cookie later.
// this section could use more error checking.
function curl_login ()
{
global $ezboard_username, $ezboard_pass, $ezboard_login, $ezboard_boardname, $curl_writepath;
$cookie_file = realpath (dirname(__FILE__) . "/" . $curl_writepath . "/");
$cookie_file .= "/ezboard.cookie.txt";
$output_file = realpath (dirname(__FILE__) . "/" . $curl_writepath . "/");
$output_file .= "/login.html";
echo "<h3>Logging in to ezboard...</h3><br>\n";
$postvars = "language=EN&back=" . $ezboard_boardname . "&boardName=" . $ezboard_boardname .
"&login=" . urlencode ($ezboard_username) . "&password=" . urlencode ($ezboard_pass) .
"&submit=login";
$ch = curl_init ($ezboard_login);
$fw = fopen ($output_file, "w");
curl_setopt ($ch, CURLOPT_FILE, $fw);
curl_setopt ($ch, CURLOPT_COOKIEJAR, $cookie_file);
curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)");
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $postvars);
$f = curl_exec ($ch);
if ($debug == "Y")
{
// echo $f;
echo curl_error ($ch) . "<br>\n";
}
fclose ($fw);
}
// reads the contents of an ezboard page into a buffer
// Modified JT - optionally use cURL to retrieve pages with cookies and other good stuff
function open_page ($arg, &$buffer)
{
global $root_url, $debug, $strip_crlf, $use_curl, $ezboard_username, $ezboard_pass, $curl_writepath;
$cookie_file = realpath (dirname(__FILE__) . "/" . $curl_writepath . "/");
$cookie_file .= "/ezboard.cookie.txt";
$fname = $root_url.$arg;
if ($debug == "Y")
{
echo "<a href=\"$fname\">Parsing exboard page: $fname</a><br>\n";
}
if ($use_curl == "Y")
{
// $fname = $root_url.urlencode($arg);
$ch = curl_init ($fname);
// $ch = curl_init ("http://pub16.ezboard.com/bnorrathsstudio");
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_COOKIEJAR, $cookie_file);
curl_setopt ($ch, CURLOPT_COOKIEFILE, $cookie_file);
// JT - believe it or not, ezboard won't accept curl's default useragent.
// does that mean they saw us coming?
curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)");
$f = curl_exec ($ch);
if ($debug == "Y")
{
echo curl_error ($ch);
}
curl_close ($ch);
if ($f == false)
{
fatal_error ("ERROR: $fname could not be opened");
}
// This is Chris's code, below. It's needed for cURL too. Thanks again, Chris! :)
if ( $strip_crlf == "Y" )
{
$f = ereg_replace ( "\r", "", $f );
$f = ereg_replace ( "\n", "", $f );
}
$buffer = $f;
} else {
$f = fopen ($fname, "r");
if ($f == false)
{
fatal_error ("ERROR: $fname could not be opened");
}
$buffer = "";
while ($line=fgets($f,5000))
{
// Added by Chris Burke (serotonin@earthlink.net) to fix
// double line spacing problem due to inconsistent fgets
// semantics on Linux and Windows (?)
if ( $strip_crlf == "Y" )
{
$line = ereg_replace( "\r", "", $line );
$line = ereg_replace( "\n", "", $line );
}
// End added code
$buffer .= $line;
}
fclose ($f);
}
}
// handles an invalid syntax in an ezboard page
function syntax_error ($tag, $pos, $message)
{
fatal_error ("Tag $tag not found after position $pos.<br>$message");
}
// Case-insensitive version of strpos
// Added by Chris Burke, serotonin@earthlink.net
function strpos_ci( $haystack, $needle, $offset=0 )
{
$haystack = substr($haystack, $offset, strlen($haystack));
$temp = stristr($haystack, $needle);
$pos = strlen($haystack) - strlen($temp);
if ( $pos == strlen($haystack) )
$pos = FALSE;
else
$pos += $offset;
return $pos;
}
// retrieves the string between the two tags
// Modified to be case insensitive since some tags are upper
// or lower case....Chris Burke, serotonin@earthlink.net
function retrieve_value (&$buffer, $start_tag, $end_tag, &$p)
{
$p1=strpos_ci($buffer, $start_tag, $p);
$p2=strpos_ci($buffer, $end_tag, $p1);
if ($p1 == 0)
{
syntax_error ( $start_tag, $p, "");
}
if ($p2 == 0)
{
syntax_error ( $end_tag, $p, "");
}
$p = $p2+1;
return (substr($buffer, $p1+strlen($start_tag), $p2-$p1-strlen($start_tag)));
}
// finds a tag in the page
function find_tag ($buffer, $tag, $pos, $mandatory)
{
$p=strpos($buffer, $tag, $pos);
if (! $p && $mandatory != "")
{
syntax_error ($tag, $pos, $mandatory);
}
return ($p);
}
// saves the posting in the phpbb database if it is not already present
//
// Modified by Chris Burke (serotonin@earthlink.net) to allow the script
// to repair invalid time stamps created by the original version of the
// script due to a bug in parse_timestr()
// Modified JT - If you enable smilies AND have HTML on, ezboard peppers the
// HTML emoticons with the original emoticon text in the alt tag and comments
// phpBB ends up putting a link to the smiley image twice along with ezboard's link.
// You only get one smiliey but there's some messy html and a trailing "> in the post.
// Disable smilies in phpBB if html processing is on.
function convert_posting ($topicID, $index, $user_id, $user_name, $timestamp, $title, $text, $falsetimestamp)
{
global $db, $forum_id, $strip_html, $enable_sigs;
// Added code to check for bad records...
if ( $timestamp != $falsetimestamp )
{
// Modified JT - this outputs every time for me. Disabling it since it's basically debug
// info.
// echo "<font color=\"green\">Note: '".$title."' by ".$user_name." would have had incorrect timestamp using old scripts - fixed.<br></font>";
$sql = "select post_id from ". POSTS_TABLE . " where forum_id=$forum_id and topic_id=$topicID and ".
"post_time=$falsetimestamp and poster_id=$user_id";
$result = exec_sql ($sql);
if ($row=$db->sql_fetchrow($result))
{
// We found a bad record. Delete it!
$sql = "delete from ". POSTS_TABLE . " where forum_id=$forum_id and topic_id=$topicID and ".
"post_time=$falsetimestamp and poster_id=$user_id";
$result = exec_sql ($sql);
echo "<font color=\"red\">Corrected time stamp of post in topic nr $topicID from $falsetimestamp to $timestamp.<br></font>";
}
}
// End added code
$sql = "select post_id from ". POSTS_TABLE . " where forum_id=$forum_id and topic_id=$topicID and ".
"post_time=$timestamp and poster_id=$user_id";
$result = exec_sql ($sql);
if (!$row=$db->sql_fetchrow($result))
{
// JT - Added code to disable smilies if HTML is on and enable/disable sigs
if ( $strip_html == "N" ) { $enablesmilies = 0; } else { $enablesmilies = 1; }
if ( $enable_sigs == "Y" ) { $enablesigs = 1; } else { $enablesigs = 0; }
if ($user_id != 0)
{
$sql = "insert into ". POSTS_TABLE . " (topic_id, forum_id, poster_id, post_time, enable_smilies, enable_sig) ".
"values ($topicID, $forum_id, $user_id, $timestamp, $enablesmilies, $enablesigs)";
}
else
{
$sql = "insert into ". POSTS_TABLE . " (topic_id, forum_id, post_username, post_time, enable_smilies, enable_sig) ".
"values ($topicID, $forum_id, '".addslashes($user_name)."', $timestamp, $enablesmilies, $enablesigs)";
}
// End added code
exec_sql ($sql);
$post_id = $db->sql_nextid();
$sql = "insert into ". POSTS_TEXT_TABLE. " (post_id, post_subject, post_text) ".
"values ($post_id, '".addslashes($title)."', '".addslashes($text)."')"; // Bug fix for title - CJB
exec_sql ($sql);
if ($index == 0)
{
$sql = "update ". TOPICS_TABLE. " set topic_first_post_id=$post_id, topic_poster=$user_id where topic_id=$topicID and forum_id=$forum_id";
exec_sql ($sql);
}
$sql = "update ". TOPICS_TABLE. " set topic_last_post_id=$post_id where topic_id=$topicID and forum_id=$forum_id and topic_last_post_id <= $post_id";
exec_sql ($sql);
}
}
// conversion from EZBOARD to PHPBB takes place in 5 stages
// Stage 0 checks whether all the conditions are fullfilled for the conversion
function stage_0 ()
{
global $root_url, $db, $forum_id, $default_password, $use_curl;
// Added by CJB - blow away the conversion table
cleanup();
// End added code
// Added JT - got to be in it to win it. Get the cookie if we want to use cURL
if ($use_curl == "Y")
{
curl_login();
}
open_page ("?page=1", $buffer);
if (! strpos ($buffer, "showMessage"))
{
fatal_error ("The url <a href=\"$root_url\">$root_url</a> is not a valid ezboard forum. ".
"Make sure this url points to an individual ezboard forum instead of the board listing your forums.");
}
$sql = "select count(*) as CNT from ". EZBOARD_CONVERSION. " where forum_id=$forum_id";
if ( !$result = $db->sql_query($sql) )
{
$sql = "CREATE TABLE ". EZBOARD_CONVERSION. " (".
"`forum_id` int(11) NOT NULL, ".
"`ezboard_topic` int(11) NOT NULL, ".
"`ezboard_page` int(11) NOT NULL, ".
"`topic_type` char(1) NOT NULL, ".
"`topic_title` char(60) NOT NULL, ".
"`topic_poster` int(11) NOT NULL, ".
"`topic_replies` int(11) NOT NULL, ".
"`phpbb_topic` int(11) NOT NULL ) ";
exec_sql ($sql);
}
echo "<h3>Please verify whether the above mentioned settings are correct:<br>".
"<a href=\"ezboard.convert.php?stage=1\">Click here to start the conversion</a></h3>";
}
// conversion from EZBOARD to PHPBB takes place in 5 stages
// Stage 1 produces a list of ezboard topics by parsing the ezboard listing pages.
// The list is stored in the conversion table
//
// Since most providers limit the maximum execution time of a php script, this routine will
// be invoked multiple times until all ezboard listing pages have been parsed.
function stage_1 ()
{
global $root_url, $db, $forum_id, $multiple_pages;
$sql = "select max(ezboard_page) as page from ". EZBOARD_CONVERSION. " where forum_id=$forum_id";
$result = exec_sql ($sql);
$row = $db->sql_fetchrow ($result);
$page = $row["page"] + 1;
for ($i=$page; check_execution_time(); $i++)
{
$cnt = parse_topic_list ($i);
if ($cnt == 0 || $multiple_pages != "Y")
{
break;
}
}
if ($cnt == 0 || $multiple_pages != "Y")
{
// test whether there are any closed topics
$sql = "select * from ". EZBOARD_CONVERSION ." where forum_id=$forum_id and topic_type='C' order by ezboard_topic desc";
$result = exec_sql ($sql);
if ($db->sql_numrows($result) > 0)
{
echo "<font color=\"red\"><b>WARNING!!<br>".
"The ezboard topics below are closed and cannot be processed. ".
"Please open these topics in ezboard to enable conversion.</font></b><br><br>";
while ($row = $db->sql_fetchrow($result))
{
$topicID = $row["ezboard_topic"];
echo "$topicID, <a href=\"$root_url.showMessageRange?topicID=$topicID.topic\">".$row["topic_title"]."</a><br>";
}
echo "<br><br><h3><a href=\"ezboard.convert.php?stage=2\">Click here</a> to proceed with stage 2 (closed topics will not be processed)</h3>";
}
else
{
echo "<h3>Stage 1 completed. <a href=\"ezboard.convert.php?stage=2\">Click here</a> for stage 2.</h3>";
}
}
else
{
echo "This run of stage 1 completed. You may need to click REFRESH for the next run if your browser stops loading.";
reload ();
}
}
// conversion from EZBOARD to PHPBB takes place in 5 stages
// Stage 2 parses the individual ezboard topics plus corresponding postings.
//
// The topics are processed starting with the oldest topics/postings first.
//
// Each topic involves parsing one or multiple ezboard pages. As this will take a long time
// the script is invoked repeatedly to prevent timeouts
// Modified JT - If a topic is marked sticky, set it sticky in the database
function stage_2 ()
{
global $db, $forum_id, $debug;
$sql = "select * from ". EZBOARD_CONVERSION. " where forum_id=$forum_id";
$result = exec_sql ($sql);
if ($db->sql_numrows ($result) == 0)
{
fatal_error ("No topics were found in stage 1");
}
$sql = "select * from ". EZBOARD_CONVERSION. " where forum_id=$forum_id and phpbb_topic < 0 order by ezboard_topic";
$result = exec_sql ($sql);
for ($i = 0; check_execution_time () && ($row=$db->sql_fetchrow($result)) && i < 200; $i++)
{
$topicID = $row["ezboard_topic"];
$topic_title = $row["topic_title"];
$replies = $row["topic_replies"];
$topic_poster = $row["topic_poster"];
// Begin sticky modifications
$tt = $row["topic_type"];
if ( $tt == "S" ) { $sticky = 1; } else { $sticky = 0; }
$sql = "select max(topic_id) as CNT from ". TOPICS_TABLE;
$result2 = exec_sql ($sql);
$row2=$db->sql_fetchrow($result2);
$phpbb_topic = $row2["CNT"] + 1;
$sql = "insert into ". TOPICS_TABLE. " (forum_id, topic_id, topic_title, topic_poster, topic_replies, topic_type) ".
"values ($forum_id, $phpbb_topic, '".addslashes($topic_title)."', $topic_poster, $replies, $sticky)";
// End sticky modifications
exec_sql ($sql);
if ( $debug != "Y" ) { echo "Processing topic ". $topic_title ."...<br>"; }
$sql = "update ". EZBOARD_CONVERSION . " set phpbb_topic=$phpbb_topic where forum_id=$forum_id and ezboard_topic=$topicID";
exec_sql ($sql);
for ($start=1, $cnt=1; $replies >= 0; $start += 20)
{
$cnt=parse_topic ($topicID, $phpbb_topic, $start);
$replies -= 20;
}
}
if ($i == $db->sql_numrows ($result) )
{
echo "<h3>Stage 2 completed. <a href=\"ezboard.convert.php?stage=3\">Click here</a> for stage 3.</h3>";
}
else
{
echo "This run of stage 2 completed. You may need to click REFRESH button for the next run if your browser stops loading.";
reload ();
}
}
// After parsing the ezboard topics in stage 2, the ezboard posts are stored in the wrong order in phpbb;
// the topics from ezboard have a higher posting number while in effect they are (probably)
// older postings. Consequently these ezboard postings will be shown before more recent postings which were
// already in the phpbb database
// This routine sorts the posts in the correct order by assigning higher posting-ids
function stage_3 ()
{
global $db, $forum_id;
$sql = "select max(A.post_time) as TIJD from ". POSTS_TABLE. " A, ". EZBOARD_CONVERSION. " B where A.topic_id=B.phpbb_topic and A.forum_id=$forum_id";
$result = exec_sql ($sql);
$row = $db->sql_fetchrow($result);
$max_post_time = $row["TIJD"];
$sql = "select max(post_id) as CNT from ". POSTS_TABLE;
$result = exec_sql ($sql);
$row = $db->sql_fetchrow($result);
$new_post_id=$row["CNT"] + 1;
$sql = "select post_id, topic_id from ". POSTS_TABLE. " where post_time > $max_post_time and forum_id=$forum_id order by post_time";
$result = exec_sql ($sql);
for ($cnt = 0; ($row=$db->sql_fetchrow($result)); $cnt++, $new_post_id++)
{
$topic_id = $row["topic_id"];
$post_id = $row["post_id"];
$sql = "update ". POSTS_TABLE. " set post_id=$new_post_id where post_id=$post_id";
exec_sql ($sql);
$sql = "update ". POSTS_TEXT_TABLE. " set post_id=$new_post_id where post_id=$post_id";
exec_sql ($sql);
$sql = "update ". TOPICS_TABLE. " set topic_last_post_id=$new_post_id where forum_id=$forum_id ".
"and topic_id=$topic_id and topic_last_post_id=$post_id";
exec_sql ($sql);
$sql = "update ". TOPICS_TABLE. " set topic_first_post_id=$new_post_id where forum_id=$forum_id ".
"and topic_id=$topic_id and topic_first_post_id=$post_id";
exec_sql ($sql);
}
if ($cnt == $db->sql_numrows($result))
{
echo "<h3>Stage 3 completed. <a href=\"ezboard.convert.php?stage=4\">Click here</a> for stage 4.</h3>";
}
else
{
echo "This run of stage 3 completed. Click REFRESH button for the next run";
reload ();
}
}
// Stage 4 fixes up some relationships between topics and posts
function stage_4 ()
{
global $db, $forum_id;
$sql = "select count(*) as CNT from ". TOPICS_TABLE. " where forum_id=$forum_id";
$result = exec_sql ($sql);
$row = $db->sql_fetchrow($result);
$topics = $row["CNT"];
$sql = "select count(*) as CNT from ". POSTS_TABLE. " where forum_id=$forum_id";
$result = exec_sql ($sql);
$row = $db->sql_fetchrow($result);
$posts = $row["CNT"];
$sql = "select max(post_id) as CNT from ". POSTS_TABLE. " where forum_id=$forum_id";
$result = exec_sql ($sql);
$row = $db->sql_fetchrow($result);
$last_post_id = $row["CNT"];
$sql = "update ". FORUMS_TABLE. " set forum_topics=$topics, forum_posts=$posts, forum_last_post_id=$last_post_id ".
"where forum_id = $forum_id";
exec_sql ($sql);
echo "<h3>Stage 4 completed. <a href=\"ezboard.convert.php?stage=5\">Click here</a> for stage 5.</h3>";
}
// Stage 5 fixes up some statistics about the converted users
//
// Modified by Chris Burke (serotonin@earthlink.net).
//
// The original code assumed that if the user's regdate was 0,
// it was a newly created user and the regdate should be set
// to the time of the first post. Also, the user's post count
// should be set based on the number of rows of user posts
// in the database.
//
// This was good, but it only updated the user's post count
// based on the 1st ezBoard forum imported.
//
// The POSTS_TABLE is global, it covers all forums and all
// posts. To get accurate results, we ALWAYS update every
// user's post count and regdate.
function stage_5 ()
{
global $db, $forum_id;
// $sql = "select user_id from ". USERS_TABLE. " where user_regdate=0"; // Original code (obsolete)
$sql = "select user_id from ". USERS_TABLE. "";
$result = exec_sql ($sql);
for ($i = 0; check_execution_time () && ($row=$db->sql_fetchrow($result)); $i++)
{
$user_id = $row["user_id"];
$sql= "select post_time from ". POSTS_TABLE. " where poster_id=$user_id order by post_time";
$result2 = exec_sql ($sql);
$posts = $db->sql_numrows($result2);
if ($posts > 0)
{
$row2=$db->sql_fetchrow($result2); // User's very first post, ordered by post time
$created = $row2["post_time"];
}
else
{
$created = 1;
}
$sql = "update ". USERS_TABLE. " set user_regdate=$created, user_posts=$posts where user_id=$user_id";
exec_sql ($sql);
}
if ($i == $db->sql_numrows($result))
{
echo "<h3>Stage 5 completed. Forum is now completely converted!!!!!!</h3>.";
}
else
{
echo "This run of stage 5 completed. Click REFRESH for the next run";
reload ();
}
}
// Removes the ezboard conversion table.
// This function should only be called after a succesfull conversion of all ezboard
// forums.
//
// Modified by Chris Burke to check for existence of table since it may be called
// from other modifications when the table doesn't yet exist.
function cleanup ()
{
if ( table_exists( EZBOARD_CONVERSION ) )
{
$sql = "drop table ". EZBOARD_CONVERSION;
exec_sql ($sql);
echo "<h3>Table ". EZBOARD_CONVERSION. " has been removed.</h3>";
}
}
// Determines whether a given table exists.
// From http://builder.com.com/article.jhtml?id=u00220020702SKJ02.htm
// Added by Chris Burke
function table_exists($table)
{
global $db;
$sql = "select count(*) from $table";
if ( !($result = $db->sql_query($sql)) )
return 0;
if ( $row = $db->sql_fetchrow($result) )
return 1;
return 0;
}
/*open_page (".showMessageRange?topicID=237.topic&start=1&stop=21", $buffer);
$len = strlen($buffer);
$pos = 0;
$p1 = find_tag($buffer, "PublicProfile", $pos, "");
$p2 = find_tag($buffer, "class=usertitle>Unregistered User", $pos, "");
$p3 = next_tag($buffer, "PublicProfile", "class=usertitle>Unregistered User", $pos, "");
die ("len=$len p1=$p1 p2=$p2 p3=$p3");*/
// entry point
$start_time = time ();
if (! isset($stage))
{
$stage = 0;
}
echo "<html><head></head><body>\n";
echo "<h2>Ezboard Conversion, Stage $stage</h2>";
$sql = "select forum_id from ". FORUMS_TABLE. " where forum_name='$forum_name'";
$result = exec_sql ($sql);
if ($row=$db->sql_fetchrow($result))
{
$forum_id=$row["forum_id"];
}
else
{
fatal_error ("Destination forum '$forum_name' does not exist in PHPBB.");
}
echo "<pre>".
"<b>ezboard forum (source):</b> <a href=\"$root_url\">$root_url</a><br>".
"<b>phpbb forum (destination):</b> <a href=\"../viewforum.php?f=$forum_id\">../viewforum.php?f=$forum_id</a><br>".
"<b>default password :</b> $default_password<br>".
"<b>Max execution Time (s) :</b> $max_executiontime<br>".
"<b>Forum has multiple pages :</b> $multiple_pages<br>".
"<b>Image for closed threads :</b> $closeThreadImage<br>".
"<b>Debug:</b> $debug<br>".
"<b>Strip HTML from bodytext:</b> $strip_html<br>".
"<b>Enable sigs:</b> $enable_sigs<br>".
"<b>Strip CR/LF from bodytext:</b> $strip_crlf<br>".
"<b>Message board tracks seconds:</b> $track_seconds<br>".
"<b>Use cURL to connect:</b> $use_curl<br>".
"<b>EZBoard username:</b> $ezboard_username<br>".
"<b>EZBoard login page:</b> <a href=\"$ezboard_login\">$ezboard_login</a><br>".
"<b>cURL data directory:</b> $curl_writepath<br>".
"</pre><br><br>";
switch ($_GET['stage'])
{
case "6":
cleanup ();
break;
case 5:
stage_5 ();
break;
case 4:
stage_4 ();
break;
case 3:
stage_3 ();
break;
case 2:
stage_2 ();
break;
case 1:
stage_1 ();
break;
default:
stage_0 ();
break;
}
echo "</body></html>";
?>
|
I would be eternally grateful it anyone here could possibly hel pme out, or even give me some ideas as to where to start fixing that error....
I love AWS and dont want to have to change it if i can ever help it....
thanks in advance, Beamin1
Last edited by Beamin1 on Fri Aug 27, 2004 12:41 pm; edited 1 time in total |
|