Joomla 4. Компонент K2 и форк K2ForJ4 (18 янв 2024)

Если вас, как и меня, достало выслушивать (вычитывать) бесконечные обещания разработчика K2 опубликовать версию компонента K2 под Joomla 4 (без чего невозможно реализовать апгрейд from Joomla 3 to Joomla 4) - воспользуйтесь форком K2ForJ4. Который в данный момент установлен и без каких-либо проблем работает на этом веб-сайте.

Переходим c Agora на Kunena

Больше
13 года 4 нед. назад - 13 года 3 нед. назад #1 от Aleksej
Aleksej создал тему: Переходим c Agora на Kunena
Для всех, кто уже оценил достоинства форума Kunena и желал бы переехать на него с иных движков -

K1.5 - Kunena Converters

This component allows you to convert all your forums, topics, messages and users from other forums (Agora, ccBoard, Joo!BB, Ninjaforum) to Kunena forum.

Currently only the Agora=>Kunena conversation is done, the others will be added according users requests.

All data will be converted to Kunena 1.5 then you can also upgrade to Kunena 1.6 easily (Kunena 1.6 offers this itself).

Requirements
PHP 5
Kunena 1.5

Правила использования очень просты:

How to make the conversation
  1. Install Kunena 1.5 component
  2. Install Kunena Converters component
  3. Click any icon in Kunena Converters' control panel
Обращаю ваше внимание - компонент конвертирует данные в формат kunena 1.5! После этого - upgrade обычным порядком до kunena v.1.6.

Страница проекта
Последнее редактирование: 13 года 3 нед. назад пользователем Aleksej.

Пожалуйста Войти или Регистрация, чтобы присоединиться к беседе.

Dev banner 3
Больше
11 года 4 нед. назад #2 от serge
serge ответил в теме Переходим c Agora на Kunena
Спустя год - новый вариант скрипта для той же цели, пробуем.

Инструкции девелопера по применению:
  • First of all, synchronize the Joomla-Users.
  • Upload the saved php-file to your webspace and open it in your browser.
  • After everything is done, press "recount statistics" under Kunena-Tools.
Code:
<?php /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // AGORA 3.0.x to Kunena 2.0.x converter ////////////////////////////////////////////////////////////////////////////////////// // Converter version 0.2 ////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //enter your database credentials here. $host = "localhost"; $user = ""; $pass = ""; $db = ""; $link = mysql_connect($host,$user,$pass) or die(mysql_error()); mysql_selectdb($db,$link) or die(mysql_error()); $ag_forums_to_kunena_categories = array(); /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // converting Agora categories to Kunena categories using original category-ID //////////////////////////////////////////////// mysql_query("TRUNCATE j25_kunena_categories"); $sql = " SELECT c.id AS categories_id, c.cat_name AS categories_name, c.disp_position AS categories_ordering, c.enable AS categories_published FROM jos_agora_categories AS c ORDER BY c.disp_position ASC "; $res = mysql_query($sql) or die(mysql_error()); while ($row = mysql_fetch_object($res)) { echo $row->c.id; echo "<br />"; $sql = "INSERT INTO `j25_kunena_categories` VALUES (".$row->categories_id.", 0, '".mysql_real_escape_string($row->categories_name)."', '', 0, 0, 'joomla.group', 2, 2, 1, 8, 0, ".$row->categories_ordering.", ".$row->categories_published.", NULL, 0, '0000-00-00 00:00:00', 0, 0, 0, 0, '', '', '', 0, 'lastpost', 0, 0, 0, 0, 0, '{}')"; echo $sql; echo "<br />"; mysql_query($sql) or die(mysql_error()); } /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // converting Agora Forums to Kunena categories using modified category-ID //////////////////////////////////////////////////// // first of all count how many agory categories are here. Start catid plus 1 for Forums /////////////////////////////////////// $sqlnum = "SELECT * FROM jos_agora_categories"; $resnum = mysql_query($sqlnum); $rows = mysql_num_rows($resnum); $cat_mod_id=$rows+1; //////////////////////////////////////////////// $sql = " SELECT f.id AS categories_id, f.enable AS categories_published, f.forum_name AS categories_name, f.forum_desc AS categories_description, f.num_topics AS categories_numTopics, f.num_posts AS categories_numPosts, f.last_post AS categories_last_post_time, f.last_post_id AS categories_last_post_id, f.disp_position AS categories_ordering, f.cat_id AS categories_parent_id, f.closed AS categories_locked FROM jos_agora_forums AS f ORDER BY f.disp_position ASC "; $res = mysql_query($sql) or die(mysql_error()); while ($row = mysql_fetch_object($res)) { echo $cat_mod_id; echo "<br />"; if($row->categories_last_post_time == '') { $row->categories_last_post_time = 0; $row->categories_last_post_id = 0; } echo $row->categories_last_post_time; echo "<br />"; $sql = "INSERT INTO `j25_kunena_categories` VALUES (".$cat_mod_id.", ".$row->categories_parent_id.", '".mysql_real_escape_string($row->categories_name)."', '', 0, 0, 'joomla.group', 1, 2, 1, 8, 0, ".$row->categories_ordering.", 1, NULL, 0, '0000-00-00 00:00:00', 0, 0, 0, 0, '".mysql_real_escape_string($row->categories_description)."', '', '', 1, 'lastpost', ".$row->categories_numTopics.", ".$row->categories_numPosts.", 0, ".$row->categories_last_post_id.", ".$row->categories_last_post_time.", '{\"access_post\":[\"6\",\"7\",\"2\",\"3\",\"4\",\"5\",\"8\"],\"access_reply\":[\"6\",\"7\",\"2\",\"3\",\"4\",\"5\",\"8\"]}')"; echo $sql; echo "<br />"; mysql_query($sql) or die(mysql_error()); $ag_forums_to_kunena_categories [$row->categories_id] = $cat_mod_id; $cat_mod_id++; } /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// echo "ARRAY:"; echo "<br />"; print_r($ag_forums_to_kunena_categories); /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // convert topics from Agora to Kunena //////////////////////////////////////////////////////////////////////////////////////// mysql_query("TRUNCATE j25_kunena_topics"); $sql = " SELECT t.id AS topic_id, t.poster AS topic_poster, t.subject AS topic_subject, t.posted AS topic_first_post_time, t.last_post AS topic_last_post_time, t.last_post_id AS topic_last_post_id, t.last_poster AS topic_last_poster, t.num_views AS topic_hits, t.num_replies AS topic_posts, t.closed AS topic_locked, t.sticky AS topic_hold, t.moved_to AS topic_moved_id, t.forum_id AS topic_category_id, t.question AS topic_poll_id, p.id AS topic_first_post_id, p.posted AS topic_first_post_time, a.jos_id AS topic_first_post_userid, p.message AS topic_first_post_message FROM jos_agora_topics AS t LEFT JOIN jos_agora_users AS a ON a.username = t.poster LEFT JOIN jos_agora_posts AS p ON t.posted = p.posted ORDER BY t.id ASC "; $res = mysql_query($sql) or die(mysql_error()); while ($row = mysql_fetch_object($res)) { echo $row->topic_id; echo "<br />"; if($row->topic_first_post_userid == '') { $row->topic_first_post_userid = 0; } $cat_id = $ag_forums_to_kunena_categories[$row->topic_category_id]; echo $cat_id; echo "<br />"; $sql = "INSERT INTO `j25_kunena_topics` VALUES (".$row->topic_id.", ".$cat_id.", '".mysql_escape_string($row->topic_subject)."', 0, ".$row->topic_locked.", ".$row->topic_hold.", 0, ".$row->topic_posts.", ".$row->topic_hits.", 0, 0, 0, ".$row->topic_first_post_id.", ".$row->topic_first_post_time.", ".$row->topic_first_post_userid.", '".mysql_escape_string($row->topic_first_post_message)."', NULL, ".$row->topic_last_post_id.", ".$row->topic_last_post_time.", 0, NULL, NULL, '')"; echo $sql; echo "<br />"; mysql_query($sql) or die(mysql_error()); } $sql = " SELECT t.id AS topic_id, t.last_post AS topic_last_post_time, t.last_post_id AS topic_last_post_id, t.last_poster AS topic_last_poster, a.jos_id AS topic_last_post_userid, p.message AS topic_last_post_message FROM jos_agora_topics AS t LEFT JOIN jos_agora_users AS a ON a.username = t.last_poster LEFT JOIN jos_agora_posts AS p ON t.last_post_id = p.id ORDER BY t.id ASC "; $res = mysql_query($sql) or die(mysql_error()); while ($row = mysql_fetch_object($res)) { echo $row->topic_id; echo "<br />"; $topic_last_post_message = mysql_real_escape_string($row->topic_last_post_message); if($row->topic_last_post_userid == '') { $row->topic_last_post_userid = 0; } $cat_id = $ag_forums_to_kunena_categories[$row->topic_category_id]; echo $cat_id; echo "<br />"; $sql = "UPDATE `j25_kunena_topics` SET `last_post_id` = ".$row->topic_last_post_id.",`last_post_time` = ".$row->topic_last_post_time.",`last_post_userid` = ".$row->topic_last_post_userid.",`last_post_message` = '".mysql_escape_string($row->topic_last_post_message)."',`last_post_guest_name` = NULL,`params` = '' WHERE `j25_kunena_topics`.`id` = ".$row->topic_id.""; echo $sql; echo "<br />"; mysql_query($sql) or die(mysql_error()); } /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // convert Posts from Agora tu Kunena ///////////////////////////////////////////////////////////////////////////////////////// mysql_query("TRUNCATE j25_kunena_messages"); mysql_query("TRUNCATE j25_kunena_messages_text"); $sql = " SELECT p.id AS messages_id, u.name AS messages_name, a.jos_id AS messages_userid, p.message AS messages_text_message, p.posted AS messages_time, p.edited AS messages_modified_time, p.edited_by AS messages_modified_by, p.topic_id AS messages_thread, t.forum_id AS messages_catid FROM jos_agora_posts AS p LEFT JOIN jos_agora_users AS a ON a.username = p.poster LEFT JOIN jos_agora_topics AS t ON t.id = p.topic_id LEFT JOIN jos_users AS u ON u.id = a.jos_id ORDER BY p.id ASC "; $res = mysql_query($sql) or die(mysql_error()); while ($row = mysql_fetch_object($res)) { echo $row->messages_id; echo "<br />"; if($row->messages_userid == '') { $row->messages_userid = 0; } $cat_id = $ag_forums_to_kunena_categories[$row->messages_catid]; if ($cat_id != 0) { echo $cat_id; echo "<br />"; $sql = "INSERT INTO `j25_kunena_messages` VALUES (".$row->messages_id.", 0, ".$row->messages_thread.", ".$cat_id.", '".$row->messages_name."', ".$row->messages_userid.", '', '', ".$row->messages_time.", NULL, 0, 0, 0, 0, 0, 0, 0, 0, '')"; $sql2 = "INSERT INTO `j25_kunena_messages_text` VALUES (".$row->messages_id.", '".mysql_escape_string($row->messages_text_message)."')"; echo $sql; echo "<br />"; echo $sql2; echo "<br />"; mysql_query($sql) or die(mysql_error()); mysql_query($sql2) or die(mysql_error()); } } mysql_close();

И еще вариации того же скрипта с небольшим исправлением от silentz0r. Пробуем, не одно так другое. Инфа взята с kunena.org :

Code:
<?php /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // AGORA 3.0.x to Kunena 2.0.x converter ////////////////////////////////////////////////////////////////////////////////////// // Converter version 0.2.1 ////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //enter your database credentials here. $host = "localhost"; $user = ""; $pass = ""; $db = ""; $link = mysql_connect($host,$user,$pass) or die(mysql_error()); mysql_selectdb($db,$link) or die(mysql_error()); $ag_forums_to_kunena_categories = array(); /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // converting Agora categories to Kunena categories using original category-ID //////////////////////////////////////////////// mysql_query("TRUNCATE j25_kunena_categories"); $sql = " SELECT c.id AS categories_id, c.cat_name AS categories_name, c.disp_position AS categories_ordering, c.enable AS categories_published FROM jos_agora_categories AS c ORDER BY c.disp_position ASC "; $res = mysql_query($sql) or die(mysql_error()); while ($row = mysql_fetch_object($res)) { echo $row->c.id; echo "<br />"; $sql = "INSERT INTO `j25_kunena_categories` VALUES (".$row->categories_id.", 0, '".mysql_real_escape_string($row->categories_name)."', '', 0, 0, 'joomla.group', 2, 2, 1, 8, 0, ".$row->categories_ordering.", ".$row->categories_published.", NULL, 0, '0000-00-00 00:00:00', 0, 0, 0, 0, '', '', '', 0, 'lastpost', 0, 0, 0, 0, 0, '{}')"; echo $sql; echo "<br />"; mysql_query($sql) or die(mysql_error()); } /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // converting Agora Forums to Kunena categories using modified category-ID //////////////////////////////////////////////////// // first of all count how many agory categories are here. Start catid plus 1 for Forums /////////////////////////////////////// $sqlnum = "SELECT * FROM jos_agora_categories"; $resnum = mysql_query($sqlnum); $rows = mysql_num_rows($resnum); $maxidquery = "SELECT id FROM jos_agora_categories ORDER BY id DESC LIMIT 0,1"; $resmax = mysql_query($maxidquery); $resmaxid = mysql_fetch_array($resmax); $maxid = $resmaxid['id']; $cat_mod_id=$maxid+1; //////////////////////////////////////////////// $sql = " SELECT f.id AS categories_id, f.enable AS categories_published, f.forum_name AS categories_name, f.forum_desc AS categories_description, f.num_topics AS categories_numTopics, f.num_posts AS categories_numPosts, f.last_post AS categories_last_post_time, f.last_post_id AS categories_last_post_id, f.disp_position AS categories_ordering, f.cat_id AS categories_parent_id, f.closed AS categories_locked FROM jos_agora_forums AS f ORDER BY f.disp_position ASC "; $res = mysql_query($sql) or die(mysql_error()); while ($row = mysql_fetch_object($res)) { echo $cat_mod_id; echo "<br />"; if($row->categories_last_post_time == '') { $row->categories_last_post_time = 0; $row->categories_last_post_id = 0; } echo $row->categories_last_post_time; echo "<br />"; $sql = "INSERT INTO `j25_kunena_categories` VALUES (".$cat_mod_id.", ".$row->categories_parent_id.", '".mysql_real_escape_string($row->categories_name)."', '', 0, 0, 'joomla.group', 1, 2, 1, 8, 0, ".$row->categories_ordering.", 1, NULL, 0, '0000-00-00 00:00:00', 0, 0, 0, 0, '".mysql_real_escape_string($row->categories_description)."', '', '', 1, 'lastpost', ".$row->categories_numTopics.", ".$row->categories_numPosts.", 0, ".$row->categories_last_post_id.", ".$row->categories_last_post_time.", '{\"access_post\":[\"6\",\"7\",\"2\",\"3\",\"4\",\"5\",\"8\"],\"access_reply\":[\"6\",\"7\",\"2\",\"3\",\"4\",\"5\",\"8\"]}')"; echo $sql; echo "<br />"; mysql_query($sql) or die(mysql_error()); $ag_forums_to_kunena_categories [$row->categories_id] = $cat_mod_id; $cat_mod_id++; } /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// echo "ARRAY:"; echo "<br />"; print_r($ag_forums_to_kunena_categories); /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // convert topics from Agora to Kunena //////////////////////////////////////////////////////////////////////////////////////// mysql_query("TRUNCATE j25_kunena_topics"); $sql = " SELECT t.id AS topic_id, t.poster AS topic_poster, t.subject AS topic_subject, t.posted AS topic_first_post_time, t.last_post AS topic_last_post_time, t.last_post_id AS topic_last_post_id, t.last_poster AS topic_last_poster, t.num_views AS topic_hits, t.num_replies AS topic_posts, t.closed AS topic_locked, t.sticky AS topic_hold, t.moved_to AS topic_moved_id, t.forum_id AS topic_category_id, t.question AS topic_poll_id, p.id AS topic_first_post_id, p.posted AS topic_first_post_time, a.jos_id AS topic_first_post_userid, p.message AS topic_first_post_message FROM jos_agora_topics AS t LEFT JOIN jos_agora_users AS a ON a.username = t.poster LEFT JOIN jos_agora_posts AS p ON t.posted = p.posted ORDER BY t.id ASC "; $res = mysql_query($sql) or die(mysql_error()); while ($row = mysql_fetch_object($res)) { echo $row->topic_id; echo "<br />"; if($row->topic_first_post_userid == '') { $row->topic_first_post_userid = 0; } $cat_id = $ag_forums_to_kunena_categories[$row->topic_category_id]; echo $cat_id; echo "<br />"; $sql = "INSERT INTO `j25_kunena_topics` VALUES (".$row->topic_id.", ".$cat_id.", '".mysql_escape_string($row->topic_subject)."', 0, ".$row->topic_locked.", ".$row->topic_hold.", 0, ".$row->topic_posts.", ".$row->topic_hits.", 0, 0, 0, ".$row->topic_first_post_id.", ".$row->topic_first_post_time.", ".$row->topic_first_post_userid.", '".mysql_escape_string($row->topic_first_post_message)."', NULL, ".$row->topic_last_post_id.", ".$row->topic_last_post_time.", 0, NULL, NULL, '')"; echo $sql; echo "<br />"; mysql_query($sql) or die(mysql_error()); } $sql = " SELECT t.id AS topic_id, t.last_post AS topic_last_post_time, t.last_post_id AS topic_last_post_id, t.last_poster AS topic_last_poster, a.jos_id AS topic_last_post_userid, p.message AS topic_last_post_message FROM jos_agora_topics AS t LEFT JOIN jos_agora_users AS a ON a.username = t.last_poster LEFT JOIN jos_agora_posts AS p ON t.last_post_id = p.id ORDER BY t.id ASC "; $res = mysql_query($sql) or die(mysql_error()); while ($row = mysql_fetch_object($res)) { echo $row->topic_id; echo "<br />"; $topic_last_post_message = mysql_real_escape_string($row->topic_last_post_message); if($row->topic_last_post_userid == '') { $row->topic_last_post_userid = 0; } $cat_id = $ag_forums_to_kunena_categories[$row->topic_category_id]; echo $cat_id; echo "<br />"; $sql = "UPDATE `j25_kunena_topics` SET `last_post_id` = ".$row->topic_last_post_id.",`last_post_time` = ".$row->topic_last_post_time.",`last_post_userid` = ".$row->topic_last_post_userid.",`last_post_message` = '".mysql_escape_string($row->topic_last_post_message)."',`last_post_guest_name` = NULL,`params` = '' WHERE `j25_kunena_topics`.`id` = ".$row->topic_id.""; echo $sql; echo "<br />"; mysql_query($sql) or die(mysql_error()); } /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // convert Posts from Agora tu Kunena ///////////////////////////////////////////////////////////////////////////////////////// mysql_query("TRUNCATE j25_kunena_messages"); mysql_query("TRUNCATE j25_kunena_messages_text"); $sql = " SELECT p.id AS messages_id, u.name AS messages_name, a.jos_id AS messages_userid, p.message AS messages_text_message, p.posted AS messages_time, p.edited AS messages_modified_time, p.edited_by AS messages_modified_by, p.topic_id AS messages_thread, t.forum_id AS messages_catid FROM jos_agora_posts AS p LEFT JOIN jos_agora_users AS a ON a.username = p.poster LEFT JOIN jos_agora_topics AS t ON t.id = p.topic_id LEFT JOIN jos_users AS u ON u.id = a.jos_id ORDER BY p.id ASC "; $res = mysql_query($sql) or die(mysql_error()); while ($row = mysql_fetch_object($res)) { echo $row->messages_id; echo "<br />"; if($row->messages_userid == '') { $row->messages_userid = 0; } $cat_id = $ag_forums_to_kunena_categories[$row->messages_catid]; if ($cat_id != 0) { echo $cat_id; echo "<br />"; $sql = "INSERT INTO `j25_kunena_messages` VALUES (".$row->messages_id.", 0, ".$row->messages_thread.", ".$cat_id.", '".$row->messages_name."', ".$row->messages_userid.", '', '', ".$row->messages_time.", NULL, 0, 0, 0, 0, 0, 0, 0, 0, '')"; $sql2 = "INSERT INTO `j25_kunena_messages_text` VALUES (".$row->messages_id.", '".mysql_escape_string($row->messages_text_message)."')"; echo $sql; echo "<br />"; echo $sql2; echo "<br />"; mysql_query($sql) or die(mysql_error()); mysql_query($sql2) or die(mysql_error()); } } mysql_close();

А я смогу! - А поглядим! - А я упрямый!

Пожалуйста Войти или Регистрация, чтобы присоединиться к беседе.

Работает на Kunena форум