本文整理汇总了PHP中EasyBlogHelper::getCategoryMenuBloggerId方法的典型用法代码示例。如果您正苦于以下问题:PHP EasyBlogHelper::getCategoryMenuBloggerId方法的具体用法?PHP EasyBlogHelper::getCategoryMenuBloggerId怎么用?PHP EasyBlogHelper::getCategoryMenuBloggerId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EasyBlogHelper
的用法示例。
在下文中一共展示了EasyBlogHelper::getCategoryMenuBloggerId方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getBlogsBy
//.........这里部分代码省略.........
$queryWhere .= ' AND a.`access` = ' . $db->Quote(BLOG_PRIVACY_PUBLIC);
}
}
}
if ($isBloggerMode !== false) {
$queryWhere .= ' AND a.`created_by` = ' . $db->Quote($isBloggerMode);
}
$contentId = '';
$isIdArray = false;
if (is_array($typeId)) {
if (count($typeId) > 1) {
for ($i = 0; $i < count($typeId); $i++) {
if ($typeId[$i]) {
$contentId .= $typeId[$i];
if ($i + 1 < count($typeId)) {
$contentId .= ',';
}
}
}
$isIdArray = true;
} else {
if (!empty($typeId)) {
$contentId = $typeId[0];
}
}
} else {
$contentId = $typeId;
}
if ($contentId) {
switch ($type) {
case 'category':
$catAccess['type'] = $typeId;
if ($isBloggerMode === false) {
$catBloggerId = EasyBlogHelper::getCategoryMenuBloggerId();
if (!empty($catBloggerId)) {
$queryWhere .= ' AND a.`created_by` = ' . $db->Quote($catBloggerId);
}
}
break;
case 'blogger':
$queryWhere .= $isIdArray ? ' AND a.`created_by` IN (' . $contentId . ')' : ' AND a.`created_by` = ' . $db->Quote($contentId);
break;
case 'teamblog':
$queryWhere .= ' AND (a.source_type = ' . $db->Quote(EASYBLOG_POST_SOURCE_TEAM);
$queryWhere .= $isIdArray ? ' AND a.source_id IN (' . $contentId . ')' : ' AND a.`source_id` = ' . $db->Quote($contentId);
$queryWhere .= ')';
break;
default:
break;
}
}
// @rule: Filter for `source` column type.
if (!is_null($postType)) {
switch ($postType) {
case 'microblog':
$queryWhere .= ' AND a.`posttype` != ' . $db->Quote('');
break;
case 'posts':
$queryWhere .= ' AND a.`posttype` = ' . $db->Quote('');
break;
case 'quote':
$queryWhere .= ' AND a.`posttype` = ' . $db->Quote('quote');
break;
case 'link':
$queryWhere .= ' AND a.`posttype` = ' . $db->Quote('link');
break;
示例2: getTotalPostCount
function getTotalPostCount($catIds)
{
$db = EasyBlogHelper::db();
//blog privacy setting
$my = JFactory::getUser();
$isBloggerMode = EasyBlogRouter::isBloggerMode();
$categoryId = '';
$isIdArray = false;
if (is_array($catIds)) {
if (count($catIds) > 1) {
$categoryId = implode(',', $catIds);
$isIdArray = true;
} else {
$categoryId = $catIds[0];
}
} else {
$categoryId = $catIds;
}
$query = 'SELECT COUNT(b.`id`) AS `cnt`';
$query .= ' FROM ' . EasyBlogHelper::getHelper('SQL')->nameQuote('#__easyblog_category') . ' AS `a`';
$query .= ' LEFT JOIN ' . EasyBlogHelper::getHelper('SQL')->nameQuote('#__easyblog_post') . ' AS b';
$query .= ' ON a.`id` = b.`category_id`';
$query .= ' AND b.`published` = ' . $db->Quote('1');
if ($my->id == 0) {
$query .= ' AND b.`private` = ' . $db->Quote(BLOG_PRIVACY_PUBLIC);
}
if ($isBloggerMode !== false) {
$query .= ' AND b.`created_by` = ' . $db->Quote($isBloggerMode);
} else {
$catBloggerId = EasyBlogHelper::getCategoryMenuBloggerId();
if (!empty($catBloggerId)) {
$query .= ' AND b.`created_by` = ' . $db->Quote($catBloggerId);
}
}
$query .= ' WHERE a.`published` = 1';
$query .= $isIdArray ? ' AND a.`id` IN (' . $categoryId . ')' : ' AND a.`id` = ' . $db->Quote($categoryId);
if (EasyBlogHelper::getJoomlaVersion() >= '1.6') {
// @rule: When language filter is enabled, we need to detect the appropriate contents
$filterLanguage = JFactory::getApplication()->getLanguageFilter();
if ($filterLanguage) {
$query .= ' AND (';
$query .= ' b.`language`=' . $db->Quote(JFactory::getLanguage()->getTag());
$query .= ' OR b.`language`=' . $db->Quote('');
$query .= ' OR b.`language`=' . $db->Quote('*');
$query .= ' )';
}
}
$query .= ' GROUP BY a.`id` HAVING (COUNT(b.`id`) > 0)';
$db->setQuery($query);
$result = $db->loadResultArray();
if (!empty($result)) {
return array_sum($result);
} else {
return '0';
}
}
示例3: getBlogsBy
//.........这里部分代码省略.........
$queryWhere .= ' AND a.`private` = ' . $db->Quote(BLOG_PRIVACY_PUBLIC);
}
}
}
if ($isBloggerMode !== false) {
$queryWhere .= ' AND a.`created_by` = ' . $db->Quote($isBloggerMode);
}
$contentId = '';
$isIdArray = false;
if (is_array($typeId)) {
if (count($typeId) > 1) {
for ($i = 0; $i < count($typeId); $i++) {
if ($typeId[$i]) {
$contentId .= $typeId[$i];
if ($i + 1 < count($typeId)) {
$contentId .= ',';
}
}
}
$isIdArray = true;
} else {
if (!empty($typeId)) {
$contentId = $typeId[0];
}
}
} else {
$contentId = $typeId;
}
if ($contentId) {
switch ($type) {
case 'category':
$queryWhere .= $isIdArray ? ' AND a.`category_id` IN (' . $contentId . ')' : ' AND a.`category_id` = ' . $db->Quote($contentId);
if ($isBloggerMode === false) {
$catBloggerId = EasyBlogHelper::getCategoryMenuBloggerId();
if (!empty($catBloggerId)) {
$queryWhere .= ' AND a.`created_by` = ' . $db->Quote($catBloggerId);
}
}
break;
case 'blogger':
$queryWhere .= $isIdArray ? ' AND a.`created_by` IN (' . $contentId . ')' : ' AND a.`created_by` = ' . $db->Quote($contentId);
break;
case 'teamblog':
$queryWhere .= $isIdArray ? ' AND u.`team_id` IN (' . $contentId . ')' : ' AND u.`team_id` = ' . $db->Quote($contentId);
break;
default:
break;
}
}
// @rule: Filter for `source` column type.
if (!is_null($postType)) {
switch ($postType) {
case 'microblog':
$queryWhere .= ' AND a.`source` != ' . $db->Quote('');
break;
case 'posts':
$queryWhere .= ' AND a.`source` = ' . $db->Quote('');
break;
}
}
if ($type == 'blogger' || $type == 'teamblog') {
if (!empty($statType)) {
if ($statType == 'category') {
$queryWhere .= ' AND a.`category_id` = ' . $db->Quote($statId);
} else {
$queryWhere .= ' AND t.`tag_id` = ' . $db->Quote($statId);