Файловый менеджер - Редактировать - /home/digilove/public_html/41423/helper.php.tar
Назад
home/digilove/public_html/modules/mod_seller_banner/helper.php 0000644 00000001416 15232603610 0020712 0 ustar 00 <?php /** * Marketplace Menus module * * PHP version 7.0 * * @category Module * @package Joomla * @author WebKul software private limited <support@webkul.com> * @copyright 2010 WebKul software private limited * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL * @version GIT:5.2 * @filesource http://store.webkul.com * @link Technical Support: webkul.uvdesk.com */ // no direct access defined('_JEXEC') or die(); /** * SellerBannerHelper - Mp Seller Banner Helper Class. * * @category Module * @package Joomla * @author WebKul software private limited <support@webkul.com> * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL * @link Technical Support: webkul.uvdesk.com */ class ModSellerBannerHelper { } home/digilove/public_html/modules/mod_feed/helper.php 0000644 00000001611 15234437754 0017017 0 ustar 00 <?php /** * @package Joomla.Site * @subpackage mod_feed * * @copyright (C) 2006 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * Helper for mod_feed * * @since 1.5 */ class ModFeedHelper { /** * Retrieve feed information * * @param \Joomla\Registry\Registry $params module parameters * * @return JFeedReader|string */ public static function getFeed($params) { // Module params $rssurl = $params->get('rssurl', ''); // Get RSS parsed object try { $feed = new JFeedFactory; $rssDoc = $feed->getFeed($rssurl); } catch (Exception $e) { return JText::_('MOD_FEED_ERR_FEED_NOT_RETRIEVED'); } if (empty($rssDoc)) { return JText::_('MOD_FEED_ERR_FEED_NOT_RETRIEVED'); } if ($rssDoc) { return $rssDoc; } } } home/digilove/public_html/administrator/includes/helper.php 0000644 00000001737 15234461446 0020277 0 ustar 00 <?php /** * @package Joomla.Administrator * * @copyright (C) 2007 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * Joomla! Administrator Application helper class. * Provide many supporting API functions. * * @since 1.5 * * @deprecated 4.0 Deprecated without replacement */ class JAdministratorHelper { /** * Return the application option string [main component]. * * @return string The component to access. * * @since 1.5 */ public static function findOption() { $app = JFactory::getApplication(); $option = strtolower($app->input->get('option')); $app->loadIdentity(); $user = $app->getIdentity(); if ($user->get('guest') || !$user->authorise('core.login.admin')) { $option = 'com_login'; } if (empty($option)) { $option = 'com_cpanel'; } $app->input->set('option', $option); return $option; } } home/digilove/public_html/modules/mod_related_items/helper.php 0000644 00000010267 15234516720 0020733 0 ustar 00 <?php /** * @package Joomla.Site * @subpackage mod_related_items * * @copyright (C) 2006 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; JLoader::register('ContentHelperRoute', JPATH_SITE . '/components/com_content/helpers/route.php'); /** * Helper for mod_related_items * * @since 1.5 */ abstract class ModRelatedItemsHelper { /** * Get a list of related articles * * @param \Joomla\Registry\Registry &$params module parameters * * @return array */ public static function getList(&$params) { $db = JFactory::getDbo(); $app = JFactory::getApplication(); $user = JFactory::getUser(); $groups = implode(',', $user->getAuthorisedViewLevels()); $date = JFactory::getDate(); $maximum = (int) $params->get('maximum', 5); // Get an instance of the generic articles model JModelLegacy::addIncludePath(JPATH_SITE . '/components/com_content/models'); $articles = JModelLegacy::getInstance('Articles', 'ContentModel', array('ignore_request' => true)); if ($articles === false) { JFactory::getApplication()->enqueueMessage(JText::_('JERROR_AN_ERROR_HAS_OCCURRED'), 'error'); return array(); } // Set application parameters in model $appParams = $app->getParams(); $articles->setState('params', $appParams); $option = $app->input->get('option'); $view = $app->input->get('view'); if (!($option === 'com_content' && $view === 'article')) { return array(); } $temp = $app->input->getString('id'); $temp = explode(':', $temp); $id = $temp[0]; $nullDate = $db->getNullDate(); $now = $date->toSql(); $related = array(); $query = $db->getQuery(true); if ($id) { // Select the meta keywords from the item $query->select('metakey') ->from('#__content') ->where('id = ' . (int) $id); $db->setQuery($query); try { $metakey = trim($db->loadResult()); } catch (RuntimeException $e) { JFactory::getApplication()->enqueueMessage(JText::_('JERROR_AN_ERROR_HAS_OCCURRED'), 'error'); return array(); } // Explode the meta keys on a comma $keys = explode(',', $metakey); $likes = array(); // Assemble any non-blank word(s) foreach ($keys as $key) { $key = trim($key); if ($key) { $likes[] = $db->escape($key); } } if (count($likes)) { // Select other items based on the metakey field 'like' the keys found $query->clear() ->select('a.id') ->from('#__content AS a') ->where('a.id != ' . (int) $id) ->where('a.state = 1') ->where('a.access IN (' . $groups . ')'); $wheres = array(); foreach ($likes as $keyword) { $wheres[] = 'a.metakey LIKE ' . $db->quote('%' . $keyword . '%'); } $query->where('(' . implode(' OR ', $wheres) . ')') ->where('(a.publish_up = ' . $db->quote($nullDate) . ' OR a.publish_up <= ' . $db->quote($now) . ')') ->where('(a.publish_down = ' . $db->quote($nullDate) . ' OR a.publish_down >= ' . $db->quote($now) . ')'); // Filter by language if (JLanguageMultilang::isEnabled()) { $query->where('a.language in (' . $db->quote(JFactory::getLanguage()->getTag()) . ',' . $db->quote('*') . ')'); } $db->setQuery($query, 0, $maximum); try { $articleIds = $db->loadColumn(); } catch (RuntimeException $e) { JFactory::getApplication()->enqueueMessage(JText::_('JERROR_AN_ERROR_HAS_OCCURRED'), 'error'); return array(); } if (count($articleIds)) { $articles->setState('filter.article_id', $articleIds); $articles->setState('filter.published', 1); $related = $articles->getItems(); } unset($articleIds); } } if (count($related)) { // Prepare data for display using display options foreach ($related as &$item) { $item->slug = $item->id . ':' . $item->alias; /** @deprecated Catslug is deprecated, use catid instead. 4.0 */ $item->catslug = $item->catid . ':' . $item->category_alias; $item->route = JRoute::_(ContentHelperRoute::getArticleRoute($item->slug, $item->catid, $item->language)); } } return $related; } } home/digilove/public_html/modules/mod_marketplacemenus/helper.php 0000644 00000012225 15234531604 0021444 0 ustar 00 <?php /** * Marketplace Menus module * * PHP version 7.0 * * @category Module * @package Joomla * @author WebKul software private limited <support@webkul.com> * @copyright 2010 WebKul software private limited * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL * @version GIT:5.2 * @filesource http://store.webkul.com * @link Technical Support: webkul.uvdesk.com */ // no direct access defined('_JEXEC') or die(); /** * ModSocLoginHelper class * * @category Module * @package Joomla * @author WebKul software private limited <support@webkul.com> * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL * @link Technical Support: webkul.uvdesk.com */ class ModMpMenuHelper { /** * CheckAndStoreUser function * * @param array $user var * * @return void */ function checkAndStoreUser($user = array()) { $chk_user = $this->_checkUser($user['email']); if (!$chk_user) { $this->_registerUser($user); $chk_user = $this->_checkUser($user['email']); } // Login user $result = $this->_forceLogin($chk_user); $juri = JUri::getInstance(); /* $url = $juri->root(); JFactory::getApplication()->redirect($url); */ } /** * Check User exists using email function * * @param string $email var * * @return void */ private function _checkUser($email="") { $db=JFactory::getDbo(); $query=$db->getQuery(true); $query->select("id")->from($db->quoteName("#__users"))->where( $db->QuoteName("email")."=".$db->quote($email) ); $db->setQuery($query); $result = $db->loadObject(); if (isset($result->id)) { return $result->id; } return 0; } /** * Register User function * * @param array $user var * * @return void */ private function _registerUser($user = array()) { JModelLegacy::addIncludePath(JPATH_SITE . '/components/com_users/models/'); $model = JModelLegacy::getInstance('Registration', 'UsersModel'); $user["username"] = substr($user['name'], 0, strpos($user['name'], ' ')); if (empty($user["username"])) { $user["username"] = $user['name']; } $username = $user["username"]; $match_found = true; $i=0; $db= JFactory::getDbo(); while ($match_found) { $query = $db->getQuery(true); $query->select($db->quoteName("email")) ->from($db->quoteName("#__users")) ->where($db->quoteName("username")."=".$db->quote($username)); $db->setQuery($query); try { $res_match_user = $db->loadObject(); } catch (Exception $e) { $match_found= true; } if (isset($res_match_user) && $res_match_user->email !== $user["email"]) { $username=$username.(++$i); $match_found= true; } else { $match_found= false; } } $user["username"] = $username; $user["password"] = $this->randomPassword(); $lang = JFactory::getLanguage(); $extension = 'com_users'; $base_dir = JPATH_SITE; $lang->load($extension, $base_dir); $data=array( "name" => $user["name"], "username" => strtolower($user["username"]), "password1" => $user["password"], "password2" => $user["password"], "email1" => $user["email"], "email2" => $user["email"] ); $res=$model->register($data); return $res; } /** * Random Password function * * @param integer $length Password length * * @return void */ function randomPassword($length = 8) { $alphabet = 'abcdefghijklmnopqrstuvwxyzAB'. 'CDEFGHIJKLMNOPQRSTUVWXYZ1234567890+-*/|{}[]()%^&#@!~'; $pass = array(); $alphaLength = strlen($alphabet) - 1; for ($i = 0; $i < $length; $i++) { $n = rand(0, $alphaLength); $pass[] = $alphabet[$n]; } return str_shuffle(implode($pass)); } /** * Force Login function * * @param [type] $userId var * * @return Mixed */ private function _forceLogin($userId) { $user = JFactory::getUser($userId); if ($user->guest) { return 'guest'; } else { //Will authorize you as this user. JPluginHelper::importPlugin('user'); $options = array(); $options['action'] = 'core.login.site'; $response = new stdClass(); $response->username = $user->username; $response->language = ''; $response->email = $user->email; $response->password_clear = ''; $response->fullname = ''; $result = JFactory::getApplication()->triggerEvent( 'onUserLogin', array((array)$response, $options) ); return $result; } } } home/digilove/public_html/modules/mod_profile/helper.php 0000644 00000011035 15234536514 0017547 0 ustar 00 <?php /** * Marketplace Menus module * * PHP version 7.0 * * @category Module * @package Joomla * @author WebKul software private limited <support@webkul.com> * @copyright 2010 WebKul software private limited * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL * @version GIT:5.2 * @filesource http://store.webkul.com * @link Technical Support: webkul.uvdesk.com */ // no direct access defined('_JEXEC') or die(); /** * Webkul - profile Helper Class. * * @category Module * @package Joomla * @author WebKul software private limited <support@webkul.com> * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL * @link Technical Support: webkul.uvdesk.com */ class ModprofileHelper { /** * Get Seller Followers function * * @param integer $seller_id Seller Id * * @return void */ function getSellerFollowers($seller_id=0) { if (!$seller_id) { return false; } $db = JFactory::getDBO(); $query_details = $db->getQuery(true); $query_details ->select('a.*') ->select($db->quoteName(array('b.name', 'b.id'))) ->from($db->quoteName('#__marketplace_seller_follower', 'a')) ->join( 'LEFT', $db->quoteName( '#__users', 'b' ) . ' ON (' . $db->quoteName('a.follower_email') . ' = ' . $db->quoteName('b.email') . ')' ) ->where( $db->quoteName('a.seller_id'). " = ".$db->quote($db->escape($seller_id)) ) ->order($db->quoteName('a.date_follow') . ' DESC'); $wke=array(); $db->setQuery($query_details); try { $followers=array(); return $db->loadObjectlist(); } catch (Exception $e) { return false; } } /** * Check Seller Follower function * * @param integer $seller_id Seller Id * @param Object $user User Object * * @return void */ function checkSellerFollower($seller_id=0, $user=null) { if (!$seller_id || $user==null) { return false; } $db = JFactory::getDBO(); $query=$db->getQuery(true); $query ->select($db->quoteName('follower_email')) ->from($db->quoteName('#__marketplace_seller_follower', 'a')) ->where( $db->quoteName('follower_email'). "=".$db->quote($db->escape($user->email)) ) ->where( $db->quoteName('seller_id'). "=".$db->quote($db->escape($seller_id)) ); try { $db->setQuery($query); $db->execute(); return $db->getNumRows(); } catch (Exception $e) { return false; } } /** * Get Country Name By Code2 function * * @param string $country_code2 var * * @return void */ function getCountryNameByCode2($country_code2="") { if ($country_code2==="") { return ""; } $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->select($db->quoteName('country_name')) ->from($db->quoteName('#__virtuemart_countries')) ->where($db->quoteName('country_2_code')."=".$db->quote($country_code2)); $db->setQuery($query); try{ $result = $db->loadObject(); if (isset($result->country_name)) { return $result->country_name; } return ""; } catch(Exception $e) { return ""; } } /** * Get State Name By Id function * * @param integer $virtuemart_state_id var * * @return void */ function getStateNameById($virtuemart_state_id=0) { if ($virtuemart_state_id===0) { return ""; } $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->select($db->quoteName('state_name')) ->from($db->quoteName('#__virtuemart_states')) ->where($db->quoteName('virtuemart_state_id')."=".$db->quote($virtuemart_state_id)); $db->setQuery($query); try{ $result = $db->loadObject(); if (isset($result->state_name)) { return $result->state_name; } return ""; } catch(Exception $e) { return ""; } } } home/digilove/public_html/modules/mod_articles_news/helper.php 0000644 00000013424 15234543206 0020751 0 ustar 00 <?php /** * @package Joomla.Site * @subpackage mod_articles_news * * @copyright (C) 2010 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; JLoader::register('ContentHelperRoute', JPATH_SITE . '/components/com_content/helpers/route.php'); JModelLegacy::addIncludePath(JPATH_SITE . '/components/com_content/models', 'ContentModel'); /** * Helper for mod_articles_news * * @since 1.6 */ abstract class ModArticlesNewsHelper { /** * Get a list of the latest articles from the article model * * @param \Joomla\Registry\Registry &$params object holding the models parameters * * @return mixed * * @since 1.6 */ public static function getList(&$params) { // Get an instance of the generic articles model $model = JModelLegacy::getInstance('Articles', 'ContentModel', array('ignore_request' => true)); // Set application parameters in model $app = JFactory::getApplication(); $appParams = $app->getParams(); $model->setState('params', $appParams); $model->setState('list.start', 0); $model->setState('filter.published', 1); // Set the filters based on the module params $model->setState('list.limit', (int) $params->get('count', 5)); // This module does not use tags data $model->setState('load_tags', false); // Access filter $access = !JComponentHelper::getParams('com_content')->get('show_noauth'); $authorised = JAccess::getAuthorisedViewLevels(JFactory::getUser()->get('id')); $model->setState('filter.access', $access); // Category filter $model->setState('filter.category_id', $params->get('catid', array())); // Filter by language $model->setState('filter.language', $app->getLanguageFilter()); // Filer by tag $model->setState('filter.tag', $params->get('tag', array())); // Featured switch $featured = $params->get('show_featured', ''); if ($featured === '') { $model->setState('filter.featured', 'show'); } elseif ($featured) { $model->setState('filter.featured', 'only'); } else { $model->setState('filter.featured', 'hide'); } // Set ordering $ordering = $params->get('ordering', 'a.publish_up'); $model->setState('list.ordering', $ordering); if (trim($ordering) === 'rand()') { $model->setState('list.ordering', JFactory::getDbo()->getQuery(true)->Rand()); } else { $direction = $params->get('direction', 1) ? 'DESC' : 'ASC'; $model->setState('list.direction', $direction); $model->setState('list.ordering', $ordering); } // Check if we should trigger additional plugin events $triggerEvents = $params->get('triggerevents', 1); // Retrieve Content $items = $model->getItems(); foreach ($items as &$item) { $item->readmore = strlen(trim($item->fulltext)); $item->slug = $item->id . ':' . $item->alias; /** @deprecated Catslug is deprecated, use catid instead. 4.0 */ $item->catslug = $item->catid . ':' . $item->category_alias; if ($access || in_array($item->access, $authorised)) { // We know that user has the privilege to view the article $item->link = JRoute::_(ContentHelperRoute::getArticleRoute($item->slug, $item->catid, $item->language)); $item->linkText = JText::_('MOD_ARTICLES_NEWS_READMORE'); } else { $item->link = new JUri(JRoute::_('index.php?option=com_users&view=login', false)); $item->link->setVar('return', base64_encode(ContentHelperRoute::getArticleRoute($item->slug, $item->catid, $item->language))); $item->linkText = JText::_('MOD_ARTICLES_NEWS_READMORE_REGISTER'); } $item->introtext = JHtml::_('content.prepare', $item->introtext, '', 'mod_articles_news.content'); // Remove any images belongs to the text if (!$params->get('image')) { $item->introtext = preg_replace('/<img[^>]*>/', '', $item->introtext); } // Show the Intro/Full image field of the article if ($params->get('img_intro_full') !== 'none') { $images = json_decode($item->images); $item->imageSrc = ''; $item->imageAlt = ''; $item->imageCaption = ''; if ($params->get('img_intro_full') === 'intro' && !empty($images->image_intro)) { $item->imageSrc = htmlspecialchars($images->image_intro, ENT_COMPAT, 'UTF-8'); $item->imageAlt = htmlspecialchars($images->image_intro_alt, ENT_COMPAT, 'UTF-8'); if ($images->image_intro_caption) { $item->imageCaption = htmlspecialchars($images->image_intro_caption, ENT_COMPAT, 'UTF-8'); } } elseif ($params->get('img_intro_full') === 'full' && !empty($images->image_fulltext)) { $item->imageSrc = htmlspecialchars($images->image_fulltext, ENT_COMPAT, 'UTF-8'); $item->imageAlt = htmlspecialchars($images->image_fulltext_alt, ENT_COMPAT, 'UTF-8'); if ($images->image_intro_caption) { $item->imageCaption = htmlspecialchars($images->image_fulltext_caption, ENT_COMPAT, 'UTF-8'); } } } if ($triggerEvents) { $item->text = ''; $app->triggerEvent('onContentPrepare', array ('com_content.article', &$item, &$params, 0)); $results = $app->triggerEvent('onContentAfterTitle', array('com_content.article', &$item, &$params, 0)); $item->afterDisplayTitle = trim(implode("\n", $results)); $results = $app->triggerEvent('onContentBeforeDisplay', array('com_content.article', &$item, &$params, 0)); $item->beforeDisplayContent = trim(implode("\n", $results)); $results = $app->triggerEvent('onContentAfterDisplay', array('com_content.article', &$item, &$params, 0)); $item->afterDisplayContent = trim(implode("\n", $results)); } else { $item->afterDisplayTitle = ''; $item->beforeDisplayContent = ''; $item->afterDisplayContent = ''; } } return $items; } } home/digilove/public_html/modules/mod_articles_popular/helper.php 0000644 00000006102 15234550136 0021452 0 ustar 00 <?php /** * @package Joomla.Site * @subpackage mod_articles_popular * * @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; JLoader::register('ContentHelperRoute', JPATH_SITE . '/components/com_content/helpers/route.php'); JModelLegacy::addIncludePath(JPATH_SITE . '/components/com_content/models', 'ContentModel'); /** * Helper for mod_articles_popular * * @since 1.6 */ abstract class ModArticlesPopularHelper { /** * Get a list of popular articles from the articles model * * @param \Joomla\Registry\Registry &$params object holding the models parameters * * @return mixed */ public static function getList(&$params) { // Get an instance of the generic articles model $model = JModelLegacy::getInstance('Articles', 'ContentModel', array('ignore_request' => true)); // Set application parameters in model $app = JFactory::getApplication(); $appParams = $app->getParams(); $model->setState('params', $appParams); $model->setState('list.start', 0); $model->setState('filter.published', 1); // Set the filters based on the module params $model->setState('list.limit', (int) $params->get('count', 5)); $model->setState('filter.featured', $params->get('show_front', 1) == 1 ? 'show' : 'hide'); // This module does not use tags data $model->setState('load_tags', false); // Access filter $access = !JComponentHelper::getParams('com_content')->get('show_noauth'); $authorised = JAccess::getAuthorisedViewLevels(JFactory::getUser()->get('id')); $model->setState('filter.access', $access); // Category filter $model->setState('filter.category_id', $params->get('catid', array())); // Date filter $date_filtering = $params->get('date_filtering', 'off'); if ($date_filtering !== 'off') { $model->setState('filter.date_filtering', $date_filtering); $model->setState('filter.date_field', $params->get('date_field', 'a.created')); $model->setState('filter.start_date_range', $params->get('start_date_range', '1000-01-01 00:00:00')); $model->setState('filter.end_date_range', $params->get('end_date_range', '9999-12-31 23:59:59')); $model->setState('filter.relative_date', $params->get('relative_date', 30)); } // Filter by language $model->setState('filter.language', $app->getLanguageFilter()); // Ordering $model->setState('list.ordering', 'a.hits'); $model->setState('list.direction', 'DESC'); $items = $model->getItems(); foreach ($items as &$item) { $item->slug = $item->id . ':' . $item->alias; /** @deprecated Catslug is deprecated, use catid instead. 4.0 */ $item->catslug = $item->catid . ':' . $item->category_alias; if ($access || in_array($item->access, $authorised)) { // We know that user has the privilege to view the article $item->link = JRoute::_(ContentHelperRoute::getArticleRoute($item->slug, $item->catid, $item->language)); } else { $item->link = JRoute::_('index.php?option=com_users&view=login'); } } return $items; } } home/digilove/public_html/modules/mod_wrapper/helper.php 0000644 00000002604 15234551140 0017561 0 ustar 00 <?php /** * @package Joomla.Site * @subpackage mod_wrapper * * @copyright (C) 2006 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * Helper for mod_wrapper * * @since 1.5 */ class ModWrapperHelper { /** * Gets the parameters for the wrapper * * @param mixed &$params The parameters set in the administrator section * * @return mixed ¶ms The modified parameters * * @since 1.5 */ public static function getParams(&$params) { $params->def('url', ''); $params->def('scrolling', 'auto'); $params->def('height', '200'); $params->def('height_auto', 0); $params->def('width', '100%'); $params->def('add', 1); $params->def('name', 'wrapper'); $url = $params->get('url'); if ($params->get('add')) { // Adds 'http://' if none is set if (strpos($url, '/') === 0) { // Relative URL in component. use server http_host. $url = 'http://' . $_SERVER['HTTP_HOST'] . $url; } elseif (strpos($url, 'http') === false && strpos($url, 'https') === false) { $url = 'http://' . $url; } } // Auto height control if ($params->def('height_auto')) { $load = 'onload="iFrameHeight(this)"'; } else { $load = ''; } $params->set('load', $load); $params->set('url', $url); return $params; } } home/digilove/public_html/modules/mod_sellercategory/helper.php 0000644 00000006562 15234552033 0021136 0 ustar 00 <?php /** * Marketplace Menus module * * PHP version 7.0 * * @category Module * @package Joomla * @author WebKul software private limited <support@webkul.com> * @copyright 2010 WebKul software private limited * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL * @version GIT:5.2 * @filesource http://store.webkul.com * @link Technical Support: webkul.uvdesk.com */ // no direct access defined('_JEXEC') or die(); if (!class_exists('VmConfig')) { include JPATH_ADMINISTRATOR.'/components/com_virtuemart/helpers/config.php'; } /** * Webkul - sellercategory Helper Class. * * @category Module * @package Joomla * @author WebKul software private limited <support@webkul.com> * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL * @link Technical Support: webkul.uvdesk.com */ class ModSellerCategoryHelper { /** * Get Vm Categories function * * @return array */ function getVmCategories() { VmConfig::loadConfig(); $lang_tag=VmConfig::$vmlang; $db = JFactory::getDBO(); $query=$db->getQuery(true); $query->select($db->quoteName('ceg.category_name')); $query->select($db->quoteName('ceg.virtuemart_category_id')); $query->from($db->quoteName('#__virtuemart_categories_'.$lang_tag, 'ceg')); $query->join( 'LEFT', $db->quoteName('#__virtuemart_categories', 'vc')." ON " .$db->quoteName('vc.virtuemart_category_id')."=". $db->quoteName('ceg.virtuemart_category_id') ); $query->join( "LEFT", $db->quoteName('#__virtuemart_product_categories', 'vpc'). " ON ".$db->quoteName('vpc.virtuemart_category_id')."=" .$db->quoteName('ceg.virtuemart_category_id') ); $query->where($db->quoteName('vc.published')."=".$db->quote('1')); $query->group($db->quoteName('ceg.category_name')); try { $db->setQuery($query); return $db->loadObjectlist(); } catch(Exception $e){ return array(); } } /** * Virtuemart Categories Seller Product function * * @param integer $virtuemart_category_id Category Id * @param integer $seller_id Seller Id * * @return array */ function virtuemartCategoriesProduct($virtuemart_category_id=0, $seller_id=0) { $db = JFactory::getDBO(); $query=$db->getQuery(true); $query->select($db->quoteName('vp.virtuemart_product_id')); $query->from($db->quoteName('#__virtuemart_products', 'vp')); $query->join( 'LEFT', $db->quoteName('#__virtuemart_product_categories', 'vpc')." ON " .$db->quoteName('vpc.virtuemart_product_id')."=" .$db->quoteName('vp.virtuemart_product_id') ); $query->where( $db->quoteName('vpc.virtuemart_category_id'). "=".$db->quote($db->escape($virtuemart_category_id)) ); $query->where( $db->quoteName('vp.created_by'). "=".$db->quote($db->escape($seller_id)) ); $query->where($db->quoteName('vp.published')."=".$db->quote('1')); try { $db->setQuery($query); return $db->loadObjectlist(); } catch (Exception $e) { return array(); } } } home/digilove/public_html/modules/mod_tags_similar/helper.php 0000644 00000011753 15234552627 0020577 0 ustar 00 <?php /** * @package Joomla.Site * @subpackage mod_tags_similar * * @copyright (C) 2013 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; use Joomla\Registry\Registry; JLoader::register('TagsHelperRoute', JPATH_BASE . '/components/com_tags/helpers/route.php'); /** * Helper for mod_tags_similar * * @since 3.1 */ abstract class ModTagssimilarHelper { /** * Get a list of tags * * @param Registry &$params Module parameters * * @return array */ public static function getList(&$params) { $app = JFactory::getApplication(); $option = $app->input->get('option'); $view = $app->input->get('view'); // For now assume com_tags and com_users do not have tags. // This module does not apply to list views in general at this point. if ($option === 'com_tags' || $view === 'category' || $option === 'com_users') { return array(); } $db = JFactory::getDbo(); $user = JFactory::getUser(); $groups = implode(',', $user->getAuthorisedViewLevels()); $matchtype = $params->get('matchtype', 'all'); $maximum = $params->get('maximum', 5); $ordering = $params->get('ordering', 'count'); $tagsHelper = new JHelperTags; $prefix = $option . '.' . $view; $id = $app->input->getInt('id'); $now = JFactory::getDate()->toSql(); $nullDate = $db->getNullDate(); $tagsToMatch = $tagsHelper->getTagIds($id, $prefix); if (!$tagsToMatch || $tagsToMatch === null) { return array(); } $tagCount = substr_count($tagsToMatch, ',') + 1; $query = $db->getQuery(true) ->select( array( $db->quoteName('m.core_content_id'), $db->quoteName('m.content_item_id'), $db->quoteName('m.type_alias'), 'COUNT( ' . $db->quoteName('tag_id') . ') AS ' . $db->quoteName('count'), $db->quoteName('ct.router'), $db->quoteName('cc.core_title'), $db->quoteName('cc.core_alias'), $db->quoteName('cc.core_catid'), $db->quoteName('cc.core_language'), $db->quoteName('cc.core_params'), ) ); $query->from($db->quoteName('#__contentitem_tag_map', 'm')); $query->join('INNER', $db->quoteName('#__tags', 't') . ' ON m.tag_id = t.id') ->join('INNER', $db->quoteName('#__ucm_content', 'cc') . ' ON m.core_content_id = cc.core_content_id') ->join('INNER', $db->quoteName('#__content_types', 'ct') . ' ON m.type_alias = ct.type_alias'); $query->where($db->quoteName('m.tag_id') . ' IN (' . $tagsToMatch . ')'); $query->where('t.access IN (' . $groups . ')'); $query->where('(cc.core_access IN (' . $groups . ') OR cc.core_access = 0)'); // Don't show current item $query->where('(' . $db->quoteName('m.content_item_id') . ' <> ' . $id . ' OR ' . $db->quoteName('m.type_alias') . ' <> ' . $db->quote($prefix) . ')' ); // Only return published tags $query->where($db->quoteName('cc.core_state') . ' = 1 ') ->where('(' . $db->quoteName('cc.core_publish_up') . '=' . $db->quote($nullDate) . ' OR ' . $db->quoteName('cc.core_publish_up') . '<=' . $db->quote($now) . ')' ) ->where('(' . $db->quoteName('cc.core_publish_down') . '=' . $db->quote($nullDate) . ' OR ' . $db->quoteName('cc.core_publish_down') . '>=' . $db->quote($now) . ')' ); // Optionally filter on language $language = JComponentHelper::getParams('com_tags')->get('tag_list_language_filter', 'all'); if ($language !== 'all') { if ($language === 'current_language') { $language = JHelperContent::getCurrentLanguage(); } $query->where($db->quoteName('cc.core_language') . ' IN (' . $db->quote($language) . ', ' . $db->quote('*') . ')'); } $query->group( $db->quoteName( array('m.core_content_id', 'm.content_item_id', 'm.type_alias', 'ct.router', 'cc.core_title', 'cc.core_alias', 'cc.core_catid', 'cc.core_language', 'cc.core_params') ) ); if ($matchtype === 'all' && $tagCount > 0) { $query->having('COUNT( ' . $db->quoteName('tag_id') . ') = ' . $tagCount); } elseif ($matchtype === 'half' && $tagCount > 0) { $tagCountHalf = ceil($tagCount / 2); $query->having('COUNT( ' . $db->quoteName('tag_id') . ') >= ' . $tagCountHalf); } if ($ordering === 'count' || $ordering === 'countrandom') { $query->order($db->quoteName('count') . ' DESC'); } if ($ordering === 'random' || $ordering === 'countrandom') { $query->order($query->Rand()); } $db->setQuery($query, 0, $maximum); try { $results = $db->loadObjectList(); } catch (RuntimeException $e) { $results = array(); JFactory::getApplication()->enqueueMessage(JText::_('JERROR_AN_ERROR_HAS_OCCURRED'), 'error'); } foreach ($results as $result) { $result->link = TagsHelperRoute::getItemRoute( $result->content_item_id, $result->core_alias, $result->core_catid, $result->core_language, $result->type_alias, $result->router ); $result->core_params = new Registry($result->core_params); } return $results; } } home/digilove/public_html/modules/mod_syndicate/helper.php 0000644 00000001500 15234562247 0020070 0 ustar 00 <?php /** * @package Joomla.Site * @subpackage mod_syndicate * * @copyright (C) 2006 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; use Joomla\Utilities\ArrayHelper; /** * Helper for mod_syndicate * * @since 1.5 */ class ModSyndicateHelper { /** * Gets the link * * @param \Joomla\Registry\Registry &$params module parameters * * @return array The link as a string * * @since 1.5 */ public static function getLink(&$params) { $document = JFactory::getDocument(); foreach ($document->_links as $link => $value) { $value = ArrayHelper::toString($value); if (strpos($value, 'application/' . $params->get('format') . '+xml')) { return $link; } } } } home/digilove/public_html/administrator/modules/mod_stats_admin/helper.php 0000644 00000010412 15234562532 0023272 0 ustar 00 <?php /** * @package Joomla.Administrator * @subpackage mod_stats_admin * * @copyright (C) 2012 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * Helper class for admin stats module * * @since 3.0 */ class ModStatsHelper { /** * Method to retrieve information about the site * * @param JObject &$params Params object * * @return array Array containing site information * * @since 3.0 */ public static function getStats(&$params) { $app = JFactory::getApplication(); $db = JFactory::getDbo(); $rows = array(); $query = $db->getQuery(true); $serverinfo = $params->get('serverinfo', 0); $siteinfo = $params->get('siteinfo', 0); $counter = $params->get('counter', 0); $increase = $params->get('increase', 0); $i = 0; if ($serverinfo) { $rows[$i] = new stdClass; $rows[$i]->title = JText::_('MOD_STATS_OS'); $rows[$i]->icon = 'screen'; $rows[$i]->data = substr(php_uname(), 0, 7); $i++; $rows[$i] = new stdClass; $rows[$i]->title = JText::_('MOD_STATS_PHP'); $rows[$i]->icon = 'cogs'; $rows[$i]->data = phpversion(); $i++; $rows[$i] = new stdClass; $rows[$i]->title = JText::_($db->name); $rows[$i]->icon = 'database'; $rows[$i]->data = $db->getVersion(); $i++; $rows[$i] = new stdClass; $rows[$i]->title = JText::_('MOD_STATS_TIME'); $rows[$i]->icon = 'clock'; $rows[$i]->data = JHtml::_('date', 'now', 'H:i'); $i++; $rows[$i] = new stdClass; $rows[$i]->title = JText::_('MOD_STATS_CACHING'); $rows[$i]->icon = 'dashboard'; $rows[$i]->data = $app->get('caching') ? JText::_('JENABLED') : JText::_('JDISABLED'); $i++; $rows[$i] = new stdClass; $rows[$i]->title = JText::_('MOD_STATS_GZIP'); $rows[$i]->icon = 'lightning'; $rows[$i]->data = $app->get('gzip') ? JText::_('JENABLED') : JText::_('JDISABLED'); $i++; } if ($siteinfo) { $query->select('COUNT(id) AS count_users') ->from('#__users'); $db->setQuery($query); try { $users = $db->loadResult(); } catch (RuntimeException $e) { $users = false; } $query->clear() ->select('COUNT(id) AS count_items') ->from('#__content') ->where('state = 1'); $db->setQuery($query); try { $items = $db->loadResult(); } catch (RuntimeException $e) { $items = false; } if ($users) { $rows[$i] = new stdClass; $rows[$i]->title = JText::_('MOD_STATS_USERS'); $rows[$i]->icon = 'users'; $rows[$i]->data = $users; $rows[$i]->link = JRoute::_('index.php?option=com_users'); $i++; } if ($items) { $rows[$i] = new stdClass; $rows[$i]->title = JText::_('MOD_STATS_ARTICLES'); $rows[$i]->icon = 'file'; $rows[$i]->data = $items; $rows[$i]->link = JRoute::_('index.php?option=com_content&view=articles&filter[published]=1'); $i++; } } if ($counter) { $query->clear() ->select('SUM(hits) AS count_hits') ->from('#__content') ->where('state = 1'); $db->setQuery($query); try { $hits = $db->loadResult(); } catch (RuntimeException $e) { $hits = false; } if ($hits) { $rows[$i] = new stdClass; $rows[$i]->title = JText::_('MOD_STATS_ARTICLES_VIEW_HITS'); $rows[$i]->icon = 'eye'; $rows[$i]->data = number_format($hits + $increase, 0, JText::_('DECIMALS_SEPARATOR'), JText::_('THOUSANDS_SEPARATOR')); $i++; } } // Include additional data defined by published system plugins JPluginHelper::importPlugin('system'); $app = JFactory::getApplication(); $arrays = (array) $app->triggerEvent('onGetStats', array('mod_stats_admin')); foreach ($arrays as $response) { foreach ($response as $row) { // We only add a row if the title and data are given if (isset($row['title']) && isset($row['data'])) { $rows[$i] = new stdClass; $rows[$i]->title = $row['title']; $rows[$i]->icon = isset($row['icon']) ? $row['icon'] : 'info'; $rows[$i]->data = $row['data']; $rows[$i]->link = isset($row['link']) ? $row['link'] : null; $i++; } } } return $rows; } } home/digilove/public_html/modules/mod_virtuemart_category/helper.php 0000644 00000003304 15234563043 0022203 0 ustar 00 <?php defined ('_JEXEC') or die('Direct Access to ' . basename (__FILE__) . ' is not allowed.'); /* * Module Helper * @package VirtueMart * @copyright (C) 2011 - 2021 The VirtueMart Team * @Email: max@virtuemart.net * * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL * * @link https://virtuemart.net */ class mod_virtuemart_category { static function displayCatsMod($module, $params, $active_category_id, $category_id, $layout){ vmLanguage::loadJLang('mod_virtuemart_category', true); /* Setting */ $categoryModel = VmModel::getModel('Category'); $ID = str_replace('.', '_', substr(microtime(true), -8, 8)); //legacy $class_sfx = $params->get('class_sfx', ''); $moduleclass_sfx = $params->get('moduleclass_sfx',''); //$layout = $params->get('layout','default'); //$active_category_id = vRequest::getInt('virtuemart_category_id', '0'); $vendorId = 1; $level = (int)$params->get('level','2'); if( strpos($layout, 'wall')!==FALSE ){ $media = true; } else { $media = (int)$params->get('media', 0); } $categories = array(); vmSetStartTime('categories'); //VirtueMartModelCategory::rekurseCategories($vendorId, $category_id, $categories, $level, 0, 0,true, '', 'c.ordering, category_name', 'ASC', true, 0, $media); $categories = VirtueMartModelCategory::getCatsTree(true, $vendorId, $category_id, $level, $media); vmTime('my categories module time','categories'); $parentCategories = $categoryModel->getCategoryRecurse($active_category_id,0); ob_start(); /* Load tmpl default */ require(JModuleHelper::getLayoutPath('mod_virtuemart_category',$layout)); $output = ob_get_clean(); echo $output; } } ?>