Commit 54a68e19 authored by Marco Huber's avatar Marco Huber
Browse files

[TASK] Update eID script for TYPO3 10

parent d8613d03
......@@ -14,17 +14,28 @@ namespace T3o\Randombanners\Eid;
* The TYPO3 project - inspiring people to share!
*/
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use TYPO3\CMS\Core\Http\Response;
use TYPO3\CMS\Core\Utility\GeneralUtility;
$banner = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('banner');
class RandombannersEidController
{
public function countClick(ServerRequestInterface $request)
{
$banner = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('banner');
/* @var \TYPO3\CMS\Core\Database\Query\QueryBuilder $queryBuilder */
$queryBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Database\ConnectionPool::class)
->getQueryBuilderForTable('tx_randombanners_domain_model_banner');
$queryBuilder
->update('tx_randombanners_domain_model_banner')
->where(
$queryBuilder->expr()->eq('uid', (int)$banner)
)
->set('clicked_this_month', 'clicked_this_month + 1', false)
->execute();
/* @var \TYPO3\CMS\Core\Database\Query\QueryBuilder $queryBuilder */
$queryBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Database\ConnectionPool::class)
->getQueryBuilderForTable('tx_randombanners_domain_model_banner');
$queryBuilder
->update('tx_randombanners_domain_model_banner')
->where(
$queryBuilder->expr()->eq('uid', (int)$banner)
)
->set('clicked_this_month', 'clicked_this_month + 1', false)
->execute();
return new Response();
}
}
\ No newline at end of file
......@@ -13,4 +13,4 @@ defined('TYPO3_MODE') or die();
);
// AJAX
$GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['randombanners'] = 'EXT:' . $_EXTKEY . '/Classes/Eid/Count.php';
\ No newline at end of file
$GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['randombanners'] = \T3o\Randombanners\Eid\RandombannersEidController::class . '::countClick';
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment