<?php

if (isNitroEnabled() && getNitroPersistence('PageCache.Enabled')) {
  if (isset($_GET['tracking'])) {
    setcookie('tracking', $_GET['tracking'], time() + 3600 * 24 * 1000, '/');
    $db = NitroDB::getInstance();
    $db->query("UPDATE `" . DB_PREFIX . "marketing` SET clicks = (clicks + 1) WHERE code = '" . $db->escape($_GET['tracking']) . "'");
  }

  require_once NITRO_CORE_FOLDER . 'top.php';
  open_nitro();
}
