function getObjectOwner($id)
 {
     $db = JCommentsFactory::getDBO();
     $db->setQuery('SELECT dmsubmitedby FROM #__docman 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;
 }
Exemple #3
0
 function getObjectOwner($id)
 {
     $db = JCommentsFactory::getDBO();
     $db->setQuery('SELECT uid FROM #__icefiles WHERE imgid = ' . $id);
     $userid = $db->loadResult();
     return intval($userid);
 }
 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;
 }
 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 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;
 }
Exemple #7
0
    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 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&amp;task=viewlink&amp;link_id=' . $id . $Itemid);
         } else {
             $info->link = JRoute::_('index.php?option=com_mtree&amp;task=viewlink&amp;link_id=' . $id . $Itemid);
         }
     }
     return $info;
 }
Exemple #9
0
 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&amp;task=results&amp;id=' . $id . '&amp;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;
 }
 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 userid #__phocagallery_user_category WHERE catid = ' . $id);
     $userid = $db->loadResult();
     return $userid;
 }
Exemple #13
0
 function getObjectOwner($id)
 {
     $db = JCommentsFactory::getDBO();
     $db->setQuery('SELECT userid FROM #__autobb_messages 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;
 }
Exemple #15
0
 /**
  * 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 getObjectOwner($id)
 {
     $db = JCommentsFactory::getDBO();
     $db->setQuery('SELECT publicador_id FROM #__propiedades_productos WHERE id_producto = ' . $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 user_id FROM #__hwdvidsvideos WHERE id = ' . $id);
     $userid = $db->loadResult();
     return intval($userid);
 }
 function getObjectOwner($id)
 {
     $db =& JCommentsFactory::getDBO();
     $db->setQuery('SELECT userid FROM #__jmultimedia WHERE id = ' . $id);
     $userid = $db->loadResult();
     return $userid;
 }
 function getObjectOwner($id)
 {
     $db =& JCommentsFactory::getDBO();
     $db->setQuery('SELECT created_by FROM #__alberghi WHERE id = ' . $id);
     $userid = $db->loadResult();
     return $userid;
 }
Exemple #21
0
 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 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;
 }
 function getCategories($filter = '')
 {
     $db =& JCommentsFactory::getDBO();
     $query = "SELECT cat_id AS `value`, cat_name AS `text`" . "\n FROM #__mt_cats" . ($filter != '' ? "\n WHERE cat_id IN ( " . $filter . " )" : '') . "\n ORDER BY cat_name";
     $db->setQuery($query);
     $rows = $db->loadObjectList();
     return $rows;
 }
 function getCategories($filter = '')
 {
     $db =& JCommentsFactory::getDBO();
     $query = "SELECT c.id AS `value`, CONCAT_WS( ' / ', s.title, c.title) AS `text`" . "\n FROM #__sections AS s" . "\n INNER JOIN #__categories AS c ON c.section = s.id" . ($filter != '' ? "\n WHERE c.id IN ( " . $filter . " )" : '') . "\n ORDER BY s.name,c.name";
     $db->setQuery($query);
     $rows = $db->loadObjectList();
     return $rows;
 }
 function getCategories($filter = '')
 {
     $db =& JCommentsFactory::getDBO();
     $query = "SELECT c.id AS `value`, CONCAT_WS( ' / ', 'EventList', c.catname) AS `text`" . "\n FROM #__eventlist_categories AS c" . ($filter != '' ? "\n WHERE c.id IN ( " . $filter . " )" : '') . "\n ORDER BY c.catname";
     $db->setQuery($query);
     $rows = $db->loadObjectList();
     return $rows;
 }
 function getObjectOwner($id)
 {
     $db =& JCommentsFactory::getDBO();
     $query = "SELECT user_id FROM #__blog_postings WHERE id = " . $id;
     $db->setQuery($query);
     $userid = $db->loadResult();
     return intval($userid);
 }
 function getObjectOwner($id)
 {
     $db = JCommentsFactory::getDBO();
     $query = "SELECT u.id " . "\n FROM #__users AS u" . "\n INNER JOIN #__yvc AS yvc ON yvc.owner = u.username" . "\n WHERE yvc.id = " . $id;
     $db->setQuery($query);
     $userid = $db->loadResult();
     return intval($userid);
 }
 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 getObjectLink($id)
 {
     $_Itemid = self::getItemid('com_xfaq');
     $db = JCommentsFactory::getDBO();
     $db->setQuery('SELECT catid FROM #__xfaq WHERE id = ' . $id);
     $catid = $db->loadResult();
     $link = JoomlaTuneRoute::_('index.php?option=com_xfaq&amp;task=answer&amp;catid=' . $catid . '&amp;aid=' . $id . '&amp;Itemid=' . $_Itemid);
     return $link;
 }
 function getObjectLink($id)
 {
     $_Itemid = self::getItemid('com_yellowpages');
     $db = JCommentsFactory::getDBO();
     $db->setQuery('SELECT catid FROM #__jyp_entries WHERE id = ' . $id);
     $catid = $db->loadResult();
     $link = sefRelToAbs('index.php?option=com_yellowpages&Itemid=' . $_Itemid . '&task=view&catid=' . $catid . '&id=' . $id);
     return $link;
 }