Not Solved [released] punBB to MyBB converter
#1
Not Solved
It will convert your current punBB forum to MyBB forum.
You need to install MyBB first, then upload punbb.php and include_punbb.php to your root MyBB folder.
Then go to http://yoururl/punbb.php. And follow the instructions.
This is for MyBB 1.2.x.
I've tested this on my localhost and it works. Although I haven't tested it on a big board.
Hopefully there are no bugs left.
This converts
  • Forums
  • Threads
  • Posts
  • Usergroups
  • Users
  • Bans
  • Badwords
  • Usertitles
  • Favorites

This will send an email to the users with there new passwords if the password is not md5'ed from the punBB database as there is no way to convert it back to normal string.

Download over at the mods page.
PunBB to MyBB converter 0.0.0 a1

Be sure to have the lastest version of punBB installed aswell as MyBB >= 1.2
Reply
#2
Not Solved
nice release mate, good to see some people doing some converters!

(Should now be added to http://community.mybboard.net/showthread.php?tid=8681)
Reply
#3
Not Solved
Tikitiki will probably add it later. Smile
Yea indeed. Converters are needed. Wink

If anyone wants to use my converter and change it to there own converter from other boards. You should pm me and ask me to use the code.
I'm probably gonna allow it if you don't delete my copyright. However do PM me first please.
Reply
#4
Not Solved
can i use it, im thinking of starting work on a converter for a board or two.
Reply
#5
Not Solved
I'll send you a PM about it.
For everyone else, please don't ask in this thread. This is strickly an support thread for users using this converter.
Reply
#6
Not Solved
Added to the list. Great job CraKteR
Reply
#7
Not Solved
Thank you.
Is the code pretty enough for you? :p
Reply
#8
Not Solved
havn't looked at it yet. Soccer practice in 14 mins.
Reply
#9
Not Solved
The 'public' from classes should be removed completely from functions and replace with var in strings.

So,

/**
 * Extends MyBB's MySQLi class with an new query command and some more.
 */
class mysqli_db extends databaseEngine
{
	/**
	 * Last query that was made with query().
	 * Great since I don't like cludder in code.
	 */
	public $last_query;
	/**
	 * Last query that was made with query().
	 * Great since I don't like cludder in code.
	 */
	public $prefix = "";
	/**
	 * Start and end, for limit query.
	 */
	public $limit, $start = 0;
	/**
	 * $usergroups will contain all usergroups with new and old id.
	 * $users will contain all users after selecting them.
	 */
	public $usergroups, $users = array();

	/**
	 * Starts the database.
	 *
	 * @param string The hostname.
	 * @param string The username.
	 * @param string The password.
	 * @param string The database.
	 * @param string The prefix.
	 */
	public function start($host, $user, $pass, $database, $prefix="")
	{
		$host = (strpos($host, ':')) ? explode(':', $host, 2) : array($host, NULL); 
		$this->link = new mysqli($host[0], $user, $pass, $database, $host[1]);
		$this->prefix = $prefix;
		if(mysqli_connect_errno()) {
			$this->error();
		}
	}

	/**
	 * Runs a mysql query.
	 *
	 * @param string The query.
	 * @return mysql resource.
	 */
	public function query($string, $unbuffered = false)
	{
		$string = str_replace('#_', $this->prefix, $string);
		if($this->limit > 0 && preg_match("#^\s*select#i", $string) && !preg_match("#^\s*limit#i", $string))
		{
			$string .= " LIMIT ".$this->start.", ".$this->limit;
		}
		$query = $this->link->query($string, ($unbuffered ? MYSQLI_USE_RESULT : MYSQLI_STORE_RESULT));
		if($this->errno())
		{
			$this->dberror($string);
		}
		$this->last_query = $query;
		$this->query_count++;
		$this->querylist[] = $string;
		return $query;
	}
}

replace with

/**
 * Extends MyBB's MySQLi class with an new query command and some more.
 */
class mysqli_db extends databaseEngine
{
	/**
	 * Last query that was made with query().
	 * Great since I don't like cludder in code.
	 */
	var $last_query;
	/**
	 * Last query that was made with query().
	 * Great since I don't like cludder in code.
	 */
	var $prefix = "";
	/**
	 * Start and end, for limit query.
	 */
	var $limit, $start = 0;
	/**
	 * $usergroups will contain all usergroups with new and old id.
	 * $users will contain all users after selecting them.
	 */
	var $usergroups, $users = array();

	/**
	 * Starts the database.
	 *
	 * @param string The hostname.
	 * @param string The username.
	 * @param string The password.
	 * @param string The database.
	 * @param string The prefix.
	 */
	function start($host, $user, $pass, $database, $prefix="")
	{
		$host = (strpos($host, ':')) ? explode(':', $host, 2) : array($host, NULL); 
		$this->link = new mysqli($host[0], $user, $pass, $database, $host[1]);
		$this->prefix = $prefix;
		if(mysqli_connect_errno()) {
			$this->error();
		}
	}

	/**
	 * Runs a mysql query.
	 *
	 * @param string The query.
	 * @return mysql resource.
	 */
	function query($string, $unbuffered = false)
	{
		$string = str_replace('#_', $this->prefix, $string);
		if($this->limit > 0 && preg_match("#^\s*select#i", $string) && !preg_match("#^\s*limit#i", $string))
		{
			$string .= " LIMIT ".$this->start.", ".$this->limit;
		}
		$query = $this->link->query($string, ($unbuffered ? MYSQLI_USE_RESULT : MYSQLI_STORE_RESULT));
		if($this->errno())
		{
			$this->dberror($string);
		}
		$this->last_query = $query;
		$this->query_count++;
		$this->querylist[] = $string;
		return $query;
	}
}
Reply
#10
Not Solved
PHP 5 uses public and private in classes. I don't believe i will or it should be deleted. MySQLi is only for PHP5.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)