From 80b617ee6222aa840a863d2e729a7c02a24b770f Mon Sep 17 00:00:00 2001 From: mambax7 Date: Sun, 14 Jun 2015 09:56:31 -0400 Subject: [PATCH 01/19] Adding GPL Label, adding plugin.tag.php --- README.md | 4 +- publisher/class/plugins/plugin.tag.php | 66 ++++++++++++++++++++++++++ 2 files changed, 68 insertions(+), 2 deletions(-) create mode 100644 publisher/class/plugins/plugin.tag.php diff --git a/README.md b/README.md index 30aa0370..22799486 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -publisher -========= +#Publisher +[![Software License](https://img.shields.io/badge/license-GPL-brightgreen.svg?style=flat)](LICENSE) Publishing module for XOOPS for static/HTML content and articles stored and provided in a hierarchical manner diff --git a/publisher/class/plugins/plugin.tag.php b/publisher/class/plugins/plugin.tag.php new file mode 100644 index 00000000..47dcc5c7 --- /dev/null +++ b/publisher/class/plugins/plugin.tag.php @@ -0,0 +1,66 @@ + + * @author The SmartFactory + * @version $Id: plugin.tag.php 10374 2012-12-12 23:39:48Z trabis $ + */ + +// defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); + +/** Get item fields: title, content, time, link, uid, uname, tags * + * + * @param $items + */ +function publisher_tag_iteminfo(&$items) +{ + $items_id = array(); + foreach (array_keys($items) as $catId) { + // Some handling here to build the link upon catid + // if catid is not used, just skip it + foreach (array_keys($items[$catId]) as $item_id) { + // In article, the item_id is "art_id" + $items_id[] = (int)($item_id); + } + } + $item_handler = xoops_getmodulehandler("item", "publisher"); + $criteria = new Criteria("itemid", "(" . implode(", ", $items_id) . ")", "IN"); + $items_obj = $item_handler->getObjects($criteria, 'itemid'); + + foreach (array_keys($items) as $catId) { + foreach (array_keys($items[$catId]) as $item_id) { + $item_obj = $items_obj[$item_id]; + $items[$catId][$item_id] = array( + "title" => $item_obj->getVar("title"), + "uid" => $item_obj->getVar("uid"), + "link" => "item.php?itemid={$item_id}", + "time" => $item_obj->getVar("datesub"), + "tags" => tag_parse_tag($item_obj->getVar("item_tag", "n")), // optional + "content" => "", + ); + } + } + unset($items_obj); +} + +/** Remove orphan tag-item links * + * @param $mid + */ +function publisher_tag_synchronization($mid) +{ + // Optional +} From 0a81f1bdcfd6b0f40885a8388445e8237eca2217 Mon Sep 17 00:00:00 2001 From: mambax7 Date: Tue, 23 Jun 2015 17:42:14 -0400 Subject: [PATCH 02/19] Add Sort by Rating, Votes --- publisher/category.php | 10 + publisher/docs/changelog.txt | 3 + publisher/index.php | 8 + publisher/item.php | 9 + publisher/language/english/modinfo.php | 622 +++++++++++++------------ publisher/xoops_version.php | 2 + 6 files changed, 344 insertions(+), 310 deletions(-) diff --git a/publisher/category.php b/publisher/category.php index 8ab7e50e..94cc077c 100644 --- a/publisher/category.php +++ b/publisher/category.php @@ -76,6 +76,16 @@ $order = 'DESC'; break; + case 'rating' : + $sort = 'rating'; + $order = 'DESC'; + break; + + case 'votes' : + $sort = 'votes'; + $order = 'DESC'; + break; + default: $sort = 'weight'; $order = 'ASC'; diff --git a/publisher/docs/changelog.txt b/publisher/docs/changelog.txt index f1541b4c..7e464dfc 100644 --- a/publisher/docs/changelog.txt +++ b/publisher/docs/changelog.txt @@ -1,3 +1,6 @@ +
1.02 RC2 (NOT RELEASED)
+- added sort by Rating, # of votes (brutalicuss/mamba) +
1.02 RC1 (2015-05-26)
- updated to XOOPS 2.5.7 version of jQuery UI Tabs (noo-b/mamba) - replaced PublisherRequest with calls to XoopsRequest (mamba) diff --git a/publisher/index.php b/publisher/index.php index 6213e9c8..92c74e04 100644 --- a/publisher/index.php +++ b/publisher/index.php @@ -150,6 +150,14 @@ $order = 'DESC'; break; + case 'rating' : + $sort = 'rating'; + $order = 'DESC'; + break; + case 'votes' : + $sort = 'votes'; + $order = 'DESC'; + break; default: $sort = 'weight'; $order = 'ASC'; diff --git a/publisher/item.php b/publisher/item.php index f551fdb2..b9c332ab 100644 --- a/publisher/item.php +++ b/publisher/item.php @@ -79,6 +79,15 @@ $order = 'DESC'; break; + case 'rating' : + $sort = 'rating'; + $order = 'DESC'; + break; + case 'votes' : + $sort = 'votes'; + $order = 'DESC'; + break; + default : $sort = 'weight'; $order = 'ASC'; diff --git a/publisher/language/english/modinfo.php b/publisher/language/english/modinfo.php index d666ae93..5ec84303 100644 --- a/publisher/language/english/modinfo.php +++ b/publisher/language/english/modinfo.php @@ -1,320 +1,322 @@ category name > article name\".
Otherwise, only \"category name > article name\" will be shown."); -define("_MI_PUBLISHER_BOTH_FOOTERS", "Both footers"); -define("_MI_PUBLISHER_BY", "by"); -define("_MI_PUBLISHER_CATEGORY_ITEM_NOTIFY", "Category Items"); -define("_MI_PUBLISHER_CATEGORY_ITEM_NOTIFY_DSC", "Notification options that apply to the current category."); -define("_MI_PUBLISHER_CATEGORY_ITEM_PUBLISHED_NOTIFY", "New article published"); -define("_MI_PUBLISHER_CATEGORY_ITEM_PUBLISHED_NOTIFY_CAP", "Notify me when a new article is published in the current category."); -define("_MI_PUBLISHER_CATEGORY_ITEM_PUBLISHED_NOTIFY_DSC", "Receive notification when a new article is published in the current category."); -define("_MI_PUBLISHER_CATEGORY_ITEM_PUBLISHED_NOTIFY_SBJ", "[{X_SITENAME}] {X_MODULE} auto-notify: New article published in category"); -define("_MI_PUBLISHER_CATEGORY_ITEM_SUBMITTED_NOTIFY", "'Article submitted"); -define("_MI_PUBLISHER_CATEGORY_ITEM_SUBMITTED_NOTIFY_CAP", "Notify me when a new article is submitted in the current category."); -define("_MI_PUBLISHER_CATEGORY_ITEM_SUBMITTED_NOTIFY_DSC", "Receive notification when a new article is submitted in the current category."); -define("_MI_PUBLISHER_CATEGORY_ITEM_SUBMITTED_NOTIFY_SBJ", "[{X_SITENAME}] {X_MODULE} auto-notify: New article submitted in category"); -define("_MI_PUBLISHER_CATLIST_IMG_W", "Category list image width"); -define("_MI_PUBLISHER_CATLIST_IMG_WDSC", "Specify the width of category images when listing the categories."); -define("_MI_PUBLISHER_CATMAINIMG_W", "Category main image width"); -define("_MI_PUBLISHER_CATMAINIMG_WDSC", "Specify the width of the category main image."); -define("_MI_PUBLISHER_CATPERPAGE", "Maximum Categories per page (User side)?"); -define("_MI_PUBLISHER_CATPERPAGEDSC", "Maximum number of top categories per page to be displayed at once in the user side?"); -define("_MI_PUBLISHER_CLONE", "Allow article duplication?"); -define("_MI_PUBLISHER_CLONEDSC", "Select “Yes” to allow users with appropriate permissions to duplicate an article."); -define("_MI_PUBLISHER_COLLHEAD", "Display the collapsible bar?"); -define("_MI_PUBLISHER_COLLHEADDSC", "If you set this option to “Yes”, the categories summary will be displayed in a collapsible bar as well as the articles. If you set this option to “No”, the collapsible bar will not be displayed."); -define("_MI_PUBLISHER_COMMENTS", "Control comments at the article level?"); -define("_MI_PUBLISHER_COMMENTSDSC", "if you set this option to “Yes”, you will see comments only on those items that have their comment checkbox marked.

Select “No” to have comments managed at the global level (look below under the tag 'Comment rules'."); -define("_MI_PUBLISHER_DATEFORMAT", "Date format:"); -define("_MI_PUBLISHER_DATEFORMATDSC", "Select a display style. Example: \"d-M-Y H:i\" translates to \"30-Mar-2004 22:35\"
Refer to the PHP manual for more display options."); -define("_MI_PUBLISHER_DEMO_SITE", "SmartFactory Demo Site"); -define("_MI_PUBLISHER_DEVELOPER_CONTRIBUTOR", "Contributor(s)"); -define("_MI_PUBLISHER_DEVELOPER_CREDITS", "Credits"); -define("_MI_PUBLISHER_DEVELOPER_EMAIL", "Email"); -define("_MI_PUBLISHER_DEVELOPER_LEAD", "Lead developer(s)"); -define("_MI_PUBLISHER_DEVELOPER_WEBSITE", "Website"); -define("_MI_PUBLISHER_DISCOM", "Display comment count?"); -define("_MI_PUBLISHER_DISCOMDSC", "Set to “Yes” to display the comments count in the individual article."); -define("_MI_PUBLISHER_DISDATECOL", "Display the 'Published on' column?"); -define("_MI_PUBLISHER_DISDATECOLDSC", "When the 'Summary' display type is selected, select “Yes” to display a “Published on” date in the items table on the index and category page."); -define("_MI_PUBLISHER_DCS", "Display the category summary?"); -define("_MI_PUBLISHER_DCS_DSC", "Select “No” to not display the category summary on a category page that has no subcategories."); -define("_MI_PUBLISHER_DISPLAYTYPE_FULL", "Full View"); -define("_MI_PUBLISHER_DISPLAYTYPE_LIST", "Bullet list"); -define("_MI_PUBLISHER_DISPLAYTYPE_WFSECTION", "WFSection style"); -define("_MI_PUBLISHER_DISPLAYTYPE_SUMMARY", "Summary View"); -define("_MI_PUBLISHER_DISSBCATDSC", "Display sub-categories description?"); -define("_MI_PUBLISHER_DISSBCATDSCDSC", "Select “Yes” to display the description of sub-categories in the index and category page."); -define("_MI_PUBLISHER_DISTYPE", "Articles display type:"); -define("_MI_PUBLISHER_DISTYPEDSC", "if “Summary View” is selected, only the Title, Date and Hits of each item will be displayed in a selected category. If “Full View” is selected, each article will be fully displayed in a selected category."); -define("_MI_PUBLISHER_FOOTERPRINT", "Print page footer"); -define("_MI_PUBLISHER_FOOTERPRINTDSC", "Footer that will be printed for each article"); -define("_MI_PUBLISHER_GLOBAL_ITEM_CATEGORY_CREATED_NOTIFY", "New category"); -define("_MI_PUBLISHER_GLOBAL_ITEM_CATEGORY_CREATED_NOTIFY_CAP", "Notify me when a new category is created."); -define("_MI_PUBLISHER_GLOBAL_ITEM_CATEGORY_CREATED_NOTIFY_DSC", "Receive notification when a new category is created."); -define("_MI_PUBLISHER_GLOBAL_ITEM_CATEGORY_CREATED_NOTIFY_SBJ", "[{X_SITENAME}] {X_MODULE} auto-notify: New category"); -define("_MI_PUBLISHER_GLOBAL_ITEM_NOTIFY", "Global Articles"); -define("_MI_PUBLISHER_GLOBAL_ITEM_NOTIFY_DSC", "Notification options that apply to all articles."); -define("_MI_PUBLISHER_GLOBAL_ITEM_PUBLISHED_NOTIFY", "New article published"); -define("_MI_PUBLISHER_GLOBAL_ITEM_PUBLISHED_NOTIFY_CAP", "Notify me when any new article is published."); -define("_MI_PUBLISHER_GLOBAL_ITEM_PUBLISHED_NOTIFY_DSC", "Receive notification when any new article is published."); -define("_MI_PUBLISHER_GLOBAL_ITEM_PUBLISHED_NOTIFY_SBJ", "[{X_SITENAME}] {X_MODULE} auto-notify: New article published"); -define("_MI_PUBLISHER_GLOBAL_ITEM_SUBMITTED_NOTIFY", "Article submitted"); -define("_MI_PUBLISHER_GLOBAL_ITEM_SUBMITTED_NOTIFY_CAP", "Notify me when any article is submitted and is awaiting approval."); -define("_MI_PUBLISHER_GLOBAL_ITEM_SUBMITTED_NOTIFY_DSC", "Receive notification when any article is submitted and is waiting approval."); -define("_MI_PUBLISHER_GLOBAL_ITEM_SUBMITTED_NOTIFY_SBJ", "[{X_SITENAME}] {X_MODULE} auto-notify: New article submitted"); -define("_MI_PUBLISHER_HEADERPRINT", "Print page header"); -define("_MI_PUBLISHER_HEADERPRINTDSC", "Header that will be printed for each article"); -define("_MI_PUBLISHER_HITSCOL", "Display the “Hits” column?"); -define("_MI_PUBLISHER_HITSCOLDSC", "When the “Summary” display type is selected, select “Yes” to display the “Hits” column in the items table on the index and category page."); -define("_MI_PUBLISHER_HLCOLOR", "Highlight color for keywords"); -define("_MI_PUBLISHER_HLCOLORDSC", "Color of the keywords highlighting for the search function."); -define("_MI_PUBLISHER_IMAGENAV", "Use the image Page Navigation:"); -define("_MI_PUBLISHER_IMAGENAVDSC", "If you set this option to “Yes”, the Page Navigation will be displayed with images, otherwise, the original Page Naviagation will be used."); -define("_MI_PUBLISHER_INDEXFOOTER", "Index Footer"); -define("_MI_PUBLISHER_INDEXFOOTER_SEL", "Index Footer"); -define("_MI_PUBLISHER_INDEXFOOTERDSC", "Footer that will be displayed at the index page of the module."); -define("_MI_PUBLISHER_INDEXMSG", "Index page welcome message:"); -define("_MI_PUBLISHER_INDEXMSGDEF", ""); -define("_MI_PUBLISHER_INDEXMSGDSC", "Welcome message to be displayed in the index page of the module."); -define("_MI_PUBLISHER_ITEM_APPROVED_NOTIFY", "Article approved"); -define("_MI_PUBLISHER_ITEM_APPROVED_NOTIFY_CAP", "Notify me when this article is approved."); -define("_MI_PUBLISHER_ITEM_APPROVED_NOTIFY_DSC", "Receive notification when this article is approved."); -define("_MI_PUBLISHER_ITEM_APPROVED_NOTIFY_SBJ", "[{X_SITENAME}] {X_MODULE} auto-notify: article approved"); -define("_MI_PUBLISHER_ITEM_NOTIFY", "Article"); -define("_MI_PUBLISHER_ITEM_NOTIFY_DSC", "Notification options that apply to the current article."); -define("_MI_PUBLISHER_ITEM_REJECTED_NOTIFY", "Article rejected"); -define("_MI_PUBLISHER_ITEM_REJECTED_NOTIFY_CAP", "Notify me if this article is rejected."); -define("_MI_PUBLISHER_ITEM_REJECTED_NOTIFY_DSC", "Receive notification if this article is rejected."); -define("_MI_PUBLISHER_ITEM_REJECTED_NOTIFY_SBJ", "[{X_SITENAME}] {X_MODULE} auto-notify: article rejected"); -define("_MI_PUBLISHER_ITEMFOOTER", "Item footer"); -define("_MI_PUBLISHER_ITEMFOOTER_SEL", "Item footer"); -define("_MI_PUBLISHER_ITEMFOOTERDSC", "Footer that will be displayed for each article."); -define("_MI_PUBLISHER_ITEMSMENU", "Categories Menu block"); +define("_MI_PUBLISHER_ADMENU1","Summary"); +define("_MI_PUBLISHER_ADMENU2","Categories"); +define("_MI_PUBLISHER_ADMENU3","Articles"); +define("_MI_PUBLISHER_ADMENU4","Permissions"); +define("_MI_PUBLISHER_ADMENU6","Mime types"); +define("_MI_PUBLISHER_ADMINHITS","Admin counter reads?"); +define("_MI_PUBLISHER_ADMINHITSDSC","Allow administrator hits for the counter stats?"); +define("_MI_PUBLISHER_ALLOWSUBMIT","User submissions?"); +define("_MI_PUBLISHER_ALLOWSUBMITDSC","Allow users to submit articles on your website?"); +define("_MI_PUBLISHER_ANONPOST","Allow anonymous posting?"); +define("_MI_PUBLISHER_ANONPOSTDSC","Allow anonymous users to submit articles?"); +define("_MI_PUBLISHER_AUTHOR_INFO","Developers"); +define("_MI_PUBLISHER_AUTHOR_WORD","The Author's Word"); +define("_MI_PUBLISHER_AUTOAPP","Auto approve submitted articles?"); +define("_MI_PUBLISHER_AUTOAPPDSC","Auto approves submitted articles without admin intervention?"); +define("_MI_PUBLISHER_BCRUMB","Show the module name in the breadcrumb?"); +define("_MI_PUBLISHER_BCRUMBDSC","If you select “Yes”, the breadcrumb will show \"Publisher > category name > article name\".
Otherwise, only \"category name > article name\" will be shown."); +define("_MI_PUBLISHER_BOTH_FOOTERS","Both footers"); +define("_MI_PUBLISHER_BY","by"); +define("_MI_PUBLISHER_CATEGORY_ITEM_NOTIFY","Category Items"); +define("_MI_PUBLISHER_CATEGORY_ITEM_NOTIFY_DSC","Notification options that apply to the current category."); +define("_MI_PUBLISHER_CATEGORY_ITEM_PUBLISHED_NOTIFY","New article published"); +define("_MI_PUBLISHER_CATEGORY_ITEM_PUBLISHED_NOTIFY_CAP","Notify me when a new article is published in the current category."); +define("_MI_PUBLISHER_CATEGORY_ITEM_PUBLISHED_NOTIFY_DSC","Receive notification when a new article is published in the current category."); +define("_MI_PUBLISHER_CATEGORY_ITEM_PUBLISHED_NOTIFY_SBJ","[{X_SITENAME}] {X_MODULE} auto-notify: New article published in category"); +define("_MI_PUBLISHER_CATEGORY_ITEM_SUBMITTED_NOTIFY","'Article submitted"); +define("_MI_PUBLISHER_CATEGORY_ITEM_SUBMITTED_NOTIFY_CAP","Notify me when a new article is submitted in the current category."); +define("_MI_PUBLISHER_CATEGORY_ITEM_SUBMITTED_NOTIFY_DSC","Receive notification when a new article is submitted in the current category."); +define("_MI_PUBLISHER_CATEGORY_ITEM_SUBMITTED_NOTIFY_SBJ","[{X_SITENAME}] {X_MODULE} auto-notify: New article submitted in category"); +define("_MI_PUBLISHER_CATLIST_IMG_W","Category list image width"); +define("_MI_PUBLISHER_CATLIST_IMG_WDSC","Specify the width of category images when listing the categories."); +define("_MI_PUBLISHER_CATMAINIMG_W","Category main image width"); +define("_MI_PUBLISHER_CATMAINIMG_WDSC","Specify the width of the category main image."); +define("_MI_PUBLISHER_CATPERPAGE","Maximum Categories per page (User side)?"); +define("_MI_PUBLISHER_CATPERPAGEDSC","Maximum number of top categories per page to be displayed at once in the user side?"); +define("_MI_PUBLISHER_CLONE","Allow article duplication?"); +define("_MI_PUBLISHER_CLONEDSC","Select “Yes” to allow users with appropriate permissions to duplicate an article."); +define("_MI_PUBLISHER_COLLHEAD","Display the collapsible bar?"); +define("_MI_PUBLISHER_COLLHEADDSC","If you set this option to “Yes”, the categories summary will be displayed in a collapsible bar as well as the articles. If you set this option to “No”, the collapsible bar will not be displayed."); +define("_MI_PUBLISHER_COMMENTS","Control comments at the article level?"); +define("_MI_PUBLISHER_COMMENTSDSC","if you set this option to “Yes”, you will see comments only on those items that have their comment checkbox marked.

Select “No” to have comments managed at the global level (look below under the tag 'Comment rules'."); +define("_MI_PUBLISHER_DATEFORMAT","Date format:"); +define("_MI_PUBLISHER_DATEFORMATDSC","Select a display style. Example: \"d-M-Y H:i\" translates to \"30-Mar-2004 22:35\"
Refer to the PHP manual for more display options."); +define("_MI_PUBLISHER_DEMO_SITE","SmartFactory Demo Site"); +define("_MI_PUBLISHER_DEVELOPER_CONTRIBUTOR","Contributor(s)"); +define("_MI_PUBLISHER_DEVELOPER_CREDITS","Credits"); +define("_MI_PUBLISHER_DEVELOPER_EMAIL","Email"); +define("_MI_PUBLISHER_DEVELOPER_LEAD","Lead developer(s)"); +define("_MI_PUBLISHER_DEVELOPER_WEBSITE","Website"); +define("_MI_PUBLISHER_DISCOM","Display comment count?"); +define("_MI_PUBLISHER_DISCOMDSC","Set to “Yes” to display the comments count in the individual article."); +define("_MI_PUBLISHER_DISDATECOL","Display the 'Published on' column?"); +define("_MI_PUBLISHER_DISDATECOLDSC","When the 'Summary' display type is selected, select “Yes” to display a “Published on” date in the items table on the index and category page."); +define("_MI_PUBLISHER_DCS","Display the category summary?"); +define("_MI_PUBLISHER_DCS_DSC","Select “No” to not display the category summary on a category page that has no subcategories."); +define("_MI_PUBLISHER_DISPLAYTYPE_FULL","Full View"); +define("_MI_PUBLISHER_DISPLAYTYPE_LIST","Bullet list"); +define("_MI_PUBLISHER_DISPLAYTYPE_WFSECTION","WFSection style"); +define("_MI_PUBLISHER_DISPLAYTYPE_SUMMARY","Summary View"); +define("_MI_PUBLISHER_DISSBCATDSC","Display sub-categories description?"); +define("_MI_PUBLISHER_DISSBCATDSCDSC","Select “Yes” to display the description of sub-categories in the index and category page."); +define("_MI_PUBLISHER_DISTYPE","Articles display type:"); +define("_MI_PUBLISHER_DISTYPEDSC","if “Summary View” is selected, only the Title, Date and Hits of each item will be displayed in a selected category. If “Full View” is selected, each article will be fully displayed in a selected category."); +define("_MI_PUBLISHER_FOOTERPRINT","Print page footer"); +define("_MI_PUBLISHER_FOOTERPRINTDSC","Footer that will be printed for each article"); +define("_MI_PUBLISHER_GLOBAL_ITEM_CATEGORY_CREATED_NOTIFY","New category"); +define("_MI_PUBLISHER_GLOBAL_ITEM_CATEGORY_CREATED_NOTIFY_CAP","Notify me when a new category is created."); +define("_MI_PUBLISHER_GLOBAL_ITEM_CATEGORY_CREATED_NOTIFY_DSC","Receive notification when a new category is created."); +define("_MI_PUBLISHER_GLOBAL_ITEM_CATEGORY_CREATED_NOTIFY_SBJ","[{X_SITENAME}] {X_MODULE} auto-notify: New category"); +define("_MI_PUBLISHER_GLOBAL_ITEM_NOTIFY","Global Articles"); +define("_MI_PUBLISHER_GLOBAL_ITEM_NOTIFY_DSC","Notification options that apply to all articles."); +define("_MI_PUBLISHER_GLOBAL_ITEM_PUBLISHED_NOTIFY","New article published"); +define("_MI_PUBLISHER_GLOBAL_ITEM_PUBLISHED_NOTIFY_CAP","Notify me when any new article is published."); +define("_MI_PUBLISHER_GLOBAL_ITEM_PUBLISHED_NOTIFY_DSC","Receive notification when any new article is published."); +define("_MI_PUBLISHER_GLOBAL_ITEM_PUBLISHED_NOTIFY_SBJ","[{X_SITENAME}] {X_MODULE} auto-notify: New article published"); +define("_MI_PUBLISHER_GLOBAL_ITEM_SUBMITTED_NOTIFY","Article submitted"); +define("_MI_PUBLISHER_GLOBAL_ITEM_SUBMITTED_NOTIFY_CAP","Notify me when any article is submitted and is awaiting approval."); +define("_MI_PUBLISHER_GLOBAL_ITEM_SUBMITTED_NOTIFY_DSC","Receive notification when any article is submitted and is waiting approval."); +define("_MI_PUBLISHER_GLOBAL_ITEM_SUBMITTED_NOTIFY_SBJ","[{X_SITENAME}] {X_MODULE} auto-notify: New article submitted"); +define("_MI_PUBLISHER_HEADERPRINT","Print page header"); +define("_MI_PUBLISHER_HEADERPRINTDSC","Header that will be printed for each article"); +define("_MI_PUBLISHER_HITSCOL","Display the “Hits” column?"); +define("_MI_PUBLISHER_HITSCOLDSC","When the “Summary” display type is selected, select “Yes” to display the “Hits” column in the items table on the index and category page."); +define("_MI_PUBLISHER_HLCOLOR","Highlight color for keywords"); +define("_MI_PUBLISHER_HLCOLORDSC","Color of the keywords highlighting for the search function."); +define("_MI_PUBLISHER_IMAGENAV","Use the image Page Navigation:"); +define("_MI_PUBLISHER_IMAGENAVDSC","If you set this option to “Yes”, the Page Navigation will be displayed with images, otherwise, the original Page Naviagation will be used."); +define("_MI_PUBLISHER_INDEXFOOTER","Index Footer"); +define("_MI_PUBLISHER_INDEXFOOTER_SEL","Index Footer"); +define("_MI_PUBLISHER_INDEXFOOTERDSC","Footer that will be displayed at the index page of the module."); +define("_MI_PUBLISHER_INDEXMSG","Index page welcome message:"); +define("_MI_PUBLISHER_INDEXMSGDEF",""); +define("_MI_PUBLISHER_INDEXMSGDSC","Welcome message to be displayed in the index page of the module."); +define("_MI_PUBLISHER_ITEM_APPROVED_NOTIFY","Article approved"); +define("_MI_PUBLISHER_ITEM_APPROVED_NOTIFY_CAP","Notify me when this article is approved."); +define("_MI_PUBLISHER_ITEM_APPROVED_NOTIFY_DSC","Receive notification when this article is approved."); +define("_MI_PUBLISHER_ITEM_APPROVED_NOTIFY_SBJ","[{X_SITENAME}] {X_MODULE} auto-notify: article approved"); +define("_MI_PUBLISHER_ITEM_NOTIFY","Article"); +define("_MI_PUBLISHER_ITEM_NOTIFY_DSC","Notification options that apply to the current article."); +define("_MI_PUBLISHER_ITEM_REJECTED_NOTIFY","Article rejected"); +define("_MI_PUBLISHER_ITEM_REJECTED_NOTIFY_CAP","Notify me if this article is rejected."); +define("_MI_PUBLISHER_ITEM_REJECTED_NOTIFY_DSC","Receive notification if this article is rejected."); +define("_MI_PUBLISHER_ITEM_REJECTED_NOTIFY_SBJ","[{X_SITENAME}] {X_MODULE} auto-notify: article rejected"); +define("_MI_PUBLISHER_ITEMFOOTER","Item footer"); +define("_MI_PUBLISHER_ITEMFOOTER_SEL","Item footer"); +define("_MI_PUBLISHER_ITEMFOOTERDSC","Footer that will be displayed for each article."); +define("_MI_PUBLISHER_ITEMSMENU","Categories Menu block"); //bd tree block hack -define("_MI_PUBLISHER_ITEMSTREE", "Tree block"); +define("_MI_PUBLISHER_ITEMSTREE","Tree block"); //--/bd -define("_MI_PUBLISHER_ITEMSNEW", "Recent items List"); -define("_MI_PUBLISHER_ITEMSPOT", "In the Spotlight!"); -define("_MI_PUBLISHER_ITEMSRANDOM_ITEM", "Random item!"); -define("_MI_PUBLISHER_LASTITEM", "Display last item column?"); -define("_MI_PUBLISHER_LASTITEMDSC", "Select “Yes” to display the last item in each category in the index and category page."); -define("_MI_PUBLISHER_LASTITEMS", "Display the list of newly published articles?"); -define("_MI_PUBLISHER_LASTITEMSDSC", "Select “Yes” to have the list at the bottom of the first page of the module."); -define("_MI_PUBLISHER_LASTITSIZE", "Last item size:"); -define("_MI_PUBLISHER_LASTITSIZEDSC", "Set the maximum size of the title in the Last item column."); -define("_MI_PUBLISHER_LINKPATH", "Enable links on the current path:"); -define("_MI_PUBLISHER_LINKPATHDSC", "This option allows the user back-track by clicking on an element of the current path displayed on the top of the page."); -define("_MI_PUBLISHER_MAX_HEIGHT", "Maximum uploaded image height"); -define("_MI_PUBLISHER_MAX_HEIGHTDSC", "Maximum height of an image file that can be uploaded."); -define("_MI_PUBLISHER_MAX_SIZE", "Maximum file size"); -define("_MI_PUBLISHER_MAX_SIZEDSC", "Maximum size (in bytes) of a file that can be uploaded."); -define("_MI_PUBLISHER_MAX_WIDTH", "Maximum uploaded image width"); -define("_MI_PUBLISHER_MAX_WIDTHDSC", "Maximum width of an image file that can be uploaded."); -define("_MI_PUBLISHER_MD_DESC", "Publishing Solution for your XOOPS Site"); -define("_MI_PUBLISHER_MD_NAME", "Publisher"); -define("_MI_PUBLISHER_MODULE_BUG", "Report a bug for this module"); -define("_MI_PUBLISHER_MODULE_DEMO", "Demo Site"); -define("_MI_PUBLISHER_MODULE_DISCLAIMER", "Disclaimer"); -define("_MI_PUBLISHER_MODULE_FEATURE", "Suggest a new feature for this module"); -define("_MI_PUBLISHER_MODULE_INFO", "Module Development details"); -define("_MI_PUBLISHER_MODULE_RELEASE_DATE", "Release date"); -define("_MI_PUBLISHER_MODULE_STATUS", "Status"); -define("_MI_PUBLISHER_MODULE_SUBMIT_BUG", "Submit a bug"); -define("_MI_PUBLISHER_MODULE_SUBMIT_FEATURE", "Submit a feature request"); -define("_MI_PUBLISHER_MODULE_SUPPORT", "Official support site"); -define("_MI_PUBLISHER_NO_FOOTERS", "None"); -define("_MI_PUBLISHER_ORDERBY", "Sort order"); -define("_MI_PUBLISHER_ORDERBY_DATE", "Date DESC"); -define("_MI_PUBLISHER_ORDERBY_TITLE", "Title ASC"); -define("_MI_PUBLISHER_ORDERBY_WEIGHT", "Weight ASC"); -define("_MI_PUBLISHER_ORDERBYDSC", "Select the sort order of the items throughout the module."); -define("_MI_PUBLISHER_OTHER_ITEMS_TYPE_ALL", "All articles"); -define("_MI_PUBLISHER_OTHER_ITEMS_TYPE_NONE", "None"); -define("_MI_PUBLISHER_OTHER_ITEMS_TYPE_PREVIOUS_NEXT", "Previous and next article"); -define("_MI_PUBLISHER_OTHERITEMS", "Other articles display type"); -define("_MI_PUBLISHER_OTHERITEMSDSC", "Select how you would like to display the other articles of the category in the article page."); -define("_MI_PUBLISHER_PERPAGE", "Maximum articles per page (Admin side):"); -define("_MI_PUBLISHER_PERPAGEDSC", "Maximum number of articles per page to be displayed at once in the admin side."); -define("_MI_PUBLISHER_PERPAGEINDEX", "Maximum articles per page (User side):"); -define("_MI_PUBLISHER_PERPAGEINDEXDSC", "Maximum number of articles per page to be displayed together in the user side."); -define("_MI_PUBLISHER_PRINTLOGOURL", "Logo print URL"); -define("_MI_PUBLISHER_PRINTLOGOURLDSC", "URL of the logo that will be printed at the top of the page."); -define("_MI_PUBLISHER_RECENTITEMS", "Recent items (Detail)"); -define("_MI_PUBLISHER_SHOW_RSS", "Show link for RSS feed"); -define("_MI_PUBLISHER_SHOW_RSSDSC", ""); -define("_MI_PUBLISHER_SHOW_SUBCATS", "Display sub categories"); -define("_MI_PUBLISHER_SHOW_SUBCATS_ALL", "Display all subcategories"); -define("_MI_PUBLISHER_SHOW_SUBCATS_DSC", "Select if you want to display the subcategories in the categories list of the index and category page of the module."); -define("_MI_PUBLISHER_SHOW_SUBCATS_NO", "Do not display sub-categories"); -define("_MI_PUBLISHER_SHOW_SUBCATS_NOMAIN", "Do not display sub-categories in index page, just in category page"); -define("_MI_PUBLISHER_SHOW_SUBCATS_NOTEMPTY", "Display non empty subcategories"); -define("_MI_PUBLISHER_SUB_SMNAME1", "Submit an article"); -define("_MI_PUBLISHER_SUBMITMSG", "Submit page intro message:"); -define("_MI_PUBLISHER_SUBMITMSGDEF", ""); -define("_MI_PUBLISHER_SUBMITMSGDSC", "Intro message to be displayed in the submit page of the module."); -define("_MI_PUBLISHER_TITLE_SIZE", "Title size:"); -define("_MI_PUBLISHER_TITLE_SIZEDSC", "Set the maximum size of the title in the single item display page."); -define("_MI_PUBLISHER_UPLOAD", "User file upload?"); -define("_MI_PUBLISHER_UPLOADDSC", "Allow users to upload files linked to articles on your website?"); -define("_MI_PUBLISHER_USEREALNAME", "Use the Real Name of users"); -define("_MI_PUBLISHER_USEREALNAMEDSC", "When displaying a username, use the real name of that user if he has a set his real name."); -define("_MI_PUBLISHER_VERSION_HISTORY", "Version History"); -define("_MI_PUBLISHER_WELCOME", "Display the welcome title and message:"); -define("_MI_PUBLISHER_WELCOMEDSC", "If this option is set to “Yes”, the module index page will display the title “Welcome in the Publisher of...”, followed by the welcome message defined below. If this option is set to “No”, none of these lines will be displayed."); -define("_MI_PUBLISHER_WHOWHEN", "Display the poster and date?"); -define("_MI_PUBLISHER_WHOWHENDSC", "Set to “Yes” to display the poster and date information in the individual article."); -define("_MI_PUBLISHER_PV_TEXT", "Partial view message"); -define("_MI_PUBLISHER_PV_TEXTDSC", "Message for articles that allow only partial view."); -define("_MI_PUBLISHER_PV_TEXT_DEF", "To view the complete article, you must register."); -define("_MI_PUBLISHER_SEOMODNAME", "URL Rewriting module name"); -define("_MI_PUBLISHER_SEOMODNAMEDSC", "If URL Rewriting is enabled for the module, this is the name of the module that will be used. For example: http://yoursite.com/publisher/..."); -define("_MI_PUBLISHER_ARTCOUNT", "Display articles count"); -define("_MI_PUBLISHER_ARTCOUNTDSC", "Select “Yes” to display the article count within each category in the category summary table. Please note that the module currently only counts articles within each category and does not count within subcategories."); -define("_MI_PUBLISHER_LATESTFILES", "Latest uploaded files"); -define("_MI_PUBLISHER_PATHSEARCH", "Display category path in search results"); -define("_MI_PUBLISHER_PATHSEARCHDSC", ""); -define("_MI_PUBLISHER_DISPBREAD", "Display the breadcrumb"); -define("_MI_PUBLISHER_DISPBREADDSC", "Breadcrumb navigation displays the current page's context within the site structure."); -define("_MI_PUBLISHER_DATE_TO_DATE", "Articles from date to date"); +define("_MI_PUBLISHER_ITEMSNEW","Recent items List"); +define("_MI_PUBLISHER_ITEMSPOT","In the Spotlight!"); +define("_MI_PUBLISHER_ITEMSRANDOM_ITEM","Random item!"); +define("_MI_PUBLISHER_LASTITEM","Display last item column?"); +define("_MI_PUBLISHER_LASTITEMDSC","Select “Yes” to display the last item in each category in the index and category page."); +define("_MI_PUBLISHER_LASTITEMS","Display the list of newly published articles?"); +define("_MI_PUBLISHER_LASTITEMSDSC","Select “Yes” to have the list at the bottom of the first page of the module."); +define("_MI_PUBLISHER_LASTITSIZE","Last item size:"); +define("_MI_PUBLISHER_LASTITSIZEDSC","Set the maximum size of the title in the Last item column."); +define("_MI_PUBLISHER_LINKPATH","Enable links on the current path:"); +define("_MI_PUBLISHER_LINKPATHDSC","This option allows the user back-track by clicking on an element of the current path displayed on the top of the page."); +define("_MI_PUBLISHER_MAX_HEIGHT","Maximum uploaded image height"); +define("_MI_PUBLISHER_MAX_HEIGHTDSC","Maximum height of an image file that can be uploaded."); +define("_MI_PUBLISHER_MAX_SIZE","Maximum file size"); +define("_MI_PUBLISHER_MAX_SIZEDSC","Maximum size (in bytes) of a file that can be uploaded."); +define("_MI_PUBLISHER_MAX_WIDTH","Maximum uploaded image width"); +define("_MI_PUBLISHER_MAX_WIDTHDSC","Maximum width of an image file that can be uploaded."); +define("_MI_PUBLISHER_MD_DESC","Publishing Solution for your XOOPS Site"); +define("_MI_PUBLISHER_MD_NAME","Publisher"); +define("_MI_PUBLISHER_MODULE_BUG","Report a bug for this module"); +define("_MI_PUBLISHER_MODULE_DEMO","Demo Site"); +define("_MI_PUBLISHER_MODULE_DISCLAIMER","Disclaimer"); +define("_MI_PUBLISHER_MODULE_FEATURE","Suggest a new feature for this module"); +define("_MI_PUBLISHER_MODULE_INFO","Module Development details"); +define("_MI_PUBLISHER_MODULE_RELEASE_DATE","Release date"); +define("_MI_PUBLISHER_MODULE_STATUS","Status"); +define("_MI_PUBLISHER_MODULE_SUBMIT_BUG","Submit a bug"); +define("_MI_PUBLISHER_MODULE_SUBMIT_FEATURE","Submit a feature request"); +define("_MI_PUBLISHER_MODULE_SUPPORT","Official support site"); +define("_MI_PUBLISHER_NO_FOOTERS","None"); +define("_MI_PUBLISHER_ORDERBY","Sort order"); +define("_MI_PUBLISHER_ORDERBY_DATE","Date DESC"); +define("_MI_PUBLISHER_ORDERBY_TITLE","Title ASC"); +define("_MI_PUBLISHER_ORDERBY_WEIGHT","Weight ASC"); +define("_MI_PUBLISHER_ORDERBYDSC","Select the sort order of the items throughout the module."); +define("_MI_PUBLISHER_OTHER_ITEMS_TYPE_ALL","All articles"); +define("_MI_PUBLISHER_OTHER_ITEMS_TYPE_NONE","None"); +define("_MI_PUBLISHER_OTHER_ITEMS_TYPE_PREVIOUS_NEXT","Previous and next article"); +define("_MI_PUBLISHER_OTHERITEMS","Other articles display type"); +define("_MI_PUBLISHER_OTHERITEMSDSC","Select how you would like to display the other articles of the category in the article page."); +define("_MI_PUBLISHER_PERPAGE","Maximum articles per page (Admin side):"); +define("_MI_PUBLISHER_PERPAGEDSC","Maximum number of articles per page to be displayed at once in the admin side."); +define("_MI_PUBLISHER_PERPAGEINDEX","Maximum articles per page (User side):"); +define("_MI_PUBLISHER_PERPAGEINDEXDSC","Maximum number of articles per page to be displayed together in the user side."); +define("_MI_PUBLISHER_PRINTLOGOURL","Logo print URL"); +define("_MI_PUBLISHER_PRINTLOGOURLDSC","URL of the logo that will be printed at the top of the page."); +define("_MI_PUBLISHER_RECENTITEMS","Recent items (Detail)"); +define("_MI_PUBLISHER_SHOW_RSS","Show link for RSS feed"); +define("_MI_PUBLISHER_SHOW_RSSDSC",""); +define("_MI_PUBLISHER_SHOW_SUBCATS","Display sub categories"); +define("_MI_PUBLISHER_SHOW_SUBCATS_ALL","Display all subcategories"); +define("_MI_PUBLISHER_SHOW_SUBCATS_DSC","Select if you want to display the subcategories in the categories list of the index and category page of the module."); +define("_MI_PUBLISHER_SHOW_SUBCATS_NO","Do not display sub-categories"); +define("_MI_PUBLISHER_SHOW_SUBCATS_NOMAIN","Do not display sub-categories in index page, just in category page"); +define("_MI_PUBLISHER_SHOW_SUBCATS_NOTEMPTY","Display non empty subcategories"); +define("_MI_PUBLISHER_SUB_SMNAME1","Submit an article"); +define("_MI_PUBLISHER_SUBMITMSG","Submit page intro message:"); +define("_MI_PUBLISHER_SUBMITMSGDEF",""); +define("_MI_PUBLISHER_SUBMITMSGDSC","Intro message to be displayed in the submit page of the module."); +define("_MI_PUBLISHER_TITLE_SIZE","Title size:"); +define("_MI_PUBLISHER_TITLE_SIZEDSC","Set the maximum size of the title in the single item display page."); +define("_MI_PUBLISHER_UPLOAD","User file upload?"); +define("_MI_PUBLISHER_UPLOADDSC","Allow users to upload files linked to articles on your website?"); +define("_MI_PUBLISHER_USEREALNAME","Use the Real Name of users"); +define("_MI_PUBLISHER_USEREALNAMEDSC","When displaying a username, use the real name of that user if he has a set his real name."); +define("_MI_PUBLISHER_VERSION_HISTORY","Version History"); +define("_MI_PUBLISHER_WELCOME","Display the welcome title and message:"); +define("_MI_PUBLISHER_WELCOMEDSC","If this option is set to “Yes”, the module index page will display the title “Welcome in the Publisher of...”, followed by the welcome message defined below. If this option is set to “No”, none of these lines will be displayed."); +define("_MI_PUBLISHER_WHOWHEN","Display the poster and date?"); +define("_MI_PUBLISHER_WHOWHENDSC","Set to “Yes” to display the poster and date information in the individual article."); +define("_MI_PUBLISHER_PV_TEXT","Partial view message"); +define("_MI_PUBLISHER_PV_TEXTDSC","Message for articles that allow only partial view."); +define("_MI_PUBLISHER_PV_TEXT_DEF","To view the complete article, you must register."); +define("_MI_PUBLISHER_SEOMODNAME","URL Rewriting module name"); +define("_MI_PUBLISHER_SEOMODNAMEDSC","If URL Rewriting is enabled for the module, this is the name of the module that will be used. For example: http://yoursite.com/publisher/..."); +define("_MI_PUBLISHER_ARTCOUNT","Display articles count"); +define("_MI_PUBLISHER_ARTCOUNTDSC","Select “Yes” to display the article count within each category in the category summary table. Please note that the module currently only counts articles within each category and does not count within subcategories."); +define("_MI_PUBLISHER_LATESTFILES","Latest uploaded files"); +define("_MI_PUBLISHER_PATHSEARCH","Display category path in search results"); +define("_MI_PUBLISHER_PATHSEARCHDSC",""); +define("_MI_PUBLISHER_DISPBREAD","Display the breadcrumb"); +define("_MI_PUBLISHER_DISPBREADDSC","Breadcrumb navigation displays the current page's context within the site structure."); +define("_MI_PUBLISHER_DATE_TO_DATE","Articles from date to date"); //added in publisher -define("_MI_PUBLISHER_FORM_STATUS", "Select default status for submitted article"); -define("_MI_PUBLISHER_FORM_STATUS_DSC", ""); -define("_MI_PUBLISHER_PUBLISHED", "Published"); -define("_MI_PUBLISHER_OFFLINE", "Offline"); -define("_MI_PUBLISHER_SUBMITTED", "Submited"); -define("_MI_PUBLISHER_REJECTED", "Rejected"); -define("_MI_PUBLISHER_FORM_ALLOWCOMMENTS", "“Allow comments” set to TRUE"); -define("_MI_PUBLISHER_FORM_ALLOWCOMMENTS_DSC", ""); -define("_MI_PUBLISHER_FORM_DOHTML", "“Enable HTML tags” set to TRUE"); -define("_MI_PUBLISHER_FORM_DOHTML_DSC", ""); -define("_MI_PUBLISHER_FORM_DOSMILEY", "“Enable smiley icons” set to TRUE"); -define("_MI_PUBLISHER_FORM_DOSMILEY_DSC", ""); -define("_MI_PUBLISHER_FORM_DOXCODE", "“Enable XOOPS codes” set to TRUE"); -define("_MI_PUBLISHER_FORM_DOXCODE_DSC", ""); -define("_MI_PUBLISHER_FORM_DOIMAGE", "“Enable images” set to TRUE"); -define("_MI_PUBLISHER_FORM_DOIMAGE_DSC", ""); -define("_MI_PUBLISHER_FORM_DOBR", "“Enable line break” set to TRUE"); -define("_MI_PUBLISHER_FORM_DOBR_DSC", ""); -define("_MI_PUBLISHER_EDITOR", "Default editor type"); -define("_MI_PUBLISHER_EDITOR_DSC", "What kind of editor would you like to use by default? You can also allow submitters to choose editors in the permissions menu."); -define("_MI_PUBLISHER_EDITOR_ROWS", "Editor number of rows"); -define("_MI_PUBLISHER_EDITOR_ROWS_DSC", ""); -define("_MI_PUBLISHER_EDITOR_COLS", "Editor number of columns"); -define("_MI_PUBLISHER_EDITOR_COLS_DSC", ""); -define("_MI_PUBLISHER_EDITOR_WIDTH", "Editor width"); -define("_MI_PUBLISHER_EDITOR_WIDTH_DSC", ""); -define("_MI_PUBLISHER_EDITOR_HEIGHT", "Editor height"); -define("_MI_PUBLISHER_EDITOR_HEIGHT_DSC", ""); +define("_MI_PUBLISHER_FORM_STATUS","Select default status for submitted article"); +define("_MI_PUBLISHER_FORM_STATUS_DSC",""); +define("_MI_PUBLISHER_PUBLISHED","Published"); +define("_MI_PUBLISHER_OFFLINE","Offline"); +define("_MI_PUBLISHER_SUBMITTED","Submited"); +define("_MI_PUBLISHER_REJECTED","Rejected"); +define("_MI_PUBLISHER_FORM_ALLOWCOMMENTS","“Allow comments” set to TRUE"); +define("_MI_PUBLISHER_FORM_ALLOWCOMMENTS_DSC",""); +define("_MI_PUBLISHER_FORM_DOHTML","“Enable HTML tags” set to TRUE"); +define("_MI_PUBLISHER_FORM_DOHTML_DSC",""); +define("_MI_PUBLISHER_FORM_DOSMILEY","“Enable smiley icons” set to TRUE"); +define("_MI_PUBLISHER_FORM_DOSMILEY_DSC",""); +define("_MI_PUBLISHER_FORM_DOXCODE","“Enable XOOPS codes” set to TRUE"); +define("_MI_PUBLISHER_FORM_DOXCODE_DSC",""); +define("_MI_PUBLISHER_FORM_DOIMAGE","“Enable images” set to TRUE"); +define("_MI_PUBLISHER_FORM_DOIMAGE_DSC",""); +define("_MI_PUBLISHER_FORM_DOBR","“Enable line break” set to TRUE"); +define("_MI_PUBLISHER_FORM_DOBR_DSC",""); +define("_MI_PUBLISHER_EDITOR","Default editor type"); +define("_MI_PUBLISHER_EDITOR_DSC","What kind of editor would you like to use by default? You can also allow submitters to choose editors in the permissions menu."); +define("_MI_PUBLISHER_EDITOR_ROWS","Editor number of rows"); +define("_MI_PUBLISHER_EDITOR_ROWS_DSC",""); +define("_MI_PUBLISHER_EDITOR_COLS","Editor number of columns"); +define("_MI_PUBLISHER_EDITOR_COLS_DSC",""); +define("_MI_PUBLISHER_EDITOR_WIDTH","Editor width"); +define("_MI_PUBLISHER_EDITOR_WIDTH_DSC",""); +define("_MI_PUBLISHER_EDITOR_HEIGHT","Editor height"); +define("_MI_PUBLISHER_EDITOR_HEIGHT_DSC",""); //blocks descriptions -define("_MI_PUBLISHER_ITEMSNEW_DSC", "Shows new items"); -define("_MI_PUBLISHER_RECENTITEMS_DSC", "Shows recent items"); -define("_MI_PUBLISHER_ITEMSPOT_DSC", "Shows last item"); -define("_MI_PUBLISHER_ITEMSRANDOM_ITEM_DSC", "Shows a random 'item' item"); -define("_MI_PUBLISHER_ITEMSMENU_DSC", "Menu displaying categories"); -define("_MI_PUBLISHER_LATESTFILES_DSC", "List of latest uploaded files"); -define("_MI_PUBLISHER_DATE_TO_DATE_DSC", "List article from a selected date to another"); -define("_MI_PUBLISHER_ITEMSTREE_DSC", "Display the category and items tree"); +define("_MI_PUBLISHER_ITEMSNEW_DSC","Shows new items"); +define("_MI_PUBLISHER_RECENTITEMS_DSC","Shows recent items"); +define("_MI_PUBLISHER_ITEMSPOT_DSC","Shows last item"); +define("_MI_PUBLISHER_ITEMSRANDOM_ITEM_DSC","Shows a random 'item' item"); +define("_MI_PUBLISHER_ITEMSMENU_DSC","Menu displaying categories"); +define("_MI_PUBLISHER_LATESTFILES_DSC","List of latest uploaded files"); +define("_MI_PUBLISHER_DATE_TO_DATE_DSC","List article from a selected date to another"); +define("_MI_PUBLISHER_ITEMSTREE_DSC","Display the category and items tree"); //templates descriptions -define("_MI_PUBLISHER_HEADER_DSC", "Display header"); -define("_MI_PUBLISHER_FOOTER_DSC", "Display footer"); -define("_MI_PUBLISHER_SINGLEITEM_DSC", "Display a single item"); -define("_MI_PUBLISHER_CATEGORIES_TABLE_DSC", "Display the category list table used in other templates"); -define("_MI_PUBLISHER_DISPLAY_LIST_DSC", "Display index and category with bullet display type"); -define("_MI_PUBLISHER_DISPLAY_SUMMARY_DSC", "Display index and category with summary display type"); -define("_MI_PUBLISHER_DISPLAY_FULL_DSC", "Display index and category with full display type"); -define("_MI_PUBLISHER_DISPLAY_WFSECTION_DSC", "Display index and category in a WF-Section like style"); -define("_MI_PUBLISHER_ITEM_DSC", "Display item"); -define("_MI_PUBLISHER_ARCHIVE__DSC", "Article Archives"); -define("_MI_PUBLISHER_SUBMIT_DSC", "Form to submit an item"); -define("_MI_PUBLISHER_SINGLEITEM_BLOCK_DSC", "Display a single item in a block"); -define("_MI_PUBLISHER_PRINT_DSC", "Print page template"); -define("_MI_PUBLISHER_RSS_DSC", "Display publisher RSS feed"); -define("_MI_PUBLISHER_ADDFILE_DSC", "Form to add a file to an article"); -define("_MI_PUBLISHER_WARNING_ALPHA", "This module comes as is, without any guarantees whatsoever. This module is ALPHA, meaning it is still under active development. This release is meant for testing purposes only and we strongly recommend that you do not use it on a live website or in a production environment."); -define("_MI_PUBLISHER_PEOPLE_DEVELOPERS", "Developers"); -define("_MI_PUBLISHER_PEOPLE_TESTERS", "Testers"); -define("_MI_PUBLISHER_PEOPLE_DOCUMENTERS", "Documenters"); -define("_MI_PUBLISHER_PEOPLE_TRANSLATERS", "Translaters"); -define("_MI_PUBLISHER_PEOPLE_OTHER", "Other contributors"); -define("_MI_PUBLISHER_URL_REWRITE", "URL rewrite method"); -define("_MI_PUBLISHER_URL_REWRITE_DSC", "If you choose htaccess, then don't forget to put “.htaccess” file under your root folder"); -define("_MI_PUBLISHER_URL_REWRITE_NONE", "None"); -define("_MI_PUBLISHER_URL_REWRITE_PATHINFO", "Path-info"); -define("_MI_PUBLISHER_URL_REWRITE_HTACCESS", "Htaccess"); -define("_MI_PUBLISHER_CONFCAT_SEO", "SEO"); -define("_MI_PUBLISHER_CONFCAT_SEO_DSC", "Preferences for rewriting methods, meta data, etc"); -define("_MI_PUBLISHER_CONFCAT_FORMAT", "Format"); -define("_MI_PUBLISHER_CONFCAT_FORMAT_DSC", ""); -define("_MI_PUBLISHER_CONFCAT_PRINT", "Print page"); -define("_MI_PUBLISHER_CONFCAT_PRINT_DSC", ""); -define("_MI_PUBLISHER_CONFCAT_OTHERS", "Others"); -define("_MI_PUBLISHER_CONFCAT_OTHERS_DSC", ""); -define("_MI_PUBLISHER_CONFCAT_PERMISSIONS", "Permissions"); -define("_MI_PUBLISHER_CONFCAT_PERMISSIONS_DSC", ""); -define("_MI_PUBLISHER_COLUMNS", "Columns"); -define("_MI_PUBLISHER_COLUMNS_DSC", ""); -define("_MI_PUBLISHER_ALLOWRATING", "Allow rating feature"); -define("_MI_PUBLISHER_ALLOWRATING_DSC", "You can select who can rate in permissions tab"); -define("_MI_PUBLISHER_ALLOWSEARCH", "Allow extended search feature"); -define("_MI_PUBLISHER_ALLOWSEARCH_DSC", "You can select who can search in permissions tab"); -define("_MI_PUBLISHER_SUB_SMNAME3", "Search"); -define("_MI_PUBLISHER_LATEST_NEWS", "Latest news"); -define("_MI_PUBLISHER_LATEST_NEWS_DSC", ""); -define("_MI_PUBLISHER_SEARCH", "Search block"); -define("_MI_PUBLISHER_SEARCH_DSC", "Advanced search page"); -define("_MI_PUBLISHER_CATEGORY_ITEMS_SEL", "Category items select"); -define("_MI_PUBLISHER_CATEGORY_ITEMS_SEL_DSC", "Shows a drop down select box with items grouped by category"); -define("_MI_PUBLISHER_CONFCAT_INDEX", "Index page"); -define("_MI_PUBLISHER_CONFCAT_INDEX_DSC", ""); -define("_MI_PUBLISHER_CONFCAT_CATEGORY", "Category page"); -define("_MI_PUBLISHER_CONFCAT_CATEGORY_DSC", ""); -define("_MI_PUBLISHER_CONFCAT_ITEM", "Item page"); -define("_MI_PUBLISHER_CONFCAT_ITEM_DSC", ""); -define("_MI_PUBLISHER_CONFCAT_SUBMIT", "Submit page"); -define("_MI_PUBLISHER_CONFCAT_SUBMIT_DSC", "Submit page layout and form default values"); -define("_MI_PUBLISHER_CONFCAT_INDEXCAT", "Index and category pages"); -define("_MI_PUBLISHER_CONFCAT_INDEXCAT_DSC", ""); -define("_MI_PUBLISHER_CONFCAT_SEARCH", "Search page"); -define("_MI_PUBLISHER_CONFCAT_SEARCH_DSC", ""); -define("_MI_PUBLISHER_SEO_METAKEYWORDS", "Meta Keywords"); -define("_MI_PUBLISHER_SEO_METAKEYWORDS_DSC", "This keywords will be merged with the keywords set by articles. Use ", " to separate them."); -define("_MI_PUBLISHER_SUB_ARCHIVE", "Archive"); -define("_MI_PUBLISHER_ALLOW_AUTHOR_ITEMS", "Allow author items feature"); -define("_MI_PUBLISHER_ALLOW_AUTHOR_ITEMS_DSC", ""); -define("_MI_PUBLISHER_AUTHOR_ITEMS_DSC", "Show items from the same author"); -define("_MI_PUBLISHER_DISP_BLOCK_SUM", "Display block summary on items page?"); -define("_MI_PUBLISHER_DISP_BLOCK_SUM_DSC", ""); -define("_MI_PUBLISHER_ADMENU0", "Home"); -define("_MI_PUBLISHER_DISP_INDEX_SUB", "Display items subtitles in index page?"); -define("_MI_PUBLISHER_DISP_INDEX_SUB_DSC", ""); -define("_MI_PUBLISHER_DISP_CAT_SUB", "Display items subtitles in categories pages?"); -define("_MI_PUBLISHER_DISP_CAT_SUB_DSC", ""); -define("_MI_PUBLISHER_DISP_ITEM_SUB", "Display item subtitle in item page?"); -define("_MI_PUBLISHER_DISP_ITEM_SUB_DSC", ""); +define("_MI_PUBLISHER_HEADER_DSC","Display header"); +define("_MI_PUBLISHER_FOOTER_DSC","Display footer"); +define("_MI_PUBLISHER_SINGLEITEM_DSC","Display a single item"); +define("_MI_PUBLISHER_CATEGORIES_TABLE_DSC","Display the category list table used in other templates"); +define("_MI_PUBLISHER_DISPLAY_LIST_DSC","Display index and category with bullet display type"); +define("_MI_PUBLISHER_DISPLAY_SUMMARY_DSC","Display index and category with summary display type"); +define("_MI_PUBLISHER_DISPLAY_FULL_DSC","Display index and category with full display type"); +define("_MI_PUBLISHER_DISPLAY_WFSECTION_DSC","Display index and category in a WF-Section like style"); +define("_MI_PUBLISHER_ITEM_DSC","Display item"); +define("_MI_PUBLISHER_ARCHIVE__DSC","Article Archives"); +define("_MI_PUBLISHER_SUBMIT_DSC","Form to submit an item"); +define("_MI_PUBLISHER_SINGLEITEM_BLOCK_DSC","Display a single item in a block"); +define("_MI_PUBLISHER_PRINT_DSC","Print page template"); +define("_MI_PUBLISHER_RSS_DSC","Display publisher RSS feed"); +define("_MI_PUBLISHER_ADDFILE_DSC","Form to add a file to an article"); +define("_MI_PUBLISHER_WARNING_ALPHA","This module comes as is, without any guarantees whatsoever. This module is ALPHA, meaning it is still under active development. This release is meant for testing purposes only and we strongly recommend that you do not use it on a live website or in a production environment."); +define("_MI_PUBLISHER_PEOPLE_DEVELOPERS","Developers"); +define("_MI_PUBLISHER_PEOPLE_TESTERS","Testers"); +define("_MI_PUBLISHER_PEOPLE_DOCUMENTERS","Documenters"); +define("_MI_PUBLISHER_PEOPLE_TRANSLATERS","Translaters"); +define("_MI_PUBLISHER_PEOPLE_OTHER","Other contributors"); +define("_MI_PUBLISHER_URL_REWRITE","URL rewrite method"); +define("_MI_PUBLISHER_URL_REWRITE_DSC","If you choose htaccess, then don't forget to put “.htaccess” file under your root folder"); +define("_MI_PUBLISHER_URL_REWRITE_NONE","None"); +define("_MI_PUBLISHER_URL_REWRITE_PATHINFO","Path-info"); +define("_MI_PUBLISHER_URL_REWRITE_HTACCESS","Htaccess"); +define("_MI_PUBLISHER_CONFCAT_SEO","SEO"); +define("_MI_PUBLISHER_CONFCAT_SEO_DSC","Preferences for rewriting methods, meta data, etc"); +define("_MI_PUBLISHER_CONFCAT_FORMAT","Format"); +define("_MI_PUBLISHER_CONFCAT_FORMAT_DSC",""); +define("_MI_PUBLISHER_CONFCAT_PRINT","Print page"); +define("_MI_PUBLISHER_CONFCAT_PRINT_DSC",""); +define("_MI_PUBLISHER_CONFCAT_OTHERS","Others"); +define("_MI_PUBLISHER_CONFCAT_OTHERS_DSC",""); +define("_MI_PUBLISHER_CONFCAT_PERMISSIONS","Permissions"); +define("_MI_PUBLISHER_CONFCAT_PERMISSIONS_DSC",""); +define("_MI_PUBLISHER_COLUMNS","Columns"); +define("_MI_PUBLISHER_COLUMNS_DSC",""); +define("_MI_PUBLISHER_ALLOWRATING","Allow rating feature"); +define("_MI_PUBLISHER_ALLOWRATING_DSC","You can select who can rate in permissions tab"); +define("_MI_PUBLISHER_ALLOWSEARCH","Allow extended search feature"); +define("_MI_PUBLISHER_ALLOWSEARCH_DSC","You can select who can search in permissions tab"); +define("_MI_PUBLISHER_SUB_SMNAME3","Search"); +define("_MI_PUBLISHER_LATEST_NEWS","Latest news"); +define("_MI_PUBLISHER_LATEST_NEWS_DSC",""); +define("_MI_PUBLISHER_SEARCH","Search block"); +define("_MI_PUBLISHER_SEARCH_DSC","Advanced search page"); +define("_MI_PUBLISHER_CATEGORY_ITEMS_SEL","Category items select"); +define("_MI_PUBLISHER_CATEGORY_ITEMS_SEL_DSC","Shows a drop down select box with items grouped by category"); +define("_MI_PUBLISHER_CONFCAT_INDEX","Index page"); +define("_MI_PUBLISHER_CONFCAT_INDEX_DSC",""); +define("_MI_PUBLISHER_CONFCAT_CATEGORY","Category page"); +define("_MI_PUBLISHER_CONFCAT_CATEGORY_DSC",""); +define("_MI_PUBLISHER_CONFCAT_ITEM","Item page"); +define("_MI_PUBLISHER_CONFCAT_ITEM_DSC",""); +define("_MI_PUBLISHER_CONFCAT_SUBMIT","Submit page"); +define("_MI_PUBLISHER_CONFCAT_SUBMIT_DSC","Submit page layout and form default values"); +define("_MI_PUBLISHER_CONFCAT_INDEXCAT","Index and category pages"); +define("_MI_PUBLISHER_CONFCAT_INDEXCAT_DSC",""); +define("_MI_PUBLISHER_CONFCAT_SEARCH","Search page"); +define("_MI_PUBLISHER_CONFCAT_SEARCH_DSC",""); +define("_MI_PUBLISHER_SEO_METAKEYWORDS","Meta Keywords"); +define("_MI_PUBLISHER_SEO_METAKEYWORDS_DSC","This keywords will be merged with the keywords set by articles. Use "," to separate them."); +define("_MI_PUBLISHER_SUB_ARCHIVE","Archive"); +define("_MI_PUBLISHER_ALLOW_AUTHOR_ITEMS","Allow author items feature"); +define("_MI_PUBLISHER_ALLOW_AUTHOR_ITEMS_DSC",""); +define("_MI_PUBLISHER_AUTHOR_ITEMS_DSC","Show items from the same author"); +define("_MI_PUBLISHER_DISP_BLOCK_SUM","Display block summary on items page?"); +define("_MI_PUBLISHER_DISP_BLOCK_SUM_DSC",""); +define("_MI_PUBLISHER_ADMENU0","Home"); +define("_MI_PUBLISHER_DISP_INDEX_SUB","Display items subtitles in index page?"); +define("_MI_PUBLISHER_DISP_INDEX_SUB_DSC",""); +define("_MI_PUBLISHER_DISP_CAT_SUB","Display items subtitles in categories pages?"); +define("_MI_PUBLISHER_DISP_CAT_SUB_DSC",""); +define("_MI_PUBLISHER_DISP_ITEM_SUB","Display item subtitle in item page?"); +define("_MI_PUBLISHER_DISP_ITEM_SUB_DSC",""); //30/04/2012 -define("_MI_PUBLISHER_ALLOWEDIT", "User article edit?"); -define("_MI_PUBLISHER_ALLOWEDITDSC", "Allow users to edit their own articles?"); -define("_MI_PUBLISHER_ALLOWDELETE", "User article delete?"); -define("_MI_PUBLISHER_ALLOWDELETEDSC", "Allow users to delete their own articles?"); +define("_MI_PUBLISHER_ALLOWEDIT","User article edit?"); +define("_MI_PUBLISHER_ALLOWEDITDSC","Allow users to edit their own articles?"); +define("_MI_PUBLISHER_ALLOWDELETE","User article delete?"); +define("_MI_PUBLISHER_ALLOWDELETEDSC","Allow users to delete their own articles?"); //1.02 Beta 2 -define("_MI_PUBLISHER_DISPLAY_PDF", "Display PDF Icon"); -define("_MI_PUBLISHER_DISPLAY_PDF_DSC", "Select Yes to show PDF icon and allow users to create PDF files"); +define("_MI_PUBLISHER_DISPLAY_PDF","Display PDF Icon"); +define("_MI_PUBLISHER_DISPLAY_PDF_DSC","Select Yes to show PDF icon and allow users to create PDF files"); -//1.02 Beta 3 +//1.02 RC2 +define("_MI_PUBLISHER_ORDERBY_RATING","Rating DESC"); +define("_MI_PUBLISHER_ORDERBY_VOTES","Votes DESC"); diff --git a/publisher/xoops_version.php b/publisher/xoops_version.php index 4fbd629d..a650b144 100644 --- a/publisher/xoops_version.php +++ b/publisher/xoops_version.php @@ -843,6 +843,8 @@ 'options' => array( _MI_PUBLISHER_ORDERBY_TITLE => 'title', _MI_PUBLISHER_ORDERBY_DATE => 'date', + _MI_PUBLISHER_ORDERBY_RATING => 'rating', + _MI_PUBLISHER_ORDERBY_VOTES => 'votes', _MI_PUBLISHER_ORDERBY_WEIGHT => 'weight'), 'default' => 'date', 'category' => 'format' From 939a19f6fc9d27496ec824a5f0b0898e9cbe0159 Mon Sep 17 00:00:00 2001 From: mambax7 Date: Tue, 30 Jun 2015 02:59:07 -0400 Subject: [PATCH 03/19] Added sorting, extra columns --- publisher/admin/about.php | 1 - publisher/admin/admin_header.php | 3 +- publisher/admin/clone.php | 15 +- publisher/admin/import/ams.php | 166 +-- publisher/admin/import/cjaycontent.php | 80 +- publisher/admin/import/fmcontent.php | 156 +-- publisher/admin/import/news.php | 78 +- publisher/admin/import/smartsection.php | 46 +- publisher/admin/import/wfsection.php | 58 +- publisher/admin/import/xfsection.php | 10 +- publisher/admin/import/xnews.php | 132 +- publisher/admin/main.php | 69 +- publisher/admin/mimetypes.php | 39 +- publisher/admin/permissions.php | 6 +- publisher/admin/preferences.php | 5 +- publisher/archive.php | 16 +- publisher/assets/css/jquery.popeye.css | 20 +- publisher/assets/css/jquery.popeye.style.css | 495 +++---- publisher/assets/css/publisher.css | 750 +++++----- publisher/assets/index.html | 2 +- publisher/assets/js/ajaxupload.3.9.js | 488 +++---- publisher/assets/js/behavior.js | 476 ++++--- publisher/assets/js/cookies.js | 25 +- publisher/assets/js/funcs.js | 208 +-- publisher/assets/js/index.html | 2 +- publisher/assets/js/jquery.easing.js | 289 ++-- publisher/assets/js/jquery.popeye-2.1.js | 1242 +++++++++-------- publisher/assets/js/publisher.js | 4 +- publisher/assets/js/rating.js | 165 +-- publisher/assets/js/script.easing.js | 553 ++++---- publisher/author_items.php | 11 +- publisher/backend.php | 12 +- publisher/blocks/category_items_sel.php | 15 +- publisher/blocks/items_columns.php | 8 +- publisher/blocks/items_menu.php | 3 +- publisher/blocks/items_new.php | 25 +- publisher/blocks/items_recent.php | 3 +- publisher/blocks/items_spot.php | 5 +- publisher/blocks/latest_files.php | 3 +- publisher/blocks/latest_news.php | 3 +- publisher/blocks/search.php | 11 +- publisher/category.php | 26 +- publisher/class/constants.php | 20 +- publisher/class/form/item.php | 27 +- publisher/class/metagen.php | 8 +- publisher/class/mimetype.php | 26 +- publisher/class/plugins/plugin.tag.php | 3 +- publisher/class/themetabform.php | 23 +- publisher/class/utilities.php | 18 +- publisher/docs/changelog.txt | 4 +- publisher/docs/index.html | 2 +- publisher/footer.php | 4 +- publisher/include/config.php | 45 +- publisher/include/functions.php | 166 ++- publisher/include/oninstall.php | 8 +- publisher/include/onupdate.php | 28 +- publisher/include/seo.inc.php | 9 +- publisher/include/seo_functions.php | 6 +- publisher/index.php | 23 +- publisher/item.php | 21 +- publisher/language/english/admin.php | 3 + publisher/language/english/help/index.html | 2 +- .../mail_template/category_item_published.tpl | 4 +- .../mail_template/category_item_submitted.tpl | 4 +- .../mail_template/global_item_submitted.tpl | 4 +- .../english/mail_template/item_approved.tpl | 4 +- .../english/mail_template/item_rejected.tpl | 4 +- publisher/language/english/modinfo.php | 626 ++++----- publisher/makepdf.php | 10 +- publisher/search.php | 82 +- publisher/sql/mysql.sql | 156 ++- publisher/submit.php | 59 +- .../blocks/publisher_items_columns.tpl | 129 +- .../templates/blocks/publisher_items_spot.tpl | 34 +- .../blocks/publisher_latest_files.tpl | 4 +- .../blocks/publisher_latest_news.tpl | 311 ++--- publisher/templates/publisher_addfile.tpl | 31 +- publisher/templates/publisher_archive.tpl | 39 +- .../templates/publisher_author_items.tpl | 89 +- .../templates/publisher_categories_table.tpl | 101 +- .../templates/publisher_display_full.tpl | 5 +- .../templates/publisher_display_list.tpl | 72 +- .../templates/publisher_display_wfsection.tpl | 138 +- publisher/templates/publisher_footer.tpl | 11 +- publisher/templates/publisher_header.tpl | 90 +- publisher/templates/publisher_item.tpl | 213 +-- publisher/templates/publisher_singleitem.tpl | 4 +- publisher/thumb.php | 37 +- publisher/xoops_version.php | 510 +++---- 89 files changed, 4477 insertions(+), 4464 deletions(-) diff --git a/publisher/admin/about.php b/publisher/admin/about.php index c5dc06dd..d575df55 100644 --- a/publisher/admin/about.php +++ b/publisher/admin/about.php @@ -35,5 +35,4 @@ // echo 'I am using PHP lower than 5.4, my version: ' . PHP_VERSION . "\n"; // } - xoops_cp_footer(); diff --git a/publisher/admin/admin_header.php b/publisher/admin/admin_header.php index 574150b3..ff296973 100644 --- a/publisher/admin/admin_header.php +++ b/publisher/admin/admin_header.php @@ -30,8 +30,7 @@ 'editimg' => "" . _AM_PUBLISHER_ICO_EDIT . "", 'deleteimg' => "" . _AM_PUBLISHER_ICO_DELETE . "", 'online' => "" . _AM_PUBLISHER_ICO_ONLINE . "", - 'offline' => "" . _AM_PUBLISHER_ICO_OFFLINE . "", -); + 'offline' => "" . _AM_PUBLISHER_ICO_OFFLINE . "",); include_once $GLOBALS['xoops']->path('Frameworks/moduleclasses/moduleadmin/moduleadmin.php'); /* diff --git a/publisher/admin/clone.php b/publisher/admin/clone.php index acdedba1..9a43ee3f 100644 --- a/publisher/admin/clone.php +++ b/publisher/admin/clone.php @@ -27,16 +27,16 @@ if ('submit' == XoopsRequest::getString('op', '', 'POST')) { if (!$GLOBALS['xoopsSecurity']->check()) { redirect_header('clone.php', 3, implode('
', $GLOBALS['xoopsSecurity']->getErrors())); -// exit(); + // exit(); } -// $clone = $_POST['clone']; + // $clone = $_POST['clone']; $clone = XoopsRequest::getString('clone', '', 'POST'); //check if name is valid if (empty($clone) || preg_match('/[^a-zA-Z0-9\_\-]/', $clone)) { redirect_header('clone.php', 3, sprintf(_AM_PUBLISHER_CLONE_INVALIDNAME, $clone)); -// exit(); + // exit(); } // Check wether the cloned module exists or not @@ -47,8 +47,7 @@ $patterns = array( strtolower(PUBLISHER_DIRNAME) => strtolower($clone), strtoupper(PUBLISHER_DIRNAME) => strtoupper($clone), - ucfirst(strtolower(PUBLISHER_DIRNAME)) => ucfirst(strtolower($clone)) - ); + ucfirst(strtolower(PUBLISHER_DIRNAME)) => ucfirst(strtolower($clone))); $patKeys = array_keys($patterns); $patValues = array_values($patterns); @@ -100,14 +99,14 @@ function file_put_contents($filename, $data, $file_append = false) class PublisherClone { -// recursive clonning script + // recursive clonning script /** * @param $path */ public static function cloneFileFolder($path) { - global $patKeys; - global $patValues; + global $patKeys; + global $patValues; $newPath = str_replace($patKeys[0], $patValues[0], $path); diff --git a/publisher/admin/import/ams.php b/publisher/admin/import/ams.php index d3376160..11053b29 100644 --- a/publisher/admin/import/ams.php +++ b/publisher/admin/import/ams.php @@ -23,9 +23,9 @@ include_once dirname(__DIR__) . '/admin_header.php'; $myts = MyTextSanitizer::getInstance(); -$importFromModuleName = "xNews " . XoopsRequest::getString('ams_version', '', 'POST'); +$importFromModuleName = 'AMS ' . XoopsRequest::getString('ams_version', '', 'POST'); -$scriptname = "ams.php"; +$scriptname = 'ams.php'; $op = ('go' == XoopsRequest::getString('op', '', 'POST')) ? 'go' : 'start'; @@ -36,39 +36,39 @@ //publisher_adminMenu(-1, _AM_PUBLISHER_IMPORT); publisherOpenCollapsableBar('amsimport', 'amsimporticon', sprintf(_AM_PUBLISHER_IMPORT_FROM, $importFromModuleName), _AM_PUBLISHER_IMPORT_INFO); - $result = $GLOBALS['xoopsDB']->query("SELECT COUNT(*) FROM " . $GLOBALS['xoopsDB']->prefix("ams_topics")); + $result = $GLOBALS['xoopsDB']->query('SELECT COUNT(*) FROM ' . $GLOBALS['xoopsDB']->prefix('ams_topics')); list ($totalCat) = $GLOBALS['xoopsDB']->fetchRow($result); if ($totalCat == 0) { - echo "" . _AM_PUBLISHER_IMPORT_NO_CATEGORY . ""; + echo "" . _AM_PUBLISHER_IMPORT_NO_CATEGORY . ''; } else { include_once $GLOBALS['xoops']->path('class/xoopstree.php'); - $result = $GLOBALS['xoopsDB']->query("SELECT COUNT(*) FROM " . $GLOBALS['xoopsDB']->prefix("nw_stories")); + $result = $GLOBALS['xoopsDB']->query('SELECT COUNT(*) FROM ' . $GLOBALS['xoopsDB']->prefix('nw_stories')); list ($totalArticles) = $GLOBALS['xoopsDB']->fetchRow($result); if ($totalArticles == 0) { - echo "" . sprintf(_AM_PUBLISHER_IMPORT_MODULE_FOUND_NO_ITEMS, $importFromModuleName, $totalArticles) . ""; + echo "" . sprintf(_AM_PUBLISHER_IMPORT_MODULE_FOUND_NO_ITEMS, $importFromModuleName, $totalArticles) . ''; } else { - echo "" . sprintf(_AM_PUBLISHER_IMPORT_MODULE_FOUND, $importFromModuleName, $totalArticles, $totalCat) . ""; + echo "" . sprintf(_AM_PUBLISHER_IMPORT_MODULE_FOUND, $importFromModuleName, $totalArticles, $totalCat) . ''; - $form = new XoopsThemeForm(_AM_PUBLISHER_IMPORT_SETTINGS, 'import_form', PUBLISHER_ADMIN_URL . "/import/$scriptname"); + $form = new XoopsThemeForm(_AM_PUBLISHER_IMPORT_SETTINGS, 'import_form', PUBLISHER_ADMIN_URL . '/import/$scriptname'); -//---------- mb ------------------ -// add "publisher" category to "imagecategory" table + //---------- mb ------------------ + // add 'publisher' category to 'imagecategory' table -// if (!$GLOBALS['xoopsSecurity']->check()) { -// redirect_header('admin.php?fct=images', 3, implode('
', $GLOBALS['xoopsSecurity']->getErrors())); -// } + // if (!$GLOBALS['xoopsSecurity']->check()) { + // redirect_header('admin.php?fct=images', 3, implode('
', $GLOBALS['xoopsSecurity']->getErrors())); + // } $imageCategoryHandler =& xoops_gethandler('imagecategory'); $imagecategory =& $imageCategoryHandler->create(); -// $imagecategory->setVar('imgcat_name', $imgcat_name); + // $imagecategory->setVar('imgcat_name', $imgcat_name); $imagecategory->setVar('imgcat_name', PUBLISHER_DIRNAME); //$imgcat_name); $imagecategory->setVar('imgcat_maxsize', $GLOBALS['xoopsModuleConfig']['maximum_filesize']); //$imgcat_maxsize); $imagecategory->setVar('imgcat_maxwidth', $GLOBALS['xoopsModuleConfig']['maximum_image_width']);//$imgcat_maxwidth); $imagecategory->setVar('imgcat_maxheight', $GLOBALS['xoopsModuleConfig']['maximum_image_height']);//$imgcat_maxheight); -// $imgcat_display = empty($imgcat_display) ? 0 : 1; + // $imgcat_display = empty($imgcat_display) ? 0 : 1; $imagecategory->setVar('imgcat_display', 1);//$imgcat_display); $imagecategory->setVar('imgcat_weight', 0);//$imgcat_weight); $imagecategory->setVar('imgcat_storetype', 'file');//$imgcat_storetype); @@ -77,7 +77,7 @@ $imageCategoryHandler->insert($imagecategory); // exit(); } catch (Exception $e) { - echo "Caught exception: : couldn't insert Image Category " . $e->getMessage() . "n"; + echo 'Caught exception: couldn not insert Image Category' . $e->getMessage() . 'n'; } $newid = $imagecategory->getVar('imgcat_id'); @@ -86,7 +86,7 @@ $readgroup = array(); } if (!in_array(XOOPS_GROUP_ADMIN, $readgroup)) { - array_push($readgroup, XOOPS_GROUP_ADMIN); + $readgroup[] = XOOPS_GROUP_ADMIN; } foreach ($readgroup as $rgroup) { $imagecategoryperm =& $imagecategoryperm_handler->create(); @@ -97,12 +97,12 @@ $imagecategoryperm_handler->insert($imagecategoryperm); unset($imagecategoryperm); } - unset($rgroup); + // unset($rgroup); if (!isset($writegroup)) { $writegroup = array(); } if (!in_array(XOOPS_GROUP_ADMIN, $writegroup)) { - array_push($writegroup, XOOPS_GROUP_ADMIN); + $writegroup[] = XOOPS_GROUP_ADMIN; } foreach ($writegroup as $wgroup) { $imagecategoryperm =& $imagecategoryperm_handler->create(); @@ -113,12 +113,12 @@ $imagecategoryperm_handler->insert($imagecategoryperm); unset($imagecategoryperm); } - unset($wgroup); + // unset($wgroup); -//---------- mb ------------------ + //---------- mb ------------------ // Categories to be imported - $sql = "SELECT cat.topic_id, cat.topic_pid, cat.topic_title, COUNT(art.storyid) FROM " . $GLOBALS['xoopsDB']->prefix("ams_topics") . " AS cat INNER JOIN " . $GLOBALS['xoopsDB']->prefix("nw_stories") . " AS art ON cat.topic_id=art.topicid GROUP BY art.topicid"; + $sql = 'SELECT cat.topic_id, cat.topic_pid, cat.topic_title, COUNT(art.storyid) FROM ' . $GLOBALS['xoopsDB']->prefix('ams_topics') . ' AS cat INNER JOIN ' . $GLOBALS['xoopsDB']->prefix('nw_stories') . ' AS art ON cat.topic_id=art.topicid GROUP BY art.topicid'; $result = $GLOBALS['xoopsDB']->query($sql); $cat_cbox_options = array(); @@ -128,14 +128,14 @@ $cat_cbox_options[$cid] = "$cat_title ($art_count)"; } - $cat_label = new XoopsFormLabel(_AM_PUBLISHER_IMPORT_CATEGORIES, implode("
", $cat_cbox_options)); + $cat_label = new XoopsFormLabel(_AM_PUBLISHER_IMPORT_CATEGORIES, implode('
', $cat_cbox_options)); $cat_label->setDescription(_AM_PUBLISHER_IMPORT_CATEGORIES_DSC); $form->addElement($cat_label); // Publisher parent category - $mytree = new XoopsTree($GLOBALS['xoopsDB']->prefix("publisher_categories"), "categoryid", "parentid"); + $mytree = new XoopsTree($GLOBALS['xoopsDB']->prefix('publisher_categories'), 'categoryid', 'parentid'); ob_start(); - $mytree->makeMySelBox("name", "weight", $preset_id = 0, $none = 1, $sel_name = "parent_category"); + $mytree->makeMySelBox('name', 'weight', $preset_id = 0, $none = 1, $sel_name = 'parent_category'); $parent_cat_sel = new XoopsFormLabel(_AM_PUBLISHER_IMPORT_PARENT_CATEGORY, ob_get_contents()); $parent_cat_sel->setDescription(_AM_PUBLISHER_IMPORT_PARENT_CATEGORY_DSC); @@ -162,8 +162,8 @@ publisherOpenCollapsableBar('amsimportgo', 'amsimportgoicon', sprintf(_AM_PUBLISHER_IMPORT_FROM, $importFromModuleName), _AM_PUBLISHER_IMPORT_RESULT); $moduleHandler = xoops_gethandler('module'); - $moduleObj = $moduleHandler->getByDirname('ams'); - $ams_module_id = $moduleObj->getVar('mid'); + $moduleObj = $moduleHandler->getByDirname('ams'); + $ams_module_id = $moduleObj->getVar('mid'); $gperm_handler = xoops_gethandler('groupperm'); @@ -172,7 +172,7 @@ $parentId = XoopsRequest::getInt('parent_category', 0, 'POST'); - $sql = "SELECT * FROM " . $GLOBALS['xoopsDB']->prefix('ams_topics'); + $sql = 'SELECT * FROM ' . $GLOBALS['xoopsDB']->prefix('ams_topics'); $resultCat = $GLOBALS['xoopsDB']->query($sql); @@ -180,32 +180,32 @@ $newArticleArray = array(); $imageCategoryHandler =& xoops_gethandler('imagecategory'); -// $criteria = new criteriaCombo; + // $criteria = new criteriaCombo; -// get the total number of subcats for this category -// $criteria = new CriteriaCompo(); -// $criteria->add(new Criteria('imagecategory', $catObj->getVar('cid'), '=')); -// $childCount = (int)($mylinksCatHandler->getCount($criteria)); + // get the total number of subcats for this category + // $criteria = new CriteriaCompo(); + // $criteria->add(new Criteria('imagecategory', $catObj->getVar('cid'), '=')); + // $childCount = (int)($mylinksCatHandler->getCount($criteria)); $criteria = new Criteria('imgcat_name', PUBLISHER_DIRNAME); $imageCategoryId = $imageCategoryHandler->getObjects($criteria); -// $criteria = new CriteriaCompo(); -// $criteria->add(new Criteria("imagecategory", PUBLISHER_DIRNAME, "=")); + // $criteria = new CriteriaCompo(); + // $criteria->add(new Criteria('imagecategory', PUBLISHER_DIRNAME, '=')); -// $newid = $imageCategoryId->getVar('imgcat_id'); + // $newid = $imageCategoryId->getVar('imgcat_id'); $newid = $imageCategoryId[0]->vars['imgcat_id']['value']; -// $newid = $imageCategoryId[0]->vars['imgcat_id']; + // $newid = $imageCategoryId[0]->vars['imgcat_id']; -// $select_form = new XoopsFormSelect("", $name_current, array(), 1); -// $select_form->addOption("", _SELECT); -// $select_form->addOptionArray($writer_handler->getList($criteria)); + // $select_form = new XoopsFormSelect('', $name_current, array(), 1); + // $select_form->addOption('', _SELECT); + // $select_form->addOptionArray($writer_handler->getList($criteria)); -// $sql = "SELECT * FROM " . $GLOBALS['xoopsDB']->prefix('imagecategory') . " WHERE imgcat_name=" . PUBLISHER_DIRNAME; -// $resultImageCategory = $GLOBALS['xoopsDB']->query($sql); -// -// -// $newid = $resultImageCategory->getVar('imgcat_id'); + // $sql = 'SELECT * FROM ' . $GLOBALS['xoopsDB']->prefix('imagecategory') . ' WHERE imgcat_name=' . PUBLISHER_DIRNAME; + // $resultImageCategory = $GLOBALS['xoopsDB']->query($sql); + // + // + // $newid = $resultImageCategory->getVar('imgcat_id'); $oldToNew = array(); while (($arrCat = $GLOBALS['xoopsDB']->fetchArray($resultCat)) !== false) { @@ -219,15 +219,15 @@ $categoryObj->setVar('image', $arrCat['topic_imgurl']); $categoryObj->setVar('weight', $arrCat['weight']); $categoryObj->setVar('name', $arrCat['topic_title']); -// $categoryObj->setVar('description', $arrCat['topic_description']); + // $categoryObj->setVar('description', $arrCat['topic_description']); $categoryObj->setVar('moderator', 1); // Category image: copying to Publisher category uploads if (($arrCat['topic_imgurl'] != 'blank.gif') && ($arrCat['topic_imgurl'] != '')) { - if (copy($GLOBALS['xoops']->path("uploads/AMS/topics/" . $arrCat['topic_imgurl']), $GLOBALS['xoops']->path("uploads/" . PUBLISHER_DIRNAME . "/images/category/" . $arrCat['topic_imgurl']))) { + if (copy($GLOBALS['xoops']->path('uploads/AMS/topics/' . $arrCat['topic_imgurl']), $GLOBALS['xoops']->path('uploads/' . PUBLISHER_DIRNAME . '/images/category/' . $arrCat['topic_imgurl']))) { $categoryObj->setVar('image', $arrCat['topic_imgurl']); -//======== there is no need to add the category images to Image Manager, because they are handled directly from /images/category/ folder + //======== there is no need to add the category images to Image Manager, because they are handled directly from /images/category/ folder /* @@ -247,26 +247,26 @@ */ -//============================ + //============================ } } if (!$publisher->getHandler('category')->insert($categoryObj)) { - echo sprintf(_AM_PUBLISHER_IMPORT_CATEGORY_ERROR, $arrCat['topic_title']) . "
"; + echo sprintf(_AM_PUBLISHER_IMPORT_CATEGORY_ERROR, $arrCat['topic_title']) . '
'; continue; } //copy all images to Image Manager - $src = $GLOBALS['xoops']->path("uploads/AMS/topics/"); - $dst = $GLOBALS['xoops']->path("uploads"); + $src = $GLOBALS['xoops']->path('uploads/AMS/topics/'); + $dst = $GLOBALS['xoops']->path('uploads'); PublisherUtilities::recurseCopy($src, $dst); //populate the Image Manager with images from xNews articles (by Bleekk) - $sql = "INSERT INTO " . $GLOBALS['xoopsDB']->prefix("image") . "(`image_name`, `image_nicename`, `image_mimetype`, `image_display`, `image_weight`, `imgcat_id`) + $sql = 'INSERT INTO ' . $GLOBALS['xoopsDB']->prefix('image') . "(`image_name`, `image_nicename`, `image_mimetype`, `image_display`, `image_weight`, `imgcat_id`) SELECT s.picture, RIGHT(s.picture,13) AS nicename, @@ -274,7 +274,7 @@ 1 AS image_display, 0 AS image_weight, c.imgcat_id - FROM " . $GLOBALS['xoopsDB']->prefix("ams_article") . " s, " . $GLOBALS['xoopsDB']->prefix("imagecategory") . " c + FROM " . $GLOBALS['xoopsDB']->prefix('ams_article') . ' s, ' . $GLOBALS['xoopsDB']->prefix('imagecategory') . " c WHERE s.picture <> '' AND c.imgcat_name = '" . PUBLISHER_DIRNAME . "'"; @@ -283,9 +283,9 @@ $newCat['newid'] = $categoryObj->categoryid(); ++$cnt_imported_cat; - echo sprintf(_AM_PUBLISHER_IMPORT_CATEGORY_SUCCESS, $categoryObj->name()) . "
"; + echo sprintf(_AM_PUBLISHER_IMPORT_CATEGORY_SUCCESS, $categoryObj->name()) . '
'; - $sql = "SELECT * FROM " . $GLOBALS['xoopsDB']->prefix('ams_article') . " WHERE topicid=" . $arrCat['topic_id']; + $sql = 'SELECT * FROM ' . $GLOBALS['xoopsDB']->prefix('ams_article') . ' WHERE topicid=' . $arrCat['topic_id']; $resultArticles = $GLOBALS['xoopsDB']->query($sql); while (($arrArticle = $GLOBALS['xoopsDB']->fetchArray($resultArticles)) !== false) { // insert article @@ -303,20 +303,20 @@ $itemObj->setVar('weight', 0); $itemObj->setVar('status', PublisherConstantsInterface::PUBLISHER_STATUS_PUBLISHED); -// $itemObj->setVar('dobr', !$arrArticle['dobr']); -// $itemObj->setVar('item_tag', $arrArticle['tags']); + // $itemObj->setVar('dobr', !$arrArticle['dobr']); + // $itemObj->setVar('item_tag', $arrArticle['tags']); $itemObj->setVar('notifypub', $arrArticle['notifypub']); -//-------- image + //-------- image $img_handler =& xoops_gethandler('image'); -// $criteria = new Criteria('image_name', $arrArticle['picture']); + // $criteria = new Criteria('image_name', $arrArticle['picture']); $imageId = $img_handler->getObjects($criteria); $newImageId = $imageId[0]->vars['image_id']['value']; $itemObj->setVar('image', $newImageId); $itemObj->setVar('images', $newImageId); -//-------------- + //-------------- $itemObj->setVar('rating', $arrArticle['rating']); $itemObj->setVar('votes', $arrArticle['votes']); @@ -327,29 +327,29 @@ /* // HTML Wrap if ($arrArticle['htmlpage']) { - $pagewrap_filename = $GLOBALS['xoops']->path("modules/wfsection/html/" .$arrArticle['htmlpage']); + $pagewrap_filename = $GLOBALS['xoops']->path('modules/wfsection/html/' .$arrArticle['htmlpage']); if (file_exists($pagewrap_filename)) { - if (copy($pagewrap_filename, $GLOBALS['xoops']->path("uploads/publisher/content/" . $arrArticle['htmlpage']))) { - $itemObj->setVar('body', "[pagewrap=" . $arrArticle['htmlpage'] . "]"); - echo sprintf("    " . _AM_PUBLISHER_IMPORT_ARTICLE_WRAP, $arrArticle['htmlpage']) . "
"; + if (copy($pagewrap_filename, $GLOBALS['xoops']->path('uploads/publisher/content/' . $arrArticle['htmlpage']))) { + $itemObj->setVar('body', '[pagewrap=' . $arrArticle['htmlpage'] . ']'); + echo sprintf('    ' . _AM_PUBLISHER_IMPORT_ARTICLE_WRAP, $arrArticle['htmlpage']) . '
'; } } } */ if (!$itemObj->store()) { - echo sprintf(" " . _AM_PUBLISHER_IMPORT_ARTICLE_ERROR, $arrArticle['storyid'] . ' ' . $arrArticle['title']) . "
"; + echo sprintf(' ' . _AM_PUBLISHER_IMPORT_ARTICLE_ERROR, $arrArticle['storyid'] . ' ' . $arrArticle['title']) . '
'; continue; } else { -//-------------------------------------------- + //-------------------------------------------- // Linkes files - $sql = "SELECT * FROM " . $GLOBALS['xoopsDB']->prefix("ams_article_files") . " WHERE storyid=" . $arrArticle['storyid']; + $sql = 'SELECT * FROM ' . $GLOBALS['xoopsDB']->prefix('ams_article_files') . ' WHERE storyid=' . $arrArticle['storyid']; $resultFiles = $GLOBALS['xoopsDB']->query($sql); $allowed_mimetypes = ''; while (($arrFile = $GLOBALS['xoopsDB']->fetchArray($resultFiles)) !== false) { - $filename = $GLOBALS['xoops']->path("uploads/AMS/attached/" . $arrFile['downloadname']); + $filename = $GLOBALS['xoops']->path('uploads/AMS/attached/' . $arrFile['downloadname']); if (file_exists($filename)) { - if (copy($filename, $GLOBALS['xoops']->path("uploads/publisher/" . $arrFile['filerealname']))) { + if (copy($filename, $GLOBALS['xoops']->path('uploads/publisher/' . $arrFile['filerealname']))) { $fileObj = $publisher->getHandler('file')->create(); $fileObj->setVar('name', $arrFile['filerealname']); $fileObj->setVar('description', $arrFile['filerealname']); @@ -363,16 +363,16 @@ $fileObj->setVar('short_url', $arrFile['filerealname']); if ($fileObj->store($allowed_mimetypes, true, false)) { - echo "    " . sprintf(_AM_PUBLISHER_IMPORTED_ARTICLE_FILE, $arrFile['filerealname']) . "
"; + echo '    ' . sprintf(_AM_PUBLISHER_IMPORTED_ARTICLE_FILE, $arrFile['filerealname']) . '
'; } } } } -//------------------------ + //------------------------ $newArticleArray[$arrArticle['storyid']] = $itemObj->itemid(); - echo "  " . sprintf(_AM_PUBLISHER_IMPORTED_ARTICLE, $itemObj->title()) . "
"; + echo '  ' . sprintf(_AM_PUBLISHER_IMPORTED_ARTICLE, $itemObj->title()) . '
'; ++$cnt_imported_articles; } } @@ -388,7 +388,7 @@ $newCatArray[$newCat['oldid']] = $newCat; unset($newCat); - echo "
"; + echo '
'; } // Looping through category to change the parentID to the new parentID @@ -407,12 +407,12 @@ unset($oldid, $newCat); // Looping through the comments to link them to the new articles and module - echo _AM_PUBLISHER_IMPORT_COMMENTS . "
"; + echo _AM_PUBLISHER_IMPORT_COMMENTS . '
'; $publisher_module_id = $publisher->getModule()->mid(); $commentHandler = xoops_gethandler('comment'); - $criteria = new CriteriaCompo(); + $criteria = new CriteriaCompo(); $criteria->add(new Criteria('com_modid', $ams_module_id)); $comments = $commentHandler->getObjects($criteria); foreach ($comments as $comment) { @@ -420,18 +420,18 @@ $comment->setVar('com_modid', $publisher_module_id); $comment->setNew(); if (!$commentHandler->insert($comment)) { - echo "  " . sprintf(_AM_PUBLISHER_IMPORTED_COMMENT_ERROR, $comment->getVar('com_title')) . "
"; + echo '  ' . sprintf(_AM_PUBLISHER_IMPORTED_COMMENT_ERROR, $comment->getVar('com_title')) . '
'; } else { - echo "  " . sprintf(_AM_PUBLISHER_IMPORTED_COMMENT, $comment->getVar('com_title')) . "
"; + echo '  ' . sprintf(_AM_PUBLISHER_IMPORTED_COMMENT, $comment->getVar('com_title')) . '
'; } } - unset($comment); + // unset($comment); - echo "

Done.
"; - echo sprintf(_AM_PUBLISHER_IMPORTED_CATEGORIES, $cnt_imported_cat) . "
"; - echo sprintf(_AM_PUBLISHER_IMPORTED_ARTICLES, $cnt_imported_articles) . "
"; - echo "
" . _AM_PUBLISHER_IMPORT_GOTOMODULE . "
"; + echo '

Done.
'; + echo sprintf(_AM_PUBLISHER_IMPORTED_CATEGORIES, $cnt_imported_cat) . '
'; + echo sprintf(_AM_PUBLISHER_IMPORTED_ARTICLES, $cnt_imported_articles) . '
'; + echo "
" . _AM_PUBLISHER_IMPORT_GOTOMODULE . '
'; publisherCloseCollapsableBar('amsimportgo', 'amsimportgoicon'); xoops_cp_footer(); diff --git a/publisher/admin/import/cjaycontent.php b/publisher/admin/import/cjaycontent.php index e70af6f8..d828849e 100644 --- a/publisher/admin/import/cjaycontent.php +++ b/publisher/admin/import/cjaycontent.php @@ -23,9 +23,9 @@ include_once dirname(__DIR__) . '/admin_header.php'; $myts = MyTextSanitizer::getInstance(); -$importFromModuleName = "cjaycontent " . XoopsRequest::getString('cjaycontent_version', '', 'POST'); +$importFromModuleName = 'cjaycontent ' . XoopsRequest::getString('cjaycontent_version', '', 'POST'); -$scriptname = "cjaycontent.php"; +$scriptname = 'cjaycontent.php'; $op = ('go' == XoopsRequest::getString('op', '', 'POST')) ? 'go' : 'start'; @@ -54,30 +54,15 @@ publisherCpHeader(); //publisher_adminMenu(-1, _AM_PUBLISHER_IMPORT); - publisherOpenCollapsableBar( - 'cjaycontentimport', - 'cjaycontentimporticon', - sprintf(_AM_PUBLISHER_IMPORT_FROM, $importFromModuleName), - _AM_PUBLISHER_IMPORT_INFO - ); + publisherOpenCollapsableBar('cjaycontentimport', 'cjaycontentimporticon', sprintf(_AM_PUBLISHER_IMPORT_FROM, $importFromModuleName), _AM_PUBLISHER_IMPORT_INFO); $result = $GLOBALS['xoopsDB']->query("SELECT COUNT(*) FROM " . $GLOBALS['xoopsDB']->prefix("cjaycontent")); list ($totalArticles) = $GLOBALS['xoopsDB']->fetchRow($result); if ($totalArticles == 0) { - echo "" . sprintf( - _AM_PUBLISHER_IMPORT_MODULE_FOUND_NO_ITEMS, - $importFromModuleName, - $totalArticles - ) . ""; + echo "" . sprintf(_AM_PUBLISHER_IMPORT_MODULE_FOUND_NO_ITEMS, $importFromModuleName, $totalArticles) . ""; } else { - echo "" . sprintf( - _AM_PUBLISHER_IMPORT_MODULE_FOUND, - $importFromModuleName, - $totalArticles, - $totalCat - ) - . ""; + echo "" . sprintf(_AM_PUBLISHER_IMPORT_MODULE_FOUND, $importFromModuleName, $totalArticles, $totalCat) . ""; $form = new XoopsThemeForm(_AM_PUBLISHER_IMPORT_SETTINGS, 'import_form', PUBLISHER_ADMIN_URL . "/import/$scriptname"); @@ -90,7 +75,7 @@ $form->display(); } -// } + // } publisherCloseCollapsableBar('cjaycontentimport', 'cjaycontentimporticon'); xoops_cp_footer(); @@ -100,14 +85,9 @@ publisherCpHeader(); //publisher_adminMenu(-1, _AM_PUBLISHER_IMPORT); include_once (dirname(dirname(__DIR__))) . '/include/common.php'; - publisherOpenCollapsableBar( - 'cjaycontentimportgo', - 'cjaycontentimportgoicon', - sprintf(_AM_PUBLISHER_IMPORT_FROM, $importFromModuleName), - _AM_PUBLISHER_IMPORT_RESULT - ); - - $moduleHandler = xoops_gethandler('module'); + publisherOpenCollapsableBar('cjaycontentimportgo', 'cjaycontentimportgoicon', sprintf(_AM_PUBLISHER_IMPORT_FROM, $importFromModuleName), _AM_PUBLISHER_IMPORT_RESULT); + + $moduleHandler = xoops_gethandler('module'); $moduleObj = $moduleHandler->getByDirname('cjaycontent'); $cjaycontent_module_id = $moduleObj->getVar('mid'); @@ -125,28 +105,28 @@ // insert article $itemObj = $publisher->getHandler('item')->create(); $itemObj->setVar('itemid', $arrArticle['id']); -// $itemObj->setVar('categoryid', $categoryObj->categoryid()); + // $itemObj->setVar('categoryid', $categoryObj->categoryid()); $itemObj->setVar('title', $arrArticle['title']); $itemObj->setVar('uid', $arrArticle['submitter']); $itemObj->setVar('summary', $arrArticle['comment']); $itemObj->setVar('body', $arrArticle['content']); $itemObj->setVar('counter', $arrArticle['hits']); $itemObj->setVar('datesub', $arrArticle['date']); -// $itemObj->setVar('dohtml', !$arrArticle['nohtml']); -// $itemObj->setVar('dosmiley', !$arrArticle['nosmiley']); + // $itemObj->setVar('dohtml', !$arrArticle['nohtml']); + // $itemObj->setVar('dosmiley', !$arrArticle['nosmiley']); $itemObj->setVar('weight', $arrArticle['weight']); $itemObj->setVar('status', PublisherConstantsInterface::PUBLISHER_STATUS_PUBLISHED); -// $itemObj->setVar('dobr', !$arrArticle['dobr']); -// $itemObj->setVar('item_tag', $arrArticle['tags']); -// $itemObj->setVar('notifypub', $arrArticle['notifypub']); + // $itemObj->setVar('dobr', !$arrArticle['dobr']); + // $itemObj->setVar('item_tag', $arrArticle['tags']); + // $itemObj->setVar('notifypub', $arrArticle['notifypub']); $itemObj->setVar('image', $arrArticle['image']); -// $itemObj->setVar('rating', $arrArticle['rating']); -// $itemObj->setVar('votes', $arrArticle['votes']); -// $itemObj->setVar('comments', $arrArticle['comments']); -// $itemObj->setVar('meta_keywords', $arrArticle['keywords']); -// $itemObj->setVar('meta_description', $arrArticle['description']); + // $itemObj->setVar('rating', $arrArticle['rating']); + // $itemObj->setVar('votes', $arrArticle['votes']); + // $itemObj->setVar('comments', $arrArticle['comments']); + // $itemObj->setVar('meta_keywords', $arrArticle['keywords']); + // $itemObj->setVar('meta_description', $arrArticle['description']); /* // HTML Wrap @@ -162,24 +142,24 @@ */ if (!$itemObj->store()) { - echo sprintf(" " . _AM_PUBLISHER_IMPORT_ARTICLE_ERROR, $arrArticle['title']) . "
"; + echo sprintf(' ' . _AM_PUBLISHER_IMPORT_ARTICLE_ERROR, $arrArticle['title']) . '
'; continue; } else { $newArticleArray[$arrArticle['id']] = $itemObj->itemid(); - echo "  " . sprintf(_AM_PUBLISHER_IMPORTED_ARTICLE, $itemObj->title()) . "
"; + echo '  ' . sprintf(_AM_PUBLISHER_IMPORTED_ARTICLE, $itemObj->title()) . '
'; ++$cnt_imported_articles; } } - echo "
"; + echo '
'; -// Looping through the comments to link them to the new articles and module - echo _AM_PUBLISHER_IMPORT_COMMENTS . "
"; + // Looping through the comments to link them to the new articles and module + echo _AM_PUBLISHER_IMPORT_COMMENTS . '
'; $publisher_module_id = $publisher->getModule()->mid(); $commentHandler = xoops_gethandler('comment'); - $criteria = new CriteriaCompo(); + $criteria = new CriteriaCompo(); $criteria->add(new Criteria('com_modid', $cjaycontent_module_id)); $comments = $commentHandler->getObjects($criteria); foreach ($comments as $comment) { @@ -187,9 +167,9 @@ $comment->setVar('com_modid', $publisher_module_id); $comment->setNew(); if (!$commentHandler->insert($comment)) { - echo "  " . sprintf(_AM_PUBLISHER_IMPORTED_COMMENT_ERROR, $comment->getVar('com_title')) . "
"; + echo "  " . sprintf(_AM_PUBLISHER_IMPORTED_COMMENT_ERROR, $comment->getVar('com_title')) . '
'; } else { - echo "  " . sprintf(_AM_PUBLISHER_IMPORTED_COMMENT, $comment->getVar('com_title')) . "
"; + echo "  " . sprintf(_AM_PUBLISHER_IMPORTED_COMMENT, $comment->getVar('com_title')) . '
'; } } @@ -197,8 +177,8 @@ echo "

Done.
"; - echo sprintf(_AM_PUBLISHER_IMPORTED_ARTICLES, $cnt_imported_articles) . "
"; - echo "
" . _AM_PUBLISHER_IMPORT_GOTOMODULE . "
"; + echo sprintf(_AM_PUBLISHER_IMPORTED_ARTICLES, $cnt_imported_articles) . '
'; + echo "
" . _AM_PUBLISHER_IMPORT_GOTOMODULE . '
'; publisherCloseCollapsableBar('cjaycontentimportgo', 'cjaycontentimportgoicon'); xoops_cp_footer(); diff --git a/publisher/admin/import/fmcontent.php b/publisher/admin/import/fmcontent.php index edd8476a..c03daf80 100644 --- a/publisher/admin/import/fmcontent.php +++ b/publisher/admin/import/fmcontent.php @@ -24,9 +24,9 @@ include_once dirname(__DIR__) . '/admin_header.php'; $myts = MyTextSanitizer::getInstance(); -$importFromModuleName = "FmContent " . XoopsRequest::getString('fmcontent_version', '', 'POST'); +$importFromModuleName = 'FmContent ' . XoopsRequest::getString('fmcontent_version', '', 'POST'); -$scriptname = "fmcontent.php"; +$scriptname = 'fmcontent.php'; $op = ('go' == XoopsRequest::getString('op', '', 'POST')) ? 'go' : 'start'; @@ -38,14 +38,14 @@ publisherOpenCollapsableBar('fmimport', 'fmimporticon', sprintf(_AM_PUBLISHER_IMPORT_FROM, $importFromModuleName), _AM_PUBLISHER_IMPORT_INFO); $moduleHandler = xoops_gethandler('module'); - $moduleObj = $moduleHandler->getByDirname('fmcontent'); - $fm_module_id = $moduleObj->getVar('mid'); + $moduleObj = $moduleHandler->getByDirname('fmcontent'); + $fm_module_id = $moduleObj->getVar('mid'); $fmTopicHdlr =& xoops_getmodulehandler('topic', 'fmcontent'); $fmTopicCount = $fmTopicHdlr->getCount(new Criteria('topic_modid', $fm_module_id)); if (empty($fmTopicCount)) { - echo "" . _AM_PUBLISHER_IMPORT_NO_CATEGORY . ""; + echo "" . _AM_PUBLISHER_IMPORT_NO_CATEGORY . ''; } else { include_once $GLOBALS['xoops']->path('www/class/xoopstree.php'); $fmContentHdlr =& xoops_getmodulehandler('page', 'fmcontent'); @@ -59,7 +59,7 @@ $form = new XoopsThemeForm(_AM_PUBLISHER_IMPORT_SETTINGS, 'import_form', PUBLISHER_ADMIN_URL . "/import/$scriptname"); */ // Categories to be imported - $sql = "SELECT cat.topic_id, cat.topic_pid, cat.topic_title, COUNT(art.content_id) FROM " . $GLOBALS['xoopsDB']->prefix("fmcontent_topic") . " AS cat INNER JOIN " . $GLOBALS['xoopsDB']->prefix("fmcontent_content") . " AS art ON ((cat.topic_id=art.content_topic) AND (cat.topic_modid=art.content_modid)) WHERE cat.topic_modid={$fm_module_id} GROUP BY art.content_topic"; + $sql = "SELECT cat.topic_id, cat.topic_pid, cat.topic_title, COUNT(art.content_id) FROM " . $GLOBALS['xoopsDB']->prefix('fmcontent_topic') . " AS cat INNER JOIN " . $GLOBALS['xoopsDB']->prefix("fmcontent_content") . " AS art ON ((cat.topic_id=art.content_topic) AND (cat.topic_modid=art.content_modid)) WHERE cat.topic_modid={$fm_module_id} GROUP BY art.content_topic"; $result = $GLOBALS['xoopsDB']->query($sql); $cat_cbox_options = array(); @@ -81,7 +81,7 @@ echo "" . sprintf(_AM_PUBLISHER_IMPORT_MODULE_FOUND, $importFromModuleName, $fmContentCount, count($cat_cbox_options)) . ""; $form = new XoopsThemeForm(_AM_PUBLISHER_IMPORT_SETTINGS, 'import_form', PUBLISHER_ADMIN_URL . "/import/$scriptname"); - $cat_label = new XoopsFormLabel(_AM_PUBLISHER_IMPORT_CATEGORIES, implode("
", $cat_cbox_options)); + $cat_label = new XoopsFormLabel(_AM_PUBLISHER_IMPORT_CATEGORIES, implode('
', $cat_cbox_options)); $cat_label->setDescription(_AM_PUBLISHER_IMPORT_CATEGORIES_DSC); $form->addElement($cat_label); @@ -123,8 +123,8 @@ publisherOpenCollapsableBar('fmimportgo', 'fmimportgoicon', sprintf(_AM_PUBLISHER_IMPORT_FROM, $importFromModuleName), _AM_PUBLISHER_IMPORT_RESULT); $moduleHandler = xoops_gethandler('module'); - $moduleObj = $moduleHandler->getByDirname('fmcontent'); - $fm_module_id = $moduleObj->getVar('mid'); + $moduleObj = $moduleHandler->getByDirname('fmcontent'); + $fm_module_id = $moduleObj->getVar('mid'); $gperm_handler = xoops_gethandler('groupperm'); @@ -146,15 +146,16 @@ // create Publsher category to hold FmContent Content items with no Topic (content_topic=0) $categoryObj = $publisher->getHandler('category')->create(); - $categoryObj->setVars(array('parentid' => $parentId, - 'name' => _AM_PUBLISHER_IMPORT_FMCONTENT_NAME, - 'description' => _AM_PUBLISHER_IMPORT_FMCONTENT_TLT, - 'image' => '', - 'total' => 0, - 'weight' => 1, - 'created' => time(), - 'moderator', $GLOBALS['xoopsUser']->getVar('uid')) - ); + $categoryObj->setVars(array( + 'parentid' => $parentId, + 'name' => _AM_PUBLISHER_IMPORT_FMCONTENT_NAME, + 'description' => _AM_PUBLISHER_IMPORT_FMCONTENT_TLT, + 'image' => '', + 'total' => 0, + 'weight' => 1, + 'created' => time(), + 'moderator', + $GLOBALS['xoopsUser']->getVar('uid'))); $categoryObj->store(); $fmTopicHdlr =& xoops_getmodulehandler('topic', 'fmcontent'); @@ -162,39 +163,39 @@ // insert articles for this category foreach ($fmContentObjs as $thisFmContentObj) { $itemObj = $publisher->getHandler('item')->create(); - $itemObj->setVars(array('categoryid' => $categoryObj->categoryid(), - 'title' => $thisFmContentObj->getVar('content_title'), - 'uid' => $thisFmContentObj->getVar('content_uid'), - 'summary' => $thisFmContentObj->getVar('content_short'), - 'body' => $thisFmContentObj->getVar('content_text'), - 'datesub' => $thisFmContentObj->getVar('content_create'), - 'dohtml' => $thisFmContentObj->getVar('dohtml'), - 'dosmiley' => $thisFmContentObj->getVar('dosmiley'), - 'doxcode' => $thisFmContentObj->getVar('doxcode'), - 'doimage' => $thisFmContentObj->getVar('doimage'), - 'dobr' => $thisFmContentObj->getVar('dobr'), - 'weight' => $thisFmContentObj->getVar('content_order'), - 'status' => ($thisFmContentObj->getVar('content_status')) ? PublisherConstantsInterface::PUBLISHER_STATUS_PUBLISHED : PublisherConstantsInterface::PUBLISHER_STATUS_OFFLINE, - 'counter' => $thisFmContentObj->getVar('content_hits'), - 'rating' => 0, - 'votes' => 0, - 'comments' => $thisFmContentObj->getVar('content_comments'), - 'meta_keywords' => $thisFmContentObj->getVar('content_words'), - 'meta_description' => $thisFmContentObj->getVar('content_desc')) - ); + $itemObj->setVars(array( + 'categoryid' => $categoryObj->categoryid(), + 'title' => $thisFmContentObj->getVar('content_title'), + 'uid' => $thisFmContentObj->getVar('content_uid'), + 'summary' => $thisFmContentObj->getVar('content_short'), + 'body' => $thisFmContentObj->getVar('content_text'), + 'datesub' => $thisFmContentObj->getVar('content_create'), + 'dohtml' => $thisFmContentObj->getVar('dohtml'), + 'dosmiley' => $thisFmContentObj->getVar('dosmiley'), + 'doxcode' => $thisFmContentObj->getVar('doxcode'), + 'doimage' => $thisFmContentObj->getVar('doimage'), + 'dobr' => $thisFmContentObj->getVar('dobr'), + 'weight' => $thisFmContentObj->getVar('content_order'), + 'status' => ($thisFmContentObj->getVar('content_status')) ? PublisherConstantsInterface::PUBLISHER_STATUS_PUBLISHED : PublisherConstantsInterface::PUBLISHER_STATUS_OFFLINE, + 'counter' => $thisFmContentObj->getVar('content_hits'), + 'rating' => 0, + 'votes' => 0, + 'comments' => $thisFmContentObj->getVar('content_comments'), + 'meta_keywords' => $thisFmContentObj->getVar('content_words'), + 'meta_description' => $thisFmContentObj->getVar('content_desc'))); $contentImg = $thisFmContentObj->getVar('content_img'); if (!empty($contentImg)) { - $itemObj->setVars(array('images' => 1, - 'image' => $thisFmContentObj->getVar('content_img')) - ); + $itemObj->setVars(array( + 'images' => 1, + 'image' => $thisFmContentObj->getVar('content_img'))); } if (!$itemObj->store()) { - echo sprintf(" " . _AM_PUBLISHER_IMPORT_ARTICLE_ERROR, $thisFmContentObj->getVar('title')) . "
\n"; + echo sprintf(" " . _AM_PUBLISHER_IMPORT_ARTICLE_ERROR, $thisFmContentObj->getVar('title')) . '
\n'; continue; } else { $newArticleArray[$thisFmContentObj->getVar('storyid')] = $itemObj->itemid(); - echo "  " . sprintf(_AM_PUBLISHER_IMPORTED_ARTICLE, $itemObj->title()) . "
\n"; + echo '  ' . sprintf(_AM_PUBLISHER_IMPORTED_ARTICLE, $itemObj->title()) . '
\n'; ++$cnt_imported_articles; } } @@ -218,17 +219,17 @@ // first create FmContent Topics as Publisher Categories foreach ($fmTopicObjs as $thisFmTopicObj) { - $CatIds = array('oldid' => $thisFmTopicObj->getVar('topic_id'), - 'oldpid' => $thisFmTopicObj->getVar('topic_pid') - ); + $CatIds = array( + 'oldid' => $thisFmTopicObj->getVar('topic_id'), + 'oldpid' => $thisFmTopicObj->getVar('topic_pid')); $categoryObj = $publisher->getHandler('category')->create(); - $categoryObj->setVars(array('parentid' => $thisFmTopicObj->getVar('topic_pid'), - 'weight' => $thisFmTopicObj->getVar('topic_weight'), - 'name' => $thisFmTopicObj->getVar('topic_title'), - 'description' => $thisFmTopicObj->getVar('topic_desc')) - ); + $categoryObj->setVars(array( + 'parentid' => $thisFmTopicObj->getVar('topic_pid'), + 'weight' => $thisFmTopicObj->getVar('topic_weight'), + 'name' => $thisFmTopicObj->getVar('topic_title'), + 'description' => $thisFmTopicObj->getVar('topic_desc'))); // Category image if (('blank.gif' != $thisFmTopicObj->getVar('topic_img')) && ('' != $thisFmTopicObj->getVar('topic_img'))) { @@ -255,26 +256,26 @@ // insert articles for this category foreach ($fmContentObjs as $thisFmContentObj) { $itemObj = $publisher->getHandler('item')->create(); - $itemObj->setVars(array('categoryid' => $CatIds['newid'], - 'title' => $thisFmContentObj->getVar('content_title'), - 'uid' => $thisFmContentObj->getVar('content_uid'), - 'summary' => $thisFmContentObj->getVar('content_short'), - 'body' => $thisFmContentObj->getVar('content_text'), - 'counter' => $thisFmContentObj->getVar('content_hits'), - 'datesub' => $thisFmContentObj->getVar('content_create'), - 'dohtml' => $thisFmContentObj->getVar('dohtml'), - 'dosmiley' => $thisFmContentObj->getVar('dosmiley'), - 'doxcode' => $thisFmContentObj->getVar('doxcode'), - 'doimage' => $thisFmContentObj->getVar('doimage'), - 'dobr' => $thisFmContentObj->getVar('dobr'), - 'weight' => $thisFmContentObj->getVar('content_order'), - 'status' => ($thisFmContentObj->getVar('content_status')) ? PublisherConstantsInterface::PUBLISHER_STATUS_PUBLISHED : PublisherConstantsInterface::PUBLISHER_STATUS_OFFLINE, - 'rating' => 0, - 'votes' => 0, - 'comments' => $thisFmContentObj->getVar('content_comments'), - 'meta_keywords' => $thisFmContentObj->getVar('content_words'), - 'meta_description' => $thisFmContentObj->getVar('content_desc')) - ); + $itemObj->setVars(array( + 'categoryid' => $CatIds['newid'], + 'title' => $thisFmContentObj->getVar('content_title'), + 'uid' => $thisFmContentObj->getVar('content_uid'), + 'summary' => $thisFmContentObj->getVar('content_short'), + 'body' => $thisFmContentObj->getVar('content_text'), + 'counter' => $thisFmContentObj->getVar('content_hits'), + 'datesub' => $thisFmContentObj->getVar('content_create'), + 'dohtml' => $thisFmContentObj->getVar('dohtml'), + 'dosmiley' => $thisFmContentObj->getVar('dosmiley'), + 'doxcode' => $thisFmContentObj->getVar('doxcode'), + 'doimage' => $thisFmContentObj->getVar('doimage'), + 'dobr' => $thisFmContentObj->getVar('dobr'), + 'weight' => $thisFmContentObj->getVar('content_order'), + 'status' => ($thisFmContentObj->getVar('content_status')) ? PublisherConstantsInterface::PUBLISHER_STATUS_PUBLISHED : PublisherConstantsInterface::PUBLISHER_STATUS_OFFLINE, + 'rating' => 0, + 'votes' => 0, + 'comments' => $thisFmContentObj->getVar('content_comments'), + 'meta_keywords' => $thisFmContentObj->getVar('content_words'), + 'meta_description' => $thisFmContentObj->getVar('content_desc'))); $contentImg = $thisFmContentObj->getVar('content_img'); if (!empty($contentImg)) { $itemObj->setVar('images', 1); @@ -286,7 +287,7 @@ continue; } else { $newArticleArray[$thisFmContentObj->getVar('storyid')] = $itemObj->itemid(); - echo "  " . sprintf(_AM_PUBLISHER_IMPORTED_ARTICLE, $itemObj->title()) . "
\n"; + echo '  ' . sprintf(_AM_PUBLISHER_IMPORTED_ARTICLE, $itemObj->title()) . "
\n"; ++$cnt_imported_articles; } } @@ -301,7 +302,7 @@ unset($CatIds, $thisFmContentObj); echo "
\n"; } - unset($thisFmTopicObj); + // unset($thisFmTopicObj); // Looping through cat to change the parentid to the new parentid foreach ($newCatArray as $oldid => $CatIds) { @@ -320,7 +321,7 @@ $publisher_module_id = $publisher->getModule()->mid(); $commentHandler = xoops_gethandler('comment'); - $criteria = new CriteriaCompo(); + $criteria = new CriteriaCompo(); $criteria->add(new Criteria('com_modid', $fm_module_id)); $comments = $commentHandler->getObjects($criteria); foreach ($comments as $comment) { @@ -334,12 +335,9 @@ } } - unset($comment); + // unset($comment); - echo "

" . _AM_PUBLISHER_IMPORT_DONE . "
\n" - . "" . sprintf(_AM_PUBLISHER_IMPORTED_CATEGORIES, $cnt_imported_cat) . "
\n" - . "" . sprintf(_AM_PUBLISHER_IMPORTED_ARTICLES, $cnt_imported_articles) . "
\n" - . "
\n" . _AM_PUBLISHER_IMPORT_GOTOMODULE . "
\n"; + echo "

" . _AM_PUBLISHER_IMPORT_DONE . "
\n" . "" . sprintf(_AM_PUBLISHER_IMPORTED_CATEGORIES, $cnt_imported_cat) . "
\n" . "" . sprintf(_AM_PUBLISHER_IMPORTED_ARTICLES, $cnt_imported_articles) . "
\n" . "
\n" . _AM_PUBLISHER_IMPORT_GOTOMODULE . "
\n"; publisherCloseCollapsableBar('fmimportgo', 'fmimportgoicon'); xoops_cp_footer(); diff --git a/publisher/admin/import/news.php b/publisher/admin/import/news.php index e98b0fc7..62500964 100644 --- a/publisher/admin/import/news.php +++ b/publisher/admin/import/news.php @@ -23,9 +23,9 @@ include_once dirname(__DIR__) . '/admin_header.php'; $myts = MyTextSanitizer::getInstance(); -$importFromModuleName = "News " . XoopsRequest::getString('news_version', '', 'POST'); +$importFromModuleName = 'News ' . XoopsRequest::getString('news_version', '', 'POST'); -$scriptname = "news.php"; +$scriptname = 'news.php'; $op = ('go' == XoopsRequest::getString('op', '', 'POST')) ? 'go' : 'start'; @@ -36,43 +36,43 @@ //publisher_adminMenu(-1, _AM_PUBLISHER_IMPORT); publisherOpenCollapsableBar('newsimport', 'newsimporticon', sprintf(_AM_PUBLISHER_IMPORT_FROM, $importFromModuleName), _AM_PUBLISHER_IMPORT_INFO); - $result = $GLOBALS['xoopsDB']->query("SELECT COUNT(*) FROM " . $GLOBALS['xoopsDB']->prefix("topics")); + $result = $GLOBALS['xoopsDB']->query('SELECT COUNT(*) FROM ' . $GLOBALS['xoopsDB']->prefix('topics')); list ($totalCat) = $GLOBALS['xoopsDB']->fetchRow($result); if ($totalCat == 0) { - echo "" . _AM_PUBLISHER_IMPORT_NO_CATEGORY . ""; + echo "" . _AM_PUBLISHER_IMPORT_NO_CATEGORY . ''; } else { include_once $GLOBALS['xoops']->path('class/xoopstree.php'); - $result = $GLOBALS['xoopsDB']->query("SELECT COUNT(*) FROM " . $GLOBALS['xoopsDB']->prefix("stories")); + $result = $GLOBALS['xoopsDB']->query('SELECT COUNT(*) FROM ' . $GLOBALS['xoopsDB']->prefix('stories')); list ($totalArticles) = $GLOBALS['xoopsDB']->fetchRow($result); if ($totalArticles == 0) { - echo "" . sprintf(_AM_PUBLISHER_IMPORT_MODULE_FOUND_NO_ITEMS, $importFromModuleName, $totalArticles) . ""; + echo "" . sprintf(_AM_PUBLISHER_IMPORT_MODULE_FOUND_NO_ITEMS, $importFromModuleName, $totalArticles) . ''; } else { - echo "" . sprintf(_AM_PUBLISHER_IMPORT_MODULE_FOUND, $importFromModuleName, $totalArticles, $totalCat) . ""; + echo "" . sprintf(_AM_PUBLISHER_IMPORT_MODULE_FOUND, $importFromModuleName, $totalArticles, $totalCat) . ''; - $form = new XoopsThemeForm(_AM_PUBLISHER_IMPORT_SETTINGS, 'import_form', PUBLISHER_ADMIN_URL . "/import/$scriptname"); + $form = new XoopsThemeForm(_AM_PUBLISHER_IMPORT_SETTINGS, 'import_form', PUBLISHER_ADMIN_URL . '/import/$scriptname'); // Categories to be imported - $sql = "SELECT cat.topic_id, cat.topic_pid, cat.topic_title, COUNT(art.storyid) FROM " . $GLOBALS['xoopsDB']->prefix("topics") . " AS cat INNER JOIN " . $GLOBALS['xoopsDB']->prefix("stories") . " AS art ON cat.topic_id=art.topicid GROUP BY art.topicid"; + $sql = 'SELECT cat.topic_id, cat.topic_pid, cat.topic_title, COUNT(art.storyid) FROM ' . $GLOBALS['xoopsDB']->prefix('topics') . ' AS cat INNER JOIN ' . $GLOBALS['xoopsDB']->prefix('stories') . ' AS art ON cat.topic_id=art.topicid GROUP BY art.topicid'; $result = $GLOBALS['xoopsDB']->query($sql); $cat_cbox_options = array(); while ((list ($cid, $pid, $cat_title, $art_count) = $GLOBALS['xoopsDB']->fetchRow($result)) !== false) { $cat_title = $myts->displayTarea($cat_title); - $cat_cbox_options[$cid] = "$cat_title ($art_count)"; + $cat_cbox_options[$cid] = '$cat_title ($art_count)'; } - $cat_label = new XoopsFormLabel(_AM_PUBLISHER_IMPORT_CATEGORIES, implode("
", $cat_cbox_options)); + $cat_label = new XoopsFormLabel(_AM_PUBLISHER_IMPORT_CATEGORIES, implode('
', $cat_cbox_options)); $cat_label->setDescription(_AM_PUBLISHER_IMPORT_CATEGORIES_DSC); $form->addElement($cat_label); // Publisher parent category - $mytree = new XoopsTree($GLOBALS['xoopsDB']->prefix("publisher_categories"), "categoryid", "parentid"); + $mytree = new XoopsTree($GLOBALS['xoopsDB']->prefix('publisher_categories'), 'categoryid', 'parentid'); ob_start(); - $mytree->makeMySelBox("name", "weight", $preset_id = 0, $none = 1, $sel_name = "parent_category"); + $mytree->makeMySelBox('name', 'weight', $preset_id = 0, $none = 1, $sel_name = 'parent_category'); $parent_cat_sel = new XoopsFormLabel(_AM_PUBLISHER_IMPORT_PARENT_CATEGORY, ob_get_contents()); $parent_cat_sel->setDescription(_AM_PUBLISHER_IMPORT_PARENT_CATEGORY_DSC); @@ -97,7 +97,7 @@ //publisher_adminMenu(-1, _AM_PUBLISHER_IMPORT); publisherOpenCollapsableBar('newsimportgo', 'newsimportgoicon', sprintf(_AM_PUBLISHER_IMPORT_FROM, $importFromModuleName), _AM_PUBLISHER_IMPORT_RESULT); - $moduleHandler = xoops_gethandler('module'); + $moduleHandler = xoops_gethandler('module'); $moduleObj = $moduleHandler->getByDirname('news'); $news_module_id = $moduleObj->getVar('mid'); @@ -108,7 +108,7 @@ $parentId = XoopsRequest::getInt('parent_category', 0, 'POST'); - $sql = "SELECT * FROM " . $GLOBALS['xoopsDB']->prefix('topics'); + $sql = 'SELECT * FROM ' . $GLOBALS['xoopsDB']->prefix('topics'); $resultCat = $GLOBALS['xoopsDB']->query($sql); @@ -131,22 +131,22 @@ // Category image if (($arrCat['topic_imgurl'] != 'blank.gif') && ($arrCat['topic_imgurl'] != '')) { - if (copy($GLOBALS['xoops']->path("modules/news/assets/images/topics/" . $arrCat['topic_imgurl']), $GLOBALS['xoops']->path("uploads/publisher/images/category/" . $arrCat['topic_imgurl']))) { + if (copy($GLOBALS['xoops']->path('modules/news/assets/images/topics/' . $arrCat['topic_imgurl']), $GLOBALS['xoops']->path('uploads/publisher/images/category/' . $arrCat['topic_imgurl']))) { $categoryObj->setVar('image', $arrCat['topic_imgurl']); } } if (!$publisher->getHandler('category')->insert($categoryObj)) { - echo sprintf(_AM_PUBLISHER_IMPORT_CATEGORY_ERROR, $arrCat['topic_title']) . "
"; + echo sprintf(_AM_PUBLISHER_IMPORT_CATEGORY_ERROR, $arrCat['topic_title']) . '
'; continue; } $newCat['newid'] = $categoryObj->categoryid(); ++$cnt_imported_cat; - echo sprintf(_AM_PUBLISHER_IMPORT_CATEGORY_SUCCESS, $categoryObj->name()) . ""; + echo sprintf(_AM_PUBLISHER_IMPORT_CATEGORY_SUCCESS, $categoryObj->name()) . ''; - $sql = "SELECT * FROM " . $GLOBALS['xoopsDB']->prefix('stories') . " WHERE topicid=" . $arrCat['topic_id']; + $sql = 'SELECT * FROM ' . $GLOBALS['xoopsDB']->prefix('stories') . ' WHERE topicid=' . $arrCat['topic_id']; $resultArticles = $GLOBALS['xoopsDB']->query($sql); while (($arrArticle = $GLOBALS['xoopsDB']->fetchArray($resultArticles)) !== false) { // insert article @@ -173,30 +173,30 @@ /* // HTML Wrap if ($arrArticle['htmlpage']) { - $pagewrap_filename = $GLOBALS['xoops']->path("modules/wfsection/html/" .$arrArticle['htmlpage']); + $pagewrap_filename = $GLOBALS['xoops']->path('modules/wfsection/html/' .$arrArticle['htmlpage']); if (file_exists($pagewrap_filename)) { - if (copy($pagewrap_filename, $GLOBALS['xoops']->path("uploads/publisher/content/" . $arrArticle['htmlpage']))) { - $itemObj->setVar('body', "[pagewrap=" . $arrArticle['htmlpage'] . "]"); - echo sprintf("    " . _AM_PUBLISHER_IMPORT_ARTICLE_WRAP, $arrArticle['htmlpage']) . "
"; + if (copy($pagewrap_filename, $GLOBALS['xoops']->path('uploads/publisher/content/' . $arrArticle['htmlpage']))) { + $itemObj->setVar('body', '[pagewrap=' . $arrArticle['htmlpage'] . ']'); + echo sprintf('    ' . _AM_PUBLISHER_IMPORT_ARTICLE_WRAP, $arrArticle['htmlpage']) . '
'; } } } */ if (!$itemObj->store()) { - echo sprintf(" " . _AM_PUBLISHER_IMPORT_ARTICLE_ERROR, $arrArticle['title']) . "
"; + echo sprintf(' ' . _AM_PUBLISHER_IMPORT_ARTICLE_ERROR, $arrArticle['title']) . '
'; continue; } else { /* // Linkes files - $sql = "SELECT * FROM ".$GLOBALS['xoopsDB']->prefix("wfs_files")." WHERE articleid=" . $arrArticle['articleid']; + $sql = 'SELECT * FROM '.$GLOBALS['xoopsDB']->prefix('wfs_files').' WHERE articleid=' . $arrArticle['articleid']; $resultFiles = $GLOBALS['xoopsDB']->query ($sql); $allowed_mimetypes = ''; while ($arrFile = $GLOBALS['xoopsDB']->fetchArray ($resultFiles)) { - $filename = $GLOBALS['xoops']->path("modules/wfsection/cache/uploaded/" . $arrFile['filerealname']); + $filename = $GLOBALS['xoops']->path('modules/wfsection/cache/uploaded/' . $arrFile['filerealname']); if (file_exists($filename)) { - if (copy($filename, $GLOBALS['xoops']->path("uploads/publisher/" . $arrFile['filerealname']))) { + if (copy($filename, $GLOBALS['xoops']->path('uploads/publisher/' . $arrFile['filerealname']))) { $fileObj = $publisher_file_handler->create(); $fileObj->setVar('name', $arrFile['fileshowname']); $fileObj->setVar('description', $arrFile['filedescript']); @@ -209,14 +209,14 @@ $fileObj->setVar('filename', $arrFile['filerealname']); if ($fileObj->store($allowed_mimetypes, true, false)) { - echo "    " . sprintf(_AM_PUBLISHER_IMPORTED_ARTICLE_FILE, $arrFile['filerealname']) . "
"; + echo '    ' . sprintf(_AM_PUBLISHER_IMPORTED_ARTICLE_FILE, $arrFile['filerealname']) . '
'; } } } } */ $newArticleArray[$arrArticle['storyid']] = $itemObj->itemid(); - echo "  " . sprintf(_AM_PUBLISHER_IMPORTED_ARTICLE, $itemObj->title()) . "
"; + echo '  ' . sprintf(_AM_PUBLISHER_IMPORTED_ARTICLE, $itemObj->title()) . '
'; ++$cnt_imported_articles; } } @@ -229,7 +229,7 @@ $newCatArray[$newCat['oldid']] = $newCat; unset($newCat); - echo "
"; + echo '
'; } // Looping through cat to change the parentid to the new parentid @@ -248,12 +248,12 @@ unset($oldid, $newCat); // Looping through the comments to link them to the new articles and module - echo _AM_PUBLISHER_IMPORT_COMMENTS . "
"; + echo _AM_PUBLISHER_IMPORT_COMMENTS . '
'; $publisher_module_id = $publisher->getModule()->mid(); $commentHandler = xoops_gethandler('comment'); - $criteria = new CriteriaCompo(); + $criteria = new CriteriaCompo(); $criteria->add(new Criteria('com_modid', $news_module_id)); $comments = $commentHandler->getObjects($criteria); foreach ($comments as $comment) { @@ -261,18 +261,18 @@ $comment->setVar('com_modid', $publisher_module_id); $comment->setNew(); if (!$commentHandler->insert($comment)) { - echo "  " . sprintf(_AM_PUBLISHER_IMPORTED_COMMENT_ERROR, $comment->getVar('com_title')) . "
"; + echo '  ' . sprintf(_AM_PUBLISHER_IMPORTED_COMMENT_ERROR, $comment->getVar('com_title')) . '
'; } else { - echo "  " . sprintf(_AM_PUBLISHER_IMPORTED_COMMENT, $comment->getVar('com_title')) . "
"; + echo '  ' . sprintf(_AM_PUBLISHER_IMPORTED_COMMENT, $comment->getVar('com_title')) . '
'; } } - unset($comment); + // unset($comment); - echo "

Done.
"; - echo sprintf(_AM_PUBLISHER_IMPORTED_CATEGORIES, $cnt_imported_cat) . "
"; - echo sprintf(_AM_PUBLISHER_IMPORTED_ARTICLES, $cnt_imported_articles) . "
"; - echo "
" . _AM_PUBLISHER_IMPORT_GOTOMODULE . "
"; + echo '

Done.
'; + echo sprintf(_AM_PUBLISHER_IMPORTED_CATEGORIES, $cnt_imported_cat) . '
'; + echo sprintf(_AM_PUBLISHER_IMPORTED_ARTICLES, $cnt_imported_articles) . '
'; + echo "
" . _AM_PUBLISHER_IMPORT_GOTOMODULE . '
'; publisherCloseCollapsableBar('newsimportgo', 'newsimportgoicon'); xoops_cp_footer(); diff --git a/publisher/admin/import/smartsection.php b/publisher/admin/import/smartsection.php index 9c2a6245..d49e60cf 100644 --- a/publisher/admin/import/smartsection.php +++ b/publisher/admin/import/smartsection.php @@ -23,9 +23,9 @@ include_once dirname(__DIR__) . '/admin_header.php'; $myts = MyTextSanitizer::getInstance(); -$importFromModuleName = "Smartsection " . XoopsRequest::getString('smartsection_version', '', 'POST'); +$importFromModuleName = 'Smartsection ' . XoopsRequest::getString('smartsection_version', '', 'POST'); -$scriptname = "smartsection.php"; +$scriptname = 'smartsection.php'; $op = ('go' == XoopsRequest::getString('op', '', 'POST')) ? 'go' : 'start'; @@ -36,15 +36,15 @@ //publisher_adminMenu(-1, _AM_PUBLISHER_IMPORT); publisherOpenCollapsableBar('newsimport', 'newsimporticon', sprintf(_AM_PUBLISHER_IMPORT_FROM, $importFromModuleName), _AM_PUBLISHER_IMPORT_INFO); - $result = $GLOBALS['xoopsDB']->query("SELECT COUNT(*) FROM " . $GLOBALS['xoopsDB']->prefix("smartsection_categories")); + $result = $GLOBALS['xoopsDB']->query('SELECT COUNT(*) FROM ' . $GLOBALS['xoopsDB']->prefix('smartsection_categories')); list ($totalCat) = $GLOBALS['xoopsDB']->fetchRow($result); if ($totalCat == 0) { - echo "" . _AM_PUBLISHER_IMPORT_NO_CATEGORY . ""; + echo "" . _AM_PUBLISHER_IMPORT_NO_CATEGORY . ''; } else { include_once $GLOBALS['xoops']->path('class/xoopstree.php'); - $result = $GLOBALS['xoopsDB']->query("SELECT COUNT(*) FROM " . $GLOBALS['xoopsDB']->prefix('smartsection_items')); + $result = $GLOBALS['xoopsDB']->query('SELECT COUNT(*) FROM ' . $GLOBALS['xoopsDB']->prefix('smartsection_items')); list ($totalArticles) = $GLOBALS['xoopsDB']->fetchRow($result); if ($totalArticles == 0) { @@ -70,9 +70,9 @@ $form->addElement($cat_label); // Publisher parent category - $mytree = new XoopsTree($GLOBALS['xoopsDB']->prefix("publisher_categories"), "categoryid", "parentid"); + $mytree = new XoopsTree($GLOBALS['xoopsDB']->prefix('publisher_categories'), 'categoryid', 'parentid'); ob_start(); - $mytree->makeMySelBox("name", "weight", $preset_id = 0, $none = 1, $sel_name = "parent_category"); + $mytree->makeMySelBox('name', 'weight', $preset_id = 0, $none = 1, $sel_name = 'parent_category'); $parent_cat_sel = new XoopsFormLabel(_AM_PUBLISHER_IMPORT_PARENT_CATEGORY, ob_get_contents()); $parent_cat_sel->setDescription(_AM_PUBLISHER_IMPORT_PARENT_CATEGORY_DSC); @@ -97,7 +97,7 @@ //publisher_adminMenu(-1, _AM_PUBLISHER_IMPORT); publisherOpenCollapsableBar('newsimportgo', 'newsimportgoicon', sprintf(_AM_PUBLISHER_IMPORT_FROM, $importFromModuleName), _AM_PUBLISHER_IMPORT_RESULT); - $moduleHandler = xoops_gethandler('module'); + $moduleHandler = xoops_gethandler('module'); $moduleObj = $moduleHandler->getByDirname('smartsection'); $smartsection_module_id = $moduleObj->getVar('mid'); @@ -108,7 +108,7 @@ $parentId = XoopsRequest::getInt('parent_category', 0, 'POST'); - $sql = "SELECT * FROM " . $GLOBALS['xoopsDB']->prefix('smartsection_categories'); + $sql = 'SELECT * FROM ' . $GLOBALS['xoopsDB']->prefix('smartsection_categories'); $resultCat = $GLOBALS['xoopsDB']->query($sql); @@ -128,7 +128,7 @@ // Copy category image if (($arrCat['image'] != 'blank.gif') && ($arrCat['image'] != '')) { - copy($GLOBALS['xoops']->path("uploads/smartsection/images/category/" . $arrCat['image']), $GLOBALS['xoops']->path("uploads/publisher/images/category/" . $arrCat['image'])); + copy($GLOBALS['xoops']->path('uploads/smartsection/images/category/' . $arrCat['image']), $GLOBALS['xoops']->path('uploads/publisher/images/category/' . $arrCat['image'])); } if (!$publisher->getHandler('category')->insert($categoryObj)) { @@ -141,7 +141,7 @@ echo sprintf(_AM_PUBLISHER_IMPORT_CATEGORY_SUCCESS, $categoryObj->name()) . ""; - $sql = "SELECT * FROM " . $GLOBALS['xoopsDB']->prefix('smartsection_items') . " WHERE categoryid=" . $arrCat['categoryid']; + $sql = 'SELECT * FROM ' . $GLOBALS['xoopsDB']->prefix('smartsection_items') . ' WHERE categoryid=' . $arrCat['categoryid']; $resultArticles = $GLOBALS['xoopsDB']->query($sql); while (($arrArticle = $GLOBALS['xoopsDB']->fetchArray($resultArticles)) !== false) { @@ -169,12 +169,12 @@ */ if (!$itemObj->store()) { - echo sprintf(" " . _AM_PUBLISHER_IMPORT_ARTICLE_ERROR, $arrArticle['title']) . "
"; + echo sprintf(' ' . _AM_PUBLISHER_IMPORT_ARTICLE_ERROR, $arrArticle['title']) . '
'; continue; } else { // Linkes files - $sql = "SELECT * FROM " . $GLOBALS['xoopsDB']->prefix("smartsection_files") . " WHERE itemid=" . $arrArticle['itemid']; + $sql = 'SELECT * FROM ' . $GLOBALS['xoopsDB']->prefix("smartsection_files") . ' WHERE itemid=' . $arrArticle['itemid']; $resultFiles = $GLOBALS['xoopsDB']->query($sql); $allowed_mimetypes = null; while (($arrFile = $GLOBALS['xoopsDB']->fetchArray($resultFiles)) !== false) { @@ -186,14 +186,14 @@ $fileObj->setVar('fileid', 0); if ($fileObj->store($allowed_mimetypes, true, false)) { - echo "    " . sprintf(_AM_PUBLISHER_IMPORTED_ARTICLE_FILE, $arrFile['filename']) . "
"; + echo '    ' . sprintf(_AM_PUBLISHER_IMPORTED_ARTICLE_FILE, $arrFile['filename']) . '
'; } } } } $newArticleArray[$arrArticle['itemid']] = $itemObj->itemid(); - echo "  " . sprintf(_AM_PUBLISHER_IMPORTED_ARTICLE, $itemObj->title()) . "
"; + echo '  ' . sprintf(_AM_PUBLISHER_IMPORTED_ARTICLE, $itemObj->title()) . "
"; ++$cnt_imported_articles; } } @@ -206,7 +206,7 @@ $newCatArray[$newCat['oldid']] = $newCat; unset($newCat); - echo "
"; + echo '
'; } // Looping through cat to change the parentid to the new parentid @@ -225,12 +225,12 @@ unset($oldid, $newCat); // Looping through the comments to link them to the new articles and module - echo _AM_PUBLISHER_IMPORT_COMMENTS . "
"; + echo _AM_PUBLISHER_IMPORT_COMMENTS . '
'; $publisher_module_id = $publisher->getModule()->mid(); $commentHandler = xoops_gethandler('comment'); - $criteria = new CriteriaCompo(); + $criteria = new CriteriaCompo(); $criteria->add(new Criteria('com_modid', $smartsection_module_id)); $comments = $commentHandler->getObjects($criteria); foreach ($comments as $comment) { @@ -238,18 +238,18 @@ $comment->setVar('com_modid', $publisher_module_id); $comment->setNew(); if (!$commentHandler->insert($comment)) { - echo "  " . sprintf(_AM_PUBLISHER_IMPORTED_COMMENT_ERROR, $comment->getVar('com_title')) . "
"; + echo '  ' . sprintf(_AM_PUBLISHER_IMPORTED_COMMENT_ERROR, $comment->getVar('com_title')) . '
'; } else { - echo "  " . sprintf(_AM_PUBLISHER_IMPORTED_COMMENT, $comment->getVar('com_title')) . "
"; + echo '  ' . sprintf(_AM_PUBLISHER_IMPORTED_COMMENT, $comment->getVar('com_title')) . '
'; } } unset($comment); echo "

Done.
"; - echo sprintf(_AM_PUBLISHER_IMPORTED_CATEGORIES, $cnt_imported_cat) . "
"; - echo sprintf(_AM_PUBLISHER_IMPORTED_ARTICLES, $cnt_imported_articles) . "
"; - echo "
" . _AM_PUBLISHER_IMPORT_GOTOMODULE . "
"; + echo sprintf(_AM_PUBLISHER_IMPORTED_CATEGORIES, $cnt_imported_cat) . '
'; + echo sprintf(_AM_PUBLISHER_IMPORTED_ARTICLES, $cnt_imported_articles) . '
'; + echo "
" . _AM_PUBLISHER_IMPORT_GOTOMODULE . '
'; publisherCloseCollapsableBar('newsimportgo', 'newsimportgoicon'); xoops_cp_footer(); diff --git a/publisher/admin/import/wfsection.php b/publisher/admin/import/wfsection.php index 113c96b6..71bb4570 100644 --- a/publisher/admin/import/wfsection.php +++ b/publisher/admin/import/wfsection.php @@ -23,9 +23,9 @@ include_once dirname(__DIR__) . '/admin_header.php'; $myts = MyTextSanitizer::getInstance(); -$importFromModuleName = "WF-Section " . XoopsRequest::getString('wfs_version', '', 'POST'); +$importFromModuleName = 'WF-Section ' . XoopsRequest::getString('wfs_version', '', 'POST'); -$scriptname = "wfsection.php"; +$scriptname = 'wfsection.php'; $op = ('go' == XoopsRequest::getString('op', '', 'POST')) ? 'go' : 'start'; @@ -36,15 +36,15 @@ //publisher_adminMenu(-1, _AM_PUBLISHER_IMPORT); publisherOpenCollapsableBar('wfsectionimport', 'wfsectionimporticon', sprintf(_AM_PUBLISHER_IMPORT_FROM, $importFromModuleName), _AM_PUBLISHER_IMPORT_INFO); - $result = $GLOBALS['xoopsDB']->query("SELECT COUNT(*) FROM " . $GLOBALS['xoopsDB']->prefix("wfs_category")); + $result = $GLOBALS['xoopsDB']->query('SELECT COUNT(*) FROM ' . $GLOBALS['xoopsDB']->prefix('wfs_category')); list ($totalCat) = $GLOBALS['xoopsDB']->fetchRow($result); if ($totalCat == 0) { echo "" . _AM_PUBLISHER_IMPORT_NOCATSELECTED . ""; } else { - include_once $GLOBALS['xoops']->path("class/xoopstree.php"); + include_once $GLOBALS['xoops']->path('class/xoopstree.php'); - $result = $GLOBALS['xoopsDB']->query("SELECT COUNT(*) FROM " . $GLOBALS['xoopsDB']->prefix("wfs_article")); + $result = $GLOBALS['xoopsDB']->query('SELECT COUNT(*) FROM ' . $GLOBALS['xoopsDB']->prefix('wfs_article')); list ($totalArticles) = $GLOBALS['xoopsDB']->fetchRow($result); if ($totalArticles == 0) { @@ -55,7 +55,7 @@ $form = new XoopsThemeForm(_AM_PUBLISHER_IMPORT_SETTINGS, 'import_form', PUBLISHER_ADMIN_URL . "/import/$scriptname"); // Categories to be imported - $sql = "SELECT cat.id, cat.pid, cat.title, COUNT(art.articleid) FROM " . $GLOBALS['xoopsDB']->prefix("wfs_category") . " AS cat INNER JOIN " . $GLOBALS['xoopsDB']->prefix("wfs_article") . " AS art ON cat.id=art.categoryid GROUP BY art.categoryid"; + $sql = 'SELECT cat.id, cat.pid, cat.title, COUNT(art.articleid) FROM ' . $GLOBALS['xoopsDB']->prefix('wfs_category') . " AS cat INNER JOIN " . $GLOBALS['xoopsDB']->prefix("wfs_article") . " AS art ON cat.id=art.categoryid GROUP BY art.categoryid"; $result = $GLOBALS['xoopsDB']->query($sql); $cat_cbox_values = array(); $cat_cbox_options = array(); @@ -68,9 +68,9 @@ $form->addElement($cat_label); // SmartFAQ parent category - $mytree = new XoopsTree($GLOBALS['xoopsDB']->prefix("publisher_categories"), "categoryid", "parentid"); + $mytree = new XoopsTree($GLOBALS['xoopsDB']->prefix('publisher_categories'), 'categoryid', 'parentid'); ob_start(); - $mytree->makeMySelBox("name", "weight", $preset_id = 0, $none = 1, $sel_name = "parent_category"); + $mytree->makeMySelBox('name', 'weight', $preset_id = 0, $none = 1, $sel_name = 'parent_category'); $parent_cat_sel = new XoopsFormLabel(_AM_PUBLISHER_IMPORT_PARENT_CATEGORY, ob_get_contents()); $parent_cat_sel->setDescription(_AM_PUBLISHER_IMPORT_PARENT_CATEGORY_DSC); @@ -131,7 +131,7 @@ // Category image if (($arrCat['imgurl'] != 'blank.gif') && ($arrCat['imgurl'])) { - if (copy($GLOBALS['xoops']->path("modules/wfsection/images/category/" . $arrCat['imgurl']), PUBLISHER_UPLOAD_PATH . "/images/category/" . $arrCat['imgurl'])) { + if (copy($GLOBALS['xoops']->path('modules/wfsection/images/category/' . $arrCat['imgurl']), PUBLISHER_UPLOAD_PATH . '/images/category/' . $arrCat['imgurl'])) { $categoryObj->setVar('image', $arrCat['imgurl']); } } @@ -148,9 +148,9 @@ ++$cnt_imported_cat; - echo sprintf(_AM_PUBLISHER_IMPORT_CATEGORY_SUCCESS, $categoryObj->name()) . ""; + echo sprintf(_AM_PUBLISHER_IMPORT_CATEGORY_SUCCESS, $categoryObj->name()) . ''; - $sql = "SELECT * FROM " . $GLOBALS['xoopsDB']->prefix("wfs_article") . " WHERE categoryid=" . $arrCat['id'] . " ORDER BY weight"; + $sql = 'SELECT * FROM ' . $GLOBALS['xoopsDB']->prefix("wfs_article") . " WHERE categoryid=" . $arrCat['id'] . ' ORDER BY weight'; $resultArticles = $GLOBALS['xoopsDB']->query($sql); while (($arrArticle = $GLOBALS['xoopsDB']->fetchArray($resultArticles)) !== false) { // insert article @@ -168,21 +168,21 @@ $itemObj->setVar('dobr', $arrArticle['nobreaks']); $itemObj->setVar('weight', $arrArticle['weight']); $itemObj->setVar('status', PublisherConstantsInterface::PUBLISHER_STATUS_PUBLISHED); - $itemObj->setGroupsRead(explode(" ", trim($arrArticle['groupid']))); + $itemObj->setGroupsRead(explode(' ', trim($arrArticle['groupid']))); // HTML Wrap if ($arrArticle['htmlpage']) { - $pagewrap_filename = $GLOBALS['xoops']->path("modules/wfsection/html/" . $arrArticle['htmlpage']); + $pagewrap_filename = $GLOBALS['xoops']->path('modules/wfsection/html/' . $arrArticle['htmlpage']); if (file_exists($pagewrap_filename)) { - if (copy($pagewrap_filename, PUBLISHER_UPLOAD_PATH . "/content/" . $arrArticle['htmlpage'])) { - $itemObj->setVar('body', "[pagewrap=" . $arrArticle['htmlpage'] . "]"); - echo sprintf("    " . _AM_PUBLISHER_IMPORT_ARTICLE_WRAP, $arrArticle['htmlpage']) . "
"; + if (copy($pagewrap_filename, PUBLISHER_UPLOAD_PATH . '/content/' . $arrArticle['htmlpage'])) { + $itemObj->setVar('body', '[pagewrap=' . $arrArticle['htmlpage'] . "]"); + echo sprintf('    ' . _AM_PUBLISHER_IMPORT_ARTICLE_WRAP, $arrArticle['htmlpage']) . '
'; } } } if (!$itemObj->store()) { - echo sprintf(" " . _AM_PUBLISHER_IMPORT_ARTICLE_ERROR, $arrArticle['title']) . "
"; + echo sprintf(" " . _AM_PUBLISHER_IMPORT_ARTICLE_ERROR, $arrArticle['title']) . '
'; continue; } else { // Linkes files @@ -206,20 +206,20 @@ $fileObj->setVar('filename', $arrFile['filerealname']); if ($fileObj->store($allowed_mimetypes, true, false)) { - echo "    " . sprintf(_AM_PUBLISHER_IMPORTED_ARTICLE_FILE, $arrFile['filerealname']) . "
"; + echo '    ' . sprintf(_AM_PUBLISHER_IMPORTED_ARTICLE_FILE, $arrFile['filerealname']) . '
'; } } } } $newArticleArray[$arrArticle['articleid']] = $itemObj->itemid(); - echo "  " . sprintf(_AM_PUBLISHER_IMPORTED_ARTICLE, $itemObj->title()) . "
"; + echo '  ' . sprintf(_AM_PUBLISHER_IMPORTED_ARTICLE, $itemObj->title()) . '
'; ++$cnt_imported_articles; } } $newCatArray[$newCat['oldid']] = $newCat; unset($newCat); - echo "
"; + echo '
'; } // Looping through cat to change the pid to the new pid foreach ($newCatArray as $oldid => $newCat) { @@ -237,16 +237,16 @@ unset($oldid, $newCat); // Looping through the comments to link them to the new articles and module - echo _AM_PUBLISHER_IMPORT_COMMENTS . "
"; + echo _AM_PUBLISHER_IMPORT_COMMENTS . '
'; - $moduleHandler = xoops_gethandler('module'); + $moduleHandler = xoops_gethandler('module'); $moduleObj = $moduleHandler->getByDirname('wfsection'); $news_module_id = $moduleObj->getVar('mid'); $publisher_module_id = $publisher->getModule()->mid(); $commentHandler = xoops_gethandler('comment'); - $criteria = new CriteriaCompo(); + $criteria = new CriteriaCompo(); $criteria->add(new Criteria('com_modid', $news_module_id)); $comments = $commentHandler->getObjects($criteria); foreach ($comments as $comment) { @@ -254,18 +254,18 @@ $comment->setVar('com_modid', $publisher_module_id); $comment->setNew(); if (!$commentHandler->insert($comment)) { - echo "  " . sprintf(_AM_PUBLISHER_IMPORTED_COMMENT_ERROR, $comment->getVar('com_title')) . "
"; + echo '  ' . sprintf(_AM_PUBLISHER_IMPORTED_COMMENT_ERROR, $comment->getVar('com_title')) . '
'; } else { - echo "  " . sprintf(_AM_PUBLISHER_IMPORTED_COMMENT, $comment->getVar('com_title')) . "
"; + echo '  ' . sprintf(_AM_PUBLISHER_IMPORTED_COMMENT, $comment->getVar('com_title')) . '
'; } } unset($comment); - echo "

Done.
"; - echo sprintf(_AM_PUBLISHER_IMPORTED_CATEGORIES, $cnt_imported_cat) . "
"; - echo sprintf(_AM_PUBLISHER_IMPORTED_ARTICLES, $cnt_imported_articles) . "
"; - echo "
" . _AM_PUBLISHER_IMPORT_GOTOMODULE . "
"; + echo '

Done.
'; + echo sprintf(_AM_PUBLISHER_IMPORTED_CATEGORIES, $cnt_imported_cat) . '
'; + echo sprintf(_AM_PUBLISHER_IMPORTED_ARTICLES, $cnt_imported_articles) . '
'; + echo "
" . _AM_PUBLISHER_IMPORT_GOTOMODULE . '
'; publisherCloseCollapsableBar('wfsectionimportgo', 'wfsectionimportgoicon'); xoops_cp_footer(); diff --git a/publisher/admin/import/xfsection.php b/publisher/admin/import/xfsection.php index 4a0939b4..9f1f74a4 100644 --- a/publisher/admin/import/xfsection.php +++ b/publisher/admin/import/xfsection.php @@ -23,9 +23,9 @@ include_once dirname(__DIR__) . '/admin_header.php'; $myts = MyTextSanitizer::getInstance(); -$importFromModuleName = "XF-Section " . XoopsRequest::getString('xfs_version', '', 'POST'); +$importFromModuleName = 'XF-Section ' . XoopsRequest::getString('xfs_version', '', 'POST'); -$scriptname = "xfsection.php"; +$scriptname = 'xfsection.php'; $op = ('go' == XoopsRequest::getString('op', '', 'POST')) ? 'go' : 'start'; @@ -36,7 +36,7 @@ //publisher_adminMenu(-1, _AM_PUBLISHER_IMPORT); publisherOpenCollapsableBar('xfsectionimport', 'xfsectionimporticon', sprintf(_AM_PUBLISHER_IMPORT_FROM, $importFromModuleName), _AM_PUBLISHER_IMPORT_INFO); - $result = $GLOBALS['xoopsDB']->query("SELECT COUNT(*) FROM " . $GLOBALS['xoopsDB']->prefix("xfs_category")); + $result = $GLOBALS['xoopsDB']->query("SELECT COUNT(*) FROM " . $GLOBALS['xoopsDB']->prefix('xfs_category')); list ($totalCat) = $GLOBALS['xoopsDB']->fetchRow($result); if ($totalCat == 0) { @@ -237,14 +237,14 @@ // Looping through the comments to link them to the new articles and module echo _AM_PUBLISHER_IMPORT_COMMENTS . "
"; - $moduleHandler = xoops_gethandler('module'); + $moduleHandler = xoops_gethandler('module'); $moduleObj = $moduleHandler->getByDirname('xfsection'); $news_module_id = $moduleObj->getVar('mid'); $publisher_module_id = $publisher->getModule()->mid(); $commentHandler = xoops_gethandler('comment'); - $criteria = new CriteriaCompo(); + $criteria = new CriteriaCompo(); $criteria->add(new Criteria('com_modid', $news_module_id)); $comments = $commentHandler->getObjects($criteria); foreach ($comments as $comment) { diff --git a/publisher/admin/import/xnews.php b/publisher/admin/import/xnews.php index 7cc8cf0a..10eb36f5 100644 --- a/publisher/admin/import/xnews.php +++ b/publisher/admin/import/xnews.php @@ -23,9 +23,9 @@ include_once dirname(__DIR__) . '/admin_header.php'; $myts = MyTextSanitizer::getInstance(); -$importFromModuleName = "xNews " . XoopsRequest::getString('xnews_version', '', 'POST'); +$importFromModuleName = 'xNews ' . XoopsRequest::getString('xnews_version', '', 'POST'); -$scriptname = "xnews.php"; +$scriptname = 'xnews.php'; $op = ('go' == XoopsRequest::getString('op', '', 'POST')) ? 'go' : 'start'; @@ -34,40 +34,28 @@ publisherCpHeader(); //publisher_adminMenu(-1, _AM_PUBLISHER_IMPORT); - publisherOpenCollapsableBar( - 'xnewsimport', - 'xnewsimporticon', - sprintf(_AM_PUBLISHER_IMPORT_FROM, $importFromModuleName), - _AM_PUBLISHER_IMPORT_INFO - ); - - $result = $GLOBALS['xoopsDB']->query("SELECT COUNT(*) FROM " . $GLOBALS['xoopsDB']->prefix("nw_topics")); + publisherOpenCollapsableBar('xnewsimport', 'xnewsimporticon', sprintf(_AM_PUBLISHER_IMPORT_FROM, $importFromModuleName), _AM_PUBLISHER_IMPORT_INFO); + + $result = $GLOBALS['xoopsDB']->query('SELECT COUNT(*) FROM ' . $GLOBALS['xoopsDB']->prefix('nw_topics')); list ($totalCat) = $GLOBALS['xoopsDB']->fetchRow($result); if ($totalCat == 0) { - echo "" . _AM_PUBLISHER_IMPORT_NO_CATEGORY . ""; + echo "" . _AM_PUBLISHER_IMPORT_NO_CATEGORY . ''; } else { include_once $GLOBALS['xoops']->path('class/xoopstree.php'); - $result = $GLOBALS['xoopsDB']->query("SELECT COUNT(*) FROM " . $GLOBALS['xoopsDB']->prefix("nw_stories")); + $result = $GLOBALS['xoopsDB']->query('SELECT COUNT(*) FROM ' . $GLOBALS['xoopsDB']->prefix('nw_stories')); list ($totalArticles) = $GLOBALS['xoopsDB']->fetchRow($result); if ($totalArticles == 0) { - echo "" . sprintf( - _AM_PUBLISHER_IMPORT_MODULE_FOUND_NO_ITEMS, - $importFromModuleName, - $totalArticles) . ""; + echo "" . sprintf(_AM_PUBLISHER_IMPORT_MODULE_FOUND_NO_ITEMS, $importFromModuleName, $totalArticles) . ''; } else { - echo "" . sprintf( - _AM_PUBLISHER_IMPORT_MODULE_FOUND, - $importFromModuleName, - $totalArticles, - $totalCat) . ""; + echo "" . sprintf(_AM_PUBLISHER_IMPORT_MODULE_FOUND, $importFromModuleName, $totalArticles, $totalCat) . ''; $form = new XoopsThemeForm(_AM_PUBLISHER_IMPORT_SETTINGS, 'import_form', PUBLISHER_ADMIN_URL . "/import/$scriptname"); //---------- mb ------------------ - // add "publisher" category to "imagecategory" table + // add 'publisher' category to 'imagecategory' table // if (!$GLOBALS['xoopsSecurity']->check()) { // redirect_header('admin.php?fct=images', 3, implode('
', $GLOBALS['xoopsSecurity']->getErrors())); @@ -89,7 +77,7 @@ $imageCategoryHandler->insert($imagecategory); // exit(); } catch (Exception $e) { - echo "Caught exception: : couldn't insert Image Category " . $e->getMessage() . "n"; + echo "Caught exception: : couldn't insert Image Category " . $e->getMessage() . 'n'; } $newid = $imagecategory->getVar('imgcat_id'); @@ -98,7 +86,7 @@ $readgroup = array(); } if (!in_array(XOOPS_GROUP_ADMIN, $readgroup)) { - array_push($readgroup, XOOPS_GROUP_ADMIN); + $readgroup[] = XOOPS_GROUP_ADMIN; } foreach ($readgroup as $rgroup) { $imagecategoryperm =& $imagecategoryperm_handler->create(); @@ -109,13 +97,13 @@ $imagecategoryperm_handler->insert($imagecategoryperm); unset($imagecategoryperm); } - unset($rgroup); + // unset($rgroup); if (!isset($writegroup)) { $writegroup = array(); } if (!in_array(XOOPS_GROUP_ADMIN, $writegroup)) { - array_push($writegroup, XOOPS_GROUP_ADMIN); + $writegroup[] = XOOPS_GROUP_ADMIN; } foreach ($writegroup as $wgroup) { $imagecategoryperm =& $imagecategoryperm_handler->create(); @@ -126,13 +114,12 @@ $imagecategoryperm_handler->insert($imagecategoryperm); unset($imagecategoryperm); } - unset($wgroup); + // unset($wgroup); //---------- mb ------------------ // Categories to be imported - $sql = "SELECT cat.topic_id, cat.topic_pid, cat.topic_title, COUNT(art.storyid) FROM " . $GLOBALS['xoopsDB']->prefix("nw_topics") - . " AS cat INNER JOIN " . $GLOBALS['xoopsDB']->prefix("nw_stories") . " AS art ON cat.topic_id=art.topicid GROUP BY art.topicid"; + $sql = 'SELECT cat.topic_id, cat.topic_pid, cat.topic_title, COUNT(art.storyid) FROM ' . $GLOBALS['xoopsDB']->prefix('nw_topics') . ' AS cat INNER JOIN ' . $GLOBALS['xoopsDB']->prefix('nw_stories') . ' AS art ON cat.topic_id=art.topicid GROUP BY art.topicid'; $result = $GLOBALS['xoopsDB']->query($sql); $cat_cbox_options = array(); @@ -142,14 +129,14 @@ $cat_cbox_options[$cid] = "$cat_title ($art_count)"; } - $cat_label = new XoopsFormLabel(_AM_PUBLISHER_IMPORT_CATEGORIES, implode("
", $cat_cbox_options)); + $cat_label = new XoopsFormLabel(_AM_PUBLISHER_IMPORT_CATEGORIES, implode('
', $cat_cbox_options)); $cat_label->setDescription(_AM_PUBLISHER_IMPORT_CATEGORIES_DSC); $form->addElement($cat_label); // Publisher parent category - $mytree = new XoopsTree($GLOBALS['xoopsDB']->prefix("publisher_categories"), "categoryid", "parentid"); + $mytree = new XoopsTree($GLOBALS['xoopsDB']->prefix('publisher_categories'), 'categoryid', 'parentid'); ob_start(); - $mytree->makeMySelBox("name", "weight", $preset_id = 0, $none = 1, $sel_name = "parent_category"); + $mytree->makeMySelBox('name', 'weight', $preset_id = 0, $none = 1, $sel_name = 'parent_category'); $parent_cat_sel = new XoopsFormLabel(_AM_PUBLISHER_IMPORT_PARENT_CATEGORY, ob_get_contents()); $parent_cat_sel->setDescription(_AM_PUBLISHER_IMPORT_PARENT_CATEGORY_DSC); @@ -173,14 +160,9 @@ publisherCpHeader(); //publisher_adminMenu(-1, _AM_PUBLISHER_IMPORT); include_once (dirname(dirname(__DIR__))) . '/include/common.php'; - publisherOpenCollapsableBar( - 'xnewsimportgo', - 'xnewsimportgoicon', - sprintf(_AM_PUBLISHER_IMPORT_FROM, $importFromModuleName), - _AM_PUBLISHER_IMPORT_RESULT - ); - - $moduleHandler = xoops_gethandler('module'); + publisherOpenCollapsableBar('xnewsimportgo', 'xnewsimportgoicon', sprintf(_AM_PUBLISHER_IMPORT_FROM, $importFromModuleName), _AM_PUBLISHER_IMPORT_RESULT); + + $moduleHandler = xoops_gethandler('module'); $moduleObj = $moduleHandler->getByDirname('xnews'); $xnews_module_id = $moduleObj->getVar('mid'); @@ -191,7 +173,7 @@ $parentId = XoopsRequest::getInt('parent_category', 0, 'POST'); - $sql = "SELECT * FROM " . $GLOBALS['xoopsDB']->prefix('nw_topics'); + $sql = 'SELECT * FROM ' . $GLOBALS['xoopsDB']->prefix('nw_topics'); $resultCat = $GLOBALS['xoopsDB']->query($sql); @@ -210,17 +192,17 @@ $imageCategoryId = $imageCategoryHandler->getObjects($criteria); // $criteria = new CriteriaCompo(); - // $criteria->add(new Criteria("imagecategory", PUBLISHER_DIRNAME, "=")); + // $criteria->add(new Criteria('imagecategory', PUBLISHER_DIRNAME, '=')); // $newid = $imageCategoryId->getVar('imgcat_id'); $newid = $imageCategoryId[0]->vars['imgcat_id']['value']; // $newid = $imageCategoryId[0]->vars['imgcat_id']; - // $select_form = new XoopsFormSelect("", $name_current, array(), 1); - // $select_form->addOption("", _SELECT); + // $select_form = new XoopsFormSelect('', $name_current, array(), 1); + // $select_form->addOption('', _SELECT); // $select_form->addOptionArray($writer_handler->getList($criteria)); - // $sql = "SELECT * FROM " . $GLOBALS['xoopsDB']->prefix('imagecategory') . " WHERE imgcat_name=" . PUBLISHER_DIRNAME; + // $sql = 'SELECT * FROM ' . $GLOBALS['xoopsDB']->prefix('imagecategory') . ' WHERE imgcat_name=' . PUBLISHER_DIRNAME; // $resultImageCategory = $GLOBALS['xoopsDB']->query($sql); // // @@ -243,11 +225,7 @@ // Category image: copying to Publisher category uploads if (($arrCat['topic_imgurl'] != 'blank.gif') && ($arrCat['topic_imgurl'] != '')) { - if (copy( - $GLOBALS['xoops']->path("uploads/xnews/topics/" . $arrCat['topic_imgurl']), - $GLOBALS['xoops']->path("uploads/" . PUBLISHER_DIRNAME . "/images/category/" . $arrCat['topic_imgurl']) - ) - ) { + if (copy($GLOBALS['xoops']->path('uploads/xnews/topics/' . $arrCat['topic_imgurl']), $GLOBALS['xoops']->path('uploads/' . PUBLISHER_DIRNAME . '/images/category/' . $arrCat['topic_imgurl']))) { $categoryObj->setVar('image', $arrCat['topic_imgurl']); //======== there is no need to add the category images to Image Manager, because they are handled directly from /images/category/ folder @@ -276,18 +254,18 @@ } if (!$publisher->getHandler('category')->insert($categoryObj)) { - echo sprintf(_AM_PUBLISHER_IMPORT_CATEGORY_ERROR, $arrCat['topic_title']) . "
"; + echo sprintf(_AM_PUBLISHER_IMPORT_CATEGORY_ERROR, $arrCat['topic_title']) . '
'; continue; } //copy all images to Image Manager - $src = $GLOBALS['xoops']->path("uploads/xnews/topics/"); - $dst = $GLOBALS['xoops']->path("uploads"); + $src = $GLOBALS['xoops']->path('uploads/xnews/topics/'); + $dst = $GLOBALS['xoops']->path('uploads'); PublisherUtilities::recurseCopy($src, $dst); //populate the Image Manager with images from xNews articles (by Bleekk) - $sql = "INSERT INTO " . $GLOBALS['xoopsDB']->prefix("image") . "(`image_name`, `image_nicename`, `image_mimetype`, `image_display`, `image_weight`, `imgcat_id`) + $sql = 'INSERT INTO ' . $GLOBALS['xoopsDB']->prefix('image') . "(`image_name`, `image_nicename`, `image_mimetype`, `image_display`, `image_weight`, `imgcat_id`) SELECT s.picture, RIGHT(s.picture,13) AS nicename, @@ -295,7 +273,7 @@ 1 AS image_display, 0 AS image_weight, c.imgcat_id - FROM " . $GLOBALS['xoopsDB']->prefix("nw_stories") . " s, " . $GLOBALS['xoopsDB']->prefix("imagecategory") . " c + FROM " . $GLOBALS['xoopsDB']->prefix('nw_stories') . ' s, ' . $GLOBALS['xoopsDB']->prefix('imagecategory') . " c WHERE s.picture <> '' AND c.imgcat_name = '" . PUBLISHER_DIRNAME . "'"; @@ -304,9 +282,9 @@ $newCat['newid'] = $categoryObj->categoryid(); ++$cnt_imported_cat; - echo sprintf(_AM_PUBLISHER_IMPORT_CATEGORY_SUCCESS, $categoryObj->name()) . "
"; + echo sprintf(_AM_PUBLISHER_IMPORT_CATEGORY_SUCCESS, $categoryObj->name()) . '
'; - $sql = "SELECT * FROM " . $GLOBALS['xoopsDB']->prefix('nw_stories') . " WHERE topicid=" . $arrCat['topic_id']; + $sql = 'SELECT * FROM ' . $GLOBALS['xoopsDB']->prefix('nw_stories') . ' WHERE topicid=' . $arrCat['topic_id']; $resultArticles = $GLOBALS['xoopsDB']->query($sql); while (($arrArticle = $GLOBALS['xoopsDB']->fetchArray($resultArticles)) !== false) { // insert article @@ -348,29 +326,29 @@ /* // HTML Wrap if ($arrArticle['htmlpage']) { - $pagewrap_filename = $GLOBALS['xoops']->path("modules/wfsection/html/" .$arrArticle['htmlpage']); + $pagewrap_filename = $GLOBALS['xoops']->path('modules/wfsection/html/' .$arrArticle['htmlpage']); if (file_exists($pagewrap_filename)) { - if (copy($pagewrap_filename, $GLOBALS['xoops']->path("uploads/publisher/content/" . $arrArticle['htmlpage']))) { - $itemObj->setVar('body', "[pagewrap=" . $arrArticle['htmlpage'] . "]"); - echo sprintf("    " . _AM_PUBLISHER_IMPORT_ARTICLE_WRAP, $arrArticle['htmlpage']) . "
"; + if (copy($pagewrap_filename, $GLOBALS['xoops']->path('uploads/publisher/content/' . $arrArticle['htmlpage']))) { + $itemObj->setVar('body', '[pagewrap=' . $arrArticle['htmlpage'] . ']'); + echo sprintf('    ' . _AM_PUBLISHER_IMPORT_ARTICLE_WRAP, $arrArticle['htmlpage']) . '
'; } } } */ if (!$itemObj->store()) { - echo sprintf(" " . _AM_PUBLISHER_IMPORT_ARTICLE_ERROR, $arrArticle['storyid'] . ' ' . $arrArticle['title']) . "
"; + echo sprintf(' ' . _AM_PUBLISHER_IMPORT_ARTICLE_ERROR, $arrArticle['storyid'] . ' ' . $arrArticle['title']) . '
'; continue; } else { //-------------------------------------------- // Linkes files - $sql = "SELECT * FROM " . $GLOBALS['xoopsDB']->prefix("nw_stories_files") . " WHERE storyid=" . $arrArticle['storyid']; + $sql = 'SELECT * FROM ' . $GLOBALS['xoopsDB']->prefix('nw_stories_files') . ' WHERE storyid=' . $arrArticle['storyid']; $resultFiles = $GLOBALS['xoopsDB']->query($sql); $allowed_mimetypes = ''; while (($arrFile = $GLOBALS['xoopsDB']->fetchArray($resultFiles)) !== false) { - $filename = $GLOBALS['xoops']->path("uploads/xnews/attached/" . $arrFile['downloadname']); + $filename = $GLOBALS['xoops']->path('uploads/xnews/attached/' . $arrFile['downloadname']); if (file_exists($filename)) { - if (copy($filename, $GLOBALS['xoops']->path("uploads/publisher/" . $arrFile['filerealname']))) { + if (copy($filename, $GLOBALS['xoops']->path('uploads/publisher/' . $arrFile['filerealname']))) { $fileObj = $publisher->getHandler('file')->create(); $fileObj->setVar('name', $arrFile['filerealname']); $fileObj->setVar('description', $arrFile['filerealname']); @@ -384,7 +362,7 @@ $fileObj->setVar('short_url', $arrFile['filerealname']); if ($fileObj->store($allowed_mimetypes, true, false)) { - echo "    " . sprintf(_AM_PUBLISHER_IMPORTED_ARTICLE_FILE, $arrFile['filerealname']) . "
"; + echo '    ' . sprintf(_AM_PUBLISHER_IMPORTED_ARTICLE_FILE, $arrFile['filerealname']) . '
'; } } } @@ -393,7 +371,7 @@ //------------------------ $newArticleArray[$arrArticle['storyid']] = $itemObj->itemid(); - echo "  " . sprintf(_AM_PUBLISHER_IMPORTED_ARTICLE, $itemObj->title()) . "
"; + echo '  ' . sprintf(_AM_PUBLISHER_IMPORTED_ARTICLE, $itemObj->title()) . '
'; ++$cnt_imported_articles; } } @@ -409,7 +387,7 @@ $newCatArray[$newCat['oldid']] = $newCat; unset($newCat); - echo "
"; + echo '
'; } // Looping through category to change the parentID to the new parentID @@ -428,12 +406,12 @@ unset($oldid, $newCat); // Looping through the comments to link them to the new articles and module - echo _AM_PUBLISHER_IMPORT_COMMENTS . "
"; + echo _AM_PUBLISHER_IMPORT_COMMENTS . '
'; $publisher_module_id = $publisher->getModule()->mid(); $commentHandler = xoops_gethandler('comment'); - $criteria = new CriteriaCompo(); + $criteria = new CriteriaCompo(); $criteria->add(new Criteria('com_modid', $xnews_module_id)); $comments = $commentHandler->getObjects($criteria); foreach ($comments as $comment) { @@ -441,18 +419,18 @@ $comment->setVar('com_modid', $publisher_module_id); $comment->setNew(); if (!$commentHandler->insert($comment)) { - echo "  " . sprintf(_AM_PUBLISHER_IMPORTED_COMMENT_ERROR, $comment->getVar('com_title')) . "
"; + echo '  ' . sprintf(_AM_PUBLISHER_IMPORTED_COMMENT_ERROR, $comment->getVar('com_title')) . '
'; } else { - echo "  " . sprintf(_AM_PUBLISHER_IMPORTED_COMMENT, $comment->getVar('com_title')) . "
"; + echo '  ' . sprintf(_AM_PUBLISHER_IMPORTED_COMMENT, $comment->getVar('com_title')) . '
'; } } - unset($comment); + // unset($comment); - echo "

Done.
"; - echo sprintf(_AM_PUBLISHER_IMPORTED_CATEGORIES, $cnt_imported_cat) . "
"; - echo sprintf(_AM_PUBLISHER_IMPORTED_ARTICLES, $cnt_imported_articles) . "
"; - echo "
" . _AM_PUBLISHER_IMPORT_GOTOMODULE . "
"; + echo '

Done.
'; + echo sprintf(_AM_PUBLISHER_IMPORTED_CATEGORIES, $cnt_imported_cat) . '
'; + echo sprintf(_AM_PUBLISHER_IMPORTED_ARTICLES, $cnt_imported_articles) . '
'; + echo "
" . _AM_PUBLISHER_IMPORT_GOTOMODULE . '
'; publisherCloseCollapsableBar('xnewsimportgo', 'xnewsimportgoicon'); xoops_cp_footer(); diff --git a/publisher/admin/main.php b/publisher/admin/main.php index e3174bfb..d477f688 100644 --- a/publisher/admin/main.php +++ b/publisher/admin/main.php @@ -23,12 +23,12 @@ include_once $GLOBALS['xoops']->path('class/xoopslists.php'); include_once $GLOBALS['xoops']->path('class/pagenav.php'); -$itemid = XoopsRequest::getInt('itemid', 0, 'POST'); +$itemid = XoopsRequest::getInt('itemid', 0, 'POST'); -$pick = XoopsRequest::getInt('pick', XoopsRequest::getInt('pick', 0, 'GET'), 'POST'); +$pick = XoopsRequest::getInt('pick', XoopsRequest::getInt('pick', 0, 'GET'), 'POST'); $statussel = XoopsRequest::getInt('statussel', XoopsRequest::getInt('statussel', 0, 'GET'), 'POST'); -$sortsel = XoopsRequest::getString('sortsel', XoopsRequest::getString('sortsel', 'itemid', 'GET'), 'POST'); -$ordersel = XoopsRequest::getString('ordersel', XoopsRequest::getString('ordersel', 'DESC', 'GET'), 'POST'); +$sortsel = XoopsRequest::getString('sortsel', XoopsRequest::getString('sortsel', 'itemid', 'GET'), 'POST'); +$ordersel = XoopsRequest::getString('ordersel', XoopsRequest::getString('ordersel', 'DESC', 'GET'), 'POST'); $module_id = $publisher->getModule()->mid(); $gperm_handler = xoops_gethandler('groupperm'); @@ -60,12 +60,7 @@ $totalrejected = $publisher->getHandler('item')->getItemsCount(-1, array(PublisherConstantsInterface::PUBLISHER_STATUS_REJECTED)); // Check Path Configuration -if ((publisherGetPathStatus('root', true) < 0) || - (publisherGetPathStatus('images', true) < 0) || - (publisherGetPathStatus('images/category', true) < 0) || - (publisherGetPathStatus('images/item', true) < 0) || - (publisherGetPathStatus('content', true) < 0) -) { +if ((publisherGetPathStatus('root', true) < 0) || (publisherGetPathStatus('images', true) < 0) || (publisherGetPathStatus('images/category', true) < 0) || (publisherGetPathStatus('images/item', true) < 0) || (publisherGetPathStatus('content', true) < 0)) { PublisherUtilities::createDir(); } @@ -91,17 +86,22 @@ $showingtxt = ''; $selectedtxt = ''; -$cond = ""; +$cond = ''; $selectedtxt0 = ''; $selectedtxt1 = ''; $selectedtxt2 = ''; $selectedtxt3 = ''; $selectedtxt4 = ''; -$sorttxttitle = ""; -$sorttxtcreated = ""; -$sorttxtweight = ""; -$sorttxtitemid = ""; +$sorttxttitle = ''; +$sorttxtcreated = ''; +$sorttxtweight = ''; +$sorttxtitemid = ''; + +$sorttxthits = ''; +$sorttxtvotes = ''; +$sorttxtcomments = ''; +$sorttxtrating = ''; $ordertxtasc = ''; $ordertxtdesc = ''; @@ -119,6 +119,22 @@ $sorttxtweight = "selected='selected'"; break; + case 'counter': + $sorttxthits = "selected='selected'"; + break; + + case 'rating': + $sorttxtrating = "selected='selected'"; + break; + + case 'votes': + $sorttxtvotes = "selected='selected'"; + break; + + case 'comments': + $sorttxtcomments = "selected='selected'"; + break; + default : $sorttxtitemid = "selected='selected'"; break; @@ -138,35 +154,35 @@ case PublisherConstantsInterface::PUBLISHER_STATUS_ALL: $selectedtxt0 = "selected='selected'"; $caption = _AM_PUBLISHER_ALL; - $cond = ""; + $cond = ''; $status_explaination = _AM_PUBLISHER_ALL_EXP; break; case PublisherConstantsInterface::PUBLISHER_STATUS_SUBMITTED: $selectedtxt1 = "selected='selected'"; $caption = _CO_PUBLISHER_SUBMITTED; - $cond = " WHERE status = " . PublisherConstantsInterface::PUBLISHER_STATUS_SUBMITTED . " "; + $cond = ' WHERE status = ' . PublisherConstantsInterface::PUBLISHER_STATUS_SUBMITTED . ' '; $status_explaination = _AM_PUBLISHER_SUBMITTED_EXP; break; case PublisherConstantsInterface::PUBLISHER_STATUS_PUBLISHED: $selectedtxt2 = "selected='selected'"; $caption = _CO_PUBLISHER_PUBLISHED; - $cond = " WHERE status = " . PublisherConstantsInterface::PUBLISHER_STATUS_PUBLISHED . " "; + $cond = ' WHERE status = ' . PublisherConstantsInterface::PUBLISHER_STATUS_PUBLISHED . ' '; $status_explaination = _AM_PUBLISHER_PUBLISHED_EXP; break; case PublisherConstantsInterface::PUBLISHER_STATUS_OFFLINE: $selectedtxt3 = "selected='selected'"; $caption = _CO_PUBLISHER_OFFLINE; - $cond = " WHERE status = " . PublisherConstantsInterface::PUBLISHER_STATUS_OFFLINE . " "; + $cond = ' WHERE status = ' . PublisherConstantsInterface::PUBLISHER_STATUS_OFFLINE . ' '; $status_explaination = _AM_PUBLISHER_OFFLINE_EXP; break; case PublisherConstantsInterface::PUBLISHER_STATUS_REJECTED: $selectedtxt4 = "selected='selected'"; $caption = _CO_PUBLISHER_REJECTED; - $cond = " WHERE status = " . PublisherConstantsInterface::PUBLISHER_STATUS_REJECTED . " "; + $cond = ' WHERE status = ' . PublisherConstantsInterface::PUBLISHER_STATUS_REJECTED . ' '; $status_explaination = _AM_PUBLISHER_REJECTED_ITEM_EXP; break; } @@ -184,6 +200,12 @@ + + + + + + */ - _createInput: function(){ + _createInput: function () { var self = this; - + var input = document.createElement("input"); input.setAttribute('type', 'file'); input.setAttribute('name', this._settings.name); - + addStyles(input, { - 'position' : 'absolute', + 'position': 'absolute', // in Opera only 'browse' button // is clickable and it is located at // the right side of the input - 'right' : 0, - 'margin' : 0, - 'padding' : 0, - 'fontSize' : '480px', - 'cursor' : 'pointer' - }); - - var div = document.createElement("div"); + 'right': 0, + 'margin': 0, + 'padding': 0, + 'fontSize': '480px', + 'cursor': 'pointer' + }); + + var div = document.createElement("div"); addStyles(div, { - 'display' : 'block', - 'position' : 'absolute', - 'overflow' : 'hidden', - 'margin' : 0, - 'padding' : 0, - 'opacity' : 0, + 'display': 'block', + 'position': 'absolute', + 'overflow': 'hidden', + 'margin': 0, + 'padding': 0, + 'opacity': 0, // Make sure browse button is in the right side // in Internet Explorer - 'direction' : 'ltr', + 'direction': 'ltr', //Max zIndex supported by Opera 9.0-9.2 'zIndex': 2147483583 }); - + // Make sure that element opacity exists. // Otherwise use IE filter - if ( div.style.opacity !== "0") { - if (typeof(div.filters) == 'undefined'){ + if (div.style.opacity !== "0") { + if (typeof(div.filters) == 'undefined') { throw new Error('Opacity not supported by the browser'); } div.style.filter = "alpha(opacity=0)"; - } - - addEvent(input, 'change', function(){ - - if ( ! input || input.value === ''){ - return; + } + + addEvent(input, 'change', function () { + + if (!input || input.value === '') { + return; } - + // Get filename from input, required // as some browsers have path instead of it var file = fileFromPath(input.value); - - if (false === self._settings.onChange.call(self, file, getExt(file))){ - self._clearInput(); + + if (false === self._settings.onChange.call(self, file, getExt(file))) { + self._clearInput(); return; } - + // Submit form when value is changed if (self._settings.autoSubmit) { self.submit(); } - }); + }); - addEvent(input, 'mouseover', function(){ + addEvent(input, 'mouseover', function () { addClass(self._button, self._settings.hoverClass); }); - - addEvent(input, 'mouseout', function(){ + + addEvent(input, 'mouseout', function () { removeClass(self._button, self._settings.hoverClass); - + // We use visibility instead of display to fix problem with Safari 4 // The problem is that the value of input doesn't change if it // has display none when user selects a file input.parentNode.style.visibility = 'hidden'; - }); - - div.appendChild(input); + }); + + div.appendChild(input); document.body.appendChild(div); - + this._input = input; }, - _clearInput : function(){ - if (!this._input){ + _clearInput: function () { + if (!this._input) { return; - } - + } + // this._input.value = ''; Doesn't work in IE6 removeNode(this._input.parentNode); - this._input = null; + this._input = null; this._createInput(); - + removeClass(this._button, this._settings.hoverClass); }, /** * Function makes sure that when user clicks upload button, * the this._input is clicked instead */ - _rerouteClicks: function(){ + _rerouteClicks: function () { var self = this; - + // IE will later display 'access denied' error // if you use using self._input.click() // other browsers just ignore click() - addEvent(self._button, 'mouseover', function(){ - if (self._disabled){ + addEvent(self._button, 'mouseover', function () { + if (self._disabled) { return; } - - if ( ! self._input){ - self._createInput(); + + if (!self._input) { + self._createInput(); } - - var div = self._input.parentNode; + + var div = self._input.parentNode; copyLayout(self._button, div); div.style.visibility = 'visible'; - + }); - - + + // commented because we now hide input on mouseleave /** - * When the window is resized the elements + * When the window is resized the elements * can be misaligned if button position depends * on window size */ @@ -478,33 +480,33 @@ // copyLayout(self._button, self._input.parentNode); // } //}); - + }, /** * Creates iframe with unique name * @return {Element} iframe */ - _createIframe: function(){ + _createIframe: function () { // We can't use getTime, because it sometimes return // same value in safari :( - var id = getUID(); - + var id = getUID(); + // We can't use following code as the name attribute // won't be properly registered in IE6, and new window // on form submit will open // var iframe = document.createElement('iframe'); // iframe.setAttribute('name', id); - + var iframe = toElement('