From bb41b59850b2d6afa7f48538156f921341669a0e Mon Sep 17 00:00:00 2001 From: Vladimir Date: Sun, 21 Nov 2021 01:35:17 +0300 Subject: [PATCH 1/2] Bugfix in package install script Multiple value must be an array while saving component settings during install process. --- pkg_jcomments.php | 5 ++++- site/classes/acl.php | 3 +-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pkg_jcomments.php b/pkg_jcomments.php index 2a8529de..80dbc46b 100644 --- a/pkg_jcomments.php +++ b/pkg_jcomments.php @@ -17,7 +17,6 @@ use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\Factory; use Joomla\CMS\Filesystem\File; -use Joomla\CMS\Filesystem\Folder; use Joomla\CMS\Filesystem\Path; use Joomla\CMS\Form\Form; use Joomla\CMS\Installer\Installer; @@ -330,6 +329,10 @@ private function setComponentParams() { $params[$fieldname] = json_decode($field->getAttribute('default')); } + elseif (!is_null($field->getAttribute('multiple'))) + { + $params[$fieldname] = explode(',', $field->getAttribute('default')); + } } } diff --git a/site/classes/acl.php b/site/classes/acl.php index 335c8be2..11d0d127 100644 --- a/site/classes/acl.php +++ b/site/classes/acl.php @@ -11,7 +11,6 @@ defined('_JEXEC') or die; -use Joomla\CMS\Access\Access; use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\Factory; @@ -218,7 +217,7 @@ public function enableAutocensor() foreach ($userGroups as $userGroup) { - if (in_array($userGroup, explode(',',$censorGroups))) + if (in_array($userGroup, $censorGroups)) { // Current usergroup must be censored. return true; From 4c4468dc9d69c0e051941b3a069f9e98df381758 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Fri, 3 Dec 2021 10:38:46 +0300 Subject: [PATCH 2/2] Bugfixes Fixed "JCommentsSecurity not found" error while saving article in frontend. Change some content plugins to work with new Joomla version. Removed content plugins for outdated versions of the components. --- jcomments.xml | 2 +- pkg_jcomments.xml | 2 +- site/helpers/object.php | 5 +- site/plugins/com_acepolls.plugin.php | 44 ---- site/plugins/com_adsmanager.plugin.php | 39 ---- site/plugins/com_allevents.plugin.php | 39 ---- site/plugins/com_apoll.plugin.php | 43 ---- site/plugins/com_ars.plugin.php | 196 +++++++++--------- site/plugins/com_ars_category.plugin.php | 8 +- site/plugins/com_autoexp.plugin.php | 63 ------ site/plugins/com_beeheard.plugin.php | 37 ---- site/plugins/com_beeheardlite.plugin.php | 37 ---- site/plugins/com_blog.plugin.php | 52 ----- site/plugins/com_cobalt.plugin.php | 48 ----- site/plugins/com_communitypolls.plugin.php | 88 ++++---- site/plugins/com_comprofiler.plugin.php | 94 ++++----- site/plugins/com_content.plugin.php | 73 ++++--- site/plugins/com_datsogallery.plugin.php | 37 ---- site/plugins/com_digifolio.plugin.php | 46 ---- site/plugins/com_djcatalog.plugin.php | 72 ++++--- site/plugins/com_djcatalog2.plugin.php | 98 +++++---- site/plugins/com_djclassifieds.plugin.php | 98 +++++---- site/plugins/com_docman.plugin.php | 168 ++++++++------- site/plugins/com_easyblog.plugin.php | 76 ++++--- site/plugins/com_eventgallery.plugin.php | 70 +++---- site/plugins/com_eventlist.plugin.php | 57 ----- site/plugins/com_flexicontent.plugin.php | 94 ++++----- site/plugins/com_flippingbook.plugin.php | 10 +- site/plugins/com_fwgallery.plugin.php | 124 ++++++----- site/plugins/com_galleric.plugin.php | 37 ---- site/plugins/com_groupjive.plugin.php | 46 ---- site/plugins/com_hekimablog.plugin.php | 44 ---- site/plugins/com_hekimablog_users.plugin.php | 42 ---- site/plugins/com_hikashop.plugin.php | 136 ++++++------ site/plugins/com_hwdmediashare.plugin.php | 42 ---- .../com_hwdmediashare_group.plugin.php | 42 ---- site/plugins/com_icagenda.plugin.php | 86 ++++---- site/plugins/com_improvemycity.plugin.php | 46 ---- site/plugins/com_javoice.plugin.php | 46 ---- site/plugins/com_jcollection.plugin.php | 42 ---- site/plugins/com_jcomments.plugin.php | 108 +++++----- site/plugins/com_jdownloads.plugin.php | 90 ++++---- site/plugins/com_jea.plugin.php | 44 ---- site/plugins/com_jevents.plugin.php | 80 ++++--- site/plugins/com_jmylife.plugin.php | 53 ----- site/plugins/com_jomclassifieds.plugin.php | 40 ---- site/plugins/com_jomtube.plugin.php | 38 ---- site/plugins/com_joomdoc.plugin.php | 49 ----- site/plugins/com_joomgallery.plugin.php | 49 ----- .../com_joomgallery_categories.plugin.php | 48 ----- .../com_joomgallery_gallery.plugin.php | 48 ----- site/plugins/com_joomleague.plugin.php | 63 ------ .../com_joomleague_matchreport.plugin.php | 64 ------ .../com_joomleague_nextmatch.plugin.php | 58 ------ site/plugins/com_jphoto.plugin.php | 46 ---- site/plugins/com_jshopping.plugin.php | 50 ----- site/plugins/com_juserlist.plugin.php | 39 ---- site/plugins/com_jvideo.plugin.php | 38 ---- site/plugins/com_jvideoclip.plugin.php | 42 ---- site/plugins/com_k2.plugin.php | 47 ----- site/plugins/com_listbingo.plugin.php | 37 ---- site/plugins/com_lyftenbloggie.plugin.php | 50 ----- site/plugins/com_marketplace.plugin.php | 50 ----- site/plugins/com_marketplace2.plugin.php | 45 ---- site/plugins/com_mijoevents.plugin.php | 49 ----- site/plugins/com_mijopolls.plugin.php | 50 ----- site/plugins/com_mijoshop.plugin.php | 45 ---- site/plugins/com_mijovoice.plugin.php | 49 ----- site/plugins/com_mmsblog.plugin.php | 31 --- site/plugins/com_moofaq.plugin.php | 124 +++++------ site/plugins/com_mtree.plugin.php | 70 +++---- site/plugins/com_muscol.plugin.php | 42 ---- site/plugins/com_muscol_artist.plugin.php | 33 --- site/plugins/com_muscol_song.plugin.php | 33 --- site/plugins/com_ohanah.plugin.php | 38 ---- site/plugins/com_phocadownload.plugin.php | 80 ++++--- .../com_phocadownload_files.plugin.php | 84 ++++---- site/plugins/com_phocagallery.plugin.php | 82 ++++---- .../com_phocagallery_images.plugin.php | 94 ++++----- site/plugins/com_poll.plugin.php | 37 ---- site/plugins/com_portfolio.plugin.php | 34 --- site/plugins/com_projectlog.plugin.php | 33 --- site/plugins/com_propiedades.plugin.php | 61 ------ site/plugins/com_quickfaq.plugin.php | 60 ------ site/plugins/com_redshop.plugin.php | 97 --------- site/plugins/com_remository.plugin.php | 40 ---- site/plugins/com_resource.plugin.php | 49 ----- site/plugins/com_rsevents.plugin.php | 70 +++---- site/plugins/com_rseventspro.plugin.php | 74 ++++--- site/plugins/com_sermonspeaker.plugin.php | 80 ++++--- site/plugins/com_seyret.plugin.php | 37 ---- site/plugins/com_sobi2.plugin.php | 68 ------ site/plugins/com_sobipro.plugin.php | 75 ------- site/plugins/com_tienda.plugin.php | 50 ----- site/plugins/com_tpdugg.plugin.php | 38 ---- site/plugins/com_tz_portfolio.plugin.php | 102 +++++---- site/plugins/com_videoflow.plugin.php | 40 ---- site/plugins/com_virtuemart.plugin.php | 94 ++++----- site/plugins/com_weblinks.plugin.php | 92 ++++---- site/plugins/com_yvcommodity.plugin.php | 52 ----- site/plugins/com_zoo.plugin.php | 76 +++---- 101 files changed, 1431 insertions(+), 4537 deletions(-) delete mode 100644 site/plugins/com_acepolls.plugin.php delete mode 100644 site/plugins/com_adsmanager.plugin.php delete mode 100644 site/plugins/com_allevents.plugin.php delete mode 100644 site/plugins/com_apoll.plugin.php delete mode 100644 site/plugins/com_autoexp.plugin.php delete mode 100644 site/plugins/com_beeheard.plugin.php delete mode 100644 site/plugins/com_beeheardlite.plugin.php delete mode 100644 site/plugins/com_blog.plugin.php delete mode 100644 site/plugins/com_cobalt.plugin.php delete mode 100644 site/plugins/com_datsogallery.plugin.php delete mode 100644 site/plugins/com_digifolio.plugin.php delete mode 100644 site/plugins/com_eventlist.plugin.php delete mode 100644 site/plugins/com_galleric.plugin.php delete mode 100644 site/plugins/com_groupjive.plugin.php delete mode 100644 site/plugins/com_hekimablog.plugin.php delete mode 100644 site/plugins/com_hekimablog_users.plugin.php delete mode 100644 site/plugins/com_hwdmediashare.plugin.php delete mode 100644 site/plugins/com_hwdmediashare_group.plugin.php delete mode 100644 site/plugins/com_improvemycity.plugin.php delete mode 100644 site/plugins/com_javoice.plugin.php delete mode 100644 site/plugins/com_jcollection.plugin.php delete mode 100644 site/plugins/com_jea.plugin.php delete mode 100644 site/plugins/com_jmylife.plugin.php delete mode 100644 site/plugins/com_jomclassifieds.plugin.php delete mode 100644 site/plugins/com_jomtube.plugin.php delete mode 100644 site/plugins/com_joomdoc.plugin.php delete mode 100644 site/plugins/com_joomgallery.plugin.php delete mode 100644 site/plugins/com_joomgallery_categories.plugin.php delete mode 100644 site/plugins/com_joomgallery_gallery.plugin.php delete mode 100644 site/plugins/com_joomleague.plugin.php delete mode 100644 site/plugins/com_joomleague_matchreport.plugin.php delete mode 100644 site/plugins/com_joomleague_nextmatch.plugin.php delete mode 100644 site/plugins/com_jphoto.plugin.php delete mode 100644 site/plugins/com_jshopping.plugin.php delete mode 100644 site/plugins/com_juserlist.plugin.php delete mode 100644 site/plugins/com_jvideo.plugin.php delete mode 100644 site/plugins/com_jvideoclip.plugin.php delete mode 100644 site/plugins/com_k2.plugin.php delete mode 100644 site/plugins/com_listbingo.plugin.php delete mode 100644 site/plugins/com_lyftenbloggie.plugin.php delete mode 100644 site/plugins/com_marketplace.plugin.php delete mode 100644 site/plugins/com_marketplace2.plugin.php delete mode 100644 site/plugins/com_mijoevents.plugin.php delete mode 100644 site/plugins/com_mijopolls.plugin.php delete mode 100644 site/plugins/com_mijoshop.plugin.php delete mode 100644 site/plugins/com_mijovoice.plugin.php delete mode 100644 site/plugins/com_mmsblog.plugin.php delete mode 100644 site/plugins/com_muscol.plugin.php delete mode 100644 site/plugins/com_muscol_artist.plugin.php delete mode 100644 site/plugins/com_muscol_song.plugin.php delete mode 100644 site/plugins/com_ohanah.plugin.php delete mode 100644 site/plugins/com_poll.plugin.php delete mode 100644 site/plugins/com_portfolio.plugin.php delete mode 100644 site/plugins/com_projectlog.plugin.php delete mode 100644 site/plugins/com_propiedades.plugin.php delete mode 100644 site/plugins/com_quickfaq.plugin.php delete mode 100644 site/plugins/com_redshop.plugin.php delete mode 100644 site/plugins/com_remository.plugin.php delete mode 100644 site/plugins/com_resource.plugin.php delete mode 100644 site/plugins/com_seyret.plugin.php delete mode 100644 site/plugins/com_sobi2.plugin.php delete mode 100644 site/plugins/com_sobipro.plugin.php delete mode 100644 site/plugins/com_tienda.plugin.php delete mode 100644 site/plugins/com_tpdugg.plugin.php delete mode 100644 site/plugins/com_videoflow.plugin.php delete mode 100644 site/plugins/com_yvcommodity.plugin.php diff --git a/jcomments.xml b/jcomments.xml index 63cd8e4f..3c9ab8c6 100644 --- a/jcomments.xml +++ b/jcomments.xml @@ -7,7 +7,7 @@ https://github.com/exstreme/Jcomments-4 Copyright 2006-2021 JoomlaTune.ru All rights reserved! https://www.gnu.org/copyleft/gpl.html GNU/GPL - 4.0.4 + 4.0.5 JComments lets your users comment on content items. diff --git a/pkg_jcomments.xml b/pkg_jcomments.xml index ebeaf6e3..9e41505d 100644 --- a/pkg_jcomments.xml +++ b/pkg_jcomments.xml @@ -4,7 +4,7 @@ JComments team November 2021 jcomments - 4.0.4 + 4.0.5 https://github.com/exstreme/Jcomments-4 JComments team https://github.com/exstreme/Jcomments-4 diff --git a/site/helpers/object.php b/site/helpers/object.php index 1d8c2458..0ee88217 100644 --- a/site/helpers/object.php +++ b/site/helpers/object.php @@ -18,6 +18,7 @@ require_once JPATH_ROOT . '/components/com_jcomments/models/object.php'; require_once JPATH_ROOT . '/components/com_jcomments/classes/objectinfo.php'; +require_once JPATH_ROOT . '/components/com_jcomments/classes/security.php'; /** * JComments objects frontend helper @@ -246,8 +247,8 @@ public static function storeObjectInfo($objectID, $objectGroup = 'com_content', { if ($app->isClient('administrator')) { - // We do not have to update object's link from backend - $info->link = null; + // We do not have to update object's link from backend. But if link is empty somehow, do update. + $info->link = str_replace('administrator/', '', $info->link); } // Insert/update object information diff --git a/site/plugins/com_acepolls.plugin.php b/site/plugins/com_acepolls.plugin.php deleted file mode 100644 index e858f90f..00000000 --- a/site/plugins/com_acepolls.plugin.php +++ /dev/null @@ -1,44 +0,0 @@ -get('DatabaseDriver'); - $query = 'SELECT p.id, p.title, p.access ' - . ', CASE WHEN CHAR_LENGTH(p.alias) THEN CONCAT_WS(":", p.id, p.alias) ELSE p.id END as slug' - . ' FROM #__acepolls_polls AS p' - . ' WHERE p.id = '.$id - ; - $db->setQuery($query); - $row = $db->loadObject(); - - $info = new JCommentsObjectInfo(); - - if (!empty($row)) { - $Itemid = self::getItemid('com_acepolls', 'index.php?option=com_acepolls&view=polls'); - $Itemid = $Itemid > 0 ? '&Itemid='.$Itemid : ''; - - $info->title = $row->title; - $info->access = $row->access; - $info->userid = 0; - $info->link = JRoute::_('index.php?option=com_acepolls&view=poll&id='.$row->slug.$Itemid); - } - - return $info; - } -} \ No newline at end of file diff --git a/site/plugins/com_adsmanager.plugin.php b/site/plugins/com_adsmanager.plugin.php deleted file mode 100644 index 77a8e32c..00000000 --- a/site/plugins/com_adsmanager.plugin.php +++ /dev/null @@ -1,39 +0,0 @@ -get('DatabaseDriver'); - $db->setQuery('SELECT id, ad_headline, userid, category FROM #__adsmanager_ads WHERE id = ' . $id); - $row = $db->loadObject(); - - $info = new JCommentsObjectInfo(); - - if (!empty($row)) { - $Itemid = self::getItemid('com_adsmanager', 'index.php?option=com_adsmanager&view=front'); - $Itemid = $Itemid > 0 ? '&Itemid=' . $Itemid : ''; - - $info->category_id = $row->category; - $info->title = $row->ad_headline; - $info->userid = $row->userid; - $info->link = JRoute::_("index.php?option=com_adsmanager&view=details&id=" . $row->id . "&catid=" . $row->category . $Itemid); - } - - return $info; - } -} \ No newline at end of file diff --git a/site/plugins/com_allevents.plugin.php b/site/plugins/com_allevents.plugin.php deleted file mode 100644 index 68eec63e..00000000 --- a/site/plugins/com_allevents.plugin.php +++ /dev/null @@ -1,39 +0,0 @@ -get('DatabaseDriver'); - $db->setQuery('SELECT titre, access, proposed_by FROM #__allevents_events WHERE `id`=' . $db->Quote($id)); - $row = $db->loadObject(); - - if (!empty($row)) { - $info->title = $row->titre; - $info->access = $row->access; - $info->userid = $row->proposed_by; - $info->link = AllEventsHelperRoute::getEventRoute($id); - } - } - return $info; - } -} \ No newline at end of file diff --git a/site/plugins/com_apoll.plugin.php b/site/plugins/com_apoll.plugin.php deleted file mode 100644 index 35b4e469..00000000 --- a/site/plugins/com_apoll.plugin.php +++ /dev/null @@ -1,43 +0,0 @@ -get('DatabaseDriver'); - $query = 'SELECT p.id, p.title, p.access ' - . ', CASE WHEN CHAR_LENGTH(p.alias) THEN CONCAT_WS(":", p.id, p.alias) ELSE p.id END as slug' - . ' FROM #__apoll_polls AS p' - . ' WHERE p.id = '.$id - ; - $db->setQuery($query); - $row = $db->loadObject(); - - $info = new JCommentsObjectInfo(); - - if (!empty($row)) { - $Itemid = self::getItemid('com_apoll', 'index.php?option=com_apoll&view=apoll'); - $Itemid = $Itemid > 0 ? '&Itemid='.$Itemid : ''; - - $info->title = $row->title; - $info->access = $row->access; - $info->userid = 0; - $info->link = JRoute::_('index.php?option=com_apoll&view=apoll&id='.$row->slug.$Itemid); - } - - return $info; - } -} \ No newline at end of file diff --git a/site/plugins/com_ars.plugin.php b/site/plugins/com_ars.plugin.php index e30bbfb7..f43763f5 100644 --- a/site/plugins/com_ars.plugin.php +++ b/site/plugins/com_ars.plugin.php @@ -1,100 +1,98 @@ -get('DatabaseDriver'); - $query = 'SELECT r.id, r.category_id, r.version, r.access, r.created_by, c.title' - . ' FROM #__ars_categories AS c ' - . ' JOIN #__ars_releases AS r ON c.id = r.category_id ' - . ' WHERE r.id = ' . $id - ; - - $db->setQuery($query); - $row = $db->loadObject(); - - $info = new JCommentsObjectInfo(); - - if (!empty($row)) { - $Itemid = self::_findItem(array('category_id' => $row->category_id, 'release_id' => $row->id)); - $Itemid = $Itemid > 0 ? '&Itemid='.$Itemid : ''; - - $info->category_id = $row->category_id; - $info->title = $row->title . ' ' . $row->version; - $info->access = $row->access; - $info->userid = $row->created_by; - $info->link = JRoute::_('index.php?option=com_ars&view=release&id='.$row->id.$Itemid); - - } - - return $info; - } - - protected static function _findItem($needles) - { - $component = JComponentHelper::getComponent('com_ars'); - - $menus = JApplication::getMenu('site'); - $items = $menus->getItems('componentid', $component->id); - $user = JFactory::getUser(); - $access = (int)$user->get('aid'); - - foreach($items as $item) { - if ($item->published == 1 && $item->access <= $access) { - if (isset($item->query) && isset($item->query['view'])) { - if ($item->query['view'] == 'release') { - $params = ($item->params instanceof JRegistry) ? $item->params : $menus->getParams($item->id); - if ($params->get('relid',0) == $needles['release_id']) { - return $item->id; - } - } - } - } - } - - foreach($items as $item) { - if ($item->published == 1 && $item->access <= $access) { - if (isset($item->query) && isset($item->query['view'])) { - if ($item->query['view'] == 'category') { - $params = ($item->params instanceof JRegistry) ? $item->params : $menus->getParams($item->id); - print_r($params); - if ($params->get('catid',0) == $needles['category_id']) { - return $item->id; - } - } - } - } - } - - foreach($items as $item) { - if ($item->published == 1 && $item->access <= $access) { - if (isset($item->query) && isset($item->query['view'])) { - if ($item->query['view'] == 'browse') { - return $item->id; - } - } - } - } - - $active = $menus->getActive(); - if ($active) { - return $active->id; - } - - return false; - } +setQuery($query); + $row = $db->loadObject(); + + $info = new JCommentsObjectInfo(); + + if (!empty($row)) { + $Itemid = self::_findItem(array('category_id' => $row->category_id, 'release_id' => $row->id)); + $Itemid = $Itemid > 0 ? '&Itemid='.$Itemid : ''; + + $info->category_id = $row->category_id; + $info->title = $row->title . ' ' . $row->version; + $info->access = $row->access; + $info->userid = $row->created_by; + $info->link = JRoute::_('index.php?option=com_ars&view=release&id='.$row->id.$Itemid); + + } + + return $info; + } + + protected static function _findItem($needles) + { + $component = JComponentHelper::getComponent('com_ars'); + + $menus = JApplication::getMenu('site'); + $items = $menus->getItems('componentid', $component->id); + $user = JFactory::getUser(); + $access = (int)$user->get('aid'); + + foreach($items as $item) { + if ($item->published == 1 && $item->access <= $access) { + if (isset($item->query) && isset($item->query['view'])) { + if ($item->query['view'] == 'release') { + $params = ($item->params instanceof JRegistry) ? $item->params : $menus->getParams($item->id); + if ($params->get('relid',0) == $needles['release_id']) { + return $item->id; + } + } + } + } + } + + foreach($items as $item) { + if ($item->published == 1 && $item->access <= $access) { + if (isset($item->query) && isset($item->query['view'])) { + if ($item->query['view'] == 'category') { + $params = ($item->params instanceof JRegistry) ? $item->params : $menus->getParams($item->id); + print_r($params); + if ($params->get('catid',0) == $needles['category_id']) { + return $item->id; + } + } + } + } + } + + foreach($items as $item) { + if ($item->published == 1 && $item->access <= $access) { + if (isset($item->query) && isset($item->query['view'])) { + if ($item->query['view'] == 'browse') { + return $item->id; + } + } + } + } + + $active = $menus->getActive(); + if ($active) { + return $active->id; + } + + return false; + } } \ No newline at end of file diff --git a/site/plugins/com_ars_category.plugin.php b/site/plugins/com_ars_category.plugin.php index cf057718..2cce542b 100644 --- a/site/plugins/com_ars_category.plugin.php +++ b/site/plugins/com_ars_category.plugin.php @@ -2,15 +2,13 @@ /** * JComments plugin for Akeeba Release System (https://www.akeebabackup.com/) * - * @version 4.0 + * @version 3.0 * @package JComments - * @author Sergey M. Litvinov (smart@joomlatune.ru) & exstreme (info@protectyoursite.ru) & Vladimir Globulopolis + * @author Sergey M. Litvinov (smart@joomlatune.ru) * @copyright (C) 2011-2013 by Sergey M. Litvinov (http://www.joomlatune.ru) * @license GNU/GPL: http://www.gnu.org/copyleft/gpl.html */ -use Joomla\CMS\Factory; - defined('_JEXEC') or die; class jc_com_ars_category extends JCommentsPlugin @@ -23,7 +21,7 @@ function getObjectInfo($id, $language = null) if (is_file($routerHelper)) { require_once($routerHelper); - $db = Factory::getContainer()->get('DatabaseDriver'); + $db = JFactory::getDBO(); $query = 'SELECT id, title, alias, access, created_by' . ' FROM #__ars_categories' . ' WHERE id = ' . $id diff --git a/site/plugins/com_autoexp.plugin.php b/site/plugins/com_autoexp.plugin.php deleted file mode 100644 index 9443b3f3..00000000 --- a/site/plugins/com_autoexp.plugin.php +++ /dev/null @@ -1,63 +0,0 @@ -get('DatabaseDriver'); - $query = "'SELECT a.model_name, m.name AS mark " - . "\n FROM #__autoexp_add AS a" - . "\n LEFT JOIN #__autoexp_mark AS m ON m.id = a.mark_id" - . "\n WHERE id = " . $id - ; - $db->setQuery($query); - - $data = null; - - if (JCOMMENTS_JVERSION == '1.5') { - $data = $db->loadObject(); - } else { - $db->loadObject($data); - } - - if ($data != null) { - return empty($data->model_name) ? (isset($data->mark) ? $data->mark : '') : $data->model_name; - } else { - return ''; - } - } - - function getObjectLink($id) - { - $_Itemid = self::getItemid( 'com_autoexp' ); - - $db = Factory::getContainer()->get('DatabaseDriver'); - $db->setQuery( 'SELECT mark_id FROM #__autoexp_add WHERE id = ' . $id ); - $catid = $db->loadResult(); - - $link = JRoute::_('index.php?option=com_autoexp&page=show_adds&catid='.$catid.'&adid=' . $id . '&Itemid=' . $_Itemid ); - return $link; - } - - function getObjectOwner($id) - { - $db = Factory::getContainer()->get('DatabaseDriver'); - $db->setQuery( 'SELECT user_id FROM #__autoexp_add WHERE id = ' . $id ); - $userid = $db->loadResult(); - - return $userid; - } -} \ No newline at end of file diff --git a/site/plugins/com_beeheard.plugin.php b/site/plugins/com_beeheard.plugin.php deleted file mode 100644 index bbf375f1..00000000 --- a/site/plugins/com_beeheard.plugin.php +++ /dev/null @@ -1,37 +0,0 @@ -get('DatabaseDriver'); - $db->setQuery('SELECT id, title, user_id FROM #__beeheard_suggestions WHERE id = ' . $id); - $row = $db->loadObject(); - - $info = new JCommentsObjectInfo(); - - if (!empty($row)) { - $Itemid = self::getItemid('com_beeheard'); - $Itemid = $Itemid > 0 ? '&Itemid='.$Itemid : ''; - - $info->title = $row->title; - $info->userid = $row->user_id; - $info->link = JRoute::_('index.php?option=com_beeheard&controller=suggestions&suggestion_id='.$id.$Itemid); - } - - return $info; - } -} \ No newline at end of file diff --git a/site/plugins/com_beeheardlite.plugin.php b/site/plugins/com_beeheardlite.plugin.php deleted file mode 100644 index 33e74f06..00000000 --- a/site/plugins/com_beeheardlite.plugin.php +++ /dev/null @@ -1,37 +0,0 @@ -get('DatabaseDriver'); - $db->setQuery('SELECT id, title, user_id FROM #__beeheard_suggestions WHERE id = ' . $id); - $row = $db->loadObject(); - - $info = new JCommentsObjectInfo(); - - if (!empty($row)) { - $Itemid = self::getItemid('com_beeheardlite'); - $Itemid = $Itemid > 0 ? '&Itemid='.$Itemid : ''; - - $info->title = $row->title; - $info->userid = $row->user_id; - $info->link = JRoute::_('index.php?option=com_beeheardlite&controller=suggestions&suggestion_id='.$id.$Itemid); - } - - return $info; - } -} \ No newline at end of file diff --git a/site/plugins/com_blog.plugin.php b/site/plugins/com_blog.plugin.php deleted file mode 100644 index 240cdb7c..00000000 --- a/site/plugins/com_blog.plugin.php +++ /dev/null @@ -1,52 +0,0 @@ -get('DatabaseDriver'); - $db->setQuery('SELECT post_title, id FROM #__blog_postings WHERE id = ' . $id); - return $db->loadResult(); - } - - function getObjectLink($id) - { - $link = 'index.php?option=com_blog&view=comments&pid='. $id; - - require_once(JPATH_SITE.DS.'includes'.DS.'application.php'); - - $component = JComponentHelper::getComponent('com_blog'); - $menus = JApplication::getMenu('site'); - $items = $menus->getItems('componentid', $component->id); - - if (count($items)) { - $link .= "&Itemid=" . $items[0]->id; - } - - $link = JRoute::_($link); - return $link; - } - - function getObjectOwner($id) - { - $db = Factory::getContainer()->get('DatabaseDriver'); - $query = "SELECT user_id FROM #__blog_postings WHERE id = " . $id; - $db->setQuery( $query ); - $userid = $db->loadResult(); - - return intval($userid); - } -} \ No newline at end of file diff --git a/site/plugins/com_cobalt.plugin.php b/site/plugins/com_cobalt.plugin.php deleted file mode 100644 index 66561469..00000000 --- a/site/plugins/com_cobalt.plugin.php +++ /dev/null @@ -1,48 +0,0 @@ -get('DatabaseDriver'); - $query = $db->getQuery(true); - - $query->select('*'); - $query->from('#__js_res_record'); - $query->where('id = ' . (int)$id); - $db->setQuery($query); - - $record = $db->loadObject(); - - if (!empty($record)) { - $info->title = $record->title; - $info->access = $record->access; - $info->userid = $record->user_id; - $info->link = JRoute::_(Url::record($record)); - } - } - - return $info; - } -} \ No newline at end of file diff --git a/site/plugins/com_communitypolls.plugin.php b/site/plugins/com_communitypolls.plugin.php index 145db828..55601bba 100644 --- a/site/plugins/com_communitypolls.plugin.php +++ b/site/plugins/com_communitypolls.plugin.php @@ -1,46 +1,44 @@ -get('DatabaseDriver'); - - $query = $db->getQuery(true); - $query->select('a.id, a.title, a.alias, a.created_by'); - $query->from('#__jcp_polls AS a'); - $query->where('a.id = ' . (int) $id); - - $db->setQuery($query); - $row = $db->loadObject(); - - $info = new JCommentsObjectInfo(); - - if (!empty($row)) { - $row->slug = $row->alias ? ($row->id.':'.$row->alias) : $row->id; - - $items = JApplication::getMenu('site')->getItems('link', 'index.php?option=com_communitypolls&controller=polls'); - $itemid = isset($items[0]) ? '&Itemid='.$items[0]->id : ''; - - $info->title = $row->title; - $info->userid = $row->created_by; - $info->link = JRoute::_( 'index.php?option=com_communitypolls&controller=polls&task=viewpoll&id='. $row->slug.$itemid); - } - - return $info; - } +getQuery(true); + $query->select('a.id, a.title, a.alias, a.created_by'); + $query->from('#__jcp_polls AS a'); + $query->where('a.id = ' . (int) $id); + + $db->setQuery($query); + $row = $db->loadObject(); + + $info = new JCommentsObjectInfo(); + + if (!empty($row)) { + $row->slug = $row->alias ? ($row->id.':'.$row->alias) : $row->id; + + $items = JApplication::getMenu('site')->getItems('link', 'index.php?option=com_communitypolls&controller=polls'); + $itemid = isset($items[0]) ? '&Itemid='.$items[0]->id : ''; + + $info->title = $row->title; + $info->userid = $row->created_by; + $info->link = JRoute::_( 'index.php?option=com_communitypolls&controller=polls&task=viewpoll&id='. $row->slug.$itemid); + } + + return $info; + } } \ No newline at end of file diff --git a/site/plugins/com_comprofiler.plugin.php b/site/plugins/com_comprofiler.plugin.php index e0f00fe9..68db9237 100644 --- a/site/plugins/com_comprofiler.plugin.php +++ b/site/plugins/com_comprofiler.plugin.php @@ -1,49 +1,47 @@ -get('DatabaseDriver'); - - $query = 'SELECT u.id, u.name, u.username, cb.firstname, cb.lastname, cb.middlename' - . ' FROM #__users AS u ' - . ' JOIN #__comprofiler AS cb ON cb.user_id = u.id ' - . ' WHERE u.id = ' . intval($id) - ; - - $db->setQuery( $query ); - $user = $db->loadObject(); - - $info = new JCommentsObjectInfo(); - - if (!empty($user)) { - $Itemid = self::getItemid('com_comprofiler', 'index.php?option=com_comprofiler'); - $Itemid = $Itemid > 0 ? '&Itemid='.$Itemid : ''; - - $title = trim(preg_replace('#\s+#', ' ', $user->lastname . ' ' . $user->firstname . ' ' . $user->middlename)); - if ($title == '') { - $title = $user->name; - } - - $info->title = $title; - $info->userid = $user->id; - $info->link = JRoute::_('index.php?option=com_comprofiler&task=userProfile&user=' . $user->id . $Itemid); - } - - return $info; - } +setQuery( $query ); + $user = $db->loadObject(); + + $info = new JCommentsObjectInfo(); + + if (!empty($user)) { + $Itemid = self::getItemid('com_comprofiler', 'index.php?option=com_comprofiler'); + $Itemid = $Itemid > 0 ? '&Itemid='.$Itemid : ''; + + $title = trim(preg_replace('#\s+#', ' ', $user->lastname . ' ' . $user->firstname . ' ' . $user->middlename)); + if ($title == '') { + $title = $user->name; + } + + $info->title = $title; + $info->userid = $user->id; + $info->link = JRoute::_('index.php?option=com_comprofiler&task=userProfile&user=' . $user->id . $Itemid); + } + + return $info; + } } \ No newline at end of file diff --git a/site/plugins/com_content.plugin.php b/site/plugins/com_content.plugin.php index f7cd99bc..6f483a5d 100644 --- a/site/plugins/com_content.plugin.php +++ b/site/plugins/com_content.plugin.php @@ -2,25 +2,28 @@ /** * JComments plugin for standart content objects support * - * @version 2.3 - * @package JComments - * @author Sergey M. Litvinov (smart@joomlatune.ru) & exstreme (info@protectyoursite.ru) & Vladimir Globulopolis - * @copyright (C) 2006-2022 by Sergey M. Litvinov (http://www.joomlatune.ru) & exstreme (https://protectyoursite.ru) & Vladimir Globulopolis (https://xn--80aeqbhthr9b.com/ru/) - * @license GNU/GPL: http://www.gnu.org/copyleft/gpl.html + * @version 2.3 + * @package JComments + * @author Sergey M. Litvinov (smart@joomlatune.ru) + * @copyright (C) 2006-2013 by Sergey M. Litvinov (http://www.joomlatune.ru) + * @license GNU/GPL: http://www.gnu.org/copyleft/gpl.html */ +defined('_JEXEC') or die; + +use Joomla\CMS\Access\Access; use Joomla\CMS\Factory; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Uri\Uri; -defined('_JEXEC') or die; +require_once JPATH_ROOT . '/components/com_jcomments/classes/plugin.php'; class jc_com_content extends JCommentsPlugin { function getObjectInfo($id, $language = null) { - $db = Factory::getContainer()->get('DatabaseDriver'); - $article = null; - $link = null; - + $db = Factory::getContainer()->get('DatabaseDriver'); + $link = null; $query = $db->getQuery(true); // Select the required fields from the table. @@ -32,41 +35,47 @@ function getObjectInfo($id, $language = null) $query->join('LEFT', '#__categories AS c ON c.id = a.catid'); $query->where('a.id = ' . (int) $id); - $db->setQuery( $query ); + $db->setQuery($query); $article = $db->loadObject(); - if (!empty($article)) { - $user = JFactory::getUser(); + if (!empty($article)) + { + $user = Factory::getUser(); - $article->slug = $article->alias ? ($article->id.':'.$article->alias) : $article->id; - $article->catslug = $article->category_alias ? ($article->catid.':'.$article->category_alias) : $article->catid; + $article->slug = $article->alias ? ($article->id . ':' . $article->alias) : $article->id; + $article->catslug = $article->category_alias ? ($article->catid . ':' . $article->category_alias) : $article->catid; - $authorised = JAccess::getAuthorisedViewLevels($user->get('id')); + $authorised = Access::getAuthorisedViewLevels($user->get('id')); $checkAccess = in_array($article->access, $authorised); - if ($checkAccess) { - $link = JRoute::_(ContentHelperRoute::getArticleRoute($article->slug, $article->catslug, $article->language)); - } else { - $returnURL = JRoute::_(ContentHelperRoute::getArticleRoute($article->slug, $article->catslug, $article->language)); - $menu = JFactory::getApplication()->getMenu(); - $active = $menu->getActive(); - $ItemId = $active->id; - $link = JRoute::_('index.php?option=com_users&view=login&Itemid=' . $ItemId); - $uri = new JURI($link); + + if ($checkAccess) + { + $link = Route::_(ContentHelperRoute::getArticleRoute($article->slug, $article->catslug, $article->language), false); + } + else + { + $returnURL = Route::_(ContentHelperRoute::getArticleRoute($article->slug, $article->catslug, $article->language)); + $menu = Factory::getApplication()->getMenu(); + $active = $menu->getActive(); + $itemId = $active->id; + $link = Route::_('index.php?option=com_users&view=login&Itemid=' . $itemId); + $uri = new Uri($link); $uri->setVar('return', base64_encode($returnURL)); $link = $uri->toString(); } } - $info = new JCommentsObjectInfo(); + $info = new JCommentsObjectInfo; - if (!empty($article)) { + if (!empty($article)) + { $info->category_id = $article->catid; - $info->title = $article->title; - $info->access = $article->access; - $info->userid = $article->created_by; - $info->link = $link; + $info->title = $article->title; + $info->access = $article->access; + $info->userid = $article->created_by; + $info->link = $link; } return $info; } -} \ No newline at end of file +} diff --git a/site/plugins/com_datsogallery.plugin.php b/site/plugins/com_datsogallery.plugin.php deleted file mode 100644 index f5229a03..00000000 --- a/site/plugins/com_datsogallery.plugin.php +++ /dev/null @@ -1,37 +0,0 @@ -get('DatabaseDriver'); - $db->setQuery('SELECT id, catid, imgtitle, owner_id FROM #__datsogallery WHERE id = ' . $id); - $row = $db->loadObject(); - - if (!empty($row)) { - $Itemid = self::getItemid('com_datsogallery'); - $Itemid = $Itemid > 0 ? '&Itemid='.$Itemid : ''; - - $info->title = $row->imgtitle; - $info->userid = $row->owner_id; - $info->link = JRoute::_('index.php?option=com_datsogallery&func=detail&catid=' . $row->catid . '&id=' . $id . $Itemid); - } - - return $info; - } -} \ No newline at end of file diff --git a/site/plugins/com_digifolio.plugin.php b/site/plugins/com_digifolio.plugin.php deleted file mode 100644 index a1471c68..00000000 --- a/site/plugins/com_digifolio.plugin.php +++ /dev/null @@ -1,46 +0,0 @@ -get('DatabaseDriver'); - $query = $db->getQuery(true); - - $query->select('id, name, alias, created_by, access'); - $query->from('#__digifolio_projects'); - $query->where('id = ' . (int)$id); - $db->setQuery($query); - - $row = $db->loadObject(); - - $info = new JCommentsObjectInfo(); - - if (!empty($row)) { - $Itemid = self::getItemid('com_digifolio'); - $Itemid = $Itemid > 0 ? '&Itemid='.$Itemid : ''; - - $slug = $row->alias ? ($row->id.':'.$row->alias) : $row->id; - - $info->title = $row->name; - $info->access = $row->access; - $info->userid = $row->created_by; - $info->link = JRoute::_('index.php?option=com_digifolio&view=project&id=' . $slug . $Itemid); - } - - return $info; - } -} \ No newline at end of file diff --git a/site/plugins/com_djcatalog.plugin.php b/site/plugins/com_djcatalog.plugin.php index 25cd2f58..17acd48c 100644 --- a/site/plugins/com_djcatalog.plugin.php +++ b/site/plugins/com_djcatalog.plugin.php @@ -1,38 +1,36 @@ -get('DatabaseDriver'); - $db->setQuery('SELECT id, cat_id, name FROM #__djcat_items WHERE id = '.$id); - $row = $db->loadObject(); - - if (!empty($row)) { - $info->title = $row->name; - $info->link = JRoute::_(DJCatalogHelperRoute::getItemRoute($row->id, $row->cat_id)); - } - } - - return $info; - } +setQuery('SELECT id, cat_id, name FROM #__djcat_items WHERE id = '.$id); + $row = $db->loadObject(); + + if (!empty($row)) { + $info->title = $row->name; + $info->link = JRoute::_(DJCatalogHelperRoute::getItemRoute($row->id, $row->cat_id)); + } + } + + return $info; + } } \ No newline at end of file diff --git a/site/plugins/com_djcatalog2.plugin.php b/site/plugins/com_djcatalog2.plugin.php index 464b7b6f..e66f498a 100644 --- a/site/plugins/com_djcatalog2.plugin.php +++ b/site/plugins/com_djcatalog2.plugin.php @@ -1,51 +1,49 @@ -get('DatabaseDriver'); - - $query = $db->getQuery(true); - $query->select('a.id, a.alias, a.name, a.created_by'); - $query->from('#__djc2_items AS a'); - $query->select('c.id AS category_id, c.alias AS category_alias'); - $query->join('LEFT', '#__djc2_categories AS c ON c.id = a.cat_id'); - $query->where('a.id = ' . (int) $id); - - $db->setQuery($query); - $row = $db->loadObject(); - - if (!empty($row)) { - $slug = $row->alias ? ($row->id . ':' . $row->alias) : $row->id; - $catslug = $row->category_alias ? ($row->category_id . ':' . $row->category_alias) : $row->category_id; - - $info->title = $row->name; - $info->category_id = $article->category_id; - $info->userid = $row->created_by; - $info->link = JRoute::_(DJCatalogHelperRoute::getItemRoute($slug, $catslug)); - } - } - - return $info; - } +getQuery(true); + $query->select('a.id, a.alias, a.name, a.created_by'); + $query->from('#__djc2_items AS a'); + $query->select('c.id AS category_id, c.alias AS category_alias'); + $query->join('LEFT', '#__djc2_categories AS c ON c.id = a.cat_id'); + $query->where('a.id = ' . (int) $id); + + $db->setQuery($query); + $row = $db->loadObject(); + + if (!empty($row)) { + $slug = $row->alias ? ($row->id . ':' . $row->alias) : $row->id; + $catslug = $row->category_alias ? ($row->category_id . ':' . $row->category_alias) : $row->category_id; + + $info->title = $row->name; + $info->category_id = $article->category_id; + $info->userid = $row->created_by; + $info->link = JRoute::_(DJCatalogHelperRoute::getItemRoute($slug, $catslug)); + } + } + + return $info; + } } \ No newline at end of file diff --git a/site/plugins/com_djclassifieds.plugin.php b/site/plugins/com_djclassifieds.plugin.php index 684906c4..67e98b3d 100644 --- a/site/plugins/com_djclassifieds.plugin.php +++ b/site/plugins/com_djclassifieds.plugin.php @@ -1,51 +1,49 @@ -get('DatabaseDriver'); - - $query = $db->getQuery(true); - $query->select('a.id, a.alias, a.name, a.user_id'); - $query->from('#__djcf_items AS a'); - $query->select('c.id AS category_id, c.alias AS category_alias'); - $query->join('LEFT', '#__djcf_categories AS c ON c.id = a.cat_id'); - $query->where('a.id = ' . (int) $id); - - $db->setQuery($query); - $row = $db->loadObject(); - - if (!empty($row)) { - $slug = $row->alias ? ($row->id . ':' . $row->alias) : $row->id; - $catslug = $row->category_alias ? ($row->category_id . ':' . $row->category_alias) : $row->category_id; - - $info->title = $row->name; - $info->category_id = $row->category_id; - $info->userid = $row->user_id; - $info->link = JRoute::_(DJClassifiedsSEO::getItemRoute($slug, $catslug)); - } - } - - return $info; - } +getQuery(true); + $query->select('a.id, a.alias, a.name, a.user_id'); + $query->from('#__djcf_items AS a'); + $query->select('c.id AS category_id, c.alias AS category_alias'); + $query->join('LEFT', '#__djcf_categories AS c ON c.id = a.cat_id'); + $query->where('a.id = ' . (int) $id); + + $db->setQuery($query); + $row = $db->loadObject(); + + if (!empty($row)) { + $slug = $row->alias ? ($row->id . ':' . $row->alias) : $row->id; + $catslug = $row->category_alias ? ($row->category_id . ':' . $row->category_alias) : $row->category_id; + + $info->title = $row->name; + $info->category_id = $row->category_id; + $info->userid = $row->user_id; + $info->link = JRoute::_(DJClassifiedsSEO::getItemRoute($slug, $catslug)); + } + } + + return $info; + } } \ No newline at end of file diff --git a/site/plugins/com_docman.plugin.php b/site/plugins/com_docman.plugin.php index 6d1231f7..24e0fe94 100644 --- a/site/plugins/com_docman.plugin.php +++ b/site/plugins/com_docman.plugin.php @@ -1,86 +1,84 @@ -get('DatabaseDriver'); - $db->setQuery( 'SELECT dmname, id FROM #__docman WHERE id = ' . $id ); - return $db->loadResult(); - } - - function getObjectLink($id) - { - static $_Itemid = null; - - if (!isset($_Itemid)) { - $needles = array('gid' => (int) $id); - if ($item = self::_findItem($needles)) { - $_Itemid = $item->id; - } else { - $_Itemid = ''; - } - } - - include_once(JPATH_SITE.DS.'includes'.DS.'application.php'); - - $link = 'index.php?option=com_docman&task=doc_details&gid=' . $id; - - if ($_Itemid != '') { - $link .= '&Itemid=' . $_Itemid; - }; - - $router = JPATH_SITE . DS . 'components' . DS . 'com_docman' . DS . 'router.php'; - if (is_file($router)) { - include_once($router); - } - $link = JRoute::_($link); - - return $link; - } - - function getObjectOwner($id) - { - $db = Factory::getContainer()->get('DatabaseDriver'); - $db->setQuery( 'SELECT dmsubmitedby FROM #__docman WHERE id = ' . $id ); - $userid = $db->loadResult(); - - return $userid; - } - - protected static function _findItem($needles) - { - $component = JComponentHelper::getComponent('com_docman'); - - $menus = JApplication::getMenu('site'); - $items = $menus->getItems('componentid', $component->id); - $user = JFactory::getUser(); - $access = (int)$user->get('aid'); - - foreach ($needles as $needle => $id) { - if (is_array($items)) { - foreach ($items as $item) { - if ($item->published == 1 && $item->access <= $access) { - return $item; - } - } - } - } - - return false; - } - +setQuery( 'SELECT dmname, id FROM #__docman WHERE id = ' . $id ); + return $db->loadResult(); + } + + function getObjectLink($id) + { + static $_Itemid = null; + + if (!isset($_Itemid)) { + $needles = array('gid' => (int) $id); + if ($item = self::_findItem($needles)) { + $_Itemid = $item->id; + } else { + $_Itemid = ''; + } + } + + include_once(JPATH_SITE.'/includes/application.php'); + + $link = 'index.php?option=com_docman&task=doc_details&gid=' . $id; + + if ($_Itemid != '') { + $link .= '&Itemid=' . $_Itemid; + }; + + $router = JPATH_SITE.'/components/com_docman/router.php'; + if (is_file($router)) { + include_once($router); + } + $link = JRoute::_($link); + + return $link; + } + + function getObjectOwner($id) + { + $db = JFactory::getDbo(); + $db->setQuery( 'SELECT dmsubmitedby FROM #__docman WHERE id = ' . $id ); + $userid = $db->loadResult(); + + return $userid; + } + + protected static function _findItem($needles) + { + $component = JComponentHelper::getComponent('com_docman'); + + $menus = JApplication::getMenu('site'); + $items = $menus->getItems('componentid', $component->id); + $user = JFactory::getUser(); + $access = (int)$user->get('aid'); + + foreach ($needles as $needle => $id) { + if (is_array($items)) { + foreach ($items as $item) { + if ($item->published == 1 && $item->access <= $access) { + return $item; + } + } + } + } + + return false; + } + } \ No newline at end of file diff --git a/site/plugins/com_easyblog.plugin.php b/site/plugins/com_easyblog.plugin.php index d4d289c3..b9b18807 100644 --- a/site/plugins/com_easyblog.plugin.php +++ b/site/plugins/com_easyblog.plugin.php @@ -1,40 +1,38 @@ -get('DatabaseDriver'); - $db->setQuery('SELECT id, title, created_by, category_id FROM #__easyblog_post WHERE id = ' . $id); - $row = $db->loadObject(); - - if (!empty($row)) { - $info->category_id = $row->category_id; - $info->title = $row->title; - $info->userid = $row->created_by; - $info->link = EasyBlogRouter::_('index.php?option=com_easyblog&view=entry&id=' . $id); - } - } - - return $info; - } +setQuery('SELECT id, title, created_by, category_id FROM #__easyblog_post WHERE id = ' . $id); + $row = $db->loadObject(); + + if (!empty($row)) { + $info->category_id = $row->category_id; + $info->title = $row->title; + $info->userid = $row->created_by; + $info->link = EasyBlogRouter::_('index.php?option=com_easyblog&view=entry&id=' . $id); + } + } + + return $info; + } } \ No newline at end of file diff --git a/site/plugins/com_eventgallery.plugin.php b/site/plugins/com_eventgallery.plugin.php index 5d8446be..a2e1fa1a 100644 --- a/site/plugins/com_eventgallery.plugin.php +++ b/site/plugins/com_eventgallery.plugin.php @@ -1,37 +1,35 @@ -get('DatabaseDriver'); - $db->setQuery("SELECT id, title, file, folder, userid FROM #__eventgallery_file WHERE id = " . $id); - $row = $db->loadObject(); - - $info = new JCommentsObjectInfo(); - - if (!empty($row)) { - $Itemid = self::getItemid('com_eventgallery'); - $Itemid = $_Itemid > 0 ? '&Itemid=' . $Itemid : ''; - - $info->title = $row->title; - $info->userid = $row->created_by; - $info->link = JRoute::_('index.php?option=com_eventgallery&view=singleimage&folder='. $row->folder . '&file=' . $row->file . $Itemid); - } - - return $info; - } +setQuery("SELECT id, title, file, folder, userid FROM #__eventgallery_file WHERE id = " . $id); + $row = $db->loadObject(); + + $info = new JCommentsObjectInfo(); + + if (!empty($row)) { + $Itemid = self::getItemid('com_eventgallery'); + $Itemid = $_Itemid > 0 ? '&Itemid=' . $Itemid : ''; + + $info->title = $row->title; + $info->userid = $row->created_by; + $info->link = JRoute::_('index.php?option=com_eventgallery&view=singleimage&folder='. $row->folder . '&file=' . $row->file . $Itemid); + } + + return $info; + } } \ No newline at end of file diff --git a/site/plugins/com_eventlist.plugin.php b/site/plugins/com_eventlist.plugin.php deleted file mode 100644 index fe9b834f..00000000 --- a/site/plugins/com_eventlist.plugin.php +++ /dev/null @@ -1,57 +0,0 @@ -get('DatabaseDriver'); - $db->setQuery( 'SELECT title, id FROM #__eventlist_events WHERE id = ' . $id ); - return $db->loadResult(); - } - - function getObjectLink($id) - { - $db = Factory::getContainer()->get('DatabaseDriver'); - - $query = 'SELECT a.id, CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(\':\', a.id, a.alias) ELSE a.id END as slug' - . ' FROM #__eventlist_events AS a' - . ' WHERE id = ' . $id - ; - $db->setQuery($query); - $slug = $db->loadResult(); - - require_once(JPATH_SITE.'/includes/application.php'); - - $eventListRouter = JPATH_SITE.'/components/com_eventlist/helpers/route.php'; - if (is_file($eventListRouter)) { - require_once($eventListRouter); - $link = JRoute::_( EventListHelperRoute::getRoute($slug) ); - } else { - $link = JRoute::_( 'index.php?option=com_eventlist&view=details&id=' . $slug ); - } - - return $link; - } - - function getObjectOwner($id) { - - $db = Factory::getContainer()->get('DatabaseDriver'); - $db->setQuery( 'SELECT created_by, id FROM #__eventlist_events WHERE id = ' . $id ); - $userid = $db->loadResult(); - - return $userid; - } -} \ No newline at end of file diff --git a/site/plugins/com_flexicontent.plugin.php b/site/plugins/com_flexicontent.plugin.php index bd507229..8a7c2b07 100644 --- a/site/plugins/com_flexicontent.plugin.php +++ b/site/plugins/com_flexicontent.plugin.php @@ -1,49 +1,47 @@ -get('DatabaseDriver'); - $query = 'SELECT i.id, i.title, i.access, i.created_by ' - . ' , CASE WHEN CHAR_LENGTH(i.alias) THEN CONCAT_WS(\':\', i.id, i.alias) ELSE i.id END as slug' - . ' , CASE WHEN CHAR_LENGTH(c.alias) THEN CONCAT_WS(\':\', c.id, c.alias) ELSE c.id END as catslug' - . ' FROM #__content AS i' - . ' LEFT JOIN #__categories AS c ON c.id = i.catid' - . ' WHERE i.id = '.$id - ; - $db->setQuery($query); - $row = $db->loadObject(); - - if (!empty($row)) { - $info->category_id = $row->catid; - $info->title = $row->title; - $info->access = $row->access; - $info->userid = $row->created_by; - $info->link = JRoute::_(FlexicontentHelperRoute::getItemRoute($row->slug, $row->catslug)); - } - } - - return $info; - } +setQuery($query); + $row = $db->loadObject(); + + if (!empty($row)) { + $info->category_id = $row->catid; + $info->title = $row->title; + $info->access = $row->access; + $info->userid = $row->created_by; + $info->link = JRoute::_(FlexicontentHelperRoute::getItemRoute($row->slug, $row->catslug)); + } + } + + return $info; + } } \ No newline at end of file diff --git a/site/plugins/com_flippingbook.plugin.php b/site/plugins/com_flippingbook.plugin.php index 20e4386c..4a9af757 100644 --- a/site/plugins/com_flippingbook.plugin.php +++ b/site/plugins/com_flippingbook.plugin.php @@ -4,20 +4,18 @@ * * @version 2.0 * @package JComments - * @author Sergey M. Litvinov (smart@joomlatune.ru) & exstreme (info@protectyoursite.ru) & Vladimir Globulopolis - * @copyright (C) 2006-2022 by Sergey M. Litvinov (http://www.joomlatune.ru) & exstreme (https://protectyoursite.ru) & Vladimir Globulopolis (https://xn--80aeqbhthr9b.com/ru/) + * @author Sergey M. Litvinov (smart@joomlatune.ru) + * @copyright (C) 2006-2013 by Sergey M. Litvinov (http://www.joomlatune.ru) * @license GNU/GPL: http://www.gnu.org/copyleft/gpl.html */ -use Joomla\CMS\Factory; - defined('_JEXEC') or die; class jc_com_flippingbook extends JCommentsPlugin { function getObjectTitle($id) { - $db = Factory::getContainer()->get('DatabaseDriver'); + $db = JFactory::getDbo(); $db->setQuery( "SELECT title, id FROM #__flippingbook_books WHERE id = $id" ); return $db->loadResult(); } @@ -26,7 +24,7 @@ function getObjectLink($id) { $_Itemid = self::getItemid( 'com_flippingbook' ); - $db = Factory::getContainer()->get('DatabaseDriver'); + $db = JFactory::getDbo(); $id = intval($id); $query = 'SELECT b.id,' . diff --git a/site/plugins/com_fwgallery.plugin.php b/site/plugins/com_fwgallery.plugin.php index c7293ad0..ca67222e 100644 --- a/site/plugins/com_fwgallery.plugin.php +++ b/site/plugins/com_fwgallery.plugin.php @@ -1,64 +1,62 @@ -get('DatabaseDriver'); - $db->setQuery('SELECT id, name, user_id FROM #__fwg_files WHERE id = ' . $id); - $row = $db->loadObject(); - - $info = new JCommentsObjectInfo(); - - if (!empty($row)) { - $_Itemid = self::_getItemid('image'); - $_Itemid = (intval($_Itemid) ? '&Itemid=' . $_Itemid : ''); - - $info->title = $row->name; - $info->userid = $row->user_id; - $info->link = JRoute::_('index.php?option=com_fwgallery&view=image&id=' . $row->id . ':' . JFilterOutput::stringURLSafe($row->name) . $_Itemid . '#fwgallerytop'); - } - - return $info; - } - - protected static function _getItemid($view = 'galleries', $id = 0, $default = 0) - { - $item = null; - $menu = JMenu::getInstance('site'); - - if ($id && $items = $menu->getItems('link', 'index.php?option=com_fwgallery&view=' . $view)) { - foreach ($items as $menuItem) { - if ((is_string($menuItem->params) && preg_match('/id\='.$id.'\s/ms', $menuItem->params)) || (is_object($menuItem->params) && $id == $menuItem->params->get('id'))) { - $item = $menuItem; - break; - } - } - } - - if ($item === null) { - $item = $menu->getItems('link', 'index.php?option=com_fwgallery&view=galleries', true); - } - - if ($item) { - return $item->id; - } elseif ($default) { - return $default; - } elseif ($item = $menu->getActive()) { - return $item->id; - } - } +setQuery('SELECT id, name, user_id FROM #__fwg_files WHERE id = ' . $id); + $row = $db->loadObject(); + + $info = new JCommentsObjectInfo(); + + if (!empty($row)) { + $_Itemid = self::_getItemid('image'); + $_Itemid = (intval($_Itemid) ? '&Itemid=' . $_Itemid : ''); + + $info->title = $row->name; + $info->userid = $row->user_id; + $info->link = JRoute::_('index.php?option=com_fwgallery&view=image&id=' . $row->id . ':' . JFilterOutput::stringURLSafe($row->name) . $_Itemid . '#fwgallerytop'); + } + + return $info; + } + + protected static function _getItemid($view = 'galleries', $id = 0, $default = 0) + { + $item = null; + $menu = JMenu::getInstance('site'); + + if ($id && $items = $menu->getItems('link', 'index.php?option=com_fwgallery&view=' . $view)) { + foreach ($items as $menuItem) { + if ((is_string($menuItem->params) && preg_match('/id\='.$id.'\s/ms', $menuItem->params)) || (is_object($menuItem->params) && $id == $menuItem->params->get('id'))) { + $item = $menuItem; + break; + } + } + } + + if ($item === null) { + $item = $menu->getItems('link', 'index.php?option=com_fwgallery&view=galleries', true); + } + + if ($item) { + return $item->id; + } elseif ($default) { + return $default; + } elseif ($item = $menu->getActive()) { + return $item->id; + } + } } \ No newline at end of file diff --git a/site/plugins/com_galleric.plugin.php b/site/plugins/com_galleric.plugin.php deleted file mode 100644 index 5547c14d..00000000 --- a/site/plugins/com_galleric.plugin.php +++ /dev/null @@ -1,37 +0,0 @@ -get('DatabaseDriver'); - $db->setQuery('SELECT name, alias FROM #__galleric_category WHERE id = ' . $id); - $row = $db->loadObject(); - - if (!empty($row)) { - $Itemid = self::getItemid('com_galleric'); - $Itemid = $Itemid > 0 ? '&Itemid='.$Itemid : ''; - - $info->title = $row->name; - $info->link = JRoute::_('index.php?option=com_galleric&view=galleric&layout=lightbox&catid=' . $id . ':' . JApplication::stringURLSafe($row->alias) . $Itemid); - } - - return $info; - } -} \ No newline at end of file diff --git a/site/plugins/com_groupjive.plugin.php b/site/plugins/com_groupjive.plugin.php deleted file mode 100644 index a65af403..00000000 --- a/site/plugins/com_groupjive.plugin.php +++ /dev/null @@ -1,46 +0,0 @@ -get('DatabaseDriver'); - $db->setQuery( 'SELECT subject FROM #__gj_bul WHERE id = ' . $id ); - return $db->loadResult(); - } - - function getObjectLink($id) - { - $Itemid = self::getItemid('com_groupjive'); - $Itemid = $Itemid > 0 ? '&Itemid=' . $Itemid : ''; - - $db = Factory::getContainer()->get('DatabaseDriver'); - $db->setQuery( 'SELECT group_id FROM #__gj_bul WHERE id = ' . $id ); - $gid = $db->loadResult(); - - $link = JRoute::_('index.php?option=com_groupjive&task=showfullmessage&idm=' . $id . '&groupid=' . $gid . $Itemid); - return $link; - } - - function getObjectOwner($id) - { - $db = Factory::getContainer()->get('DatabaseDriver'); - $db->setQuery( 'SELECT author_id FROM #__gj_bul WHERE id = ' . $id ); - $userid = $db->loadResult(); - - return $userid; - } -} \ No newline at end of file diff --git a/site/plugins/com_hekimablog.plugin.php b/site/plugins/com_hekimablog.plugin.php deleted file mode 100644 index e11b6265..00000000 --- a/site/plugins/com_hekimablog.plugin.php +++ /dev/null @@ -1,44 +0,0 @@ -get('DatabaseDriver'); - $query = "SELECT i.id, i.title, i.created_by, i.access, i.catid" - . " , CASE WHEN CHAR_LENGTH(i.alias) THEN CONCAT_WS(':', i.id, i.alias) ELSE i.id END as alias" - . " FROM #__content as i" - . " WHERE i.id = " . $id; - $db->setQuery($query); - $row = $db->loadObject(); - - $info = new JCommentsObjectInfo(); - - if (!empty($row)) { - $Itemid = self::getItemid('com_hekimablog'); - $Itemid = $Itemid > 0 ? '&Itemid='.$Itemid : ''; - - $info->category_id = $row->catid; - $info->title = $row->title; - $info->access = $row->access; - $info->userid = $row->created_by; - $info->link = JRoute::_('index.php?option=com_hekimablog&article='.$row->alias.$Itemid); - } - - return $info; - } -} \ No newline at end of file diff --git a/site/plugins/com_hekimablog_users.plugin.php b/site/plugins/com_hekimablog_users.plugin.php deleted file mode 100644 index 2ad0a5a3..00000000 --- a/site/plugins/com_hekimablog_users.plugin.php +++ /dev/null @@ -1,42 +0,0 @@ -get('DatabaseDriver'); - $query = "SELECT i.id, i.name, i.username" - . " , CONCAT_WS(':', i.id, i.username) as alias" - . " FROM #__users as i" - . " WHERE i.id = " . $id; - $db->setQuery($query); - $row = $db->loadObject(); - - $info = new JCommentsObjectInfo(); - - if (!empty($row)) { - $Itemid = self::getItemid('com_hekimablog'); - $Itemid = $Itemid > 0 ? '&Itemid='.$Itemid : ''; - - $info->title = $row->name; - $info->userid = $row->id; - $info->link = JRoute::_('index.php?option=com_hekimablog&view=profile&user='.$row->alias.$Itemid); - } - - return $info; - } -} \ No newline at end of file diff --git a/site/plugins/com_hikashop.plugin.php b/site/plugins/com_hikashop.plugin.php index fde77cb1..4762ac17 100644 --- a/site/plugins/com_hikashop.plugin.php +++ b/site/plugins/com_hikashop.plugin.php @@ -1,70 +1,68 @@ -get('DatabaseDriver'); - $db->setQuery( 'SELECT a.product_name as name, a.product_id as id, b.product_name as parent_name FROM #__hikashop_product AS a LEFT JOIN #__hikashop_product AS b ON a.product_parent_id=b.product_id WHERE a.product_id = ' . $id ); - $obj = $db->loadObject(); - $name = @$obj->name; - - if (empty($name)) { - $name = @$obj->parent_name; - } - - if (empty($name)) { - $name = $id; - } - - return $name; - } - - function getObjectLink($id) - { - $Itemid = self::getItemid('com_hikashop'); - $Itemid = $Itemid > 0 ? '&Itemid='.$Itemid : ''; - - $link = JRoute::_('index.php?option=com_hikashop&ctrl=product&task=show&cid=' . $id . $Itemid); - return $link; - } - - function getObjectOwner($id) - { - $db = Factory::getContainer()->get('DatabaseDriver'); - $db->setQuery( 'SELECT a.product_vendor_id as created_by, a.product_id as id, b.product_vendor_id as parent_created_by FROM #__hikashop_product AS a LEFT JOIN #__hikashop_product AS b ON a.product_parent_id=b.product_id WHERE a.product_id = ' . $id ); - $obj = $db->loadObject(); - $id = @$obj->created_by; - - if (empty($id)) { - $id = @$obj->parent_created_by; - } - - if (!empty($id)) { - $db->setQuery( 'SELECT user_cms_id FROM #__hikashop_user WHERE user_id = ' . $id ); - $id = $db->loadResult(); - } - - if (empty($id)) { - $app = JFactory::getApplication(); - if (JCommentsSystemPluginHelper::isAdmin($app)) { - $user =& JFactory::getUser(); - $id = $user->id; - } - } - return (int)$id; - } +setQuery( 'SELECT a.product_name as name, a.product_id as id, b.product_name as parent_name FROM #__hikashop_product AS a LEFT JOIN #__hikashop_product AS b ON a.product_parent_id=b.product_id WHERE a.product_id = ' . $id ); + $obj = $db->loadObject(); + $name = @$obj->name; + + if (empty($name)) { + $name = @$obj->parent_name; + } + + if (empty($name)) { + $name = $id; + } + + return $name; + } + + function getObjectLink($id) + { + $Itemid = self::getItemid('com_hikashop'); + $Itemid = $Itemid > 0 ? '&Itemid='.$Itemid : ''; + + $link = JRoute::_('index.php?option=com_hikashop&ctrl=product&task=show&cid=' . $id . $Itemid); + return $link; + } + + function getObjectOwner($id) + { + $db = JFactory::getDBO(); + $db->setQuery( 'SELECT a.product_vendor_id as created_by, a.product_id as id, b.product_vendor_id as parent_created_by FROM #__hikashop_product AS a LEFT JOIN #__hikashop_product AS b ON a.product_parent_id=b.product_id WHERE a.product_id = ' . $id ); + $obj = $db->loadObject(); + $id = @$obj->created_by; + + if (empty($id)) { + $id = @$obj->parent_created_by; + } + + if (!empty($id)) { + $db->setQuery( 'SELECT user_cms_id FROM #__hikashop_user WHERE user_id = ' . $id ); + $id = $db->loadResult(); + } + + if (empty($id)) { + $app = JFactory::getApplication(); + if ($app->isAdmin()) { + $user =& JFactory::getUser(); + $id = $user->id; + } + } + return (int)$id; + } } \ No newline at end of file diff --git a/site/plugins/com_hwdmediashare.plugin.php b/site/plugins/com_hwdmediashare.plugin.php deleted file mode 100644 index e97ee486..00000000 --- a/site/plugins/com_hwdmediashare.plugin.php +++ /dev/null @@ -1,42 +0,0 @@ -get('DatabaseDriver'); - $db->setQuery('SELECT id, title, access, created_user_id FROM #__hwdms_media WHERE id = ' . $id); - $row = $db->loadObject(); - - if (!empty($row)) { - $slug = $row->alias ? ($row->id . ':' . $row->alias) : $row->id; - - $info->title = $row->title ? 'Unknown hwdMediaShare Content' : $row->title; - $info->userid = $row->created_user_id; - $info->access = $row->access; - $info->link = JRoute::_(hwdMediaShareHelperRoute::getMediaItemRoute($slug)); - } - } - - return $info; - } -} \ No newline at end of file diff --git a/site/plugins/com_hwdmediashare_group.plugin.php b/site/plugins/com_hwdmediashare_group.plugin.php deleted file mode 100644 index 0c89f07d..00000000 --- a/site/plugins/com_hwdmediashare_group.plugin.php +++ /dev/null @@ -1,42 +0,0 @@ -get('DatabaseDriver'); - $db->setQuery('SELECT id, title, access, created_user_id FROM #__hwdms_groups WHERE id = ' . $id); - $row = $db->loadObject(); - - if (!empty($row)) { - $slug = $row->alias ? ($row->id . ':' . $row->alias) : $row->id; - - $info->title = $row->title ? 'Unknown hwdMediaShare Content' : $row->title; - $info->userid = $row->created_user_id; - $info->access = $row->access; - $info->link = JRoute::_(hwdMediaShareHelperRoute::getGroupRoute($slug)); - } - } - - return $info; - } -} \ No newline at end of file diff --git a/site/plugins/com_icagenda.plugin.php b/site/plugins/com_icagenda.plugin.php index dc9b831a..2b2c6160 100644 --- a/site/plugins/com_icagenda.plugin.php +++ b/site/plugins/com_icagenda.plugin.php @@ -1,45 +1,43 @@ -get('DatabaseDriver'); - $query = $db->getQuery(true); - $query->select('id, title, access, created_by, alias'); - $query->from('#__icagenda_events'); - $query->where('id = ' . (int) $id); - $db->setQuery( $query ); - $row = $db->loadObject(); - - $info = new JCommentsObjectInfo(); - - if (!empty($row)) { - $Itemid = self::getItemid('com_icagenda', 'index.php?option=com_icagenda&view=list'); - $Itemid = $Itemid > 0 ? '&Itemid='.$Itemid : ''; - - $row->slug = $row->alias ? ($row->id.':'.$row->alias) : $row->id; - - $info->title = $row->title; - $info->access = $row->access; - $info->userid = $row->created_by; - $info->link = JRoute::_('index.php?option=com_icagenda&view=list&layout=event&id=' . $row->slug . $Itemid); - } - - return $info; - } +getQuery(true); + $query->select('id, title, access, created_by, alias'); + $query->from('#__icagenda_events'); + $query->where('id = ' . (int) $id); + $db->setQuery( $query ); + $row = $db->loadObject(); + + $info = new JCommentsObjectInfo(); + + if (!empty($row)) { + $Itemid = self::getItemid('com_icagenda', 'index.php?option=com_icagenda&view=list'); + $Itemid = $Itemid > 0 ? '&Itemid='.$Itemid : ''; + + $row->slug = $row->alias ? ($row->id.':'.$row->alias) : $row->id; + + $info->title = $row->title; + $info->access = $row->access; + $info->userid = $row->created_by; + $info->link = JRoute::_('index.php?option=com_icagenda&view=list&layout=event&id=' . $row->slug . $Itemid); + } + + return $info; + } } \ No newline at end of file diff --git a/site/plugins/com_improvemycity.plugin.php b/site/plugins/com_improvemycity.plugin.php deleted file mode 100644 index b8ccb507..00000000 --- a/site/plugins/com_improvemycity.plugin.php +++ /dev/null @@ -1,46 +0,0 @@ -get('DatabaseDriver'); - $query = $db->getQuery(true); - - $query->select('a.id, a.title, a.userid, a.catid'); - $query->from('#__improvemycity AS a'); - $query->where('a.id = ' . (int) $id); - - $db->setQuery($query); - $row = $db->loadObject(); - - if (!empty($row)) { - $Itemid = self::getItemid('com_improvemycity'); - $Itemid = $Itemid > 0 ? '&Itemid='.$Itemid : ''; - - $info->category_id = $row->catid; - $info->title = $row->title; - $info->userid = $row->userid; - $info->link = JRoute::_('index.php?option=com_improvemycity&view=issue&issue_id=' . (int) $id . $Itemid); - } - } - - return $info; - } -} \ No newline at end of file diff --git a/site/plugins/com_javoice.plugin.php b/site/plugins/com_javoice.plugin.php deleted file mode 100644 index 438d4d18..00000000 --- a/site/plugins/com_javoice.plugin.php +++ /dev/null @@ -1,46 +0,0 @@ -get('DatabaseDriver'); - $db->setQuery('SELECT title, id FROM #__jav_items WHERE id = '.$id); - return $db->loadResult(); - } - - function getObjectLink($id) - { - $_Itemid = self::getItemid('com_javoice'); - - //get type_id - $db = Factory::getContainer()->get('DatabaseDriver'); - $db->setQuery('SELECT voice_types_id FROM #__jav_items WHERE id = '.$id); - $type_id = $db->loadResult(); - - $link = JRoute::_('index.php?option=com_javoice&view=items&layout=item&cid='.$id.'&type='.$type_id.'&Itemid='.$_Itemid); - return $link; - } - - function getObjectOwner($id) - { - $db = Factory::getContainer()->get('DatabaseDriver'); - $db->setQuery('SELECT user_id FROM #__jav_items WHERE id = '.$id); - $userid = (int) $db->loadResult(); - - return $userid; - } -} \ No newline at end of file diff --git a/site/plugins/com_jcollection.plugin.php b/site/plugins/com_jcollection.plugin.php deleted file mode 100644 index 025ba89d..00000000 --- a/site/plugins/com_jcollection.plugin.php +++ /dev/null @@ -1,42 +0,0 @@ -get('DatabaseDriver'); - $db->setQuery( 'SELECT name, id FROM #__jc WHERE id = ' . $id ); - return $db->loadResult(); - } - - function getObjectLink($id) - { - $link = 'index.php?option=com_jcollection&view=item&id=' . $id; - $_Itemid = self::getItemid('com_jcollection'); - $link .= $_Itemid > 0 ? '&Itemid=' . $_Itemid : ''; - $link = JRoute::_( $link ); - return $link; - } - - function getObjectOwner($id) - { - $db = Factory::getContainer()->get('DatabaseDriver'); - $db->setQuery( 'SELECT created_by, id FROM #__jc WHERE id = ' . $id ); - $userid = $db->loadResult(); - - return $userid; - } -} \ No newline at end of file diff --git a/site/plugins/com_jcomments.plugin.php b/site/plugins/com_jcomments.plugin.php index 7a2faecd..702bb845 100644 --- a/site/plugins/com_jcomments.plugin.php +++ b/site/plugins/com_jcomments.plugin.php @@ -1,56 +1,54 @@ -params); - - $info->title = $params->get('page_title') ? $params->get('page_title') : $menu->title; - $info->access = $menu->access; - $info->link = JRoute::_('index.php?option=com_jcomments&Itemid='.$menu->id); - $info->userid = 0; - } - - return $info; - } - - protected static function getMenuItem($id) - { - $db = Factory::getContainer()->get('DatabaseDriver'); - - $query = "SELECT m.*" - . " FROM `#__menu` AS m" - . " JOIN `#__extensions` AS e ON m.component_id = e.extension_id" - . " WHERE m.type = 'component'" - . " AND e.element = 'com_jcomments'" - . " AND m.published = 1" - . " AND m.parent_id > 0" - . " AND m.client_id = 0" - . " AND m.params LIKE '%\"object_id\":\"" . $id . "\"%'" - ; - - $db->setQuery($query, 0, 1); - $menus = $db->loadObjectList(); - - return count($menus) ? $menus[0] : null; - } +params); + + $info->title = $params->get('page_title') ? $params->get('page_title') : $menu->title; + $info->access = $menu->access; + $info->link = JRoute::_('index.php?option=com_jcomments&Itemid='.$menu->id); + $info->userid = 0; + } + + return $info; + } + + protected static function getMenuItem($id) + { + $db = JFactory::getDBO(); + + $query = "SELECT m.*" + . " FROM `#__menu` AS m" + . " JOIN `#__extensions` AS e ON m.component_id = e.extension_id" + . " WHERE m.type = 'component'" + . " AND e.element = 'com_jcomments'" + . " AND m.published = 1" + . " AND m.parent_id > 0" + . " AND m.client_id = 0" + . " AND m.params LIKE '%\"object_id\":\"" . $id . "\"%'" + ; + + $db->setQuery($query, 0, 1); + $menus = $db->loadObjectList(); + + return count($menus) ? $menus[0] : null; + } } \ No newline at end of file diff --git a/site/plugins/com_jdownloads.plugin.php b/site/plugins/com_jdownloads.plugin.php index e40d369c..7244124f 100644 --- a/site/plugins/com_jdownloads.plugin.php +++ b/site/plugins/com_jdownloads.plugin.php @@ -1,47 +1,45 @@ -get('DatabaseDriver'); - $query = "SELECT file_id as id, file_title as title, submitted_by as owner, cat_id" - . " FROM #__jdownloads_files" - . " WHERE file_id = " . $id; - $db->setQuery($query); - $row = $db->loadObject(); - - $info = new JCommentsObjectInfo(); - - if (!empty($row)) { - $db->setQuery("SELECT id FROM #__menu WHERE link = 'index.php?option=com_jdownloads&view=viewcategory&catid=".$row->cat_id."' and published = 1"); - $Itemid = $db->loadResult(); - - if (!$Itemid) { - $Itemid = self::getItemid('com_jdownloads'); - } - - $Itemid = $Itemid > 0 ? '&Itemid='.$Itemid : ''; - - $info->category_id = $row->cat_id; - $info->title = $row->title; - $info->userid = $row->owner; - $info->link = JRoute::_('index.php?option=com_jdownloads'.$Itemid.'&view=viewdownload&catid='.$row->cat_id.'&cid='.$id); - } - - return $info; - } +setQuery($query); + $row = $db->loadObject(); + + $info = new JCommentsObjectInfo(); + + if (!empty($row)) { + $db->setQuery("SELECT id FROM #__menu WHERE link = 'index.php?option=com_jdownloads&view=viewcategory&catid=".$row->cat_id."' and published = 1"); + $Itemid = $db->loadResult(); + + if (!$Itemid) { + $Itemid = self::getItemid('com_jdownloads'); + } + + $Itemid = $Itemid > 0 ? '&Itemid='.$Itemid : ''; + + $info->category_id = $row->cat_id; + $info->title = $row->title; + $info->userid = $row->owner; + $info->link = JRoute::_('index.php?option=com_jdownloads'.$Itemid.'&view=viewdownload&catid='.$row->cat_id.'&cid='.$id); + } + + return $info; + } } \ No newline at end of file diff --git a/site/plugins/com_jea.plugin.php b/site/plugins/com_jea.plugin.php deleted file mode 100644 index 8f535257..00000000 --- a/site/plugins/com_jea.plugin.php +++ /dev/null @@ -1,44 +0,0 @@ -get('DatabaseDriver'); - - $query = "SELECT id, alias, title, access, created_by" - . " FROM #__jea_properties" - . " WHERE id = " . $id; - $db->setQuery($query); - $row = $db->loadObject(); - - $info = new JCommentsObjectInfo(); - - if (!empty($row)) { - $Itemid = self::getItemid('com_jea'); - $Itemid = $Itemid > 0 ? '&Itemid=' . $Itemid : ''; - - $slug = $row->alias ? ($row->id . ':' . $row->alias) : $row->id; - - $info->title = $row->title; - $info->userid = $row->created_by; - $info->access = $row->access; - $info->link = JRoute::_('index.php?option=com_jea&view=property&id='. $slug . $Itemid); - } - - return $info; - } -} \ No newline at end of file diff --git a/site/plugins/com_jevents.plugin.php b/site/plugins/com_jevents.plugin.php index 634249a3..053d2bd2 100644 --- a/site/plugins/com_jevents.plugin.php +++ b/site/plugins/com_jevents.plugin.php @@ -1,42 +1,40 @@ -get('DatabaseDriver'); - - $query = 'SELECT det.summary, rpt.rp_id, ev.created_by, ev.access' - . ' FROM #__jevents_repetition AS rpt ' - . ' LEFT JOIN #__jevents_vevdetail AS det ON det.evdet_id = rpt.eventdetail_id ' - . ' LEFT JOIN #__jevents_vevent AS ev ON ev.ev_id = rpt.eventid ' - . ' WHERE ev.ev_id = ' . $id; - - $db->setQuery($query); - $row = $db->loadObject(); - - if (!empty($row)) { - $info->title = $row->summary; - $info->access = $row->access; - $info->userid = $row->created_by; - $info->link = JRoute::_( 'index.php?option=com_jevents&task=icalrepeat.detail&evid=' . $row->rp_id ); - } - - return $info; - } +setQuery($query); + $row = $db->loadObject(); + + if (!empty($row)) { + $info->title = $row->summary; + $info->access = $row->access; + $info->userid = $row->created_by; + $info->link = JRoute::_( 'index.php?option=com_jevents&task=icalrepeat.detail&evid=' . $row->rp_id ); + } + + return $info; + } } \ No newline at end of file diff --git a/site/plugins/com_jmylife.plugin.php b/site/plugins/com_jmylife.plugin.php deleted file mode 100644 index 751d8a11..00000000 --- a/site/plugins/com_jmylife.plugin.php +++ /dev/null @@ -1,53 +0,0 @@ -get('DatabaseDriver'); - $db->setQuery( "SELECT CASE WHEN title IS NULL OR title = '' THEN SUBSTRING(`fulltext`, 1, 20) ELSE `title` END as title, id FROM #__jmylife_stories WHERE id = " . $id ); - return $db->loadResult(); - } - - function getObjectLink($id) - { - $db = Factory::getContainer()->get('DatabaseDriver'); - $db->setQuery( 'SELECT cat.`name` AS catname, cat.`id` AS catid, s.`title`, s.`user_alias` FROM `#__jmylife_categories` AS cat LEFT JOIN `#__jmylife_stories` AS s ON ( cat.`id` = s.`catid` ) WHERE s.`id` = '.$id.' GROUP BY cat.`id`' ); - - $_Itemid = ''; - - if($data = $db->loadObject()) { - if( !defined( 'JPATH_JMYLIFE' ) ) define( 'JPATH_JMYLIFE', JPATH_ROOT.DS.'components'.DS.'com_jmylife' ); - if( !defined( 'JPATH_JMYLIFELIBS' ) ) define( 'JPATH_JMYLIFELIBS', JPATH_JMYLIFE.DS.'libraries' ); - if (is_file(JPATH_JMYLIFELIBS.DS.'common.php')) { - require_once( JPATH_JMYLIFELIBS.DS.'common.php' ); - require_once( JPATH_JMYLIFELIBS.DS.'configuration.php' ); - $_Itemid = '&Itemid='.JmylifeCommon::getStoryItemid($data); - } - } - $link = JRoute::_('index.php?option=com_jmylife&view=item&id='.$id.$_Itemid); - return $link; - } - - function getObjectOwner($id) - { - $db = Factory::getContainer()->get('DatabaseDriver'); - $db->setQuery( 'SELECT user_id FROM #__jmylife_stories WHERE id = ' . $id ); - $userid = $db->loadResult(); - - return $userid; - } -} \ No newline at end of file diff --git a/site/plugins/com_jomclassifieds.plugin.php b/site/plugins/com_jomclassifieds.plugin.php deleted file mode 100644 index 4fe9daab..00000000 --- a/site/plugins/com_jomclassifieds.plugin.php +++ /dev/null @@ -1,40 +0,0 @@ -get('DatabaseDriver'); - $db->setQuery("SELECT id, title, alias, userid, catid FROM #__jomcl_adverts WHERE id = " . $id); - $row = $db->loadObject(); - - $info = new JCommentsObjectInfo(); - - if (!empty($row)) { - $slug = $row->alias ? ($row->id . ':' . $row->alias) : $row->id; - - $Itemid = self::getItemid('com_jomclassifies'); - $Itemid = $Itemid > 0 ? '&Itemid='.$Itemid : ''; - - $info->category_id = $row->catid; - $info->title = $row->title; - $info->userid = $row->userid; - $info->link = JRoute::_('index.php?option=com_jomclassifieds&view=advert&id='.$slug.$Itemid); - } - - return $info; - } -} \ No newline at end of file diff --git a/site/plugins/com_jomtube.plugin.php b/site/plugins/com_jomtube.plugin.php deleted file mode 100644 index c2486c4d..00000000 --- a/site/plugins/com_jomtube.plugin.php +++ /dev/null @@ -1,38 +0,0 @@ -get('DatabaseDriver'); - $db->setQuery('SELECT id, video_title, user_id FROM #__jomtube_videos WHERE id = '.$id); - $row = $db->loadObject(); - - $info = new JCommentsObjectInfo(); - - if (!empty($row)) { - $Itemid = self::getItemid('com_jomtube'); - $Itemid = $Itemid > 0 ? '&Itemid='.$Itemid : ''; - - $info->title = $row->video_title; - $info->userid = $row->user_id; - $info->link = JRoute::_('index.php?option=com_jomtube&view=video&id='.$id.$Itemid); - } - - return $info; - } -} \ No newline at end of file diff --git a/site/plugins/com_joomdoc.plugin.php b/site/plugins/com_joomdoc.plugin.php deleted file mode 100644 index 1596e880..00000000 --- a/site/plugins/com_joomdoc.plugin.php +++ /dev/null @@ -1,49 +0,0 @@ -get('DatabaseDriver'); - - $query = $db->getQuery(true); - $query->select('a.id, a.title, a.alias, a.access, a.created_by, a.path'); - $query->from('#__joomdoc AS a'); - $query->where('a.id = ' . (int) $id); - - $db->setQuery($query); - $row = $db->loadObject(); - - if (!empty($row)) { - $slug = $row->alias ? ($row->id . ':' . $row->alias) : $row->id; - - $info->title = $row->title; - $info->access = $row->access; - $info->userid = $row->created_by; - $info->link = JRoute::_(JoomDOCRoute::viewDocuments($row->path, false));; - } - } - - return $info; - } -} \ No newline at end of file diff --git a/site/plugins/com_joomgallery.plugin.php b/site/plugins/com_joomgallery.plugin.php deleted file mode 100644 index 5d798743..00000000 --- a/site/plugins/com_joomgallery.plugin.php +++ /dev/null @@ -1,49 +0,0 @@ -get('DatabaseDriver'); - // Image comments - $db->setQuery('SELECT imgtitle, id FROM #__joomgallery WHERE id = ' . $id); - return $db->loadResult(); - } - - function getObjectLink($id) - { - // Get an Itemid of JoomGallery - // First, check whether there was set one in the configuration - $db = Factory::getContainer()->get('DatabaseDriver'); - $db->setQuery('SELECT jg_itemid FROM #__joomgallery_config LIMIT 1'); - if (!$_Itemid = $db->loadResult()) { - $_Itemid = self::getItemid('com_joomgallery'); - } - - // Detail view - return JRoute::_('index.php?option=com_joomgallery&view=detail&id=' . $id . '&Itemid=' . $_Itemid); - } - - function getObjectOwner($id) - { - $db = Factory::getContainer()->get('DatabaseDriver'); - - // Image owner - $db->setQuery('SELECT owner FROM #__joomgallery WHERE id = ' . $id); - $userid = $db->loadResult(); - return intval($userid); - } -} \ No newline at end of file diff --git a/site/plugins/com_joomgallery_categories.plugin.php b/site/plugins/com_joomgallery_categories.plugin.php deleted file mode 100644 index 276ac101..00000000 --- a/site/plugins/com_joomgallery_categories.plugin.php +++ /dev/null @@ -1,48 +0,0 @@ -get('DatabaseDriver'); - $db->setQuery('SELECT name, cid FROM #__joomgallery_catg WHERE cid = ' . $id); - return $db->loadResult(); - } - - function getObjectLink($id) - { - // Get an Itemid of JoomGallery - // First, check whether there was set one in the configuration - $db = Factory::getContainer()->get('DatabaseDriver'); - $db->setQuery('SELECT jg_itemid FROM #__joomgallery_config LIMIT 1'); - if (!$_Itemid = $db->loadResult()) { - $_Itemid = self::getItemid('com_joomgallery'); - } - - // Category view - return JRoute::_('index.php?option=com_joomgallery&view=category&catid=' . $id . '&Itemid=' . $_Itemid); - } - - function getObjectOwner($id) - { - // Category owner - $db = Factory::getContainer()->get('DatabaseDriver'); - $db->setQuery('SELECT owner FROM #__joomgallery_catg WHERE cid = ' . $id); - $userid = $db->loadResult(); - return intval($userid); - } -} \ No newline at end of file diff --git a/site/plugins/com_joomgallery_gallery.plugin.php b/site/plugins/com_joomgallery_gallery.plugin.php deleted file mode 100644 index b5fe593e..00000000 --- a/site/plugins/com_joomgallery_gallery.plugin.php +++ /dev/null @@ -1,48 +0,0 @@ -load('com_joomgallery', JPATH_ROOT); - return JText::_('JGS_COMMON_GALLERY'); - } - - function getObjectLink($id) - { - // Get an Itemid of JoomGallery - // First, check whether there was set one in the configuration - $db = Factory::getContainer()->get('DatabaseDriver'); - $db->setQuery('SELECT jg_itemid FROM #__joomgallery_config LIMIT 1'); - if (!$_Itemid = $db->loadResult()) { - $_Itemid = self::getItemid('com_joomgallery'); - } - - return JRoute::_('index.php?option=com_joomgallery&view=gallery&Itemid=' . $_Itemid); - } - - function getObjectOwner($id) - { - // Gallery owner (a super administrator) - $db = Factory::getContainer()->get('DatabaseDriver'); - $db->setQuery('SELECT id FROM #__users WHERE gid = 25'); - $userid = $db->loadResult(); - return intval($userid); - } -} \ No newline at end of file diff --git a/site/plugins/com_joomleague.plugin.php b/site/plugins/com_joomleague.plugin.php deleted file mode 100644 index a4e08fc2..00000000 --- a/site/plugins/com_joomleague.plugin.php +++ /dev/null @@ -1,63 +0,0 @@ -get('DatabaseDriver'); - $query = "SELECT m.id as matchid, - t1.short_name t1name, - t2.short_name t2name, - m.projectteam1_id, - m.projectteam2_id, - m.team1_result, - m.team2_result, - m.modified_by, - r.project_id, - p.name as projectname" - . " FROM #__joomleague_match as m" - . " LEFT JOIN #__joomleague_round as r ON r.id=m.round_id" - . " INNER JOIN #__joomleague_project_team AS pt1 ON m.projectteam1_id=pt1.id" - . " INNER JOIN #__joomleague_project_team AS pt2 ON m.projectteam2_id=pt2.id" - . " INNER JOIN #__joomleague_team AS t1 ON pt1.team_id=t1.id" - . " INNER JOIN #__joomleague_team AS t2 ON pt2.team_id=t2.id" - . " INNER JOIN #__joomleague_project AS p ON pt1.project_id=p.id" - . " WHERE m.id = " . $id; - $db->setQuery($query); - $row = $db->loadObject(); - - if (!empty($row)) { - - if (!is_null($row->team1_result) && (!is_null($row->team1_result))) { - $info->title = $row->projectname." ".$row->t1name." vs. ".$row->t2name." ".$row->team1_result.":".$row->team2_result; - } else { - $info->title = $row->projectname." ".$row->t1name." vs. ".$row->t2name; - } - - $info->userid = $row->modified_by; - $info->link = JRoute::_(JoomleagueHelperRoute::getMatchReportRoute($row->project_id, $row->matchid)); - } - } - - return $info; - } -} \ No newline at end of file diff --git a/site/plugins/com_joomleague_matchreport.plugin.php b/site/plugins/com_joomleague_matchreport.plugin.php deleted file mode 100644 index 5c3c271d..00000000 --- a/site/plugins/com_joomleague_matchreport.plugin.php +++ /dev/null @@ -1,64 +0,0 @@ -get('DatabaseDriver'); - $query = "SELECT m.id as matchid, - t1.short_name t1name, - t2.short_name t2name, - m.projectteam1_id, - m.projectteam2_id, - m.team1_result, - m.team2_result, - m.modified_by, - r.project_id, - p.name as projectname" - . " FROM #__joomleague_match as m" - . " LEFT JOIN #__joomleague_round as r ON r.id=m.round_id" - . " INNER JOIN #__joomleague_project_team AS pt1 ON m.projectteam1_id=pt1.id" - . " INNER JOIN #__joomleague_project_team AS pt2 ON m.projectteam2_id=pt2.id" - . " INNER JOIN #__joomleague_team AS t1 ON pt1.team_id=t1.id" - . " INNER JOIN #__joomleague_team AS t2 ON pt2.team_id=t2.id" - . " INNER JOIN #__joomleague_project AS p ON pt1.project_id=p.id" - . " WHERE m.id = " . $id; - $db->setQuery($query); - $row = $db->loadObject(); - - if (!empty($row)) { - - if (!is_null($row->team1_result) && (!is_null($row->team1_result))) { - $info->title = $row->projectname." ".$row->t1name." vs. ".$row->t2name." ".$row->team1_result.":".$row->team2_result; - } else { - $info->title = $row->projectname." ".$row->t1name." vs. ".$row->t2name; - } - - $info->userid = $row->modified_by; - $info->link = JRoute::_(JoomleagueHelperRoute::getMatchReportRoute($row->project_id, $row->matchid)); - } - } - - return $info; - } - -} \ No newline at end of file diff --git a/site/plugins/com_joomleague_nextmatch.plugin.php b/site/plugins/com_joomleague_nextmatch.plugin.php deleted file mode 100644 index 18c093c4..00000000 --- a/site/plugins/com_joomleague_nextmatch.plugin.php +++ /dev/null @@ -1,58 +0,0 @@ -get('DatabaseDriver'); - $query = "SELECT m.id as matchid, - t1.short_name t1name, - t2.short_name t2name, - m.projectteam1_id, - m.projectteam2_id, - m.team1_result, - m.team2_result, - m.modified_by, - r.project_id, - p.name as projectname" - . " FROM #__joomleague_match as m" - . " LEFT JOIN #__joomleague_round as r ON r.id=m.round_id" - . " INNER JOIN #__joomleague_project_team AS pt1 ON m.projectteam1_id=pt1.id" - . " INNER JOIN #__joomleague_project_team AS pt2 ON m.projectteam2_id=pt2.id" - . " INNER JOIN #__joomleague_team AS t1 ON pt1.team_id=t1.id" - . " INNER JOIN #__joomleague_team AS t2 ON pt2.team_id=t2.id" - . " INNER JOIN #__joomleague_project AS p ON pt1.project_id=p.id" - . " WHERE m.id = " . $id; - $db->setQuery($query); - $row = $db->loadObject(); - - if (!empty($row)) { - $info->title = $row->projectname." ".$row->t1name." vs. ".$row->t2name; - $info->userid = $row->modified_by; - $info->link = JRoute::_(JoomleagueHelperRoute::getNextMatchRoute($row->project_id, $row->matchid)); - } - } - - return $info; - } - -} \ No newline at end of file diff --git a/site/plugins/com_jphoto.plugin.php b/site/plugins/com_jphoto.plugin.php deleted file mode 100644 index f4cb6e7e..00000000 --- a/site/plugins/com_jphoto.plugin.php +++ /dev/null @@ -1,46 +0,0 @@ -get('DatabaseDriver'); - $db->setQuery('SELECT title, id FROM #__jphoto_imgs WHERE id = ' . $id); - return $db->loadResult(); - } - - function getObjectLink($id) - { - $db = Factory::getContainer()->get('DatabaseDriver'); - $db->setQuery( 'SELECT alias, gallery FROM #__jphoto_imgs WHERE id = ' . $id ); - $r = $db->loadAssoc(); - $alias = $r['alias']; - $gal_id = $r['gallery']; - - $link = 'index.php?option=com_jphoto&Itemid='.$gal_id.'&id='. $id . ':' . $alias . '&view=image'; - - $link = JRoute::_($link); - return $link; - } - - function getObjectOwner($id) - { - $db = Factory::getContainer()->get('DatabaseDriver'); - $db->setQuery("SELECT created_by FROM #__jphoto_imgs WHERE id = " . $id); - $userid = $db->loadResult(); - - return intval($userid); - } -} \ No newline at end of file diff --git a/site/plugins/com_jshopping.plugin.php b/site/plugins/com_jshopping.plugin.php deleted file mode 100644 index edf04fd8..00000000 --- a/site/plugins/com_jshopping.plugin.php +++ /dev/null @@ -1,50 +0,0 @@ -getTag(); - - $db = Factory::getContainer()->get('DatabaseDriver'); - $query = "SELECT p.`$titleField`, p.access, c.category_id " - . " FROM #__jshopping_products AS p" - . " JOIN #__jshopping_products_to_categories AS c ON p.product_id = c.product_id" - . " WHERE p.product_id = " . $id - ; - - $db->setQuery($query); - $row = $db->loadObject(); - - if (!empty($row)) { - $info->category_id = $row->category_id; - $info->title = $row->$titleField; - $info->access = $row->access; - $info->link = SEFLink('index.php?option=com_jshopping&controller=product&task=view&category_id='.$row->category_id.'&product_id='.$id); - } - } - - return $info; - } -} \ No newline at end of file diff --git a/site/plugins/com_juserlist.plugin.php b/site/plugins/com_juserlist.plugin.php deleted file mode 100644 index 845a5599..00000000 --- a/site/plugins/com_juserlist.plugin.php +++ /dev/null @@ -1,39 +0,0 @@ -get('DatabaseDriver'); - $db->setQuery( 'SELECT name FROM #__users WHERE id = ' . $id ); - return $db->loadResult(); - } - - function getObjectLink($id) - { - $_Itemid = self::getItemid( 'com_juserlist' ); - - $link = JRoute::_( 'index.php?option=com_juserlist&view=profile&id=' .$id .'&Itemid=' . $_Itemid); - return $link; - } - - function getObjectOwner($id) - { - $user = JFactory::getUser(); - return $user->id; - } -} \ No newline at end of file diff --git a/site/plugins/com_jvideo.plugin.php b/site/plugins/com_jvideo.plugin.php deleted file mode 100644 index 965b3d3a..00000000 --- a/site/plugins/com_jvideo.plugin.php +++ /dev/null @@ -1,38 +0,0 @@ -get('DatabaseDriver'); - $db->setQuery('SELECT id, video_title, user_id FROM #__jvideos WHERE id = ' . $id); - $row = $db->loadObject(); - - $info = new JCommentsObjectInfo(); - - if (!empty($row)) { - $Itemid = self::getItemid('com_jvideo'); - $Itemid = $Itemid > 0 ? '&Itemid='.$Itemid : ''; - - $info->title = $row->video_title; - $info->access = 0; - $info->userid = $row->user_id; - $info->link = JRoute::_('index.php?option=com_jvideo&view=watch&id='.$id.$Itemid); - } - - return $info; - } -} \ No newline at end of file diff --git a/site/plugins/com_jvideoclip.plugin.php b/site/plugins/com_jvideoclip.plugin.php deleted file mode 100644 index 99b8a792..00000000 --- a/site/plugins/com_jvideoclip.plugin.php +++ /dev/null @@ -1,42 +0,0 @@ -get('DatabaseDriver'); - $db->setQuery( 'SELECT title, id FROM #__jvc_videos WHERE id = ' . $id ); - return $db->loadResult(); - } - - function getObjectLink($id) - { - $_Itemid = self::getItemid('com_jvideoclip'); - $link = 'index.php?option=com_jvideoclip&view=showvideo&id=' . $id; - $link .= ($_Itemid > 0) ? ('&Itemid=' . $_Itemid) : ''; - $link = JRoute::_( $link ); - return $link; - } - - function getObjectOwner($id) - { - $db = Factory::getContainer()->get('DatabaseDriver'); - $db->setQuery( 'SELECT user_id FROM #__jvc_videos WHERE id = ' . $id ); - $userid = $db->loadResult(); - - return $userid; - } -} \ No newline at end of file diff --git a/site/plugins/com_k2.plugin.php b/site/plugins/com_k2.plugin.php deleted file mode 100644 index 149c2355..00000000 --- a/site/plugins/com_k2.plugin.php +++ /dev/null @@ -1,47 +0,0 @@ -get('DatabaseDriver'); - $query = "SELECT i.id, i.title, i.catid, i.alias, i.access, i.created_by, c.alias as catalias" - . " FROM #__k2_items as i" - . " LEFT JOIN #__k2_categories as c ON c.id=i.catid" - . " WHERE i.id = " . $id; - $db->setQuery($query); - $row = $db->loadObject(); - - if (!empty($row)) { - $info->category_id = $row->catid; - $info->title = $row->title; - $info->access = $row->access; - $info->userid = $row->created_by; - $info->link = JRoute::_(K2HelperRoute::getItemRoute($row->id.':'.urlencode($row->alias), $row->catid.':'.urlencode($row->catalias))); - } - } - - return $info; - } -} \ No newline at end of file diff --git a/site/plugins/com_listbingo.plugin.php b/site/plugins/com_listbingo.plugin.php deleted file mode 100644 index c703e96c..00000000 --- a/site/plugins/com_listbingo.plugin.php +++ /dev/null @@ -1,37 +0,0 @@ -get('DatabaseDriver'); - $db->setQuery("SELECT id, title, user_id FROM #__gbl_ads WHERE id = ".$id); - $row = $db->loadObject(); - - $info = new JCommentsObjectInfo(); - - if (!empty($row)) { - $Itemid = self::getItemid('com_listbingo'); - $Itemid = $Itemid > 0 ? '&Itemid='.$Itemid : ''; - - $info->title = $row->title; - $info->userid = $row->user_id; - $info->link = JRoute::_('index.php?option=com_listbingo&task=ads.view&adid='.$id.$Itemid); - } - - return $info; - } -} \ No newline at end of file diff --git a/site/plugins/com_lyftenbloggie.plugin.php b/site/plugins/com_lyftenbloggie.plugin.php deleted file mode 100644 index 73e2ea9d..00000000 --- a/site/plugins/com_lyftenbloggie.plugin.php +++ /dev/null @@ -1,50 +0,0 @@ -get('DatabaseDriver'); - $query = "SELECT e.id, e.title, e.created_by, e.created, e.access" - . ', CASE WHEN CHAR_LENGTH(e.alias) THEN CONCAT_WS(":", e.id, e.alias) ELSE e.id END as slug' - . ' FROM #__bloggies_entries AS e' - . ' WHERE e.id = '.$id - ; - - $db->setQuery( $query, 0, 1); - $entry = $db->loadObject(); - - $info = new JCommentsObjectInfo(); - - if (!empty($entry)) { - $routerHelper = JPATH_ROOT.'/components/com_lyftenbloggie/helpers/route.php'; - if (is_file($routerHelper)) { - include_once(JPATH_SITE.DS.'includes'.DS.'application.php'); - include_once(JPATH_SITE.DS.'components'.DS.'com_lyftenbloggie'.DS.'helpers'.DS.'route.php'); - include_once(JPATH_SITE.DS.'components'.DS.'com_lyftenbloggie'.DS.'router.php'); - - $entry->archive = JHTML::_('date', $entry->created, '&year=%Y&month=%m&day=%d'); - - $info->title = $entry->title; - $info->access = $entry->access; - $info->userid = $entry->created_by; - $info->link = JRoute::_(LyftenBloggieHelperRoute::getEntryRoute($entry->archive, $entry->slug));; - } - } - - return $info; - } -} \ No newline at end of file diff --git a/site/plugins/com_marketplace.plugin.php b/site/plugins/com_marketplace.plugin.php deleted file mode 100644 index 83a14ce5..00000000 --- a/site/plugins/com_marketplace.plugin.php +++ /dev/null @@ -1,50 +0,0 @@ - 0 ? '&Itemid='.$Itemid : ''; - - $marketplaceCore = JPATH_SITE.'/components/com_marketplace/controller.php'; - if (is_file($marketplaceCore)) { - $db = Factory::getContainer()->get('DatabaseDriver'); - $query = 'SELECT e.id, e.headline as title, e.user_id as userid, e.category_id' - . " , CASE WHEN CHAR_LENGTH(e.alias) THEN CONCAT_WS(':', e.id, e.alias) ELSE e.id END as slug" - . " , CASE WHEN CHAR_LENGTH(c.alias) THEN CONCAT_WS(':', c.id, c.alias) ELSE c.id END as categorySlug" - . " FROM #__marketplace_entries AS e" - . " JOIN #__marketplace_categories AS c ON c.id = e.category_id" - . " WHERE e.id = " . $id - ; - $db->setQuery($query); - $row = $db->loadObject(); - - $link = JRoute::_("index.php?option=com_marketplace&view=entry&catid=".htmlspecialchars($row->categorySlug)."&entry=".$row->slug.$Itemid); - - if (!empty($row)) { - $info->category_id = $row->category_id; - $info->title = $row->ad_headline; - $info->userid = $row->userid; - $info->link = $link; - } - } - - return $info; - } -} \ No newline at end of file diff --git a/site/plugins/com_marketplace2.plugin.php b/site/plugins/com_marketplace2.plugin.php deleted file mode 100644 index b6c3494b..00000000 --- a/site/plugins/com_marketplace2.plugin.php +++ /dev/null @@ -1,45 +0,0 @@ -get('DatabaseDriver'); - $query = 'SELECT e.id, e.headline, e.user_id, e.category_id ' - . " , CASE WHEN CHAR_LENGTH(e.alias) THEN CONCAT_WS(':', e.id, e.alias) ELSE e.id END as slug" - . " , CASE WHEN CHAR_LENGTH(c.alias) THEN CONCAT_WS(':', c.id, c.alias) ELSE c.id END as categorySlug" - . " FROM #__marketplace_entries AS e" - . " JOIN #__marketplace_categories AS c ON c.id = e.category_id" - . " WHERE e.id = " . $id - ; - $db->setQuery($query); - $row = $db->loadObject(); - - $info = new JCommentsObjectInfo(); - - if (!empty($row)) { - $Itemid = self::getItemid('com_marketplace'); - $Itemid = $Itemid > 0 ? '&Itemid='.$Itemid : ''; - - $info->category_id = $row->catid; - $info->title = $row->headline; - $info->userid = $row->user_id; - $info->link = JRoute::_("index.php?option=com_marketplace&view=entry&catid=".htmlspecialchars($row->categorySlug)."&entry=".$row->slug.$Itemid); - } - - return $info; - } -} \ No newline at end of file diff --git a/site/plugins/com_mijoevents.plugin.php b/site/plugins/com_mijoevents.plugin.php deleted file mode 100644 index dba85c8c..00000000 --- a/site/plugins/com_mijoevents.plugin.php +++ /dev/null @@ -1,49 +0,0 @@ -get('DatabaseDriver'); - $query = $db->getQuery(true); - - $query->select('id, title, created_by'); - $query->from('#__mijoevents_events'); - $query->where('id = ' . (int) $id); - - $db->setQuery($query); - $row = $db->loadObject(); - - if (!empty($row)) { - $Itemid = MijoEvents::get('utility')->getItemid(array('category'), null, false); - $Itemid = $Itemid > 0 ? '&Itemid=' . $Itemid : ''; - - $info->title = $row->title; - $info->userid = $row->created_by; - $info->link = JRoute::_('index.php?option=com_mijoevents&view=event&event_id=' . $id . $Itemid); - } - } - - return $info; - } -} \ No newline at end of file diff --git a/site/plugins/com_mijopolls.plugin.php b/site/plugins/com_mijopolls.plugin.php deleted file mode 100644 index ce2e21ff..00000000 --- a/site/plugins/com_mijopolls.plugin.php +++ /dev/null @@ -1,50 +0,0 @@ -get('DatabaseDriver'); - $query = $db->getQuery(true); - - $query->select('id, title, alias'); - $query->from('#__mijopolls_polls'); - $query->where('id = ' . (int) $id); - - $db->setQuery($query); - $row = $db->loadObject(); - - if (!empty($row)) { - $Itemid = self::getItemid('com_mijopolls', 'index.php?option=com_mijopolls&view=polls'); - $Itemid = $Itemid > 0 ? '&Itemid=' . $Itemid : ''; - - $row->slug = $row->alias ? ($row->id.':'.$row->alias) : $row->id; - - $info->title = $row->title; - $info->link = JRoute::_('index.php?option=com_mijopolls&view=poll&id=' . $row->slug . $Itemid); - } - } - - return $info; - } -} \ No newline at end of file diff --git a/site/plugins/com_mijoshop.plugin.php b/site/plugins/com_mijoshop.plugin.php deleted file mode 100644 index 4a7ef59a..00000000 --- a/site/plugins/com_mijoshop.plugin.php +++ /dev/null @@ -1,45 +0,0 @@ -get('DatabaseDriver'); - $query = $db->getQuery(true); - - $query->select('product_id, name'); - $query->from('#__mijoshop_product_description'); - $query->where('product_id = ' . (int) $id); - - $db->setQuery($query); - $row = $db->loadObject(); - - if (!empty($row)) { - $info->title = $row->name; - $info->link = MijoShop::get('router')->route('index.php?route=product/product&product_id='.$id); - } - } - - return $info; - } -} \ No newline at end of file diff --git a/site/plugins/com_mijovoice.plugin.php b/site/plugins/com_mijovoice.plugin.php deleted file mode 100644 index 0fb98d37..00000000 --- a/site/plugins/com_mijovoice.plugin.php +++ /dev/null @@ -1,49 +0,0 @@ -get('DatabaseDriver'); - $query = $db->getQuery(true); - - $query->select('id, title, user_id'); - $query->from('#__mijovoice_ideas'); - $query->where('id = ' . (int) $id); - - $db->setQuery($query); - $row = $db->loadObject(); - - if (!empty($row)) { - $Itemid = MijoVoice::get('utility')->getItemid(array('ideas'), null, false); - $Itemid = $Itemid > 0 ? '&Itemid=' . $Itemid : ''; - - $info->title = $row->title; - $info->userid = $row->user_id; - $info->link = JRoute::_('index.php?option=com_mijovoice&view=idea&idea_id=' . $id . $Itemid); - } - } - - return $info; - } -} \ No newline at end of file diff --git a/site/plugins/com_mmsblog.plugin.php b/site/plugins/com_mmsblog.plugin.php deleted file mode 100644 index bd0d7496..00000000 --- a/site/plugins/com_mmsblog.plugin.php +++ /dev/null @@ -1,31 +0,0 @@ -get('DatabaseDriver'); - $db->setQuery( 'SELECT subject, id FROM #__mmsblog_item WHERE id = ' . $id ); - return $db->loadResult(); - } - - function getObjectLink($id) - { - $_Itemid = self::getItemid('com_mmsblog'); - $link = JRoute::_('index.php?option=com_mmsblog&view=item&id='. $id .'&Itemid='. $_Itemid); - return $link; - } -} \ No newline at end of file diff --git a/site/plugins/com_moofaq.plugin.php b/site/plugins/com_moofaq.plugin.php index 087e269c..bb8abed9 100644 --- a/site/plugins/com_moofaq.plugin.php +++ b/site/plugins/com_moofaq.plugin.php @@ -1,61 +1,65 @@ -get('DatabaseDriver'); - $db->setQuery( 'SELECT title, id FROM #__content WHERE id = ' . $id ); - return $db->loadResult(); - } - - function getObjectLink($id) - { - $link = ''; - - require_once(JPATH_ROOT.DS.'components'.DS.'com_moofaq'.DS.'helpers'.DS.'route.php'); - - $query = 'SELECT a.id, a.sectionid, a.access,' . - ' CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(":", a.id, a.alias) ELSE a.id END as slug,'. - ' CASE WHEN CHAR_LENGTH(cc.alias) THEN CONCAT_WS(":", cc.id, cc.alias) ELSE cc.id END as catslug'. - ' FROM #__content AS a' . - ' LEFT JOIN #__categories AS cc ON cc.id = a.catid' . - ' WHERE a.id = ' . $id; - - $db = Factory::getContainer()->get('DatabaseDriver'); - $db->setQuery( $query ); - $row = $db->loadObject(); - - $user = JFactory::getUser(); - - if ($row->access <= $user->get('aid', 0)) { - $link = JRoute::_(MoofaqHelperRoute::getArticleRoute($row->slug, $row->catslug, $row->sectionid)); - } else { - $link = JRoute::_("index.php?option=com_user&task=register"); - } - - return $link; - } - - function getObjectOwner($id) - { - $db = Factory::getContainer()->get('DatabaseDriver'); - $db->setQuery( 'SELECT created_by FROM #__content WHERE id = ' . $id ); - $userid = $db->loadResult(); - - return $userid; - } +setQuery( 'SELECT title, id FROM #__content WHERE id = ' . $id ); + return $db->loadResult(); + } + + function getObjectLink($id) + { + $link = ''; + + require_once(JPATH_ROOT.'/components/com_moofaq/helpers/route.php'); + + $query = 'SELECT a.id, a.sectionid, a.access,' . + ' CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(":", a.id, a.alias) ELSE a.id END as slug,'. + ' CASE WHEN CHAR_LENGTH(cc.alias) THEN CONCAT_WS(":", cc.id, cc.alias) ELSE cc.id END as catslug'. + ' FROM #__content AS a' . + ' LEFT JOIN #__categories AS cc ON cc.id = a.catid' . + ' WHERE a.id = ' . $id; + + $db = JFactory::getDbo(); + $db->setQuery( $query ); + $row = $db->loadObject(); + + $user = JFactory::getUser(); + + if ($row->access <= $user->get('aid', 0)) { + $link = JRoute::_(MoofaqHelperRoute::getArticleRoute($row->slug, $row->catslug, $row->sectionid)); + } else { + $link = JRoute::_("index.php?option=com_user&task=register"); + } + + return $link; + } + + function getObjectOwner($id) + { + $db = JFactory::getDbo(); + $db->setQuery( 'SELECT created_by FROM #__content WHERE id = ' . $id ); + $userid = $db->loadResult(); + + return $userid; + } } \ No newline at end of file diff --git a/site/plugins/com_mtree.plugin.php b/site/plugins/com_mtree.plugin.php index 72d06763..17b7ceab 100644 --- a/site/plugins/com_mtree.plugin.php +++ b/site/plugins/com_mtree.plugin.php @@ -1,37 +1,35 @@ -get('DatabaseDriver'); - $db->setQuery('SELECT link_id, link_name, user_id FROM #__mt_links WHERE link_id = ' . $id); - $row = $db->loadObject(); - - $info = new JCommentsObjectInfo(); - - if (!empty($row)) { - $Itemid = self::getItemid('com_mtree'); - $Itemid = $Itemid > 0 ? '&Itemid=' . $Itemid : ''; - - $info->title = $row->link_name; - $info->userid = $row->user_id; - $info->link = JRoute::_('index.php?option=com_mtree&task=viewlink&link_id=' . $id . $Itemid); - } - - return $info; - } +setQuery('SELECT link_id, link_name, user_id FROM #__mt_links WHERE link_id = ' . $id); + $row = $db->loadObject(); + + $info = new JCommentsObjectInfo(); + + if (!empty($row)) { + $Itemid = self::getItemid('com_mtree'); + $Itemid = $Itemid > 0 ? '&Itemid=' . $Itemid : ''; + + $info->title = $row->link_name; + $info->userid = $row->user_id; + $info->link = JRoute::_('index.php?option=com_mtree&task=viewlink&link_id=' . $id . $Itemid); + } + + return $info; + } } \ No newline at end of file diff --git a/site/plugins/com_muscol.plugin.php b/site/plugins/com_muscol.plugin.php deleted file mode 100644 index 5d8f2d38..00000000 --- a/site/plugins/com_muscol.plugin.php +++ /dev/null @@ -1,42 +0,0 @@ -get('DatabaseDriver'); - $db->setQuery( 'SELECT name, id FROM #__muscol_albums WHERE id = ' . $id ); - return $db->loadResult(); - } - - function getObjectLink($id) - { - $link = 'index.php?option=com_muscol&view=album&id=' . $id; - $_Itemid = self::getItemid('com_muscol'); - $link .= ($_Itemid > 0) ? ('&Itemid=' . $_Itemid) : ''; - $link = JRoute::_( $link ); - return $link; - } - - function getObjectOwner($id) - { - $db = Factory::getContainer()->get('DatabaseDriver'); - $db->setQuery( 'SELECT user_id FROM #__muscol_albums WHERE id = ' . $id ); - $userid = $db->loadResult(); - - return $userid; - } -} \ No newline at end of file diff --git a/site/plugins/com_muscol_artist.plugin.php b/site/plugins/com_muscol_artist.plugin.php deleted file mode 100644 index 5545b336..00000000 --- a/site/plugins/com_muscol_artist.plugin.php +++ /dev/null @@ -1,33 +0,0 @@ -get('DatabaseDriver'); - $db->setQuery( 'SELECT artist_name, id FROM #__muscol_artists WHERE id = ' . $id ); - return $db->loadResult(); - } - - function getObjectLink($id) - { - $link = 'index.php?option=com_muscol&view=artist&id=' . $id; - $_Itemid = self::getItemid('com_muscol'); - $link .= ($_Itemid > 0) ? ('&Itemid=' . $_Itemid) : ''; - $link = JRoute::_( $link ); - return $link; - } -} \ No newline at end of file diff --git a/site/plugins/com_muscol_song.plugin.php b/site/plugins/com_muscol_song.plugin.php deleted file mode 100644 index 918868e1..00000000 --- a/site/plugins/com_muscol_song.plugin.php +++ /dev/null @@ -1,33 +0,0 @@ -get('DatabaseDriver'); - $db->setQuery( 'SELECT name, id FROM #__muscol_songs WHERE id = ' . $id ); - return $db->loadResult(); - } - - function getObjectLink($id) - { - $link = 'index.php?option=com_muscol&view=song&id=' . $id; - $_Itemid = self::getItemid('com_muscol'); - $link .= ($_Itemid > 0) ? ('&Itemid=' . $_Itemid) : ''; - $link = JRoute::_( $link ); - return $link; - } -} \ No newline at end of file diff --git a/site/plugins/com_ohanah.plugin.php b/site/plugins/com_ohanah.plugin.php deleted file mode 100644 index 4072a824..00000000 --- a/site/plugins/com_ohanah.plugin.php +++ /dev/null @@ -1,38 +0,0 @@ -get('DatabaseDriver'); - $db->setQuery('SELECT title, created_by FROM #__ohanah_events WHERE ohanah_event_id = ' . $id); - $row = $db->loadObject(); - - $info = new JCommentsObjectInfo(); - - if (!empty($row)) { - $Itemid = self::getItemid('com_ohanah'); - $Itemid = $Itemid > 0 ? '&Itemid='.$Itemid : ''; - - $info->title = $row->title; - $info->userid = $row->created_by; - $info->link = JRoute::_('index.php?option=com_ohanah&task=view&id='.$id.$Itemid); - - } - - return $info; - } -} \ No newline at end of file diff --git a/site/plugins/com_phocadownload.plugin.php b/site/plugins/com_phocadownload.plugin.php index 4da64aa7..5842361a 100644 --- a/site/plugins/com_phocadownload.plugin.php +++ b/site/plugins/com_phocadownload.plugin.php @@ -1,42 +1,40 @@ -get('DatabaseDriver'); - $query = 'SELECT id, title, access ' - . ' , CASE WHEN CHAR_LENGTH(alias) THEN CONCAT_WS(\':\', id, alias) ELSE id END as slug' - . ' FROM #__phocadownload_categories' - . ' WHERE id = '.$id - ; - $db->setQuery($query); - $row = $db->loadObject(); - - if (!empty($row)) { - $Itemid = self::getItemid('com_phocadownload'); - $Itemid = $Itemid > 0 ? '&Itemid='.$Itemid : ''; - - $info->title = $row->title; - $info->access = $row->access; - $info->link = JRoute::_('index.php?option=com_phocadownload&view=category&id=' . $row->slug . $Itemid); - } - - return $info; - } +setQuery($query); + $row = $db->loadObject(); + + if (!empty($row)) { + $Itemid = self::getItemid('com_phocadownload'); + $Itemid = $Itemid > 0 ? '&Itemid='.$Itemid : ''; + + $info->title = $row->title; + $info->access = $row->access; + $info->link = JRoute::_('index.php?option=com_phocadownload&view=category&id=' . $row->slug . $Itemid); + } + + return $info; + } } \ No newline at end of file diff --git a/site/plugins/com_phocadownload_files.plugin.php b/site/plugins/com_phocadownload_files.plugin.php index 7b942f01..bede674b 100644 --- a/site/plugins/com_phocadownload_files.plugin.php +++ b/site/plugins/com_phocadownload_files.plugin.php @@ -1,44 +1,42 @@ -get('DatabaseDriver'); - $query = 'SELECT a.id, a.title, a.access' - .' , CASE WHEN CHAR_LENGTH(c.alias) THEN CONCAT_WS(\':\', c.id, c.alias) ELSE c.id END as catslug' - .' , CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(\':\', a.id, a.alias) ELSE a.id END as slug' - .' FROM #__phocadownload AS a' - .' LEFT JOIN #__phocadownload_categories AS c ON c.id = a.catid' - .' WHERE a.id = '. $id - ; - $db->setQuery($query); - $row = $db->loadObject(); - - if (!empty($row)) { - $Itemid = self::getItemid('com_phocadownload'); - $Itemid = $Itemid > 0 ? '&Itemid='.$Itemid : ''; - - $info->title = $row->title; - $info->access = $row->access; - $info->link = JRoute::_('index.php?option=com_phocadownload&view=file&catid=' . $row->catslug . '&id=' . $row->slug . $Itemid); - } - - return $info; - } +setQuery($query); + $row = $db->loadObject(); + + if (!empty($row)) { + $Itemid = self::getItemid('com_phocadownload'); + $Itemid = $Itemid > 0 ? '&Itemid='.$Itemid : ''; + + $info->title = $row->title; + $info->access = $row->access; + $info->link = JRoute::_('index.php?option=com_phocadownload&view=file&catid=' . $row->catslug . '&id=' . $row->slug . $Itemid); + } + + return $info; + } } \ No newline at end of file diff --git a/site/plugins/com_phocagallery.plugin.php b/site/plugins/com_phocagallery.plugin.php index c296f117..23adb713 100644 --- a/site/plugins/com_phocagallery.plugin.php +++ b/site/plugins/com_phocagallery.plugin.php @@ -1,43 +1,41 @@ -get('DatabaseDriver'); - $query = 'SELECT id, title, owner_id ' - . ' , CASE WHEN CHAR_LENGTH(alias) THEN CONCAT_WS(\':\', id, alias) ELSE id END as slug' - . ' FROM #__phocagallery_categories' - . ' WHERE id = '.$id - ; - $db->setQuery($query); - $row = $db->loadObject(); - - if (!empty($row)) { - $Itemid = self::getItemid('com_phocagallery'); - $Itemid = $Itemid > 0 ? '&Itemid='.$Itemid : ''; - - $info->title = $row->title; - $info->access = 0; - $info->userid = $row->owner_id; - $info->link = JRoute::_('index.php?option=com_phocagallery&view=category&id=' . $row->slug . $Itemid); - } - - return $info; - } +setQuery($query); + $row = $db->loadObject(); + + if (!empty($row)) { + $Itemid = self::getItemid('com_phocagallery'); + $Itemid = $Itemid > 0 ? '&Itemid='.$Itemid : ''; + + $info->title = $row->title; + $info->access = 0; + $info->userid = $row->owner_id; + $info->link = JRoute::_('index.php?option=com_phocagallery&view=category&id=' . $row->slug . $Itemid); + } + + return $info; + } } \ No newline at end of file diff --git a/site/plugins/com_phocagallery_images.plugin.php b/site/plugins/com_phocagallery_images.plugin.php index 1e38c777..a1e7cf8d 100644 --- a/site/plugins/com_phocagallery_images.plugin.php +++ b/site/plugins/com_phocagallery_images.plugin.php @@ -1,49 +1,47 @@ -get('DatabaseDriver'); - $query = 'SELECT a.id, a.title ' - .' , CASE WHEN CHAR_LENGTH(c.alias) THEN CONCAT_WS(\':\', c.id, c.alias) ELSE c.id END as catslug' - .' , CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(\':\', a.id, a.alias) ELSE a.id END as slug' - .' FROM #__phocagallery AS a' - .' LEFT JOIN #__phocagallery_categories AS c ON c.id = a.catid' - .' WHERE a.id = '. $id - ; - $db->setQuery($query); - $row = $db->loadObject(); - - if (!empty($row)) { - $Itemid = self::getItemid('com_phocagallery'); - $Itemid = $Itemid > 0 ? '&Itemid='.$Itemid : ''; - - $info->title = $row->title; - $info->access = 0; - $info->userid = $row->owner_id; - - // Comment is displayed in popup window so we must create link to category view - // Because of possible pagination only this one image will be displayed not all - - $info->link = JRoute::_('index.php?option=com_phocagallery&view=category&id=' . $row->catslug.'&cimgid=' . $row->slug . $Itemid); - } - - return $info; - } +setQuery($query); + $row = $db->loadObject(); + + if (!empty($row)) { + $Itemid = self::getItemid('com_phocagallery'); + $Itemid = $Itemid > 0 ? '&Itemid='.$Itemid : ''; + + $info->title = $row->title; + $info->access = 0; + $info->userid = $row->owner_id; + + // Comment is displayed in popup window so we must create link to category view + // Because of possible pagination only this one image will be displayed not all + + $info->link = JRoute::_('index.php?option=com_phocagallery&view=category&id=' . $row->catslug.'&cimgid=' . $row->slug . $Itemid); + } + + return $info; + } } \ No newline at end of file diff --git a/site/plugins/com_poll.plugin.php b/site/plugins/com_poll.plugin.php deleted file mode 100644 index 4cc76ca4..00000000 --- a/site/plugins/com_poll.plugin.php +++ /dev/null @@ -1,37 +0,0 @@ -get('DatabaseDriver'); - $db->setQuery("SELECT id, title, alias, access FROM #__polls WHERE id = " . $id); - $row = $db->loadObject(); - - $info = new JCommentsObjectInfo(); - - if (!empty($row)) { - $_Itemid = self::getItemid('com_poll'); - $_Itemid = $_Itemid > 0 ? '&Itemid=' . $_Itemid : ''; - - $info->title = $row->title; - $info->access = $row->access; - $info->link = JRoute::_('index.php?option=com_poll&id='. $id . ':' . $row->alias . $_Itemid); - } - - return $info; - } -} \ No newline at end of file diff --git a/site/plugins/com_portfolio.plugin.php b/site/plugins/com_portfolio.plugin.php deleted file mode 100644 index ed8df57c..00000000 --- a/site/plugins/com_portfolio.plugin.php +++ /dev/null @@ -1,34 +0,0 @@ -get('DatabaseDriver'); - $db->setQuery( 'SELECT title, id FROM #__portfolio_items WHERE id = ' . $id ); - return $db->loadResult(); - } - - function getObjectLink($id) - { - $_Itemid = self::getItemid('com_portfolio'); - $link = 'index.php?option=com_portfolio&id=' . $id . '&view=item'; - $link .= ($_Itemid > 0) ? ('&Itemid=' . $_Itemid) : ''; - $link = JRoute::_($link); - - return $link; - } -} \ No newline at end of file diff --git a/site/plugins/com_projectlog.plugin.php b/site/plugins/com_projectlog.plugin.php deleted file mode 100644 index cdc8358c..00000000 --- a/site/plugins/com_projectlog.plugin.php +++ /dev/null @@ -1,33 +0,0 @@ -get('DatabaseDriver'); - $db->setQuery( "SELECT title, id FROM #__projectlog_projects WHERE id = $id" ); - return $db->loadResult(); - } - - function getObjectLink($id) - { - $_Itemid = self::getItemid( 'com_projectlog' ); - $link = "index.php?option=com_projectlog&view=project&project_id=" . $id; - $link .= ($_Itemid > 0) ? ('&Itemid=' . $_Itemid) : ''; - $link = JRoute::_($link); - return $link; - } -} \ No newline at end of file diff --git a/site/plugins/com_propiedades.plugin.php b/site/plugins/com_propiedades.plugin.php deleted file mode 100644 index ddbcf51d..00000000 --- a/site/plugins/com_propiedades.plugin.php +++ /dev/null @@ -1,61 +0,0 @@ -get('DatabaseDriver'); - $db->setQuery( 'SELECT titulo_producto, id_producto FROM #__propiedades_productos WHERE id_producto = ' . $id ); - return $db->loadResult(); - } - - function getObjectLink($id) - { - $_Itemid = self::getItemid('com_propiedades'); - - $db = Factory::getContainer()->get('DatabaseDriver'); - $query = ' SELECT CASE WHEN CHAR_LENGTH(p.alias) THEN CONCAT_WS(":", p.id_producto, p.alias) ELSE p.id_producto END as slug,' - . ' CASE WHEN CHAR_LENGTH(t.alias) THEN CONCAT_WS(":", t.id_categoria, t.alias) ELSE t.id_categoria END as catslug,' - . ' FROM #__propiedades_productos AS p ' - . ' LEFT JOIN #__propiedades_categorias AS t ON t.id_categoria = p.id_categoria_producto ' - . ' WHERE p.id_producto = ' . $id - ; - $db->setQuery($query); - - $row = new StdClass; - - if (JCOMMENTS_JVERSION == '1.5') { - $row = $db->loadObject(); - } else { - $db->loadObject($row); - } - - $link = 'index.php?option=com_propiedades&view=propiedad&catid='.$row->catslug.'&id='.$row->slug; - $link .= ($_Itemid > 0) ? ('&Itemid=' . $_Itemid) : ''; - $link = JRoute::_( $link ); - - return $link; - } - - function getObjectOwner($id) - { - $db = Factory::getContainer()->get('DatabaseDriver'); - $db->setQuery( 'SELECT publicador_id FROM #__propiedades_productos WHERE id_producto = ' . $id ); - $userid = $db->loadResult(); - - return $userid; - } -} \ No newline at end of file diff --git a/site/plugins/com_quickfaq.plugin.php b/site/plugins/com_quickfaq.plugin.php deleted file mode 100644 index 791d9834..00000000 --- a/site/plugins/com_quickfaq.plugin.php +++ /dev/null @@ -1,60 +0,0 @@ -get('DatabaseDriver'); - $db->setQuery( 'SELECT title, id FROM #__quickfaq_items WHERE id = ' . $id ); - return $db->loadResult(); - } - - function getObjectLink($id) - { - $link = ''; - - $quickFaqRouterPath = JPATH_SITE.DS.'components'.DS.'com_quickfaq'.DS.'helpers'.DS.'route.php'; - - if (is_file($quickFaqRouterPath)) { - require_once ($quickFaqRouterPath); - - $db = Factory::getContainer()->get('DatabaseDriver'); - - $query = 'SELECT CASE WHEN CHAR_LENGTH(i.alias) THEN CONCAT_WS(\':\', i.id, i.alias) ELSE i.id END as slug,' - . ' CASE WHEN CHAR_LENGTH(c.alias) THEN CONCAT_WS(\':\', c.id, c.alias) ELSE c.id END as categoryslug' - . ' FROM #__quickfaq_items AS i' - . ' LEFT JOIN #__quickfaq_cats_item_relations AS rel ON rel.itemid = i.id' - . ' LEFT JOIN #__quickfaq_categories AS c ON c.id = rel.catid' - . ' WHERE i.id = '.$id - ; - $db->setQuery($query); - $row = $db->loadObject(); - - $link = JRoute::_(QuickfaqHelperRoute::getItemRoute($row->slug, $row->categoryslug)); - } - - return $link; - } - - function getObjectOwner($id) - { - $db = Factory::getContainer()->get('DatabaseDriver'); - $db->setQuery( 'SELECT created_by, id FROM #__quickfaq_items WHERE id = ' . $id ); - $userid = $db->loadResult(); - - return $userid; - } -} \ No newline at end of file diff --git a/site/plugins/com_redshop.plugin.php b/site/plugins/com_redshop.plugin.php deleted file mode 100644 index b899f95d..00000000 --- a/site/plugins/com_redshop.plugin.php +++ /dev/null @@ -1,97 +0,0 @@ -get('DatabaseDriver'); - $query = 'SELECT p.product_id, p.product_name, c.category_id' - . ' FROM #__redshop_product AS p ' - . ' LEFT JOIN #__redshop_product_category_xref AS pcx ON pcx.product_id = p.product_id ' - . ' LEFT JOIN #__redshop_category AS c ON c.category_id = pcx.category_id ' - . ' WHERE p.product_id = ' . $id - ; - - $db->setQuery($query, 0, 1); - $row = $db->loadObject(); - - $info = new JCommentsObjectInfo(); - - if (!empty($row)) { - $Itemid = self::_findItem($id, $row->category_id); - $Itemid = $Itemid > 0 ? '&Itemid='.$Itemid : ''; - - $info->category_id = $row->category_id; - $info->title = $row->product_name; - $info->link = JRoute::_('index.php?option=com_redshop&view=product&pid='.$row->product_id.'&cid='.$row->category_id.$Itemid); - } - - return $info; - } - - protected static function _findItem($product_id, $category_id) - { - $component = JComponentHelper::getComponent('com_redshop'); - $menus = JApplication::getMenu('site'); - $field = (JCOMMENTS_JVERSION == '1.5') ? 'componentid' : 'component_id'; - $items = $menus->getItems($field, $component->id); - $user = JFactory::getUser(); - $access = (int)$user->get('aid'); - - $count = count($items); - - if ($count == 1) { - return $items[0]->id; - } else if ($count > 1) { - foreach($items as $item) { - if ($item->access <= $access) { - if (isset($item->query) && isset($item->query['view'])) { - if ($item->query['view'] == 'category' && isset($item->query['cid'])) { - if ($item->query['cid'] = $category_id) { - return $item->id; - } - } - } - } - } - - $db = Factory::getContainer()->get('DatabaseDriver'); - $db->setQuery('SELECT category_id FROM #__redshop_product_category_xref WHERE product_id = ' . $product_id); - $categories = $db->loadResultArray(); - - foreach($items as $item) { - if ($item->access <= $access) { - if (isset($item->query) && isset($item->query['view'])) { - if ($item->query['view'] == 'category' && isset($item->query['cid'])) { - if (in_array($item->query['cid'], $categories)) { - return $item->id; - } - } - } - } - } - } - - $active = $menus->getActive(); - if ($active) { - return $active->id; - } - - return false; - } -} \ No newline at end of file diff --git a/site/plugins/com_remository.plugin.php b/site/plugins/com_remository.plugin.php deleted file mode 100644 index 9e7106f9..00000000 --- a/site/plugins/com_remository.plugin.php +++ /dev/null @@ -1,40 +0,0 @@ -get('DatabaseDriver'); - $db->setQuery( 'SELECT filetitle, id FROM #__downloads_files WHERE id = ' . $id ); - return $db->loadResult(); - } - - function getObjectLink($id) - { - $_Itemid = self::getItemid('com_remository'); - $link = JoomlaTuneRoute::_( 'index.php?option=com_remository&func=fileinfo&id=' . $id . '&Itemid=' . $_Itemid ); - return $link; - } - - function getObjectOwner($id) - { - $db = Factory::getContainer()->get('DatabaseDriver'); - $db->setQuery( 'SELECT userid FROM #__downloads_files WHERE id = ' . $id ); - $userid = $db->loadResult(); - - return $userid; - } -} \ No newline at end of file diff --git a/site/plugins/com_resource.plugin.php b/site/plugins/com_resource.plugin.php deleted file mode 100644 index 44dfbe24..00000000 --- a/site/plugins/com_resource.plugin.php +++ /dev/null @@ -1,49 +0,0 @@ -get('DatabaseDriver'); - $db->setQuery( 'SELECT title, id FROM #__js_res_record WHERE id = ' . $id ); - return $db->loadResult(); - } - - function getObjectLink($id) - { - include_once(JPATH_ROOT.DS.'administrator'.DS.'components'.DS.'com_resource'.DS.'library'.DS.'helper.php'); - if (class_exists('MEUrl')) { - $link = MEUrl::link_record($id); - } else { - $_Itemid = self::getItemid('com_resource'); - $link = 'index.php?option=com_resource&controller=article&article='.$id; - $link .= ($_Itemid > 0) ? ('&Itemid=' . $_Itemid) : ''; - } - - $link = JRoute::_( $link ); - - return $link; - } - - function getObjectOwner($id) - { - $db = Factory::getContainer()->get('DatabaseDriver'); - $db->setQuery( "SELECT created_by FROM #__js_res_record WHERE id='$id'"); - $userid = $db->loadResult(); - - return $userid; - } -} \ No newline at end of file diff --git a/site/plugins/com_rsevents.plugin.php b/site/plugins/com_rsevents.plugin.php index 0a332619..c73c3e18 100644 --- a/site/plugins/com_rsevents.plugin.php +++ b/site/plugins/com_rsevents.plugin.php @@ -1,37 +1,35 @@ -get('DatabaseDriver'); - $db->setQuery('SELECT id, title, created_by FROM #__rsevents WHERE id = ' . $id); - $row = $db->loadObject(); - - $info = new JCommentsObjectInfo(); - - if (!empty($row)) { - $Itemid = self::getItemid('com_rsevents'); - $Itemid = $Itemid > 0 ? '&Itemid='.$Itemid : ''; - - $info->title = $row->title; - $info->userid = $row->created_by; - $info->link = JRoute::_('index.php?option=com_rsevents&view=events&layout=show&cid='.$row->id); - } - - return $info; - } +setQuery('SELECT id, title, created_by FROM #__rsevents WHERE id = ' . $id); + $row = $db->loadObject(); + + $info = new JCommentsObjectInfo(); + + if (!empty($row)) { + $Itemid = self::getItemid('com_rsevents'); + $Itemid = $Itemid > 0 ? '&Itemid='.$Itemid : ''; + + $info->title = $row->title; + $info->userid = $row->created_by; + $info->link = JRoute::_('index.php?option=com_rsevents&view=events&layout=show&cid='.$row->id); + } + + return $info; + } } \ No newline at end of file diff --git a/site/plugins/com_rseventspro.plugin.php b/site/plugins/com_rseventspro.plugin.php index c91b83b9..9421aec8 100644 --- a/site/plugins/com_rseventspro.plugin.php +++ b/site/plugins/com_rseventspro.plugin.php @@ -1,38 +1,36 @@ -get('DatabaseDriver'); - $db->setQuery('SELECT id, name, owner FROM #__rseventspro_eventsWHERE id = ' . $id); - $row = $db->loadObject(); - - $info = new JCommentsObjectInfo(); - - if (!empty($row)) { - $Itemid = self::getItemid('com_rseventspro'); - $Itemid = $Itemid > 0 ? '&Itemid='.$Itemid : ''; - - $info->title = $row->name; - $info->userid = $row->owner; - $info->link = JRoute::_('index.php?option=com_rseventspro&view=rseventspro&layout=show&id='.$row->id); - } - - return $info; - } -} +setQuery('SELECT id, name, owner FROM #__rseventspro_events WHERE id = ' . $id); + $row = $db->loadObject(); + + $info = new JCommentsObjectInfo(); + + if (!empty($row)) { + $Itemid = self::getItemid('com_rseventspro'); + $Itemid = $Itemid > 0 ? '&Itemid='.$Itemid : ''; + + $info->title = $row->name; + $info->userid = $row->owner; + $info->link = JRoute::_('index.php?option=com_rseventspro&view=rseventspro&layout=show&id='.$row->id); + } + + return $info; + } +} diff --git a/site/plugins/com_sermonspeaker.plugin.php b/site/plugins/com_sermonspeaker.plugin.php index 670817fb..5b2b7ca0 100644 --- a/site/plugins/com_sermonspeaker.plugin.php +++ b/site/plugins/com_sermonspeaker.plugin.php @@ -1,42 +1,40 @@ -get('DatabaseDriver'); - $query = 'SELECT id, sermon_title, created_by ' - . ' FROM #__sermon_sermons' - . ' WHERE id = '.$id - ; - $db->setQuery($query); - $row = $db->loadObject(); - - if (!empty($row)) { - $Itemid = self::getItemid('com_sermonspeaker'); - $Itemid = $Itemid > 0 ? '&Itemid='.$Itemid : ''; - - $info->title = $row->sermon_title; - $info->access = 0; - $info->userid = $row->created_by; - $info->link = JRoute::_('index.php?option=com_sermonspeaker&view=sermon&id=' . $row->id . $Itemid); - } - - return $info; - } +setQuery($query); + $row = $db->loadObject(); + + if (!empty($row)) { + $Itemid = self::getItemid('com_sermonspeaker'); + $Itemid = $Itemid > 0 ? '&Itemid='.$Itemid : ''; + + $info->title = $row->sermon_title; + $info->access = 0; + $info->userid = $row->created_by; + $info->link = JRoute::_('index.php?option=com_sermonspeaker&view=sermon&id=' . $row->id . $Itemid); + } + + return $info; + } } \ No newline at end of file diff --git a/site/plugins/com_seyret.plugin.php b/site/plugins/com_seyret.plugin.php deleted file mode 100644 index 8b14b5e7..00000000 --- a/site/plugins/com_seyret.plugin.php +++ /dev/null @@ -1,37 +0,0 @@ -get('DatabaseDriver'); - $db->setQuery('SELECT id, title, addedby FROM #__seyret_items WHERE id = '.$id); - $row = $db->loadObject(); - - $info = new JCommentsObjectInfo(); - - if (!empty($row)) { - $Itemid = self::getItemid('com_seyret'); - $Itemid = $Itemid > 0 ? '&Itemid='.$Itemid : ''; - - $info->title = $row->title; - $info->userid = $row->addedby; - $info->link = JRoute::_('index.php?option=com_seyret&task=videodirectlink&id='.$id.$Itemid); - } - - return $info; - } -} \ No newline at end of file diff --git a/site/plugins/com_sobi2.plugin.php b/site/plugins/com_sobi2.plugin.php deleted file mode 100644 index 5c262fd9..00000000 --- a/site/plugins/com_sobi2.plugin.php +++ /dev/null @@ -1,68 +0,0 @@ -get('DatabaseDriver'); - $query = "SELECT i.itemid as id, i.title, i.owner" - . " FROM #__sobi2_item as i" - . " WHERE i.itemid = " . $id; - $db->setQuery($query); - $row = $db->loadObject(); - - $info = new JCommentsObjectInfo(); - - if (!empty($row)) { - $configFile = JPATH_SITE.'/components/com_sobi2/config.class.php'; - if (is_file($configFile)) { - require_once($configFile); - - $config = sobi2Config::getInstance(); - - $info->title = self::getSobiStr($row->title); - $info->access = NULL; - $info->userid = $row->owner; - $info->link = sobi2Config::sef('index.php?option=com_sobi2&sobi2Task=sobi2Details&sobi2Id=' . $id . '&Itemid=' . $config->sobi2Itemid); - } - } - - return $info; - } - - /** - * reversing MySQL injection filter - * - * @param string $string - string to decode - * @return string - */ - protected static function getSobiStr( $string ) - { - if( $string ) { - $iso = defined("_ISO") ? explode( '=', _ISO ) : array( null, "UTF-8"); - if(strtoupper($iso[1]) != "UTF-8" ) { - $string = stripslashes(stripslashes(html_entity_decode($string, ENT_COMPAT, 'UTF-8'))); - } - else { - $string = stripslashes(stripslashes($string)); - } - if( !strstr( "get('DatabaseDriver'); - $query = "SELECT o.id, o.name, o.owner, o.parent, fd.baseData" - . " FROM #__sobipro_object as o" - . " LEFT JOIN #__sobipro_field_data AS fd ON o.id = fd.sid" - . " JOIN #__sobipro_field AS f ON fd.fid = f.fid AND f.nid = 'field_name'" - . " WHERE o.id = " . $id - . " AND o.oType = 'entry'" - ; - - $db->setQuery($query); - $row = $db->loadObject(); - - if (!empty($row)) { - $sobiCore = JPATH_SITE.'/components/com_sobipro/lib/base/fs/loader.php'; - if (is_file($sobiCore)) { - if (!defined( 'SOBIPRO')) { - $ver = new JVersion(); - $ver = str_replace( '.', null, $ver->RELEASE ); - if ($ver > '15') { $ver = '16'; } - define('SOBI_CMS', 'joomla'. $ver); - define('SOBIPRO', true); - define('SOBI_TASK', 'task'); - define('SOBI_DEFLANG', JFactory::getLanguage()->getDefault()); - define('SOBI_ACL', 'front'); - define('SOBI_ROOT', JPATH_ROOT); - define('SOBI_MEDIA', implode(DS, array(JPATH_ROOT, 'media', 'sobipro'))); - define('SOBI_MEDIA_LIVE', JURI::root().'/media/sobipro'); - define('SOBI_PATH', JPATH_ROOT.'/components/com_sobipro'); - define('SOBI_LIVE_PATH', 'components/com_sobipro'); - require_once (JPATH_ROOT.'/components/com_sobipro/lib/base/fs/loader.php'); - } - - SPLoader::loadClass( 'sobi' ); - SPLoader::loadClass( 'base.request' ); - SPLoader::loadClass( 'base.object' ); - SPLoader::loadClass( 'base.factory' ); - SPLoader::loadClass( 'base.mainframe' ); - SPLoader::loadClass( 'base.const' ); - SPLoader::loadClass( 'cms.base.mainframe' ); - SPLoader::loadClass( 'cms.base.lang' ); - - $info->title = empty($row->name) ? (isset($row->baseData) ? $row->baseData : '') : $row->name; - $info->access = NULL; - $info->userid = $row->owner; - - $info->link = Sobi::Url(array('title' => $row->name, 'pid' => $row->parent, 'sid' => $row->id)); - } - } - } - - return $info; - } -} \ No newline at end of file diff --git a/site/plugins/com_tienda.plugin.php b/site/plugins/com_tienda.plugin.php deleted file mode 100644 index 7b6a1410..00000000 --- a/site/plugins/com_tienda.plugin.php +++ /dev/null @@ -1,50 +0,0 @@ -get('DatabaseDriver'); - - $query = "SELECT a.product_id as id, a.product_name as title" - . "\n , c.category_id" - . "\n FROM #__tienda_products AS a" - . "\n LEFT JOIN #__tienda_productcategoryxref AS b ON b.product_id = a.product_id" - . "\n LEFT JOIN #__tienda_categories AS c ON b.category_id = c.category_id" - . "\n WHERE a.product_id = " . intval($id) - ; - - $db->setQuery( $query, 0, 1); - $product = $db->loadObject(); - - $info = new JCommentsObjectInfo(); - - if (!empty($product)) { - $routerHelper = JPATH_ROOT.'/administrator/components/com_tienda/helpers/route.php'; - if (is_file($routerHelper)) { - require_once($routerHelper); - - $info->category_id = $product->category_id; - $info->title = $product->title; - $info->access = 0; - $info->userid = 0; - $info->link = JRoute::_(TiendaHelperRoute::product($id, $product->category_id)); - } - } - - return $info; - } -} \ No newline at end of file diff --git a/site/plugins/com_tpdugg.plugin.php b/site/plugins/com_tpdugg.plugin.php deleted file mode 100644 index 69493f1c..00000000 --- a/site/plugins/com_tpdugg.plugin.php +++ /dev/null @@ -1,38 +0,0 @@ -get('DatabaseDriver'); - $db->setQuery("SELECT title, id FROM #__tpdugg WHERE id='$id'"); - return $db->loadResult(); - } - - function getObjectLink($id) - { - $_Itemid = self::getItemid('com_tpdugg'); - $link = JRoute::_('index.php?option=com_tpdugg&task=detail&id='.$id.'&show=comments'.'&Itemid='. $_Itemid); - return $link; - } - - function getObjectOwner($id) - { - $db = Factory::getContainer()->get('DatabaseDriver'); - $db->setQuery("SELECT userid FROM #__tpdugg WHERE id='$id'"); - return $db->loadResult(); - } -} \ No newline at end of file diff --git a/site/plugins/com_tz_portfolio.plugin.php b/site/plugins/com_tz_portfolio.plugin.php index f19dcf42..76286801 100644 --- a/site/plugins/com_tz_portfolio.plugin.php +++ b/site/plugins/com_tz_portfolio.plugin.php @@ -1,53 +1,51 @@ -get('DatabaseDriver'); - $query = $db->getQuery(true); - - $query->select('a.id, a.title, a.created_by, a.access, a.alias, a.catid'); - $query->from('#__content AS a'); - - $query->select('c.alias AS category_alias'); - $query->join('LEFT', '#__categories AS c ON c.id = a.catid'); - - $query->where('a.id = ' . (int) $id); - - $db->setQuery($query); - $row = $db->loadObject(); - - if (!empty($row)) { - $row->slug = $row->alias ? ($row->id.':'.$row->alias) : $row->id; - $row->catslug = $row->category_alias ? ($row->catid.':'.$row->category_alias) : $row->catid; - - $info->category_id = $row->category_id; - $info->title = $row->title; - $info->userid = $row->created_by; - $info->link = JRoute::_(TZ_PortfolioHelperRoute::getArticleRoute($row->slug, $row->catslug)); - } - } - - return $info; - } +getQuery(true); + + $query->select('a.id, a.title, a.created_by, a.access, a.alias, a.catid'); + $query->from('#__content AS a'); + + $query->select('c.alias AS category_alias'); + $query->join('LEFT', '#__categories AS c ON c.id = a.catid'); + + $query->where('a.id = ' . (int) $id); + + $db->setQuery($query); + $row = $db->loadObject(); + + if (!empty($row)) { + $row->slug = $row->alias ? ($row->id.':'.$row->alias) : $row->id; + $row->catslug = $row->category_alias ? ($row->catid.':'.$row->category_alias) : $row->catid; + + $info->category_id = $row->category_id; + $info->title = $row->title; + $info->userid = $row->created_by; + $info->link = JRoute::_(TZ_PortfolioHelperRoute::getArticleRoute($row->slug, $row->catslug)); + } + } + + return $info; + } } \ No newline at end of file diff --git a/site/plugins/com_videoflow.plugin.php b/site/plugins/com_videoflow.plugin.php deleted file mode 100644 index a1c67d43..00000000 --- a/site/plugins/com_videoflow.plugin.php +++ /dev/null @@ -1,40 +0,0 @@ -get('DatabaseDriver'); - - $query = "SELECT id, title, userid FROM #__vflow_data WHERE published = 1 AND id = " . (int) $id; - $db->setQuery($query, 0, 1); - $row = $db->loadObject(); - - $info = new JCommentsObjectInfo(); - - if (!empty($row)) { - $_Itemid = self::getItemid('com_videoflow'); - - $info->title = empty($row->title) ? 'VideoFlow Multimedia Content - No Title' : $row->title; - $info->access = 0; - $info->userid = $row->userid; - $info->link = JRoute::_("index.php?option=com_videoflow&task=play&id=" . $id . "&Itemid=" . $_Itemid); - } - - return $info; - } -} \ No newline at end of file diff --git a/site/plugins/com_virtuemart.plugin.php b/site/plugins/com_virtuemart.plugin.php index 2a37de07..1f373ce7 100644 --- a/site/plugins/com_virtuemart.plugin.php +++ b/site/plugins/com_virtuemart.plugin.php @@ -1,49 +1,47 @@ -get('DatabaseDriver'); - $db->setQuery('SELECT product_name, created_by FROM #__virtuemart_products_' . VMLANG . ' WHERE virtuemart_product_id =' . $id); - $row = $db->loadObject(); - - if (!empty($row)) { - $db->setQuery('SELECT virtuemart_category_id FROM #__virtuemart_product_categories WHERE virtuemart_product_id =' . $id); - $categoryId = $db->loadResult(); - - $info->title = $row->product_name; - $info->userid = $row->created_by; - $info->link = AllEventsHelperRoute::getEventRoute($id); - $info->link = JRoute::_('index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=' . $id . '&virtuemart_category_id=' . $categoryId); - } - } - - return $info; - } +setQuery('SELECT product_name, created_by FROM #__virtuemart_products_' . VMLANG . ' WHERE virtuemart_product_id =' . $id); + $row = $db->loadObject(); + + if (!empty($row)) { + $db->setQuery('SELECT virtuemart_category_id FROM #__virtuemart_product_categories WHERE virtuemart_product_id =' . $id); + $categoryId = $db->loadResult(); + + $info->title = $row->product_name; + $info->userid = $row->created_by; + $info->link = AllEventsHelperRoute::getEventRoute($id); + $info->link = JRoute::_('index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=' . $id . '&virtuemart_category_id=' . $categoryId); + } + } + + return $info; + } } \ No newline at end of file diff --git a/site/plugins/com_weblinks.plugin.php b/site/plugins/com_weblinks.plugin.php index bb23bab9..27b75331 100644 --- a/site/plugins/com_weblinks.plugin.php +++ b/site/plugins/com_weblinks.plugin.php @@ -1,48 +1,46 @@ -get('DatabaseDriver'); - $db->setQuery( 'SELECT title, id FROM #__categories WHERE section = "com_weblinks" and id = ' . $id ); - return $db->loadResult(); - } - - function getObjectLink($id) - { - $db = Factory::getContainer()->get('DatabaseDriver'); - $db->setQuery( 'SELECT alias FROM #__categories WHERE section = "com_weblinks" and id = ' . $id ); - $alias = $db->loadResult(); - - $link = 'index.php?option=com_weblinks&view=category&id='. $id.':'.$alias; - - require_once(JPATH_SITE.DS.'includes'.DS.'application.php'); - - $component = JComponentHelper::getComponent('com_weblinks'); - $menus = JApplication::getMenu('site'); - $items = $menus->getItems('componentid', $component->id); - - if (count($items)) { - $link .= "&Itemid=" . $items[0]->id; - } - - $link = JRoute::_($link); - - return $link; - } +setQuery( 'SELECT title, id FROM #__categories WHERE section = "com_weblinks" and id = ' . $id ); + return $db->loadResult(); + } + + function getObjectLink($id) + { + $db = JFactory::getDBO(); + $db->setQuery( 'SELECT alias FROM #__categories WHERE section = "com_weblinks" and id = ' . $id ); + $alias = $db->loadResult(); + + $link = 'index.php?option=com_weblinks&view=category&id='. $id.':'.$alias; + + require_once(JPATH_SITE.'/includes/application.php'); + + $component = JComponentHelper::getComponent('com_weblinks'); + $menus = JApplication::getMenu('site'); + $items = $menus->getItems('componentid', $component->id); + + if (count($items)) { + $link .= "&Itemid=" . $items[0]->id; + } + + $link = JRoute::_($link); + + return $link; + } } \ No newline at end of file diff --git a/site/plugins/com_yvcommodity.plugin.php b/site/plugins/com_yvcommodity.plugin.php deleted file mode 100644 index aaeec48d..00000000 --- a/site/plugins/com_yvcommodity.plugin.php +++ /dev/null @@ -1,52 +0,0 @@ -getQuery(true); - - $query->select('a.id, a.title, a.created_by, a.access, a.alias, a.cat_id'); - $query->from($db->quoteName('#__yvc') . ' AS a'); - $query->select('c.alias AS category_alias'); - $query->join('LEFT', $db->quoteName('#__yvc_catg') . ' AS c ON c.cat_id = a.cat_id'); - $query->where('a.id = ' . (int) $id); - - $db->setQuery($query); - $row = $db->loadObject(); - - if (!empty($row)) { - $row->slug = $row->alias ? ($row->id.':'.$row->alias) : $row->id; - $row->catslug = $row->category_alias ? ($row->cat_id.':'.$row->category_alias) : $row->cat_id; - - $info->category_id = $row->cat_id; - $info->title = $row->title; - $info->access = $row->access; - $info->userid = $row->created_by; - $info->link = JRoute::_( "index.php?option=com_yvcommodity&Itemid=". yvHelper::get_yvc_Itemid(). "&view=commodity&id=". $row->slug. "&cid=". $row->catslug); - } - } - - return $info; - } -} \ No newline at end of file diff --git a/site/plugins/com_zoo.plugin.php b/site/plugins/com_zoo.plugin.php index b70d1d01..dc0cbe33 100644 --- a/site/plugins/com_zoo.plugin.php +++ b/site/plugins/com_zoo.plugin.php @@ -1,36 +1,42 @@ -table->item->get($id); - if (!empty($item)) { - $info->title = $item->name; - $info->access = $item->access; - $info->userid = $item->created_by; - $info->link = JRoute::_($zooApp->route->item($item)); - } - } - } - return $info; - } +isAdmin()) { + + $zooConfig = JPATH_ADMINISTRATOR.'/components/com_zoo/config.php'; + + if (is_file($zooConfig)) { + require_once($zooConfig); + + $zooApp = App::getInstance('zoo'); + $item = $zooApp->table->item->get($id); + + if (!empty($item)) { + $info->title = $item->name; + $info->access = $item->access; + $info->userid = $item->created_by; + $info->link = JRoute::_($zooApp->route->item($item)); + } + } + } + + return $info; + } } \ No newline at end of file