Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

update fork

  • Loading branch information...
commit 2992013b2aba463ca8410d4d27c0da5e42891ec0 2 parents ccfd547 + 3894f4f
@xillibit authored
Showing with 1,911 additions and 955 deletions.
  1. +6 −0 administrator/components/com_kunena/controllers/categories.php
  2. +10 −3 administrator/components/com_kunena/controllers/config.php
  3. +0 −38 administrator/components/com_kunena/controllers/createmenu.php
  4. +0 −90 administrator/components/com_kunena/controllers/prune.php
  5. +0 −93 administrator/components/com_kunena/controllers/recount.php
  6. +0 −62 administrator/components/com_kunena/controllers/syncusers.php
  7. +246 −0 administrator/components/com_kunena/controllers/tools.php
  8. +4 −2 administrator/components/com_kunena/install/controller.php
  9. +2 −2 administrator/components/com_kunena/install/data/sampledata.php
  10. +1 −1  administrator/components/com_kunena/install/entrypoints/api.php
  11. +11 −5 administrator/components/com_kunena/install/install.kunena.php
  12. +74 −60 administrator/components/com_kunena/install/install.script.php
  13. +1 −0  administrator/components/com_kunena/install/install.xml
  14. +6 −0 administrator/components/com_kunena/install/kunena.install.upgrade.xml
  15. +1 −0  administrator/components/com_kunena/install/media/install.css
  16. +54 −16 administrator/components/com_kunena/install/model.php
  17. 0  administrator/components/com_kunena/{views/syncusers/tmpl → install/plugins/plg_finder_kunena}/index.html
  18. +17 −0 administrator/components/com_kunena/install/plugins/plg_finder_kunena/kunena.j16.xml
  19. +264 −0 administrator/components/com_kunena/install/plugins/plg_finder_kunena/kunena.php
  20. +1 −1  administrator/components/com_kunena/install/tmpl/default_reqfail.php
  21. +5 −3 administrator/components/com_kunena/install/uninstall.kunena.php
  22. +1 −1  administrator/components/com_kunena/install/upgrade/upgrade-1.6.1_delfiles.php
  23. +20 −0 administrator/components/com_kunena/install/upgrade/upgrade-2.0.0_menu.php
  24. +2 −2 administrator/components/com_kunena/install/view.php
  25. +1 −1  administrator/components/com_kunena/kunena.xml
  26. +28 −29 administrator/components/com_kunena/language/en-GB/en-GB.com_kunena.ini
  27. +4 −3 administrator/components/com_kunena/language/en-GB/en-GB.com_kunena.install.ini
  28. +2 −2 administrator/components/com_kunena/libraries/bbcode/bbcode.php
  29. +2 −1  administrator/components/com_kunena/libraries/config.php
  30. +3 −3 administrator/components/com_kunena/libraries/controller.php
  31. +5 −1 administrator/components/com_kunena/libraries/date.php
  32. +1 −1  administrator/components/com_kunena/libraries/forum/forum.php
  33. +5 −4 administrator/components/com_kunena/libraries/forum/message/attachment/helper.php
  34. +1 −0  administrator/components/com_kunena/libraries/forum/topic/helper.php
  35. +5 −5 administrator/components/com_kunena/libraries/html/pagination.php
  36. +2 −2 administrator/components/com_kunena/libraries/login.php
  37. +221 −0 administrator/components/com_kunena/libraries/menu/helper.php
  38. 0  administrator/components/com_kunena/{views/syncusers → libraries/menu}/index.html
  39. +65 −14 administrator/components/com_kunena/libraries/route/legacy.php
  40. +20 −6 administrator/components/com_kunena/libraries/route/route.php
  41. +1 −1  administrator/components/com_kunena/libraries/template/template.php
  42. +8 −8 administrator/components/com_kunena/libraries/view.php
  43. +7 −2 administrator/components/com_kunena/models/config.php
  44. +25 −26 administrator/components/com_kunena/models/cpanel.php
  45. +0 −22 administrator/components/com_kunena/models/createmenu.php
  46. +0 −22 administrator/components/com_kunena/models/recount.php
  47. +1 −9 administrator/components/com_kunena/models/report.php
  48. +0 −36 administrator/components/com_kunena/models/syncusers.php
  49. +8 −7 administrator/components/com_kunena/models/{prune.php → tools.php}
  50. +4 −1 administrator/components/com_kunena/views/categories/view.html.php
  51. +1 −3 administrator/components/com_kunena/views/common/tmpl/menu.php
  52. +3 −0  administrator/components/com_kunena/views/config/tmpl/default.php
  53. +2 −16 administrator/components/com_kunena/views/cpanel/tmpl/default.php
  54. +0 −36 administrator/components/com_kunena/views/prune/view.html.php
  55. +1 −1  administrator/components/com_kunena/views/ranks/tmpl/add.php
  56. +1 −1  administrator/components/com_kunena/views/ranks/tmpl/default.php
  57. +1 −3 administrator/components/com_kunena/views/ranks/view.html.php
  58. +1 −1  administrator/components/com_kunena/views/smilies/tmpl/add.php
  59. +1 −1  administrator/components/com_kunena/views/smilies/tmpl/default.php
  60. +1 −3 administrator/components/com_kunena/views/smilies/view.html.php
  61. +1 −1  administrator/components/com_kunena/views/stats/tmpl/default.php
  62. +0 −32 administrator/components/com_kunena/views/syncusers/view.html.php
  63. 0  administrator/components/com_kunena/views/{prune/tmpl → tools}/index.html
  64. +55 −0 administrator/components/com_kunena/views/tools/tmpl/default.php
  65. 0  administrator/components/com_kunena/views/{prune → tools/tmpl}/index.html
  66. +47 −0 administrator/components/com_kunena/views/tools/tmpl/menu.php
  67. +2 −3 administrator/components/com_kunena/views/{prune/tmpl/default.php → tools/tmpl/prune.php}
  68. +55 −0 administrator/components/com_kunena/views/tools/tmpl/recount.php
  69. +3 −9 administrator/components/com_kunena/views/{syncusers/tmpl/default.php → tools/tmpl/syncusers.php}
  70. +95 −0 administrator/components/com_kunena/views/tools/view.html.php
  71. +1 −1  administrator/components/com_kunena/views/topicicons/tmpl/add.php
  72. +1 −1  administrator/components/com_kunena/views/topicicons/tmpl/default.php
  73. +0 −2  administrator/components/com_kunena/views/topicicons/view.html.php
  74. +2 −0  build/externaldefinitions.php
  75. +19 −2 components/com_kunena/controllers/announcement.php
  76. +1 −1  components/com_kunena/controllers/topic.php
  77. +19 −1 components/com_kunena/language/en-GB/en-GB.com_kunena.ini
  78. +28 −0 components/com_kunena/language/en-GB/en-GB.com_kunena.tpl_default20.ini
  79. +2 −0  components/com_kunena/models/announcement.php
  80. +1 −1  components/com_kunena/router.php
  81. +3 −3 components/com_kunena/template/blue_eagle/css/kunena.forum.css
  82. +0 −2  components/com_kunena/template/blue_eagle/html/announcement/default.php
  83. +1 −1  components/com_kunena/template/blue_eagle/html/announcement/edit.php
  84. +0 −2  components/com_kunena/template/blue_eagle/html/announcement/list.php
  85. +2 −2 components/com_kunena/template/blue_eagle/html/category/manage.php
  86. +1 −1  components/com_kunena/template/blue_eagle/html/credits/default.php
  87. +1 −1  components/com_kunena/template/blue_eagle/html/topic/default_pollresults.php
  88. +1 −1  components/com_kunena/template/blue_eagle/html/topic/edit.php
  89. +2 −2 components/com_kunena/template/blue_eagle/html/topic/edit_editor.php
  90. +1 −1  components/com_kunena/template/blue_eagle/html/user/default_attachments.php
  91. +1 −1  components/com_kunena/template/blue_eagle/html/user/list.php
  92. +1 −1  components/com_kunena/template/blue_eagle/initialize.php
  93. +7 −12 components/com_kunena/template/default20/css/buttons.css
  94. +98 −50 components/com_kunena/template/default20/css/global.css
  95. +6 −2 components/com_kunena/template/default20/css/icons.css
  96. +16 −2 components/com_kunena/template/default20/css/ie.css
  97. +2 −1  components/com_kunena/template/default20/css/ie7.css
  98. +40 −0 components/com_kunena/template/default20/css/main.css
  99. +3 −0  components/com_kunena/template/default20/css/menu.css
  100. +2 −2 components/com_kunena/template/default20/css/topic.css
  101. +0 −3  components/com_kunena/template/default20/html/announcement/default.php
  102. +1 −1  components/com_kunena/template/default20/html/announcement/edit.php
  103. +22 −10 components/com_kunena/template/default20/html/announcement/list.php
  104. +2 −2 components/com_kunena/template/default20/html/category/list_category.php
  105. +1 −1  components/com_kunena/template/default20/html/category/list_section.php
  106. +1 −1  components/com_kunena/template/default20/html/credits/default.php
  107. +1 −1  components/com_kunena/template/default20/html/statistics/default.php
  108. +1 −6 components/com_kunena/template/default20/html/topic/default_list.php
  109. +1 −1  components/com_kunena/template/default20/html/topic/default_pollresults.php
  110. +2 −2 components/com_kunena/template/default20/html/topic/edit_editor.php
  111. +1 −1  components/com_kunena/template/default20/html/topic/edit_form.php
  112. +2 −1  components/com_kunena/template/default20/html/topic/report.php
  113. +4 −4 components/com_kunena/template/default20/html/topic/threaded_list.php
  114. +11 −7 components/com_kunena/template/default20/html/topics/default_row.php
  115. +6 −6 components/com_kunena/template/default20/html/topics/posts_actions.php
  116. +1 −1  components/com_kunena/template/default20/html/user/default_attachments.php
  117. +19 −0 components/com_kunena/template/default20/html/user/list_list.php
  118. BIN  components/com_kunena/template/default20/images/poll_32.png
  119. +8 −0 components/com_kunena/template/orao/css/category.css
  120. +0 −1  components/com_kunena/template/orao/css/global.css
  121. +0 −2  components/com_kunena/template/orao/html/announcement/default.php
  122. +1 −1  components/com_kunena/template/orao/html/announcement/edit.php
  123. +0 −2  components/com_kunena/template/orao/html/announcement/list.php
  124. +7 −6 components/com_kunena/template/orao/html/category/list_category.php
  125. +1 −1  components/com_kunena/template/orao/html/category/list_section.php
  126. +2 −2 components/com_kunena/template/orao/html/common/breadcrumb.php
  127. +3 −3 components/com_kunena/template/orao/html/common/login.php
  128. +20 −27 components/com_kunena/template/orao/html/common/menu.php
  129. +4 −6 components/com_kunena/template/orao/html/common/pmread.php
  130. +1 −0  components/com_kunena/template/orao/html/common/quicksearch.php
  131. +2 −2 components/com_kunena/template/orao/html/common/rules.php
  132. +2 −4 components/com_kunena/template/orao/html/search/default.php
  133. +2 −2 components/com_kunena/template/orao/html/topic/default_actions.php
  134. +1 −0  components/com_kunena/template/orao/html/topic/default_message.php
  135. +32 −0 components/com_kunena/template/orao/html/topic/edit_attachments.php
  136. +2 −2 components/com_kunena/template/orao/html/topic/edit_editor.php
  137. +2 −2 components/com_kunena/template/orao/html/topic/edit_form.php
  138. +6 −8 components/com_kunena/template/orao/html/topic/moderate.php
  139. +2 −1  components/com_kunena/template/orao/html/topic/report.php
  140. +7 −7 components/com_kunena/template/orao/html/topics/default_row.php
  141. +6 −6 components/com_kunena/template/orao/html/topics/posts_actions.php
  142. +5 −2 components/com_kunena/template/orao/html/user/default_attachments.php
  143. +1 −1  components/com_kunena/template/orao/template.php
  144. +12 −0 components/com_kunena/views/announcement/view.html.php
  145. +1 −2  components/com_kunena/views/category/view.feed.php
  146. +4 −4 components/com_kunena/views/category/view.html.php
  147. +16 −11 components/com_kunena/views/common/view.html.php
  148. +4 −4 components/com_kunena/views/topic/view.html.php
  149. +3 −6 components/com_kunena/views/topics/view.feed.php
  150. +1 −1  components/com_kunena/views/user/view.html.php
View
6 administrator/components/com_kunena/controllers/categories.php
@@ -117,10 +117,16 @@ function apply() {
$this->redirectBack();
}
+ function save2new() {
+ $this->_save();
+ $this->setRedirect(KunenaRoute::_($this->baseurl2."&layout=create", false));
+ }
+
function save() {
$this->_save();
JFactory::getApplication ()->redirect ( KunenaRoute::_($this->baseurl, false) );
}
+
protected function _save() {
$lang = JFactory::getLanguage();
$lang->load('com_kunena', JPATH_ADMINISTRATOR);
View
13 administrator/components/com_kunena/controllers/config.php
@@ -21,9 +21,15 @@ class KunenaAdminControllerConfig extends KunenaController {
public function __construct($config = array()) {
parent::__construct($config);
$this->baseurl = 'index.php?option=com_kunena&view=config';
+ $this->kunenabaseurl = 'index.php?option=com_kunena';
}
- function save() {
+ function apply() {
+ $url = $this->baseurl;
+ $this->save($url);
+ }
+
+ function save($url=null) {
$app = JFactory::getApplication ();
$config = KunenaFactory::getConfig ();
$db = JFactory::getDBO ();
@@ -53,19 +59,20 @@ function save() {
$config->save ();
$app->enqueueMessage ( JText::_('COM_KUNENA_CONFIGSAVED'));
- $app->redirect ( KunenaRoute::_($this->baseurl, false) );
+ if (empty($url)) $app->redirect ( KunenaRoute::_($this->baseurl, false) );
+ else $app->redirect ( $url );
}
function setdefault() {
$db = JFactory::getDBO ();
$app = JFactory::getApplication ();
- $config = KunenaFactory::getConfig ();
if (! JRequest::checkToken ()) {
$app->enqueueMessage ( JText::_ ( 'COM_KUNENA_ERROR_TOKEN' ), 'error' );
$app->redirect ( KunenaRoute::_($this->baseurl, false) );
}
+ $config = KunenaFactory::getConfig ();
$config->reset();
$config->save();
View
38 administrator/components/com_kunena/controllers/createmenu.php
@@ -1,38 +0,0 @@
-<?php
-/**
- * Kunena Component
- * @package Kunena.Administrator
- * @subpackage Controllers
- *
- * @copyright (C) 2008 - 2011 Kunena Team. All rights reserved.
- * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
- * @link http://www.kunena.org
- **/
-defined ( '_JEXEC' ) or die ();
-
-/**
- * Kunena Createmenu Controller
- *
- * @since 2.0
- */
-class KunenaAdminControllerCreatemenu extends KunenaController {
- protected $baseurl = null;
-
- public function __construct($config = array()) {
- parent::__construct($config);
-
- $app = JFactory::getApplication ();
- $lang = JFactory::getLanguage();
- // Start by loading English strings and override them by current locale
- $lang->load('com_kunena.install',JPATH_ADMINISTRATOR, 'en-GB');
- $lang->load('com_kunena.install',JPATH_ADMINISTRATOR, null, true);
-
- require_once(KPATH_ADMIN . '/install/model.php');
- $installer = new KunenaModelInstall();
- $installer->deleteMenu();
- $installer->createMenu();
-
- $app->enqueueMessage ( JText::_('COM_KUNENA_MENU_CREATED') );
- $this->redirectBack ();
- }
-}
View
90 administrator/components/com_kunena/controllers/prune.php
@@ -1,90 +0,0 @@
-<?php
-/**
- * Kunena Component
- * @package Kunena.Administrator
- * @subpackage Controllers
- *
- * @copyright (C) 2008 - 2011 Kunena Team. All rights reserved.
- * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
- * @link http://www.kunena.org
- **/
-defined ( '_JEXEC' ) or die ();
-
-/**
- * Kunena Prune Controller
- *
- * @since 2.0
- */
-class KunenaAdminControllerPrune extends KunenaController {
- protected $baseurl = null;
-
- public function __construct($config = array()) {
- parent::__construct($config);
- $this->baseurl = 'index.php?option=com_kunena&view=prune';
- }
-
- function doprune() {
- $app = JFactory::getApplication ();
- if (!JRequest::checkToken()) {
- $app->enqueueMessage ( JText::_ ( 'COM_KUNENA_ERROR_TOKEN' ), 'error' );
- $this->setRedirect(KunenaRoute::_($this->baseurl, false));
- return;
- }
-
- $categories = KunenaForumCategoryHelper::getCategories(JRequest::getVar ( 'prune_forum', array(0) ), false, 'admin');
- if (!$categories) {
- $app->enqueueMessage ( JText::_ ( 'COM_KUNENA_CHOOSEFORUMTOPRUNE' ), 'error' );
- $this->setRedirect(KunenaRoute::_($this->baseurl, false));
- return;
- }
-
- // Convert days to seconds for timestamp functions...
- $prune_days = JRequest::getInt ( 'prune_days', 36500 );
- $prune_date = JFactory::getDate()->toUnix() - ($prune_days * 86400);
-
- $trashdelete = JRequest::getInt( 'trashdelete', 0);
-
- $where = array();
- $where[] = " AND tt.last_post_time < {$prune_date}";
-
- $controloptions = JRequest::getString( 'controloptions', 0);
- if ( $controloptions == 'answered' ) {
- $where[] = 'AND tt.posts>1';
- } elseif ( $controloptions == 'unanswered' ) {
- $where[] = 'AND tt.posts=1';
- } elseif( $controloptions == 'locked' ) {
- $where[] = 'AND tt.locked>0';
- } elseif( $controloptions == 'deleted' ) {
- $where[] = 'AND tt.hold IN (2,3)';
- } elseif( $controloptions == 'unapproved' ) {
- $where[] = 'AND tt.hold=1';
- } elseif( $controloptions == 'shadow' ) {
- $where[] = 'AND tt.moved_id>0';
- } elseif( $controloptions == 'normal' ) {
- $where[] = 'AND tt.locked=0';
- } elseif( $controloptions == 'all' ) {
- // No filtering
- } else {
- $where[] = 'AND 0';
- }
-
- // Keep sticky topics?
- if (JRequest::getInt( 'keepsticky', 1)) $where[] = ' AND tt.ordering=0';
-
- $where = implode(' ', $where);
-
- $params = array(
- 'where'=> $where,
- );
-
- $count = 0;
- foreach ($categories as $category) {
- if ( $trashdelete ) $count += $category->purge($prune_date, $params);
- else $count += $category->trash($prune_date, $params);
- }
-
- if ( $trashdelete ) $app->enqueueMessage ( "" . JText::_('COM_KUNENA_FORUMPRUNEDFOR') . " " . $prune_days . " " . JText::_('COM_KUNENA_PRUNEDAYS') . "; " . JText::_('COM_KUNENA_PRUNEDELETED') . " {$count} " . JText::_('COM_KUNENA_PRUNETHREADS') );
- else $app->enqueueMessage ( "" . JText::_('COM_KUNENA_FORUMPRUNEDFOR') . " " . $prune_days . " " . JText::_('COM_KUNENA_PRUNEDAYS') . "; " . JText::_('COM_KUNENA_PRUNETRASHED') . " {$count} " . JText::_('COM_KUNENA_PRUNETHREADS') );
- $this->setRedirect(KunenaRoute::_($this->baseurl, false));
- }
-}
View
93 administrator/components/com_kunena/controllers/recount.php
@@ -1,93 +0,0 @@
-<?php
-/**
- * Kunena Component
- * @package Kunena.Administrator
- * @subpackage Controllers
- *
- * @copyright (C) 2008 - 2011 Kunena Team. All rights reserved.
- * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
- * @link http://www.kunena.org
- **/
-defined ( '_JEXEC' ) or die ();
-
-/**
- * Kunena Recount Controller
- *
- * @since 2.0
- */
-class KunenaAdminControllerRecount extends KunenaController {
- function display() {
- $this->recount();
- }
-
- function recount() {
- $app = JFactory::getApplication ();
- $state = $app->getUserState ( 'com_kunena.admin.recount', null );
-
- if ($state === null) {
- // First run
- $query = "SELECT MAX(id) FROM #__kunena_messages";
- $db = JFactory::getDBO();
- $db->setQuery ( $query );
- $state = new StdClass();
- $state->step = 0;
- $state->maxId = (int) $db->loadResult ();
- $state->start = 0;
- }
-
- $this->checkTimeout();
- while (1) {
- $count = mt_rand(95000, 105000);
- switch ($state->step) {
- case 0:
- // Update topic statistics
- KunenaForumTopicHelper::recount(false, $state->start, $state->start+$count);
- $state->start += $count;
- //$app->enqueueMessage ( JText::sprintf('COM_KUNENA_ADMIN_RECOUNT_TOPICS', min($state->start, $state->maxId), $state->maxId) );
- break;
- case 1:
- // Update usertopic statistics
- KunenaForumTopicUserHelper::recount(false, $state->start, $state->start+$count);
- $state->start += $count;
- //$app->enqueueMessage ( JText::sprintf('COM_KUNENA_ADMIN_RECOUNT_USERTOPICS', min($state->start, $state->maxId), $state->maxId) );
- break;
- case 2:
- // Update user statistics
- KunenaUserHelper::recount();
- //$app->enqueueMessage ( JText::sprintf('COM_KUNENA_ADMIN_RECOUNT_USER') );
- break;
- case 3:
- // Update category statistics
- KunenaForumCategoryHelper::recount();
- //$app->enqueueMessage ( JText::sprintf('COM_KUNENA_ADMIN_RECOUNT_CATEGORY') );
- break;
- default:
- $app->setUserState ( 'com_kunena.admin.recount', null );
- $app->enqueueMessage (JText::_('COM_KUNENA_RECOUNTFORUMS_DONE'));
- $this->setRedirect(KunenaRoute::_('index.php?option=com_kunena', false));
- return;
- }
- if (!$state->start || $state->start > $state->maxId) {
- $state->step++;
- $state->start = 0;
- }
- if ($this->checkTimeout()) break;
- }
- $app->setUserState ( 'com_kunena.admin.recount', $state );
- $this->setRedirect(KunenaRoute::_('index.php?option=com_kunena&view=recount&task=recount', false));
- }
-
- protected function checkTimeout($stop = false) {
- static $start = null;
- if ($stop) $start = 0;
- $time = microtime (true);
- if ($start === null) {
- $start = $time;
- return false;
- }
- if ($time - $start < 1)
- return false;
-
- return true;
- }
-}
View
62 administrator/components/com_kunena/controllers/syncusers.php
@@ -1,62 +0,0 @@
-<?php
-/**
- * Kunena Component
- * @package Kunena.Administrator
- * @subpackage Controllers
- *
- * @copyright (C) 2008 - 2011 Kunena Team. All rights reserved.
- * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
- * @link http://www.kunena.org
- **/
-defined ( '_JEXEC' ) or die ();
-
-/**
- * Kunena Syncusers Controller
- *
- * @since 2.0
- */
-class KunenaAdminControllerSyncusers extends KunenaController {
- protected $baseurl = null;
-
- public function __construct($config = array()) {
- parent::__construct($config);
- $this->baseurl = 'index.php?option=com_kunena&view=syncusers';
- }
-
- function sync() {
- // FIXME: remove option:
- $usercache = JRequest::getBool ( 'usercache', 0 );
- $useradd = JRequest::getBool ( 'useradd', 0 );
- $userdel = JRequest::getBool ( 'userdel', 0 );
- $userrename = JRequest::getBool ( 'userrename', 0 );
-
- $app = JFactory::getApplication ();
- $db = JFactory::getDBO ();
- if (!JRequest::checkToken()) {
- $app->enqueueMessage ( JText::_ ( 'COM_KUNENA_ERROR_TOKEN' ), 'error' );
- $this->setRedirect(KunenaRoute::_($this->baseurl, false));
- return;
- }
-
- if ($useradd) {
- $db->setQuery ( "INSERT INTO #__kunena_users (userid) SELECT a.id FROM #__users AS a LEFT JOIN #__kunena_users AS b ON b.userid=a.id WHERE b.userid IS NULL" );
- $db->query ();
- if (KunenaError::checkDatabaseError()) return;
- $app->enqueueMessage ( JText::_('COM_KUNENA_SYNC_USERS_DO_ADD') . ' ' . $db->getAffectedRows () );
- }
- if ($userdel) {
- $db->setQuery ( "DELETE a FROM #__kunena_users AS a LEFT JOIN #__users AS b ON a.userid=b.id WHERE b.username IS NULL" );
- $db->query ();
- if (KunenaError::checkDatabaseError()) return;
- $app->enqueueMessage ( JText::_('COM_KUNENA_SYNC_USERS_DO_DEL') . ' ' . $db->getAffectedRows () );
- }
- if ($userrename) {
- $model = $this->getModel('Syncusers');
- $cnt = $model->KupdateNameInfo ();
- $app->enqueueMessage ( JText::_('COM_KUNENA_SYNC_USERS_DO_RENAME') . " $cnt" );
- }
-
- $this->setRedirect(KunenaRoute::_($this->baseurl, false));
- }
-
-}
View
246 administrator/components/com_kunena/controllers/tools.php
@@ -0,0 +1,246 @@
+<?php
+/**
+ * Kunena Component
+ * @package Kunena.Administrator
+ * @subpackage Controllers
+ *
+ * @copyright (C) 2008 - 2011 Kunena Team. All rights reserved.
+ * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
+ * @link http://www.kunena.org
+ **/
+defined ( '_JEXEC' ) or die ();
+
+/**
+ * Kunena Cpanel Controller
+ *
+ * @since 2.0
+ */
+class KunenaAdminControllerTools extends KunenaController {
+ protected $baseurl = null;
+
+ public function __construct($config = array()) {
+ parent::__construct($config);
+ $this->baseurl = 'index.php?option=com_kunena&view=tools';
+ }
+
+ function prune() {
+ $app = JFactory::getApplication ();
+ if (!JRequest::checkToken()) {
+ $app->enqueueMessage ( JText::_ ( 'COM_KUNENA_ERROR_TOKEN' ), 'error' );
+ $this->setRedirect(KunenaRoute::_($this->baseurl, false));
+ return;
+ }
+
+ $categories = KunenaForumCategoryHelper::getCategories(JRequest::getVar ( 'prune_forum', array(0) ), false, 'admin');
+ if (!$categories) {
+ $app->enqueueMessage ( JText::_ ( 'COM_KUNENA_CHOOSEFORUMTOPRUNE' ), 'error' );
+ $this->setRedirect(KunenaRoute::_($this->baseurl, false));
+ return;
+ }
+
+ // Convert days to seconds for timestamp functions...
+ $prune_days = JRequest::getInt ( 'prune_days', 36500 );
+ $prune_date = JFactory::getDate()->toUnix() - ($prune_days * 86400);
+
+ $trashdelete = JRequest::getInt( 'trashdelete', 0);
+
+ $where = array();
+ $where[] = " AND tt.last_post_time < {$prune_date}";
+
+ $controloptions = JRequest::getString( 'controloptions', 0);
+ if ( $controloptions == 'answered' ) {
+ $where[] = 'AND tt.posts>1';
+ } elseif ( $controloptions == 'unanswered' ) {
+ $where[] = 'AND tt.posts=1';
+ } elseif( $controloptions == 'locked' ) {
+ $where[] = 'AND tt.locked>0';
+ } elseif( $controloptions == 'deleted' ) {
+ $where[] = 'AND tt.hold IN (2,3)';
+ } elseif( $controloptions == 'unapproved' ) {
+ $where[] = 'AND tt.hold=1';
+ } elseif( $controloptions == 'shadow' ) {
+ $where[] = 'AND tt.moved_id>0';
+ } elseif( $controloptions == 'normal' ) {
+ $where[] = 'AND tt.locked=0';
+ } elseif( $controloptions == 'all' ) {
+ // No filtering
+ } else {
+ $where[] = 'AND 0';
+ }
+
+ // Keep sticky topics?
+ if (JRequest::getInt( 'keepsticky', 1)) $where[] = ' AND tt.ordering=0';
+
+ $where = implode(' ', $where);
+
+ $params = array(
+ 'where'=> $where,
+ );
+
+ $count = 0;
+ foreach ($categories as $category) {
+ if ( $trashdelete ) $count += $category->purge($prune_date, $params);
+ else $count += $category->trash($prune_date, $params);
+ }
+
+ if ( $trashdelete ) $app->enqueueMessage ( "" . JText::_('COM_KUNENA_FORUMPRUNEDFOR') . " " . $prune_days . " " . JText::_('COM_KUNENA_PRUNEDAYS') . "; " . JText::_('COM_KUNENA_PRUNEDELETED') . " {$count} " . JText::_('COM_KUNENA_PRUNETHREADS') );
+ else $app->enqueueMessage ( "" . JText::_('COM_KUNENA_FORUMPRUNEDFOR') . " " . $prune_days . " " . JText::_('COM_KUNENA_PRUNEDAYS') . "; " . JText::_('COM_KUNENA_PRUNETRASHED') . " {$count} " . JText::_('COM_KUNENA_PRUNETHREADS') );
+ $this->setRedirect(KunenaRoute::_($this->baseurl, false));
+ }
+
+ function syncusers() {
+ $useradd = JRequest::getBool ( 'useradd', 0 );
+ $userdel = JRequest::getBool ( 'userdel', 0 );
+ $userrename = JRequest::getBool ( 'userrename', 0 );
+
+ $app = JFactory::getApplication ();
+ $db = JFactory::getDBO ();
+ if (!JRequest::checkToken()) {
+ $app->enqueueMessage ( JText::_ ( 'COM_KUNENA_ERROR_TOKEN' ), 'error' );
+ $this->setRedirect(KunenaRoute::_($this->baseurl, false));
+ return;
+ }
+
+ if ($useradd) {
+ $db->setQuery ( "INSERT INTO #__kunena_users (userid) SELECT a.id FROM #__users AS a LEFT JOIN #__kunena_users AS b ON b.userid=a.id WHERE b.userid IS NULL" );
+ $db->query ();
+ if (KunenaError::checkDatabaseError()) return;
+ $app->enqueueMessage ( JText::_('COM_KUNENA_SYNC_USERS_DO_ADD') . ' ' . $db->getAffectedRows () );
+ }
+ if ($userdel) {
+ $db->setQuery ( "DELETE a FROM #__kunena_users AS a LEFT JOIN #__users AS b ON a.userid=b.id WHERE b.username IS NULL" );
+ $db->query ();
+ if (KunenaError::checkDatabaseError()) return;
+ $app->enqueueMessage ( JText::_('COM_KUNENA_SYNC_USERS_DO_DEL') . ' ' . $db->getAffectedRows () );
+ }
+ if ($userrename) {
+ $queryName = KunenaFactory::getConfig ()->username ? "username" : "name";
+
+ $db = JFactory::getDBO();
+ $query = "UPDATE #__kunena_messages AS m
+ INNER JOIN #__users AS u
+ SET m.name = u.{$queryName}
+ WHERE m.userid = u.id";
+ $db->setQuery($query);
+ $db->query();
+ if (KunenaError::checkDatabaseError()) return;
+
+ $app->enqueueMessage ( JText::_('COM_KUNENA_SYNC_USERS_DO_RENAME') . $db->getAffectedRows() );
+ }
+
+ $this->setRedirect(KunenaRoute::_($this->baseurl, false));
+ }
+
+ function recount() {
+ $app = JFactory::getApplication ();
+ $state = $app->getUserState ( 'com_kunena.admin.recount', null );
+
+ if ($state === null) {
+ // First run: get last message id (if topics were created with <K2.0)
+ $query = "SELECT MAX(id) FROM #__kunena_messages";
+ $db = JFactory::getDBO();
+ $db->setQuery ( $query );
+ $state = new StdClass();
+ $state->step = 0;
+ $state->maxId = (int) $db->loadResult ();
+ $state->start = 0;
+ $state->reload = 0;
+
+ $state->topics = JRequest::getBool('topics', false);
+ $state->usertopics = JRequest::getBool('usertopics', false);
+ $state->categories = JRequest::getBool('categories', false);
+ $state->users = JRequest::getBool('users', false);
+ }
+
+ $this->checkTimeout();
+ while (1) {
+ $count = mt_rand(95000, 105000);
+ switch ($state->step) {
+ case 0:
+ if ($state->topics) {
+ // Update topic statistics
+ KunenaForumTopicHelper::recount(false, $state->start, $state->start+$count);
+ $state->start += $count;
+ //$app->enqueueMessage ( JText::sprintf('COM_KUNENA_ADMIN_RECOUNT_TOPICS', min($state->start, $state->maxId), $state->maxId) );
+ }
+ break;
+ case 1:
+ if ($state->usertopics) {
+ // Update usertopic statistics
+ KunenaForumTopicUserHelper::recount(false, $state->start, $state->start+$count);
+ $state->start += $count;
+ //$app->enqueueMessage ( JText::sprintf('COM_KUNENA_ADMIN_RECOUNT_USERTOPICS', min($state->start, $state->maxId), $state->maxId) );
+ }
+ break;
+ case 2:
+ if ($state->categories) {
+ // Update category statistics
+ KunenaForumCategoryHelper::recount();
+ //$app->enqueueMessage ( JText::sprintf('COM_KUNENA_ADMIN_RECOUNT_CATEGORY') );
+ }
+ break;
+ case 3:
+ if ($state->users) {
+ // Update user statistics
+ KunenaUserHelper::recount();
+ //$app->enqueueMessage ( JText::sprintf('COM_KUNENA_ADMIN_RECOUNT_USER') );
+ }
+ break;
+ default:
+ $app->setUserState ( 'com_kunena.admin.recount', null );
+ $app->enqueueMessage (JText::_('COM_KUNENA_RECOUNTFORUMS_DONE'));
+ $this->setRedirect(KunenaRoute::_($this->baseurl, false));
+ return;
+ }
+ if (!$state->start || $state->start > $state->maxId) {
+ $state->step++;
+ $state->start = 0;
+ }
+ if ($this->checkTimeout()) break;
+ }
+ $state->reload++;
+ $app->setUserState ( 'com_kunena.admin.recount', $state );
+ $this->setRedirect(KunenaRoute::_("{$this->baseurl}&task=recount&i={$state->reload}", false));
+ }
+
+ public function trashmenu() {
+ $app = JFactory::getApplication ();
+ $lang = JFactory::getLanguage();
+ // Start by loading English strings and override them by current locale
+ $lang->load('com_kunena.install',JPATH_ADMINISTRATOR, 'en-GB');
+ $lang->load('com_kunena.install',JPATH_ADMINISTRATOR, null, true);
+
+ require_once(KPATH_ADMIN . '/install/model.php');
+ $installer = new KunenaModelInstall();
+ $installer->deleteMenu();
+ $installer->createMenu();
+
+ $app->enqueueMessage ( JText::_('COM_KUNENA_MENU_CREATED') );
+ $this->setRedirect(KunenaRoute::_($this->baseurl, false));
+ }
+
+ public function fixlegacy() {
+ $app = JFactory::getApplication ();
+
+ $legacy = KunenaMenuHelper::getLegacy();
+ $error = KunenaMenuHelper::fixLegacy();
+
+ if ($error) $app->enqueueMessage ( JText::sprintf('COM_KUNENA_MENU_FIXED_LEGACY_FAILED', $error ), 'notice' );
+ else $app->enqueueMessage ( JText::sprintf('COM_KUNENA_MENU_FIXED_LEGACY', count($legacy) ) );
+ $this->setRedirect(KunenaRoute::_($this->baseurl, false));
+ }
+
+ protected function checkTimeout($stop = false) {
+ static $start = null;
+ if ($stop) $start = 0;
+ $time = microtime (true);
+ if ($start === null) {
+ $start = $time;
+ return false;
+ }
+ if ($time - $start < 1)
+ return false;
+
+ return true;
+ }
+}
View
6 administrator/components/com_kunena/install/controller.php
@@ -36,8 +36,10 @@ public function __construct() {
$this->steps = $this->model->getSteps ();
}
+ // Run from administrator installer
function prepare() {
JRequest::checkToken( 'get' ) or die( 'Invalid Token' );
+ $start = JRequest::getBool('start', false);
$this->model->setStep ( 0 );
// Install English and default language
@@ -45,7 +47,7 @@ function prepare() {
$this->model->installLanguage('en-GB');
if ($tag != 'en-GB') $this->model->installLanguage($tag);
- $this->setRedirect('index.php?option=com_kunena&view=install');
+ $this->setRedirect('index.php?option=com_kunena&view=install' . ($start ? '&task=upgrade&'.JUtility::getToken().'=1' : ''));
}
public function display()
@@ -167,7 +169,7 @@ function uninstall() {
$this->model->deleteMenu();
$app = JFactory::getApplication();
$app->enqueueMessage(JText::_('COM_KUNENA_INSTALL_REMOVED'));
- if (!KunenaForum::isSvn()) {
+ if (!KunenaForum::isDev()) {
jimport('joomla.filesystem.folder');
JFolder::delete(KPATH_MEDIA);
jimport('joomla.installer.installer');
View
4 administrator/components/com_kunena/install/data/sampledata.php
@@ -176,13 +176,13 @@ function installSampleData()
$query="INSERT INTO `#__kunena_messages_text`
(`mesid`, `message`) VALUES
- (1, ".$db->quote(KText::_('COM_KUNENA_SAMPLEDATA_POST1_TEXT')).");";
+ (1, ".$db->quote(KText::_('COM_KUNENA_SAMPLEDATA_POST1_TEXT_CONTENT')).");";
$queries[] = array ('kunena_messages_text', $query);
$query="INSERT INTO `#__kunena_topics`
(`id`, `category_id`, `subject`, `posts`, `first_post_id`, `first_post_time`, `first_post_userid`, `first_post_message`, `first_post_guest_name`, `last_post_id`, `last_post_time`, `last_post_userid`, `last_post_message`, `last_post_guest_name`) VALUES
- (1, 2, ".$db->quote(KText::_('COM_KUNENA_SAMPLEDATA_POST1_SUBJECT')).", 1, 1, ".$posttime->toUnix().", ".$db->quote($my->id).", ".$db->quote(KText::_('COM_KUNENA_SAMPLEDATA_POST1_TEXT')).", 'Kunena', 1, ".$posttime->toUnix().", ".$db->quote($my->id).", ".$db->quote(KText::_('COM_KUNENA_SAMPLEDATA_POST1_TEXT')).", 'Kunena');";
+ (1, 2, ".$db->quote(KText::_('COM_KUNENA_SAMPLEDATA_POST1_SUBJECT')).", 1, 1, ".$posttime->toUnix().", ".$db->quote($my->id).", ".$db->quote(KText::_('COM_KUNENA_SAMPLEDATA_POST1_TEXT_CONTENT')).", 'Kunena', 1, ".$posttime->toUnix().", ".$db->quote($my->id).", ".$db->quote(KText::_('COM_KUNENA_SAMPLEDATA_POST1_TEXT_CONTENT')).", 'Kunena');";
$queries[] = array ('kunena_topics', $query);
View
2  administrator/components/com_kunena/install/entrypoints/api.php
@@ -84,7 +84,7 @@ function KunenaAutoload($class) {
class KunenaForum {
private function __construct() {}
- public static function isSvn() {
+ public static function isDev() {
if ('@kunenaversion@' == '@' . 'kunenaversion' . '@') {
return true;
}
View
16 administrator/components/com_kunena/install/install.kunena.php
@@ -9,6 +9,8 @@
**/
defined ( '_JEXEC' ) or die ();
+jimport( 'joomla.filesystem.file' );
+
// This isn't called because of redirect
$this->parent->copyManifest();
@@ -24,13 +26,17 @@ function com_install() {
return false;
}
- // Emulate J1.6 installer
- include_once(dirname(__FILE__).'/install.script.php');
- Com_KunenaInstallerScript::preflight( 'update', null );
- Com_KunenaInstallerScript::install ( null );
- $redirect_url = Com_KunenaInstallerScript::postflight( 'update', null );
+ // Initialise Kunena installer
+ require_once(JPATH_ADMINISTRATOR . '/components/com_kunena/install/model.php');
+ $installer = new KunenaModelInstall();
+ $installer->install();
+
+ // Remove deprecated manifest.xml (K1.5)
+ $manifest = JPATH_ADMINISTRATOR . '/components/com_kunena/manifest.xml';
+ if (JFile::exists($manifest)) JFile::delete($manifest);
// Redirect to Kunena Installer
+ $redirect_url = JURI::base () . 'index.php?option=com_kunena&view=install';
header ( "HTTP/1.1 303 See Other" );
header ( "Location: {$redirect_url}" );
}
View
134 administrator/components/com_kunena/install/install.script.php
@@ -13,92 +13,106 @@
jimport( 'joomla.filesystem.file' );
class Com_KunenaInstallerScript {
+ protected $versions = array(
+ 'PHP' => array (
+ '5.2' => '5.2.4',
+ ),
+ 'MySQL' => array (
+ '5.0' => '5.0.4',
+ ),
+ 'Joomla' => array (
+ '2.5' => '2.5',
+ '1.7' => '1.7.3',
+ )
+ );
+ protected $extensions = array ('dom', 'gd', 'json', 'pcre', 'SimpleXML');
- function install($parent) {
- $app = JFactory::getApplication();
- $app->setUserState('com_kunena.install.step', 0);
-
- // Install English and default language
+ public function install($parent) {
require_once(JPATH_ADMINISTRATOR . '/components/com_kunena/install/model.php');
$installer = new KunenaModelInstall();
- $installer->installLanguage('en-GB');
- $lang = JFactory::getLanguage();
- $tag = $lang->getTag();
- if ($tag != 'en-GB') $installer->installLanguage($tag);
+ $installer->install();
return true;
}
- function discover_install($parent) {
+ public function discover_install($parent) {
return self::install($parent);
}
- function update($parent) {
+ public function update($parent) {
return self::install($parent);
}
- function uninstall($parent) {
- require_once (JPATH_ADMINISTRATOR . '/components/com_kunena/api.php');
- $lang = JFactory::getLanguage();
- $lang->load('com_kunena.install',JPATH_ADMINISTRATOR);
-
- require_once(KPATH_ADMIN . '/install/model.php');
+ public function uninstall($parent) {
+ require_once(JPATH_ADMINISTRATOR . '/components/com_kunena/install/model.php');
$installer = new KunenaModelInstall();
- $installer->uninstallPlugin('kunena', 'alphauserpoints');
- $installer->uninstallPlugin('kunena', 'community');
- $installer->uninstallPlugin('kunena', 'comprofiler');
- $installer->uninstallPlugin('kunena', 'gravatar');
- $installer->uninstallPlugin('kunena', 'joomla');
- $installer->uninstallPlugin('kunena', 'kunena');
- $installer->uninstallPlugin('kunena', 'uddeim');
- $installer->uninstallPlugin('system', 'kunena');
- $installer->deleteMenu();
+ $installer->uninstall();
return true;
}
- function preflight($type, $parent) {
+ public function preflight($type, $parent) {
+ // Prevent installation if requirements are not met.
+ if (!$this->checkRequirements()) return false;
+
+ // Do not install over Git repository.
+ if (method_exists('Kunena', 'isSvn') && Kunena::isSvn() || method_exists('KunenaForum', 'isDev') && KunenaForum::isDev()) {
+ JFactory::getApplication()->enqueueMessage('Oops! You should not install Kunena over your Git reporitory!', 'notice');
+ return false;
+ }
+
// TODO: Before install: we want so store files so that user can cancel action
- if (version_compare(JVERSION, '1.6', '>')) {
- $installer = $parent->getParent();
- $adminpath = $installer->extension_administrator;
- if ( JFolder::exists($adminpath)) {
- // Delete old zip files
- $archive = "{$adminpath}/archive";
- if ( JFolder::exists($archive)) {
- JFolder::delete($archive);
- // We want to keep empty directory (it is defined in manifest file)
- JFolder::create($archive);
- }
+
+ $installer = $parent->getParent();
+ $adminpath = $installer->extension_administrator;
+ if ( JFolder::exists($adminpath)) {
+ // Delete old zip files
+ $archive = "{$adminpath}/archive";
+ if ( JFolder::exists($archive)) {
+ JFolder::delete($archive);
+ // We want to keep empty directory (it is defined in manifest file)
+ JFolder::create($archive);
}
}
return true;
}
- function postflight($type, $parent) {
- $redirect_url = JURI::base () . 'index.php?option=com_kunena&view=install&task=prepare&'.JUtility::getToken().'=1';
- if (version_compare(JVERSION, '1.6', '>')) {
- // Joomla 1.6+
- $installer = $parent->getParent();
+ public function postflight($type, $parent) {
+ $installer = $parent->getParent();
- // Set redirect
- $installer->set('redirect_url', $redirect_url);
+ // Rename kunena.j16.xml to kunena.xml
+ $adminpath = $installer->extension_administrator;
+ if (JFile::exists("{$adminpath}/kunena.j16.xml")) {
+ if ( JFile::exists("{$adminpath}/kunena.xml")) JFile::delete("{$adminpath}/kunena.xml");
+ JFile::move("{$adminpath}/kunena.j16.xml", "{$adminpath}/kunena.xml");
+ }
- // Rename kunena.j16.xml to kunena.xml
- $adminpath = $installer->extension_administrator;
- if (JFile::exists("{$adminpath}/kunena.j16.xml")) {
- if ( JFile::exists("{$adminpath}/kunena.xml")) JFile::delete("{$adminpath}/kunena.xml");
- JFile::move("{$adminpath}/kunena.j16.xml", "{$adminpath}/kunena.xml");
- }
- } else {
- // Joomla 1.5
- $manifest = JPATH_ADMINISTRATOR . '/components/com_kunena/manifest.xml';
- if (JFile::exists($manifest)) {
- // Remove deprecated manifest.xml (K1.5)
- JFile::delete($manifest);
- }
+ // Set redirect
+ $installer->set('redirect_url', JURI::base () . 'index.php?option=com_kunena&view=install');
+
+ return true;
+ }
+
+ // Internal functions
- return $redirect_url;
+ protected function checkRequirements() {
+ $pass = $this->checkVersion('Joomla', JVERSION);
+ $pass &= $this->checkVersion('MySQL', JFactory::getDbo()->getVersion ());
+ $pass &= $this->checkVersion('PHP', phpversion());
+ foreach ($this->extensions as $name) {
+ if (!extension_loaded($name)) {
+ JFactory::getApplication()->enqueueMessage(sprintf('Missing PHP extension: %s.', $name), 'notice');
+ $pass = false;
+ }
}
+ return $pass;
+ }
- return true;
+ protected function checkVersion($name, $version) {
+ foreach ($this->versions[$name] as $major=>$minor) {
+ if (version_compare ( $version, $major, "<" )) continue;
+ if (version_compare ( $version, $minor, ">=" )) return true;
+ break;
+ }
+ JFactory::getApplication()->enqueueMessage(sprintf('%s %s required (you have %s %s).', $name, $minor, $name, $version), 'notice');
+ return false;
}
}
View
1  administrator/components/com_kunena/install/install.xml
@@ -15,6 +15,7 @@
<field primary_key="yes" name="id" type="int(3)" null="0"
extra="auto_increment" />
<field name="title" type="tinytext" null="0" />
+ <field name="created_by" type="int(10)" null="0" default="0" />
<field name="sdescription" type="text" null="0" />
<field name="description" type="text" null="0" />
<field name="created" type="datetime" null="0" default="0000-00-00 00:00:00" />
View
6 administrator/components/com_kunena/install/kunena.install.upgrade.xml
@@ -326,6 +326,12 @@
<query mode="silenterror">ALTER TABLE `#__kunena_categories` ADD `alias` varchar(255) NOT NULL AFTER `name`;</query>
<phpfile name="upgrade-2.0.0_aliases"></phpfile>
</version>
+ <version version="2.0.0-DEV8" versiondate="2011-12-18" versionname="Internal">
+ <query mode="silenterror">ALTER TABLE `#__kunena_announcement` ADD `created_by` int(10) NOT NULL AFTER `title`;</query>
+ </version>
+ <version version="2.0.0-DEV9" versiondate="2011-12-18" versionname="Internal">
+ <phpfile name="upgrade-2.0.0_menu"></phpfile>
+ </version>
<version version="@kunenaversion@" versiondate="@kunenaversiondate@" versionname="@kunenaversionname@">
</version>
</upgrade>
View
1  administrator/components/com_kunena/install/media/install.css
@@ -310,6 +310,7 @@ div#installer div.n {
div#element-box div.m {
border: 0;
padding: 0 !important;
+ background:#FFF;
}
div#element-box div.t,
View
70 administrator/components/com_kunena/install/model.php
@@ -9,12 +9,10 @@
**/
defined ( '_JEXEC' ) or die ();
-// Minimum version requirements
+// Minimum version requirements for Joomla 1.5
DEFINE('KUNENA_MIN_PHP', '5.2.4');
DEFINE('KUNENA_MIN_MYSQL', '5.0.4');
-DEFINE ( 'KUNENA_MIN_JOOMLA15', '1.5.23' );
-DEFINE ( 'KUNENA_MIN_JOOMLA16', '1.6.4' );
-DEFINE ( 'KUNENA_MIN_JOOMLA17', '1.7.0' );
+DEFINE('KUNENA_MIN_JOOMLA', '1.5.25');
jimport ( 'joomla.application.component.model' );
jimport ( 'joomla.filesystem.folder' );
@@ -99,6 +97,46 @@ public function __destruct() {
}
/**
+ * Initialise Kunena, run from Joomla installer.
+ */
+ public function install() {
+ $lang = JFactory::getLanguage();
+ $tag = $lang->getTag();
+
+ // Install English and default language
+ $this->installLanguage('en-GB');
+ if ($tag != 'en-GB') $this->installLanguage($tag);
+
+ $this->setStep(0);
+ }
+
+ /**
+ * Uninstall Kunena, run from Joomla installer.
+ */
+ public function uninstall() {
+ $lang = JFactory::getLanguage();
+ $lang->load('com_kunena.install',JPATH_ADMINISTRATOR);
+
+ $this->uninstallPlugin('kunena', 'alphauserpoints');
+ $this->uninstallPlugin('kunena', 'community');
+ $this->uninstallPlugin('kunena', 'comprofiler');
+ $this->uninstallPlugin('kunena', 'gravatar');
+ $this->uninstallPlugin('kunena', 'joomla');
+ $this->uninstallPlugin('kunena', 'kunena');
+ $this->uninstallPlugin('kunena', 'uddeim');
+ $this->uninstallPlugin('finder', 'kunena');
+ $this->uninstallPlugin('system', 'kunena');
+ if (class_exists('KunenaMenuHelper')) {
+ $items = KunenaMenuHelper::getAll();
+ foreach ($items as $item) {
+ KunenaMenuHelper::delete($item->id);
+ }
+ }
+ $this->deleteMenu();
+ return true;
+ }
+
+ /**
* Installer cleanup after installation
*
* @access public
@@ -255,6 +293,8 @@ function installLanguage($tag, $name = '') {
// SVN never has these files, installation package may have
if (file_exists("$path/$file")) {
$success = $this->extract ( $path, $file, $installdir, true );
+ } else {
+ $success = false;
}
}
// Install language from dest/language/xx-XX
@@ -288,7 +328,7 @@ function publishPlugin($folder, $name, $enable = 1) {
}
function installPlugin($path, $group, $name, $publish) {
- $dest = JPATH_ROOT.'/tmp/kinstall_plugin';
+ $dest = JPATH_ROOT."/tmp/kinstall_plg_{$group}_{$name}";
if (is_file(KPATH_ADMIN .'/'. $path)) {
// Extract file
$success = $this->extract ( KPATH_ADMIN, $path, $dest );
@@ -415,7 +455,7 @@ public function stepLanguage() {
public function stepExtract() {
$path = JPATH_ADMINISTRATOR . '/components/com_kunena/archive';
- if (KunenaForum::isSVN() || !is_file("{$path}/fileformat")) {
+ if (KunenaForum::isDev() || !is_file("{$path}/fileformat")) {
// SVN install
$dir = JPATH_ADMINISTRATOR.'/components/com_kunena/media/kunena';
if (is_dir($dir)) {
@@ -447,7 +487,7 @@ public function stepExtract() {
$this->deleteFolders($dest, $ignore[$dest]);
}
// Copy new files into folder
- $this->extract ( $path, $file['name'] . $ext, $dest, KunenaForum::isSVN() );
+ $this->extract ( $path, $file['name'] . $ext, $dest, KunenaForum::isDev() );
}
$this->setTask($task+1);
} else {
@@ -460,6 +500,7 @@ public function stepExtract() {
public function stepPlugins() {
$this->installPlugin('install/plugins/plg_system_kunena', 'system', 'kunena', true);
+ $this->installPlugin('install/plugins/plg_finder_kunena', 'finder', 'kunena', false);
$this->installPlugin('install/plugins/plg_kunena_kunena', 'kunena', 'kunena', true);
$this->installPlugin('install/plugins/plg_kunena_joomla15', 'kunena', 'joomla', true);
$this->installPlugin('install/plugins/plg_kunena_joomla16', 'kunena', 'joomla', true);
@@ -542,9 +583,9 @@ public function stepFinish() {
}
// Cleanup directory structure
- if (!KunenaForum::isSVN()) {
- if( JFolder::exists(KPATH_ADMIN . '/language') ) JFolder::delete(KPATH_ADMIN . '/language');
- if( JFolder::exists(KPATH_SITE . '/language') ) JFolder::delete(KPATH_SITE . '/language');
+ if (!KunenaForum::isDev()) {
+ if ( JFolder::exists(KPATH_ADMIN . '/language') ) JFolder::delete(KPATH_ADMIN . '/language');
+ if ( JFolder::exists(KPATH_SITE . '/language') ) JFolder::delete(KPATH_SITE . '/language');
}
if (! $this->getError ()) {
@@ -1112,6 +1153,7 @@ function recountCategories() {
return false;
}
+ // Needed for Joomla 1.5 only
public function getRequirements() {
if ($this->_req !== false) {
return $this->_req;
@@ -1128,11 +1170,7 @@ public function getRequirements() {
$req->fail ['mysql'] = true;
if (version_compare ( $req->php, KUNENA_MIN_PHP, "<" ))
$req->fail ['php'] = true;
- if (version_compare ( $req->joomla, '1.7', ">" ) && version_compare ( $req->joomla, KUNENA_MIN_JOOMLA17, "<" ))
- $req->fail ['joomla'] = true;
- elseif (version_compare ( $req->joomla, '1.6', ">" ) && version_compare ( $req->joomla, KUNENA_MIN_JOOMLA16, "<" ))
- $req->fail ['joomla'] = true;
- elseif (version_compare ( $req->joomla, KUNENA_MIN_JOOMLA15, "<" ))
+ if (version_compare ( $req->joomla, KUNENA_MIN_JOOMLA, "<" ))
$req->fail ['joomla'] = true;
if(!class_exists('DOMDocument')){
$req->fail ['domdocument'] = true;
@@ -1914,4 +1952,4 @@ protected function _getJoomlaArchiveError($archive) {
}
class KunenaInstallerException extends Exception {
-}
+}
View
0  ...onents/com_kunena/views/syncusers/tmpl/index.html → ...nena/install/plugins/plg_finder_kunena/index.html
File renamed without changes
View
17 administrator/components/com_kunena/install/plugins/plg_finder_kunena/kunena.j16.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE extension>
+<extension version="1.6" type="plugin" group="finder" method="upgrade">
+ <name>plg_finder_kunena</name>
+ <version>@kunenaversion@</version>
+ <creationDate>@kunenaversiondate@</creationDate>
+ <author>Kunena Team</author>
+ <authorEmail>Kunena@kunena.org</authorEmail>
+ <authorUrl>http://www.kunena.org</authorUrl>
+ <copyright>(C) 2008 - 2012 Kunena Team. All rights reserved.</copyright>
+ <license>GNU/GPL</license>
+ <description>PLG_FINDER_KUNENA_DESCRIPTION</description>
+ <files>
+ <filename plugin="kunena">kunena.php</filename>
+ <filename>index.html</filename>
+ </files>
+</extension>
View
264 administrator/components/com_kunena/install/plugins/plg_finder_kunena/kunena.php
@@ -0,0 +1,264 @@
+<?php
+/**
+ * Kunena Plugin
+ * @package Kunena.Plugins
+ * @subpackage Finder
+ *
+ * @Copyright (C) 2008 - 2012 Kunena Team. All rights reserved.
+ * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
+ * @link http://www.kunena.org
+ **/
+defined ( '_JEXEC' ) or die ( '' );
+
+jimport('joomla.application.component.helper');
+
+// Load the base adapter.
+require_once JPATH_ADMINISTRATOR . '/components/com_finder/helpers/indexer/adapter.php';
+
+/**
+ * Finder adapter for com_kunena.
+ */
+class plgFinderKunena extends FinderIndexerAdapter {
+ /**
+ * The plugin identifier.
+ *
+ * @var string
+ * @since 2.5
+ */
+ protected $context = 'Kunena';
+
+ /**
+ * The extension name.
+ *
+ * @var string
+ * @since 2.5
+ */
+ protected $extension = 'com_kunena';
+
+ /**
+ * The sublayout to use when rendering the results.
+ *
+ * @var string
+ * @since 2.5
+ */
+ protected $layout = 'topic';
+
+ /**
+ * The type of content that the adapter indexes.
+ *
+ * @var string
+ * @since 2.5
+ */
+ protected $type_title = 'Forum Post';
+
+ /**
+ * Method to reindex the link information for an item that has been saved.
+ * This event is fired before the data is actually saved so we are going
+ * to queue the item to be indexed later.
+ *
+ * @param string $context The context of the content passed to the plugin.
+ * @param JTable $row A JTable object
+ * @param boolean $isNew If the content is just about to be created
+ *
+ * @return boolean True on success.
+ *
+ * @since 2.5
+ * @throws Exception on database error.
+ */
+ public function onFinderBeforeSave($context, $row, $isNew) {
+ // We only want to handle articles here
+ if ($context == 'com_kunena.message') {
+ // Query the database for the old access level if the item isn't new
+ if (!$isNew) {
+ $query = $this->db->getQuery(true);
+ $query->select($this->db->quoteName('access'));
+ $query->from($this->db->quoteName('#__content'));
+ $query->where($this->db->quoteName('id') . ' = ' . (int)$row->id);
+ $this->db->setQuery($query);
+
+ // Store the access level to determine if it changes
+ $this->old_access = $this->db->loadResult();
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * Method to determine if the access level of an item changed.
+ *
+ * @param string $context The context of the content passed to the plugin.
+ * @param JTable $row A JTable object
+ * @param boolean $isNew If the content has just been created
+ *
+ * @return boolean True on success.
+ *
+ * @since 2.5
+ * @throws Exception on database error.
+ */
+ public function onFinderAfterSave($context, $row, $isNew) {
+ // We only want to handle Kunena messages in here
+ if ($context == 'com_kunena.message') {
+ // Check if the access levels are different
+ if (!$isNew && $this->old_access != $row->access) {
+ $sql = clone($this->_getStateQuery());
+ $sql->where('a.id = ' . (int) $row->id);
+
+ // Get the access level.
+ $this->db->setQuery($sql);
+ $item = $this->db->loadObject();
+
+ // Set the access level.
+ $temp = max($row->access, $item->cat_access);
+
+ // Update the item.
+ $this->change((int) $row->id, 'access', $temp);
+ }
+
+ // Run the setup method.
+ $this->setup();
+
+ // Get the item.
+ $item = $this->getItem($row->id);
+
+ // Index the item.
+ $this->index($item);
+
+ }
+
+ return true;
+ }
+
+ /**
+ * Method to remove the link information for items that have been deleted.
+ *
+ * @param string $context The context of the action being performed.
+ * @param JTable $table A JTable object containing the record to be deleted
+ *
+ * @return boolean True on success.
+ *
+ * @since 2.5
+ * @throws Exception on database error.
+ */
+ public function onFinderAfterDelete($context, $table)
+ {
+ if ($context == 'com_kunena.message') {
+ $id = $table->id;
+ } elseif ($context == 'com_finder.index') {
+ $id = $table->link_id;
+ } else {
+ return true;
+ }
+ // Remove the items.
+ return $this->remove($id);
+ }
+
+ /**
+ * Method to index an item. The item must be a FinderIndexerResult object.
+ *
+ * @param FinderIndexerResult $item The item to index as an FinderIndexerResult object.
+ *
+ * @return void
+ *
+ * @since 2.5
+ * @throws Exception on database error.
+ */
+ protected function index(FinderIndexerResult $item, $format = 'html') {
+ // Check if the extension is enabled
+ if (JComponentHelper::isEnabled($this->extension) == false) {
+ return;
+ }
+
+ // Translate the access group to an access level.
+ // FIXME:
+ $item->access = $item->cat_access = 1; // $this->getAccessLevel($item->cat_access);
+
+ // Set the language.
+ $item->language = FinderIndexerHelper::getDefaultLanguage();
+
+ // Trigger the onContentPrepare event.
+ $item->body = $item->summary = FinderIndexerHelper::prepareContent(KunenaHtmlParser::parseBBCode($item->body));
+
+ // Build the necessary route and path information.
+ $item->url = $this->getURL($item, $this->extension, $this->layout);
+ $item->route = $item->url.'&Itemid='.KunenaRoute::getItemId($item->url);
+ $item->path = FinderIndexerHelper::getContentPath($item->route);
+
+ // Add the meta-data processing instructions.
+ $item->addInstruction(FinderIndexer::META_CONTEXT, 'author');
+
+ // Add the type taxonomy data.
+ $item->addTaxonomy('Type', 'Forum Post');
+
+ // Add the author taxonomy data.
+ if (!empty($item->author)) {
+ $item->addTaxonomy('Author', $item->author);
+ }
+
+ // Add the category taxonomy data.
+// $item->addTaxonomy('Category', $item->category, $item->cat_state, $item->cat_access);
+
+ // Add the language taxonomy data.
+ $item->addTaxonomy('Language', $item->language);
+
+ // Get content extras.
+ FinderIndexerHelper::getContentExtras($item);
+
+ // Index the item.
+ FinderIndexer::index($item);
+ }
+
+ /**
+ * Method to setup the indexer to be run.
+ *
+ * @return boolean True on success.
+ *
+ * @since 2.5
+ */
+ protected function setup() {
+ // Check if Kunena has been installed.
+ if (! class_exists ( 'KunenaForum' ) || ! KunenaForum::installed()) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Method to get the SQL query used to retrieve the list of content items.
+ *
+ * @param mixed $sql A JDatabaseQuery object or null.
+ *
+ * @return JDatabaseQuery A database object.
+ *
+ * @since 2.5
+ */
+ protected function getListQuery($sql = null)
+ {
+ // Check if we can use the supplied SQL query.
+ $sql = is_a($sql, 'JDatabaseQuery') ? $sql : $this->db->getQuery(true);
+ $sql->select('m.id, m.parent, m.thread, m.catid, m.subject AS title');
+ $sql->select('FROM_UNIXTIME(m.time, \'%Y-%m-%d %H:%i:%s\') AS start_date');
+ $sql->select('m.name AS author, t.message AS summary, t.message AS body');
+ $sql->select('c.name AS category, 1 AS state, c.published AS cat_state, c.pub_access AS access, c.pub_access AS cat_access');
+ $sql->from('#__kunena_messages AS m');
+ $sql->join('INNER', '#__kunena_messages_text AS t ON t.mesid = m.id');
+ $sql->join('INNER', '#__kunena_categories AS c ON c.id = m.catid');
+ $sql->join('LEFT', '#__users AS u ON u.id = m.userid');
+
+ // Only include posts that have been approved.
+ $sql->where('m.hold=0 AND m.moved=0');
+
+ return $sql;
+ }
+
+ /**
+ * Method to get the URL for the item. The URL is how we look up the link
+ * in the Finder index.
+ *
+ * @param mixed The id of the item.
+ * @return string The URL of the item.
+ */
+ protected function getURL($item, $extension, $view) {
+ return "index.php?option=com_kunena&view={$view}&catid={$item->catid}&id={$item->thread}&mesid={$item->id}";
+ }
+}
View
2  administrator/components/com_kunena/install/tmpl/default_reqfail.php
@@ -31,7 +31,7 @@
<td><?php echo JText::_('COM_KUNENA_INSTALL_REQ_JOOMLA') ?>:</td>
<td><font
color="<?php echo isset($this->requirements->fail['joomla'])?'red':'green'; ?>"><?php echo $this->requirements->joomla; ?></font></td>
- <td>(<?php echo JText::_('COM_KUNENA_INSTALL_REQUIRED') ?> &gt;= <?php echo version_compare(JVERSION, '1.7', '>') ? KUNENA_MIN_JOOMLA17 : (version_compare(JVERSION, '1.6', '>') ? KUNENA_MIN_JOOMLA16 : KUNENA_MIN_JOOMLA15); ?>)</td>
+ <td>(<?php echo JText::_('COM_KUNENA_INSTALL_REQUIRED') ?> &gt;= <?php echo KUNENA_MIN_JOOMLA; ?>)</td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_INSTALL_REQ_DOMDOCUMENT') ?>:</td>
View
8 administrator/components/com_kunena/install/uninstall.kunena.php
@@ -11,6 +11,8 @@
function com_uninstall() {
if (version_compare(JVERSION, '1.6','>')) return;
- include_once(dirname(__FILE__).'/install.script.php');
- Com_KunenaInstallerScript::uninstall ( null );
-}
+
+ require_once(JPATH_ADMINISTRATOR . '/components/com_kunena/install/model.php');
+ $installer = new KunenaModelInstall();
+ $installer->uninstall();
+}
View
2  administrator/components/com_kunena/install/upgrade/upgrade-1.6.1_delfiles.php
@@ -11,7 +11,7 @@
// Kunena 1.6.1: Delete view/artcile folder which is not needed anymore
function kunena_upgrade_161_delfiles($parent) {
- if (KunenaForum::isSVN()) return;
+ if (KunenaForum::isDev()) return;
//Import filesystem libraries.
jimport ( 'joomla.filesystem.folder' );
View
20 administrator/components/com_kunena/install/upgrade/upgrade-2.0.0_menu.php
@@ -0,0 +1,20 @@
+<?php
+/**
+ * Kunena Component
+ * @package Kunena.Installer
+ *
+ * @copyright (C) 2008 - 2011 Kunena Team. All rights reserved.
+ * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
+ * @link http://www.kunena.org
+ **/
+defined ( '_JEXEC' ) or die ();
+
+jimport('joomla.filter.output');
+
+// Kunena 2.0.0: Update menu items
+function kunena_upgrade_200_menu($parent) {
+ $legacy = KunenaMenuHelper::getLegacy();
+ $error = KunenaMenuHelper::fixLegacy();
+
+ return array ('action' => '', 'name' => JText::sprintf ( 'COM_KUNENA_INSTALL_200_MENU', count($legacy) ), 'success' => !$error );
+}
View
4 administrator/components/com_kunena/install/view.php
@@ -118,7 +118,7 @@ function displaySchema() {
echo '<textarea cols="80" rows="50">';
echo $this->escape ( $schema->getSchema ()->saveXML () );
echo '</textarea>';
- if (KunenaForum::isSvn()) {
+ if (KunenaForum::isDev()) {
echo '<textarea cols="80" rows="20">';
foreach ( $create as $item ) {
echo $this->escape($item ['sql']) . "\n\n";
@@ -135,7 +135,7 @@ function displaySchemaDiff() {
echo '<textarea cols="80" rows="20">';
echo $this->escape ( $diff->saveXML () );
echo '</textarea>';
- if (KunenaForum::isSvn()) {
+ if (KunenaForum::isDev()) {
echo '<textarea cols="80" rows="20">';
foreach ( $sql as $item ) {
echo $this->escape($item ['sql']) . "\n\n";
View
2  administrator/components/com_kunena/kunena.xml
@@ -2,7 +2,7 @@
<!DOCTYPE install>
<install type="component" version="1.5.0" method="upgrade">
<name>Kunena</name>
- <version>2.0.0-DEV6</version>
+ <version>2.0.0-DEV11</version>
<versionname>Internal</versionname>
<creationDate>@kunenaversiondate@</creationDate>
<author>Kunena Team</author>
View
57 administrator/components/com_kunena/language/en-GB/en-GB.com_kunena.ini
@@ -1261,36 +1261,35 @@ COM_KUNENA_A_PRUNE_SHADOW="Shadow Topics"
COM_KUNENA_A_PRUNE_ALL="All Topics"
COM_KUNENA_A_PRUNE_KEEP_STICKY="Keep Sticky Topics"
-COM_KUNENA_TEMPLATE_HEADER_BACKGROUND="Header color gradient top"
-COM_KUNENA_TEMPLATE_HEADER_GRADIENT_BACKGROUND="Header color gradient bottom"
-COM_KUNENA_TEMPLATE_FORUM_ROW_ODD_BACKGROUND="Backgound Gradient Color top row odd"
-COM_KUNENA_TEMPLATE_FORUM_ROW_ODD_BACKGROUND_DESC="Backgound Gradient Color top row odd"
-COM_KUNENA_TEMPLATE_FORUM_ROW_ODD_BACKGROUND2="Backgound Gradient Color bottom row odd"
-COM_KUNENA_TEMPLATE_FORUM_ROW_ODD_BACKGROUND2_DESC="Backgound Gradient Color bottom row odd"
-COM_KUNENA_TEMPLATE_FORUM_ROW_EVEN="Backgound Gradient Color top row even"
-COM_KUNENA_TEMPLATE_FORUM_ROW_EVEN_DESC="Backgound Gradient Color top row even"
-COM_KUNENA_TEMPLATE_FORUM_ROW_EVEN2="Backgound Gradient Color Bottom row even"
-COM_KUNENA_TEMPLATE_FORUM_ROW_EVEN2_DESC="Backgound Gradient Color Bottom row even"
-COM_KUNENA_TEMPLATE_FORUM_BODY_COLOR="Body Color text"
-COM_KUNENA_TEMPLATE_FORUM_BODY_COLOR_DESC="Body Color text. like category details"
-COM_KUNENA_TEMPLATE_FORUM_HOVER_CATEGORIES_ROW="Hover Category Odd Row Color"
-COM_KUNENA_TEMPLATE_FORUM_HOVER_CATEGORIES_ROW_DESC="Hover Category Odd Row Color"
-COM_KUNENA_TEMPLATE_FORUM_HOVER_CATEGORIES_ROW_EVEN="Hover Category Odd Even Color"
-COM_KUNENA_TEMPLATE_FORUM_HOVER_CATEGORIES_ROW_EVEN_DESC="Hover Category Odd Even Color"
-COM_KUNENA_TEMPLATE_TABS="Tabs"
-COM_KUNENA_TEMPLATE_FORUM_LINK_COLOR="Link Color"
-COM_KUNENA_TEMPLATE_FORUM_LINK_COLOR_DESC="Link Color"
-COM_KUNENA_TEMPLATE_LEGEND_COLORS="Legend"
-COM_KUNENA_TEMPLATE_LEGEND_ADMIN_COLOR="Admin color"
-COM_KUNENA_TEMPLATE_LEGEND_GLOBAL_COLOR="Global color"
-COM_KUNENA_TEMPLATE_LEGEND_GUEST_COLOR="Guest color"
-COM_KUNENA_TEMPLATE_LEGEND_MODERATOR_COLOR="Moderator color"
-COM_KUNENA_TEMPLATE_LEGEND_USER_COLOR="User color"
-COM_KUNENA_TEMPLATE_FORUM_MSG_COLOR="Message font color"
-COM_KUNENA_TEMPLATE_FORUM_MSG_COLOR_DESC="Message color"
-COM_KUNENA_TEMPLATE_CSS3_COLORS="Css3 Options"
+COM_KUNENA_A_CATEGORY_ALIAS="Alias:"
+COM_KUNENA_A_VIEW_TOOLS="Forum Tools"
+COM_KUNENA_A_RECOUNT="Recount Statistics"
+COM_KUNENA_A_RECOUNT_OPTIONS="Options"
+COM_KUNENA_A_RECOUNT_TOPICS="Recount Topic Statistics"
+COM_KUNENA_A_RECOUNT_USERTOPICS="Recount Topic Statistics For Users"
+COM_KUNENA_A_RECOUNT_USERS="Recount User Statistics"
+COM_KUNENA_A_RECOUNT_CATEGORIES="Recount Category Statistics"
+COM_KUNENA_A_RECOUNT_TOPICS_DESC="Update post count for every topic. Fix first and last post information."
+COM_KUNENA_A_RECOUNT_USERTOPICS_DESC="Update user post count for every topic. Fix last posted information."
+COM_KUNENA_A_RECOUNT_CATEGORIES_DESC="Update total topics and posts for every category. Fix last topic information."
+COM_KUNENA_A_RECOUNT_USERS_DESC="Update total post count for every user."
+COM_KUNENA_A_TRASH_MENU="Trash Menu"
+COM_KUNENA_A_MENU_MANAGER="Menu Manager"
+COM_KUNENA_A_MENU_MANAGER_ISSUES="Detected following issues from your menus:"
+COM_KUNENA_A_MENU_MANAGER_LEGACY="Legacy Menu Items"
+COM_KUNENA_A_MENU_MANAGER_CONFLICTS="Conflicting Menu Items"
+COM_KUNENA_A_MENU_MANAGER_INVALID="Invalid Menu Items"
COM_KUNENA_A_CATEGORY_ALIAS="Alias:"
COM_KUNENA_PICKUP_CATEGORY="Force users to pickup a category"
-COM_KUNENA_PICKUP_CATEGORY_DESC="Force users to pickup a category instead of set the actual category"
+COM_KUNENA_PICKUP_CATEGORY_DESC="Force users to pickup a category instead of set the actual category"
+
+COM_KUNENA_MENU_FIXED_LEGACY="Fixed %d deprecated menu items."
+COM_KUNENA_MENU_FIXED_LEGACY_FAILED="Failed to fix deprecated menu item: %s"
+
+COM_KUNENA_COM_A_FULL_ARTICLE="Full"
+COM_KUNENA_COM_A_INTRO_ARTICLE="Intro"
+COM_KUNENA_COM_A_ARTICLE_LINK="Link"
+COM_KUNENA_COM_A_ARTICLE_DISPLAY="Choose how to display article by default"
+COM_KUNENA_COM_A_ARTICLE_DISPLAY_DESC="Choose how to display Joomla! articles by default in messages"
View
7 administrator/components/com_kunena/language/en-GB/en-GB.com_kunena.install.ini
@@ -143,7 +143,7 @@ COM_KUNENA_SAMPLEDATA_CATEGORY2_TITLE="Suggestion Box"
COM_KUNENA_SAMPLEDATA_CATEGORY2_DESC="Have some feedback and input to share? \n Don't be shy and drop us a note. We want to hear from you and strive to make our site better and more user friendly for our guests and members a like."
COM_KUNENA_SAMPLEDATA_CATEGORY2_HEADER="This is the optional category header for the Suggestion Box."
COM_KUNENA_SAMPLEDATA_POST1_SUBJECT="Welcome to Kunena!"
-COM_KUNENA_SAMPLEDATA_POST1_TEXT="[size=4][b]Welcome to Kunena![/b][/size] \n\n Thank you for choosing Kunena for your community forum needs in Joomla. \n\n Kunena, translated from Swahili meaning &ldquo;to speak,&rdquo; is built by a team of open source professionals with the goal of providing a top quality, tightly unified forum solution for Joomla. Kunena even supports social networking components like Community Builder and JomSocial. \n\n\n [size=4][b]Additional Kunena Resources[/b][/size] \n\n [b]Kunena Documentation:[/b] [url]http://www.kunena.org/docs[/url] \n\n [b]Kunena Support Forum[/b]: [url]http://www.kunena.org/forum[/url] \n\n [b]Kunena Downloads:[/b] [url]http://www.kunena.org/downloads[/url] \n\n [b]Kunena Blog:[/b] [url]http://www.kunena.org/blog[/url] \n\n [b]Submit your feature ideas:[/b] [url]http://www.kunena.org/uservoice[/url] \n\n [b]Follow Kunena on Twitter:[/b] [url]http://www.kunena.org/twitter[/url]"
+COM_KUNENA_SAMPLEDATA_POST1_TEXT_CONTENT="[size=4][b]Welcome to Kunena![/b][/size] \n\n Thank you for choosing Kunena for your community forum needs in Joomla. \n\n Kunena, translated from Swahili meaning &ldquo;to speak,&rdquo; is built by a team of open source professionals with the goal of providing a top quality, tightly unified forum solution for Joomla. Kunena even supports social networking components like Community Builder and JomSocial. \n\n\n [size=4][b]Additional Kunena Resources[/b][/size] \n\n [b]Kunena Documentation:[/b] [url]http://www.kunena.org/docs[/url] \n\n [b]Kunena Support Forum[/b]: [url]http://www.kunena.org/forum[/url] \n\n [b]Kunena Downloads:[/b] [url]http://www.kunena.org/download[/url] \n\n [b]Kunena Blog:[/b] [url]http://www.kunena.org/blog[/url] \n\n [b]Submit your feature ideas:[/b] [url]http://www.kunena.org/uservoice[/url] \n\n [b]Follow Kunena on Twitter:[/b] [url]http://www.kunena.org/twitter[/url]"
COM_KUNENA_MENU_TITLE="Kunena Menu"
COM_KUNENA_MENU_TITLE_DESC="This is the default Kunena menu. It is used as the top navigation for Kunena. It can be publish in any module position. Simply unpublish items that are not required."
@@ -191,6 +191,7 @@ COM_KUNENA_MIGRATE_RECOUNT_USER="Recounting user statistics"
COM_KUNENA_MIGRATE_RECOUNT_CATEGORY="Recounting category statistics"
COM_KUNENA_MIGRATE_RECOUNT_DONE="Recounting forum statistics"
-COM_KUNENA_INSTALL_200_CONFIGURATION="Migrate configuration options to K2.0.0 schema"
+COM_KUNENA_INSTALL_200_CONFIGURATION="Migrating configuration options to K2.0.0 schema"
COM_KUNENA_INSTALL_200_TEMPLATES="Migrating templates"
-COM_KUNENA_INSTALL_200_ALIASES="Create category aliases"
+COM_KUNENA_INSTALL_200_ALIASES="Creating category aliases"
+COM_KUNENA_INSTALL_200_MENU="Upgrading %d menu items"
View
4 administrator/components/com_kunena/libraries/bbcode/bbcode.php
@@ -865,6 +865,7 @@ function DoArticle($bbcode, $action, $name, $default, $params, $content) {
$articleid = intval($content);
+ $config = KunenaFactory::getConfig();
$user = JFactory::getUser ();
$db = JFactory::getDBO ();
$site = JFactory::getApplication('site');
@@ -935,8 +936,7 @@ function DoArticle($bbcode, $action, $name, $default, $params, $content) {
$url = JRoute::_(ContentHelperRoute::getArticleRoute($article->id, $article->catid, $article->sectionid));
}
- // TODO: make configurable
- if (!$default) $default = 'intro';
+ if (!$default) $default = $config->article_display;
switch ($default) {
case 'full':
if ( !empty($article->fulltext) ) {
View
3  administrator/components/com_kunena/libraries/config.php
@@ -241,6 +241,7 @@ class KunenaConfig extends JObject {
public $hold_guest_posts = 0;
public $attachment_limit = 8;
public $pickup_category = 0;
+ public $article_display = 'intro';
public function __construct() {
parent::__construct ();
@@ -276,7 +277,7 @@ public function save() {
public function reset() {
$instance = new KunenaConfig ();
- $this->bind($instance);
+ $this->bind($instance->getProperties());
}
//
View
6 administrator/components/com_kunena/libraries/controller.php
@@ -123,13 +123,13 @@ public function display() {
$view = $this->getView ( $vName, $vFormat );
if ($view) {
if ($app->isSite() && $vFormat=='html') {
- $view->template = KunenaFactory::getTemplate();
$common = $this->getView ( 'common', $vFormat );
$common->setModel ( $this->getModel ( 'common' ), true );
+ $view->ktemplate = $common->ktemplate = KunenaFactory::getTemplate();
$view->common = $common;
- $defaultpath = KPATH_SITE."/{$view->template->getPath(true)}/html";
- $templatepath = KPATH_SITE."/{$view->template->getPath()}/html";
+ $defaultpath = KPATH_SITE."/{$view->ktemplate->getPath(true)}/html";
+ $templatepath = KPATH_SITE."/{$view->ktemplate->getPath()}/html";
if ($templatepath != $defaultpath) {
$view->addTemplatePath("{$defaultpath}/{$vName}" );
$view->common->addTemplatePath("{$defaultpath}/common");
View
6 administrator/components/com_kunena/libraries/date.php
@@ -117,7 +117,11 @@ public function toTimeAgo() {
}
public function toTimezone() {
- $timezone = $this->getOffset();
+ if (version_compare(JVERSION, '1.6', '>')) {
+ $timezone = $this->getOffsetFromGMT(true);
+ } else {
+ $timezone = $this->getOffset();
+ }
return sprintf('%+d:%02d', $timezone, ($timezone*60)%60);
}
View
2  administrator/components/com_kunena/libraries/forum/forum.php
@@ -29,7 +29,7 @@ class KunenaForum {
private function __construct() {}
- public static function isSvn() {
+ public static function isDev() {
if ('@kunenaversion@' == '@' . 'kunenaversion' . '@') {
return true;
}
View
9 administrator/components/com_kunena/libraries/forum/message/attachment/helper.php
@@ -96,6 +96,7 @@ static public function getByMessage($ids = false, $authorise='read') {
static public function getExtensions($category, $user = null) {
$imagetypes = self::getImageExtensions($category, $user);
$filetypes = self::getFileExtensions($category, $user);
+
if ($imagetypes === false && $filetypes === false) return false;
return array_merge((array)$imagetypes, (array)$filetypes);
}
@@ -112,11 +113,11 @@ static public function getImageExtensions($category, $user = null) {
// Check if attachments are allowed at all
if (!$config->image_upload) return false;
- if ($config->image_upload == 'all') return $types;
+ if ($config->image_upload == 'everybody') return $types;
// For now on we only allow registered users
if (!$user->exists()) return false;
- if ($config->image_upload == 'user') return $types;
+ if ($config->image_upload == 'registered') return $types;
// For now on we only allow moderators
if (!$user->isModerator($category->id)) return false;
@@ -141,11 +142,11 @@ static public function getFileExtensions($category, $user = null) {
// Check if attachments are allowed at all
if (!$config->file_upload) return false;
- if ($config->file_upload == 'all') return $types;
+ if ($config->file_upload == 'everybody') return $types;
// For now on we only allow registered users
if (!$user->exists()) return false;
- if ($config->file_upload == 'user') return $types;
+ if ($config->file_upload == 'registered') return $types;
// For now on we only allow moderators
if (!$user->isModerator($category->id)) return false;
View
1  administrator/components/com_kunena/libraries/forum/topic/helper.php
@@ -288,6 +288,7 @@ public function trash($ids) {
static function recount($ids=false, $start=0, $end=0) {
$db = JFactory::getDBO ();
+ if ($start < 1) $start = 1;
if (is_array($ids)) {
$threads = 'm.thread IN ('.implode(',', $ids).')';
} elseif ((int)$ids) {
View
10 administrator/components/com_kunena/libraries/html/pagination.php
@@ -46,7 +46,7 @@ function __construct($total, $limitstart, $limit, $prefix = '') {
parent::__construct($total, $limitstart, $limit, $prefix);
$this->setDisplay();
<