Skip to content

Commit

Permalink
+ [Kunena#42] Add support for Joo!BB
Browse files Browse the repository at this point in the history
  • Loading branch information
xillibit committed Jul 31, 2011
1 parent 8203d6f commit 84d4922
Show file tree
Hide file tree
Showing 3 changed files with 603 additions and 66 deletions.
3 changes: 3 additions & 0 deletions administrator/components/com_kunenaimporter/CHANGELOG.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@

KunenaImporter 1.6.5-DEV

31-July-2011 Xillibit
+ [#42] Add support for Joo!BB

30-July-2011 Xillibit
# [#25] Improvements on agora import : polls options, user avatar

Expand Down
132 changes: 66 additions & 66 deletions administrator/components/com_kunenaimporter/models/export_example.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@

/**
* Example Exporter Class
*
*
* This class can be used as a base to export all data from your favorite forum software.
* If you want to migrate something else than Joomla component, check also phpBB3 and SMF2 exporters.
*
*
* NOTE: Sor simplicity, please remove functions which you haven't modified!
*/
class KunenaimporterModelExport_example extends KunenaimporterModelExport {
Expand Down Expand Up @@ -47,12 +47,12 @@ class KunenaimporterModelExport_example extends KunenaimporterModelExport {
* @var string or null
*/
protected $versionmax = null;

/**
* Get external forum path from importer configuration
*
*
* You can usually remove this function if you are exporting Joomla component.
*
*
* @return string Relative path
*/
public function getPath($absolute = false) {
Expand All @@ -62,9 +62,9 @@ public function getPath($absolute = false) {

/**
* Detect if component exists
*
*
* You can usually remove this function if you are exporting Joomla component.
*
*
* @return bool
*/
public function detectComponent() {
Expand All @@ -74,15 +74,15 @@ public function detectComponent() {

/**
* Get database object
*
*
* You can usually remove this function if you are exporting Joomla component.
*
*
* @return JDatabase or JError or null
*/
public function getDatabase() {
return JFactory::getDBO ();
}

/**
* Initialization needed by exporter
*/
Expand All @@ -91,7 +91,7 @@ public function initialize() {

/**
* Get configuration
*
*
* You can usually remove this function if you are exporting Joomla component.
* By default this function gets configuration from component parameters.
*/
Expand All @@ -104,11 +104,11 @@ public function &getConfig() {

/**
* Full detection
*
*
* Make sure that everything is OK for full import.
* Use $this->addMessage($html) to add status messages.
* If you return false, remember also to fill $this->error
*
*
* @return bool
*/
public function detect() {
Expand All @@ -119,7 +119,7 @@ public function detect() {

/**
* Get component version
*
*
* You can usually remove this function if you are exporting Joomla component.
*/
public function getVersion() {
Expand All @@ -135,7 +135,7 @@ public function getVersion() {

/**
* Remove htmlentities, addslashes etc
*
*
* @param string $s String
*/
protected function parseText(&$s) {
Expand All @@ -148,7 +148,7 @@ protected function parseText(&$s) {
*/
protected function parseBBCode(&$s) {
}

/**
* Convert HTML to Kunena BBCode
*
Expand All @@ -157,12 +157,12 @@ protected function parseBBCode(&$s) {
protected function parseHTML(&$s) {
parent::parseHTML($s);
}

/**
* Map Joomla user to external user
*
* You can usually remove this function if you are exporting Joomla component.
*
*
* @param object $joomlauser StdClass(id, username, email)
* @return int External user ID
*/
Expand All @@ -179,18 +179,18 @@ public function countUsers() {

/**
* Export users (external applications only)
*
* Returns list of user extuser objects containing database fields
*
* Returns list of user extuser objects containing database fields
* to #__kunenaimporter_users.
*
*
* @param int $start Pagination start
* @param int $limit Pagination limit
* @return array
*/
public function &exportUsers($start = 0, $limit = 0) {
$result = array();
return $result;
return $result;

$query = "SELECT
NULL AS extid,
'' AS extusername,
Expand Down Expand Up @@ -224,11 +224,11 @@ public function countUserProfile() {

/**
* Export user profiles
*
* Returns list of user profile objects containing database fields
*
* Returns list of user profile objects containing database fields
* to #__kunena_users.
* NOTE: copies all files found in $row->copyfile (full path) to Kunena.
*
*
* @param int $start Pagination start
* @param int $limit Pagination limit
* @return array
Expand Down Expand Up @@ -298,11 +298,11 @@ public function countRanks() {

/**
* Export user ranks
*
* Returns list of rank objects containing database fields
*
* Returns list of rank objects containing database fields
* to #__kunena_ranks.
* NOTE: copies all files found in $row->copyfile (full path) to Kunena.
*
*
* @param int $start Pagination start
* @param int $limit Pagination limit
* @return array
Expand Down Expand Up @@ -335,10 +335,10 @@ public function countSessions() {

/**
* Export user session information
*
* Returns list of attachment objects containing database fields
*
* Returns list of attachment objects containing database fields
* to #__kunena_sessions.
*
*
* @param int $start Pagination start
* @param int $limit Pagination limit
* @return array
Expand All @@ -365,14 +365,14 @@ public function countCategories() {

/**
* Export sections and categories
*
* Returns list of category objects containing database fields
*
* Returns list of category objects containing database fields
* to #__kunena_categories.
* All categories without parent are sections.
*
*
* NOTE: it's very important to keep category IDs (containing topics) the same!
* If there are two tables for sections and categories, change IDs on sections..
*
*
* @param int $start Pagination start
* @param int $limit Pagination limit
* @return array
Expand Down Expand Up @@ -414,7 +414,7 @@ public function &exportCategories($start = 0, $limit = 0) {
}
return $result;
}

/**
* Count total number of moderator columns to be exported
*/
Expand All @@ -426,11 +426,11 @@ public function countModeration() {

/**
* Export moderator columns
*
* Returns list of moderator objects containing database fields
*
* Returns list of moderator objects containing database fields
* to #__kunena_moderation.
* NOTE: Global moderator doesn't have columns in this table!
*
*
* @param int $start Pagination start
* @param int $limit Pagination limit
* @return array
Expand All @@ -455,10 +455,10 @@ public function countMessages() {

/**
* Export messages
*
* Returns list of message objects containing database fields
*
* Returns list of message objects containing database fields
* to #__kunena_messages (and #__kunena_messages_text.message).
*
*
* @param int $start Pagination start
* @param int $limit Pagination limit
* @return array
Expand All @@ -483,7 +483,7 @@ public function &exportMessages($start = 0, $limit = 0) {
0 AS moved,
0 AS modified_by,
0 AS modified_time,
'' AS modified_reason
'' AS modified_reason,
'' AS message
FROM #__example_messages";
$result = $this->getExportData ( $query, $start, $limit );
Expand All @@ -496,7 +496,7 @@ public function &exportMessages($start = 0, $limit = 0) {
}
return $result;
}

/**
* Count total polls to be exported
*/
Expand All @@ -507,10 +507,10 @@ public function countPolls() {

/**
* Export polls
*
* Returns list of poll objects containing database fields
*
* Returns list of poll objects containing database fields
* to #__kunena_polls.
*
*
* @param int $start Pagination start
* @param int $limit Pagination limit
* @return array
Expand All @@ -536,10 +536,10 @@ public function countPollsOptions() {

/**
* Export poll options
*
* Returns list of poll options objects containing database fields
*
* Returns list of poll options objects containing database fields
* to #__kunena_polls_options.
*
*
* @param int $start Pagination start
* @param int $limit Pagination limit
* @return array
Expand All @@ -566,10 +566,10 @@ public function countPollsUsers() {

/**
* Export poll users
*
* Returns list of poll users objects containing database fields
*
* Returns list of poll users objects containing database fields
* to #__kunena_polls_users.
*
*
* @param int $start Pagination start
* @param int $limit Pagination limit
* @return array
Expand Down Expand Up @@ -598,11 +598,11 @@ public function countAttachments() {

/**
* Export attachments in messages
*
* Returns list of attachment objects containing database fields
*
* Returns list of attachment objects containing database fields
* to #__kunena_attachments.
* NOTE: copies all files found in $row->copyfile (full path) to Kunena.
*
*
* @param int $start Pagination start
* @param int $limit Pagination limit
* @return array
Expand Down Expand Up @@ -640,10 +640,10 @@ public function countSubscriptions() {

/**
* Export topic subscriptions
*
* Returns list of subscription objects containing database fields
*
* Returns list of subscription objects containing database fields
* to #__kunena_subscriptions.
*
*
* @param int $start Pagination start
* @param int $limit Pagination limit
* @return array
Expand All @@ -668,10 +668,10 @@ public function countAvatarGalleries() {

/**
* Export avatar galleries
*
*
* Returns list of folder=>fullpath to be copied, where fullpath points
* to the directory in the filesystem.
*
*
* @param int $start Pagination start
* @param int $limit Pagination limit
* @return array
Expand All @@ -683,7 +683,7 @@ public function &exportAvatarGalleries($start = 0, $limit = 0) {

/**
* Internal function to fetch all avatar galleries
*
*
* @return array (folder=>full path, ...)
*/
protected function &getAvatarGalleries() {
Expand All @@ -698,7 +698,7 @@ protected function &getAvatarGalleries() {
}
return $galleries;
}

/**
* Count global configurations to be exported
* @return 1
Expand All @@ -709,7 +709,7 @@ public function countConfig() {

/**
* Export global configuration
*
*
* @param int $start Pagination start
* @param int $limit Pagination limit
* @return array (1=>(array(option=>value, ...)))
Expand All @@ -721,7 +721,7 @@ public function &exportConfig($start = 0, $limit = 0) {

// Time delta in seconds from UTC (=JFactory::getDate()->toUnix())
// $config['timedelta'] = JFactory::getDate()->toUnix() - time() - $offsetinseconds;

// Get configuration and fill any values from below:

// $config['board_title'] = null;
Expand Down
Loading

0 comments on commit 84d4922

Please sign in to comment.