prepare("SELECT * FROM appusers WHERE (phoneNum=? OR phoneNum=? OR phoneNum=?) AND isApproved=1 LIMIT 1"); $s->execute([$phone, $intl, '+' . $intl]); return $s->fetch(); } function getMember($phone) { $phone = normalizePhone($phone); $intl = '31' . substr($phone, 1); $s = ai_db()->prepare("SELECT * FROM appusers WHERE phoneNum=? OR phoneNum=? OR phoneNum=? LIMIT 1"); $s->execute([$phone, $intl, '+' . $intl]); return $s->fetch(); } $action = $_POST['action'] ?? ''; $error = ''; $member = null; $view = 'check'; $slug = $_GET['s'] ?? $_POST['s'] ?? ''; if ($action === 'logout') { setcookie(COOKIE_NAME, '', time() - 3600, '/', '', true, true); header('Location: artikel.php' . ($slug ? '?s=' . urlencode($slug) : '')); exit; } if ($action === 'check') { $phone = trim($_POST['phone'] ?? ''); if (!$phone) { $error = 'Vul je telefoonnummer in.'; } else { $member = checkMember($phone); if ($member) { setcookie(COOKIE_NAME, normalizePhone($phone), time() + 86400 * COOKIE_DAYS, '/', '', true, true); $_COOKIE[COOKIE_NAME] = normalizePhone($phone); } else { $existing = getMember($phone); if ($existing) { $view = 'pending'; } else { $view = 'register'; $error = 'notfound'; } } } } if ($action === 'register') { $phone = normalizePhone(trim($_POST['phone'] ?? '')); $firstName = trim($_POST['firstName'] ?? ''); $lastName = trim($_POST['lastName'] ?? ''); $functie = trim($_POST['functie'] ?? ''); $woonplaats = trim($_POST['woonplaats'] ?? ''); $years = (int)($_POST['yearsExperience'] ?? 0); if (!$phone || !$firstName || !$lastName) { $error = 'Vul alle verplichte velden in.'; $view = 'register'; } else { $existing = getMember($phone); if ($existing && $existing['isApproved']) { $member = $existing; setcookie(COOKIE_NAME, $phone, time() + 86400 * COOKIE_DAYS, '/', '', true, true); $_COOKIE[COOKIE_NAME] = $phone; } elseif ($existing) { $view = 'pending'; } else { $uuid = md5(uniqid($phone, true)); ai_db()->prepare("INSERT INTO appusers (uuid,createdAt,firstName,lastName,phoneNum,functie,woonplaats,yearsExperience,isApproved,isManuallyAdded,experiences) VALUES (?,NOW(),?,?,?,?,?,?,0,0,'[]')") ->execute([$uuid,$firstName,$lastName,$phone,$functie,$woonplaats,$years]); $view = 'success'; } } } if ($action === 'show_register') { $view = 'register'; } $cookiePhone = $_COOKIE[COOKIE_NAME] ?? ''; if ($cookiePhone && !$member) { $member = checkMember($cookiePhone); if (!$member) { setcookie(COOKIE_NAME, '', time() - 3600, '/'); $cookiePhone = ''; } } $hasAccess = !!$member; $article = null; $artConfig = []; if ($hasAccess && $slug) { $apiUrl = 'https://socialmanager.imaginecreativeagency.nl/api.php?action=article_public&slug=' . urlencode($slug); $resp = @file_get_contents($apiUrl, false, stream_context_create(['http'=>['timeout'=>5]])); if ($resp) { $data = json_decode($resp, true); if ($data['ok']) { $article = $data['data']['article'] ?? $data['data']; $artConfig = $data['data']['config'] ?? $data['config'] ?? []; } } } // Template instellingen met fallbacks $tplColor = $artConfig['article_primary_color'] ?? '#00AAFF'; $tplBg = $artConfig['article_bg_color'] ?? '#080808'; $tplFont = $artConfig['article_font'] ?? 'bebas'; $tplLogo = $artConfig['article_logo'] ?? 'AutoInsiders'; $tplTag = $artConfig['article_tagline'] ?? 'Exclusieve automotive-community'; $fontUrl = match($tplFont) { 'playfair' => 'https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,700;1,400&family=Barlow:wght@300;400;700&display=swap', 'syne' => 'https://fonts.googleapis.com/css2?family=Syne:wght@600;700;800&family=Barlow:wght@300;400;700&display=swap', default => 'https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Barlow:ital,wght@0,300;0,400;0,700;1,400&display=swap', }; $fontTitle = match($tplFont) { 'playfair' => "'Playfair Display', serif", 'syne' => "'Syne', sans-serif", default => "'Bebas Neue', sans-serif", }; // Registreer labels bij bezoek if ($hasAccess && $slug && $article) { try { $labelNames = implode(',', array_column($article['labels'] ?? [], 'name')); $vuuid = md5(uniqid($cookiePhone, true)); $ua = $_SERVER['HTTP_USER_AGENT'] ?? ''; ai_db()->prepare("INSERT INTO urlvisits (uuid,createdAt,userAgent,uniqueLinkId,labels) VALUES (?,NOW(),?,?,?)") ->execute([$vuuid, $ua, $slug, $labelNames ?: null]); } catch (Exception $e) {} } function e($s) { return htmlspecialchars($s ?? '', ENT_QUOTES, 'UTF-8'); } ?> <?= $article ? e($article['title']) . ' — ' : '' ?>AutoInsiders
Leden only
Dit artikel is exclusief voor leden van de AutoInsiders community. Vul je telefoonnummer in om toegang te krijgen.
of
Gratis lidmaatschap
Word lid
Vul je gegevens in — je krijgt toegang zodra je aanvraag is goedgekeurd door de community-manager.
Dit nummer is nog niet bekend. Meld je hieronder aan.
Status
In behandeling
Je aanvraag is ontvangen en wordt beoordeeld. Je ontvangt een WhatsApp-bericht zodra je bent goedgekeurd.
Aanmelding ontvangen
Welkom bij AutoInsiders
Je aanvraag is ingediend. De community-manager beoordeelt je aanmelding en neemt contact op via WhatsApp zodra je toegang hebt.
<?= e($d['title']??'') ?>


<?= e($d['caption']??'') ?>
""
strpos($m['mime_type']??'','image')===0)); $videos = array_values(array_filter($media, fn($m) => strpos($m['mime_type']??'','video')===0)); $mainMedia = $videos[0] ?? $images[0] ?? null; ?>
<?= e($article['title']) ?>
404
Artikel niet beschikbaar