From 97eebaf6912dc95b2d2e6361a61668c583d1a91e Mon Sep 17 00:00:00 2001 From: mambax7 Date: Tue, 31 May 2016 05:20:55 -0400 Subject: [PATCH 1/2] bug fixes --- README.md | 24 ++++- admin/admin_footer.php | 9 +- admin/category.php | 53 +++++++++--- admin/file.php | 43 +++++++-- admin/import.php | 8 +- admin/main.php | 106 ++++++++++++++++++++--- admin/offer.php | 6 +- admin/partner.php | 76 ++++++++++++---- admin/xoopspartners.php | 15 ++-- blocks/categories_list.php | 5 +- blocks/moving_partner.php | 2 +- blocks/partners_list.php | 4 +- blocks/random_offer.php | 4 +- blocks/random_partner.php | 2 +- blocks/recent_offers.php | 2 +- blocks/recent_partners.php | 2 +- blocks/scrolling_partner.php | 4 +- class/baseObjectHandler.php | 2 +- class/category.php | 6 +- class/file.php | 54 ++++++------ class/keyhighlighter.class.php | 2 +- class/mimetype.php | 15 ++-- class/object.php | 2 +- class/offer.php | 6 +- class/partner.php | 95 +++++++++++--------- class/partner_cat_link.php | 80 +++++++++++++++++ class/partnercatlink.php | 6 +- class/session.php | 13 ++- class/smartdbupdater.php | 40 ++++----- class/uploader.php | 10 +-- docs/changelog.txt | 3 +- include/blocksadmin.inc.php | 22 +++-- include/common.php | 2 +- include/displayitems.php | 24 ++++- include/displaysubcats.php | 36 +++++++- include/functions.php | 34 +++++--- include/gtickets.php | 2 +- include/mimetypes.inc.php | 2 +- include/onupdate.inc.php | 14 +-- include/updateblock.inc.php | 21 ++++- language/english/admin.php | 23 +++-- language/english/common.php | 11 +-- language/english/help/help.html | 8 +- language/english/main.php | 2 +- language/english/modinfo.php | 6 +- makepdf.php | 4 +- templates/blocks/moving_patner.tpl | 8 +- templates/blocks/partners_block_list.tpl | 6 +- templates/blocks/random_offer.tpl | 8 +- templates/blocks/random_partner.tpl | 6 +- templates/blocks/recent_offers.tpl | 8 +- templates/blocks/recent_partners.tpl | 6 +- templates/smartpartner_footer.tpl | 2 +- templates/smartpartner_index.tpl | 9 +- templates/smartpartner_offer.tpl | 4 +- templates/smartpartner_partner.tpl | 15 ++-- templates/smartpartner_pdf.tpl | 11 ++- xoops_version.php | 26 +++--- 58 files changed, 710 insertions(+), 309 deletions(-) create mode 100644 class/partner_cat_link.php diff --git a/README.md b/README.md index 6572656..55f258e 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,22 @@ -#SmartPartner -[![Software License](https://img.shields.io/badge/license-GPL-brightgreen.svg?style=flat)](LICENSE) + ![alt XOOPS CMS](http://xoops.org/images/logoXoops4GithubRepository.png) + ## SmartPartner for [XOOPS CMS 2.5.8+](https://xoops.org) + [![Software License](https://img.shields.io/badge/license-GPL-brightgreen.svg?style=flat)](LICENSE) + [![Scrutinizer Code Quality](https://img.shields.io/scrutinizer/g/mambax7/smartpartner.svg?style=flat)](https://scrutinizer-ci.com/g/mambax7/smartpartner/?branch=master) + [![Codacy Badge](https://api.codacy.com/project/badge/grade/2d27c0023ee54f0b9ba2b5d17a68b2a5)](https://www.codacy.com/app/mambax7/smartpartner) + [![Code Climate](https://img.shields.io/codeclimate/github/mambax7/smartpartner.svg?style=flat)](https://codeclimate.com/github/mambax7/smartpartner) + [![SensioLabsInsight](https://insight.sensiolabs.com/projects/626a39f7-d06e-47a6-8fc9-20bd04275bb1/mini.png)](https://insight.sensiolabs.com/projects/626a39f7-d06e-47a6-8fc9-20bd04275bb1) + [![Latest Pre-Resease](https://img.shields.io/github/tag/XoopsModules25x/smartpartner.svg?style=flat)](https://github.com/XoopsModules25x/smartpartner/tags/) + [![Latest Version](https://img.shields.io/github/release/XoopsModules25x/smartpartner.svg?style=flat)](https://github.com/XoopsModules25x/smartpartner/releases/) + +SmartPartner for [XOOPS CMS](http://xoops.org) is an advanced Partners Management System for your XOOPS site. + + [![Tutorial Available](http://xoops.org/images/tutorial-available-blue.svg)](https://www.gitbook.com/book/xoops/xoops-smartpartner-module/) Tutorial: see [here](https://www.gitbook.com/book/xoops/xoops-smartpartner-module/). + To contribute to the Tutorial, [fork it on GitHub](https://github.com/XoopsDocs/smartpartner-tutorial) + + [![Translations on Transifex](http://xoops.org/images/translations-transifex-blue.svg)](https://www.transifex.com/xoops) + + Please visit us on [http://xoops.org](https://xoops.org) + + The upcoming "next generation" version of XOOPS CMS is being crafted on GitHub at: https://github.com/XOOPS + -SmartPartner is an advanced Partners Management System for your XOOPS site. diff --git a/admin/admin_footer.php b/admin/admin_footer.php index e3f7c1e..30e1587 100644 --- a/admin/admin_footer.php +++ b/admin/admin_footer.php @@ -17,6 +17,13 @@ * @author XOOPS Development Team */ -echo "
\n" . "
\n" . " XOOPS\n" . "
\n" . ' ' . _AM_MODULEADMIN_ADMIN_FOOTER . "\n" . '
'; +echo "
\n" + . "
\n" + . " XOOPS\n" + . "
\n" + . ' ' + . _AM_MODULEADMIN_ADMIN_FOOTER + . "\n" + . '
'; xoops_cp_footer(); diff --git a/admin/category.php b/admin/category.php index 10bad2a..7ecdc73 100644 --- a/admin/category.php +++ b/admin/category.php @@ -18,8 +18,28 @@ function displayCategory($categoryObj, $level = 0) $description = substr($description, 0, 100 - 1) . '...'; } } - $modify = "" . _AM_SPARTNER_CATEGORY_EDIT . ""; - $delete = "" . _AM_SPARTNER_CATEGORY_DELETE . ""; + $modify = ""
+              . _AM_SPARTNER_CATEGORY_EDIT
+              . ""; + $delete = ""
+              . _AM_SPARTNER_CATEGORY_DELETE
+              . ""; $spaces = ''; for ($j = 0; $j < $level; ++$j) { @@ -27,7 +47,15 @@ function displayCategory($categoryObj, $level = 0) } echo ''; - echo "" . $spaces . " " . $categoryObj->name() . ''; + echo "" + . $spaces + . " " + . $categoryObj->name() + . ''; echo "" . $categoryObj->weight() . ''; echo " $modify $delete "; echo ''; @@ -59,7 +87,7 @@ function editcat($showmenu = false, $categoryid = 0, $nb_subcats = 4, $categoryO //$categoryObj = new SmartpartnerCategory($categoryid); $categoryObj = $smartPartnerCategoryHandler->get($categoryid); - echo "
\n"; + echo "
\n"; if ($categoryObj->notLoaded()) { redirect_header('category.php', 1, _AM_SPARTNER_NOCOLTOEDIT); } @@ -69,7 +97,7 @@ function editcat($showmenu = false, $categoryid = 0, $nb_subcats = 4, $categoryO $categoryObj = $smartPartnerCategoryHandler->create(); } - //echo "
\n"; + //echo "
\n"; smartpartner_collapsableBar('createtable', 'createtableicon', _AM_SPARTNER_CATEGORY_CREATE, _AM_SPARTNER_CATEGORY_CREATE_INFO); } // Start category form @@ -88,10 +116,10 @@ function editcat($showmenu = false, $categoryid = 0, $nb_subcats = 4, $categoryO $image_select = new XoopsFormSelect('', 'image', $categoryObj->image()); $image_select->addOption('-1', '---------------'); $image_select->addOptionArray($image_array); - $image_select->setExtra("onchange='showImgSelected(\"image3\", \"image\", \"" . 'uploads/smartpartner/images/category/' . "\", \"\", \"" . XOOPS_URL . "\")'"); + $image_select->setExtra("onchange='showImgSelected(\"image3\", \"image\", \"" . 'uploads/smartpartner/assets/images/category/' . "\", \"\", \"" . XOOPS_URL . "\")'"); $image_tray = new XoopsFormElementTray(_AM_SPARTNER_CATEGORY_IMAGE, ' '); $image_tray->addElement($image_select); - $image_tray->addElement(new XoopsFormLabel('', "

image() . "' name='image3' id='image3' alt='' />")); + $image_tray->addElement(new XoopsFormLabel('', "

image() . "' name='image3' id='image3' alt='' />")); $image_tray->setDescription(_AM_SPARTNER_CATEGORY_IMAGE_DSC); $sform->addElement($image_tray); @@ -122,7 +150,7 @@ function editcat($showmenu = false, $categoryid = 0, $nb_subcats = 4, $categoryO // Added by fx2024 // sub Categories - $cat_tray = new XoopsFormElementTray(_AM_SPARTNER_CATEGORY_SUBCATS_CREATE, '

'); + $cat_tray = new XoopsFormElementTray(_AM_SPARTNER_CATEGORY_SUBCATS_CREATE, '

'); $cat_tray->setDescription(_AM_SPARTNER_CATEGORY_SUBCATS_CREATE_DSC); for ($i = 0; $i < $nb_subcats; ++$i) { if ($i < (isset($_POST['scname']) ? count($_POST['scname']) : 0)) { @@ -362,7 +390,7 @@ function editcat($showmenu = false, $categoryid = 0, $nb_subcats = 4, $categoryO smartpartner_xoops_cp_header(); - $categoryObj =& $smartPartnerCategoryHandler->create(); + $categoryObj = $smartPartnerCategoryHandler->create(); $categoryObj->setVar('name', $_POST['name']); $categoryObj->setVar('description', $_POST['description']); $categoryObj->setVar('weight', $_POST['weight']); @@ -402,7 +430,8 @@ function editcat($showmenu = false, $categoryid = 0, $nb_subcats = 4, $categoryO // no confirm: show deletion condition $categoryid = isset($_GET['categoryid']) ? (int)$_GET['categoryid'] : 0; xoops_cp_header(); - xoops_confirm(array('op' => 'del', 'categoryid' => $categoryObj->categoryid(), 'confirm' => 1, 'name' => $categoryObj->name()), 'category.php', _AM_SPARTNER_CATEGORY_DELETE . " '" . $categoryObj->name() . "'.

" . _AM_SPARTNER_CATEGORY_DELETE_CONFIRM, _AM_SPARTNER_DELETE); + xoops_confirm(array('op' => 'del', 'categoryid' => $categoryObj->categoryid(), 'confirm' => 1, 'name' => $categoryObj->name()), 'category.php', + _AM_SPARTNER_CATEGORY_DELETE . " '" . $categoryObj->name() . "'.

" . _AM_SPARTNER_CATEGORY_DELETE_CONFIRM, _AM_SPARTNER_DELETE); xoops_cp_footer(); } exit(); @@ -422,7 +451,7 @@ function editcat($showmenu = false, $categoryid = 0, $nb_subcats = 4, $categoryO echo $indexAdmin->renderButton('left', ''); /* - echo "
\n"; + echo "
\n"; echo "
"; echo "  "; //echo "  "; @@ -454,7 +483,7 @@ function editcat($showmenu = false, $categoryid = 0, $nb_subcats = 4, $categoryO include_once XOOPS_ROOT_PATH . '/class/pagenav.php'; $pagenav = new XoopsPageNav($totalCategories, $xoopsModuleConfig['perpage_admin'], $startcategory, 'startcategory'); echo '
' . $pagenav->renderNav() . '
'; - echo '
'; + echo '
'; smartpartner_close_collapsable('createdcategories', 'createdcategoriesicon'); echo '
'; //editcat(false); diff --git a/admin/file.php b/admin/file.php index 62cb671..1f0a869 100644 --- a/admin/file.php +++ b/admin/file.php @@ -39,13 +39,13 @@ function editfile($showmenu = false, $fileid = 0, $id = 0) redirect_header('javascript:history.go(-1)', 1, _AM_SPARTNER_NOFILESELECTED); } - echo "
\n"; + echo "
\n"; echo "" . _AM_SPARTNER_FILE_EDITING . ''; echo "" . _AM_SPARTNER_FILE_EDITING_DSC . ''; smartpartner_collapsableBar('editfile', 'editfileicon', _AM_SPARTNER_FILE_INFORMATIONS); } else { // there's no parameter, so we're adding an item - $fileObj =& $smartPartnerFileHandler->create(); + $fileObj = $smartPartnerFileHandler->create(); $fileObj->setVar('id', $id); echo "" . _AM_SPARTNER_FILE_ADDING . ''; @@ -201,7 +201,8 @@ function editfile($showmenu = false, $fileid = 0, $id = 0) $fileid = isset($_GET['fileid']) ? (int)$_GET['fileid'] : 0; smartpartner_xoops_cp_header(); - xoops_confirm(array('op' => 'del', 'fileid' => $fileObj->fileid(), 'confirm' => 1, 'name' => $fileObj->name()), 'file.php', _AM_SPARTNER_DELETETHISFILE . '
' . $fileObj->name() . '

', _AM_SPARTNER_DELETE); + xoops_confirm(array('op' => 'del', 'fileid' => $fileObj->fileid(), 'confirm' => 1, 'name' => $fileObj->name()), 'file.php', + _AM_SPARTNER_DELETETHISFILE . '
' . $fileObj->name() . '

', _AM_SPARTNER_DELETE); xoops_cp_footer(); } @@ -218,7 +219,7 @@ function editfile($showmenu = false, $fileid = 0, $id = 0) global $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $xoopsModuleConfig, $xoopsModule; - echo "
\n"; + echo "
\n"; smartpartner_collapsableBar('toptable', 'toptableicon', _AM_SPARTNER_PUBLISHEDITEMS, _AM_SPARTNER_PUBLISHED_DSC); @@ -241,13 +242,39 @@ function editfile($showmenu = false, $fileid = 0, $id = 0) for ($i = 0; $i < $totalItemsOnPage; ++$i) { $categoryObj =& $itemsObj[$i]->category(); - $modify = "" . _AM_SPARTNER_EDITITEM . ""; - $delete = "" . _AM_SPARTNER_DELETEITEM . ""; + $modify = ""
+                          . _AM_SPARTNER_EDITITEM
+                          . ""; + $delete = ""
+                          . _AM_SPARTNER_DELETEITEM
+                          . ""; echo ''; echo "" . $itemsObj[$i]->id() . ''; echo "" . $categoryObj->name() . ''; - echo "dirname() . '/partner.php?id=' . $itemsObj[$i]->id() . "'>" . $itemsObj[$i]->title() . ''; + echo "dirname() + . '/partner.php?id=' + . $itemsObj[$i]->id() + . "'>" + . $itemsObj[$i]->title() + . ''; echo "" . $itemsObj[$i]->datesub() . ''; echo " $modify $delete "; echo ''; @@ -259,7 +286,7 @@ function editfile($showmenu = false, $fileid = 0, $id = 0) echo ''; } echo "\n"; - echo "
\n"; + echo "
\n"; $pagenav = new XoopsPageNav($totalitems, $xoopsModuleConfig['perpage'], $startitem, 'startitem'); echo '
' . $pagenav->renderNav() . '
'; diff --git a/admin/import.php b/admin/import.php index b0b9f0c..1ef1d7e 100644 --- a/admin/import.php +++ b/admin/import.php @@ -32,9 +32,9 @@ include_once($importfile_path); } foreach ($msgs as $m) { - echo $m . '
'; + echo $m . '
'; } - echo '
'; + echo '
'; if ($error == true) { $endMsg = _AM_SPARTNER_IMPORT_ERROR; } else { @@ -42,9 +42,9 @@ } echo $endMsg; - echo '

'; + echo '

'; echo "" . _AM_SPARTNER_IMPORT_BACK . ''; - echo '

'; + echo '

'; break; case 'default': diff --git a/admin/main.php b/admin/main.php index 303aed6..ad4a594 100644 --- a/admin/main.php +++ b/admin/main.php @@ -56,7 +56,7 @@ function pathConfiguration() global $xoopsModule; // Upload and Images Folders smartpartner_collapsableBar('configtable', 'configtableicon', _AM_SPARTNER_PATHCONFIGURATION); - echo '
'; + echo '
'; echo ""; echo "'; echo "'; @@ -73,7 +73,7 @@ function pathConfiguration() echo "'; echo '
" . _AM_SPARTNER_PATH_ITEM . '" . _AM_SPARTNER_PATH . '" . smartpartner_admin_getPathStatus('images/category') . '
'; - echo '
'; + echo '
'; smartpartner_close_collapsable('configtable', 'configtableicon'); } @@ -133,14 +133,14 @@ function buildTable() // -- // //smartpartner_collapsableBar('index', 'indexicon', _AM_SPARTNER_INVENTORY); -//echo "
"; +//echo "
"; //echo ""; //echo ""; //echo ""; //echo ""; //echo ""; //echo "
" . _AM_SPARTNER_TOTAL_SUBMITTED . "" . $totalsubmitted . "" . _AM_SPARTNER_TOTAL_ACTIVE . "" . $totalactive . "" . _AM_SPARTNER_TOTAL_REJECTED . "" . $totalrejected . "" . _AM_SPARTNER_TOTAL_INACTIVE . "" . $totalinactive . "
"; -//echo "
"; +//echo "
"; // //echo "
"; //echo "  "; @@ -275,30 +275,102 @@ function buildTable() case _SPARTNER_STATUS_SUBMITTED: $statustxt = _AM_SPARTNER_SUBMITTED; - $approve = "" . _AM_SPARTNER_PARTNER_APPROVE . " "; - $delete = "" . _AM_SPARTNER_PARTNER_DELETE . " "; + $approve = ""
+                             . _AM_SPARTNER_PARTNER_APPROVE
+                             . " "; + $delete = ""
+                             . _AM_SPARTNER_PARTNER_DELETE
+                             . " "; $modify = ''; break; case _SPARTNER_STATUS_ACTIVE: $statustxt = _AM_SPARTNER_ACTIVE; $approve = ''; - $modify = "" . _AM_SPARTNER_PARTNER_EDIT . " "; - $delete = "" . _AM_SPARTNER_PARTNER_DELETE . " "; + $modify = ""
+                             . _AM_SPARTNER_PARTNER_EDIT
+                             . " "; + $delete = ""
+                             . _AM_SPARTNER_PARTNER_DELETE
+                             . " "; break; case _SPARTNER_STATUS_INACTIVE: $statustxt = _AM_SPARTNER_INACTIVE; $approve = ''; - $modify = "" . _AM_SPARTNER_PARTNER_EDIT . " "; - $delete = "" . _AM_SPARTNER_PARTNER_DELETE . " "; + $modify = ""
+                             . _AM_SPARTNER_PARTNER_EDIT
+                             . " "; + $delete = ""
+                             . _AM_SPARTNER_PARTNER_DELETE
+                             . " "; break; case _SPARTNER_STATUS_REJECTED: $statustxt = _AM_SPARTNER_REJECTED; $approve = ''; - $modify = "" . _AM_SPARTNER_PARTNER_EDIT . " "; - $delete = "" . _AM_SPARTNER_PARTNER_DELETE . " "; + $modify = ""
+                             . _AM_SPARTNER_PARTNER_EDIT
+                             . " "; + $delete = ""
+                             . _AM_SPARTNER_PARTNER_DELETE
+                             . " "; break; case 'default': @@ -310,7 +382,15 @@ function buildTable() } echo ''; - echo " " . $partnersObj[$i]->title() . ''; + echo " " + . $partnersObj[$i]->title() + . ''; echo "" . $partnersObj[$i]->summary(100) . ''; echo "" . $partnersObj[$i]->hits() . ''; echo "" . $statustxt . ''; diff --git a/admin/offer.php b/admin/offer.php index b6de409..6203cfc 100644 --- a/admin/offer.php +++ b/admin/offer.php @@ -38,7 +38,7 @@ function editoffer($showmenu = false, $offerid = 0, $fct = '') if ($showmenu) { //smart_adminMenu($menuTab, $breadcrumb); } - echo "
\n"; + echo "
\n"; smart_collapsableBar($collaps_name, $title, $info); $sform = $offerObj->getForm($form_name, 'addoffer', false, $submit_button_caption); @@ -110,7 +110,7 @@ function editoffer($showmenu = false, $offerid = 0, $fct = '') //smart_adminMenu(3, _AM_SPARTNER_OFFERS); - // echo "
\n"; + // echo "
\n"; // echo "
"; // echo "  "; // echo "
"; @@ -126,7 +126,7 @@ function editoffer($showmenu = false, $offerid = 0, $fct = '') $objectTable->addColumn(new SmartObjectColumn('status', 'center', 100)); $objectTable->render(); - echo '
'; + echo '
'; smart_close_collapsable('createdoffers'); echo '
'; diff --git a/admin/partner.php b/admin/partner.php index 17252b2..f8cef2d 100644 --- a/admin/partner.php +++ b/admin/partner.php @@ -12,9 +12,9 @@ function showfiles($partnerObj) // UPLOAD FILES //include_once XOOPS_ROOT_PATH . '/modules/smartpartner/include/functions.php'; global $xoopsModule, $smartPartnerFileHandler; - + $pathIcon16 = '../' . $xoopsModule->getInfo('icons16'); smartpartner_collapsableBar('filetable', 'filetableicon', _AM_SPARTNER_FILES_LINKED); - $filesObj =& $smartPartnerFileHandler->getAllFiles($partnerObj->id()); + $filesObj = $smartPartnerFileHandler->getAllFiles($partnerObj->id()); if (count($filesObj) > 0) { echo ""; echo ''; @@ -27,8 +27,26 @@ function showfiles($partnerObj) echo ''; for ($i = 0, $iMax = count($filesObj); $i < $iMax; ++$i) { - $modify = "" . _AM_SPARTNER_EDITFILE . ""; - $delete = "" . _AM_SPARTNER_DELETEFILE . ""; + $modify = ""
+                      . _AM_SPARTNER_EDITFILE
+                      . ""; + $delete = ""
+                      . _AM_SPARTNER_DELETEFILE
+                      . ""; if ($filesObj[$i]->status() == 0) { $not_visible = "dirname() . "/assets/images/no.gif'/>"; } else { @@ -119,16 +137,16 @@ function editpartner($showmenu = false, $id = 0) break; } - echo "
\n"; + echo "
\n"; smartpartner_collapsableBar('editpartner', 'editpartmericon', $page_title, $page_info); } else { // there's no parameter, so we're adding a partner - $partnerObj =& $smartPartnerPartnerHandler->create(); + $partnerObj = $smartPartnerPartnerHandler->create(); $breadcrumb_action1 = _AM_SPARTNER_PARTNERS; $breadcrumb_action2 = _AM_SPARTNER_CREATE; $button_caption = _AM_SPARTNER_CREATE; $new_status = _SPARTNER_STATUS_ACTIVE; - smartpartner_collapsableBar('addpartner', 'addpartmericon', _AM_SPARTNER_PARTNER_CREATING, _AM_SPARTNER_PARTNER_CREATING_DSC); + smartpartner_collapsableBar('addpartner', 'addpartnericon', _AM_SPARTNER_PARTNER_CREATING, _AM_SPARTNER_PARTNER_CREATING_DSC); } // PARTNER FORM @@ -157,7 +175,7 @@ function editpartner($showmenu = false, $id = 0) $logo_select->setExtra("onchange='showImgSelected(\"image3\", \"image\", \"" . 'uploads/' . SMARTPARTNER_DIRNAME . '/images' . "\", \"\", \"" . XOOPS_URL . "\")'"); $logo_tray = new XoopsFormElementTray(_AM_SPARTNER_LOGO, ' '); $logo_tray->addElement($logo_select); - $logo_tray->addElement(new XoopsFormLabel('', "

image() . "' name='image3' id='image3' alt='' />")); + $logo_tray->addElement(new XoopsFormLabel('', "

image() . "' name='image3' id='image3' alt='' />")); $logo_tray->setDescription(_AM_SPARTNER_LOGO_DSC); $sform->addElement($logo_tray); @@ -428,7 +446,6 @@ function editpartner($showmenu = false, $id = 0) // Storing the partner if (!$partnerObj->store()) { redirect_header('javascript:history.go(-1)', 3, $redirect_msgs['error'] . smartpartner_formatErrors($partnerObj->getErrors())); - exit; } if (($_POST['original_status'] == _SPARTNER_STATUS_SUBMITTED) || ($_POST['status'] == _SPARTNER_STATUS_ACTIVE)) { @@ -466,7 +483,8 @@ function editpartner($showmenu = false, $id = 0) // no confirm: show deletion condition $id = isset($_GET['id']) ? (int)$_GET['id'] : 0; xoops_cp_header(); - xoops_confirm(array('op' => 'del', 'id' => $partnerObj->id(), 'confirm' => 1, 'name' => $partnerObj->title()), 'partner.php', _AM_SPARTNER_DELETETHISP . "
'" . $partnerObj->title() . "'

", _AM_SPARTNER_DELETE); + xoops_confirm(array('op' => 'del', 'id' => $partnerObj->id(), 'confirm' => 1, 'name' => $partnerObj->title()), 'partner.php', + _AM_SPARTNER_DELETETHISP . "
'" . $partnerObj->title() . "'

", _AM_SPARTNER_DELETE); xoops_cp_footer(); } @@ -480,9 +498,9 @@ function editpartner($showmenu = false, $id = 0) echo $indexAdmin->addNavigation(basename(__FILE__)); $indexAdmin->addItemButton(_AM_SPARTNER_PARTNER_CREATE, 'partner.php?op=add', 'add', ''); - echo $indexAdmin->renderButton('left', ''); + echo $indexAdmin->renderButton('left', ''); - // echo "
\n"; + // echo "
\n"; // echo "
"; // echo "  "; // echo "
"; @@ -510,11 +528,37 @@ function editpartner($showmenu = false, $id = 0) echo ''; if ($totalpartners > 0) { for ($i = 0; $i < $totalPartnersOnPage; ++$i) { - $modify = "" . _AM_SPARTNER_EDITPARTNER . " "; - $delete = "" . _AM_SPARTNER_DELETEPARTNER . " "; + $modify = ""
+                          . _AM_SPARTNER_EDITPARTNER
+                          . " "; + $delete = ""
+                          . _AM_SPARTNER_DELETEPARTNER
+                          . " "; echo ''; - echo "'; + echo "'; echo "'; echo "'; echo "'; @@ -528,7 +572,7 @@ function editpartner($showmenu = false, $id = 0) echo ''; } echo "
 " . $partnersObj[$i]->title() . ' " + . $partnersObj[$i]->title() + . '" . $partnersObj[$i]->summary(100) . '" . $partnersObj[$i]->hits() . '" . $partnersObj[$i]->getStatusName() . '
\n"; - echo "
\n"; + echo "
\n"; $pagenav = new XoopsPageNav($totalpartners, $xoopsModuleConfig['perpage_admin'], $startpartner, 'startpartner'); echo '
' . $pagenav->renderNav() . '
'; diff --git a/admin/xoopspartners.php b/admin/xoopspartners.php index 950f180..7b704ff 100644 --- a/admin/xoopspartners.php +++ b/admin/xoopspartners.php @@ -29,7 +29,8 @@ $result = $xoopsDB->query('select count(*) from ' . $xoopsDB->prefix('partners')); list($totalpartners) = $xoopsDB->fetchRow($result); - smartpartner_collapsableBar('bottomtable', 'bottomtableicon', sprintf(_AM_SPARTNER_IMPORT_FROM, $importFromModuleName), sprintf(_AM_SPARTNER_IMPORT_MODULE_FOUND, $importFromModuleName, $totalpartners)); + smartpartner_collapsableBar('bottomtable', 'bottomtableicon', sprintf(_AM_SPARTNER_IMPORT_FROM, $importFromModuleName), + sprintf(_AM_SPARTNER_IMPORT_MODULE_FOUND, $importFromModuleName, $totalpartners)); $form = new XoopsThemeForm(_AM_SPARTNER_IMPORT_SETTINGS, 'import_form', XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/admin/' . $scriptname); @@ -57,7 +58,7 @@ extract($arrPartners, EXTR_PREFIX_ALL, 'xpartner'); // insert partner into SmartPartner - $partnerObj =& $smartPartnerPartnerHandler->create(); + $partnerObj = $smartPartnerPartnerHandler->create(); if ($xpartner_status == 0) { $xpartner_status = _SPARTNER_STATUS_INACTIVE; @@ -74,18 +75,18 @@ $partnerObj->setVar('status', $xpartner_status); if (!$partnerObj->store(false)) { - echo sprintf(' ' . _AM_SPARTNER_IMPORT_PARTNER_ERROR, $xpartner_title) . '
'; + echo sprintf(' ' . _AM_SPARTNER_IMPORT_PARTNER_ERROR, $xpartner_title) . '
'; continue; } else { - echo '  ' . sprintf(_AM_SPARTNER_IMPORTED_PARTNER, $partnerObj->title()) . '
'; + echo '  ' . sprintf(_AM_SPARTNER_IMPORTED_PARTNER, $partnerObj->title()) . '
'; ++$cnt_imported_partner; } - echo '
'; + echo '
'; } - echo 'Done.
'; - echo sprintf(_AM_SPARTNER_IMPORTED_PARTNERS, $cnt_imported_partner) . '
'; + echo 'Done.
'; + echo sprintf(_AM_SPARTNER_IMPORTED_PARTNERS, $cnt_imported_partner) . '
'; //exit (); } diff --git a/blocks/categories_list.php b/blocks/categories_list.php index 9506024..609445f 100644 --- a/blocks/categories_list.php +++ b/blocks/categories_list.php @@ -17,7 +17,8 @@ function get_content($cat_id, $catsObj, $displaysubs) $i = 0; foreach ($catsObj as $catObj) { if ($catObj->getVar('parentid') == $cat_id) { - $content[$catObj->getVar('categoryid')]['link'] = "" . $catObj->getVar('name') . ''; + $content[$catObj->getVar('categoryid')]['link'] = + "" . $catObj->getVar('name') . ''; $content[$catObj->getVar('categoryid')]['categories'] = get_content($catObj->getVar('categoryid'), $catsObj, $displaysubs); $content[$catObj->getVar('categoryid')]['displaysubs'] = $displaysubs; } @@ -41,7 +42,7 @@ function b_categories_list_show($options) $criteria->setSort(isset($options[0]) ? $options[0] : 'name'); $criteria->setOrder(isset($options[1]) ? $options[1] : 'ASC'); - $catsObj =& $smartPartnerCategoryHandler->getobjects($criteria, true); + $catsObj = $smartPartnerCategoryHandler->getObjects($criteria, true); $catArray = get_content(0, $catsObj, $options[2]); $block = array(); diff --git a/blocks/moving_partner.php b/blocks/moving_partner.php index 0de8be1..dbd0a8a 100644 --- a/blocks/moving_partner.php +++ b/blocks/moving_partner.php @@ -36,7 +36,7 @@ function b_random_partner_show($options) } else { $partner['title'] = ''; } - $smartConfig =& smartpartner_getModuleConfig(); + $smartConfig = smartpartner_getModuleConfig(); $image_info = smartpartner_imageResize($partnerObj->getImagePath(), $smartConfig['img_max_width'], $smartConfig['img_max_height']); $partner['img_attr'] = $image_info[3]; $partner['extendedInfo'] = $partnerObj->extentedInfo(); diff --git a/blocks/partners_list.php b/blocks/partners_list.php index 15519bf..37b2be7 100644 --- a/blocks/partners_list.php +++ b/blocks/partners_list.php @@ -19,7 +19,7 @@ function b_partners_list_show($options) $smartPartnerCategoryHandler = smartpartner_gethandler('category'); // Randomize - $partnersObj =& $smartPartnerPartnerHandler->getPartners(0, 0, _SPARTNER_STATUS_ACTIVE); + $partnersObj = $smartPartnerPartnerHandler->getPartners(0, 0, _SPARTNER_STATUS_ACTIVE); if (count($partnersObj) > 1) { $key_arr = array_keys($partnersObj); $key_rand = array_rand($key_arr, count($key_arr)); @@ -61,7 +61,7 @@ function b_partners_list_show($options) } else { $partner['title'] = ''; } - $smartConfig =& smartpartner_getModuleConfig(); + $smartConfig = smartpartner_getModuleConfig(); $image_info = smartpartner_imageResize($partnersObj[$i]->getImagePath(), $smartConfig['img_max_width'], $smartConfig['img_max_height']); $partner['img_attr'] = $image_info[3]; $partner['extendedInfo'] = $partnersObj[$i]->extentedInfo(); diff --git a/blocks/random_offer.php b/blocks/random_offer.php index 984a628..b8247dc 100644 --- a/blocks/random_offer.php +++ b/blocks/random_offer.php @@ -30,7 +30,7 @@ function b_random_offer_show($options) $criteria->add(new Criteria('status', _SPARTNER_STATUS_ONLINE)); // Randomize - $offersObj =& $smartPartnerOfferHandler->getObjects($criteria); + $offersObj = $smartPartnerOfferHandler->getObjects($criteria); if (count($offersObj) > 0) { $key_arr = array_keys($offersObj); $key_rand = array_rand($key_arr, 1); @@ -41,7 +41,7 @@ function b_random_offer_show($options) if (isset($offerObj) && is_object($offerObj)) { $block['offers'][] = $offerObj->toArray('e'); - $smartConfig =& smartpartner_getModuleConfig(); + $smartConfig = smartpartner_getModuleConfig(); //$image_info = smartpartner_imageResize($partnerObj->getImagePath(), $smartConfig['img_max_width'], $smartConfig['img_max_height']); if ($options[0] == 1) { diff --git a/blocks/random_partner.php b/blocks/random_partner.php index 0de8be1..dbd0a8a 100644 --- a/blocks/random_partner.php +++ b/blocks/random_partner.php @@ -36,7 +36,7 @@ function b_random_partner_show($options) } else { $partner['title'] = ''; } - $smartConfig =& smartpartner_getModuleConfig(); + $smartConfig = smartpartner_getModuleConfig(); $image_info = smartpartner_imageResize($partnerObj->getImagePath(), $smartConfig['img_max_width'], $smartConfig['img_max_height']); $partner['img_attr'] = $image_info[3]; $partner['extendedInfo'] = $partnerObj->extentedInfo(); diff --git a/blocks/recent_offers.php b/blocks/recent_offers.php index 2a2ca0d..5d67269 100644 --- a/blocks/recent_offers.php +++ b/blocks/recent_offers.php @@ -38,7 +38,7 @@ function b_recent_offers_show($options) foreach ($offersObj as $offerObj) { $block['offers'][] = $offerObj->toArray('e'); } - $smartConfig =& smartpartner_getModuleConfig(); + $smartConfig = smartpartner_getModuleConfig(); //$image_info = smartpartner_imageResize($partnerObj->getImagePath(), $smartConfig['img_max_width'], $smartConfig['img_max_height']); if ($options[0] == 1) { diff --git a/blocks/recent_partners.php b/blocks/recent_partners.php index ef096ec..560598c 100644 --- a/blocks/recent_partners.php +++ b/blocks/recent_partners.php @@ -19,7 +19,7 @@ function b_recent_partners_show($options) $smartPartnerCategoryHandler = smartpartner_gethandler('category'); // Randomize - $partnersObj =& $smartPartnerPartnerHandler->getPartners($options[2], 0, _SPARTNER_STATUS_ACTIVE, 'datesub', 'DESC'); + $partnersObj = $smartPartnerPartnerHandler->getPartners($options[2], 0, _SPARTNER_STATUS_ACTIVE, 'datesub', 'DESC'); include_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectpermission.php'; $smartPermissionsHandler = new SmartobjectPermissionHandler($smartPartnerPartnerHandler); diff --git a/blocks/scrolling_partner.php b/blocks/scrolling_partner.php index 8048e12..b9e4b19 100644 --- a/blocks/scrolling_partner.php +++ b/blocks/scrolling_partner.php @@ -19,7 +19,7 @@ function b_scrolling_partner_show($options) //$smartPartnerCategoryHandler = smartpartner_gethandler('category'); // Randomize - $partnersObj =& $smartPartnerPartnerHandler->getPartners(0, 0, _SPARTNER_STATUS_ACTIVE); + $partnersObj = $smartPartnerPartnerHandler->getPartners(0, 0, _SPARTNER_STATUS_ACTIVE); if (count($partnersObj) > 1) { $key_arr = array_keys($partnersObj); $key_rand = array_rand($key_arr, count($key_arr)); @@ -46,7 +46,7 @@ function b_scrolling_partner_show($options) $partner['urllink'] = $partnersObj[$i]->getUrlLink('block'); $partner['image'] = $partnersObj[$i]->getImageUrl(); $partner['title'] = $partnersObj[$i]->title(); - $smartConfig =& smartpartner_getModuleConfig(); + $smartConfig = smartpartner_getModuleConfig(); $image_info = smartpartner_imageResize($partnersObj[$i]->getImagePath(), $smartConfig['img_max_width'], $smartConfig['img_max_height']); $block['partners'][] = $partner; } diff --git a/class/baseObjectHandler.php b/class/baseObjectHandler.php index da2b53d..c5b4d5a 100644 --- a/class/baseObjectHandler.php +++ b/class/baseObjectHandler.php @@ -210,7 +210,7 @@ public function getCount($criteria = null) * @return bool deletion successful? * @access public */ - public function delete(&$obj, $force = false) + public function delete($obj, $force = false) { if (strcasecmp($this->classname, get_class($obj)) != 0) { return false; diff --git a/class/category.php b/class/category.php index 9accc02..b4a8953 100644 --- a/class/category.php +++ b/class/category.php @@ -151,7 +151,7 @@ public function getCategoryPath($withAllLink = true) $parentid = $this->parentid(); global $smartPartnerCategoryHandler; if ($parentid != 0) { - $parentObj =& $smartPartnerCategoryHandler->get($parentid); + $parentObj = $smartPartnerCategoryHandler->get($parentid); if ($parentObj->notLoaded()) { exit; } @@ -249,7 +249,7 @@ class SmartpartnerCategoryHandler extends smartpartner_PersistableObjectHandler * SmartpartnerCategoryHandler constructor. * @param object|XoopsDatabase $db */ - public function __construct($db) + public function __construct(XoopsDatabase $db) { parent::__construct($db, 'smartpartner_categories', 'SmartpartnerCategory', 'categoryid', 'name'); } @@ -280,7 +280,7 @@ public function delete(XoopsObject $category, $force = false) $smartPartnerPartnerHandler = smartpartner_gethandler('partner'); } $criteria = new Criteria('category', $category->categoryid()); - $partners =& $smartPartnerPartnerHandler->getObjects($criteria); + $partners = $smartPartnerPartnerHandler->getObjects($criteria); if ($partners) { foreach ($partners as $partner) { $smartPartnerPartnerHandler->delete($partner); diff --git a/class/file.php b/class/file.php index bc131c9..d465b79 100644 --- a/class/file.php +++ b/class/file.php @@ -104,24 +104,24 @@ public function purifyText($text) $text = str_replace(';', '', $text); $text = str_replace('!', ' ', $text); $text = str_replace('?', ' ', $text); - $text = str_replace('�', 'e', $text); - $text = str_replace('�', 'e', $text); - $text = str_replace('�', 'e', $text); - $text = str_replace('�', 'a', $text); - $text = str_replace('�', 'a', $text); - $text = str_replace('�', 'u', $text); - $text = str_replace('�', 'u', $text); - $text = str_replace('�', 'o', $text); - $text = str_replace('�', 'n', $text); - $text = str_replace('�', 'e', $text); - $text = str_replace('�', 'e', $text); - $text = str_replace('�', 'e', $text); - $text = str_replace('�', 'A', $text); - $text = str_replace('�', 'A', $text); - $text = str_replace('�', 'U', $text); - $text = str_replace('�', 'U', $text); - $text = str_replace('�', 'O', $text); - $text = str_replace('�', 'N', $text); + $text = str_replace('é', 'e', $text); + $text = str_replace('è', 'e', $text); + $text = str_replace('ê', 'e', $text); + $text = str_replace('â', 'a', $text); + $text = str_replace('à', 'a', $text); + $text = str_replace('ù', 'u', $text); + $text = str_replace('û', 'u', $text); + $text = str_replace('ô', 'o', $text); + $text = str_replace('ñ', 'n', $text); + $text = str_replace('É', 'e', $text); + $text = str_replace('È', 'e', $text); + $text = str_replace('Ê', 'e', $text); + $text = str_replace('Â', 'A', $text); + $text = str_replace('À', 'A', $text); + $text = str_replace('Ù', 'U', $text); + $text = str_replace('Û', 'U', $text); + $text = str_replace('Ô', 'O', $text); + $text = str_replace('Ñ', 'N', $text); $text = str_replace("'", '', $text); $text = str_replace("\\", '', $text); $text = strip_tags($text); @@ -143,7 +143,7 @@ public function storeUpload($post_field, $allowed_mimetypes = null, &$errors) global $xoopsUser, $xoopsDB, $xoopsModule; include_once(SMARTPARTNER_ROOT_PATH . 'class/uploader.php'); - $config =& smartpartner_getModuleConfig(); + $config = smartpartner_getModuleConfig(); $id = $this->getVar('id'); @@ -393,7 +393,7 @@ public function getNameFromFilename() { $ret = $this->filename(); $sep_pos = strpos($ret, '_'); - $ret = substr($ret, $sep_pos + 1, - $sep_pos); + $ret = substr($ret, $sep_pos + 1, -$sep_pos); return $ret; } @@ -476,12 +476,16 @@ public function insert(XoopsObject $fileObj, $force = false) } if ($fileObj->isNew()) { - $sql = sprintf('INSERT INTO %s (fileid, id, name, description, filename, mimetype, uid, datesub, `status`, notifypub, counter) VALUES (NULL, %u, %s, %s, %s, %s, %u, %u, %u, %u, %u)', $this->db->prefix('smartpartner_files'), $id, $this->db->quoteString($name), $this->db->quoteString($description), $this->db->quoteString($filename), $this->db->quoteString($mimetype), $uid, time(), $status, $notifypub, $counter); + $sql = sprintf('INSERT INTO %s (fileid, id, name, description, filename, mimetype, uid, datesub, `status`, notifypub, counter) VALUES (NULL, %u, %s, %s, %s, %s, %u, %u, %u, %u, %u)', + $this->db->prefix('smartpartner_files'), $id, $this->db->quoteString($name), $this->db->quoteString($description), $this->db->quoteString($filename), + $this->db->quoteString($mimetype), $uid, time(), $status, $notifypub, $counter); } else { - $sql = sprintf('UPDATE %s SET id = %u, name = %s, description = %s, filename = %s, mimetype = %s, uid = %u, datesub = %u, status = %u, notifypub = %u, counter = %u WHERE fileid = %u', $this->db->prefix('smartpartner_files'), $id, $this->db->quoteString($name), $this->db->quoteString($description), $this->db->quoteString($filename), $this->db->quoteString($mimetype), $uid, $datesub, $status, $notifypub, $counter, $fileid); + $sql = sprintf('UPDATE %s SET id = %u, name = %s, description = %s, filename = %s, mimetype = %s, uid = %u, datesub = %u, status = %u, notifypub = %u, counter = %u WHERE fileid = %u', + $this->db->prefix('smartpartner_files'), $id, $this->db->quoteString($name), $this->db->quoteString($description), $this->db->quoteString($filename), + $this->db->quoteString($mimetype), $uid, $datesub, $status, $notifypub, $counter, $fileid); } - //echo "
$sql
"; + //echo "
$sql
"; if (false != $force) { $result = $this->db->queryF($sql); @@ -577,7 +581,7 @@ public function getObjects($criteria = null, $id_as_key = false) $limit = $criteria->getLimit(); $start = $criteria->getStart(); } - //echo "
" . $sql . "
"; + //echo "
" . $sql . "
"; $result = $this->db->query($sql, $limit, $start); if (!$result) { return $ret; @@ -699,7 +703,7 @@ public function updateAll($fieldname, $fieldvalue, $criteria = null) if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { $sql .= ' ' . $criteria->renderWhere(); } - //echo "
" . $sql . "
"; + //echo "
" . $sql . "
"; if (!$result = $this->db->queryF($sql)) { return false; } diff --git a/class/keyhighlighter.class.php b/class/keyhighlighter.class.php index 9bf517a..a08f3d5 100644 --- a/class/keyhighlighter.class.php +++ b/class/keyhighlighter.class.php @@ -41,7 +41,7 @@ class SmartpartnerKeyhighlighter /** * Main constructor * - * This is the main constructor of keyhighlighter class.
+ * This is the main constructor of keyhighlighter class.
* It's the only public method of the class. * @param string $keywords the keywords you want to highlight * @param boolean $singlewords specify if it has to highlight also the single words. diff --git a/class/mimetype.php b/class/mimetype.php index 3c614f4..3fed365 100644 --- a/class/mimetype.php +++ b/class/mimetype.php @@ -121,7 +121,7 @@ public function &getObjects($criteria = null) $limit = $criteria->getLimit(); $start = $criteria->getStart(); } - //echo "
$sql
";exit; + //echo "
$sql
";exit; $result = $this->_db->query($sql, $limit, $start); // if no records from db, return empty array if (!$result) { @@ -241,7 +241,7 @@ public function _selectQuery($criteria = null, $join = false) * @param $obj * @return string */ - public function _insertQuery(&$obj) + public function _insertQuery($obj) { // Copy all object vars into local variables foreach ($obj->cleanVars as $k => $v) { @@ -249,7 +249,8 @@ public function _insertQuery(&$obj) } $sql = sprintf('INSERT INTO %s (mime_id, mime_ext, mime_types, mime_name, mime_admin, mime_user) VALUES - (%u, %s, %s, %s, %u, %u)', $this->_db->prefix($this->_dbtable), $mime_id, $this->_db->quoteString($mime_ext), $this->_db->quoteString($mime_types), $this->_db->quoteString($mime_name), $mime_admin, $mime_user); + (%u, %s, %s, %s, %u, %u)', $this->_db->prefix($this->_dbtable), $mime_id, $this->_db->quoteString($mime_ext), $this->_db->quoteString($mime_types), $this->_db->quoteString($mime_name), + $mime_admin, $mime_user); return $sql; } @@ -258,7 +259,7 @@ public function _insertQuery(&$obj) * @param $obj * @return string */ - public function _updateQuery(&$obj) + public function _updateQuery($obj) { // Copy all object vars into local variables foreach ($obj->cleanVars as $k => $v) { @@ -266,7 +267,8 @@ public function _updateQuery(&$obj) } $sql = sprintf('UPDATE %s SET mime_ext = %s, mime_types = %s, mime_name = %s, mime_admin = %u, mime_user = %u WHERE - mime_id = %u', $this->_db->prefix($this->_dbtable), $this->_db->quoteString($mime_ext), $this->_db->quoteString($mime_types), $this->_db->quoteString($mime_name), $mime_admin, $mime_user, $mime_id); + mime_id = %u', $this->_db->prefix($this->_dbtable), $this->_db->quoteString($mime_ext), $this->_db->quoteString($mime_types), $this->_db->quoteString($mime_name), $mime_admin, + $mime_user, $mime_id); return $sql; } @@ -275,10 +277,11 @@ public function _updateQuery(&$obj) * @param $obj * @return string */ - public function _deleteQuery(&$obj) + public function _deleteQuery($obj) { $sql = sprintf('DELETE FROM %s WHERE mime_id = %u', $this->_db->prefix($this->_dbtable), $obj->getVar('mime_id')); return $sql; } } // end class + diff --git a/class/object.php b/class/object.php index 25d01d4..642b983 100644 --- a/class/object.php +++ b/class/object.php @@ -97,7 +97,7 @@ public function &create($isNew = true) * @param bool $as_object whether to return an object or an array * @return mixed reference to the object, FALSE if failed */ - public function &get($id, $as_object = true) + public function get($id, $as_object = true) { if (is_array($this->keyName)) { $criteria = new CriteriaCompo(); diff --git a/class/offer.php b/class/offer.php index 42b2b52..854981b 100644 --- a/class/offer.php +++ b/class/offer.php @@ -84,7 +84,7 @@ public function __construct() public function getVar($key, $format = 's') { if ($format === 's' && in_array($key, array('partnerid', 'status'))) { -// return call_user_func(array($this, $key)); + // return call_user_func(array($this, $key)); return $this->{$key}(); } @@ -175,9 +175,9 @@ class SmartpartnerOfferHandler extends SmartPersistableObjectHandler { /** * SmartpartnerOfferHandler constructor. - * @param object|XoopsDatabase $db + * @param XoopsDatabase $db */ - public function __construct($db) + public function __construct(XoopsDatabase $db) { parent::__construct($db, 'offer', 'offerid', 'title', false, 'smartpartner'); } diff --git a/class/partner.php b/class/partner.php index 7102376..1351fc3 100644 --- a/class/partner.php +++ b/class/partner.php @@ -64,7 +64,7 @@ public function __construct($id = null) if (isset($id)) { $smartPartnerPartnerHandler = new SmartpartnerPartnerHandler($this->db); - $partner =& $smartPartnerPartnerHandler->get($id); + $partner = $smartPartnerPartnerHandler->get($id); foreach ($partner->vars as $k => $v) { $this->assignVar($k, $v['value']); } @@ -757,7 +757,7 @@ class SmartpartnerPartnerHandler extends SmartPersistableObjectHandler * @param object $db reference to a xoops_db object */ - public function __construct($db) + public function __construct(XoopsDatabase $db) { xoops_loadLanguage('common', 'smartpartner'); parent::__construct($db, 'partner', 'id', 'title', false, 'smartpartner'); @@ -776,7 +776,7 @@ public function getInstance(XoopsDatabase $db) { static $instance; if (!isset($instance)) { - $instance = new SmartpartnerCategoryHandler($db); + $instance = new static($db); } return $instance; @@ -786,7 +786,7 @@ public function getInstance(XoopsDatabase $db) * @param bool $isNew * @return SmartpartnerPartner */ - public function &create($isNew = true) + public function create($isNew = true) { $partner = new SmartpartnerPartner(); if ($isNew) { @@ -799,12 +799,12 @@ public function &create($isNew = true) /** * retrieve a Partner * - * @param int $id partnerid of the user - * @param bool $as_object - * @param bool $debug - * @param bool $criteria + * @param int $id partnerid of the user + * @param bool $as_object + * @param bool $debug + * @param bool $criteria * @return mixed reference to the SmartpartnerPartner object, FALSE if failed - * object, FALSE if failed + * object, FALSE if failed */ public function get($id, $as_object = true, $debug = false, $criteria = false) { @@ -820,7 +820,7 @@ public function get($id, $as_object = true, $debug = false, $criteria = false) $partner->assignVars($this->db->fetchArray($result)); global $smartpartnerPartnerCatLinkHandler; if (!$smartpartnerPartnerCatLinkHandler) { - $smartpartnerPartnerCatLinkHandler = smartpartner_gethandler('partnercatlink'); + $smartpartnerPartnerCatLinkHandler = smartpartner_gethandler('partner_cat_link'); } $partner->setVar('categoryid', $smartpartnerPartnerCatLinkHandler->getParentIds($partner->getVar('id'))); @@ -835,14 +835,14 @@ public function get($id, $as_object = true, $debug = false, $criteria = false) /** * insert a new Partner in the database * - * @param XoopsObject $obj - * @param bool $force - * @param bool $checkObject - * @param bool $debug - * @return bool FALSE if failed, TRUE if already present and unchanged or successful + * @param XoopsObject $partner + * @param bool $force + * @param bool $checkObject + * @param bool $debug + * @return bool FALSE if failed, TRUE if already present and unchanged or successful * @internal param XoopsObject $partner reference to the SmartpartnerPartner object object */ - public function insert(XoopsObject $obj, $force = false, $checkObject = true, $debug = false) + public function insert(XoopsObject $partner, $force = false, $checkObject = true, $debug = false) { if (strtolower(get_class($partner)) != strtolower($this->className)) { return false; @@ -861,12 +861,21 @@ public function insert(XoopsObject $obj, $force = false, $checkObject = true, $d } if ($partner->isNew()) { - $sql = sprintf("INSERT INTO %s (id, weight, hits, hits_page, url, image, image_url, title, datesub, summary, description, contact_name, contact_email, contact_phone, adress, `status`, `last_update`, `email_priv`, `phone_priv`, `adress_priv`, `showsummary`) VALUES ('', %u, %u, %u, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %u, %u, %u, %u, %u, %u)", $this->table, $weight, $hits, $hits_page, $this->db->quoteString($url), $this->db->quoteString($image), $this->db->quoteString($image_url), $this->db->quoteString($title), time(), $this->db->quoteString($summary), $this->db->quoteString($description), $this->db->quoteString($contact_name), $this->db->quoteString($contact_email), $this->db->quoteString($contact_phone), $this->db->quoteString($adress), $status, time(), $email_priv, $phone_priv, $adress_priv, $showsummary); + $sql = + sprintf("INSERT INTO %s (id, weight, hits, hits_page, url, image, image_url, title, datesub, summary, description, contact_name, contact_email, contact_phone, adress, `status`, `last_update`, `email_priv`, `phone_priv`, `adress_priv`, `showsummary`) VALUES (null, %u, %u, %u, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %u, %u, %u, %u, %u, %u)", + $this->table, $weight, $hits, $hits_page, $this->db->quoteString($url), $this->db->quoteString($image), $this->db->quoteString($image_url), $this->db->quoteString($title), + time(), $this->db->quoteString($summary), $this->db->quoteString($description), $this->db->quoteString($contact_name), $this->db->quoteString($contact_email), + $this->db->quoteString($contact_phone), $this->db->quoteString($adress), $status, time(), $email_priv, $phone_priv, $adress_priv, $showsummary); } else { - $sql = sprintf('UPDATE %s SET weight = %u, hits = %u, hits_page = %u, url = %s, image = %s, image_url = %s, title = %s, datesub = %s, summary = %s, description = %s, contact_name = %s, contact_email = %s, contact_phone = %s, adress = %s, `status` = %u, `last_update` = %u, `email_priv` = %u, `phone_priv` = %u, `adress_priv` = %u, `showsummary` = %u WHERE id = %u', $this->table, $weight, $hits, $hits_page, $this->db->quoteString($url), $this->db->quoteString($image), $this->db->quoteString($image_url), $this->db->quoteString($title), $this->db->quoteString($datesub), $this->db->quoteString($summary), $this->db->quoteString($description), $this->db->quoteString($contact_name), $this->db->quoteString($contact_email), $this->db->quoteString($contact_phone), $this->db->quoteString($adress), $status, time(), $email_priv, $phone_priv, $adress_priv, $showsummary, $id); + $sql = + sprintf('UPDATE %s SET weight = %u, hits = %u, hits_page = %u, url = %s, image = %s, image_url = %s, title = %s, datesub = %s, summary = %s, description = %s, contact_name = %s, contact_email = %s, contact_phone = %s, adress = %s, `status` = %u, `last_update` = %u, `email_priv` = %u, `phone_priv` = %u, `adress_priv` = %u, `showsummary` = %u WHERE id = %u', + $this->table, $weight, $hits, $hits_page, $this->db->quoteString($url), $this->db->quoteString($image), $this->db->quoteString($image_url), $this->db->quoteString($title), + $this->db->quoteString($datesub), $this->db->quoteString($summary), $this->db->quoteString($description), $this->db->quoteString($contact_name), + $this->db->quoteString($contact_email), $this->db->quoteString($contact_phone), $this->db->quoteString($adress), $status, time(), $email_priv, $phone_priv, $adress_priv, + $showsummary, $id); } - //echo "
" . $sql . "
";exit; + //echo "
" . $sql . "
";exit; if (false != $force) { $result = $this->db->queryF($sql); @@ -954,15 +963,15 @@ public function delete(XoopsObject $partner, $force = false) /** * retrieve Partners from the database * - * @param object $criteria {@link CriteriaElement} conditions to be met - * @param bool $id_as_key use the partnerid as key for the array? - * @param bool $as_object - * @param bool $sql - * @param bool $debug - * @return array array of SmartpartnerPartner objects - * objects + * @param CriteriaElement $criteria {@link CriteriaElement} conditions to be met + * @param bool $id_as_key use the partnerid as key for the array? + * @param bool $as_object + * @param bool $sql + * @param bool $debug + * @return array array of SmartpartnerPartner objects + * objects */ - public function getObjects($criteria = null, $id_as_key = false, $as_object = true, $sql = false, $debug = false)//&getObjects($criteria = null, $id_as_key = false) + public function getObjects(CriteriaElement $criteria = null, $id_as_key = false, $as_object = true, $sql = false, $debug = false)//&getObjects($criteria = null, $id_as_key = false) { $ret = array(); $limit = $start = 0; @@ -981,7 +990,7 @@ public function getObjects($criteria = null, $id_as_key = false, $as_object = tr } } - //echo "
" . $sql . "
";exit; + //echo "
" . $sql . "
";exit; $result = $this->db->query($sql, $limit, $start); if (!$result) { return $ret; @@ -992,7 +1001,7 @@ public function getObjects($criteria = null, $id_as_key = false, $as_object = tr } global $smartpartnerPartnerCatLinkHandler; if (!isset($smartpartnerPartnerCatLinkHandler)) { - $smartpartnerPartnerCatLinkHandler = smartpartner_gethandler('partnercatlink'); + $smartpartnerPartnerCatLinkHandler = smartpartner_gethandler('partner_cat_link'); } while ($myrow = $this->db->fetchArray($result)) { $partner = new SmartpartnerPartner(); @@ -1013,10 +1022,10 @@ public function getObjects($criteria = null, $id_as_key = false, $as_object = tr /** * count Partners matching a condition * - * @param object $criteria {@link CriteriaElement} to match + * @param CriteriaElement $criteria {@link CriteriaElement} to match * @return int count of partners */ - public function getCount($criteria = null) + public function getCount(CriteriaElement $criteria = null) { $sql = 'SELECT COUNT(*) FROM ' . $this->table; if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { @@ -1026,7 +1035,7 @@ public function getCount($criteria = null) } } - //echo "
" . $sql . "
"; + //echo "
" . $sql . "
"; $result = $this->db->query($sql); if (!$result) { return 0; @@ -1110,7 +1119,7 @@ public function &getObjectsForSearch($queryarray = array(), $andor = 'AND', $lim } } - //echo "
$sql
"; + //echo "
$sql
"; $result = $this->db->query($sql, $limit, $offset); // If no records from db, return empty array @@ -1203,7 +1212,7 @@ public function getRandomPartner($status = null) if ($totalPartners > 0) { --$totalPartners; mt_srand((double)microtime() * 1000000); - $entrynumber = random_int(0, $totalPartners); + $entrynumber = mt_rand(0, $totalPartners); $partner = $this->getPartners(1, $entrynumber, $status); if ($partner) { $ret =& $partner[0]; @@ -1216,10 +1225,10 @@ public function getRandomPartner($status = null) /** * delete Partners matching a set of conditions * - * @param object $criteria {@link CriteriaElement} + * @param CriteriaElement $criteria {@link CriteriaElement} * @return bool FALSE if deletion failed */ - public function deleteAll($criteria = null) + public function deleteAll(CriteriaElement $criteria = null) { $sql = 'DELETE FROM ' . $this->db->prefix('smartpartner_partner'); if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { @@ -1235,14 +1244,14 @@ public function deleteAll($criteria = null) /** * Change a value for a Partner with a certain criteria * - * @param string $fieldname Name of the field - * @param string $fieldvalue Value to write - * @param object $criteria {@link CriteriaElement} + * @param string $fieldname Name of the field + * @param string $fieldvalue Value to write + * @param CriteriaElement $criteria {@link CriteriaElement} * - * @param bool $force + * @param bool $force * @return bool */ - public function updateAll($fieldname, $fieldvalue, $criteria = null, $force = false) + public function updateAll($fieldname, $fieldvalue, CriteriaElement $criteria = null, $force = false) { $set_clause = is_numeric($fieldvalue) ? $fieldname . ' = ' . $fieldvalue : $fieldname . ' = ' . $this->db->quoteString($fieldvalue); $sql = 'UPDATE ' . $this->db->prefix('smartpartner_partner') . ' SET ' . $set_clause; @@ -1267,7 +1276,7 @@ public function getRandomPartners($limit = 0, $status = _SPARTNER_STATUS_ACTIVE) $sql = 'SELECT id FROM ' . $this->db->prefix('smartpartner_partner') . ' '; $sql .= 'WHERE status=' . $status; - //echo "
" . $sql . "
"; + //echo "
" . $sql . "
"; $result = $this->db->query($sql); @@ -1393,7 +1402,7 @@ public function getRandomPartners($limit = 0, $status = _SPARTNER_STATUS_ACTIVE) } } - //echo "
" . $sql . "
"; + //echo "
" . $sql . "
"; $result = $this->db->query($sql, $limit, $start); if (!$result) { diff --git a/class/partner_cat_link.php b/class/partner_cat_link.php new file mode 100644 index 0000000..a439b95 --- /dev/null +++ b/class/partner_cat_link.php @@ -0,0 +1,80 @@ + // +// ------------------------------------------------------------------------ // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation; either version 2 of the License, or // +// (at your option) any later version. // + +// You may not change or alter any portion of this comment or credits // +// of supporting developers from this source code or any supporting // +// source code which is considered copyrighted (c) material of the // +// original comment or credit authors. // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License for more details. // + +// You should have received a copy of the GNU General Public License // +// along with this program; if not, write to the Free Software // +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // +// ------------------------------------------------------------------------ // +// URL: http://xoops.org/ // +// Project: XOOPS Project // +// -------------------------------------------------------------------------// + +// defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); +include_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobject.php'; +include_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjecthandler.php'; + +/** + * Class SmartpartnerPartnerCatLink + */ +class SmartpartnerPartner_cat_link extends SmartObject +{ + /** + * SmartpartnerPartnerCatLink constructor. + */ + public function __construct() + { + $this->initVar('partner_cat_linkid', XOBJ_DTYPE_INT, '', true); + $this->initVar('partnerid', XOBJ_DTYPE_INT, '', true); + $this->initVar('categoryid', XOBJ_DTYPE_INT, '', true); + } +} + +/** + * Class SmartpartnerPartnerCatLinkHandler + */ +class SmartpartnerPartner_cat_linkHandler extends SmartPersistableObjectHandler +{ + /** + * SmartpartnerPartnerCatLinkHandler constructor. + * @param object|XoopsDatabase $db + */ + public function __construct(XoopsDatabase $db) + { + parent::__construct($db, 'partner_cat_link', array('partnerid', 'categoryid'), '', false, 'smartpartner'); + } + + /** + * @param $partnerid + * @return string + */ + public function getParentIds($partnerid) + { + $criteria = new CriteriaCompo(); + $criteria->add(new Criteria('partnerid', $partnerid)); + $links = $this->getObjects($criteria); + $parent_array = array(); + foreach ($links as $link) { + $parent_array[] = $link->getVar('categoryid'); + } + + return implode('|', $parent_array); + } +} diff --git a/class/partnercatlink.php b/class/partnercatlink.php index c7386fa..a439b95 100644 --- a/class/partnercatlink.php +++ b/class/partnercatlink.php @@ -34,7 +34,7 @@ /** * Class SmartpartnerPartnerCatLink */ -class SmartpartnerPartnerCatLink extends SmartObject +class SmartpartnerPartner_cat_link extends SmartObject { /** * SmartpartnerPartnerCatLink constructor. @@ -50,13 +50,13 @@ public function __construct() /** * Class SmartpartnerPartnerCatLinkHandler */ -class SmartpartnerPartnerCatLinkHandler extends SmartPersistableObjectHandler +class SmartpartnerPartner_cat_linkHandler extends SmartPersistableObjectHandler { /** * SmartpartnerPartnerCatLinkHandler constructor. * @param object|XoopsDatabase $db */ - public function __construct($db) + public function __construct(XoopsDatabase $db) { parent::__construct($db, 'partner_cat_link', array('partnerid', 'categoryid'), '', false, 'smartpartner'); } diff --git a/class/session.php b/class/session.php index 894bbd5..ce5b367 100644 --- a/class/session.php +++ b/class/session.php @@ -8,7 +8,7 @@ class SmartpartnerSession { /** - * Session constructor
+ * Session constructor
* Starts the session with session_start() * Note: that if the session has already started, * session_start() does nothing @@ -71,14 +71,13 @@ public function destroy() /** * @return SmartpartnerSession */ - public static function singleton() + public static function getInstance() { - static $_sess; - - if (!isset($_sess)) { - $_sess = new SmartpartnerSession(); + static $instance; + if (!isset($instance)) { + $instance = new static(); } - return $_sess; + return $instance; } } diff --git a/class/smartdbupdater.php b/class/smartdbupdater.php index 690c1a1..b4ed9f5 100644 --- a/class/smartdbupdater.php +++ b/class/smartdbupdater.php @@ -235,9 +235,9 @@ public function addData() $query = sprintf('INSERT INTO %s VALUES (%s)', $this->name(), $data); $ret = $xoopsDB->query($query); if (!$ret) { - echo '  ' . sprintf(_SDU_MSG_ADD_DATA_ERR, $this->name()) . '
'; + echo '  ' . sprintf(_SDU_MSG_ADD_DATA_ERR, $this->name()) . '
'; } else { - echo '  ' . sprintf(_SDU_MSG_ADD_DATA, $this->name()) . '
'; + echo '  ' . sprintf(_SDU_MSG_ADD_DATA, $this->name()) . '
'; } } @@ -393,9 +393,9 @@ public function createTable() $ret = $xoopsDB->query($query); if (!$ret) { - echo '  ' . sprintf(_SDU_MSG_CREATE_TABLE_ERR, $this->name()) . '
'; + echo '  ' . sprintf(_SDU_MSG_CREATE_TABLE_ERR, $this->name()) . '
'; } else { - echo '  ' . sprintf(_SDU_MSG_CREATE_TABLE, $this->name()) . '
'; + echo '  ' . sprintf(_SDU_MSG_CREATE_TABLE, $this->name()) . '
'; } return $ret; @@ -414,11 +414,11 @@ public function dropTable() $query = sprintf('DROP TABLE %s', $this->name()); $ret = $xoopsDB->query($query); if (!$ret) { - echo '  ' . sprintf(_SDU_MSG_DROP_TABLE_ERR, $this->name()) . '
'; + echo '  ' . sprintf(_SDU_MSG_DROP_TABLE_ERR, $this->name()) . '
'; return false; } else { - echo '  ' . sprintf(_SDU_MSG_DROP_TABLE, $this->name()) . '
'; + echo '  ' . sprintf(_SDU_MSG_DROP_TABLE, $this->name()) . '
'; return true; } @@ -442,9 +442,9 @@ public function alterTable() $ret = $ret && $xoopsDB->query($query); if ($alteredField['showerror']) { if (!$ret) { - echo '  ' . sprintf(_SDU_MSG_CHGFIELD_ERR, $alteredField['name'], $this->name()) . '
'; + echo '  ' . sprintf(_SDU_MSG_CHGFIELD_ERR, $alteredField['name'], $this->name()) . '
'; } else { - echo '  ' . sprintf(_SDU_MSG_CHGFIELD, $alteredField['name'], $this->name()) . '
'; + echo '  ' . sprintf(_SDU_MSG_CHGFIELD, $alteredField['name'], $this->name()) . '
'; } } } @@ -468,9 +468,9 @@ public function addNewFields() //echo $query; $ret = $ret && $xoopsDB->query($query); if (!$ret) { - echo '  ' . sprintf(_SDU_MSG_NEWFIELD_ERR, $newField['name'], $this->name()) . '
'; + echo '  ' . sprintf(_SDU_MSG_NEWFIELD_ERR, $newField['name'], $this->name()) . '
'; } else { - echo '  ' . sprintf(_SDU_MSG_NEWFIELD, $newField['name'], $this->name()) . '
'; + echo '  ' . sprintf(_SDU_MSG_NEWFIELD, $newField['name'], $this->name()) . '
'; } } @@ -493,9 +493,9 @@ public function updateFieldsValues() $query = sprintf('UPDATE %s SET %s = %s', $this->name(), $updatedField['name'], $updatedField['value']); $ret = $ret && $xoopsDB->query($query); if (!$ret) { - echo '  ' . sprintf(_SDU_MSG_UPDATE_TABLE_ERR, $this->name()) . '
'; + echo '  ' . sprintf(_SDU_MSG_UPDATE_TABLE_ERR, $this->name()) . '
'; } else { - echo '  ' . sprintf(_SDU_MSG_UPDATE_TABLE, $this->name()) . '
'; + echo '  ' . sprintf(_SDU_MSG_UPDATE_TABLE, $this->name()) . '
'; } } @@ -519,9 +519,9 @@ public function updateWhereValues() //echo $query."
"; $ret = $ret && $xoopsDB->query($query); if (!$ret) { - echo '  ' . sprintf(_SDU_MSG_UPDATE_TABLE_ERR, $this->name()) . '
'; + echo '  ' . sprintf(_SDU_MSG_UPDATE_TABLE_ERR, $this->name()) . '
'; } else { - echo '  ' . sprintf(_SDU_MSG_UPDATE_TABLE, $this->name()) . '
'; + echo '  ' . sprintf(_SDU_MSG_UPDATE_TABLE, $this->name()) . '
'; } } @@ -545,9 +545,9 @@ public function dropFields() $ret = $ret && $xoopsDB->query($query); if (!$ret) { - echo '  ' . sprintf(_SDU_MSG_DROPFIELD_ERR, $droppedField, $this->name()) . '
'; + echo '  ' . sprintf(_SDU_MSG_DROPFIELD_ERR, $droppedField, $this->name()) . '
'; } else { - echo '  ' . sprintf(_SDU_MSG_DROPFIELD, $droppedField, $this->name()) . '
'; + echo '  ' . sprintf(_SDU_MSG_DROPFIELD, $droppedField, $this->name()) . '
'; } } @@ -588,11 +588,11 @@ public function runQuery($query, $goodmsg, $badmsg) global $xoopsDB; $ret = $xoopsDB->query($query); if (!$ret) { - echo "  $badmsg
"; + echo "  $badmsg
"; return false; } else { - echo "  $goodmsg
"; + echo "  $goodmsg
"; return true; } @@ -616,11 +616,11 @@ public function renameTable($from, $to) $query = sprintf('ALTER TABLE %s RENAME %s', $from, $to); $ret = $xoopsDB->query($query); if (!$ret) { - echo '  ' . sprintf(_SDU_MSG_RENAME_TABLE_ERR, $from) . '
'; + echo '  ' . sprintf(_SDU_MSG_RENAME_TABLE_ERR, $from) . '
'; return false; } else { - echo '  ' . sprintf(_SDU_MSG_RENAME_TABLE, $from, $to) . '
'; + echo '  ' . sprintf(_SDU_MSG_RENAME_TABLE, $from, $to) . '
'; return true; } diff --git a/class/uploader.php b/class/uploader.php index 2b412c4..6bb077c 100644 --- a/class/uploader.php +++ b/class/uploader.php @@ -43,7 +43,7 @@ * echo $uploader->getErrors(); * } else { * echo '

File uploaded successfully!

' - * echo 'Saved as: ' . $uploader->getSavedFileName() . '
'; + * echo 'Saved as: ' . $uploader->getSavedFileName() . '
'; * echo 'Full path: ' . $uploader->getSavedDestination(); * } * } else { @@ -67,7 +67,7 @@ * echo $uploader->getErrors(); * } else { * echo '

File uploaded successfully!

' - * echo 'Saved as: ' . $uploader->getSavedFileName() . '
'; + * echo 'Saved as: ' . $uploader->getSavedFileName() . '
'; * echo 'Full path: ' . $uploader->getSavedDestination(); * } * } else { @@ -347,7 +347,7 @@ public function upload($chmod = 0644) $this->setErrors('Failed opening directory: ' . $this->uploadDir); } - if (!s_writable($this->uploadDir)) { + if (!is_writable($this->uploadDir)) { $this->setErrors('Failed opening directory with write permission: ' . $this->uploadDir); } @@ -401,7 +401,7 @@ public function _copyFile($chmod) $this->savedFileName = preg_replace('!\s+!', '_', $this->savedFileName); $this->savedDestination = $this->uploadDir . $this->savedFileName; if (is_file($this->savedDestination) && !!is_dir($this->savedDestination)) { - $this->setErrors('File ' . $this->mediaName . ' already exists on the server. Please rename this file and try again.
'); + $this->setErrors('File ' . $this->mediaName . ' already exists on the server. Please rename this file and try again.
'); return false; } @@ -507,7 +507,7 @@ public function &getErrors($ashtml = true) if (count($this->errors) > 0) { $ret = '

Errors Returned While Uploading

'; foreach ($this->errors as $error) { - $ret .= $error . '
'; + $ret .= $error . '
'; } } diff --git a/docs/changelog.txt b/docs/changelog.txt index 86f1e55..670e967 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -1,7 +1,8 @@ -
2.01 RC-1 (2016-03-30)
+
2.01 RC-1 (NOT RELEASED)
- moved all images, CSS, and JS files to /assets (mamba) - renamed .html Smarty templates to .tpl (mamba) - XOOPS 2.5.8, PHP 7 (mamba) +- bug fixes (mamba)
2.01 Beta 1 (2012-07-23)
- Converted to XOOPS 2.5.5 Admin GUI (Mamba) diff --git a/include/blocksadmin.inc.php b/include/blocksadmin.inc.php index 61276c5..49f4bba 100644 --- a/include/blocksadmin.inc.php +++ b/include/blocksadmin.inc.php @@ -144,9 +144,9 @@ $block['ctype'] = isset($bctype) ? $bctype : $myblock->getVar('c_type'); $block['is_custom'] = true; $block['cachetime'] = (int)$bcachetime; - echo '' . _AM_BADMIN . ' »» ' . $block['form_title'] . '

'; + echo '' . _AM_BADMIN . ' »» ' . $block['form_title'] . '

'; include __DIR__ . '/../admin/myblockform.php'; //GIJ - //echo ''. _AM_BADMIN .' »» '.$block['form_title'].'

'; + //echo ''. _AM_BADMIN .' »» '.$block['form_title'].'

'; //include XOOPS_ROOT_PATH.'/modules/system/admin/blocksadmin/blockform.php'; $xoopsGTicket->addTicketXoopsFormElement($form, __LINE__, 1800, 'myblocksadmin'); //GIJ $form->display(); @@ -361,7 +361,8 @@ $message = _AM_MODULECANT; redirect_header('admin.php?fct=blocksadmin', 4, $message); } else { - xoops_confirm(array('fct' => 'blocksadmin', 'op' => 'delete_ok', 'bid' => $myblock->getVar('bid')) + $xoopsGTicket->getTicketArray(__LINE__, 1800, 'myblocksadmin'), 'admin.php', sprintf(_AM_RUSUREDEL, $myblock->getVar('title'))); + xoops_confirm(array('fct' => 'blocksadmin', 'op' => 'delete_ok', 'bid' => $myblock->getVar('bid')) + $xoopsGTicket->getTicketArray(__LINE__, 1800, 'myblocksadmin'), 'admin.php', + sprintf(_AM_RUSUREDEL, $myblock->getVar('title'))); } // end of delete_block() GIJ xoops_cp_footer(); @@ -401,7 +402,7 @@ 'submit_button' => _SUBMIT ); - echo '' . _AM_BADMIN . ' »» ' . _AM_EDITBLOCK . '

'; + echo '' . _AM_BADMIN . ' »» ' . _AM_EDITBLOCK . '

'; include __DIR__ . '/../admin/myblockform.php'; //GIJ $xoopsGTicket->addTicketXoopsFormElement($form, __LINE__, 1800, 'myblocksadmin'); //GIJ $form->display(); @@ -441,7 +442,7 @@ 'options' => $myblock->getVar('options'), 'submit_button' => _CLONE ); - echo '' . _AM_BADMIN . ' »» ' . _AM_CLONEBLOCK . '

'; + echo '' . _AM_BADMIN . ' »» ' . _AM_CLONEBLOCK . '

'; include __DIR__ . '/../admin/myblockform.php'; $xoopsGTicket->addTicketXoopsFormElement($form, __LINE__, 1800, 'myblocksadmin'); //GIJ $form->display(); @@ -683,7 +684,15 @@ function myblocksadmin_update_blockinstance($id, $bside, $bweight, $bvisible, $b $page = explode('-', $mid); $mid = $page[0]; $pageid = $page[1]; - $GLOBALS['xoopsDB']->query('INSERT INTO ' . $GLOBALS['xoopsDB']->prefix('block_module_link') . ' VALUES (' . $instance->getVar('instanceid') . ', ' . (int)$mid . ', ' . (int)$pageid . ')'); + $GLOBALS['xoopsDB']->query('INSERT INTO ' + . $GLOBALS['xoopsDB']->prefix('block_module_link') + . ' VALUES (' + . $instance->getVar('instanceid') + . ', ' + . (int)$mid + . ', ' + . (int)$pageid + . ')'); } return _MD_AM_DBUPDATED; @@ -731,3 +740,4 @@ function myblocksadmin_update_blockinstance($id, $bside, $bweight, $bvisible, $b } // TODO edit2, delete2, customblocks + diff --git a/include/common.php b/include/common.php index 0724571..41133de 100644 --- a/include/common.php +++ b/include/common.php @@ -49,7 +49,7 @@ $smartPartnerCategoryHandler = smartpartner_gethandler('category'); // Creating the category link handler object -$smartpartnerPartnerCatLinkHandler = smartpartner_gethandler('partnercatlink'); +$smartpartnerPartnerCatLinkHandler = smartpartner_gethandler('partner_cat_link'); // Creating the offer handler object $smartPartnerOfferHandler = smartpartner_gethandler('offer'); diff --git a/include/displayitems.php b/include/displayitems.php index c3b7af2..9299a80 100644 --- a/include/displayitems.php +++ b/include/displayitems.php @@ -40,8 +40,26 @@ global $pathIcon16; for ($i = 0; $i < $totalitemsOnPage; ++$i) { $categoryObj =& $allcats[$itemsObj[$i]->categoryid()]; - $modify = "" . _AM_SPARTNER_EDITITEM . ""; - $delete = "" . _AM_SPARTNER_DELETEITEM . ""; + $modify = ""
+                       . _AM_SPARTNER_EDITITEM
+                       . ""; + $delete = ""
+                       . _AM_SPARTNER_DELETEITEM
+                       . ""; echo ''; echo "" . $itemsObj[$i]->itemid() . ''; @@ -59,7 +77,7 @@ echo ''; } echo "\n"; -echo "
\n"; +echo "
\n"; $pagenav_extra_args = "op=mod&categoryid=$sel_cat&parentid=$parentid"; $pagenav = new XoopsPageNav($totalitems, $xoopsModuleConfig['perpage'], $startitem, 'startitem', $pagenav_extra_args); echo '
' . $pagenav->renderNav() . '
'; diff --git a/include/displaysubcats.php b/include/displaysubcats.php index 80d0d2a..4ff0128 100644 --- a/include/displaysubcats.php +++ b/include/displaysubcats.php @@ -35,11 +35,39 @@ if ($totalsubs > 0) { global $pathIcon16; foreach ($subcatsObj as $subcat) { - $modify = "" . _AM_SPARTNER_MODIFY . ""; - $delete = "" . _AM_SPARTNER_DELETE . ""; + $modify = ""
+                  . _AM_SPARTNER_MODIFY
+                  . ""; + $delete = ""
+                  . _AM_SPARTNER_DELETE
+                  . ""; echo ''; echo "" . $subcat->categoryid() . ''; - echo "dirname() . '/category.php?categoryid=' . $subcat->categoryid() . '&parentid=' . $subcat->parentid() . "'>" . $subcat->name() . ''; + echo "dirname() + . '/category.php?categoryid=' + . $subcat->categoryid() + . '&parentid=' + . $subcat->parentid() + . "'>" + . $subcat->name() + . ''; echo "" . $subcat->description() . ''; echo " $modify $delete "; echo ''; @@ -50,5 +78,5 @@ echo ''; } echo "\n"; -echo "
\n"; +echo "
\n"; smartpartner_close_collapsable('subcatstable', 'subcatsicon'); diff --git a/include/functions.php b/include/functions.php index 4cb2817..e7af0f5 100644 --- a/include/functions.php +++ b/include/functions.php @@ -103,7 +103,7 @@ function smartpartner_SetMeta($key, $value) function smartpartner_highlighter($matches) { //$color=getmoduleoption('highlightcolor'); - $smartConfig =& smartpartner_getModuleConfig(); + $smartConfig = smartpartner_getModuleConfig(); $color = $smartConfig['highlight_color']; if (0 !== strpos($color, '#')) { $color = '#' . $color; @@ -126,7 +126,7 @@ function smartpartner_getAllowedImagesTypes() * @author Aidan Lister * @param string $source The source * @param string $dest The destination - * @return bool Returns true on success, false on failure + * @return bool Returns true on success, false on failure * @throws */ function smartpartner_copyr($source, $dest) @@ -138,7 +138,7 @@ function smartpartner_copyr($source, $dest) // Make destination directory if (!is_dir($dest)) { -// mkdir($dest); + // mkdir($dest); if (!@mkdir($dest) && !is_dir($dest)) { throw Exception("Couldn't create this directory: " . $dest); } @@ -171,7 +171,7 @@ function smartpartner_copyr($source, $dest) */ function smartpartner_getHelpPath() { - $smartConfig =& smartpartner_getModuleConfig(); + $smartConfig = smartpartner_getModuleConfig(); switch ($smartConfig['helppath_select']) { case 'docs.xoops.org': return 'http://docs.xoops.org/help/spartnerh/index.htm'; @@ -279,7 +279,7 @@ function smartpartner_gethandler($name, $optional = false) } } if (!isset($handlers[$name]) && !$optional) { - trigger_error('Class ' . $class . ' does not exist
Handler Name: ' . $name . ' | Module path: ' . SMARTPARTNER_ROOT_PATH, E_USER_ERROR); + trigger_error('Class ' . $class . ' does not exist
Handler Name: ' . $name . ' | Module path: ' . SMARTPARTNER_ROOT_PATH, E_USER_ERROR); } $ret = isset($handlers[$name]) ? $handlers[$name] : false; @@ -441,12 +441,20 @@ function smartpartner_modFooter() $versioninfo = &$hModule->get($smartModule->getVar('mid')); $modfootertxt = 'Module ' . $versioninfo->getInfo('name') . ' - Version ' . $versioninfo->getInfo('version') . ''; if (!defined('_AM_SPARTNER_XOOPS_PRO')) { - define('_AM_SPARTNER_XOOPS_PRO', 'Do you need help with this module ?
Do you need new features not yet availale?'); - } - - echo "
" . $modfootertxt . "
"; + define('_AM_SPARTNER_XOOPS_PRO', 'Do you need help with this module ?
Do you need new features not yet availale?'); + } + + echo "
"
+         . $modfootertxt
+         . "
"; echo '
'; - echo '
' . _AM_SPARTNER_XOOPS_PRO . '
Need XOOPS Professional Services? + echo '
' . _AM_SPARTNER_XOOPS_PRO . '
Need XOOPS Professional Services? Need XOOPS Professional Services?
'; echo '
'; @@ -572,7 +580,7 @@ function smartpartner_formatErrors($errors = array()) { $ret = ''; foreach ($errors as $key => $value) { - $ret .= '
- ' . $value; + $ret .= '
- ' . $value; } return $ret; @@ -592,7 +600,7 @@ function smartpartner_upload_file($another = false, $withRedirect = true, $itemO $id = isset($_POST['id']) ? (int)$_POST['id'] : 0; $uid = is_object($xoopsUser) ? $xoopsUser->uid() : 0; - $session = SmartpartnerSession::singleton(); + $session = SmartpartnerSession::getInstance(); $session->set('smartpartner_file_filename', isset($_POST['name']) ? $_POST['name'] : ''); $session->set('smartpartner_file_description', isset($_POST['description']) ? $_POST['description'] : ''); $session->set('smartpartner_file_status', $_POST['file_status']); @@ -625,7 +633,7 @@ function smartpartner_upload_file($another = false, $withRedirect = true, $itemO */ if (is_uploaded_file($_FILES['userfile']['tmp_name'])) { if (!$ret = $fileObj->checkUpload('userfile', $allowed_mimetypes, $errors)) { - $errorstxt = implode('
', $errors); + $errorstxt = implode('
', $errors); $message = sprintf(_SMARTPARTNER_MESSAGE_FILE_ERROR, $errorstxt); if ($withRedirect) { diff --git a/include/gtickets.php b/include/gtickets.php index aa755c2..e382964 100644 --- a/include/gtickets.php +++ b/include/gtickets.php @@ -242,7 +242,7 @@ public function getErrors($ashtml = true) if ($ashtml) { $ret = ''; foreach ($this->_errors as $msg) { - $ret .= "$msg
\n"; + $ret .= "$msg
\n"; } } else { $ret = $this->_errors; diff --git a/include/mimetypes.inc.php b/include/mimetypes.inc.php index 66eb417..b9ceb16 100644 --- a/include/mimetypes.inc.php +++ b/include/mimetypes.inc.php @@ -7,7 +7,7 @@ * * This file is provided as an helper for objects who need to perform filename to mimetype translations. * Common types have been provided, but feel free to add your own one if you need it. - *

+ *

* See the enclosed file LICENSE for licensing information. * If you did not receive this file, get it at http://www.fsf.org/copyleft/gpl.html * diff --git a/include/onupdate.inc.php b/include/onupdate.inc.php index 2bb40cc..e105ae4 100644 --- a/include/onupdate.inc.php +++ b/include/onupdate.inc.php @@ -3,7 +3,7 @@ // defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); global $modversion; -if (!empty($_POST['fct']) && !empty($_POST['op']) && $_POST['fct'] === 'modulesadmin' && $_POST['op'] === 'update_ok' && $_POST['dirname'] === $modversion['dirname']) { +if (!empty($_POST['fct']) && !empty($_POST['op']) && $_POST['fct'] === 'modulesadmin' && $_POST['op'] === 'update_ok' && $_POST['dirname'] == $modversion['dirname']) { // referer check $ref = xoops_getenv('HTTP_REFERER'); if ($ref == '' || strpos($ref, XOOPS_URL . '/modules/system/admin.php') === 0) { @@ -33,14 +33,14 @@ function xoops_module_update_smartpartner($module) $dbupdater = new SmartobjectDbupdater(); - echo '' . _SDU_UPDATE_UPDATING_DATABASE . '
'; + echo '' . _SDU_UPDATE_UPDATING_DATABASE . '
'; //smartpartner_create_upload_folders(); // db migrate version = 3 $newDbVersion = 3; if ($dbVersion < $newDbVersion) { - echo 'Database migrate to version ' . $newDbVersion . '
'; + echo 'Database migrate to version ' . $newDbVersion . '
'; $table = new SmartDbTable('smartpartner_partner'); $table->addNewField('email_priv', " tinyint(1) NOT NULL default '0'"); @@ -57,7 +57,7 @@ function xoops_module_update_smartpartner($module) // db migrate version =4 $newDbVersion = 4; if ($dbVersion < $newDbVersion) { - echo 'Database migrate to version ' . $newDbVersion . '
'; + echo 'Database migrate to version ' . $newDbVersion . '
'; //create new tables // Create table smartpartner_categories $table = new SmartDbTable('smartpartner_categories'); @@ -148,9 +148,9 @@ function xoops_module_update_smartpartner($module) } } //loop in partners to insert cat_links in partner_cat_link table - $smartpartnerPartnerHandler = xoops_getModuleHandler('partner', 'smartpartner'); -// $smartpartnerPartnerCatLinkHandler = xoops_getModuleHandler('partner_cat_link', 'smartpartner'); - $smartpartnerPartnerCatLinkHandler = xoops_getModuleHandler('partnerCatLink', 'smartpartner'); + $smartpartnerPartnerHandler = xoops_getModuleHandler('partner', 'smartpartner'); + // $smartpartnerPartnerCatLinkHandler = xoops_getModuleHandler('partner_cat_link', 'smartpartner'); + $smartpartnerPartnerCatLinkHandler = xoops_getModuleHandler('partner_cat_link', 'smartpartner'); $modulepermHandler = xoops_getHandler('groupperm'); $moduleHandler = xoops_getHandler('module'); diff --git a/include/updateblock.inc.php b/include/updateblock.inc.php index de970d4..1385e45 100644 --- a/include/updateblock.inc.php +++ b/include/updateblock.inc.php @@ -64,7 +64,17 @@ } for ($i = 1; $i <= $count; ++$i) { - $sql = 'SELECT name,options FROM ' . $xoopsDB->prefix('newblocks') . ' WHERE mid=' . $mid . ' AND func_num=' . $i . " AND show_func='" . addslashes($modversion['blocks'][$i]['show_func']) . "' AND func_file='" . addslashes($modversion['blocks'][$i]['file']) . "'"; + $sql = 'SELECT name,options FROM ' + . $xoopsDB->prefix('newblocks') + . ' WHERE mid=' + . $mid + . ' AND func_num=' + . $i + . " AND show_func='" + . addslashes($modversion['blocks'][$i]['show_func']) + . "' AND func_file='" + . addslashes($modversion['blocks'][$i]['file']) + . "'"; $fresult = $xoopsDB->query($sql); $fblock = $xoopsDB->fetchArray($fresult); if (isset($fblock['options'])) { @@ -78,9 +88,14 @@ $def_vals[$j] = $old_vals[$j]; } $modversion['blocks'][$i]['options'] = implode('|', $def_vals); - $local_msgs[] = "Option's values of the block " . $fblock['name'] . ' will be kept and new option(s) are added. (value = ' . $modversion['blocks'][$i]['options'] . ')'; + $local_msgs[] = + "Option's values of the block " . $fblock['name'] . ' will be kept and new option(s) are added. (value = ' . $modversion['blocks'][$i]['options'] . ')'; } else { - $local_msgs[] = "Option's values of the block " . $fblock['name'] . ' will be reset to the default, because of some decrease of options. (value = ' . $modversion['blocks'][$i]['options'] . ')'; + $local_msgs[] = "Option's values of the block " + . $fblock['name'] + . ' will be reset to the default, because of some decrease of options. (value = ' + . $modversion['blocks'][$i]['options'] + . ')'; } } } diff --git a/language/english/admin.php b/language/english/admin.php index 536944e..a91cf47 100644 --- a/language/english/admin.php +++ b/language/english/admin.php @@ -32,7 +32,8 @@ define('_AM_SPARTNER_ACTIVE_EDITING_INFO', 'You can edit this active partner. Modifications will immediatly take effect in the user side.'); define('_AM_SPARTNER_ACTIVE_EXP', 'Active partners: Actual active partners of this site.'); define('_AM_SPARTNER_ACTIVE_PARTNERS', 'Active partners'); -define('_AM_SPARTNER_ACTIVE_PARTNERS_DSC', 'Here is a list of active partners. These partners are displayed in the user side. You can edit or delete each partners by clicking on the related button in the Action column.'); +define('_AM_SPARTNER_ACTIVE_PARTNERS_DSC', + 'Here is a list of active partners. These partners are displayed in the user side. You can edit or delete each partners by clicking on the related button in the Action column.'); define('_AM_SPARTNER_ALL', 'All'); define('_AM_SPARTNER_ALL_EXP', 'All status: All partners of the module, whatever their status.'); define('_AM_SPARTNER_ALLITEMS', 'All partners of the module'); @@ -135,7 +136,8 @@ define('_AM_SPARTNER_INACTIVATE_PARTNER', 'Deactivate partner'); define('_AM_SPARTNER_INACTIVE', _CO_SPARTNER_INACTIVE); define('_AM_SPARTNER_INACTIVE_EDITING', 'Editing an inactive partner'); -define('_AM_SPARTNER_INACTIVE_EDITING_INFO', "You can edit this inactive partner. Modifications will be saved for this partner. However, if you would like to display this partner in the user side, you will need to set the Status field to 'Active'."); +define('_AM_SPARTNER_INACTIVE_EDITING_INFO', + "You can edit this inactive partner. Modifications will be saved for this partner. However, if you would like to display this partner in the user side, you will need to set the Status field to 'Active'."); define('_AM_SPARTNER_INACTIVE_EXP', 'Inactive partners: Active partners that has become, for some reason, inactive. An inactive partner is not displayed in the user side.'); define('_AM_SPARTNER_INACTIVE_FIELD', 'Inactive'); define('_AM_SPARTNER_INACTIVE_PARTNERS', 'Inactive partners'); @@ -178,7 +180,8 @@ define('_AM_SPARTNER_REJECTED_EXP', 'Rejected partners: Submitted partners that have been rejected. A rejected partner is not displayed in the user side.'); define('_AM_SPARTNER_REJECTED_PARTNERS', 'Rejected partners'); define('_AM_SPARTNER_REJECTED_EDITING', 'Editing a rejected partner'); -define('_AM_SPARTNER_REJECTED_EDITING_INFO', "You can edit this rejected partner. Modifications will be saved for this partner. However, if you would like to display this partner in the user side, you will need to set the Status field to 'Active'."); +define('_AM_SPARTNER_REJECTED_EDITING_INFO', + "You can edit this rejected partner. Modifications will be saved for this partner. However, if you would like to display this partner in the user side, you will need to set the Status field to 'Active'."); define('_AM_SPARTNER_SELECT_SORT', 'Select sort order:'); define('_AM_SPARTNER_SELECT_STATUS', 'Select a status'); define('_AM_SB_SETMPERM', 'Set the permission'); @@ -195,7 +198,8 @@ define('_AM_SPARTNER_SUBMITTED', _CO_SPARTNER_SUBMITTED); define('_AM_SPARTNER_SUBMITTED_APPROVE_SUCCESS', 'The submitted partner has been approved.'); define('_AM_SPARTNER_SUBMITTED_EXP', 'Submitted partners: Potential partners that have submitted their organisation to become a partner of this site.'); -define('_AM_SPARTNER_SUBMITTED_INFO', "This partner have been submitted on your site. You can edit it as you like. You can make some modifications if you'd like. Upon approval, this partner will be displayed in the user side of this site."); +define('_AM_SPARTNER_SUBMITTED_INFO', + "This partner have been submitted on your site. You can edit it as you like. You can make some modifications if you'd like. Upon approval, this partner will be displayed in the user side of this site."); define('_AM_SPARTNER_SUBMITTED_PARTNERS', 'Submitted partners'); define('_AM_SPARTNER_SUBMITTED_TITLE', 'Submitted partner'); define('_AM_SPARTNER_TITLE', "Partner's name"); @@ -250,12 +254,14 @@ define('_AM_SPARTNER_CATEGORY_PARENT', 'Parent category'); define('_AM_SPARTNER_CATEGORY_PARENT_DSC', 'Select a parent to make this a sub-category.'); define('_AM_SPARTNER_CATEGORY_SUBCATS_CREATE', 'Create subcategories'); -define('_AM_SPARTNER_CATEGORY_SUBCATS_CREATE_DSC', "Fill the text box with the names of sub categories to create.
Leave blank to not create subcategory. To create more, enter the how much more to create then press 'Add'"); +define('_AM_SPARTNER_CATEGORY_SUBCATS_CREATE_DSC', + "Fill the text box with the names of sub categories to create.
Leave blank to not create subcategory. To create more, enter the how much more to create then press 'Add'"); define('_AM_SPARTNER_ADD_OPT', 'Add %s more sub categories'); define('_AM_SPARTNER_ADD_OPT_SUBMIT', 'Add'); define('_AM_SPARTNER_CATEGORY_CREATED', 'New category was created and saved!'); define('_AM_SPARTNER_CATEGORY_SUBCAT_SAVE_ERROR', 'An error occured while saving the category. Here is a list of error(s):'); -define('_AM_SPARTNER_CATEGORY_DELETE_CONFIRM', 'Please note that by deleting a category, all the sub-categories and the partners of this category will be deleted as well, along with any comments that may have been posted related to ces articles. Are you sure you wish to delete this category?'); +define('_AM_SPARTNER_CATEGORY_DELETE_CONFIRM', + 'Please note that by deleting a category, all the sub-categories and the partners of this category will be deleted as well, along with any comments that may have been posted related to ces articles. Are you sure you wish to delete this category?'); define('_AM_SPARTNER_CATEGORY_DELETE_ERROR', 'An error occured while deleting this category.'); define('_AM_SPARTNER_CATEGORY_NONE', 'There is no category in the module.'); @@ -286,6 +292,7 @@ define('_AM_SPARTNER_OFFER_EDIT', 'Edit an offer'); define('_AM_SPARTNER_OFFER_EDIT_INFO', ''); define('_AM_SPARTNER_SHOW_SUMMARY', 'Show summary on partner page'); -define('_AM_SPARTNER_SHOW_SUMMARY_DSC', "Note: if any users have partial view permissions, you should set this to 'yes.' Otherwise a partner detail page displayed in partial view mode will have no info at all other than the logo and name."); -define('_SMARTPARTNER_MESSAGE_FILE_ERROR', 'Error: Unable to store uploaded file for the following reasons:
%s'); +define('_AM_SPARTNER_SHOW_SUMMARY_DSC', + "Note: if any users have partial view permissions, you should set this to 'yes.' Otherwise a partner detail page displayed in partial view mode will have no info at all other than the logo and name."); +define('_SMARTPARTNER_MESSAGE_FILE_ERROR', 'Error: Unable to store uploaded file for the following reasons:
%s'); define('_SMARTPARTNER_MESSAGE_WRONG_MIMETYPE', 'Error: filetype is not allowed. Please re-submit.'); diff --git a/language/english/common.php b/language/english/common.php index 8353e45..79976ce 100644 --- a/language/english/common.php +++ b/language/english/common.php @@ -29,7 +29,8 @@ define('_CO_SPARTNER_FILE_UPLOAD_ERROR', 'An error occured while uploading the logo.'); define('_CO_SPARTNER_HITS', 'Hits'); define('_CO_SPARTNER_IMAGE_URL', 'Logo URL'); -define('_CO_SPARTNER_IMAGE_URL_DSC', "The partner's logo can also be an url over the web. However, we recommand you to upload the logo for better resizing functionnalities. Please note that if you select a logo in the second row of this form, the 'Logo URL' won't be taken in consideration."); +define('_CO_SPARTNER_IMAGE_URL_DSC', + "The partner's logo can also be an url over the web. However, we recommand you to upload the logo for better resizing functionnalities. Please note that if you select a logo in the second row of this form, the 'Logo URL' won't be taken in consideration."); define('_CO_SPARTNER_INACTIVE', 'Inactive'); define('_CO_SPARTNER_INTRO', 'Summary'); define('_CO_SPARTNER_INVENTORY', 'Partners Summary'); @@ -73,11 +74,11 @@ define('_CO_SPARTNER_WEIGHT', 'Weight'); define('_CO_SPARTNER_WEIGHT_DSC', "If the 'Sort by Weight' option is turned on in the preferences, the partners will be sort by their weight in the user side index page."); define('_CO_SPARTNER_CONTACT_EMAILPRIV', 'Email Privacy?'); -define('_CO_SPARTNER_CONTACT_EMAILPRIV_DSC', "Select 'YES' to make your email address private
Admin will still be able to view it!"); +define('_CO_SPARTNER_CONTACT_EMAILPRIV_DSC', "Select 'YES' to make your email address private
Admin will still be able to view it!"); define('_CO_SPARTNER_CONTACT_PHONEPRIV', 'Phone Privacy?'); -define('_CO_SPARTNER_CONTACT_PHONEPRIV_DSC', "Select 'YES' to make your phone number private
Admin will still be able to view it!"); +define('_CO_SPARTNER_CONTACT_PHONEPRIV_DSC', "Select 'YES' to make your phone number private
Admin will still be able to view it!"); define('_CO_SPARTNER_CONTACT_ADRESSPRIV', 'Address Privacy?'); -define('_CO_SPARTNER_CONTACT_ADRESSPRIV_DSC', "Select 'YES' to make your address private
Admin will still be able to view it!"); +define('_CO_SPARTNER_CONTACT_ADRESSPRIV_DSC', "Select 'YES' to make your address private
Admin will still be able to view it!"); define('_CO_SPARTNER_STATUS_OFFLINE', 'Offline'); define('_CO_SPARTNER_STATUS_ONLINE', 'Online'); define('_CO_SPARTNER_OFFER_TITLE', 'Title'); @@ -106,5 +107,5 @@ define('_CO_SPARTNER_FULL_PERM_READ_DSC', 'Select groups that will have full view.'); define('_CO_SPARTNER_PART_PERM_READ', 'Partial view'); define('_CO_SPARTNER_PART_PERM_READ_DSC', 'Select groups that will have partial view.'); -define('_SPARTNER_MESSAGE_FILE_ERROR', 'Error: Unable to store uploaded file for the following reasons:
%s'); +define('_SPARTNER_MESSAGE_FILE_ERROR', 'Error: Unable to store uploaded file for the following reasons:
%s'); define('_SPARTNER_MESSAGE_WRONG_MIMETYPE', 'Error: filetype is not allowed. Please re-submit.'); diff --git a/language/english/help/help.html b/language/english/help/help.html index 4ccc9e7..caf05ac 100644 --- a/language/english/help/help.html +++ b/language/english/help/help.html @@ -8,23 +8,23 @@

Help:

Description

-

SmartPartner is a XOOPS 2 module that allows you to manage partners. Each partner have a unique page with its logo, web site and contact information.

+

SmartPartner is a XOOPS 2 module that allows you to manage partners. Each partner have a unique page with its logo, web site and contact information.

Install/uninstall

No special measures necessary, follow the standard installation process – extract the module folder into the ../modules directory. Install the - module through Admin -> System Module -> Modules.

+ module through Admin -> System Module -> Modules.

Detailed instructions on installing modules are available in the Chapter 2.12 of our XOOPS Operations Manual

Operating instructions

- This module and its operations are very simple.

+ This module and its operations are very simple.

Detailed instructions on configuring the access rights for user groups are available in the - XOOPS Operations Manual

+ XOOPS Operations Manual

Tutorial

diff --git a/language/english/main.php b/language/english/main.php index ca5bab0..82e1b22 100644 --- a/language/english/main.php +++ b/language/english/main.php @@ -49,7 +49,7 @@ define('_MD_SPARTNER_ERROR3', "
The image file doesn't exist. Try with another image
"); define('_MD_SPARTNER_GOBACK', "Back"); define('_MD_SPARTNER_NEWPARTNER', '%s Partners Request'); -define('_MD_SPARTNER_SENDMAIL', "Request mail sent to the administrator.
Return to index"); +define('_MD_SPARTNER_SENDMAIL', "Request mail sent to the administrator.
Return to index"); define('_MD_SPARTNER_CATEGORY_EMPTY', 'This category is empty.'); // Hack by marcan: More information on the SmartPartner module diff --git a/language/english/modinfo.php b/language/english/modinfo.php index d781a7b..9de8a80 100644 --- a/language/english/modinfo.php +++ b/language/english/modinfo.php @@ -91,10 +91,12 @@ define('_MI_SPARTNER_IMG_MAX_HEIGHT_DSC', 'This will be the maximum height of a logo that is uploaded to the module.'); define('_MI_SPARTNER_HELP_PATH_SELECT', 'Path of SmartPartner help files'); -define('_MI_SPARTNER_HELP_PATH_SELECT_DSC', "Select from where you would like to access SmartPartner's help files. If you downloaded the 'SmartPartner's Help Package' and uploaded it in 'modules/smartpartner/doc/', you can select 'Inside the module'. Alternatively, you can access the module's help file directly from docs.xoops.org by chosing this in the selector. You can also select 'Custom Path' and specify yourself the path of the help files in the next config option 'Custom path of SmartPartner's help files'"); +define('_MI_SPARTNER_HELP_PATH_SELECT_DSC', + "Select from where you would like to access SmartPartner's help files. If you downloaded the 'SmartPartner's Help Package' and uploaded it in 'modules/smartpartner/doc/', you can select 'Inside the module'. Alternatively, you can access the module's help file directly from docs.xoops.org by chosing this in the selector. You can also select 'Custom Path' and specify yourself the path of the help files in the next config option 'Custom path of SmartPartner's help files'"); define('_MI_SPARTNER_HELP_PATH_CUSTOM', "Custom path of SmartPartner's help files"); -define('_MI_SPARTNER_HELP_PATH_CUSTOM_DSC', "If you selected 'Custom path' in the previous option 'Path of SmartPartner's help files', please specify the URL of SmartPartner's help files, in that format: http://www.yoursite.com/doc"); +define('_MI_SPARTNER_HELP_PATH_CUSTOM_DSC', + "If you selected 'Custom path' in the previous option 'Path of SmartPartner's help files', please specify the URL of SmartPartner's help files, in that format: http://www.yoursite.com/doc"); define('_MI_SPARTNER_HELP_INSIDE', 'Inside the module'); define('_MI_SPARTNER_HELP_CUSTOM', 'Custom Path'); diff --git a/makepdf.php b/makepdf.php index 8d37d2e..ba94e31 100644 --- a/makepdf.php +++ b/makepdf.php @@ -65,8 +65,8 @@ echo 'test'; //Other stuff -$puff = '
'; -$puffer = '


'; +$puff = '
'; +$puffer = '


'; //create the A4-PDF... $pdf_config['slogan'] = $xoopsConfig['sitename'] . ' - ' . $xoopsConfig['slogan']; diff --git a/templates/blocks/moving_patner.tpl b/templates/blocks/moving_patner.tpl index b6cfd1f..535024c 100644 --- a/templates/blocks/moving_patner.tpl +++ b/templates/blocks/moving_patner.tpl @@ -7,7 +7,7 @@ ***********************************************/ - //Specify the slider's width (in pixels) + //Specify the slider's width (in pixels) var sliderwidth = "300px" //Specify the slider's height var sliderheight = "150px" @@ -149,13 +149,13 @@ <{/literal}> <{/if}>
-
+
<{$partner.urllink}> <{if $partner.image != ""}> border="0" alt="<{$partner.title}>" <{$block.fadeImage}> /> -
+
<{/if}> <{$partner.title}><{if $block.insertBr != ""}> -

<{/if}> +

<{/if}>
diff --git a/templates/blocks/partners_block_list.tpl b/templates/blocks/partners_block_list.tpl index 632354f..928148b 100644 --- a/templates/blocks/partners_block_list.tpl +++ b/templates/blocks/partners_block_list.tpl @@ -36,10 +36,10 @@
<{$category.link}>
<{/if}> <{foreach item=partner from=$category.partners}> <{$partner.urllink}> <{if $partner.image != ""}> border="0" alt="<{$partner.title}>" <{$block.fadeImage}> /> -
+
<{/if}> <{$partner.title}> <{if $block.insertBr != ""}> -
-
+
+
<{/if}> <{/foreach}> <{/foreach}> diff --git a/templates/blocks/random_offer.tpl b/templates/blocks/random_offer.tpl index e2ce90d..e1a6ed6 100644 --- a/templates/blocks/random_offer.tpl +++ b/templates/blocks/random_offer.tpl @@ -32,15 +32,15 @@ <{/literal}> <{/if}>
-
<{foreach item=offer from=$block.offers}> +
<{foreach item=offer from=$block.offers}> <{if $offer.image != ""}> <{$offer.title}> /> -
+
<{/if}> <{$offer.title}>
<{if $block.insertBr != ""}> -
-
+
+
<{/if}> <{/foreach}>
diff --git a/templates/blocks/random_partner.tpl b/templates/blocks/random_partner.tpl index b5a2b61..4a8bc74 100644 --- a/templates/blocks/random_partner.tpl +++ b/templates/blocks/random_partner.tpl @@ -32,13 +32,13 @@ <{/literal}> <{/if}>
-
+
<{$partner.urllink}> <{if $partner.image != ""}> border="0" alt="<{$partner.title}>" <{$block.fadeImage}> /> -
+
<{/if}> <{$partner.title}><{if $block.insertBr != ""}> -

<{/if}> +

<{/if}>
diff --git a/templates/blocks/recent_offers.tpl b/templates/blocks/recent_offers.tpl index 33ba365..f07a509 100644 --- a/templates/blocks/recent_offers.tpl +++ b/templates/blocks/recent_offers.tpl @@ -36,10 +36,10 @@
<{$offer.title}>

<{if $block.insertBr != ""}> -
-
+ <{$offer.title}> />
+ <{/if}>--><{$offer.title}>

<{if $block.insertBr != ""}> +
+
<{/if}>
<{/foreach}> diff --git a/templates/blocks/recent_partners.tpl b/templates/blocks/recent_partners.tpl index 885a1cd..17f0443 100644 --- a/templates/blocks/recent_partners.tpl +++ b/templates/blocks/recent_partners.tpl @@ -36,9 +36,9 @@ diff --git a/templates/smartpartner_footer.tpl b/templates/smartpartner_footer.tpl index 94958f0..149fe55 100644 --- a/templates/smartpartner_footer.tpl +++ b/templates/smartpartner_footer.tpl @@ -1,4 +1,4 @@ -
<{if $isAdmin == 1}> +
<{if $isAdmin == 1}> <{/if}><{if $smarttie==1}><{include file='db:smarttie_links.tpl'}><{/if}> <{include file='db:system_notification_select.tpl'}> diff --git a/templates/smartpartner_index.tpl b/templates/smartpartner_index.tpl index 4cfbaaa..749a486 100644 --- a/templates/smartpartner_index.tpl +++ b/templates/smartpartner_index.tpl @@ -3,7 +3,7 @@ <{if $on_index_page && $lang_intro_text}>
<{$lang_partnerstitle}>
<{$lang_intro_text}>
-
+
<{/if}> <{if count($partners) > 0}><{foreach item=category from=$partners}><{if $category.title}> @@ -28,7 +28,8 @@ <{foreach item=partner from=$category.partners}> <{if $partner.display_type == 'part' || $partner.display_type == 'full'}> - <{$partner.title}>

<{if $partner.update_status == 'new'}> + <{$partner.title}>

<{if $partner.update_status == 'new'}> <{elseif $partner.update_status == 'updated'}> @@ -62,8 +63,8 @@ <{/foreach}><{else}><{$lang_no_partners}> -
-
+
+
<{/if}> diff --git a/templates/smartpartner_offer.tpl b/templates/smartpartner_offer.tpl index a2fb869..abb3a88 100644 --- a/templates/smartpartner_offer.tpl +++ b/templates/smartpartner_offer.tpl @@ -2,7 +2,7 @@
<{$lang_offer_intro}>
<{/if}><{foreach item=category from=$offers}> <{$category.name}> : -
+
<{foreach key=key item=partner from=$category.partners}><{foreach item=offer from=$partner.offers}> <{$offer.title}>
@@ -19,7 +19,7 @@
<{/foreach}> -
+
<{/foreach}><{if $category.subcats}>
<{include file='db:smartpartner_offer.html' offers=$category.subcats nointro=1}> diff --git a/templates/smartpartner_partner.tpl b/templates/smartpartner_partner.tpl index 244cfca..0357f92 100644 --- a/templates/smartpartner_partner.tpl +++ b/templates/smartpartner_partner.tpl @@ -9,7 +9,8 @@ <{elseif $partner.update_status == 'updated'}> <{/if}> <{$partner.urllink}> - <{$partner.clean_title}><{$partner.title}> <{if $isAdmin}> + <{$partner.clean_title}><{$partner.title}> <{if $isAdmin}> <{$lang_edit}> <{$lang_delete}> <{/if}> @@ -47,7 +48,7 @@ <{/if}>
-
<{if $partner.display_type == 'full' && ($partner.contact_name || $partner.contact_email || $partner.contact_phone || $partner.adress || $partner.url)}> +
<{if $partner.display_type == 'full' && ($partner.contact_name || $partner.contact_email || $partner.contact_phone || $partner.adress || $partner.url)}> @@ -103,8 +104,8 @@
<{$partview_msg}>
<{/if}> <{if $show_stats_block}> -
-
+
+
<{$lang_stats}>
<{$lang_page_been_seen}> <{$partner.hits_page}> @@ -125,7 +126,9 @@ <{foreach item=file from=$partner.files}>
@@ -134,7 +137,7 @@ <{/foreach}>
<{$lang_partner_informations}>
- <{$lang_download_file}> <{$file.name}> + <{$lang_download_file}> <{$file.name}>
<{$file.description}>
<{$file.datesub}>
-
+
<{/if}> <{include file='db:smartpartner_footer.tpl'}> diff --git a/templates/smartpartner_pdf.tpl b/templates/smartpartner_pdf.tpl index 84436aa..5909727 100644 --- a/templates/smartpartner_pdf.tpl +++ b/templates/smartpartner_pdf.tpl @@ -5,7 +5,8 @@ - + @@ -38,9 +39,11 @@
- <{$partner.urllink}><{$partner.clean_title}><{$partner.title}> <{if $isAdmin}> + <{$partner.urllink}><{$partner.clean_title}><{$partner.title}> <{if $isAdmin}> <{$lang_edit}> - <{$lang_delete}> + <{$lang_delete}> <{/if}>
@@ -50,7 +53,7 @@ -
+
diff --git a/xoops_version.php b/xoops_version.php index c536a2e..e876894 100644 --- a/xoops_version.php +++ b/xoops_version.php @@ -28,7 +28,8 @@ // Added by marcan for the About page in admin section $modversion['modFooter'] = 'smartpartner_modFooter'; $modversion['developer_lead'] = 'marcan [Marc-Andre Lanciault]'; -$modversion['developer_contributor'] = 'Andy Cleff, Raul Recio, chapi, Marco, Mariuss, outch, M0nty, Christian, Philou, M4d3L, solo, GiJOE, Predator, phppp, AmiCalmant, hsalazar, Aidan Lister, fx2024, Zabou'; +$modversion['developer_contributor'] = + 'Andy Cleff, Raul Recio, chapi, Marco, Mariuss, outch, M0nty, Christian, Philou, M4d3L, solo, GiJOE, Predator, phppp, AmiCalmant, hsalazar, Aidan Lister, fx2024, Zabou'; $modversion['developer_website_url'] = 'http://www.smartfactory.ca'; $modversion['developer_website_name'] = 'SmartFactory.ca'; $modversion['developer_email'] = 'marcan@smartfactory'; @@ -74,16 +75,16 @@ $modversion['submit_feature'] = 'http://dev.xoops.org/modules/xfmod/tracker/?func=add&group_id=1109&atid=584'; $modversion['author_word'] = " -The SmartFactory would like to thank everyone involved in this project.
-
-A big thanks to chapi, Marco, Mariuss, oucth, Christian, Philou, solo, yoyo2021 and AmiCalmant for their feedback on the module.
-
-Thanks to hsalazar who originally created the admin interface the SmartModules are using. A lot of modules are now using it and it's because of your work. Thank you Horacio !
-
-Thanks to GiJoe for the blocks and groups management pages. Your code is very usefull to a lot of developers !
-
-Thanks to Zabou for supporting me ;-)
-
+The SmartFactory would like to thank everyone involved in this project.
+
+A big thanks to chapi, Marco, Mariuss, oucth, Christian, Philou, solo, yoyo2021 and AmiCalmant for their feedback on the module.
+
+Thanks to hsalazar who originally created the admin interface the SmartModules are using. A lot of modules are now using it and it's because of your work. Thank you Horacio !
+
+Thanks to GiJoe for the blocks and groups management pages. Your code is very usefull to a lot of developers !
+
+Thanks to Zabou for supporting me ;-)
+
Enjoy SmartPartner ! "; @@ -291,7 +292,8 @@ $modversion['config'][$i]['formtype'] = 'select'; $modversion['config'][$i]['valuetype'] = 'int'; $modversion['config'][$i]['default'] = 86400; -$modversion['config'][$i]['options'] = array('_MI_SPARTNER_HOUR' => '3600', '_MI_SPARTNER_3HOURS' => '10800', '_MI_SPARTNER_5HOURS' => '18000', '_MI_SPARTNER_10HOURS' => '36000', '_MI_SPARTNER_DAY' => '86400'); +$modversion['config'][$i]['options'] = + array('_MI_SPARTNER_HOUR' => '3600', '_MI_SPARTNER_3HOURS' => '10800', '_MI_SPARTNER_5HOURS' => '18000', '_MI_SPARTNER_10HOURS' => '36000', '_MI_SPARTNER_DAY' => '86400'); $modversion['config'][$i]['category'] = 'other'; ++$i; From a5640d0d778aaf8f98b4fef62c1235dfe70d21d2 Mon Sep 17 00:00:00 2001 From: mambax7 Date: Tue, 31 May 2016 06:11:37 -0400 Subject: [PATCH 2/2] fixes --- README.md | 30 +++++++++++++++--------------- assets/css/module.css | 2 +- class/baseObjectHandler.php | 2 +- class/partner.php | 6 +++--- class/session.php | 2 +- templates/smartpartner_pdf.tpl | 2 +- 6 files changed, 22 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 55f258e..6bf1af9 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,22 @@ - ![alt XOOPS CMS](http://xoops.org/images/logoXoops4GithubRepository.png) - ## SmartPartner for [XOOPS CMS 2.5.8+](https://xoops.org) - [![Software License](https://img.shields.io/badge/license-GPL-brightgreen.svg?style=flat)](LICENSE) - [![Scrutinizer Code Quality](https://img.shields.io/scrutinizer/g/mambax7/smartpartner.svg?style=flat)](https://scrutinizer-ci.com/g/mambax7/smartpartner/?branch=master) - [![Codacy Badge](https://api.codacy.com/project/badge/grade/2d27c0023ee54f0b9ba2b5d17a68b2a5)](https://www.codacy.com/app/mambax7/smartpartner) - [![Code Climate](https://img.shields.io/codeclimate/github/mambax7/smartpartner.svg?style=flat)](https://codeclimate.com/github/mambax7/smartpartner) - [![SensioLabsInsight](https://insight.sensiolabs.com/projects/626a39f7-d06e-47a6-8fc9-20bd04275bb1/mini.png)](https://insight.sensiolabs.com/projects/626a39f7-d06e-47a6-8fc9-20bd04275bb1) - [![Latest Pre-Resease](https://img.shields.io/github/tag/XoopsModules25x/smartpartner.svg?style=flat)](https://github.com/XoopsModules25x/smartpartner/tags/) - [![Latest Version](https://img.shields.io/github/release/XoopsModules25x/smartpartner.svg?style=flat)](https://github.com/XoopsModules25x/smartpartner/releases/) +![alt XOOPS CMS](http://xoops.org/images/logoXoops4GithubRepository.png) +##SmartPartner for [XOOPS CMS 2.5.8+](https://xoops.org) +[![Software License](https://img.shields.io/badge/license-GPL-brightgreen.svg?style=flat)](LICENSE) +[![Scrutinizer Code Quality](https://img.shields.io/scrutinizer/g/mambax7/smartpartner.svg?style=flat)](https://scrutinizer-ci.com/g/XoopsModules25x/smartpartner/?branch=master) +[![Codacy Badge](https://api.codacy.com/project/badge/grade/2d27c0023ee54f0b9ba2b5d17a68b2a5)](https://www.codacy.com/app/mambax7/smartpartner) +[![Code Climate](https://img.shields.io/codeclimate/github/mambax7/smartpartner.svg?style=flat)](https://codeclimate.com/github/mambax7/smartpartner) +[![SensioLabsInsight](https://insight.sensiolabs.com/projects/626a39f7-d06e-47a6-8fc9-20bd04275bb1/mini.png)](https://insight.sensiolabs.com/projects/626a39f7-d06e-47a6-8fc9-20bd04275bb1) +[![Latest Pre-Resease](https://img.shields.io/github/tag/XoopsModules25x/smartpartner.svg?style=flat)](https://github.com/XoopsModules25x/smartpartner/tags/) +[![Latest Version](https://img.shields.io/github/release/XoopsModules25x/smartpartner.svg?style=flat)](https://github.com/XoopsModules25x/smartpartner/releases/) SmartPartner for [XOOPS CMS](http://xoops.org) is an advanced Partners Management System for your XOOPS site. - [![Tutorial Available](http://xoops.org/images/tutorial-available-blue.svg)](https://www.gitbook.com/book/xoops/xoops-smartpartner-module/) Tutorial: see [here](https://www.gitbook.com/book/xoops/xoops-smartpartner-module/). - To contribute to the Tutorial, [fork it on GitHub](https://github.com/XoopsDocs/smartpartner-tutorial) +[![Tutorial Available](http://xoops.org/images/tutorial-available-blue.svg)](https://www.gitbook.com/book/xoops/xoops-smartpartner-module/) Tutorial: see [here](https://www.gitbook.com/book/xoops/xoops-smartpartner-module/). +To contribute to the Tutorial, [fork it on GitHub](https://github.com/XoopsDocs/smartpartner-tutorial) - [![Translations on Transifex](http://xoops.org/images/translations-transifex-blue.svg)](https://www.transifex.com/xoops) +[![Translations on Transifex](http://xoops.org/images/translations-transifex-blue.svg)](https://www.transifex.com/xoops) - Please visit us on [http://xoops.org](https://xoops.org) - - The upcoming "next generation" version of XOOPS CMS is being crafted on GitHub at: https://github.com/XOOPS +Please visit us on [http://xoops.org](https://xoops.org) + +The upcoming "next generation" version of XOOPS CMS is being crafted on GitHub at: https://github.com/XOOPS diff --git a/assets/css/module.css b/assets/css/module.css index 85a31ed..3cb1e03 100644 --- a/assets/css/module.css +++ b/assets/css/module.css @@ -102,7 +102,7 @@ text-align: center; padding-top: 6px; font-size: 9px; - border-top: 0px solid #ccc; + border-top: 0 solid #ccc; } .smartpartner_category_block { diff --git a/class/baseObjectHandler.php b/class/baseObjectHandler.php index c5b4d5a..037b2c8 100644 --- a/class/baseObjectHandler.php +++ b/class/baseObjectHandler.php @@ -310,7 +310,7 @@ public function _deleteQuery($obj) public function getInstance(XoopsDatabase $db) { static $instance; - if (!isset($instance)) { + if (null === $instance) { $classname = $this->classname . 'Handler'; $instance = new $classname($db); } diff --git a/class/partner.php b/class/partner.php index 1351fc3..af2b231 100644 --- a/class/partner.php +++ b/class/partner.php @@ -754,7 +754,7 @@ class SmartpartnerPartnerHandler extends SmartPersistableObjectHandler /** * Constructor * - * @param object $db reference to a xoops_db object + * @param XoopsDatabase $db reference to a xoops_db object */ public function __construct(XoopsDatabase $db) @@ -775,7 +775,7 @@ public function __construct(XoopsDatabase $db) public function getInstance(XoopsDatabase $db) { static $instance; - if (!isset($instance)) { + if (null === $instance) { $instance = new static($db); } @@ -862,7 +862,7 @@ public function insert(XoopsObject $partner, $force = false, $checkObject = true if ($partner->isNew()) { $sql = - sprintf("INSERT INTO %s (id, weight, hits, hits_page, url, image, image_url, title, datesub, summary, description, contact_name, contact_email, contact_phone, adress, `status`, `last_update`, `email_priv`, `phone_priv`, `adress_priv`, `showsummary`) VALUES (null, %u, %u, %u, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %u, %u, %u, %u, %u, %u)", + sprintf('INSERT INTO %s (id, weight, hits, hits_page, url, image, image_url, title, datesub, summary, description, contact_name, contact_email, contact_phone, adress, `status`, `last_update`, `email_priv`, `phone_priv`, `adress_priv`, `showsummary`) VALUES (null, %u, %u, %u, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %u, %u, %u, %u, %u, %u)', $this->table, $weight, $hits, $hits_page, $this->db->quoteString($url), $this->db->quoteString($image), $this->db->quoteString($image_url), $this->db->quoteString($title), time(), $this->db->quoteString($summary), $this->db->quoteString($description), $this->db->quoteString($contact_name), $this->db->quoteString($contact_email), $this->db->quoteString($contact_phone), $this->db->quoteString($adress), $status, time(), $email_priv, $phone_priv, $adress_priv, $showsummary); diff --git a/class/session.php b/class/session.php index ce5b367..bb93c00 100644 --- a/class/session.php +++ b/class/session.php @@ -74,7 +74,7 @@ public function destroy() public static function getInstance() { static $instance; - if (!isset($instance)) { + if (null === $instance) { $instance = new static(); } diff --git a/templates/smartpartner_pdf.tpl b/templates/smartpartner_pdf.tpl index 5909727..deb7aa9 100644 --- a/templates/smartpartner_pdf.tpl +++ b/templates/smartpartner_pdf.tpl @@ -147,6 +147,6 @@
<{$wiwimod.body}> -
+
<{$_MD_WIWI_MODIFIED_TXT}> <{$wiwimod.lastmodified}> <{$_MD_WIWI_BY}> <{$wiwimod.author}>