__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
<?php
/**
* @copyright Copyright (C) 2011 Simplify Your Web, Inc. All rights reserved.
* @license GNU General Public License version 3 or later; see LICENSE.txt
*/
namespace SYW\Library;
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\Helper\ContentHelper;
use Joomla\CMS\Language\Multilanguage;
use Joomla\Utilities\ArrayHelper;
use Joomla\Database\Exception\ExecutionFailureException;
class Tags
{
/*
* Get all tag objects for a specific content type (optional)
*
* @return array of tag objects (false if error)
*/
static function getTags($content_type = '', $whole = false, $tag_ids = array(), $include = true, $order = 'lft', $order_dir = 'ASC')
{
$tags = array();
$db = Factory::getDBO();
$query = $db->getQuery(true);
if ($whole) { // get the whole object
$query->select('a.*');
} else {
$query->select('a.id, a.path, a.title, a.level');
}
$query->from('#__tags AS a');
$query->join('LEFT', $db->quoteName('#__tags').' AS b ON a.lft > b.lft AND a.rgt < b.rgt');
// get tags for a specific content type
if (!empty($content_type)) { // get only tags associated with the content type
$query->join('INNER', $db->quoteName('#__contentitem_tag_map').' AS m ON m.tag_id = a.id AND m.type_alias ='.$db->quote($content_type));
}
$query->where('a.published = 1');
$query->where($db->quoteName('a.alias').' <> '.$db->quote('root'));
// get tags with specific ids
if (is_array($tag_ids) && count($tag_ids) > 0) {
ArrayHelper::toInteger($tag_ids);
$tag_ids = implode(',', $tag_ids);
$test_type = $include ? 'IN' : 'NOT IN';
$query->where($db->quoteName('a.id').' '.$test_type.' ('.$tag_ids.')');
}
// access groups
$user = Factory::getUser();
$groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')');
// language
if (Multilanguage::isEnabled()) {
$language = ContentHelper::getCurrentLanguage();
$query->where($db->quoteName('a.language').' IN ('.$db->quote($language).', '.$db->quote('*').')');
}
$query->group('a.id, a.title, a.level, a.lft, a.rgt, a.parent_id, a.path');
$query->order('a.'.$order.' '.$order_dir);
$db->setQuery($query);
try {
$tags = $db->loadObjectList();
} catch (ExecutionFailureException $e) {
return false;
}
return $tags;
}
}| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| Field | Folder | 0775 |
|
|
| Image | Folder | 0775 |
|
|
| Vendor | Folder | 0775 |
|
|
| Cache.php | File | 7.02 KB | 0664 |
|
| Fields.php | File | 6.86 KB | 0664 |
|
| Fonts.php | File | 13.75 KB | 0664 |
|
| HeaderFilesCache.php | File | 5.02 KB | 0664 |
|
| Image.php | File | 23.43 KB | 0664 |
|
| K2.php | File | 3.39 KB | 0664 |
|
| Libraries.php | File | 17.95 KB | 0664 |
|
| Plugin.php | File | 1.71 KB | 0664 |
|
| Stylesheets.php | File | 54.61 KB | 0664 |
|
| Tags.php | File | 2.36 KB | 0664 |
|
| Text.php | File | 2.31 KB | 0664 |
|
| Utilities.php | File | 30.4 KB | 0664 |
|
| Version.php | File | 3.29 KB | 0664 |
|