From e6f340f921de788b5414573179e940babae87725 Mon Sep 17 00:00:00 2001 From: Johan Janssens Date: Tue, 26 May 2015 00:38:32 +0200 Subject: [PATCH 1/2] #43 - Remove whosonline module --- administrator/components/com_admin/script.php | 1 - installation/sql/mysql/joomla.sql | 1 - installation/sql/mysql/sample_testing.sql | 2 - language/en-GB/en-GB.mod_whosonline.ini | 28 ----- language/en-GB/en-GB.mod_whosonline.sys.ini | 9 -- language/en-GB/install.xml | 2 - modules/mod_whosonline/helper.php | 106 ------------------ modules/mod_whosonline/index.html | 1 - modules/mod_whosonline/mod_whosonline.php | 30 ----- modules/mod_whosonline/mod_whosonline.xml | 79 ------------- modules/mod_whosonline/tmpl/default.php | 30 ----- modules/mod_whosonline/tmpl/index.html | 1 - tests/system/resetdb.sql | 1 - tests/unit/stubs/database/jos_content.csv | 2 - tests/unit/stubs/database/jos_extensions.csv | 1 - tests/unit/stubs/database/jos_modules.csv | 1 - .../language/data/language/en-GB/en-GB.xml | 2 - .../libraries/joomla/utilities/stubs/test.xml | 19 ---- 18 files changed, 316 deletions(-) delete mode 100644 language/en-GB/en-GB.mod_whosonline.ini delete mode 100644 language/en-GB/en-GB.mod_whosonline.sys.ini delete mode 100644 modules/mod_whosonline/helper.php delete mode 100644 modules/mod_whosonline/index.html delete mode 100644 modules/mod_whosonline/mod_whosonline.php delete mode 100644 modules/mod_whosonline/mod_whosonline.xml delete mode 100644 modules/mod_whosonline/tmpl/default.php delete mode 100644 modules/mod_whosonline/tmpl/index.html diff --git a/administrator/components/com_admin/script.php b/administrator/components/com_admin/script.php index 48e5b5834c..4c0714f871 100644 --- a/administrator/components/com_admin/script.php +++ b/administrator/components/com_admin/script.php @@ -125,7 +125,6 @@ protected function updateManifestCaches() $extensions[] = array('module', 'mod_search', '', 0); $extensions[] = array('module', 'mod_stats', '', 0); $extensions[] = array('module', 'mod_users_latest', '', 0); - $extensions[] = array('module', 'mod_whosonline', '', 0); $extensions[] = array('module', 'mod_articles_category', '', 0); $extensions[] = array('module', 'mod_articles_categories', '', 0); $extensions[] = array('module', 'mod_languages', '', 0); diff --git a/installation/sql/mysql/joomla.sql b/installation/sql/mysql/joomla.sql index 9e1becdd02..351b8b20a8 100644 --- a/installation/sql/mysql/joomla.sql +++ b/installation/sql/mysql/joomla.sql @@ -349,7 +349,6 @@ INSERT INTO `#__extensions` (`extension_id`, `name`, `type`, `element`, `folder` (213, 'mod_search', 'module', 'mod_search', '', 0, 1, 1, 0, '', '', '', '', 0, '0000-00-00 00:00:00', 0, 0), (214, 'mod_stats', 'module', 'mod_stats', '', 0, 1, 1, 0, '', '', '', '', 0, '0000-00-00 00:00:00', 0, 0), (216, 'mod_users_latest', 'module', 'mod_users_latest', '', 0, 1, 1, 0, '', '', '', '', 0, '0000-00-00 00:00:00', 0, 0), -(218, 'mod_whosonline', 'module', 'mod_whosonline', '', 0, 1, 1, 0, '', '', '', '', 0, '0000-00-00 00:00:00', 0, 0), (220, 'mod_articles_category', 'module', 'mod_articles_category', '', 0, 1, 1, 0, '', '', '', '', 0, '0000-00-00 00:00:00', 0, 0), (221, 'mod_articles_categories', 'module', 'mod_articles_categories', '', 0, 1, 1, 0, '', '', '', '', 0, '0000-00-00 00:00:00', 0, 0), (222, 'mod_languages', 'module', 'mod_languages', '', 0, 1, 1, 1, '', '', '', '', 0, '0000-00-00 00:00:00', 0, 0), diff --git a/installation/sql/mysql/sample_testing.sql b/installation/sql/mysql/sample_testing.sql index a87691b58c..c85fdaeb3e 100644 --- a/installation/sql/mysql/sample_testing.sql +++ b/installation/sql/mysql/sample_testing.sql @@ -213,7 +213,6 @@ INSERT IGNORE INTO `#__content` (`id`, `asset_id`, `title`, `alias`, `introtext` (52, 150, 'Users', 'users-component', '

The users extension lets your site visitors register, login and logout, change their passwords and other information, and recover lost passwords. In the administrator it allows you to create, block and manage users and create user groups and access levels. Help

\r\n

Please note that some of the user views will not display if you are not logged-in to the site.

', '', 1, 21, '2011-01-01 00:00:01', 42, 'Joomla', '0000-00-00 00:00:00', 0, 0, '0000-00-00 00:00:00', '2011-01-01 00:00:01', '0000-00-00 00:00:00', '', '', '{"show_title":"","link_titles":"","show_intro":"","show_category":"","link_category":"","show_parent_category":"","link_parent_category":"","show_author":"","link_author":"","show_create_date":"","show_modify_date":"","show_publish_date":"","show_item_navigation":"","show_icons":"","show_print_icon":"","show_email_icon":"","show_vote":"","show_hits":"","show_noauth":"","alternative_readmore":"","article_layout":""}', 1, 5, '', '', 1, 0, '{"robots":"","author":"","rights":"","xreference":""}', 0, '*', ''), (53, 151, 'Using Joomla!', 'using-joomla', '

With Joomla you can create anything from a simple personal website to a complex ecommerce or social site with millions of visitors.

\r\n

This section of the sample data provides you with a brief introduction to Joomla concepts and reference material to help you understand how Joomla works.

\r\n

When you no longer need the sample data, you can can simply unpublish the sample data category found within each extension in the site administrator or you may completely delete each item and all of the categories.

', '', 1, 19, '2011-01-01 00:00:01', 42, 'Joomla', '0000-00-00 00:00:00', 0, 0, '0000-00-00 00:00:00', '2011-01-01 00:00:01', '0000-00-00 00:00:00', '{"image_intro":"","float_intro":"","image_intro_alt":"","image_intro_caption":"","image_fulltext":"","float_fulltext":"","image_fulltext_alt":"","image_fulltext_caption":""}', '{"urla":"","urlatext":"","targeta":"","urlb":"","urlbtext":"","targetb":"","urlc":"","urlctext":"","targetc":""}', '{"show_title":"","link_titles":"","show_intro":"","show_category":"","link_category":"","show_parent_category":"","link_parent_category":"","show_author":"","link_author":"","show_create_date":"","show_modify_date":"","show_publish_date":"","show_item_navigation":"","show_icons":"","show_print_icon":"","show_email_icon":"","show_vote":"","show_hits":"","show_noauth":"","alternative_readmore":"","article_layout":"","show_publishing_options":"","show_article_options":"","show_urls_images_backend":"","show_urls_images_frontend":""}', 1, 7, '', '', 1, 0, '{"robots":"","author":"","rights":"","xreference":""}', 0, '*', ''), INSERT IGNORE INTO `#__content` (`id`, `asset_id`, `title`, `alias`, `introtext`, `fulltext`, `state`, `catid`, `created`, `created_by`, `created_by_alias`, `modified`, `modified_by`, `checked_out`, `checked_out_time`, `publish_up`, `publish_down`, `images`, `urls`, `attribs`, `version`, `ordering`, `metakey`, `metadesc`, `access`, `hits`, `metadata`, `featured`, `language`, `xreference`) VALUES -(56, 154, 'Who''s Online', 'whos-online', '

The Who''s Online Module displays the number of Anonymous Users (e.g. Guests) and Registered Users (ones logged-in) that are currently accessing the Web site. Help

\r\n
{loadmodule whosonline,Who''s Online}
', '', 1, 65, '2011-01-01 00:00:01', 42, 'Joomla', '0000-00-00 00:00:00', 0, 0, '0000-00-00 00:00:00', '2011-01-01 00:00:01', '0000-00-00 00:00:00', '', '', '{"show_title":"","link_titles":"","show_intro":"","show_category":"","link_category":"","show_parent_category":"","link_parent_category":"","show_author":"","show_create_date":"","show_modify_date":"","show_publish_date":"","show_readmore":"","show_print_icon":"","show_email_icon":"","show_hits":"","page_title":"","alternative_readmore":"","layout":""}', 1, 1, '', '', 1, 0, '', 0, '*', ''), (57, 155, 'Wobbegone', 'wobbegone', '

\r\n', '\r\n

', 1, 72, '2011-01-01 00:00:01', 42, 'Joomla', '0000-00-00 00:00:00', 0, 0, '0000-00-00 00:00:00', '2011-01-01 00:00:01', '0000-00-00 00:00:00', '{"image_intro":"images\\/sampledata\\/parks\\/animals\\/180px_wobbegong.jpg","float_intro":"","image_intro_alt":"Wobbegon","image_intro_caption":"","image_fulltext":"images\\/sampledata\\/parks\\/animals\\/800px_wobbegong.jpg","float_fulltext":"","image_fulltext_alt":"Wobbegon","image_fulltext_caption":"Source: http:\\/\\/en.wikipedia.org\\/wiki\\/File:Wobbegong.jpg Author: Richard Ling Rights: GNU Free Documentation License v 1.2 or later"}', '{"urla":"","urlatext":"","targeta":"","urlb":"","urlbtext":"","targetb":"","urlc":"","urlctext":"","targetc":""}', '{"show_title":"","link_titles":"","show_intro":"","show_category":"","link_category":"","show_parent_category":"","link_parent_category":"","show_author":"","link_author":"","show_create_date":"","show_modify_date":"","show_publish_date":"","show_item_navigation":"","show_icons":"","show_print_icon":"","show_email_icon":"","show_vote":"","show_hits":"","show_noauth":"","alternative_readmore":"","article_layout":"","show_publishing_options":"","show_article_options":"","show_urls_images_backend":"","show_urls_images_frontend":""}', 1, 1, '', '', 1, 0, '{"robots":"","author":"","rights":"","xreference":""}', 0, '*', ''), (58, 156, 'Wonderful Watermelon', 'wonderful-watermelon', '

Watermelon is a wonderful and healthy treat. We grow the world''s sweetest watermelon. We have the largest watermelon patch in our country.

', '', 1, 30, '2011-01-01 00:00:01', 42, 'Joomla', '0000-00-00 00:00:00', 0, 0, '0000-00-00 00:00:00', '2011-01-01 00:00:01', '0000-00-00 00:00:00', '', '', '{"show_title":"","link_titles":"","show_intro":"","show_category":"","link_category":"","show_parent_category":"","link_parent_category":"","show_author":"","show_create_date":"","show_modify_date":"","show_publish_date":"","show_readmore":"","show_print_icon":"","show_email_icon":"","show_hits":"","page_title":"","alternative_readmore":"","layout":""}', 1, 1, '', '', 1, 0, '', 0, '*', ''), (59, 157, 'Wrapper Module', 'wrapper-module', '

This module shows an iFrame window to specified location. Help

\r\n
{loadmodule wrapper,Wrapper}
', '', 1, 67, '2011-01-01 00:00:01', 42, 'Joomla', '0000-00-00 00:00:00', 0, 0, '0000-00-00 00:00:00', '2011-01-01 00:00:01', '0000-00-00 00:00:00', '', '', '{"show_title":"","link_titles":"","show_intro":"","show_category":"","link_category":"","show_parent_category":"","link_parent_category":"","show_author":"","show_create_date":"","show_modify_date":"","show_publish_date":"","show_readmore":"","show_print_icon":"","show_email_icon":"","show_hits":"","page_title":"","alternative_readmore":"","layout":""}', 1, 1, '', '', 1, 0, '', 0, '*', ''), @@ -392,7 +391,6 @@ INSERT IGNORE INTO `#__modules` (`id`, `title`, `note`, `content`, `ordering`, ` (35, 'Search', '', '', 1, '', 0, '0000-00-00 00:00:00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 'mod_search', 1, 1, '{"label":"","width":"20","text":"","button":"","button_pos":"right","imagebutton":"","button_text":"","opensearch":"1","opensearch_title":"","set_itemid":"","layout":"_:default","moduleclass_sfx":"","cache":"1","cache_time":"900","cachemode":"itemid"}', 0, '*'), (36, 'Statistics', '', '', 1, '', 0, '0000-00-00 00:00:00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 'mod_stats', 1, 1, '{"serverinfo":"1","siteinfo":"1","counter":"1","increase":"0","layout":"_:default","moduleclass_sfx":"","cache":"1","cache_time":"900","cachemode":"static"}', 0, '*'), (38, 'Users Latest', '', '', 1, '', 0, '0000-00-00 00:00:00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 'mod_users_latest', 1, 1, '{"shownumber":"5","linknames":"0","layout":"_:default","moduleclass_sfx":"","cache":"0","cache_time":"900","cachemode":"static"}', 0, '*'), -(39, 'Who''s Online', '', '', 1, '', 0, '0000-00-00 00:00:00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 'mod_whosonline', 1, 1, '{"showmode":"2","linknames":"0","layout":"_:default","moduleclass_sfx":"","cache":"0"}', 0, '*'), (41, 'Footer', '', '', 1, '', 0, '0000-00-00 00:00:00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 'mod_footer', 1, 1, '{"layout":"_:default","moduleclass_sfx":"","cache":"1","cache_time":"900","cachemode":"static"}', 0, '*'), (44, 'Login', '', '', 1, '', 0, '0000-00-00 00:00:00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 'mod_login', 1, 1, '{"pretext":"","posttext":"","login":"280","logout":"280","greeting":"1","name":"0","usesecure":"0","layout":"_:default","moduleclass_sfx":"","cache":"0"}', 0, '*'), (45, 'Menu Example', '', '', 1, '', 0, '0000-00-00 00:00:00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 'mod_menu', 1, 1, '{"menutype":"mainmenu","startLevel":"1","endLevel":"0","showAllChildren":"0","tag_id":"","class_sfx":"","window_open":"","layout":"_:default","moduleclass_sfx":"","cache":"0","cache_time":"900","cachemode":"itemid"}', 0, '*'), diff --git a/language/en-GB/en-GB.mod_whosonline.ini b/language/en-GB/en-GB.mod_whosonline.ini deleted file mode 100644 index f1861803ae..0000000000 --- a/language/en-GB/en-GB.mod_whosonline.ini +++ /dev/null @@ -1,28 +0,0 @@ -; Joomla! Project -; Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved. -; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php -; Note : All ini files need to be saved as UTF-8 - No BOM -MOD_WHOSONLINE="Who's Online" -MOD_WHOSONLINE_FIELD_FILTER_GROUPS_DESC="Choose to filter by groups of the connected user" -MOD_WHOSONLINE_FIELD_FILTER_GROUPS_LABEL="Filter groups" -MOD_WHOSONLINE_FIELD_LINKTOWHAT_DESC="Choose the type of information to display" -MOD_WHOSONLINE_FIELD_LINKTOWHAT_LABEL="Information" -MOD_WHOSONLINE_FIELD_VALUE_BOTH="Both" -MOD_WHOSONLINE_FIELD_VALUE_CONTACT="Contact" -MOD_WHOSONLINE_FIELD_VALUE_NAMES="Usernames" -MOD_WHOSONLINE_FIELD_VALUE_NUMBER="# of Guests / Users" -MOD_WHOSONLINE_FIELD_VALUE_PROFILE="Profile" -MOD_WHOSONLINE_GUESTS="%s guests" -MOD_WHOSONLINE_GUESTS_1="one guest" -MOD_WHOSONLINE_GUESTS_0="no guests" -MOD_WHOSONLINE_MEMBERS="%s members" -MOD_WHOSONLINE_MEMBERS_1="one member" -MOD_WHOSONLINE_MEMBERS_0="no members" -MOD_WHOSONLINE_SAME_GROUP_MESSAGE="List of Users who belong to your user groups or your user groups' child groups" -MOD_WHOSONLINE_SHOWMODE_DESC="Select what shall be shown" -MOD_WHOSONLINE_SHOWMODE_LABEL="Display" -MOD_WHOSONLINE_XML_DESCRIPTION="The Who's Online Module displays the number of Anonymous Users (e.g. Guests) and Registered Users (ones logged-in) that are currently accessing the Web site." -; frontend display -; in the following string -; %1$s is for guests and %2$s for members -MOD_WHOSONLINE_WE_HAVE="We have %1$s and %2$s online" diff --git a/language/en-GB/en-GB.mod_whosonline.sys.ini b/language/en-GB/en-GB.mod_whosonline.sys.ini deleted file mode 100644 index f8fd9ebd8c..0000000000 --- a/language/en-GB/en-GB.mod_whosonline.sys.ini +++ /dev/null @@ -1,9 +0,0 @@ -; Joomla! Project -; Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved. -; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php -; Note : All ini files need to be saved as UTF-8 - No BOM - -MOD_WHOSONLINE="Who's Online" -MOD_WHOSONLINE_XML_DESCRIPTION="The Who's Online Module displays the number of Anonymous Users (e.g. Guests) and Registered Users (ones logged-in) that are currently accessing the Web site." -MOD_WHOSONLINE_LAYOUT_DEFAULT="Default" - diff --git a/language/en-GB/install.xml b/language/en-GB/install.xml index ff8432905b..c842e92da8 100644 --- a/language/en-GB/install.xml +++ b/language/en-GB/install.xml @@ -71,8 +71,6 @@ en-GB.mod_tags_similar.sys.ini en-GB.mod_users_latest.ini en-GB.mod_users_latest.sys.ini - en-GB.mod_whosonline.ini - en-GB.mod_whosonline.sys.ini en-GB.tpl_protostar.ini en-GB.tpl_protostar.sys.ini index.html diff --git a/modules/mod_whosonline/helper.php b/modules/mod_whosonline/helper.php deleted file mode 100644 index 91c793c100..0000000000 --- a/modules/mod_whosonline/helper.php +++ /dev/null @@ -1,106 +0,0 @@ -getQuery(true) - ->select('guest, client_id') - ->from('#__session') - ->where('client_id = 0'); - $db->setQuery($query); - $sessions = (array) $db->loadObjectList(); - - if (count($sessions)) - { - foreach ($sessions as $session) - { - // If guest increase guest count by 1 - if ($session->guest == 1) - { - $guest_array ++; - } - - // If member increase member count by 1 - if ($session->guest == 0) - { - $user_array ++; - } - } - } - - $result['user'] = $user_array; - $result['guest'] = $guest_array; - - return $result; - } - - /** - * Show online member names - * - * @param mixed $params The parameters - * - * @return array (array) $db->loadObjectList() The names of the online users. - * - * @since 1.5.0 - **/ - public static function getOnlineUserNames($params) - { - $db = JFactory::getDbo(); - $query = $db->getQuery(true) - ->select($db->quoteName(array('a.username', 'a.time', 'a.userid', 'a.client_id'))) - ->from('#__session AS a') - ->where($db->quoteName('a.userid') . ' != 0') - ->where($db->quoteName('a.client_id') . ' = 0') - ->group($db->quoteName(array('a.username', 'a.time', 'a.userid', 'a.client_id'))); - $user = JFactory::getUser(); - - if (!$user->authorise('core.admin') && $params->get('filter_groups', 0) == 1) - { - $groups = $user->getAuthorisedGroups(); - - if (empty($groups)) - { - return array(); - } - - $query->join('LEFT', '#__user_usergroup_map AS m ON m.user_id = a.userid') - ->join('LEFT', '#__usergroups AS ug ON ug.id = m.group_id') - ->where('ug.id in (' . implode(',', $groups) . ')') - ->where('ug.id <> 1'); - } - - $db->setQuery($query); - - return (array) $db->loadObjectList(); - } -} diff --git a/modules/mod_whosonline/index.html b/modules/mod_whosonline/index.html deleted file mode 100644 index 2efb97f319..0000000000 --- a/modules/mod_whosonline/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/modules/mod_whosonline/mod_whosonline.php b/modules/mod_whosonline/mod_whosonline.php deleted file mode 100644 index 819b9382e3..0000000000 --- a/modules/mod_whosonline/mod_whosonline.php +++ /dev/null @@ -1,30 +0,0 @@ -get('showmode', 0); - -if ($showmode == 0 || $showmode == 2) -{ - $count = ModWhosonlineHelper::getOnlineCount(); -} - -if ($showmode > 0) -{ - $names = ModWhosonlineHelper::getOnlineUserNames($params); -} - -$linknames = $params->get('linknames', 0); -$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx')); - -require JModuleHelper::getLayoutPath('mod_whosonline', $params->get('layout', 'default')); diff --git a/modules/mod_whosonline/mod_whosonline.xml b/modules/mod_whosonline/mod_whosonline.xml deleted file mode 100644 index c15bc09ac6..0000000000 --- a/modules/mod_whosonline/mod_whosonline.xml +++ /dev/null @@ -1,79 +0,0 @@ - - - mod_whosonline - Joomla! Project - July 2004 - Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved. - GNU General Public License version 2 or later; see LICENSE.txt - admin@joomla.org - www.joomla.org - 3.0.0 - MOD_WHOSONLINE_XML_DESCRIPTION - - mod_whosonline.php - tmpl - helper.php - index.html - mod_whosonline.xml - - - en-GB.mod_whosonline.ini - en-GB.mod_whosonline.sys.ini - - - - -
- - - - - -
-
- - - - - - - - - -
-
-
-
diff --git a/modules/mod_whosonline/tmpl/default.php b/modules/mod_whosonline/tmpl/default.php deleted file mode 100644 index fd7fe03f20..0000000000 --- a/modules/mod_whosonline/tmpl/default.php +++ /dev/null @@ -1,30 +0,0 @@ - - - - - -

- - - 0) && count($names)) : ?> - - diff --git a/tests/system/resetdb.sql b/tests/system/resetdb.sql index 26da9fa79c..4e7deca017 100644 --- a/tests/system/resetdb.sql +++ b/tests/system/resetdb.sql @@ -754,7 +754,6 @@ INSERT INTO `jos_modules` (`id`, `title`, `content`, `ordering`, `position`, `ch (18, 'Login Form', '', 8, 'left', 0, '0000-00-00 00:00:00', 1, 'mod_login', 0, 0, 1, 'greeting=1\nname=0', 1, 0, ''), (19, 'Latest News', '', 4, 'user1', 0, '0000-00-00 00:00:00', 1, 'mod_latestnews', 0, 0, 1, 'cache=1', 1, 0, ''), (20, 'Statistics', '', 6, 'left', 0, '0000-00-00 00:00:00', 0, 'mod_stats', 0, 0, 1, 'serverinfo=1\nsiteinfo=1\ncounter=1\nincrease=0\nmoduleclass_sfx=', 0, 0, ''), -(21, 'Who''s Online', '', 1, 'right', 0, '0000-00-00 00:00:00', 1, 'mod_whosonline', 0, 0, 1, 'online=1\nusers=1\nmoduleclass_sfx=', 0, 0, ''), (22, 'Popular', '', 6, 'user2', 0, '0000-00-00 00:00:00', 1, 'mod_mostread', 0, 0, 1, 'cache=1', 0, 0, ''), (23, 'Archive', '', 9, 'left', 0, '0000-00-00 00:00:00', 0, 'mod_archive', 0, 0, 1, 'cache=1', 1, 0, ''), (24, 'Sections', '', 10, 'left', 0, '0000-00-00 00:00:00', 0, 'mod_sections', 0, 0, 1, 'cache=1', 1, 0, ''), diff --git a/tests/unit/stubs/database/jos_content.csv b/tests/unit/stubs/database/jos_content.csv index b2e65bc194..0609c8f3fb 100644 --- a/tests/unit/stubs/database/jos_content.csv +++ b/tests/unit/stubs/database/jos_content.csv @@ -255,8 +255,6 @@ '54','152','Weblinks','weblinks','

Weblinks (com_weblinks) is a component that provides a structured way to organize external links and present them in a visually attractive, consistent and informative way. Help

',,'1','21','2011-01-01 00:00:01','100','Joomla','0000-00-00 00:00:00','0','0','0000-00-00 00:00:00','2011-01-01 00:00:01','0000-00-00 00:00:00',,,'{"show_title":"","link_titles":"","show_intro":"","show_category":"","link_category":"","show_parent_category":"","link_parent_category":"","show_author":"","link_author":"","show_create_date":"","show_modify_date":"","show_publish_date":"","show_item_navigation":"","show_icons":"","show_print_icon":"","show_email_icon":"","show_vote":"","show_hits":"","show_noauth":"","alternative_readmore":"","article_layout":""}','1','6',,,'1','1','{"robots":"","author":"","rights":"","xreference":""}','0','*', '55','153','Weblinks Module','weblinks-module','

This module displays the list of weblinks in a category. Help

{loadmodule weblinks,Weblinks}
',,'1','66','2011-01-01 00:00:01','100','Joomla','0000-00-00 00:00:00','0','0','0000-00-00 00:00:00','2011-01-01 00:00:01','0000-00-00 00:00:00',,,'{"show_title":"","link_titles":"","show_intro":"","show_category":"","link_category":"","show_parent_category":"","link_parent_category":"","show_author":"","show_create_date":"","show_modify_date":"","show_publish_date":"","show_readmore":"","show_print_icon":"","show_email_icon":"","show_hits":"","page_title":"","alternative_readmore":"","layout":""}','1','5',,,'1','0',,'0','*', -'56','154','Who\'s Online','whos-online','

The Who\'s Online Module displays the number of Anonymous Users (e.g. Guests) and Registered Users (ones logged-in) that are currently accessing the Web site. Help

-
{loadmodule whosonline,Who\'s Online}
',,'1','65','2011-01-01 00:00:01','100','Joomla','0000-00-00 00:00:00','0','0','0000-00-00 00:00:00','2011-01-01 00:00:01','0000-00-00 00:00:00',,,'{"show_title":"","link_titles":"","show_intro":"","show_category":"","link_category":"","show_parent_category":"","link_parent_category":"","show_author":"","show_create_date":"","show_modify_date":"","show_publish_date":"","show_readmore":"","show_print_icon":"","show_email_icon":"","show_hits":"","page_title":"","alternative_readmore":"","layout":""}','1','1',,,'1','0',,'0','*', '57','155','Wobbegone','wobbegone','

','

','1','72','2011-01-01 00:00:01','100','Joomla','0000-00-00 00:00:00','0','0','0000-00-00 00:00:00','2011-01-01 00:00:01','0000-00-00 00:00:00','{"image_intro":"images\\/sampledata\\/parks\\/animals\\/180px_wobbegong.jpg","float_intro":"","image_intro_alt":"Wobbegon","image_intro_caption":"","image_fulltext":"images\\/sampledata\\/parks\\/animals\\/800px_wobbegong.jpg","float_fulltext":"","image_fulltext_alt":"Wobbegon","image_fulltext_caption":"Source: http:\\/\\/en.wikipedia.org\\/wiki\\/File:Wobbegong.jpg Author: Richard Ling Rights: GNU Free Documentation License v 1.2 or later"}','{"urla":"","urlatext":"","targeta":"","urlb":"","urlbtext":"","targetb":"","urlc":"","urlctext":"","targetc":""}','{"show_title":"","link_titles":"","show_intro":"","show_category":"","link_category":"","show_parent_category":"","link_parent_category":"","show_author":"","link_author":"","show_create_date":"","show_modify_date":"","show_publish_date":"","show_item_navigation":"","show_icons":"","show_print_icon":"","show_email_icon":"","show_vote":"","show_hits":"","show_noauth":"","alternative_readmore":"","article_layout":"","show_publishing_options":"","show_article_options":"","show_urls_images_backend":"","show_urls_images_frontend":""}','1','1',,,'1','0','{"robots":"","author":"","rights":"","xreference":""}','0','*', diff --git a/tests/unit/stubs/database/jos_extensions.csv b/tests/unit/stubs/database/jos_extensions.csv index b30db0e85c..cca25b7527 100644 --- a/tests/unit/stubs/database/jos_extensions.csv +++ b/tests/unit/stubs/database/jos_extensions.csv @@ -37,7 +37,6 @@ '214','mod_stats','module','mod_stats',,'0','1','1','0','{"name":"mod_stats","type":"module","creationDate":"July 2004","author":"Joomla! Project","copyright":"Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved.","authorEmail":"admin@joomla.org","authorUrl":"www.joomla.org","version":"3.0.0","description":"MOD_STATS_XML_DESCRIPTION","group":""}',,,,'0','0000-00-00 00:00:00','0','0' '216','mod_users_latest','module','mod_users_latest',,'0','1','1','0','{"name":"mod_users_latest","type":"module","creationDate":"December 2009","author":"Joomla! Project","copyright":"Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved.","authorEmail":"admin@joomla.org","authorUrl":"www.joomla.org","version":"3.0.0","description":"MOD_USERS_LATEST_XML_DESCRIPTION","group":""}',,,,'0','0000-00-00 00:00:00','0','0' '217','mod_weblinks','module','mod_weblinks',,'0','1','1','0','{"name":"mod_weblinks","type":"module","creationDate":"July 2009","author":"Joomla! Project","copyright":"Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved.","authorEmail":"admin@joomla.org","authorUrl":"www.joomla.org","version":"3.0.0","description":"MOD_WEBLINKS_XML_DESCRIPTION","group":""}',,,,'0','0000-00-00 00:00:00','0','0' -'218','mod_whosonline','module','mod_whosonline',,'0','1','1','0','{"name":"mod_whosonline","type":"module","creationDate":"July 2004","author":"Joomla! Project","copyright":"Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved.","authorEmail":"admin@joomla.org","authorUrl":"www.joomla.org","version":"3.0.0","description":"MOD_WHOSONLINE_XML_DESCRIPTION","group":""}',,,,'0','0000-00-00 00:00:00','0','0' '220','mod_articles_category','module','mod_articles_category',,'0','1','1','0','{"name":"mod_articles_category","type":"module","creationDate":"February 2010","author":"Joomla! Project","copyright":"Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved.","authorEmail":"admin@joomla.org","authorUrl":"www.joomla.org","version":"3.0.0","description":"MOD_ARTICLES_CATEGORY_XML_DESCRIPTION","group":""}',,,,'0','0000-00-00 00:00:00','0','0' '221','mod_articles_categories','module','mod_articles_categories',,'0','1','1','0','{"name":"mod_articles_categories","type":"module","creationDate":"February 2010","author":"Joomla! Project","copyright":"Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved.","authorEmail":"admin@joomla.org","authorUrl":"www.joomla.org","version":"3.0.0","description":"MOD_ARTICLES_CATEGORIES_XML_DESCRIPTION","group":""}',,,,'0','0000-00-00 00:00:00','0','0' '222','mod_languages','module','mod_languages',,'0','1','1','1','{"name":"mod_languages","type":"module","creationDate":"February 2010","author":"Joomla! Project","copyright":"Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved.","authorEmail":"admin@joomla.org","authorUrl":"www.joomla.org","version":"3.0.0","description":"MOD_LANGUAGES_XML_DESCRIPTION","group":""}',,,,'0','0000-00-00 00:00:00','0','0' diff --git a/tests/unit/stubs/database/jos_modules.csv b/tests/unit/stubs/database/jos_modules.csv index 349c91f9ce..360466efee 100644 --- a/tests/unit/stubs/database/jos_modules.csv +++ b/tests/unit/stubs/database/jos_modules.csv @@ -28,7 +28,6 @@ '35','Search',,,'1',,'0','0000-00-00 00:00:00','0000-00-00 00:00:00','0000-00-00 00:00:00','1','mod_search','1','1','{"label":"","width":"20","text":"","button":"","button_pos":"right","imagebutton":"","button_text":"","opensearch":"1","opensearch_title":"","set_itemid":"","layout":"_:default","moduleclass_sfx":"","cache":"1","cache_time":"900","cachemode":"itemid"}','0','*' '36','Statistics',,,'1',,'0','0000-00-00 00:00:00','0000-00-00 00:00:00','0000-00-00 00:00:00','1','mod_stats','1','1','{"serverinfo":"1","siteinfo":"1","counter":"1","increase":"0","layout":"_:default","moduleclass_sfx":"","cache":"1","cache_time":"900","cachemode":"static"}','0','*' '38','Users Latest',,,'1',,'0','0000-00-00 00:00:00','0000-00-00 00:00:00','0000-00-00 00:00:00','1','mod_users_latest','1','1','{"shownumber":"5","linknames":"0","layout":"_:default","moduleclass_sfx":"","cache":"0","cache_time":"900","cachemode":"static"}','0','*' -'39','Who\'s Online',,,'1',,'0','0000-00-00 00:00:00','0000-00-00 00:00:00','0000-00-00 00:00:00','1','mod_whosonline','1','1','{"showmode":"2","linknames":"0","layout":"_:default","moduleclass_sfx":"","cache":"0"}','0','*' '41','Footer',,,'1',,'0','0000-00-00 00:00:00','0000-00-00 00:00:00','0000-00-00 00:00:00','1','mod_footer','1','1','{"layout":"_:default","moduleclass_sfx":"","cache":"1","cache_time":"900","cachemode":"static"}','0','*' '44','Login',,,'1',,'0','0000-00-00 00:00:00','0000-00-00 00:00:00','0000-00-00 00:00:00','1','mod_login','1','1','{"pretext":"","posttext":"","login":"280","logout":"280","greeting":"1","name":"0","usesecure":"0","layout":"_:default","moduleclass_sfx":"","cache":"0"}','0','*' '45','Menu Example',,,'1',,'0','0000-00-00 00:00:00','0000-00-00 00:00:00','0000-00-00 00:00:00','1','mod_menu','1','1','{"menutype":"mainmenu","startLevel":"1","endLevel":"0","showAllChildren":"0","tag_id":"","class_sfx":"","window_open":"","layout":"_:default","moduleclass_sfx":"","cache":"0","cache_time":"900","cachemode":"itemid"}','0','*' diff --git a/tests/unit/suites/libraries/joomla/language/data/language/en-GB/en-GB.xml b/tests/unit/suites/libraries/joomla/language/data/language/en-GB/en-GB.xml index e922f73b8e..39d7292b24 100644 --- a/tests/unit/suites/libraries/joomla/language/data/language/en-GB/en-GB.xml +++ b/tests/unit/suites/libraries/joomla/language/data/language/en-GB/en-GB.xml @@ -64,8 +64,6 @@ en-GB.mod_users_latest.sys.ini en-GB.mod_weblinks.ini en-GB.mod_weblinks.sys.ini - en-GB.mod_whosonline.ini - en-GB.mod_whosonline.sys.ini en-GB.pkg_joomla.sys.ini en-GB.tpl_atomic.ini en-GB.tpl_atomic.sys.ini diff --git a/tests/unit/suites/libraries/joomla/utilities/stubs/test.xml b/tests/unit/suites/libraries/joomla/utilities/stubs/test.xml index b6b56c5659..0de7e1c308 100644 --- a/tests/unit/suites/libraries/joomla/utilities/stubs/test.xml +++ b/tests/unit/suites/libraries/joomla/utilities/stubs/test.xml @@ -1033,25 +1033,6 @@ 0 0 - - 47 - Who's Online - module - mod_whosonline - - 0 - 1 - 1 - 0 - - - - - 0 - 0000-00-00 00:00:00 - 0 - 0 - 49 Custom HTML From 65c28b8f82571b5412c693009b4c85203dbdd2a8 Mon Sep 17 00:00:00 2001 From: Johan Janssens Date: Tue, 26 May 2015 00:39:59 +0200 Subject: [PATCH 2/2] #44 - Remove whosonline module This reverts commit e6f340f921de788b5414573179e940babae87725. --- administrator/components/com_admin/script.php | 1 + installation/sql/mysql/joomla.sql | 1 + installation/sql/mysql/sample_testing.sql | 2 + language/en-GB/en-GB.mod_whosonline.ini | 28 +++++ language/en-GB/en-GB.mod_whosonline.sys.ini | 9 ++ language/en-GB/install.xml | 2 + modules/mod_whosonline/helper.php | 106 ++++++++++++++++++ modules/mod_whosonline/index.html | 1 + modules/mod_whosonline/mod_whosonline.php | 30 +++++ modules/mod_whosonline/mod_whosonline.xml | 79 +++++++++++++ modules/mod_whosonline/tmpl/default.php | 30 +++++ modules/mod_whosonline/tmpl/index.html | 1 + tests/system/resetdb.sql | 1 + tests/unit/stubs/database/jos_content.csv | 2 + tests/unit/stubs/database/jos_extensions.csv | 1 + tests/unit/stubs/database/jos_modules.csv | 1 + .../language/data/language/en-GB/en-GB.xml | 2 + .../libraries/joomla/utilities/stubs/test.xml | 19 ++++ 18 files changed, 316 insertions(+) create mode 100644 language/en-GB/en-GB.mod_whosonline.ini create mode 100644 language/en-GB/en-GB.mod_whosonline.sys.ini create mode 100644 modules/mod_whosonline/helper.php create mode 100644 modules/mod_whosonline/index.html create mode 100644 modules/mod_whosonline/mod_whosonline.php create mode 100644 modules/mod_whosonline/mod_whosonline.xml create mode 100644 modules/mod_whosonline/tmpl/default.php create mode 100644 modules/mod_whosonline/tmpl/index.html diff --git a/administrator/components/com_admin/script.php b/administrator/components/com_admin/script.php index 4c0714f871..48e5b5834c 100644 --- a/administrator/components/com_admin/script.php +++ b/administrator/components/com_admin/script.php @@ -125,6 +125,7 @@ protected function updateManifestCaches() $extensions[] = array('module', 'mod_search', '', 0); $extensions[] = array('module', 'mod_stats', '', 0); $extensions[] = array('module', 'mod_users_latest', '', 0); + $extensions[] = array('module', 'mod_whosonline', '', 0); $extensions[] = array('module', 'mod_articles_category', '', 0); $extensions[] = array('module', 'mod_articles_categories', '', 0); $extensions[] = array('module', 'mod_languages', '', 0); diff --git a/installation/sql/mysql/joomla.sql b/installation/sql/mysql/joomla.sql index 351b8b20a8..9e1becdd02 100644 --- a/installation/sql/mysql/joomla.sql +++ b/installation/sql/mysql/joomla.sql @@ -349,6 +349,7 @@ INSERT INTO `#__extensions` (`extension_id`, `name`, `type`, `element`, `folder` (213, 'mod_search', 'module', 'mod_search', '', 0, 1, 1, 0, '', '', '', '', 0, '0000-00-00 00:00:00', 0, 0), (214, 'mod_stats', 'module', 'mod_stats', '', 0, 1, 1, 0, '', '', '', '', 0, '0000-00-00 00:00:00', 0, 0), (216, 'mod_users_latest', 'module', 'mod_users_latest', '', 0, 1, 1, 0, '', '', '', '', 0, '0000-00-00 00:00:00', 0, 0), +(218, 'mod_whosonline', 'module', 'mod_whosonline', '', 0, 1, 1, 0, '', '', '', '', 0, '0000-00-00 00:00:00', 0, 0), (220, 'mod_articles_category', 'module', 'mod_articles_category', '', 0, 1, 1, 0, '', '', '', '', 0, '0000-00-00 00:00:00', 0, 0), (221, 'mod_articles_categories', 'module', 'mod_articles_categories', '', 0, 1, 1, 0, '', '', '', '', 0, '0000-00-00 00:00:00', 0, 0), (222, 'mod_languages', 'module', 'mod_languages', '', 0, 1, 1, 1, '', '', '', '', 0, '0000-00-00 00:00:00', 0, 0), diff --git a/installation/sql/mysql/sample_testing.sql b/installation/sql/mysql/sample_testing.sql index c85fdaeb3e..a87691b58c 100644 --- a/installation/sql/mysql/sample_testing.sql +++ b/installation/sql/mysql/sample_testing.sql @@ -213,6 +213,7 @@ INSERT IGNORE INTO `#__content` (`id`, `asset_id`, `title`, `alias`, `introtext` (52, 150, 'Users', 'users-component', '

The users extension lets your site visitors register, login and logout, change their passwords and other information, and recover lost passwords. In the administrator it allows you to create, block and manage users and create user groups and access levels. Help

\r\n

Please note that some of the user views will not display if you are not logged-in to the site.

', '', 1, 21, '2011-01-01 00:00:01', 42, 'Joomla', '0000-00-00 00:00:00', 0, 0, '0000-00-00 00:00:00', '2011-01-01 00:00:01', '0000-00-00 00:00:00', '', '', '{"show_title":"","link_titles":"","show_intro":"","show_category":"","link_category":"","show_parent_category":"","link_parent_category":"","show_author":"","link_author":"","show_create_date":"","show_modify_date":"","show_publish_date":"","show_item_navigation":"","show_icons":"","show_print_icon":"","show_email_icon":"","show_vote":"","show_hits":"","show_noauth":"","alternative_readmore":"","article_layout":""}', 1, 5, '', '', 1, 0, '{"robots":"","author":"","rights":"","xreference":""}', 0, '*', ''), (53, 151, 'Using Joomla!', 'using-joomla', '

With Joomla you can create anything from a simple personal website to a complex ecommerce or social site with millions of visitors.

\r\n

This section of the sample data provides you with a brief introduction to Joomla concepts and reference material to help you understand how Joomla works.

\r\n

When you no longer need the sample data, you can can simply unpublish the sample data category found within each extension in the site administrator or you may completely delete each item and all of the categories.

', '', 1, 19, '2011-01-01 00:00:01', 42, 'Joomla', '0000-00-00 00:00:00', 0, 0, '0000-00-00 00:00:00', '2011-01-01 00:00:01', '0000-00-00 00:00:00', '{"image_intro":"","float_intro":"","image_intro_alt":"","image_intro_caption":"","image_fulltext":"","float_fulltext":"","image_fulltext_alt":"","image_fulltext_caption":""}', '{"urla":"","urlatext":"","targeta":"","urlb":"","urlbtext":"","targetb":"","urlc":"","urlctext":"","targetc":""}', '{"show_title":"","link_titles":"","show_intro":"","show_category":"","link_category":"","show_parent_category":"","link_parent_category":"","show_author":"","link_author":"","show_create_date":"","show_modify_date":"","show_publish_date":"","show_item_navigation":"","show_icons":"","show_print_icon":"","show_email_icon":"","show_vote":"","show_hits":"","show_noauth":"","alternative_readmore":"","article_layout":"","show_publishing_options":"","show_article_options":"","show_urls_images_backend":"","show_urls_images_frontend":""}', 1, 7, '', '', 1, 0, '{"robots":"","author":"","rights":"","xreference":""}', 0, '*', ''), INSERT IGNORE INTO `#__content` (`id`, `asset_id`, `title`, `alias`, `introtext`, `fulltext`, `state`, `catid`, `created`, `created_by`, `created_by_alias`, `modified`, `modified_by`, `checked_out`, `checked_out_time`, `publish_up`, `publish_down`, `images`, `urls`, `attribs`, `version`, `ordering`, `metakey`, `metadesc`, `access`, `hits`, `metadata`, `featured`, `language`, `xreference`) VALUES +(56, 154, 'Who''s Online', 'whos-online', '

The Who''s Online Module displays the number of Anonymous Users (e.g. Guests) and Registered Users (ones logged-in) that are currently accessing the Web site. Help

\r\n
{loadmodule whosonline,Who''s Online}
', '', 1, 65, '2011-01-01 00:00:01', 42, 'Joomla', '0000-00-00 00:00:00', 0, 0, '0000-00-00 00:00:00', '2011-01-01 00:00:01', '0000-00-00 00:00:00', '', '', '{"show_title":"","link_titles":"","show_intro":"","show_category":"","link_category":"","show_parent_category":"","link_parent_category":"","show_author":"","show_create_date":"","show_modify_date":"","show_publish_date":"","show_readmore":"","show_print_icon":"","show_email_icon":"","show_hits":"","page_title":"","alternative_readmore":"","layout":""}', 1, 1, '', '', 1, 0, '', 0, '*', ''), (57, 155, 'Wobbegone', 'wobbegone', '

\r\n', '\r\n

', 1, 72, '2011-01-01 00:00:01', 42, 'Joomla', '0000-00-00 00:00:00', 0, 0, '0000-00-00 00:00:00', '2011-01-01 00:00:01', '0000-00-00 00:00:00', '{"image_intro":"images\\/sampledata\\/parks\\/animals\\/180px_wobbegong.jpg","float_intro":"","image_intro_alt":"Wobbegon","image_intro_caption":"","image_fulltext":"images\\/sampledata\\/parks\\/animals\\/800px_wobbegong.jpg","float_fulltext":"","image_fulltext_alt":"Wobbegon","image_fulltext_caption":"Source: http:\\/\\/en.wikipedia.org\\/wiki\\/File:Wobbegong.jpg Author: Richard Ling Rights: GNU Free Documentation License v 1.2 or later"}', '{"urla":"","urlatext":"","targeta":"","urlb":"","urlbtext":"","targetb":"","urlc":"","urlctext":"","targetc":""}', '{"show_title":"","link_titles":"","show_intro":"","show_category":"","link_category":"","show_parent_category":"","link_parent_category":"","show_author":"","link_author":"","show_create_date":"","show_modify_date":"","show_publish_date":"","show_item_navigation":"","show_icons":"","show_print_icon":"","show_email_icon":"","show_vote":"","show_hits":"","show_noauth":"","alternative_readmore":"","article_layout":"","show_publishing_options":"","show_article_options":"","show_urls_images_backend":"","show_urls_images_frontend":""}', 1, 1, '', '', 1, 0, '{"robots":"","author":"","rights":"","xreference":""}', 0, '*', ''), (58, 156, 'Wonderful Watermelon', 'wonderful-watermelon', '

Watermelon is a wonderful and healthy treat. We grow the world''s sweetest watermelon. We have the largest watermelon patch in our country.

', '', 1, 30, '2011-01-01 00:00:01', 42, 'Joomla', '0000-00-00 00:00:00', 0, 0, '0000-00-00 00:00:00', '2011-01-01 00:00:01', '0000-00-00 00:00:00', '', '', '{"show_title":"","link_titles":"","show_intro":"","show_category":"","link_category":"","show_parent_category":"","link_parent_category":"","show_author":"","show_create_date":"","show_modify_date":"","show_publish_date":"","show_readmore":"","show_print_icon":"","show_email_icon":"","show_hits":"","page_title":"","alternative_readmore":"","layout":""}', 1, 1, '', '', 1, 0, '', 0, '*', ''), (59, 157, 'Wrapper Module', 'wrapper-module', '

This module shows an iFrame window to specified location. Help

\r\n
{loadmodule wrapper,Wrapper}
', '', 1, 67, '2011-01-01 00:00:01', 42, 'Joomla', '0000-00-00 00:00:00', 0, 0, '0000-00-00 00:00:00', '2011-01-01 00:00:01', '0000-00-00 00:00:00', '', '', '{"show_title":"","link_titles":"","show_intro":"","show_category":"","link_category":"","show_parent_category":"","link_parent_category":"","show_author":"","show_create_date":"","show_modify_date":"","show_publish_date":"","show_readmore":"","show_print_icon":"","show_email_icon":"","show_hits":"","page_title":"","alternative_readmore":"","layout":""}', 1, 1, '', '', 1, 0, '', 0, '*', ''), @@ -391,6 +392,7 @@ INSERT IGNORE INTO `#__modules` (`id`, `title`, `note`, `content`, `ordering`, ` (35, 'Search', '', '', 1, '', 0, '0000-00-00 00:00:00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 'mod_search', 1, 1, '{"label":"","width":"20","text":"","button":"","button_pos":"right","imagebutton":"","button_text":"","opensearch":"1","opensearch_title":"","set_itemid":"","layout":"_:default","moduleclass_sfx":"","cache":"1","cache_time":"900","cachemode":"itemid"}', 0, '*'), (36, 'Statistics', '', '', 1, '', 0, '0000-00-00 00:00:00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 'mod_stats', 1, 1, '{"serverinfo":"1","siteinfo":"1","counter":"1","increase":"0","layout":"_:default","moduleclass_sfx":"","cache":"1","cache_time":"900","cachemode":"static"}', 0, '*'), (38, 'Users Latest', '', '', 1, '', 0, '0000-00-00 00:00:00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 'mod_users_latest', 1, 1, '{"shownumber":"5","linknames":"0","layout":"_:default","moduleclass_sfx":"","cache":"0","cache_time":"900","cachemode":"static"}', 0, '*'), +(39, 'Who''s Online', '', '', 1, '', 0, '0000-00-00 00:00:00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 'mod_whosonline', 1, 1, '{"showmode":"2","linknames":"0","layout":"_:default","moduleclass_sfx":"","cache":"0"}', 0, '*'), (41, 'Footer', '', '', 1, '', 0, '0000-00-00 00:00:00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 'mod_footer', 1, 1, '{"layout":"_:default","moduleclass_sfx":"","cache":"1","cache_time":"900","cachemode":"static"}', 0, '*'), (44, 'Login', '', '', 1, '', 0, '0000-00-00 00:00:00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 'mod_login', 1, 1, '{"pretext":"","posttext":"","login":"280","logout":"280","greeting":"1","name":"0","usesecure":"0","layout":"_:default","moduleclass_sfx":"","cache":"0"}', 0, '*'), (45, 'Menu Example', '', '', 1, '', 0, '0000-00-00 00:00:00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 'mod_menu', 1, 1, '{"menutype":"mainmenu","startLevel":"1","endLevel":"0","showAllChildren":"0","tag_id":"","class_sfx":"","window_open":"","layout":"_:default","moduleclass_sfx":"","cache":"0","cache_time":"900","cachemode":"itemid"}', 0, '*'), diff --git a/language/en-GB/en-GB.mod_whosonline.ini b/language/en-GB/en-GB.mod_whosonline.ini new file mode 100644 index 0000000000..f1861803ae --- /dev/null +++ b/language/en-GB/en-GB.mod_whosonline.ini @@ -0,0 +1,28 @@ +; Joomla! Project +; Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved. +; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php +; Note : All ini files need to be saved as UTF-8 - No BOM +MOD_WHOSONLINE="Who's Online" +MOD_WHOSONLINE_FIELD_FILTER_GROUPS_DESC="Choose to filter by groups of the connected user" +MOD_WHOSONLINE_FIELD_FILTER_GROUPS_LABEL="Filter groups" +MOD_WHOSONLINE_FIELD_LINKTOWHAT_DESC="Choose the type of information to display" +MOD_WHOSONLINE_FIELD_LINKTOWHAT_LABEL="Information" +MOD_WHOSONLINE_FIELD_VALUE_BOTH="Both" +MOD_WHOSONLINE_FIELD_VALUE_CONTACT="Contact" +MOD_WHOSONLINE_FIELD_VALUE_NAMES="Usernames" +MOD_WHOSONLINE_FIELD_VALUE_NUMBER="# of Guests / Users" +MOD_WHOSONLINE_FIELD_VALUE_PROFILE="Profile" +MOD_WHOSONLINE_GUESTS="%s guests" +MOD_WHOSONLINE_GUESTS_1="one guest" +MOD_WHOSONLINE_GUESTS_0="no guests" +MOD_WHOSONLINE_MEMBERS="%s members" +MOD_WHOSONLINE_MEMBERS_1="one member" +MOD_WHOSONLINE_MEMBERS_0="no members" +MOD_WHOSONLINE_SAME_GROUP_MESSAGE="List of Users who belong to your user groups or your user groups' child groups" +MOD_WHOSONLINE_SHOWMODE_DESC="Select what shall be shown" +MOD_WHOSONLINE_SHOWMODE_LABEL="Display" +MOD_WHOSONLINE_XML_DESCRIPTION="The Who's Online Module displays the number of Anonymous Users (e.g. Guests) and Registered Users (ones logged-in) that are currently accessing the Web site." +; frontend display +; in the following string +; %1$s is for guests and %2$s for members +MOD_WHOSONLINE_WE_HAVE="We have %1$s and %2$s online" diff --git a/language/en-GB/en-GB.mod_whosonline.sys.ini b/language/en-GB/en-GB.mod_whosonline.sys.ini new file mode 100644 index 0000000000..f8fd9ebd8c --- /dev/null +++ b/language/en-GB/en-GB.mod_whosonline.sys.ini @@ -0,0 +1,9 @@ +; Joomla! Project +; Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved. +; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php +; Note : All ini files need to be saved as UTF-8 - No BOM + +MOD_WHOSONLINE="Who's Online" +MOD_WHOSONLINE_XML_DESCRIPTION="The Who's Online Module displays the number of Anonymous Users (e.g. Guests) and Registered Users (ones logged-in) that are currently accessing the Web site." +MOD_WHOSONLINE_LAYOUT_DEFAULT="Default" + diff --git a/language/en-GB/install.xml b/language/en-GB/install.xml index c842e92da8..ff8432905b 100644 --- a/language/en-GB/install.xml +++ b/language/en-GB/install.xml @@ -71,6 +71,8 @@ en-GB.mod_tags_similar.sys.ini en-GB.mod_users_latest.ini en-GB.mod_users_latest.sys.ini + en-GB.mod_whosonline.ini + en-GB.mod_whosonline.sys.ini en-GB.tpl_protostar.ini en-GB.tpl_protostar.sys.ini index.html diff --git a/modules/mod_whosonline/helper.php b/modules/mod_whosonline/helper.php new file mode 100644 index 0000000000..91c793c100 --- /dev/null +++ b/modules/mod_whosonline/helper.php @@ -0,0 +1,106 @@ +getQuery(true) + ->select('guest, client_id') + ->from('#__session') + ->where('client_id = 0'); + $db->setQuery($query); + $sessions = (array) $db->loadObjectList(); + + if (count($sessions)) + { + foreach ($sessions as $session) + { + // If guest increase guest count by 1 + if ($session->guest == 1) + { + $guest_array ++; + } + + // If member increase member count by 1 + if ($session->guest == 0) + { + $user_array ++; + } + } + } + + $result['user'] = $user_array; + $result['guest'] = $guest_array; + + return $result; + } + + /** + * Show online member names + * + * @param mixed $params The parameters + * + * @return array (array) $db->loadObjectList() The names of the online users. + * + * @since 1.5.0 + **/ + public static function getOnlineUserNames($params) + { + $db = JFactory::getDbo(); + $query = $db->getQuery(true) + ->select($db->quoteName(array('a.username', 'a.time', 'a.userid', 'a.client_id'))) + ->from('#__session AS a') + ->where($db->quoteName('a.userid') . ' != 0') + ->where($db->quoteName('a.client_id') . ' = 0') + ->group($db->quoteName(array('a.username', 'a.time', 'a.userid', 'a.client_id'))); + $user = JFactory::getUser(); + + if (!$user->authorise('core.admin') && $params->get('filter_groups', 0) == 1) + { + $groups = $user->getAuthorisedGroups(); + + if (empty($groups)) + { + return array(); + } + + $query->join('LEFT', '#__user_usergroup_map AS m ON m.user_id = a.userid') + ->join('LEFT', '#__usergroups AS ug ON ug.id = m.group_id') + ->where('ug.id in (' . implode(',', $groups) . ')') + ->where('ug.id <> 1'); + } + + $db->setQuery($query); + + return (array) $db->loadObjectList(); + } +} diff --git a/modules/mod_whosonline/index.html b/modules/mod_whosonline/index.html new file mode 100644 index 0000000000..2efb97f319 --- /dev/null +++ b/modules/mod_whosonline/index.html @@ -0,0 +1 @@ + diff --git a/modules/mod_whosonline/mod_whosonline.php b/modules/mod_whosonline/mod_whosonline.php new file mode 100644 index 0000000000..819b9382e3 --- /dev/null +++ b/modules/mod_whosonline/mod_whosonline.php @@ -0,0 +1,30 @@ +get('showmode', 0); + +if ($showmode == 0 || $showmode == 2) +{ + $count = ModWhosonlineHelper::getOnlineCount(); +} + +if ($showmode > 0) +{ + $names = ModWhosonlineHelper::getOnlineUserNames($params); +} + +$linknames = $params->get('linknames', 0); +$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx')); + +require JModuleHelper::getLayoutPath('mod_whosonline', $params->get('layout', 'default')); diff --git a/modules/mod_whosonline/mod_whosonline.xml b/modules/mod_whosonline/mod_whosonline.xml new file mode 100644 index 0000000000..c15bc09ac6 --- /dev/null +++ b/modules/mod_whosonline/mod_whosonline.xml @@ -0,0 +1,79 @@ + + + mod_whosonline + Joomla! Project + July 2004 + Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved. + GNU General Public License version 2 or later; see LICENSE.txt + admin@joomla.org + www.joomla.org + 3.0.0 + MOD_WHOSONLINE_XML_DESCRIPTION + + mod_whosonline.php + tmpl + helper.php + index.html + mod_whosonline.xml + + + en-GB.mod_whosonline.ini + en-GB.mod_whosonline.sys.ini + + + + +
+ + + + + +
+
+ + + + + + + + + +
+
+
+
diff --git a/modules/mod_whosonline/tmpl/default.php b/modules/mod_whosonline/tmpl/default.php new file mode 100644 index 0000000000..fd7fe03f20 --- /dev/null +++ b/modules/mod_whosonline/tmpl/default.php @@ -0,0 +1,30 @@ + + + + + +

+ + + 0) && count($names)) : ?> +
    + get('filter_groups')):?> +

    + + +
  • + username; ?> +
  • + +
+ diff --git a/tests/system/resetdb.sql b/tests/system/resetdb.sql index 4e7deca017..26da9fa79c 100644 --- a/tests/system/resetdb.sql +++ b/tests/system/resetdb.sql @@ -754,6 +754,7 @@ INSERT INTO `jos_modules` (`id`, `title`, `content`, `ordering`, `position`, `ch (18, 'Login Form', '', 8, 'left', 0, '0000-00-00 00:00:00', 1, 'mod_login', 0, 0, 1, 'greeting=1\nname=0', 1, 0, ''), (19, 'Latest News', '', 4, 'user1', 0, '0000-00-00 00:00:00', 1, 'mod_latestnews', 0, 0, 1, 'cache=1', 1, 0, ''), (20, 'Statistics', '', 6, 'left', 0, '0000-00-00 00:00:00', 0, 'mod_stats', 0, 0, 1, 'serverinfo=1\nsiteinfo=1\ncounter=1\nincrease=0\nmoduleclass_sfx=', 0, 0, ''), +(21, 'Who''s Online', '', 1, 'right', 0, '0000-00-00 00:00:00', 1, 'mod_whosonline', 0, 0, 1, 'online=1\nusers=1\nmoduleclass_sfx=', 0, 0, ''), (22, 'Popular', '', 6, 'user2', 0, '0000-00-00 00:00:00', 1, 'mod_mostread', 0, 0, 1, 'cache=1', 0, 0, ''), (23, 'Archive', '', 9, 'left', 0, '0000-00-00 00:00:00', 0, 'mod_archive', 0, 0, 1, 'cache=1', 1, 0, ''), (24, 'Sections', '', 10, 'left', 0, '0000-00-00 00:00:00', 0, 'mod_sections', 0, 0, 1, 'cache=1', 1, 0, ''), diff --git a/tests/unit/stubs/database/jos_content.csv b/tests/unit/stubs/database/jos_content.csv index 0609c8f3fb..b2e65bc194 100644 --- a/tests/unit/stubs/database/jos_content.csv +++ b/tests/unit/stubs/database/jos_content.csv @@ -255,6 +255,8 @@ '54','152','Weblinks','weblinks','

Weblinks (com_weblinks) is a component that provides a structured way to organize external links and present them in a visually attractive, consistent and informative way. Help

',,'1','21','2011-01-01 00:00:01','100','Joomla','0000-00-00 00:00:00','0','0','0000-00-00 00:00:00','2011-01-01 00:00:01','0000-00-00 00:00:00',,,'{"show_title":"","link_titles":"","show_intro":"","show_category":"","link_category":"","show_parent_category":"","link_parent_category":"","show_author":"","link_author":"","show_create_date":"","show_modify_date":"","show_publish_date":"","show_item_navigation":"","show_icons":"","show_print_icon":"","show_email_icon":"","show_vote":"","show_hits":"","show_noauth":"","alternative_readmore":"","article_layout":""}','1','6',,,'1','1','{"robots":"","author":"","rights":"","xreference":""}','0','*', '55','153','Weblinks Module','weblinks-module','

This module displays the list of weblinks in a category. Help

{loadmodule weblinks,Weblinks}
',,'1','66','2011-01-01 00:00:01','100','Joomla','0000-00-00 00:00:00','0','0','0000-00-00 00:00:00','2011-01-01 00:00:01','0000-00-00 00:00:00',,,'{"show_title":"","link_titles":"","show_intro":"","show_category":"","link_category":"","show_parent_category":"","link_parent_category":"","show_author":"","show_create_date":"","show_modify_date":"","show_publish_date":"","show_readmore":"","show_print_icon":"","show_email_icon":"","show_hits":"","page_title":"","alternative_readmore":"","layout":""}','1','5',,,'1','0',,'0','*', +'56','154','Who\'s Online','whos-online','

The Who\'s Online Module displays the number of Anonymous Users (e.g. Guests) and Registered Users (ones logged-in) that are currently accessing the Web site. Help

+
{loadmodule whosonline,Who\'s Online}
',,'1','65','2011-01-01 00:00:01','100','Joomla','0000-00-00 00:00:00','0','0','0000-00-00 00:00:00','2011-01-01 00:00:01','0000-00-00 00:00:00',,,'{"show_title":"","link_titles":"","show_intro":"","show_category":"","link_category":"","show_parent_category":"","link_parent_category":"","show_author":"","show_create_date":"","show_modify_date":"","show_publish_date":"","show_readmore":"","show_print_icon":"","show_email_icon":"","show_hits":"","page_title":"","alternative_readmore":"","layout":""}','1','1',,,'1','0',,'0','*', '57','155','Wobbegone','wobbegone','

','

','1','72','2011-01-01 00:00:01','100','Joomla','0000-00-00 00:00:00','0','0','0000-00-00 00:00:00','2011-01-01 00:00:01','0000-00-00 00:00:00','{"image_intro":"images\\/sampledata\\/parks\\/animals\\/180px_wobbegong.jpg","float_intro":"","image_intro_alt":"Wobbegon","image_intro_caption":"","image_fulltext":"images\\/sampledata\\/parks\\/animals\\/800px_wobbegong.jpg","float_fulltext":"","image_fulltext_alt":"Wobbegon","image_fulltext_caption":"Source: http:\\/\\/en.wikipedia.org\\/wiki\\/File:Wobbegong.jpg Author: Richard Ling Rights: GNU Free Documentation License v 1.2 or later"}','{"urla":"","urlatext":"","targeta":"","urlb":"","urlbtext":"","targetb":"","urlc":"","urlctext":"","targetc":""}','{"show_title":"","link_titles":"","show_intro":"","show_category":"","link_category":"","show_parent_category":"","link_parent_category":"","show_author":"","link_author":"","show_create_date":"","show_modify_date":"","show_publish_date":"","show_item_navigation":"","show_icons":"","show_print_icon":"","show_email_icon":"","show_vote":"","show_hits":"","show_noauth":"","alternative_readmore":"","article_layout":"","show_publishing_options":"","show_article_options":"","show_urls_images_backend":"","show_urls_images_frontend":""}','1','1',,,'1','0','{"robots":"","author":"","rights":"","xreference":""}','0','*', diff --git a/tests/unit/stubs/database/jos_extensions.csv b/tests/unit/stubs/database/jos_extensions.csv index cca25b7527..b30db0e85c 100644 --- a/tests/unit/stubs/database/jos_extensions.csv +++ b/tests/unit/stubs/database/jos_extensions.csv @@ -37,6 +37,7 @@ '214','mod_stats','module','mod_stats',,'0','1','1','0','{"name":"mod_stats","type":"module","creationDate":"July 2004","author":"Joomla! Project","copyright":"Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved.","authorEmail":"admin@joomla.org","authorUrl":"www.joomla.org","version":"3.0.0","description":"MOD_STATS_XML_DESCRIPTION","group":""}',,,,'0','0000-00-00 00:00:00','0','0' '216','mod_users_latest','module','mod_users_latest',,'0','1','1','0','{"name":"mod_users_latest","type":"module","creationDate":"December 2009","author":"Joomla! Project","copyright":"Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved.","authorEmail":"admin@joomla.org","authorUrl":"www.joomla.org","version":"3.0.0","description":"MOD_USERS_LATEST_XML_DESCRIPTION","group":""}',,,,'0','0000-00-00 00:00:00','0','0' '217','mod_weblinks','module','mod_weblinks',,'0','1','1','0','{"name":"mod_weblinks","type":"module","creationDate":"July 2009","author":"Joomla! Project","copyright":"Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved.","authorEmail":"admin@joomla.org","authorUrl":"www.joomla.org","version":"3.0.0","description":"MOD_WEBLINKS_XML_DESCRIPTION","group":""}',,,,'0','0000-00-00 00:00:00','0','0' +'218','mod_whosonline','module','mod_whosonline',,'0','1','1','0','{"name":"mod_whosonline","type":"module","creationDate":"July 2004","author":"Joomla! Project","copyright":"Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved.","authorEmail":"admin@joomla.org","authorUrl":"www.joomla.org","version":"3.0.0","description":"MOD_WHOSONLINE_XML_DESCRIPTION","group":""}',,,,'0','0000-00-00 00:00:00','0','0' '220','mod_articles_category','module','mod_articles_category',,'0','1','1','0','{"name":"mod_articles_category","type":"module","creationDate":"February 2010","author":"Joomla! Project","copyright":"Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved.","authorEmail":"admin@joomla.org","authorUrl":"www.joomla.org","version":"3.0.0","description":"MOD_ARTICLES_CATEGORY_XML_DESCRIPTION","group":""}',,,,'0','0000-00-00 00:00:00','0','0' '221','mod_articles_categories','module','mod_articles_categories',,'0','1','1','0','{"name":"mod_articles_categories","type":"module","creationDate":"February 2010","author":"Joomla! Project","copyright":"Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved.","authorEmail":"admin@joomla.org","authorUrl":"www.joomla.org","version":"3.0.0","description":"MOD_ARTICLES_CATEGORIES_XML_DESCRIPTION","group":""}',,,,'0','0000-00-00 00:00:00','0','0' '222','mod_languages','module','mod_languages',,'0','1','1','1','{"name":"mod_languages","type":"module","creationDate":"February 2010","author":"Joomla! Project","copyright":"Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved.","authorEmail":"admin@joomla.org","authorUrl":"www.joomla.org","version":"3.0.0","description":"MOD_LANGUAGES_XML_DESCRIPTION","group":""}',,,,'0','0000-00-00 00:00:00','0','0' diff --git a/tests/unit/stubs/database/jos_modules.csv b/tests/unit/stubs/database/jos_modules.csv index 360466efee..349c91f9ce 100644 --- a/tests/unit/stubs/database/jos_modules.csv +++ b/tests/unit/stubs/database/jos_modules.csv @@ -28,6 +28,7 @@ '35','Search',,,'1',,'0','0000-00-00 00:00:00','0000-00-00 00:00:00','0000-00-00 00:00:00','1','mod_search','1','1','{"label":"","width":"20","text":"","button":"","button_pos":"right","imagebutton":"","button_text":"","opensearch":"1","opensearch_title":"","set_itemid":"","layout":"_:default","moduleclass_sfx":"","cache":"1","cache_time":"900","cachemode":"itemid"}','0','*' '36','Statistics',,,'1',,'0','0000-00-00 00:00:00','0000-00-00 00:00:00','0000-00-00 00:00:00','1','mod_stats','1','1','{"serverinfo":"1","siteinfo":"1","counter":"1","increase":"0","layout":"_:default","moduleclass_sfx":"","cache":"1","cache_time":"900","cachemode":"static"}','0','*' '38','Users Latest',,,'1',,'0','0000-00-00 00:00:00','0000-00-00 00:00:00','0000-00-00 00:00:00','1','mod_users_latest','1','1','{"shownumber":"5","linknames":"0","layout":"_:default","moduleclass_sfx":"","cache":"0","cache_time":"900","cachemode":"static"}','0','*' +'39','Who\'s Online',,,'1',,'0','0000-00-00 00:00:00','0000-00-00 00:00:00','0000-00-00 00:00:00','1','mod_whosonline','1','1','{"showmode":"2","linknames":"0","layout":"_:default","moduleclass_sfx":"","cache":"0"}','0','*' '41','Footer',,,'1',,'0','0000-00-00 00:00:00','0000-00-00 00:00:00','0000-00-00 00:00:00','1','mod_footer','1','1','{"layout":"_:default","moduleclass_sfx":"","cache":"1","cache_time":"900","cachemode":"static"}','0','*' '44','Login',,,'1',,'0','0000-00-00 00:00:00','0000-00-00 00:00:00','0000-00-00 00:00:00','1','mod_login','1','1','{"pretext":"","posttext":"","login":"280","logout":"280","greeting":"1","name":"0","usesecure":"0","layout":"_:default","moduleclass_sfx":"","cache":"0"}','0','*' '45','Menu Example',,,'1',,'0','0000-00-00 00:00:00','0000-00-00 00:00:00','0000-00-00 00:00:00','1','mod_menu','1','1','{"menutype":"mainmenu","startLevel":"1","endLevel":"0","showAllChildren":"0","tag_id":"","class_sfx":"","window_open":"","layout":"_:default","moduleclass_sfx":"","cache":"0","cache_time":"900","cachemode":"itemid"}','0','*' diff --git a/tests/unit/suites/libraries/joomla/language/data/language/en-GB/en-GB.xml b/tests/unit/suites/libraries/joomla/language/data/language/en-GB/en-GB.xml index 39d7292b24..e922f73b8e 100644 --- a/tests/unit/suites/libraries/joomla/language/data/language/en-GB/en-GB.xml +++ b/tests/unit/suites/libraries/joomla/language/data/language/en-GB/en-GB.xml @@ -64,6 +64,8 @@ en-GB.mod_users_latest.sys.ini en-GB.mod_weblinks.ini en-GB.mod_weblinks.sys.ini + en-GB.mod_whosonline.ini + en-GB.mod_whosonline.sys.ini en-GB.pkg_joomla.sys.ini en-GB.tpl_atomic.ini en-GB.tpl_atomic.sys.ini diff --git a/tests/unit/suites/libraries/joomla/utilities/stubs/test.xml b/tests/unit/suites/libraries/joomla/utilities/stubs/test.xml index 0de7e1c308..b6b56c5659 100644 --- a/tests/unit/suites/libraries/joomla/utilities/stubs/test.xml +++ b/tests/unit/suites/libraries/joomla/utilities/stubs/test.xml @@ -1033,6 +1033,25 @@ 0 0
+ + 47 + Who's Online + module + mod_whosonline + + 0 + 1 + 1 + 0 + + + + + 0 + 0000-00-00 00:00:00 + 0 + 0 + 49 Custom HTML