function getObjectOwner($id) { $db =& JCommentsFactory::getDBO(); $db->setQuery('SELECT owner FROM #__ezrealty WHERE id = ' . $id); $userid = (int) $db->loadResult(); return $userid; }
function getObjectOwner($id) { $db =& JCommentsFactory::getDBO(); $db->setQuery('SELECT user_id FROM #__beeheard_suggestions WHERE id = ' . $id); $userid = $db->loadResult(); return $userid; }
function getObjectOwner($id) { $db = JCommentsFactory::getDBO(); $db->setQuery('SELECT created_by, id FROM #__rokdownloads WHERE id = ' . $id); $userid = $db->loadResult(); return $userid; }
function getObjectOwner($id) { $db = JCommentsFactory::getDBO(); $db->setQuery('SELECT user_id FROM #__muscol_albums WHERE id = ' . $id); $userid = $db->loadResult(); return $userid; }
function getObjectOwner($id) { $db =& JCommentsFactory::getDBO(); $db->setQuery("SELECT created_by FROM #__js_res_record WHERE id='{$id}'"); $userid = $db->loadResult(); return $userid; }
function getObjectOwner($id) { $db = JCommentsFactory::getDBO(); $db->setQuery('SELECT publicador_id FROM #__propiedades_productos WHERE id_producto = ' . $id); $userid = $db->loadResult(); return $userid; }
/** * Set Jcomments config for the actual product, and the value of $comments_enabled * * @author Florian Voutzinos * @param object $product virtuemart product object * @param array $excludedCatIds Ids of excluded category from plugin params * @return void */ public static function applyConfig($product, $excludedCatIds) { $config = JCommentsFactory::getConfig(); // {Jcomments} tag domines Excluded categories ! // and {Jcomments OFF} domines everything // if {Jcomments OFF} tag found we disable comments by force if (self::isDisabled($product)) { $config->set('comments_on', 0); $config->set('comments_off', 1); self::$comments_enabled = false; } elseif (self::isEnabled($product)) { $config->set('comments_on', 1); $config->set('comments_off', 0); self::$comments_enabled = true; } else { // we enable comments if the product category is enabled if (self::isCategoryProductEnabled($product, $excludedCatIds)) { $config->set('comments_on', 1); $config->set('comments_off', 0); self::$comments_enabled = true; } else { $config->set('comments_on', 0); $config->set('comments_off', 1); self::$comments_enabled = false; } } $config->set('comments_locked', (int) self::isLocked($product)); }
function getObjectOwner($id) { $db =& JCommentsFactory::getDBO(); $db->setQuery('SELECT userid FROM #__jmultimedia WHERE id = ' . $id); $userid = $db->loadResult(); return $userid; }
function render() { $readmoreLink = $this->getReadmoreLink(); $commentsLink = $this->getCommentsLink(); $hitsCount = ''; if ($this->getVar('show_hits', 0) == 1) { $content = $this->getVar('content-item'); if (!isset($content->hits)) { $dbo =& JCommentsFactory::getDBO(); $dbo->setQuery('SELECT hits FROM #__content WHERE id = ' . intval($content->id)); $cnt = (int) $dbo->loadResult(); } else { $cnt = (int) $content->hits; } $hitsCount = JText::_('Hits') . ': ' . $cnt; } if ($readmoreLink != '' || $commentsLink != '') { ?> <div class="jcomments-links"><?php echo $readmoreLink; ?> <?php echo $commentsLink; ?> <?php echo $hitsCount; ?> </div> <?php } }
function getObjectOwner($id) { $db = JCommentsFactory::getDBO(); $db->setQuery('SELECT author_id FROM #__gj_bul WHERE id = ' . $id); $userid = $db->loadResult(); return $userid; }
function getObjectInfo($id, $language = null) { $info = new JCommentsObjectInfo(); $row = null; if (JCOMMENTS_JVERSION == '1.0') { $db = JCommentsFactory::getDBO(); $db->setQuery('SELECT link_id, link_name, user_id FROM #__mt_links WHERE link_id = ' . $id); $db->loadObject($row); } else { $db = JFactory::getDBO(); $db->setQuery('SELECT link_id, link_name, user_id FROM #__mt_links WHERE link_id = ' . $id); $row = $db->loadObject(); } if (!empty($row)) { $Itemid = self::getItemid('com_mtree'); $Itemid = $Itemid > 0 ? '&Itemid=' . $Itemid : ''; $info->title = $row->link_name; $info->userid = $row->user_id; if (JCOMMENTS_JVERSION == '1.0') { $info->link = sefRelToAbs('index.php?option=com_mtree&task=viewlink&link_id=' . $id . $Itemid); } else { $info->link = JRoute::_('index.php?option=com_mtree&task=viewlink&link_id=' . $id . $Itemid); } } return $info; }
function getObjectInfo($id, $language = null) { if (JCOMMENTS_JVERSION == '1.0') { $query = "SELECT id, title, '' as alias, access FROM #__polls WHERE id = " . $id; } else { $query = "SELECT id, title, alias, access FROM #__polls WHERE id = " . $id; } $db = JCommentsFactory::getDBO(); $db->setQuery($query); $row = $db->loadObject(); $info = new JCommentsObjectInfo(); if (!empty($row)) { $_Itemid = self::getItemid('com_poll'); $info->title = $row->title; $info->access = $row->access; if (JCOMMENTS_JVERSION == '1.0') { $link = sefRelToAbs('index.php?option=com_poll&task=results&id=' . $id . '&Itemid=' . $_Itemid); } else { $_Itemid = $_Itemid > 0 ? '&Itemid=' . $_Itemid : ''; $link = JRoute::_('index.php?option=com_poll&id=' . $id . ':' . $row->alias . $_Itemid); } $info->link = $link; } return $info; }
public static function isEnabled() { static $enabled = null; if (!isset($enabled)) { $app = JFactory::getApplication(); if ($app->isSite()) { $enabled = $app->getLanguageFilter(); } else { $db = JFactory::getDBO(); $query = $db->getQuery(true); $query->select('enabled'); $query->from($db->quoteName('#__extensions')); $query->where($db->quoteName('type') . ' = ' . $db->quote('plugin')); $query->where($db->quoteName('folder') . ' = ' . $db->quote('system')); $query->where($db->quoteName('element') . ' = ' . $db->quote('languagefilter')); $db->setQuery($query); $enabled = $db->loadResult(); } JFactory::getConfig()->set('multilingual_support', $enabled); if ($enabled) { $enabled = JCommentsFactory::getConfig()->get('multilingual_support', $enabled); } } return $enabled; }
public static function getList($params) { $db = JFactory::getDBO(); $db->setQuery("SELECT * FROM #__jcomments ORDER BY date DESC", 0, $params->get('count')); $items = $db->loadObjectList(); if (!is_array($items)) { $items = array(); } if (count($items)) { $config = JCommentsFactory::getConfig(); $bbcode = JCommentsFactory::getBBCode(); $limit_comment_text = (int) $params->get('limit_comment_text', 0); foreach ($items as &$item) { $item->link = 'index.php?option=com_jcomments&&view=comment&layout=edit&id=' . $item->id; $item->author = JComments::getCommentAuthorName($item); $text = JCommentsText::censor($item->comment); $text = $bbcode->filter($text, true); $text = JCommentsText::cleanText($text); if ($limit_comment_text && JString::strlen($text) > $limit_comment_text) { $text = self::truncateText($text, $limit_comment_text - 1); } $item->comment = $text; } } return $items; }
function getObjectInfo($id, $language = null) { $info = new JCommentsObjectInfo(); $row = null; if (JCOMMENTS_JVERSION == '1.0') { $db = JCommentsFactory::getDBO(); $db->setQuery('SELECT id, ad_headline, userid, category FROM #__adsmanager_ads WHERE id = ' . $id); $db->loadObject($row); } else { $db = JFactory::getDBO(); $db->setQuery('SELECT id, ad_headline, userid, category FROM #__adsmanager_ads WHERE id = ' . $id); $row = $db->loadObject(); } if (!empty($row)) { $info->title = $row->ad_headline; $info->userid = $row->userid; if (JCOMMENTS_JVERSION == '1.0') { $Itemid = self::getItemid('com_adsmanager'); $Itemid = $Itemid > 0 ? '&Itemid=' . $Itemid : ''; $info->link = sefRelToAbs("index.php?option=com_adsmanager&page=show_ad&adid=" . $id . $Itemid); } else { $Itemid = self::getItemid('com_adsmanager', 'index.php?option=com_adsmanager&view=front'); $Itemid = $Itemid > 0 ? '&Itemid=' . $Itemid : ''; $info->link = JRoute::_("index.php?option=com_adsmanager&view=details&id=" . $row->id . "&catid=" . $row->category . $Itemid); } } return $info; }
function plgSystemJComments() { global $mosConfig_absolute_path, $mainframe; include_once $mosConfig_absolute_path . '/components/com_jcomments/jcomments.legacy.php'; if (!defined('JCOMMENTS_JVERSION')) { return; } include_once JCOMMENTS_BASE . '/jcomments.class.php'; include_once JCOMMENTS_BASE . '/jcomments.config.php'; include_once JCOMMENTS_HELPERS . '/system.php'; $document = JCommentsFactory::getDocument(); if (!defined('JCOMMENTS_CSS')) { $document->addStyleSheet(JCommentsSystemPluginHelper::getCSS()); define('JCOMMENTS_CSS', 1); } if (!$mainframe->isAdmin()) { if (!defined('JCOMMENTS_JS')) { $document->addScript(JCommentsSystemPluginHelper::getCoreJS()); define('JCOMMENTS_JS', 1); } if (!defined('JOOMLATUNE_AJAX_JS')) { $document->addScript(JCommentsSystemPluginHelper::getAjaxJS()); define('JOOMLATUNE_AJAX_JS', 1); } } }
public function save() { JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); $app = JFactory::getApplication(); $base64 = $app->input->get('base64', ''); if (!empty($base64)) { $base64 = base64_decode(urldecode($base64)); parse_str($base64, $data); foreach ($data as $k => $v) { $app->input->post->set($k, $v); } } $model = $this->getModel(); $data = $app->input->post->get('jform', array(), 'array'); $language = $app->input->post->get('language', '', 'string'); $model->setState($model->getName() . '.language', $language); if ($model->save($data) === false) { $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_SAVE_FAILED', $model->getError())); $this->setMessage($this->getError(), 'error'); $this->setRedirect(JRoute::_('index.php?option=com_jcomments&view=settings', false)); return false; } if (!extension_loaded('gd') || !function_exists('imagecreatefrompng')) { $config = JCommentsFactory::getConfig(); if ($config->get('captcha_engine', 'kcaptcha') != 'recaptcha') { JFactory::getApplication()->enqueueMessage(JText::_('A_WARNINGS_PHP_GD'), 'warning'); } } $cache = JFactory::getCache('com_jcomments'); $cache->clean(); $this->setMessage(JText::_('A_SETTINGS_SAVED')); $this->setRedirect(JRoute::_('index.php?option=com_jcomments&view=settings', false)); return true; }
/** * Gets the parameter object for a plugin * * @param string $pluginName The plugin name * @param string $type The plugin type, relates to the sub-directory in the plugins directory * @return JParameter A JParameter object (mosParameters for J1.0) */ public static function getParams($pluginName, $type = 'content') { if (JCOMMENTS_JVERSION == '1.0') { static $mambotParams = array(); $paramKey = $type . '_' . $pluginName; if (!isset($mambotParams[$paramKey])) { include_once JCOMMENTS_BASE . DS . 'jcomments.class.php'; $dbo = JCommentsFactory::getDBO(); $dbo->setQuery("SELECT params FROM #__mambots WHERE element = '{$pluginName}' AND folder = '{$type}'"); $mambotParams[$paramKey] = $dbo->loadResult(); } $data = $mambotParams[$paramKey]; $pluginParams = new mosParameters($data); } elseif (JCOMMENTS_JVERSION == '1.5') { $plugin = JPluginHelper::getPlugin($type, $pluginName); if (is_object($plugin)) { $pluginParams = new JParameter($plugin->params); } else { $pluginParams = new JParameter(''); } } else { $plugin = JPluginHelper::getPlugin($type, $pluginName); if (is_object($plugin)) { $pluginParams = new JRegistry($plugin->params); } else { $pluginParams = new JRegistry(''); } } return $pluginParams; }
function getObjectInfo($id, $language = null) { $info = new JCommentsObjectInfo(); $Itemid = self::getItemid('com_marketplace'); $Itemid = $Itemid > 0 ? '&Itemid=' . $Itemid : ''; $marketplaceCore = JPATH_SITE . '/components/com_marketplace/controller.php'; if (is_file($marketplaceCore)) { $db = JFactory::getDBO(); $query = 'SELECT e.id, e.headline as title, e.user_id as userid' . " , 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); } else { $db = JCommentsFactory::getDBO(); $query = 'SELECT e.id, e.ad_headline as title, e.userid ' . " FROM #__marketplace_ads AS e" . " WHERE e.id = " . $id; $db->setQuery($query); $row = $db->loadObject(); $link = JoomlaTuneRoute::_("index.php?option=com_marketplace&page=show_ad&adid=" . $id . $Itemid); } if (!empty($row)) { $info->title = $row->ad_headline; $info->userid = $row->userid; $info->link = $link; } return $info; }
public static function check($str) { static $group = null; $str = JCommentsFactory::getConfig()->get($str); if (!empty($str)) { $user = JFactory::getUser(); $list = explode(',', $str); if ($group === null) { if ($user->id) { $db = JFactory::getDbo(); // get highest group $query = $db->getQuery(true); $query->select('a.id'); $query->from('#__user_usergroup_map AS map'); $query->leftJoin('#__usergroups AS a ON a.id = map.group_id'); $query->where('map.user_id = ' . (int) $user->id); $query->order('a.lft desc'); $db->setQuery($query, 0, 1); $group = $db->loadResult(); } else { $group = JComponentHelper::getParams('com_users')->get('guest_usergroup', 1); } } if (in_array($group, $list)) { return 1; } } return 0; }
function getObjectOwner($id) { $db = JCommentsFactory::getDBO(); $db->setQuery('SELECT dmsubmitedby FROM #__docman WHERE id = ' . $id); $userid = $db->loadResult(); return $userid; }
public static function getUserGroups() { static $groups = array(); if (!count($groups)) { if (JCOMMENTS_JVERSION == '1.0') { $db = JCommentsFactory::getDbo(); $db->setQuery('SELECT a.name, a.name AS text, a.group_id as id, COUNT(DISTINCT b.group_id) AS level' . ' FROM #__core_acl_aro_groups AS a' . ' LEFT JOIN `#__core_acl_aro_groups` AS b ON a.lft > b.lft AND a.rgt < b.rgt' . ' WHERE a.name NOT IN ("ROOT", "USERS", "Public Backend")' . ' GROUP BY a.group_id' . ' ORDER BY a.lft ASC'); $groups = $db->loadObjectList(); // for backward compatibility self::updateUserGroups($groups); } else { if (JCOMMENTS_JVERSION == '1.5') { $db = JFactory::getDbo(); $db->setQuery('SELECT a.name, a.name AS text, a.id, COUNT(DISTINCT b.id) AS level' . ' FROM #__core_acl_aro_groups AS a' . ' LEFT JOIN `#__core_acl_aro_groups` AS b ON a.lft > b.lft AND a.rgt < b.rgt' . ' WHERE a.name NOT IN ("ROOT", "USERS", "Public Backend")' . ' GROUP BY a.id' . ' ORDER BY a.lft ASC'); $groups = $db->loadObjectList(); // for backward compatibility self::updateUserGroups($groups); } else { if (JCOMMENTS_JVERSION == '1.7') { $db = JFactory::getDbo(); $db->setQuery('SELECT CASE WHEN a.id = 1 THEN \'Public\' ELSE a.title END AS name, a.title AS text, a.id, COUNT(DISTINCT b.id) AS level' . ' FROM #__usergroups AS a' . ' LEFT JOIN `#__usergroups` AS b ON a.lft > b.lft AND a.rgt < b.rgt' . ' GROUP BY a.id' . ' ORDER BY a.lft ASC'); $groups = $db->loadObjectList(); } } } } return $groups; }
function getObjectOwner($id) { $db =& JCommentsFactory::getDBO(); $db->setQuery('SELECT user_id FROM #__hwdvidsvideos WHERE id = ' . $id); $userid = $db->loadResult(); return intval($userid); }
function getObjectOwner($id) { $db =& JCommentsFactory::getDBO(); $db->setQuery('SELECT userid #__phocagallery_user_category WHERE catid = ' . $id); $userid = $db->loadResult(); return $userid; }
function getObjectOwner($id) { $db = JCommentsFactory::getDBO(); $db->setQuery('SELECT uid FROM #__icefiles WHERE imgid = ' . $id); $userid = $db->loadResult(); return intval($userid); }
function getObjectOwner($id) { $db =& JCommentsFactory::getDBO(); $db->setQuery('SELECT created_by FROM #__alberghi WHERE id = ' . $id); $userid = $db->loadResult(); return $userid; }
function getObjectOwner($id) { $db = JCommentsFactory::getDBO(); $db->setQuery('SELECT userid FROM #__autobb_messages WHERE id = ' . $id); $userid = $db->loadResult(); return $userid; }
public static function upgradeStructure() { $db = JCommentsFactory::getDBO(); $fields = self::getTableFieldNames('#__jcomments'); if (count($fields)) { // 2.2.0.0 if (!in_array('level', $fields)) { $db->setQuery("ALTER TABLE `#__jcomments` ADD `level` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0' AFTER `parent`;"); @$db->query(); $db->setQuery("ALTER TABLE `#__jcomments` ADD INDEX `idx_level`(`level`);"); @$db->query(); } if (!in_array('path', $fields)) { $db->setQuery("ALTER TABLE `#__jcomments` ADD `path` VARCHAR(255) NOT NULL DEFAULT '' AFTER `parent`;"); @$db->query(); $db->setQuery("ALTER TABLE `#__jcomments` ADD INDEX `idx_path`(`path`,`level`);"); @$db->query(); } if (!in_array('source_id', $fields)) { $db->setQuery("ALTER TABLE `#__jcomments` ADD `source_id` INT(11) UNSIGNED NOT NULL DEFAULT '0' AFTER `source`;"); @$db->query(); } // 2.3 if (!in_array('deleted', $fields)) { $db->setQuery("ALTER TABLE `#__jcomments` ADD `deleted` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0' AFTER `published`;"); @$db->query(); } if (!in_array('thread_id', $fields)) { $db->setQuery("ALTER TABLE `#__jcomments` ADD `thread_id` INT(1) UNSIGNED NOT NULL DEFAULT '0' AFTER `parent`;"); @$db->query(); $db->setQuery("ALTER TABLE `#__jcomments` ADD INDEX `idx_thread`(`thread_id`);"); @$db->query(); } unset($fields); } $db->setQuery("ALTER IGNORE TABLE `#__jcomments` CHANGE `isgood` `isgood` SMALLINT(5) NOT NULL DEFAULT '0';"); @$db->query(); $db->setQuery("ALTER IGNORE TABLE `#__jcomments` CHANGE `ispoor` `ispoor` SMALLINT(5) NOT NULL DEFAULT '0';"); @$db->query(); $db->setQuery("ALTER IGNORE TABLE `#__jcomments` CHANGE `ip` `ip` VARCHAR(39) NOT NULL DEFAULT '';"); @$db->query(); $db->setQuery("ALTER IGNORE TABLE `#__jcomments_votes` CHANGE `ip` `ip` VARCHAR(39) NOT NULL DEFAULT '';"); @$db->query(); $db->setQuery("ALTER IGNORE TABLE `#__jcomments_reports` CHANGE `ip` `ip` VARCHAR(39) NOT NULL DEFAULT '';"); @$db->query(); $db->setQuery("ALTER IGNORE TABLE `#__jcomments_blacklist` CHANGE `ip` `ip` VARCHAR(39) NOT NULL DEFAULT '';"); @$db->query(); $fields = self::getTableFieldNames('#__jcomments_subscriptions'); if (count($fields)) { if (!in_array('source', $fields)) { $db->setQuery("ALTER IGNORE TABLE `#__jcomments_subscriptions` ADD `source` VARCHAR(255) NOT NULL DEFAULT '';"); @$db->query(); $db->setQuery("ALTER IGNORE TABLE `#__jcomments_subscriptions` ADD INDEX `idx_source`(`source`);"); @$db->query(); } unset($fields); } return true; }
function getCategories($filter = '') { $db =& JCommentsFactory::getDBO(); $query = "SELECT c.id as `value`, name AS `text`" . "\n FROM #__sobi2_categories\t AS c" . ($filter != '' ? "\n WHERE c.id IN ( " . $filter . " )" : '') . "\n ORDER BY c.ordering"; $db->setQuery($query); $rows = $db->loadObjectList(); return $rows; }
function getCategories($filter = '') { $db =& JCommentsFactory::getDBO(); $query = "SELECT id AS value, name AS text" . "\n FROM #__categories" . "\n WHERE section = 'com_yellowpages'" . "\n AND published = 1" . ($filter != '' ? "\n AND id IN ( " . $filter . " )" : '') . "\n ORDER BY name"; $db->setQuery($query); $rows = $db->loadObjectList(); return $rows; }