本文整理匯總了PHP中JCommentsFactory::getDBO方法的典型用法代碼示例。如果您正苦於以下問題:PHP JCommentsFactory::getDBO方法的具體用法?PHP JCommentsFactory::getDBO怎麽用?PHP JCommentsFactory::getDBO使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類JCommentsFactory
的用法示例。
在下文中一共展示了JCommentsFactory::getDBO方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getObjectOwner
function getObjectOwner($id)
{
$db = JCommentsFactory::getDBO();
$db->setQuery('SELECT dmsubmitedby FROM #__docman WHERE id = ' . $id);
$userid = $db->loadResult();
return $userid;
}
示例2: getObjectOwner
function getObjectOwner($id)
{
$db = JCommentsFactory::getDBO();
$db->setQuery('SELECT uid FROM #__icefiles WHERE imgid = ' . $id);
$userid = $db->loadResult();
return intval($userid);
}
示例3: getObjectInfo
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;
}
示例4: getObjectInfo
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;
}
示例5: render
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
}
}
示例6: getObjectInfo
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;
}
示例7: getObjectInfo
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;
}
示例8: getObjectOwner
function getObjectOwner($id)
{
$db =& JCommentsFactory::getDBO();
$db->setQuery('SELECT owner FROM #__ezrealty WHERE id = ' . $id);
$userid = (int) $db->loadResult();
return $userid;
}
示例9: getObjectOwner
function getObjectOwner($id)
{
$db =& JCommentsFactory::getDBO();
$db->setQuery('SELECT user_id FROM #__beeheard_suggestions WHERE id = ' . $id);
$userid = $db->loadResult();
return $userid;
}
示例10: getParams
/**
* 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;
}
示例11: getObjectOwner
function getObjectOwner($id)
{
$db =& JCommentsFactory::getDBO();
$db->setQuery("SELECT created_by FROM #__js_res_record WHERE id='{$id}'");
$userid = $db->loadResult();
return $userid;
}
示例12: getObjectOwner
function getObjectOwner($id)
{
$db =& JCommentsFactory::getDBO();
$db->setQuery('SELECT user_id FROM #__hwdvidsvideos WHERE id = ' . $id);
$userid = $db->loadResult();
return intval($userid);
}
示例13: upgradeStructure
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;
}
示例14: getCategories
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;
}
示例15: getCategories
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;
}