Welcome, Guest. Please Login or Register.
June 02, 2024, 01:38:40 PM
Home Help Search Log in Register
News: If you are still using YaBB SE, please consider upgrading to SMF as soon as possible.

YaBB SE Community  |  Development  |  Converters  |  Converter Template « previous next »
Pages: [1] Reply Ignore Print
Author Topic: Converter Template  (Read 1300 times)
groundup
Disciple of Joe, Head Cleric
Mod Team
YaBB God
*****
Posts: 2983


Error 309: Please notify the administrator of this

WWW
Converter Template
« on: January 21, 2003, 02:01:30 AM »
Reply with quote

If we want rapid development of converters, we are going to need a process of creating them. We should create a template (I started, but if someone comes out with one first.. please do it as I won't release mine).
Logged

http://www.fastfinancialfreedom.org - financial freedom is a myth
http://www.fastfinancialfreedom.org - financial freedom is a myth
http://www.fastfinancialfreedom.org - financial freedom is a myth
fastfinancialfreedom.org
chris
Guest
Re:Converter Template
« Reply #1 on: January 23, 2003, 12:32:37 PM »
Reply with quote

I'll release a little "something" later today or tomorrow ;D

Its a class that should make Converter-Creation easier...
Logged
groundup
Disciple of Joe, Head Cleric
Mod Team
YaBB God
*****
Posts: 2983


Error 309: Please notify the administrator of this

WWW
Re:Converter Template
« Reply #2 on: January 23, 2003, 09:00:16 PM »
Reply with quote

we could convert phpbb's UCC or whatever it is called
Logged

http://www.fastfinancialfreedom.org - financial freedom is a myth
http://www.fastfinancialfreedom.org - financial freedom is a myth
http://www.fastfinancialfreedom.org - financial freedom is a myth
fastfinancialfreedom.org
chris
Guest
Re:Converter Template
« Reply #3 on: January 27, 2003, 09:07:06 AM »
Reply with quote

sorry, but the converter-stuff will take another few days... hadn't much time :-/
Logged
[Unknown]
Global Moderator
YaBB God
*****
Posts: 7830


ICQ - 179721867unknownbrackets@hotmail.com WWW
Re:Converter Template
« Reply #4 on: January 27, 2003, 11:03:24 AM »
Reply with quote

A nice one could be made...

Well, I'm not sure how it would be done, but for the most part everything would be mapped... like this:

$table[$db_prefix . 'members'] = array( // vBulletin 2.2.9 user->members
   'name' => 'user',
   'columns' => array(
      'ID_MEMBER' => 'userid',
      'memberGroup' => array('usergroupid' => array('usergroup', 'title')),
      'passwd' => 'password',
      'emailAddress' => 'email'
...
   )
);

And so on... this would make it much easier to make converters, although it still would require SOME other effort...

Just an idea.  If I have time, I might work on it.

-[Unknown]
« Last Edit: January 27, 2003, 11:05:37 AM by [Unknown] » Logged
chris
Guest
Re:Converter Template
« Reply #5 on: January 27, 2003, 01:43:07 PM »
Reply with quote

hmmm... i'm currently thinking about this approach....

   class BaseConverter
   {

      $userCache   = array();
      $boardCache   = array();
      $categoryCache   = array();

      function _createUser($data)
      {

         // Get new User-ID
         $curUserID         = ($this->_getMaxUserID())+1;

         // Gender-Values
         $gender[0]         = '""';
         $gender[1]         = '"Male"';
         $gender[2]         = '"Female"';         

         // Variables
         $ivalues['ID_MEMBER']      = (int)$curUserID;
         $ivalues['memberName']      = '"'.$data['user_name'].'"';
         $ivalues['realName']      = (trim($data['user_realname']) != '' ? '"'.trim($data['user_realname']).'"' : '""');
         $ivalues['passwd']      = (trim($data['user_password']) != '' ? '"'.trim($data['user_password']).'"' : '""');
         $ivalues['emailAddress']   = (trim($data['user_email']) != '' ? '"'.trim($data['user_email']).'"' : '""');
         $ivalues['dateRegistered']   = (trim($data['user_date_registered']) != '' ? trim($data['user_date_registered']) : time());
         $ivalues['personalText']   = (trim($data['user_personaltext']) != '' ? '"'.trim($data['user_personaltext']).'"' : '""');
         $ivalues['memberGroup']      = $data['user_membergroup'];
         $ivalues['gender']      = $gender[(int)($data['user_gender'])];
         $ivalues['birthdate']      = $data['user_birthdate'];
         $ivalues['websiteTitle']   = (trim($data['user_website_name']) != '' ? '"'.trim($data['user_website_name']).'"' : '""');
         $ivalues['websiteUrl']      = (trim($data['user_website_url']) != '' ? '"'.trim($data['user_website_url']).'"' : '""');
         $ivalues['location']      = (trim($data['user_location']) != '' ? '"'.trim($data['user_location']).'"' : '""');
         $ivalues['ICQ']         = (trim($data['user_icq']) != '' ? '"'.trim($data['user_icq']).'"' : '""');
         $ivalues['AIM']         = (trim($data['user_aim']) != '' ? '"'.trim($data['user_aim']).'"' : '""');
         $ivalues['YIM']         = (trim($data['user_yim']) != '' ? '"'.trim($data['user_yim']).'"' : '""');
         $ivalues['MSN']         = (trim($data['user_msn']) != '' ? '"'.trim($data['user_msn']).'"' : '""');
         $ivalues['hideEmail']      = (int)$data['user_hidemail'];
         $ivalues['timeFormat']      = $data['user_timeformat'];
         $ivalues['signature']      = (trim($data['user_signature']) != '' ? '"'.trim($data['user_signature']).'"' : '""');
         $ivalues['posts']      = (int)$data['user_posts'];
         $ivalues['timeOffset']      = (float)$data['user_timeoffset'];
         $ivalues['avatar']      = (trim($data['user_avatar']) != '' ? '"'.trim($data['user_avatar']).'"' : '""');
         if (is_array($data['user_im_ignore']) && (count($data['user_im_ignore'])>0))
         {
            $ivalues['im_ignore_list']   = '"'.implode(',',$data['user_im_ignore']).'"';
         }
         else
         {
            $ivalues['im_ignore_list']   = '""';
         }
         $ivalues['im_email_notify']   = (int)$data['user_im_notify'];
         $ivalues['lastLogin']      = (int)$data['user_lastlogin'];
         $ivalues['karmaBad']      = (int)$data['user_karma_bad'];
         $ivalues['karmaGood']      = (int)$data['user_karma_good'];
         $ivalues['usertitle']      = (trim($data['user_title']) != '' ? '"'.trim($data['user_title']).'"' : '""');
         $ivalues['lngfile']      = (trim($data['user_language']) != '' ? '"'.trim($data['user_language']).'"' : '""');
         $ivalues['notifyAnnouncements']   = (int)$data['user_avatar'];
         $ivalues['notifyOnce']      = (int)$data['user_avatar'];
         $ivalues['memberIP']      = '""';
         $ivalues['secretQuestion']   = (trim($data['user_question']) != '' ? '"'.trim($data['user_question']).'"' : '""');
         $ivalues['secretAnswer']   = (trim($data['user_answer']) != '' ? '"'.trim($data['user_answer']).'"' : '""');

         $sqlquery   = _createQuery('members',$ivalues);
         
         // Create User
         if (@mysql_query($sqlquery))
         {
            // Return User-ID
            return $curUserID;
         }
         else
         {
            return false;
         }

      }

      function createCategory($data)
      {

         // Get new Category-ID
         $curCatID         = ($this->_getMaxCategoryID())+1;

         // Variables
         $ivalues['ID_CAT']      = (int)$curCatID;
         $ivalues['name']      = '"'.$data['category_name'].'"';
         if (is_array($data['category_membergroups']) && (count($data['category_membergroups'])>0))
         {
            $ivalues['memberGroups']   = '"'.implode(',',$data['category_membergroups']).'"';
         }
         else
         {
            $ivalues['memberGroups']   = '""';
         }
         $ivalues['catOrder']      = (int)$data['category_order'];

         // Create Board
         $sqlquery   = _createQuery('categories',$ivalues);

         if (@mysql_query($sqlquery))
         {
            // Store Category in cache
            // $this->categoryCache[$curCatID]   = array( '' );

            // Return Category-ID
            return $curCatID;
         }
         else
         {
            return false;
         }

      }

      function createBoard($data)
      {

         // Get new Board-ID
         $curBoardID         = ($this->_getMaxBoardID())+1;

         // Variables
         $ivalues['ID_BOARD']      = (int)$curBoardID;
         $ivalues['ID_CAT']      = (int)$data['category_id'];
         $ivalues['name']      = '"'.$data['board_name'].'"';
         $ivalues['description']      = '"'.$data['board_description'].'"';
         if (is_array($data['board_moderators']) && (count($data['board_moderators'])>0))
         {
            $ivalues['moderators']   = '"'.implode(',',$data['board_moderators']).'"';
         }
         else
         {
            $ivalues['moderators']   = '""';
         }
         $ivalues['numTopics']      = (int)$data['board_topics'];
         $ivalues['numPosts']      = (int)$data['board_postings'];
         $ivalues['boardOrder']      = (int)$data['board_order'];
         $ivalues['isAnnouncement']   = (int)$data['board_is_announcement'];
         $ivalues['notifyAnnouncements']   = (int)$data['board_notify_on_announcement'];
         $ivalues['count']      = (int)$data['board_count'];
         $ivalues['ID_LAST_TOPIC']   = (int)$data['board_newest_topic_id'];

         // Create Board
         $sqlquery   = _createQuery('boards',$ivalues);

         if (@mysql_query($sqlquery))
         {
            // Return Board-ID
            return $curBoardID;
         }
         else
         {
            return false;
         }

      }

      function loadUser()
      {
         //$this->userCache[]
      }

      function updateSetting($variable,$value)
      {
      }

      function _createQuery($table,$values)
      {
         
         $dummy   = 'INSERT INTO '.$this->_dbPrefix.$table.' (';
         $dummy   .= implode(',',array_keys($values));
         $dummy   .= ') VALUES (';
         $dummy   .= implode(',',array_values($values));
         $dummy   .= ')';

         return $dummy;
         
      }

      function _getMaxBoardID()
      {
         return _getMaxID('boards','ID_BOARD');
      }

      function _getMaxCategoryID()
      {
         return _getMaxID('categories','ID_CAT');
      }

      function _getMaxUserID()
      {
         return _getMaxID('members','ID_MEMBER');
      }

      function _getMaxID($table,$field)
      {

         $sqlquery   = 'SELECT MAX('.$field.') AS maxID FROM '.$this->_dbPrefix.$table;
         $result      = mysql_query($sqlquery) or die(mysql_error());
         $row      = mysql_fetch_assoc($result);

         return $row['maxID'];

      }

      function readYSESettings($path)
      {
         
         // require_once($path.'Settings.php');

      }

   }

(there is a lot of stuff missing!!!!!)
Logged
[Unknown]
Global Moderator
YaBB God
*****
Posts: 7830


ICQ - 179721867unknownbrackets@hotmail.com WWW
Re:Converter Template
« Reply #6 on: March 02, 2003, 07:38:03 AM »
Reply with quote

Something useless:

Use at your own risk.  I provide no warranty, not even the suggested warranty of usability.  Copyright 2003 by myself.  All rights reserved.  Do not redistribute without my permission.  Only for use with YaBB SE and pfaBB.

http://gbaetc.homeip.net/yypack/converter.zip

-[Unknown]
Logged
Pages: [1] Reply Ignore Print 
YaBB SE Community  |  Development  |  Converters  |  Converter Template « previous - next »
 


Powered by MySQL Powered by PHP YaBB SE Community | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved.
SMF 2.1.4 © 2023, Simple Machines
Valid XHTML 1.0! Valid CSS

Page created in 0.032 seconds with 18 queries.