本文整理汇总了PHP中EasyBlogHelper::db方法的典型用法代码示例。如果您正苦于以下问题:PHP EasyBlogHelper::db方法的具体用法?PHP EasyBlogHelper::db怎么用?PHP EasyBlogHelper::db使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EasyBlogHelper
的用法示例。
在下文中一共展示了EasyBlogHelper::db方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getItems
public function getItems()
{
$mainframe = JFactory::getApplication();
$db = EasyBlogHelper::db();
$filter_groups = $mainframe->getUserStateFromRequest('com_easyblog.fields.filter_groups', 'filter_groups', '', 'string');
$search = $mainframe->getUserStateFromRequest('com_easyblog.fields.search', 'search', '', 'string');
$search = $db->getEscaped(trim(JString::strtolower($search)));
$query = array();
$pagination = $this->getPagination();
$query[] = 'SELECT * FROM ' . $db->quoteName('#__easyblog_fields');
$where = array();
if ($filter_groups) {
$where[] = $db->quoteName('id') . '=' . $db->Quote($filter_groups);
}
if ($search) {
$where[] = 'LOWER(' . $db->quoteName('title') . ') LIKE \'%' . $search . '%\' ';
}
$where = count($where) ? ' WHERE ' . implode(' AND ', $where) : '';
$query[] = $where;
$query[] = 'LIMIT ' . $pagination->limitstart . ',' . $pagination->limit;
$query = implode(' ', $query);
$db->setQuery($query);
$data = $db->loadObjectList();
return $data;
}
示例2: getPostCount
function getPostCount($id)
{
$db = EasyBlogHelper::db();
$query = 'SELECT COUNT(1) FROM #__easyblog_post ' . 'WHERE `created_by`=' . $db->Quote($id);
$db->setQuery($query);
return $db->loadResult();
}
示例3: exists
function exists()
{
$db = EasyBlogHelper::db();
$query = 'SELECT COUNT(1) FROM #__easyblog_team_request ' . 'WHERE `team_id`=' . $db->Quote($this->team_id) . ' ' . 'AND `user_id`=' . $db->Quote($this->user_id) . ' ' . 'AND `ispending` = ' . $db->Quote('1');
$db->setQuery($query);
return $db->loadResult() > 0 ? true : false;
}
示例4: getAllRuleItems
function getAllRuleItems()
{
$db = EasyBlogHelper::db();
$query = 'select * from `#__easyblog_category_acl_item` order by id';
$db->setQuery($query);
return $db->loadObjectList();
}
示例5: sendOnPageLoad
function sendOnPageLoad($max = 5)
{
$db = EasyBlogHelper::db();
$config = EasyBlogHelper::getConfig();
$sendHTML = $config->get('main_mailqueuehtmlformat', 0);
// Delete existing mails that has already been sent.
$query = 'DELETE FROM ' . $db->nameQuote('#__easyblog_mailq') . ' WHERE ' . $db->nameQuote('status') . '=' . $db->Quote(1) . ' AND DATEDIFF(NOW(), `created`) >= 7';
$db->setQuery($query);
$db->Query();
$query = 'SELECT `id` FROM `#__easyblog_mailq` WHERE `status` = 0';
$query .= ' ORDER BY `created` ASC';
$query .= ' LIMIT ' . $max;
$db->setQuery($query);
$result = $db->loadObjectList();
if (!empty($result)) {
foreach ($result as $mail) {
$mailq = EasyBlogHelper::getTable('MailQueue', 'Table');
$mailq->load($mail->id);
// update the status to 1 == proccessed
$mailq->status = 1;
if ($mailq->store()) {
// Send emails out.
if (EasyBlogHelper::getJoomlaVersion() >= '3.0') {
$mail = JFactory::getMailer();
$mail->sendMail($mailq->mailfrom, $mailq->fromname, $mailq->recipient, $mailq->subject, $mailq->body, $sendHTML);
} else {
JUtility::sendMail($mailq->mailfrom, $mailq->fromname, $mailq->recipient, $mailq->subject, $mailq->body, $sendHTML);
}
}
}
}
}
示例6: exists
function exists()
{
$db = EasyBlogHelper::db();
$query = 'SELECT COUNT(1) FROM ' . EasyBlogHelper::getHelper('SQL')->nameQuote($this->_tbl) . ' ' . 'WHERE `team_id`=' . $db->Quote($this->team_id) . ' ' . 'AND `group_id`=' . $db->Quote($this->group_id);
$db->setQuery($query);
return $db->loadResult() > 0 ? true : false;
}
示例7: isAssociated
/**
* Detects where the system has been setup before
*/
public function isAssociated($type)
{
$db = EasyBlogHelper::db();
$query = 'SELECT COUNT(1) FROM ' . $db->nameQuote('#__easyblog_oauth') . ' ' . 'WHERE ' . $db->nameQuote('system') . '=' . $db->Quote(1) . ' ' . 'AND ' . $db->nameQuote('type') . '=' . $db->Quote($type) . ' ' . 'AND ' . $db->nameQuote('access_token') . ' !=""';
$db->setQuery($query);
return $db->loadResult() > 0;
}
示例8: getInput
protected function getInput()
{
if (!JFile::exists(JPATH_ROOT . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_easyblog' . DIRECTORY_SEPARATOR . 'constants.php')) {
return JText::_('PLG_DJMEDIATOOLS_EASYBLOG_COMPONENT_DISABLED');
}
require_once JPATH_ROOT . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_easyblog' . DIRECTORY_SEPARATOR . 'constants.php';
require_once EBLOG_HELPERS . DIRECTORY_SEPARATOR . 'helper.php';
$mainframe = JFactory::getApplication();
$db = EasyBlogHelper::db();
$doc = JFactory::getDocument();
JFactory::getLanguage()->load('com_easyblog', JPATH_ROOT);
require_once JPATH_ROOT . DIRECTORY_SEPARATOR . 'administrator' . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_easyblog' . DIRECTORY_SEPARATOR . 'models' . DIRECTORY_SEPARATOR . 'categories.php';
$model = new EasyBlogModelCategories();
$categories = $model->getAllCategories();
if (!is_array($this->value)) {
$this->value = array($this->value);
}
ob_start();
?>
<select name="<?php
echo $this->name;
?>
[]" multiple="multiple" style="width:220px;height:200px;" class="<?php
echo $this->element['class'];
?>
">
<?php
$selected = in_array('all', $this->value) ? ' selected="selected"' : '';
?>
<option value="all"<?php
echo $selected;
?>
><?php
echo JText::_('COM_EASYBLOG_ALL_CATEGORIES');
?>
</option>
<?php
foreach ($categories as $category) {
$selected = in_array($category->id, $this->value) ? ' selected="selected"' : '';
?>
<option value="<?php
echo $category->id;
?>
"<?php
echo $selected;
?>
><?php
echo $category->title;
?>
</option>
<?php
}
?>
</select>
<?php
$html = ob_get_contents();
ob_end_clean();
return $html;
}
示例9: getCategoriesByBlogger
function getCategoriesByBlogger($bloggerId)
{
$db = EasyBlogHelper::db();
$query = $this->_buildQueryByBlogger($bloggerId);
$db->setQuery($query);
$result = $this->_getList($query, $this->getState('limitstart'), $this->getState('limit'));
return $result;
}
示例10: getLanguageTitle
public function getLanguageTitle($code)
{
$db = EasyBlogHelper::db();
$query = 'SELECT ' . EasyBlogHelper::getHelper('SQL')->nameQuote('title') . ' FROM ' . EasyBlogHelper::getHelper('SQL')->nameQuote('#__languages') . ' WHERE ' . EasyBlogHelper::getHelper('SQL')->nameQuote('lang_code') . '=' . $db->Quote($code);
$db->setQuery($query);
$title = $db->loadResult();
return $title;
}
示例11: loadByKey
public function loadByKey($key)
{
$db = EasyBlogHelper::db();
$query = 'SELECT * FROM ' . $db->nameQuote($this->_tbl) . ' WHERE ' . $db->nameQuote('key') . '=' . $db->Quote($key);
$db->setQuery($query);
$data = $db->loadObject();
return parent::bind($data);
}
示例12: _buildQueryWhere
function _buildQueryWhere($userId)
{
$mainframe = JFactory::getApplication();
$db = EasyBlogHelper::db();
$where[] = 'a.' . EasyBlogHelper::getHelper('SQL')->nameQuote('user_id') . '=' . $db->Quote($userId);
$where = count($where) ? ' WHERE ' . implode(' AND ', $where) : '';
return $where;
}
示例13: getDescription
public function getDescription($rule)
{
$db = EasyBlogHelper::db();
$query = 'SELECT ' . EasyBlogHelper::getHelper('SQL')->nameQuote('description') . ' ' . 'FROM ' . EasyBlogHelper::getHelper('SQL')->nameQuote('#__easyblog_acl') . ' ' . 'WHERE ' . EasyBlogHelper::getHelper('SQL')->nameQuote('action') . '=' . $db->Quote($rule);
$db->setQuery($query);
$description = $db->loadResult();
return $description;
}
示例14: loadBySource
function loadBySource($postId, $key, $source)
{
$db = EasyBlogHelper::db();
$query = 'SELECT * FROM ' . EasyBlogHelper::getHelper('SQL')->nameQuote($this->_tbl) . ' ' . 'WHERE ' . EasyBlogHelper::getHelper('SQL')->nameQuote('uid') . '=' . $db->Quote($key) . ' ' . 'AND ' . EasyBlogHelper::getHelper('SQL')->nameQuote('post_id') . '=' . $db->Quote($postId) . ' ' . 'AND ' . EasyBlogHelper::getHelper('SQL')->nameQuote('source') . '=' . $db->Quote($source);
$db->setQuery($query);
$obj = $db->loadObject();
return parent::bind($obj);
}
示例15: getRatingUsers
public function getRatingUsers($uid, $type, $limit = 5)
{
$db = EasyBlogHelper::db();
$query = 'SELECT COUNT(' . EasyBlogHelper::getHelper('SQL')->nameQuote('created_by') . ') AS times, ' . EasyBlogHelper::getHelper('SQL')->nameQuote('created_by') . ' , ' . EasyBlogHelper::getHelper('SQL')->nameQuote('created') . ' ' . 'FROM ' . EasyBlogHelper::getHelper('SQL')->nameQuote('#__easyblog_ratings') . ' ' . 'WHERE ' . EasyBlogHelper::getHelper('SQL')->nameQuote('uid') . ' = ' . $db->Quote($uid) . ' ' . 'AND ' . EasyBlogHelper::getHelper('SQL')->nameQuote('type') . ' = ' . $db->Quote($type) . ' ' . 'GROUP BY ' . EasyBlogHelper::getHelper('SQL')->nameQuote('created_by') . ' ' . 'LIMIT 0,' . $limit;
$db->setQuery($query);
$result = $db->loadObjectList();
return $result;
}