diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 77cb4951..e5ab1262 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,4 +1,4 @@ -![alt XOOPS CMS](https://xoops.org/images/logoXoops4GithubRepository.png) +![alt XOOPS CMS](https://xoops.org/images/logoXoopsPhp8.png) # Contributing to [XOOPS CMS](https://xoops.org) [![XOOPS CMS Module](https://img.shields.io/badge/XOOPS%20CMS-Module-blue.svg)](https://xoops.org) [![Software License](https://img.shields.io/badge/license-GPL-brightgreen.svg?style=flat)](https://www.gnu.org/licenses/gpl-2.0.html) diff --git a/admin/about.php b/admin/about.php index 285e731a..2047d6df 100644 --- a/admin/about.php +++ b/admin/about.php @@ -24,7 +24,7 @@ /** @var Admin $adminObject */ -require __DIR__ . '/admin_header.php'; +require_once __DIR__ . '/admin_header.php'; xoops_cp_header(); $adminObject->displayNavigation(basename(__FILE__)); diff --git a/admin/admin_footer.php b/admin/admin_footer.php index b060a982..acd28a70 100644 --- a/admin/admin_footer.php +++ b/admin/admin_footer.php @@ -20,7 +20,7 @@ use Xmf\Module\Admin; -$pathIcon32 = Admin::iconUrl('', 32); +$pathIcon32 = Admin::iconUrl('', '32'); echo "
'; diff --git a/admin/admin_header.php b/admin/admin_header.php index 7354b5cd..7ab6b6b0 100644 --- a/admin/admin_header.php +++ b/admin/admin_header.php @@ -23,23 +23,24 @@ use XoopsModules\Publisher\Helper; use XoopsModules\Publisher\Common\Configurator; -require dirname(__DIR__) . '/preloads/autoloader.php'; +require \dirname(__DIR__) . '/preloads/autoloader.php'; -require_once dirname(__DIR__, 3) . '/include/cp_header.php'; +require \dirname(__DIR__, 3) . '/include/cp_header.php'; //require_once $GLOBALS['xoops']->path('www/class/xoopsformloader.php'); -require_once dirname(__DIR__) . '/include/common.php'; +require_once \dirname(__DIR__) . '/include/common.php'; -$moduleDirName = basename(dirname(__DIR__)); +$moduleDirName = \basename(\dirname(__DIR__)); $helper = Helper::getInstance(); /** @var Admin $adminObject */ $adminObject = Admin::getInstance(); -$pathIcon16 = Admin::iconUrl('', 16); -$pathIcon32 = Admin::iconUrl('', 32); -if (is_object($helper->getModule())) { - $pathModIcon32 = $helper->getModule()->getInfo('modicons32'); +$pathIcon16 = Admin::iconUrl('', '16'); +$pathIcon32 = Admin::iconUrl('', '32'); +$pathModIcon32 = XOOPS_URL . '/modules/' . $moduleDirName . '/assets/images/icons/32/'; +if (is_object($helper->getModule()) && false !== $helper->getModule()->getInfo('modicons32')) { + $pathModIcon32 = $helper->url($helper->getModule()->getInfo('modicons32')); } // Load language files diff --git a/admin/blockform.php b/admin/blockform.php index 647e216f..2f3fdfc9 100644 --- a/admin/blockform.php +++ b/admin/blockform.php @@ -7,7 +7,6 @@ * of supporting developers from this source code or any supporting source code * which is considered copyrighted (c) material of the original comment or credit authors. * - * PHP version 5 * * @category Module * @author XOOPS Development Team @@ -15,10 +14,21 @@ * @link https://xoops.org * @license GNU GPL 2 or later (https://www.gnu.org/licenses/gpl-2.0.html) */ + +use Xmf\Module\Admin; +use XoopsModules\Publisher\{ + Helper +}; + +/** @var Admin $adminObject */ +/** @var Helper $helper */ + require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; -$moduleDirName = basename(dirname(__DIR__)); -$moduleDirNameUpper = mb_strtoupper($moduleDirName); //$capsDirName +$moduleDirName = \basename(\dirname(__DIR__)); +$moduleDirNameUpper = \mb_strtoupper($moduleDirName); + +$helper->loadLanguage('blocksadmin'); $form = new \XoopsThemeForm($block['form_title'], 'blockform', 'blocksadmin.php', 'post', true); if (isset($block['name'])) { @@ -51,7 +61,7 @@ ksort($moduleList); $moduleSelect->addOptionArray($moduleList); $form->addElement($moduleSelect); -$form->addElement(new \XoopsFormText(constant('CO_' . $moduleDirNameUpper . '_' . 'TITLE'), 'btitle', 50, 255, $block['title']), false); +$form->addElement(new \XoopsFormText(_AM_SYSTEM_BLOCKS_TITLE, 'btitle', 50, 255, $block['title']), false); if ($block['is_custom']) { $textarea = new \XoopsFormDhtmlTextArea(_AM_SYSTEM_BLOCKS_CONTENT, 'bcontent', $block['content'], 15, 70); $textarea->setDescription('' . _AM_SYSTEM_BLOCKS_USEFULTAGS . '" - . constant('CO_' . $moduleDirNameUpper . '_' . 'TITLE') + . _AM_SYSTEM_BLOCKS_TITLE . " | "
. constant('CO_' . $moduleDirNameUpper . '_' . 'SIDE')
. ' ' @@ -103,9 +103,7 @@ function listBlocks() . '-' . _RIGHT . " | " - . constant( - 'CO_' . $moduleDirNameUpper . '_' . 'WEIGHT' - ) + . constant('CO_' . $moduleDirNameUpper . '_' . 'WEIGHT') . " | " . constant('CO_' . $moduleDirNameUpper . '_' . 'VISIBLE') . " | " @@ -122,17 +120,17 @@ function listBlocks() $blockCount = count($blockArray); $class = 'even'; $cachetimes = [ - '0' => _NOCACHE, - '30' => sprintf(_SECONDS, 30), - '60' => _MINUTE, - '300' => sprintf(_MINUTES, 5), - '1800' => sprintf(_MINUTES, 30), - '3600' => _HOUR, - '18000' => sprintf(_HOURS, 5), - '86400' => _DAY, - '259200' => sprintf(_DAYS, 3), - '604800' => _WEEK, - '2592000' => _MONTH, + 0 => _NOCACHE, + 30 => sprintf(_SECONDS, 30), + 60 => _MINUTE, + 300 => sprintf(_MINUTES, 5), + 1800 => sprintf(_MINUTES, 30), + 3600 => _HOUR, + 18000 => sprintf(_HOURS, 5), + 86400 => _DAY, + 259200 => sprintf(_DAYS, 3), + 604800 => _WEEK, + 2592000 => _MONTH, ]; foreach ($blockArray as $i) { $groupsPerms = $grouppermHandler->getGroupIds('block_read', $i->getVar('bid')); @@ -248,13 +246,13 @@ function listBlocks() echo " | '; echo " | '; @@ -264,10 +262,10 @@ function listBlocks() // Actions - echo " | " . $icons->edit . " + echo " | " . $icons['edit'] . " "; if (!in_array($i->getVar('block_type'), ['S', 'M'])) { - echo " getVar('bid') . "'>" . $icons->delete . ''; + echo " getVar('bid') . "'>" . $icons['delete'] . ''; } echo " @@ -295,21 +293,17 @@ function listBlocks() */ function cloneBlock($bid) { - require_once __DIR__ . '/admin_header.php'; - xoops_cp_header(); - /** @var \Xmf\Module\Admin $adminObject */ $adminObject = Admin::getInstance(); $adminObject->displayNavigation(basename(__FILE__)); - $moduleDirName = basename(dirname(__DIR__)); - $moduleDirNameUpper = mb_strtoupper($moduleDirName); //$capsDirName + $moduleDirName = \basename(\dirname(__DIR__)); + $moduleDirNameUpper = \mb_strtoupper($moduleDirName); xoops_loadLanguage('admin', 'system'); xoops_loadLanguage('admin/blocksadmin', 'system'); xoops_loadLanguage('admin/groups', 'system'); - // mpu_adm_menu(); $myblock = new \XoopsBlock($bid); $db = \XoopsDatabaseFactory::getDatabaseConnection(); $sql = 'SELECT module_id FROM ' . $db->prefix('block_module_link') . ' WHERE block_id=' . (int)$bid; @@ -318,7 +312,7 @@ function cloneBlock($bid) while (false !== ($row = $db->fetchArray($result))) { $modules[] = (int)$row['module_id']; } - $isCustom = (in_array($myblock->getVar('block_type'), ['C', 'E'])); + $isCustom = (in_array($myblock->getVar('block_type'), ['C', 'E'])); $block = [ 'title' => $myblock->getVar('title') . ' Clone', 'form_title' => constant('CO_' . $moduleDirNameUpper . '_' . 'BLOCKS_CLONEBLOCK'), @@ -361,11 +355,13 @@ function isBlockCloned($bid, $bside, $bweight, $bvisible, $bcachetime, $bmodule, xoops_loadLanguage('admin/blocksadmin', 'system'); xoops_loadLanguage('admin/groups', 'system'); - $block = new \XoopsBlock($bid); - $clone = $block->xoopsClone(); + $moduleDirName = \basename(\dirname(__DIR__)); + $moduleDirNameUpper = mb_strtoupper($moduleDirName); + $block = new \XoopsBlock($bid); + $clone = $block->xoopsClone(); if (empty($bmodule)) { xoops_cp_header(); - xoops_error(sprintf(_AM_NOTSELNG, _AM_VISIBLEIN)); + xoops_error(sprintf(constant('CO_' . $moduleDirNameUpper . '_' . 'NOTSELNG'), constant('CO_' . $moduleDirNameUpper . '_' . 'VISIBLEIN'))); xoops_cp_footer(); exit(); } @@ -413,7 +409,7 @@ function isBlockCloned($bid, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $sql = 'INSERT INTO ' . $db->prefix('group_permission') . ' (gperm_groupid, gperm_itemid, gperm_modid, gperm_name) VALUES (' . $iValue . ', ' . $newid . ", 1, 'block_read')"; $db->query($sql); } - redirect_header('blocksadmin.php?op=listar', 1, _AM_DBUPDATED); + redirect_header('blocksadmin.php?op=listar', 1, _AM_SYSTEM_BLOCKS_DBUPDATED); } /** @@ -434,6 +430,9 @@ function setOrder($bid, $title, $weight, $visible, $side, $bcachetime, $bmodule $myblock->setVar('side', $side); $myblock->setVar('bcachetime', $bcachetime); $myblock->store(); + // /** @var \XoopsBlockHandler $blockHandler */ + // $blockHandler = xoops_getHandler('block'); + // return $blockHandler->insert($myblock); } /** @@ -441,13 +440,12 @@ function setOrder($bid, $title, $weight, $visible, $side, $bcachetime, $bmodule */ function editBlock($bid) { - require_once __DIR__ . '/admin_header.php'; xoops_cp_header(); /** @var \Xmf\Module\Admin $adminObject */ $adminObject = Admin::getInstance(); $adminObject->displayNavigation(basename(__FILE__)); - $moduleDirName = basename(dirname(__DIR__)); - $moduleDirNameUpper = mb_strtoupper($moduleDirName); //$capsDirName + $moduleDirName = \basename(\dirname(__DIR__)); + $moduleDirNameUpper = \mb_strtoupper($moduleDirName); xoops_loadLanguage('admin', 'system'); xoops_loadLanguage('admin/blocksadmin', 'system'); @@ -461,7 +459,7 @@ function editBlock($bid) while (false !== ($row = $db->fetchArray($result))) { $modules[] = (int)$row['module_id']; } - $isCustom = (in_array($myblock->getVar('block_type'), ['C', 'E'])); + $isCustom = (in_array($myblock->getVar('block_type'), ['C', 'E'])); $block = [ 'title' => $myblock->getVar('title'), 'form_title' => constant('CO_' . $moduleDirNameUpper . '_' . 'BLOCKS_EDITBLOCK'), @@ -503,31 +501,36 @@ function editBlock($bid) function updateBlock($bid, $btitle, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options, $groups) { - $myblock = new XoopsBlock($bid); + $myblock = new \XoopsBlock($bid); $myblock->setVar('title', $btitle); $myblock->setVar('weight', $bweight); $myblock->setVar('visible', $bvisible); $myblock->setVar('side', $bside); $myblock->setVar('bcachetime', $bcachetime); + $myblock->setVar('module', $bmodule); + $myblock->setVar('groups', $groups); $helper = Helper::getInstance(); $helper->loadLanguage('common'); //update block options - if (isset($options)) { - $optionsCount = count($options); - if ($optionsCount > 0) { - //Convert array values to comma-separated - foreach ($options as $i => $iValue) { - if (is_array($iValue)) { - $options[$i] = implode(',', $iValue); - } + if (is_array($options) && count($options) > 0) { + //Convert array values to comma-separated + foreach ($options as $i => $iValue) { + if (is_array($iValue)) { + $options[$i] = implode(',', $iValue); } - $options = implode('|', $options); - $myblock->setVar('options', $options); } + $options = implode('|', $options); + $myblock->setVar('options', $options); } $myblock->store(); - $moduleDirName = basename(dirname(__DIR__)); - $moduleDirNameUpper = mb_strtoupper($moduleDirName); + // /** @var \XoopsBlockHandler $blockHandler */ + // $blockHandler = xoops_getHandler('block'); + // $blockHandler->insert($myblock); + + global $xoopsDB; + + $moduleDirName = \basename(\dirname(__DIR__)); + $moduleDirNameUpper = \mb_strtoupper($moduleDirName); if (!empty($bmodule) && count($bmodule) > 0) { $sql = sprintf('DELETE FROM `%s` WHERE block_id = %u', $GLOBALS['xoopsDB']->prefix('block_module_link'), $bid); @@ -555,7 +558,7 @@ function updateBlock($bid, $btitle, $bside, $bweight, $bvisible, $bcachetime, $b if ('list' === $op) { xoops_cp_header(); - $adminObject->displayNavigation(basename(__FILE__)); + //$adminObject->displayNavigation(basename(__FILE__)); listBlocks(); require_once __DIR__ . '/admin_footer.php'; exit(); diff --git a/admin/category.php b/admin/category.php index fcb4e24b..2a4229b3 100644 --- a/admin/category.php +++ b/admin/category.php @@ -35,11 +35,11 @@ // Where do we start ? $startcategory = Request::getInt('startcategory', 0, 'GET'); -$categoryId = Request::getInt('categoryid', null); +$categoryid = Request::getInt('categoryid', null); switch ($op) { case 'del': - $categoryObj = $helper->getHandler('Category')->get($categoryId); + $categoryObj = $helper->getHandler('Category')->get($categoryid); $confirm = Request::getString('confirm', '', 'POST'); $name = Request::getString('name', '', 'POST'); if ($confirm) { @@ -60,14 +60,14 @@ //end of fx2024 code Utility::cpHeader(); - Utility::editCategory(true, $categoryId, $numberSubcats); + Utility::editCategory(true, $categoryid, $numberSubcats); break; case 'addcategory': global $modify; $parentid = Request::getInt('parentid'); - if (0 != $categoryId) { - $categoryObj = $helper->getHandler('Category')->get($categoryId); + if (0 != $categoryid) { + $categoryObj = $helper->getHandler('Category')->get($categoryid); } else { $categoryObj = $helper->getHandler('Category')->create(); } @@ -164,7 +164,7 @@ //Added by fx2024 case 'addsubcats': - $categoryId = 0; + $categoryid = 0; $numberSubcats = Request::getInt('nb_subcats', 0, 'POST') + Request::getInt('nb_sub_yet', 0, 'POST'); $categoryObj = $helper->getHandler('Category')->create(); @@ -176,7 +176,7 @@ } Utility::cpHeader(); - Utility::editCategory(true, $categoryId, $numberSubcats, $categoryObj); + Utility::editCategory(true, $categoryid, $numberSubcats, $categoryObj); exit(); //end of fx2024 code @@ -216,7 +216,7 @@ echo ' |
---|---|---|---|---|---|---|---|---|
" . _AM_PUBLISHER_NOCAT . ' | '; echo '
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
' @@ -10,9 +10,9 @@ datesub: '1486997400' dateexpire: '0' status: '2' - image: '1' - images: '1' - counter: '133' + image: '0' + images: '' + counter: '134' rating: '0.0000' votes: '1' weight: '1' @@ -27,12 +27,13 @@ meta_keywords: 'XOOPS,Publisher' meta_description: 'This is a Meta Description' short_url: example_category_1 - item_tag: ItemTag1 + item_tag: '' votetype: '1' + votevalue: '' - itemid: '2' categoryid: '2' - title: 'Article 2' + title: 'Article 2 (Like/Dislike rating)' subtitle: 'Subtitle Teaser 2' summary: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
' body: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
' @@ -41,8 +42,8 @@ datesub: '1486997400' dateexpire: '0' status: '2' - image: '2' - images: '2' + image: '0' + images: '' counter: '240' rating: '0.0000' votes: '1' @@ -58,12 +59,13 @@ meta_keywords: 'XOOPS,Publisher' meta_description: 'This is a Meta Description' short_url: example_category_1 - item_tag: ItemTag2 + item_tag: '' votetype: '3' + votevalue: '' - itemid: '3' categoryid: '3' - title: 'Article 3' + title: 'Article 3 (Like/Dislike rating)' subtitle: 'Subtitle Teaser 3' summary: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
' body: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
' @@ -72,8 +74,8 @@ datesub: '1486997400' dateexpire: '0' status: '2' - image: '3' - images: '3' + image: '0' + images: '' counter: '93' rating: '0.0000' votes: '1' @@ -89,22 +91,23 @@ meta_keywords: 'XOOPS,Publisher' meta_description: 'This is a Meta Description' short_url: example_category_1 - item_tag: ItemTag3 + item_tag: '' votetype: '3' + votevalue: '' - itemid: '4' categoryid: '1' - title: 'Article 4' + title: 'Article 4 (5 Star rating)' subtitle: 'Subtitle Teaser 4' - summary: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.' - body: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.' + summary: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
' + body: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
' uid: '1' author_alias: '' datesub: '1486990200' dateexpire: '0' status: '2' - image: '1' - images: '1' + image: '0' + images: '' counter: '532' rating: '0.0000' votes: '1' @@ -120,14 +123,15 @@ meta_keywords: 'XOOPS,Publisher' meta_description: 'This is a Meta Description' short_url: example_category_1 - item_tag: ItemTag4 - votetype: '4' + item_tag: '' + votetype: '1' + votevalue: '' - itemid: '5' categoryid: '2' - title: 'Article 5' + title: 'Article 5 (Reactions rating)' subtitle: 'Subtitle Teaser 5' - summary: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. ' + summary: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.' body: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.' uid: '1' author_alias: '' @@ -151,12 +155,13 @@ meta_keywords: 'XOOPS,Publisher' meta_description: 'This is a Meta Description' short_url: example_category_5 - item_tag: ItemTag5 + item_tag: '' votetype: '5' + votevalue: '' - itemid: '6' categoryid: '1' - title: 'Heart of Darkness, by Joseph Conrad' + title: 'Heart of Darkness, by Joseph Conrad (Like/Dislike rating)' subtitle: '' summary: 'Heart of Darkness, by Joseph Conrad
' body: 'The Nellie, a cruising yawl, swung to her anchor without a flutter of the sails, and was at rest. The flood had made, the wind was nearly calm, and being bound down the river, the only thing for it was to come to and wait for the turn of the tide.
The sea-reach of the Thames stretched before us like the beginning of an interminable waterway. In the offing the sea and the sky were welded together without a joint, and in the luminous space the tanned sails of the barges drifting up with the tide seemed to stand still in red clusters of canvas sharply peaked, with gleams of varnished sprits. A haze rested on the low shores that ran out to sea in vanishing flatness. The air was dark above Gravesend, and farther back still seemed condensed into a mournful gloom, brooding motionless over the biggest, and the greatest, town on earth.
The Director of Companies was our captain and our host. We four affectionately watched his back as he stood in the bows looking to seaward. On the whole river there was nothing that looked half so nautical. He resembled a pilot, which to a seaman is trustworthiness personified. It was difficult to realize his work was not out there in the luminous estuary, but behind him, within the brooding gloom.
Between us there was, as I have already said somewhere, the bond of the sea. Besides holding our hearts together through long periods of separation, it had the effect of making us tolerant of each other’s yarns—and even convictions. The Lawyer—the best of old fellows—had, because of his many years and many virtues, the only cushion on deck, and was lying on the only rug. The Accountant had brought out already a box of dominoes, and was toying architecturally with the bones. Marlow sat cross-legged right aft, leaning against the mizzen-mast. He had sunken cheeks, a yellow complexion, a straight back, an ascetic aspect, and, with his arms dropped, the palms of hands outwards, resembled an idol. The director, satisfied the anchor had good hold, made his way aft and sat down amongst us. We exchanged a few words lazily. Afterwards there was silence on board the yacht. For some reason or other we did not begin that game of dominoes. We felt meditative, and fit for nothing but placid staring. The day was ending in a serenity of still and exquisite brilliance. The water shone pacifically; the sky, without a speck, was a benign immensity of unstained light; the very mist on the Essex marsh was like a gauzy and radiant fabric, hung from the wooded rises inland, and draping the low shores in diaphanous folds. Only the gloom to the west, brooding over the upper reaches, became more sombre every minute, as if angered by the approach of the sun.
And at last, in its curved and imperceptible fall, the sun sank low, and from glowing white changed to a dull red without rays and without heat, as if about to go out suddenly, stricken to death by the touch of that gloom brooding over a crowd of men.
Forthwith a change came over the waters, and the serenity became less brilliant but more profound. The old river in its broad reach rested unruffled at the decline of day, after ages of good service done to the race that peopled its banks, spread out in the tranquil dignity of a waterway leading to the uttermost ends of the earth. We looked at the venerable stream not in the vivid flush of a short day that comes and departs for ever, but in the august light of abiding memories. And indeed nothing is easier for a man who has, as the phrase goes, “followed the sea” with reverence and affection, than to evoke the great spirit of the past upon the lower reaches of the Thames. The tidal current runs to and fro in its unceasing service, crowded with memories of men and ships it had borne to the rest of home or to the battles of the sea. It had known and served all the men of whom the nation is proud, from Sir Francis Drake to Sir John Franklin, knights all, titled and untitled—the great knights-errant of the sea. It had borne all the ships whose names are like jewels flashing in the night of time, from the Golden Hind returning with her rotund flanks full of treasure, to be visited by the Queen’s Highness and thus pass out of the gigantic tale, to the Erebus and Terror, bound on other conquests—and that never returned. It had known the ships and the men. They had sailed from Deptford, from Greenwich, from Erith—the adventurers and the settlers; kings’ ships and the ships of men on ‘Change; captains, admirals, the dark “interlopers” of the Eastern trade, and the commissioned “generals” of East India fleets. Hunters for gold or pursuers of fame, they all had gone out on that stream, bearing the sword, and often the torch, messengers of the might within the land, bearers of a spark from the sacred fire. What greatness had not floated on the ebb of that river into the mystery of an unknown earth!… The dreams of men, the seed of commonwealths, the germs of empires.
The sun set; the dusk fell on the stream, and lights began to appear along the shore. The Chapman light-house, a three-legged thing erect on a mud-flat, shone strongly. Lights of ships moved in the fairway—a great stir of lights going up and going down. And farther west on the upper reaches the place of the monstrous town was still marked ominously on the sky, a brooding gloom in sunshine, a lurid glare under the stars.
“And this also,” said Marlow suddenly, “has been one of the dark places of the earth.”
He was the only man of us who still “followed the sea.” The worst that could be said of him was that he did not represent his class. He was a seaman, but he was a wanderer, too, while most seamen lead, if one may so express it, a sedentary life. Their minds are of the stay-at-home order, and their home is always with them—the ship; and so is their country—the sea. One ship is very much like another, and the sea is always the same. In the immutability of their surroundings the foreign shores, the foreign faces, the changing immensity of life, glide past, veiled not by a sense of mystery but by a slightly disdainful ignorance; for there is nothing mysterious to a seaman unless it be the sea itself, which is the mistress of his existence and as inscrutable as Destiny. For the rest, after his hours of work, a casual stroll or a casual spree on shore suffices to unfold for him the secret of a whole continent, and generally he finds the secret not worth knowing. The yarns of seamen have a direct simplicity, the whole meaning of which lies within the shell of a cracked nut. But Marlow was not typical (if his propensity to spin yarns be excepted), and to him the meaning of an episode was not inside like a kernel but outside, enveloping the tale which brought it out only as a glow brings out a haze, in the likeness of one of these misty halos that sometimes are made visible by the spectral illumination of moonshine.
His remark did not seem at all surprising. It was just like Marlow. It was accepted in silence. No one took the trouble to grunt even; and presently he said, very slow—“I was thinking of very old times, when the Romans first came here, nineteen hundred years ago—the other day …. Light came out of this river since—you say Knights? Yes; but it is like a running blaze on a plain, like a flash of lightning in the clouds. We live in the flicker—may it last as long as the old earth keeps rolling! But darkness was here yesterday. Imagine the feelings of a commander of a fine—what d’ye call ‘em?—trireme in the Mediterranean, ordered suddenly to the north; run overland across the Gauls in a hurry; put in charge of one of these craft the legionaries—a wonderful lot of handy men they must have been, too—used to build, apparently by the hundred, in a month or two, if we may believe what we read. Imagine him here—the very end of the world, a sea the colour of lead, a sky the colour of smoke, a kind of ship about as rigid as a concertina—and going up this river with stores, or orders, or what you like. Sand-banks, marshes, forests, savages,—precious little to eat fit for a civilized man, nothing but Thames water to drink. No Falernian wine here, no going ashore. Here and there a military camp lost in a wilderness, like a needle in a bundle of hay—cold, fog, tempests, disease, exile, and death—death skulking in the air, in the water, in the bush. They must have been dying like flies here. Oh, yes—he did it. Did it very well, too, no doubt, and without thinking much about it either, except afterwards to brag of what he had gone through in his time, perhaps. They were men enough to face the darkness. And perhaps he was cheered by keeping his eye on a chance of promotion to the fleet at Ravenna by and by, if he had good friends in Rome and survived the awful climate. Or think of a decent young citizen in a toga—perhaps too much dice, you know—coming out here in the train of some prefect, or tax-gatherer, or trader even, to mend his fortunes. Land in a swamp, march through the woods, and in some inland post feel the savagery, the utter savagery, had closed round him—all that mysterious life of the wilderness that stirs in the forest, in the jungles, in the hearts of wild men. There’s no initiation either into such mysteries. He has to live in the midst of the incomprehensible, which is also detestable. And it has a fascination, too, that goes to work upon him. The fascination of the abomination—you know, imagine the growing regrets, the longing to escape, the powerless disgust, the surrender, the hate.”
' @@ -181,13 +186,14 @@ notifypub: '0' meta_keywords: 'nthnthnth,dnthd,nhtd,ntdthd,nthd,nthdnthd,ntgdhnd,ntdnthdngtd' meta_description: 'tnh dnthd nhtd nhtd ntdthd nthd nthdnthd ntgdhnd ntdnthdngtd' - short_url: '' - item_tag: 'Theme, Bootstrap, jQuery, bootnewage' + short_url: heart-of-darkness-by-joseph-conrad-like-dislike-rating + item_tag: '' votetype: '3' + votevalue: '' - itemid: '7' categoryid: '5' - title: 'Test Expiration Date' + title: 'Test Expiration Date (Like/Dislike rating)' subtitle: '' summary: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
' body: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
' @@ -215,10 +221,11 @@ short_url: test-di item_tag: '' votetype: '3' + votevalue: '' - itemid: '8' categoryid: '5' - title: 'Test DI FUTURE' + title: 'Test DI FUTURE (10 Star rating)' subtitle: '' summary: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
' body: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
' @@ -227,8 +234,8 @@ datesub: '1553701200' dateexpire: '0' status: '2' - image: '4' - images: '4' + image: '0' + images: '' counter: '361' rating: '0.0000' votes: '1' @@ -246,10 +253,11 @@ short_url: test-di-future item_tag: '' votetype: '2' + votevalue: '' - itemid: '9' categoryid: '5' - title: 'Test DI' + title: 'Test DI (Like/Dislike rating)' subtitle: '' summary: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
' body: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
' @@ -258,9 +266,9 @@ datesub: '1551368400' dateexpire: '0' status: '2' - image: '4' - images: '4' - counter: '224' + image: '0' + images: '' + counter: '233' rating: '0.0000' votes: '1' weight: '0' @@ -277,10 +285,11 @@ short_url: test-di item_tag: '' votetype: '3' + votevalue: '' - itemid: '10' categoryid: '5' - title: 'Test OFFLINE' + title: 'Test OFFLINE (5 Star rating)' subtitle: '' summary: 'This is on OFFLINE article
' body: 'This is on OFFLINE article
Est primus bursa, cesaris.A falsis, luna albus abactus.A falsis, absolutio lotus barcas.Nomen de azureus nixus, promissio detrius!Onuss trabem in mare!' @@ -308,10 +317,11 @@ short_url: test-offline item_tag: '' votetype: '1' + votevalue: '' - itemid: '11' categoryid: '5' - title: 'Test Approval' + title: 'Test Approval (Reactions)' subtitle: '' summary: '
Messors trabem in tectum!Indexs sunt caniss de bi-color lactea.
Racanas unda!
sth st hsth
' body: 'tnhsnth sthstnh th
' @@ -339,10 +349,11 @@ short_url: test-approval item_tag: '' votetype: '5' + votevalue: '' - itemid: '12' categoryid: '1' - title: 'Submitted New Article' + title: 'Submitted New Article (5 Star rating)' subtitle: 'Waiting for Approval' summary: 'Est primus bursa, cesaris.A falsis, luna albus abactus.A falsis, absolutio lotus barcas.Nomen de azureus nixus, promissio detrius!Onuss trabem in mare!' body: '
Est primus bursa, cesaris.A falsis, luna albus abactus.A falsis, absolutio lotus barcas.Nomen de azureus nixus, promissio detrius!Onuss trabem in mare!Messors trabem in tectum!Indexs sunt caniss de bi-color lactea.Racanas unda!' @@ -370,10 +381,11 @@ short_url: submitted_new item_tag: '' votetype: '1' + votevalue: '' - itemid: '13' categoryid: '5' - title: 'Rejected Article' + title: 'Rejected Article (5 Star rating)' subtitle: '' summary: '
This is a rejected article
' body: 'This is a rejected article' @@ -401,3 +413,36 @@ short_url: rejected item_tag: '' votetype: '1' + votevalue: '' +- + itemid: '14' + categoryid: '1' + title: '10 Numbers rating' + subtitle: '' + summary: '
Est primus bursa, cesaris.A falsis, luna albus abactus.A falsis, absolutio lotus barcas.Nomen de azureus nixus, promissio detrius!Onuss trabem in mare!Messors trabem in tectum!Indexs sunt caniss de bi-color lactea.Racanas unda!
xxx htdnthdnthd nthd
' + body: 'tnhd nthdnthdtnhd
' + uid: '1' + author_alias: '' + datesub: '1610439000' + dateexpire: '0' + status: '2' + image: '0' + images: '' + counter: '0' + rating: '0.0000' + votes: '0' + weight: '0' + dohtml: '1' + dosmiley: '1' + doxcode: '1' + doimage: '1' + dobr: '1' + cancomment: '1' + comments: '0' + notifypub: '0' + meta_keywords: 'xxxx,htdnthdnthd,nthd' + meta_description: 'xxx htdnthdnthd nthd' + short_url: xxxx + item_tag: '' + votetype: '4' + votevalue: '' diff --git a/testdata/english/publisher_rating.yml b/testdata/english/publisher_rating.yml index 5fb31370..9998e8d8 100644 --- a/testdata/english/publisher_rating.yml +++ b/testdata/english/publisher_rating.yml @@ -1,6 +1,6 @@ - ratingid: '1' - itemid: '1' + itemid: '3' uid: '1' rate: '1' date: '1600080372' @@ -9,7 +9,7 @@ votetype: '3' - ratingid: '2' - itemid: '2' + itemid: '9' uid: '1' rate: '-1' date: '1600081774' @@ -18,7 +18,7 @@ votetype: '3' - ratingid: '3' - itemid: '1' + itemid: '9' uid: '2' rate: '1' date: '1600082767' @@ -27,7 +27,7 @@ votetype: '3' - ratingid: '4' - itemid: '2' + itemid: '6' uid: '1' rate: '1' date: '1600166527' @@ -77,11 +77,11 @@ rate: '1' date: '1600170106' ip: 78.83.87.210 - source: '3' + source: '1' votetype: '3' - ratingid: '10' - itemid: '2' + itemid: '6' uid: '6' rate: '-1' date: '1600170151' @@ -90,7 +90,7 @@ votetype: '3' - ratingid: '11' - itemid: '2' + itemid: '9' uid: '7' rate: '-1' date: '1603038378' @@ -135,7 +135,7 @@ votetype: '3' - ratingid: '16' - itemid: '2' + itemid: '1' uid: '5' rate: '1' date: '1603083350' @@ -144,7 +144,7 @@ votetype: '1' - ratingid: '17' - itemid: '2' + itemid: '10' uid: '5' rate: '1' date: '1603083452' @@ -153,7 +153,7 @@ votetype: '1' - ratingid: '18' - itemid: '7' + itemid: '13' uid: '5' rate: '1' date: '1603083468' @@ -198,16 +198,16 @@ votetype: '3' - ratingid: '23' - itemid: '7' + itemid: '6' uid: '5' - rate: '4' + rate: '1' date: '1603084835' ip: '' source: '1' votetype: '3' - ratingid: '24' - itemid: '1' + itemid: '6' uid: '5' rate: '-1' date: '1603086728' @@ -225,7 +225,7 @@ votetype: '1' - ratingid: '26' - itemid: '0' + itemid: '1' uid: '0' rate: '5' date: '1603087380' @@ -249,55 +249,55 @@ date: '1603413237' ip: '' source: '1' - votetype: '1' + votetype: '2' - ratingid: '29' itemid: '8' uid: '0' - rate: '-1' + rate: '3' date: '1603413247' ip: '' source: '1' - votetype: '1' + votetype: '2' - ratingid: '30' itemid: '8' uid: '0' - rate: '-1' + rate: '8' date: '1603413248' ip: '' source: '1' - votetype: '1' + votetype: '2' - ratingid: '31' - itemid: '8' + itemid: '4' uid: '0' - rate: '-1' + rate: '4' date: '1603413249' ip: '' source: '1' votetype: '1' - ratingid: '32' - itemid: '5' + itemid: '10' uid: '0' - rate: '1' + rate: '2' date: '1603424515' ip: '' source: '1' votetype: '1' - ratingid: '33' - itemid: '5' + itemid: '9' uid: '0' rate: '-1' date: '1603424520' ip: '' source: '1' - votetype: '1' + votetype: '3' - ratingid: '34' - itemid: '5' + itemid: '13' uid: '0' rate: '1' date: '1603424828' @@ -306,16 +306,16 @@ votetype: '1' - ratingid: '35' - itemid: '5' + itemid: '3' uid: '0' rate: '-1' date: '1603424834' ip: '' source: '1' - votetype: '1' + votetype: '3' - ratingid: '36' - itemid: '6' + itemid: '1' uid: '0' rate: '1' date: '1603425156' @@ -324,7 +324,7 @@ votetype: '1' - ratingid: '37' - itemid: '6' + itemid: '10' uid: '0' rate: '1' date: '1603425167' @@ -339,7 +339,7 @@ date: '1603425175' ip: '' source: '1' - votetype: '1' + votetype: '3' - ratingid: '39' itemid: '6' @@ -348,10 +348,10 @@ date: '1603425201' ip: '' source: '1' - votetype: '1' + votetype: '3' - ratingid: '40' - itemid: '6' + itemid: '4' uid: '0' rate: '1' date: '1603425246' @@ -360,7 +360,7 @@ votetype: '1' - ratingid: '41' - itemid: '6' + itemid: '4' uid: '0' rate: '1' date: '1603426430' @@ -369,16 +369,16 @@ votetype: '1' - ratingid: '42' - itemid: '6' + itemid: '11' uid: '0' rate: '1' date: '1603426491' ip: '' source: '1' - votetype: '1' + votetype: '5' - ratingid: '43' - itemid: '6' + itemid: '13' uid: '0' rate: '1' date: '1603426589' @@ -387,7 +387,7 @@ votetype: '1' - ratingid: '44' - itemid: '6' + itemid: '1' uid: '5' rate: '1' date: '1603426722' @@ -396,7 +396,7 @@ votetype: '1' - ratingid: '45' - itemid: '6' + itemid: '4' uid: '2' rate: '1' date: '1603426746' @@ -405,7 +405,7 @@ votetype: '1' - ratingid: '46' - itemid: '6' + itemid: '4' uid: '1' rate: '1' date: '1603426945' @@ -414,16 +414,16 @@ votetype: '1' - ratingid: '47' - itemid: '5' + itemid: '12' uid: '1' - rate: '7' + rate: '5' date: '1603430099' ip: '' source: '1' votetype: '1' - ratingid: '48' - itemid: '7' + itemid: '1' uid: '1' rate: '1' date: '1608463542' @@ -432,7 +432,7 @@ votetype: '1' - ratingid: '49' - itemid: '7' + itemid: '12' uid: '0' rate: '2' date: '1608464480' @@ -441,7 +441,7 @@ votetype: '1' - ratingid: '50' - itemid: '7' + itemid: '13' uid: '0' rate: '3' date: '1608464495' @@ -450,7 +450,7 @@ votetype: '1' - ratingid: '51' - itemid: '7' + itemid: '4' uid: '0' rate: '2' date: '1608465043' @@ -459,25 +459,25 @@ votetype: '1' - ratingid: '52' - itemid: '0' + itemid: '3' uid: '0' rate: '-1' date: '1608535960' ip: '' source: '1' - votetype: '1' + votetype: '3' - ratingid: '53' - itemid: '0' + itemid: '10' uid: '0' - rate: '1' + rate: '3' date: '1608535984' ip: '' source: '1' votetype: '1' - ratingid: '54' - itemid: '0' + itemid: '1' uid: '0' rate: '1' date: '1608536072' @@ -486,16 +486,16 @@ votetype: '1' - ratingid: '55' - itemid: '0' + itemid: '4' uid: '0' - rate: '1' + rate: '5' date: '1608536080' ip: '' source: '1' votetype: '1' - ratingid: '56' - itemid: '0' + itemid: '1' uid: '0' rate: '1' date: '1608536311' @@ -504,7 +504,7 @@ votetype: '1' - ratingid: '57' - itemid: '0' + itemid: '12' uid: '0' rate: '1' date: '1608536378' @@ -513,16 +513,16 @@ votetype: '1' - ratingid: '58' - itemid: '0' + itemid: '14' uid: '0' - rate: '1' + rate: '7' date: '1608536854' ip: '' source: '1' - votetype: '1' + votetype: '4' - ratingid: '59' - itemid: '0' + itemid: '1' uid: '0' rate: '1' date: '1608536926' @@ -531,13 +531,13 @@ votetype: '1' - ratingid: '60' - itemid: '9' + itemid: '14' uid: '0' - rate: '1' + rate: '9' date: '1608537199' ip: '' source: '1' - votetype: '1' + votetype: '4' - ratingid: '61' itemid: '9' @@ -546,7 +546,7 @@ date: '1608537299' ip: '' source: '1' - votetype: '1' + votetype: '3' - ratingid: '62' itemid: '9' @@ -555,7 +555,7 @@ date: '1608537304' ip: '' source: '1' - votetype: '1' + votetype: '3' - ratingid: '63' itemid: '9' @@ -564,97 +564,97 @@ date: '1608537309' ip: '' source: '1' - votetype: '1' + votetype: '3' - ratingid: '64' - itemid: '7' + itemid: '9' uid: '0' rate: '-1' date: '1608565406' ip: '' source: '1' - votetype: '1' + votetype: '3' - ratingid: '65' - itemid: '0' - uid: '0' + itemid: '9' + uid: '2' rate: '-1' date: '1608870150' ip: '' source: '1' - votetype: '1' + votetype: '3' - ratingid: '66' itemid: '6' - uid: '0' + uid: '1' rate: '-1' date: '1608870194' ip: '' source: '1' - votetype: '1' + votetype: '3' - ratingid: '67' - itemid: '6' - uid: '0' + itemid: '9' + uid: '1' rate: '-1' date: '1608870207' ip: '' source: '1' - votetype: '1' + votetype: '3' - ratingid: '68' itemid: '7' - uid: '0' + uid: '2' rate: '-1' date: '1608883620' ip: '' source: '1' - votetype: '1' + votetype: '3' - ratingid: '69' itemid: '7' - uid: '0' - rate: '-1' + uid: '1' + rate: '1' date: '1608884456' ip: '' source: '1' - votetype: '1' + votetype: '3' - ratingid: '70' - itemid: '7' - uid: '0' + itemid: '2' + uid: '2' rate: '-1' date: '1608884803' ip: '' source: '1' - votetype: '1' + votetype: '3' - ratingid: '71' itemid: '7' - uid: '0' + uid: '1' rate: '-1' date: '1608885197' ip: '::1' source: '1' - votetype: '1' + votetype: '3' - ratingid: '72' itemid: '7' - uid: '0' + uid: '2' rate: '-1' date: '1608885231' ip: '::1' source: '1' - votetype: '1' + votetype: '3' - ratingid: '73' itemid: '7' - uid: '0' + uid: '1' rate: '-1' date: '1608885237' ip: '::1' source: '1' - votetype: '1' + votetype: '3' - ratingid: '74' itemid: '7' @@ -663,7 +663,7 @@ date: '1608885306' ip: '::1' source: '1' - votetype: '1' + votetype: '3' - ratingid: '75' itemid: '7' @@ -672,10 +672,10 @@ date: '1608885318' ip: '::1' source: '1' - votetype: '1' + votetype: '3' - ratingid: '76' - itemid: '7' + itemid: '1' uid: '1' rate: '1' date: '1608886477' @@ -684,27 +684,27 @@ votetype: '1' - ratingid: '77' - itemid: '7' + itemid: '13' uid: '1' - rate: '1' + rate: '4' date: '1608886483' ip: '::1' source: '1' votetype: '1' - ratingid: '78' - itemid: '7' + itemid: '12' uid: '1' - rate: '1' + rate: '3' date: '1608886571' ip: '::1' source: '1' votetype: '1' - ratingid: '79' - itemid: '7' + itemid: '4' uid: '1' - rate: '1' + rate: '2' date: '1608886586' ip: '::1' source: '1' @@ -717,12 +717,12 @@ date: '1608886592' ip: '::1' source: '1' - votetype: '1' + votetype: '3' - ratingid: '81' - itemid: '7' + itemid: '1' uid: '1' - rate: '1' + rate: '5' date: '1608887202' ip: '::1' source: '1' @@ -735,12 +735,12 @@ date: '1609066427' ip: '::1' source: '1' - votetype: '3' + votetype: '5' - ratingid: '83' - itemid: '7' + itemid: '4' uid: '3' - rate: '9' + rate: '4' date: '1608888776' ip: '::1' source: '1' @@ -749,20 +749,20 @@ ratingid: '85' itemid: '11' uid: '2' - rate: '2' + rate: '3' date: '1609070268' ip: '::1' source: '1' - votetype: '1' + votetype: '5' - ratingid: '86' itemid: '11' uid: '3' - rate: '2' + rate: '6' date: '1609070323' ip: '::1' source: '1' - votetype: '1' + votetype: '5' - ratingid: '87' itemid: '9' @@ -771,7 +771,7 @@ date: '1609070360' ip: '::1' source: '1' - votetype: '1' + votetype: '3' - ratingid: '88' itemid: '9' @@ -780,12 +780,12 @@ date: '1609070367' ip: '::1' source: '1' - votetype: '1' + votetype: '3' - ratingid: '89' itemid: '4' uid: '1' - rate: '8' + rate: '5' date: '1609072806' ip: '::1' source: '1' @@ -812,7 +812,7 @@ ratingid: '92' itemid: '4' uid: '2' - rate: '10' + rate: '3' date: '1609073097' ip: '::1' source: '1' @@ -873,9 +873,9 @@ votetype: '1' - ratingid: '861' - itemid: '3' + itemid: '10' uid: '1' - rate: '1' + rate: '5' date: '1609520318' ip: '::1' source: '1' @@ -888,7 +888,7 @@ date: '1609521721' ip: '::1' source: '1' - votetype: '1' + votetype: '3' - ratingid: '863' itemid: '6' @@ -897,28 +897,28 @@ date: '1609536526' ip: '::1' source: '1' - votetype: '1' + votetype: '3' - ratingid: '864' - itemid: '6' + itemid: '1' uid: '1' - rate: '-1' + rate: '4' date: '1609536980' ip: '::1' source: '1' votetype: '1' - ratingid: '865' - itemid: '6' + itemid: '10' uid: '1' - rate: '-1' + rate: '1' date: '1609537043' ip: '::1' source: '1' votetype: '1' - ratingid: '866' - itemid: '6' + itemid: '12' uid: '1' rate: '1' date: '1609537049' @@ -933,22 +933,85 @@ date: '1609537199' ip: '::1' source: '1' - votetype: '1' + votetype: '2' - ratingid: '868' itemid: '8' uid: '1' - rate: '10' + rate: '9' date: '1609537205' ip: '::1' source: '1' - votetype: '1' + votetype: '2' - ratingid: '869' - itemid: '8' + itemid: '14' uid: '1' - rate: '10' + rate: '2' date: '1609537211' ip: '::1' source: '1' + votetype: '4' +- + ratingid: '871' + itemid: '14' + uid: '1' + rate: '8' + date: '1610504760' + ip: '::1' + source: '1' + votetype: '4' +- + ratingid: '872' + itemid: '10' + uid: '1' + rate: '2' + date: '1613037798' + ip: '::1' + source: '1' + votetype: '1' +- + ratingid: '873' + itemid: '11' + uid: '1' + rate: '5' + date: '1613046112' + ip: '::1' + source: '1' votetype: '1' +- + ratingid: '874' + itemid: '5' + uid: '1' + rate: '2' + date: '1613046453' + ip: '::1' + source: '1' + votetype: '5' +- + ratingid: '875' + itemid: '5' + uid: '1' + rate: '4' + date: '1613046883' + ip: '::1' + source: '1' + votetype: '5' +- + ratingid: '876' + itemid: '5' + uid: '1' + rate: '6' + date: '1613047333' + ip: '::1' + source: '1' + votetype: '5' +- + ratingid: '877' + itemid: '5' + uid: '1' + rate: '6' + date: '1613047510' + ip: '::1' + source: '1' + votetype: '5' diff --git a/testdata/index.html b/testdata/index.html deleted file mode 100644 index 2c5cdd3f..00000000 --- a/testdata/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/testdata/index.php b/testdata/index.php index bcacb54a..4ec2fdb9 100644 --- a/testdata/index.php +++ b/testdata/index.php @@ -17,21 +17,22 @@ */ use Xmf\Database\TableLoad; -use \Xmf\Request; +use Xmf\Request; +use Xmf\Yaml; use XoopsModules\Publisher\{Helper, - Common, + Common\Configurator, Utility }; -use Xmf\Yaml; - /** @var Helper $helper */ +/** @var Utility $utility */ +/** @var Configurator $configurator */ -require_once dirname(__DIR__, 3) . '/include/cp_header.php'; -require dirname(__DIR__) . '/preloads/autoloader.php'; +require \dirname(__DIR__, 3) . '/include/cp_header.php'; +require \dirname(__DIR__) . '/preloads/autoloader.php'; $op = Request::getCmd('op', ''); -$moduleDirName = basename(dirname(__DIR__)); +$moduleDirName = \basename(\dirname(__DIR__)); $moduleDirNameUpper = mb_strtoupper($moduleDirName); $helper = Helper::getInstance(); @@ -47,13 +48,16 @@ loadSampleData(); } else { xoops_cp_header(); - xoops_confirm(['ok' => 1, 'op' => 'load'], 'index.php', sprintf(constant('CO_' . $moduleDirNameUpper . '_' . 'ADD_SAMPLEDATA_OK')), constant('CO_' . $moduleDirNameUpper . '_' . 'CONFIRM'), true); + xoops_confirm(['ok' => 1, 'op' => 'load'], 'index.php', sprintf(constant('CO_' . $moduleDirNameUpper . '_' . 'LOAD_SAMPLEDATA_CONFIRM')), constant('CO_' . $moduleDirNameUpper . '_' . 'CONFIRM'), true); xoops_cp_footer(); } break; case 'save': saveSampleData(); break; + case 'clear': + clearSampleData(); + break; } // XMF TableLoad for SAMPLE data @@ -61,12 +65,11 @@ function loadSampleData() { global $xoopsConfig; - $moduleDirName = basename(dirname(__DIR__)); + $moduleDirName = \basename(\dirname(__DIR__)); $moduleDirNameUpper = mb_strtoupper($moduleDirName); $utility = new Utility(); - $configurator = new Common\Configurator(); - $helper = Helper::getInstance(); + $configurator = new Configurator(); $tables = \Xmf\Module\Helper::getHelper($moduleDirName)->getModule()->getInfo('tables'); @@ -85,30 +88,28 @@ function loadSampleData() // load permissions $table = 'group_permission'; $tabledata = Yaml::readWrapped($language . $table . '.yml'); - $moduleId = $helper->getModule()->getVar('mid'); - loadTableFromArrayWithReplace($table, $tabledata, 'gperm_modid', $moduleId); + $mid = \Xmf\Module\Helper::getHelper($moduleDirName)->getModule()->getVar('mid'); + loadTableFromArrayWithReplace($table, $tabledata, 'gperm_modid', $mid); // --- COPY test folder files --------------- if (is_array($configurator->copyTestFolders) && count($configurator->copyTestFolders) > 0) { - // $file = dirname(__DIR__) . '/testdata/images/'; + // $file = \dirname(__DIR__) . '/testdata/images/'; foreach (array_keys($configurator->copyTestFolders) as $i) { $src = $configurator->copyTestFolders[$i][0]; $dest = $configurator->copyTestFolders[$i][1]; $utility::rcopy($src, $dest); } } - \redirect_header('../admin/index.php', 1, \constant('CO_' . $moduleDirNameUpper . '_' . 'SAVE_SAMPLEDATA_SUCCESS')); + \redirect_header('../admin/index.php', 1, \constant('CO_' . $moduleDirNameUpper . '_' . 'LOAD_SAMPLEDATA_SUCCESS')); } function saveSampleData() { global $xoopsConfig; - $moduleDirName = basename(dirname(__DIR__)); + $moduleDirName = \basename(\dirname(__DIR__)); $moduleDirNameUpper = mb_strtoupper($moduleDirName); $helper = Helper::getInstance(); - $moduleId = $helper->getModule()->getVar('mid'); - - $tables = $helper->getModule()->getInfo('tables'); + $tables = $helper->getModule()->getInfo('tables'); $languageFolder = __DIR__ . '/' . $xoopsConfig['language']; if (!file_exists($languageFolder . '/')) { @@ -124,7 +125,7 @@ function saveSampleData() // save permissions $criteria = new \CriteriaCompo(); - $criteria->add(new \Criteria('gperm_modid', $moduleId)); + $criteria->add(new \Criteria('gperm_modid', $helper->getModule()->getVar('mid'))); $skipColumns[] = 'gperm_id'; TableLoad::saveTableToYamlFile('group_permission', $exportFolder . 'group_permission.yml', $criteria, $skipColumns); unset($criteria); @@ -134,7 +135,7 @@ function saveSampleData() function exportSchema() { - $moduleDirName = basename(dirname(__DIR__)); + $moduleDirName = \basename(\dirname(__DIR__)); $moduleDirNameUpper = mb_strtoupper($moduleDirName); try { @@ -202,3 +203,17 @@ function loadTableFromArrayWithReplace($table, $data, $search, $replace) return $count; } + +function clearSampleData(){ + $moduleDirName = \basename(\dirname(__DIR__)); + $moduleDirNameUpper = mb_strtoupper($moduleDirName); + $helper = Helper::getInstance(); + // Load language files + $helper->loadLanguage('common'); + $tables = $helper->getModule()->getInfo('tables'); + // truncate module tables + foreach ($tables as $table) { + \Xmf\Database\TableLoad::truncateTable($table); + } + redirect_header($helper->url('admin/index.php'), 1, constant('CO_' . $moduleDirNameUpper . '_' . 'CLEAR_SAMPLEDATA_OK')); +} diff --git a/tests/index.html b/tests/index.html deleted file mode 100644 index 74b6f45c..00000000 --- a/tests/index.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/tests/index.php b/tests/index.php new file mode 100644 index 00000000..4ae18fd0 --- /dev/null +++ b/tests/index.php @@ -0,0 +1,2 @@ +setVar('uid', $itemRating['uid']); $voteObj->setVar('ip', $itemRating['ip']); $voteObj->setVar('date', \time()); + $voteObj->setVar('votetype', $votingType); // Insert Data if ($voteHandler->insert($voteObj)) { unset($voteObj); diff --git a/xoops_version.php b/xoops_version.php index 0c7bc534..c0f22915 100644 --- a/xoops_version.php +++ b/xoops_version.php @@ -36,8 +36,8 @@ $modversion = [ 'version' => '1.08', - 'module_status' => 'Alpha 4', - 'release_date' => '2021/01/12', + 'module_status' => 'Alpha 5', + 'release_date' => '2021/08/08', 'name' => _MI_PUBLISHER_MD_NAME, 'description' => _MI_PUBLISHER_MD_DESC, 'author' => 'Trabis (www.Xuups.com)', @@ -62,7 +62,7 @@ 'onInstall' => 'include/oninstall.php', 'onUpdate' => 'include/onupdate.php', // ------------------- Min Requirements ------------------- - 'min_php' => '7.2', + 'min_php' => '7.3', 'min_xoops' => '2.5.10', 'min_admin' => '1.2', 'min_db' => ['mysql' => '5.5'],