当前位置: 首页>>代码示例>>PHP>>正文


PHP Komento::getDBO方法代码示例

本文整理汇总了PHP中Komento::getDBO方法的典型用法代码示例。如果您正苦于以下问题:PHP Komento::getDBO方法的具体用法?PHP Komento::getDBO怎么用?PHP Komento::getDBO使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Komento的用法示例。


在下文中一共展示了Komento::getDBO方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: purge

 public function purge()
 {
     $db = Komento::getDBO();
     $query = 'DELETE FROM ' . $db->nameQuote('#__komento_mailq');
     $db->setQuery($query);
     $db->Query();
 }
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:7,代码来源:mailq.php

示例2: getEditorList

 public function getEditorList($selected)
 {
     $db = Komento::getDBO();
     // compile list of the editors
     if (Komento::joomlaVersion() >= '1.6') {
         $query = 'SELECT `element` AS value, `name` AS text' . ' FROM `#__extensions`' . ' WHERE `folder` = "editors"' . ' AND `type` = "plugin"' . ' AND `enabled` = 1' . ' ORDER BY ordering, name';
     } else {
         $query = 'SELECT element AS value, name AS text' . ' FROM #__plugins' . ' WHERE folder = "editors"' . ' AND published = 1' . ' ORDER BY ordering, name';
     }
     //echo $query;
     $db->setQuery($query);
     $editors = $db->loadObjectList();
     if (count($editors) > 0) {
         if (Komento::joomlaVersion() >= '1.6') {
             $lang = JFactory::getLanguage();
             for ($i = 0; $i < count($editors); $i++) {
                 $editor = $editors[$i];
                 $lang->load($editor->text . '.sys', JPATH_ADMINISTRATOR, null, false, false);
                 $editor->text = JText::_($editor->text);
             }
         }
     }
     // temporary. remove when wysiwyg editors are ready
     $editors = array();
     $bbcode = new stdClass();
     $bbcode->value = 'bbcode';
     $bbcode->text = JText::_('COM_KOMENTO_EDITOR_BBCODE');
     $none = new stdClass();
     $none->value = 'none';
     $none->text = JText::_('COM_KOMENTO_EDITOR_NONE');
     $editors[] = $bbcode;
     $editors[] = $none;
     return JHTML::_('select.genericlist', $editors, 'form_editor', 'class="inputbox" size="1"', 'value', 'text', $selected);
 }
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:34,代码来源:view.html.php

示例3: send

	public function send( $max = 5 )
	{
		$konfig		= Komento::getKonfig();

		if( $konfig->get( 'disable_mailq' ) )
		{
			return false;
		}

		$db			= Komento::getDBO();
		$config		= Komento::getConfig();

		$sql = Komento::getSql();

		$sql->select( '#__komento_mailq' )
			->column( 'id' )
			->where( 'status', 0 )
			->order( 'created' )
			->limit( $max );

		$result = $sql->loadObjectList();

		if(! empty($result))
		{
			foreach($result as $mail)
			{
				$mailq	= Komento::getTable('mailq');
				$mailq->load($mail->id);

				$sendHTML = $mailq->type == 'html' ? 1 : 0;

				$state = 0;

				if( empty( $mailq->recipient ) )
				{
					$state = 1;
				}

				//send emails.
				if( Komento::isJoomla15() )
				{
					$state = JUtility::sendMail($mailq->mailfrom, $mailq->fromname, $mailq->recipient, $mailq->subject, $mailq->body, $sendHTML);
				}
				else
				{
					$mail = JFactory::getMailer();
					$state = $mail->sendMail($mailq->mailfrom, $mailq->fromname, $mailq->recipient, $mailq->subject, $mailq->body, $sendHTML);
				}

				if( $state )
				{
					// update the status to 1 == proccessed
					$mailq->status  = 1;
					$mailq->store();
				}
			}
		}
	}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:58,代码来源:mailqueue.php

示例4: clear

 /**
  * Delete the outdated entries.
  */
 public function clear()
 {
     $db = Komento::getDBO();
     $date = Komento::getDate();
     $query = 'DELETE FROM ' . $db->nameQuote('#__komento_captcha') . ' WHERE ' . $db->nameQuote('created') . ' <= DATE_SUB( ' . $db->Quote($date->toMySQL()) . ', INTERVAL 12 HOUR )';
     $db->setQuery($query);
     $db->query();
     return true;
 }
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:12,代码来源:captcha.php

示例5: getCategories

 public function getCategories()
 {
     $db = Komento::getDBO();
     $query = 'SELECT c.id, c.title, c.parent_id, c.title AS name, c.parent_id AS parent' . ' FROM #__categories AS c' . ' WHERE c.extension = ' . $db->quote(FLEXI_CAT_EXTENSION) . ' AND (c.lft > ' . $db->quote(FLEXI_LFT_CATEGORY) . ' AND c.rgt < ' . $db->quote(FLEXI_RGT_CATEGORY) . ') GROUP BY c.id ORDER BY c.lft ';
     $db->setQuery($query);
     $categories = $db->loadObjectList();
     foreach ($categories as &$row) {
         $repeat = $row->level - 1 >= 0 ? $row->level - 1 : 0;
         $row->treename = str_repeat('.&#160;&#160;&#160;', $repeat) . ($row->level - 1 > 0 ? '|_&#160;' : '') . $row->title;
     }
     return $categories;
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:12,代码来源:com_flexicontent.php

示例6: getCategories

 public function getCategories()
 {
     $db = Komento::getDBO();
     $query = 'SELECT `id`, `title`, `level`, `parent_id` FROM `CATEGORY_TABLE`';
     $db->setQuery($query);
     $categories = $db->loadObjectList();
     // optional. populate tree listing
     foreach ($categories as &$row) {
         $repeat = $row->level - 1 >= 0 ? $row->level - 1 : 0;
         $row->treename = str_repeat('.&#160;&#160;&#160;', $repeat) . ($row->level - 1 > 0 ? '|_&#160;' : '') . $row->title;
     }
     return $categories;
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:13,代码来源:com_sample.php

示例7: store

 public function store($updateNulls = false)
 {
     $sql = Komento::getSql();
     $sql->select('#__komento_configs')->column('1', '', 'count', true)->where('component', $this->component);
     $exists = $sql->loadResult() > 0 ? true : false;
     $data = new stdClass();
     $data->component = $this->component;
     $data->params = trim($this->params);
     $database = Komento::getDBO();
     if ($exists) {
         return $database->updateObject('#__komento_configs', $data, 'component');
     }
     return $database->insertObject('#__komento_configs', $data);
 }
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:14,代码来源:configs.php

示例8: __construct

 function __construct()
 {
     $mainframe = JFactory::getApplication();
     $db = Komento::getDBO();
     $this->limit = $mainframe->getUserStateFromRequest('com_komento.reports.limit', 'limit', $mainframe->getCfg('list_limit'), 'int');
     $this->limitstart = $mainframe->getUserStateFromRequest('com_komento.reports.limitstart', 'limitstart', 0, 'int');
     $this->filter_publish = $mainframe->getUserStateFromRequest('com_komento.reports.filter_publish', 'filter_publish', '*', 'string');
     $this->filter_component = $mainframe->getUserStateFromRequest('com_komento.reports.filter_component', 'filter_component', '*', 'string');
     $this->order = $mainframe->getUserStateFromRequest('com_komento.reports.filter_order', 'filter_order', 'created', 'cmd');
     $this->order_dir = $mainframe->getUserStateFromRequest('com_komento.reports.filter_order_Dir', 'filter_order_Dir', 'DESC', 'word');
     $this->search = $mainframe->getUserStateFromRequest('com_komento.reports.search', 'search', '', 'string');
     Komento::import('helper', 'string');
     $this->search = KomentoStringHelper::escape(trim(JString::strtolower($this->search)));
     parent::__construct();
 }
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:15,代码来源:reports.php

示例9: getCategories

 public function getCategories()
 {
     $db = Komento::getDBO();
     $query = 'SELECT c.category_id, cx.category_child_id, cx.category_child_id AS id, cx.category_parent_id,' . ' cx.category_parent_id AS parent_id, c.category_name, c.category_name AS title,' . ' c.category_description, c.published,ordering,' . ' c.category_name AS name, cx.category_parent_id AS parent' . ' FROM `#__redshop_category` AS c,' . ' `#__redshop_category_xref` AS cx' . ' WHERE c.category_id = cx.category_child_id' . ' ORDER BY c.ordering';
     $db->setQuery($query);
     $categories = $db->loadObjectList();
     $children = array();
     foreach ($categories as $row) {
         $pt = $row->parent_id;
         $list = @$children[$pt] ? $children[$pt] : array();
         $list[] = $row;
         $children[$pt] = $list;
     }
     $categories = JHTML::_('menu.treerecurse', 0, '', array(), $children, 9999, 0, 0);
     return $categories;
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:16,代码来源:com_redshop.php

示例10: getCategories

 public function getCategories()
 {
     $db = Komento::getDBO();
     $query = 'SELECT c.id, c.name AS title, c.parent AS parent_id, c.name, c.parent' . ' FROM `#__zoo_category` as c USE INDEX (APPLICATIONID_ID_INDEX)' . ' ORDER BY c.ordering';
     $db->setQuery($query);
     $categories = $db->loadObjectList();
     $children = array();
     foreach ($categories as $row) {
         $pt = $row->parent_id;
         $list = @$children[$pt] ? $children[$pt] : array();
         $list[] = $row;
         $children[$pt] = $list;
     }
     $categories = JHTML::_('menu.treerecurse', 0, '', array(), $children, 9999, 0, 0);
     return $categories;
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:16,代码来源:com_zoo.php

示例11: getCategories

 public function getCategories()
 {
     $db = Komento::getDBO();
     $query = 'SELECT a.id, a.name AS title, a.parent AS parent_id, a.name, a.parent' . ' FROM `#__k2_categories` AS a' . ' WHERE a.trash = 0' . ' ORDER BY a.ordering';
     $db->setQuery($query);
     $categories = $db->loadObjectList();
     $children = array();
     foreach ($categories as $row) {
         $pt = $row->parent_id;
         $list = @$children[$pt] ? $children[$pt] : array();
         $list[] = $row;
         $children[$pt] = $list;
     }
     $categories = JHTML::_('menu.treerecurse', 0, '', array(), $children, 9999, 0, 0);
     return $categories;
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:16,代码来源:com_k2.php

示例12: getCategories

 public function getCategories()
 {
     $db = Komento::getDBO();
     $query = 'SELECT a.id, a.title, a.level, a.parent_id' . ' FROM `#__categories` AS a' . ' WHERE a.extension = ' . $db->quote('com_content') . ' AND a.parent_id > 0' . ' ORDER BY a.lft';
     if (Komento::joomlaVersion() == '1.5') {
         $query = 'SELECT a.id, a.title' . ' FROM `#__categories` AS a' . ' ORDER BY a.ordering';
     }
     $db->setQuery($query);
     $categories = $db->loadObjectList();
     if (Komento::joomlaVersion() >= '1.6') {
         foreach ($categories as &$row) {
             $repeat = $row->level - 1 >= 0 ? $row->level - 1 : 0;
             $row->treename = str_repeat('.&#160;&#160;&#160;', $repeat) . ($row->level - 1 > 0 ? '|_&#160;' : '') . $row->title;
         }
     }
     return $categories;
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:17,代码来源:com_tz_portfolio.php

示例13: getCategories

 public function getCategories()
 {
     $db = Komento::getDBO();
     $query = 'SELECT a.`cat_id` AS `id`, a.`cat_name` AS `title` , a.`cat_parent` AS `parent_id`' . ' FROM `#__mt_cats` AS a' . ' ORDER BY a.`lft`';
     $db->setQuery($query);
     $categories = $db->loadObjectList();
     $children = array();
     foreach ($categories as $row) {
         if ($row->parent_id != -1) {
             $pt = $row->parent_id;
             $list = @$children[$pt] ? $children[$pt] : array();
             $list[] = $row;
             $children[$pt] = $list;
         }
     }
     $res = JHTML::_('menu.treerecurse', 0, '', array(), $children, 9999, 0, 0);
     return $res;
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:18,代码来源:com_mtree.php

示例14: getCategories

 public function getCategories()
 {
     $db = Komento::getDBO();
     $query = 'SELECT c.category_id AS id, cd.name, cd.name AS title, c.parent_id, c.parent_id AS parent' . ' FROM `#__aceshop_category` AS c,' . ' `#__aceshop_category_description` AS cd' . ' WHERE c.category_id = cd.category_id' . ' ORDER BY c.sort_order';
     $db->setQuery($query);
     $rows = $db->loadObjectList();
     $categories = array();
     if (count($rows)) {
         $children = array();
         foreach ($rows as $v) {
             $pt = $v->parent_id;
             $list = @$children[$pt] ? $children[$pt] : array();
             array_push($list, $v);
             $children[$pt] = $list;
         }
         $treelist = JHTML::_('menu.treerecurse', 0, '', array(), $children, 9999, 0, 0);
         foreach ($treelist as &$row) {
             $category->title = $row->treename;
             $categories[] = $row;
         }
     }
     return $categories;
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:23,代码来源:com_aceshop.php

示例15: onBeforeLoad

 public function onBeforeLoad($eventTrigger, $context, &$article, &$params, &$page, &$options)
 {
     // We got to go through 3 checks:
     // 1. Check if POST parameter have id (this is when user go to an event page through event listings)
     // 2. Check if page parameter have id (this is when user assign an event on a menu item)
     // 3. Find back the id based on text parameter passed in (this was the old trigger before changing from onPrepareContent to onAfterDisplayContent for Joomla 1.5)
     $cid = JRequest::getInt('id');
     if (empty($cid)) {
         $pageParameters = JFactory::getApplication()->getPageParameters();
         $cid = $pageParameters->get('id');
     }
     if (empty($cid)) {
         // Bad fallback due to limited data that is being passed in
         // Use the description text to backtrace and search for the article id
         $text = $article->text;
         $text = str_ireplace('<!--{emailcloak=off}-->', '', $text);
         $db = Komento::getDBO();
         $query = 'SELECT ohanah_event_id FROM `#__ohanah_events` WHERE description = ' . $db->quote($text);
         $db->setQuery($query);
         $cid = $db->loadResult();
     }
     // If cid is still empty then we don't continue
     if (empty($cid)) {
         return false;
     }
     $article->id = $cid;
     return true;
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:28,代码来源:com_ohanah.php


注:本文中的Komento::getDBO方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。