code blijft werken if (isset($_SERVER["HTTP_CF_CONNECTING_IP"])) { $_SERVER['REMOTE_ADDR'] = $_SERVER["HTTP_CF_CONNECTING_IP"]; } if (in_array($_SERVER['HTTP_HOST'], ['localhost', Host::TUINADVIES_DEV])) { $_SERVER['REMOTE_ADDR'] = '127.0.0.1'; } $currentdomain = strtolower(str_replace("www.", "", $_SERVER['HTTP_HOST'])); if (($currentdomain == "tuintv.be") or ($currentdomain == "bloemschikken.com")) { header("HTTP/1.1 301 Moved Permanently"); header("Location: https://www.tuinadvies.be" . $_SERVER['REQUEST_URI']); exit(); } if (isset($_GET["zoekenid"]) && ($_GET["zoekenid"] != '')) //zoekenid weg!!!! { //redirect zonder zoekenid $uri_parts = explode('?', $_SERVER['REQUEST_URI'], 2); //301 redirect header("HTTP/1.1 301 Moved Permanently"); header("Location: https://" . $_SERVER['HTTP_HOST'] . $uri_parts[0]); exit(); } $_SESSION["pree_test"] = []; $_SESSION["controler_route"] = false; //labels wegschrijven !!! //urls met daarin het woord aveve moet worden geforwarded naar een 404 pagina //tenzij een bezoeker dit echt heeft gezocht in onze eigen zoekfunctie. $noindexnofollow = ""; if (preg_match("/aveve/", strtolower($_SERVER["REQUEST_URI"]))) { if (preg_match("/tuinadvies/", strtolower($_SERVER['HTTP_REFERER']))) { //tis iemand die zelf heeft gezocht, dus deze pagina niet laten indexeren $noindexnofollow = ""; } else { //pagina is niet aangeroepen via tuinadvies. Wellicht google of iets anders, dus 301'en Header("HTTP/1.1 301 Moved Permanently"); Header("Location: /404.html"); exit; } } if ($_SERVER['SERVER_NAME'] == 'www.digituin.be') { Header("HTTP/1.1 301 Moved Permanently"); Header("Location: http://www.tuinadvies.be/tuinvrienden"); exit; } if (($_SERVER['SERVER_NAME'] == 'www.tuinwinkel.be') or ($_SERVER['SERVER_NAME'] == 'www.tuinadvi.es') or ($_SERVER['SERVER_NAME'] == 'www.tuinclub.be')) //ilse 11/2017 { Header("HTTP/1.1 301 Moved Permanently"); Header("Location: https://www.tuinadvies.be" . $_SERVER['REQUEST_URI']); exit; } if (in_array($_SERVER['HTTP_HOST'], ['localhost', 'tuinadvies.docker'])) { error_reporting(E_ERROR); } elseif ($_SERVER['REMOTE_ADDR'] != '91.183.203.239') { //109.135.17.76 // Turn off all error reporting error_reporting(0); } else { error_reporting(E_ERROR); } if (!stristr($_SERVER['REQUEST_URI'], "/ajax/")) { //enkel indien het een niet-ajax pagina betreft !!! //product_detail vorig en volgend product $_SESSION['new_product_order'] = []; } //product_detail vorig en volgend plant $_SESSION['new_plant_order'] = []; if ($_SERVER['SERVER_NAME'] == 'test.tuinadvies.be') { $_SESSION['testversion'] = true; } else { $_SESSION['testversion'] = false; } if ($_SESSION['testversion']) { date_default_timezone_set('Europe/Brussels'); $noindexnofollow = ""; } //proberen resizes toe te voegen aan tuinfoto_album_fotos // maar bij de activiteiten zitten de fotos vast in de tekst!! probleem !!!!! //voorlopig niet online .... if ((isset($_GET["tuinfotos"])) && ($_GET["tuinfotos"] == 'ilse1976')) { $_SESSION['tuinfotos'] = true; } if ((isset($_GET["layoutold"])) && ($_GET["layoutold"] == 'ilse1976')) { $_SESSION['layoutold'] = true; } $_SESSION['bus'] = true; $_SESSION['orderplanten'] = true; $_SESSION['pager'] = true; $_SESSION['pagination'] = true; if ((isset($_GET["layout"])) && ($_GET["layout"] == 'ilse1976')) { $_SESSION['layout'] = true; } elseif (!isset($_SESSION['layout'])) { $_SESSION['layout'] = false; } $_SESSION["save_labels_trans"] = []; //Templater::vertaal -> iedere label hierin opslaan onderaan de pagina wegschrijven if ((isset($_GET["lazyload"])) && ($_GET["lazyload"] == 'ilse1976')) { $_SESSION['lazyload'] = true; } elseif (!isset($_SESSION['lazyload'])) { $_SESSION['lazyload'] = false; } $_SESSION['lazyload'] = true; if ((isset($_GET["testsite"])) && ($_GET["testsite"] == 'ilse1976')) { $_SESSION['testsite'] = true; } header('Content-Type: text/html; charset=utf-8'); $useragent = $_SERVER['HTTP_USER_AGENT']; if (preg_match('/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i', $useragent) || preg_match('/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i', substr($useragent, 0, 4))) $_SESSION['mobile'] = 1; else $_SESSION['mobile'] = 0; $css_version = '1.435'; include("library/functions.php"); if ($_SERVER['SERVER_NAME'] == 'www.matelma.de') //oude links redirecten { Header("HTTP/1.1 301 Moved Permanently"); Header("Location: https://www.matelma.com/de-de" . ($_SERVER['REQUEST_URI'] == '/' ? '' : $_SERVER['REQUEST_URI'])); exit; } elseif ($_SERVER['SERVER_NAME'] == 'www.matelma.be') { Header("HTTP/1.1 301 Moved Permanently"); $c = explode("?", $_SERVER['REQUEST_URI']); $urlRequestZonderParams = $c[0]; Header("Location: https://www.tuinadvies.be" . ($c[0] == '/' ? '' : $c[0]) . "?selectCountry=1"); exit; } elseif ($_SERVER['SERVER_NAME'] == 'www.matelma.fr') { Header("HTTP/1.1 301 Moved Permanently"); $c = explode("?", $_SERVER['REQUEST_URI']); $urlRequestZonderParams = $c[0]; Header("Location: https://www.matelma.com/fr-fr" . ($c[0] == '/' ? '' : $c[0]) . "?selectCountry=1"); exit; } //if ( ($_SERVER['REMOTE_ADDR'] == "109.135.17.76") or ($_SERVER['REMOTE_ADDR'] == "188.166.90.42")) { // echo $_SERVER['REMOTE_ADDR']; // // if (Templater::getIdPageContent() == 'tuinwinkel_mijnbestellingen'){ // // // // pre($_COOKIE); // // echo 'test'; // // die(); // // } //} include("classes/class.Templater.php"); include("classes/class.Controller.php"); include("classes/class.Banners.php"); include("classes/class.Database.php"); include("classes/class.Artikel.php"); include("classes/class.Author.php"); include("classes/class.Profiel.php"); include("classes/class.ImageResize.php"); include("classes/class.Taal.php"); include("classes/class.Tags.php"); include("classes/class.Pagination.php"); include("classes/class.Encyclopedie.php"); include("classes/class.Bookmark.php"); include("classes/class.Activiteit.php"); include("classes/class.Forum.php"); include("classes/class.Tuinfoto.php"); include("classes/class.Ruillijst.php"); include("classes/class.Producten.php"); include("classes/class.FrontAndBackend.php"); include("classes/class.SharedFunctions.php"); include("classes/class.Winkelwagen.php"); include("classes/class.Verlanglijst.php"); include("classes/class.Url.php"); include("classes/class.Berichten.php"); include("classes/class.Soap.php"); include("classes/class.Bestelling.php"); include("classes/class.Media.php"); include("classes/class.Cutoff.php"); include("classes/class.Inhoud.php"); include("classes/class.MultiSafePayAfhandeling.php"); include("classes/class.Merk.php"); include("classes/class.Plantenherkenner.php"); include("classes/class.Status.php"); include("classes/class.Tuinagenda.php"); include("classes/class.Video.php"); include("classes/class.Tuinproblemen.php"); include("classes/class.Quiz.php"); include("classes/class.Faq.php"); include("classes/class.Marketing.php"); //print_r("offline"); //die(); include("classes/class.Plantenbeheer.php"); include("classes/class.Ads.php"); include("classes/class.Mail.php"); include("classes/class.Like.php"); include("classes/class.Dhl.php"); include("classes/class.Zoeken.php"); //UITZONDERING IN ADMIN include("admin/phpmailer/PHPMailerAutoload.php"); include("classes/class.Admin.php"); //tijdelijke fix om inkomende bezoekers vanuit google toch de juiste zoekresultatentab te tonen (2022/11/04) use Tuinadvies\Domain\Visitor\SearchTab; if (str_contains($_SERVER['REQUEST_URI'], "/" . (Templater::genereerKorteTitelMetCijfers(Templater::vertaal("TUINWINKEL"))))) { $lastVisitedSearchTabRepository = Container::getLastVisitedSearchTabRepository(); $lastVisitedSearchTabRepository->set(SearchTab::useTabFromController('webshop')); } //indien marketing beslist om een custom popup te tonen, dan moet dit hier bekeken worden $shopInstellingen = Templater::getShopInstellingen(); if (time() > $shopInstellingen['kortingscodepopup_vanaf'] && time() < $shopInstellingen['kortingscodepopup_tot']) { $_SESSION['toonKortingscodePopup'] = true; } else { //tenzij de testsessie manueel gezet is: if ($_SESSION['toonKortingscodePopupManueel']) { } else { unset($_SESSION['toonKortingscodePopup']); } } //testen om de popup aan te zetten? => via get-parameter if ((isset($_GET["previewkortingscodepopup"])) && ($_GET["previewkortingscodepopup"] == '1')) { $_SESSION['toonKortingscodePopup'] = true; $_SESSION['toonKortingscodePopupManueel'] = true; } //test terug kunnen uitzetten if ((isset($_GET["previewkortingscodepopup"])) && ($_GET["previewkortingscodepopup"] == '0')) { unset($_SESSION['toonKortingscodePopup']); unset($_SESSION['toonKortingscodePopupManueel']); } // //in tijden van AB-testen controleren of de huidige test nog steeds actief is // if ($_SESSION['abtest_active_id'] != "") { // //als er een sessie bestaat, dan controleren of deze nu nog altijd live is // Templater::checkValidityAbTest($_SESSION['abtest_active_id']); // } if ($_GET['ELASTICSEARCH_ENABLED'] != "") { //wordt dus doorgegeven aan de hand van een get-parameter zoals www.tuinadvies.be?ELASTICSEARCH_ENABLED=102 //sessie voor autocomplete maken if (substr(trim($_GET['ELASTICSEARCH_ENABLED']), 0, 1) == '0') { $_SESSION['ELASTICSEARCH_AUTOCOMPLETE'] = "false"; } elseif (substr(trim($_GET['ELASTICSEARCH_ENABLED']), 0, 1) == 1) { $_SESSION['ELASTICSEARCH_AUTOCOMPLETE'] = "true"; } if (substr(trim($_GET['ELASTICSEARCH_ENABLED']), 0, 1) == 2) { unset($_SESSION['ELASTICSEARCH_AUTOCOMPLETE']); } //sessie voor gewone zoekpagina maken (idem voor de laad-meer items op zoek zoekpagina) if (substr(trim($_GET['ELASTICSEARCH_ENABLED']), 1, 1) == 0) { $_SESSION['ELASTICSEARCH_SERPS'] = "false"; } elseif (substr(trim($_GET['ELASTICSEARCH_ENABLED']), 1, 1) == 1) { $_SESSION['ELASTICSEARCH_SERPS'] = "true"; } if (substr(trim($_GET['ELASTICSEARCH_ENABLED']), 1, 1) == 2) { unset($_SESSION['ELASTICSEARCH_SERPS']); } //sessie voor gerelateerde items op de productpagina if (substr(trim($_GET['ELASTICSEARCH_ENABLED']), 2, 1) == 0) { $_SESSION['ELASTICSEARCH_GERELATEERDE'] = "false"; } elseif (substr(trim($_GET['ELASTICSEARCH_ENABLED']), 2, 1) == 1) { $_SESSION['ELASTICSEARCH_GERELATEERDE'] = "true"; } if (substr(trim($_GET['ELASTICSEARCH_ENABLED']), 2, 1) == 2) { unset($_SESSION['ELASTICSEARCH_GERELATEERDE']); } } //een lijst van alle ip-adressen bijhouden waarmee een klant de site bezoekt Bestelling::logUsersIpHistory(); //links uit de nieuwsbrief 10/2017 // hs37 + hashstring weglaten uit url + automatisch inloggen adhv deze hash if (preg_match("/hs37([a-z0-9]+)/", $_SERVER['REQUEST_URI'], $match)) { //oude manier $profiel = Profiel::getProfielByHashAutoLogin($match[1]); if (!empty($profiel['profiel_email'])) { Profiel::inloggen($profiel['profiel_email'], $profiel['profiel_wachtwoord']); } $newURL = (isSecure() ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . str_replace("/" . $match[0], '', $_SERVER['REQUEST_URI']); header("HTTP/1.1 301 Moved Permanently"); header("Location: " . $newURL); exit(); } //nieuwsbrief kliks //https://www.tuinadvies.be/tuinwinkel/product/10614/regenton-antraciet-270-liter? //Array //( // [mi] => 1012 // [k] => 43429 // [mhash] => bbe68e980cfa26828f89111a284c6413utm_source=TUBE // [utm_campaign] => MAILING_2018_01_31_1517410102 // [utm_medium] => email // [utm_term] => MAILING_2018_01_31_1517410102_43429 //) // //IPBAN? //voorlopig niet meer uitvoeren. // if (Templater::ipStaatOpBlacklist()) { // print(""); // exit(); // } function grabIpInfo($ip) { $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, "https://api.ipgeolocationapi.com/geolocate/" . $ip); curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($curl, CURLOPT_TIMEOUT, 3); $returnData = curl_exec($curl); curl_close($curl); return $returnData; } function getIpLandje($ip) { $sth = Database::prepare('SELECT ip_landcode from tube0712_sitebe.ip2loc WHERE ip_ipstart<=:ip AND ip_ipstop>=:ip '); $sth->bindValue("ip", ip2long($ip), PDO::PARAM_INT); Database::execute($sth); $iplandje = $sth->fetchColumn(0); return ($iplandje); } //if(isset($_GET["mhash"])){//nieuw systeem ilse -> mag weg -> niet meer automatisch laten inloggen vanuit de mailing if (isset($_GET["mi"]) && isset($_GET["k"])) { //nieuw systeem ilse // $curl = curl_init(); // curl_setopt_array($curl, array( // CURLOPT_URL => "https://freegeoip.app/json/".$ip, // CURLOPT_RETURNTRANSFER => true, // CURLOPT_ENCODING => "", // CURLOPT_MAXREDIRS => 10, // CURLOPT_TIMEOUT => 5, // CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, // CURLOPT_CUSTOMREQUEST => "GET", // CURLOPT_HTTPHEADER => array( // "accept: application/json", // "content-type: application/json" // ), // )); // $response = curl_exec($curl); // $err = curl_error($curl); // curl_close($curl); // // if ($err) { //// echo "cURL Error #:" . $err; // //Admin::voegErrorLogToe("ip api error", $err); //// mail("[email protected]", "test ip ERR ".$err, $ip.' - lancode nie gevonden !!!! '.$_SERVER['HTTP_HOST'].' '.$_SERVER['REQUEST_URI'] . ' - sess.kl.id. '.$_SESSION['klant_land_id']); // } else { // $tmp = json_decode($response, true); // $iplandcode = $tmp["country_code"]; // // if( ($iplandcode=="NL") OR ($iplandcode=="BE") OR ($iplandcode=="DE") OR ($iplandcode=="FR")){ // $iplandje = $iplandcode; // }else{ // // Admin::voegErrorLogToe("ander ip land mailing", " ipland niet be/nl/de/fr "); // // mail("[email protected]", "test ip NIET ".$iplandcode, $ip.' - lancode nie gevonden !!!! '.$_SERVER['HTTP_HOST'].' '.$_SERVER['REQUEST_URI'] . ' - sess.kl.id. '.$_SESSION['klant_land_id']); // } // } // $lol=ip2long($ip); // $sth = Database::prepare('SELECT ip_land from tube0712_sitebe.ip2loc WHERE ip_ipstart<=:ip AND ip_ipstop>=:ip '); // $sth->bindValue("ip", $lol, PDO::PARAM_INT); // Database::execute($sth); // $iplandje = $sth->fetchColumn(0); // $ipInfo = grabIpInfo($ip); // $ipJsonInfo = json_decode($ipInfo); // $iplandcode = $ipJsonInfo->alpha2; $ip = $_SERVER["REMOTE_ADDR"]; $iplandje = ""; $iplandcode = getIpLandje($ip); if (($iplandcode == "NL") or ($iplandcode == "BE") or ($iplandcode == "DE") or ($iplandcode == "FR")) { $iplandje = $iplandcode; } else { // // Admin::voegErrorLogToe("ander ip land mailing", " ipland niet be/nl/de/fr "); // mail("[email protected]", "test ip NIET ".$iplandcode, $ip.' - lancode nie gevonden !!!! '.$_SERVER['HTTP_HOST'].' '.$_SERVER['REQUEST_URI'] . ' - sess.kl.id. '.$_SESSION['klant_land_id']); } //pree($iplandje); $tempURL = ($_SERVER['REDIRECT_HTTPS'] == 'on' ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; $aTempURL = explode('?', $tempURL); $sURL = $aTempURL[0]; if ($iplandje != "") { //ipland is niet leeg ==> tzal geen amerikaansen bot zijn //bijhouden klik van klant, maar url filteren zodat de hash wegvalt ==> later gemakkelijker asc te sorteren in favo url // if ($ip != Templater::getTuinadviesIp()){//kliks tuinadvies niet wegschrijven $timestamp = time(); $sth = Database::prepare("INSERT into tube0712_log.mailing_log_kliks SET log_klik_mailing_id = :mailingid, log_klik_datum=:timestamp, log_klik_klant_id=:klantid, log_klik_url=:url, log_klik_uri =:uri, log_klik_ip=:ip"); $sth->bindValue("mailingid", $_GET["mi"], PDO::PARAM_INT); $sth->bindValue("timestamp", $timestamp, PDO::PARAM_STR); $sth->bindValue("klantid", $_GET["k"], PDO::PARAM_INT); $sth->bindValue("url", $sURL, PDO::PARAM_STR); $sth->bindValue("uri", ($_SERVER['REDIRECT_HTTPS'] == 'on' ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], PDO::PARAM_STR); $sth->bindValue("ip", $ip, PDO::PARAM_STR); //TODO Database::execute($sth); //pree("dd"); // mail("[email protected]", "error mailing", "".$_GET["mi"]." - ".$_GET["k"]." - ".$sURL." - ".$ip); //indien de mailing niet in HTML-mode zou zijn geopend is de open-event nooit getriggerd //hier is mailing geklikt ==> is dus ook geopend ==> open-event oproepen $sth = Database::prepare("INSERT into tube0712_log.mailing_log_open SET log_open_mailing_id=:mailingid, log_open_klant_id=:klantid, log_open_ip=:ip ON DUPLICATE KEY UPDATE log_open_ip=:ip"); $sth->bindValue("mailingid", $_GET["mi"], PDO::PARAM_INT); $sth->bindValue("klantid", $_GET["k"], PDO::PARAM_INT); $sth->bindValue("ip", $ip, PDO::PARAM_STR); //TODO Database::execute($sth); // } } else { //effen alles zonder iplandje... 13/2/2019 $timestamp = time(); // $sth = Database::prepare("INSERT into tube0712_log.mailing_log_kliks2 SET // log_klik_mailing_id = :mailingid, // log_klik_datum=:timestamp, // log_klik_klant_id=:klantid, // log_klik_url=:url, // log_klik_uri =:uri, // log_klik_ip=:ip"); // $sth->bindValue("mailingid", $_GET["mi"], PDO::PARAM_INT); // $sth->bindValue("timestamp", $timestamp, PDO::PARAM_STR); // $sth->bindValue("klantid", $_GET["k"], PDO::PARAM_INT); // $sth->bindValue("url", $sURL, PDO::PARAM_STR); // $sth->bindValue("uri", ($_SERVER['REDIRECT_HTTPS']=='on'?'https://':'http://').$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'], PDO::PARAM_STR); // $sth->bindValue("ip", $ip, PDO::PARAM_STR); //TODO // Database::execute($sth); } //via de hash automatisch inloggenmail( // if(($_SERVER['REMOTE_ADDR'] == Templater::getTuinadviesIp()) OR ($_SERVER['REMOTE_ADDR'] == Templater::getTuinadviesIpNL())){ // //niet automatisch inloggen // }else{ // $profiel = Profiel::getProfielByHashKlantAutoLogin($_GET["mhash"], $_GET["k"]); // //$profiel = Profiel::getProfielByHashAutoLogin($_GET["mhash"]); // if(! empty($profiel['profiel_email'])){ // Profiel::inloggen($profiel['profiel_email'], $profiel['profiel_wachtwoord']); // } // } } if (isset($_GET["bannerfotoid"]) && ($_GET["bannerfotoid"] != '')) { Banners::verhoogKliksBannerFoto($_GET["bannerfotoid"]); } /// ilse 2/5/2017 Profiel:isIngelogd -> query meerdere keren per pagina -> dit is niet nodig // script 1 maal draaien per pagina en isIngelogd aanpassen Profiel::isIngelogdCheckStatusValid(); //PROBEER AUTOMATISCH MET COOKIE IN TE LOGGEN if (isset($_COOKIE['cookiegebruikersnaam']) && isset($_COOKIE['cookiewachtwoord']) && !Profiel::isIngelogd()) { Profiel::inloggen($_COOKIE['cookiegebruikersnaam'], $_COOKIE['cookiewachtwoord']); //+setcookie preferedcountry } $_SESSION['testfrans'] = true; $_SESSION['testparcelshop'] = true; //pree($_SERVER['HTTP_HOST']); //pree($_SERVER['REQUEST_URI']); //if(isset($_GET["dsfsdf"])){ // echo $_GET["dsfsdf"]; // // print_r($_COOKIE); // print_r($_SERVER["REMOTE_ADDR"]); // // $ip = $_SERVER["REMOTE_ADDR"]; // //// $opts = array('http'=>array('method'=>"GET")); //// $context = stream_context_create($opts); //// $res = file_get_contents('http://freegeoip.net/json/'.$ip, false, $context); //// //// print_r($res); //// // //https://ipstack.com/quickstart //// $key = "27f7b2a59c826ba1afe655ac03418dd4"; //// $urlipstack = "http://api.ipstack.com/".$ip."?access_key=".$key; //// //// $res = file_get_contents($urlipstack); //// //// pre($res); //// //// print_r($res["country_code"]); // // // //https://ipstack.com/ // $ip = $_SERVER["REMOTE_ADDR"]; // $access_key = "27f7b2a59c826ba1afe655ac03418dd4"; // // Initialize CURL: // $ch = curl_init('http://api.ipstack.com/'.$ip.'?access_key='.$access_key.''); // curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // // Store the data: // $json = curl_exec($ch); // curl_close($ch); // // Decode JSON response: // $api_result = json_decode($json, true); // // pre($api_result); // // Output the "capital" object inside "location" // echo $api_result['country_code']; // // // // die(); //} //if ($_SERVER['REMOTE_ADDR'] == Templater::getTuinadviesIp()) { // $ip = $_SERVER["REMOTE_ADDR"]; // $ipInfo = grabIpInfo($ip); // $ipJsonInfo = json_decode($ipInfo); // $iplandcode = $ipJsonInfo->alpha2; // echo $iplandcode; // if( ($iplandcode=="NL") OR ($iplandcode=="BE") OR ($iplandcode=="DE") OR ($iplandcode=="FR")){ // $sCountry_code = $iplandcode; // }else{ // // // } //} if (isset($_GET["selectCountry"])) //taalwissel site -> niet redirecten!!!! { //een sessie toevoegen, want dit wil zeggen dat de gebruiker zelf heeft gekozen om naar een bepaalde taal te gaan //in dat geval zal de automatische redirect uiteraard een ander land voorstellen dan wat bezocht wordt //door deze sessie kunnen we de automatische redirect stoppen $_SESSION['userSelectCountry'] = $_GET["selectCountry"]; //verder niks doen... op de pagina zal cookie worden gezet } else { if (!isset($_COOKIE['preferedcountry'])) { //via hierboven Profiel::inloggen misschien ook cookie gezet adhv landid klant indien correct ingevuld $ip = $_SERVER["REMOTE_ADDR"]; if (strlen(trim($ip)) > 0) { // $iplong = ip2long($ip); // //$sth = Database::prepare('SELECT ip_landcode from tube0712_sitebe.ip2loc WHERE ip_ipstart <= :iplong AND ip_ipstop >= :iplong '); // $sth = Database::prepare('SELECT ip_landcode from tube0712_sitebe.ip2loc2 WHERE ip_longstart <= :iplong AND ip_longstop >= :iplong '); // $sth->bindValue("iplong", $iplong, PDO::PARAM_STR); // Database::execute($sth); // $iplandcode = trim(strtoupper($sth->fetchColumn(0))); // if($iplandcode != ''){ // if( ($iplandcode=="NL") OR ($iplandcode=="DE") OR ($iplandcode=="FR")){ // $sCountry_code = $iplandcode; // //mail("[email protected]", "test ip ".$iplandcode." ".$sCountry_code ." ".$ip, $ip.' lancode wel gevonden !!!! '.$_SERVER['HTTP_HOST'].' '.$_SERVER['REQUEST_URI'] . ' - sess.kl.id. '.$_SESSION['klant_land_id']); // }else{ // //mail("[email protected]", "test ip NIET ".$iplandcode, $ip.' - lancode nie gevonden !!!! '.$_SERVER['HTTP_HOST'].' '.$_SERVER['REQUEST_URI'] . ' - sess.kl.id. '.$_SESSION['klant_land_id']); // } // } $sCountry_code = ''; // $curl = curl_init(); // curl_setopt_array($curl, array( // CURLOPT_URL => "https://freegeoip.app/json/".$ip, // CURLOPT_RETURNTRANSFER => true, // CURLOPT_ENCODING => "", // CURLOPT_MAXREDIRS => 10, // CURLOPT_TIMEOUT => 5,//max aantal seconden!! // CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, // CURLOPT_CUSTOMREQUEST => "GET", // CURLOPT_HTTPHEADER => array( // "accept: application/json", // "content-type: application/json" // ), // )); // $response = curl_exec($curl); // $err = curl_error($curl); // curl_close($curl); // // //keer tellen hoeveel per uur -> testing // //Admin::voegErrorLogToe("tellen hoeveel requests per uur", "testing - verwijderen aub!!"); // // if ($err) { // //echo "cURL Error #:" . $err; // //Admin::voegErrorLogToe("ip api error", $err); // //mail("[email protected]", "test ip ERR ".$err, $ip.' - lancode nie gevonden !!!! '.$_SERVER['HTTP_HOST'].' '.$_SERVER['REQUEST_URI'] . ' - sess.kl.id. '.$_SESSION['klant_land_id']); // } else { // $tmp = json_decode($response, true); // $iplandcode = $tmp["country_code"]; // // if( ($iplandcode=="NL") OR ($iplandcode=="BE") OR ($iplandcode=="DE") OR ($iplandcode=="FR")){ // $sCountry_code = $iplandcode; // }else{ // // Admin::voegErrorLogToe("ander ip land", " ipland niet be/nl/de/fr "); // // mail("[email protected]", "test ip NIET ".$iplandcode, $ip.' - lancode nie gevonden !!!! '.$_SERVER['HTTP_HOST'].' '.$_SERVER['REQUEST_URI'] . ' - sess.kl.id. '.$_SESSION['klant_land_id']); // } // } // $ipInfo = grabIpInfo($ip); // $ipJsonInfo = json_decode($ipInfo); // $iplandcode = $ipJsonInfo->alpha2; // $iplandcode1 = $iplandcode; // if (($iplandcode == "NL") or ($iplandcode == "BE") or ($iplandcode == "DE") or ($iplandcode == "FR")) { // $sCountry_code = $iplandcode; // } else { // // Admin::voegErrorLogToe("ander ip land mailing", " ipland niet be/nl/de/fr "); // // mail("[email protected]", "test ip NIET ".$iplandcode, $ip.' - lancode nie gevonden !!!! '.$_SERVER['HTTP_HOST'].' '.$_SERVER['REQUEST_URI'] . ' - sess.kl.id. '.$_SESSION['klant_land_id']); // } //nie gevonden 2de poging // if ($sCountry_code == '') { // $s = file_get_contents('http://ip2c.org/' . $ip);//1;BE;BEL;Belgium // $reply = explode(';', $s); // $iplandcode = $reply[1];//2 letters // if (($iplandcode == "NL") or ($iplandcode == "BE") or ($iplandcode == "DE") or ($iplandcode == "FR")) { // // mail("[email protected]", " 1-".$iplandcode1."-".$iplandcode."-", $ip.' - lancode nie gevonden !!!! '.$_SERVER['HTTP_HOST'].' '.$_SERVER['REQUEST_URI'] . ' - sess.kl.id. '.$_SESSION['klant_land_id']); // $sCountry_code = $iplandcode; // } else { // // mail("[email protected]", " 2--".$iplandcode."-", $ip.' - lancode nie gevonden !!!! '.$_SERVER['HTTP_HOST'].' '.$_SERVER['REQUEST_URI'] . ' - sess.kl.id. '.$_SESSION['klant_land_id']); // } // } //$sCountry_code = $results["country_code"];// BE / FR / DE / empty if ($sCountry_code == "BE") $nTmpPreferedCountryID = 1; //belgie elseif ($sCountry_code == "FR") $nTmpPreferedCountryID = 5; //frankrijk elseif ($sCountry_code == "DE") $nTmpPreferedCountryID = 3; //duitsland elseif ($sCountry_code == "NL") $nTmpPreferedCountryID = 2; //nederland // if ($_SERVER['REMOTE_ADDR'] == Templater::getTuinadviesIp()) { // // $afzenderNaam = my_mb_ucfirst(Templater::getWebshopNaam()); // $afzenderEmail = '[email protected]'; // $onderwerp = 'stest index !!!'; // $mailbody = '
'; // $mailbody .= " nTmpPreferedCountryID :".$nTmpPreferedCountryID. " host:".$_SERVER['HTTP_HOST']." uri:".$_SERVER['REQUEST_URI']."klantid:".$_SESSION['klant_land_id']; // $ontvangerEmail = '[email protected]'; // $ontvangerNaam = 'ilse'; // $bijlage = ''; // Mail::sendMail($afzenderNaam, $afzenderEmail, $onderwerp, $mailbody, $ontvangerEmail, $ontvangerNaam, $bijlage); // } //enkel mogelijks wisselen tss franstalig (belgie en frans) -> assortiment is anders //MATELMA //no cookie - site:frankrijk - ip:belgie - profiel!=france -> wallonie if (preg_match("/matelma\.com\/fr-fr/", $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']) && ($nTmpPreferedCountryID == 1) && ($_SESSION['klant_land_id'] != 5)) { //redirect header("Location: https://" . str_replace('/fr-fr', '/be-fr', $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'])); exit(); //no cookie - site:wallonie - ip:france - profiel!=belgie -> france } elseif (preg_match("/matelma\.com\/be-fr/", $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']) && ($nTmpPreferedCountryID == 5) && ($_SESSION['klant_land_id'] != 1)) { //redirect header("Location: https://" . str_replace('/be-fr', '/fr-fr', $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'])); exit(); //no cookie - site:matelma(home) - ip:france - profiel!=belgie -> france } elseif (preg_match("/matelma\.com/", $_SERVER['HTTP_HOST']) && ($_SERVER['REQUEST_URI'] == '/') && ($nTmpPreferedCountryID == 5) && ($_SESSION['klant_land_id'] != 1)) { //https://www.matelma.com //redirect header("Location: https://www.matelma.com/fr-fr"); exit(); //no cookie - site:matelma(home) - ip:belgie - profiel!=frankrijk -> wallonie } elseif (preg_match("/matelma\.com/", $_SERVER['HTTP_HOST']) && ($_SERVER['REQUEST_URI'] == '/') && ($nTmpPreferedCountryID == 1) && ($_SESSION['klant_land_id'] != 5)) { //https://www.matelma.com //redirect header("Location: https://www.matelma.com/be-fr"); exit(); }/*elseif(preg_match("/matelma\.fr\/",$_SERVER['HTTP_HOST']) ){//https://www.matelma.com pree($_SERVER['REQUEST_URI']); die(); //redirect // header("Location: https://www.matelma.com/be-fr"); // exit(); }*//*elseif(preg_match("/matelma\.fr\/",$_SERVER['HTTP_HOST']) && ($_SERVER['REQUEST_URI'] == '/') && ($nTmpPreferedCountryID==1) && ($_SESSION['klant_land_id']!=5)){//https://www.matelma.com //redirect header("Location: https://www.matelma.com/be-fr"); exit(); }*/ //TUINADVIES.BE //no cookie - site:TA.be - ip:nederland - profiel!=belgie -> nederland elseif (preg_match("/tuinadvies\.be/", $_SERVER['HTTP_HOST']) && ($nTmpPreferedCountryID == 2) && ($_SESSION['klant_land_id'] != 1)) { // if ($_SERVER['REMOTE_ADDR'] == Templater::getTuinadviesIp()) { // // $afzenderNaam = my_mb_ucfirst(Templater::getWebshopNaam()); // $afzenderEmail = '[email protected]'; // $onderwerp = 'stest index !!!'; // $mailbody = '
'; // $mailbody .= " 111 Location: https://".str_replace('/tuinadvies.be/', '/tuinadvies.nl/', $_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']); // $ontvangerEmail = '[email protected]'; // $ontvangerNaam = 'ilse'; // $bijlage = ''; // Mail::sendMail($afzenderNaam, $afzenderEmail, $onderwerp, $mailbody, $ontvangerEmail, $ontvangerNaam, $bijlage); // } //redirect header("Location: https://" . str_replace('tuinadvies.be/', 'tuinadvies.nl/', $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'])); exit(); } //no cookie - site:TA.nl - ip:belgie - profiel!=nederland -> TA.be elseif (preg_match("/tuinadvies\.nl/", $_SERVER['HTTP_HOST']) && ($nTmpPreferedCountryID == 1) && ($_SESSION['klant_land_id'] != 2)) { // if ($_SERVER['REMOTE_ADDR'] == Templater::getTuinadviesIp()) { // // $afzenderNaam = my_mb_ucfirst(Templater::getWebshopNaam()); // $afzenderEmail = '[email protected]'; // $onderwerp = 'stest index !!!'; // $mailbody = '
'; // $mailbody .= " 222 Location: https://".str_replace('/tuinadvies.nl/', '/tuinadvies.be/', $_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']); // $ontvangerEmail = '[email protected]'; // $ontvangerNaam = 'ilse'; // $bijlage = ''; // Mail::sendMail($afzenderNaam, $afzenderEmail, $onderwerp, $mailbody, $ontvangerEmail, $ontvangerNaam, $bijlage); // } //redirect header("Location: https://" . str_replace('tuinadvies.nl/', 'tuinadvies.be/', $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'])); exit(); } } } elseif (isset($_COOKIE['preferedcountry']) && ($_COOKIE['preferedcountry'] == 1)) { // cookie:belgie // cookie:belgie - site:france -> wallonie if (preg_match("/matelma\.com\/fr-fr/", $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'])) { header("Location: https://" . str_replace('/fr-fr', '/be-fr', $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'])); exit(); } // cookie:belgie - site:nederland -> belgie if (preg_match("/tuinadvies\.nl/", $_SERVER['HTTP_HOST'])) { header("Location: https://" . str_replace('www.tuinadvies.nl', 'www.tuinadvies.be', $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'])); exit(); } //cookie:belgie site:matelma.com -> be-fr //new if (preg_match("/matelma\.com/", $_SERVER['HTTP_HOST']) && ($_SERVER['REQUEST_URI'] == '/')) { header("Location: https://www.matelma.com/be-fr"); exit(); } } elseif (isset($_COOKIE['preferedcountry']) && ($_COOKIE['preferedcountry'] == 5)) { // cookie:france // cookie:france - site:wallonie -> france if (preg_match("/matelma\.com\/be-fr/", $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'])) { header("Location: https://" . str_replace('/be-fr', '/fr-fr', $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'])); exit(); } //cookie:france site:matelma.com -> be-fr //new if (preg_match("/matelma\.com/", $_SERVER['HTTP_HOST']) && ($_SERVER['REQUEST_URI'] == '/')) { header("Location: https://www.matelma.com/fr-fr"); exit(); } } elseif (isset($_COOKIE['preferedcountry']) && ($_COOKIE['preferedcountry'] == 2)) { // cookie:nederland // cookie:nederland - site:belgie -> nederland if (preg_match("/tuinadvies\.be/", $_SERVER['HTTP_HOST'])) { header("Location: https://" . str_replace('www.tuinadvies.be', 'www.tuinadvies.nl', $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'])); exit(); } //cookie:nederland site:matelma.com -> be-fr?? //new if (preg_match("/matelma\.com/", $_SERVER['HTTP_HOST']) && ($_SERVER['REQUEST_URI'] == '/')) { header("Location: https://www.matelma.com/be-fr"); exit(); } } elseif (isset($_COOKIE['preferedcountry']) && ($_COOKIE['preferedcountry'] == 3)) { // cookie:duitsland //cookie:nederland site:matelma.com -> be-fr?? //new if (preg_match("/matelma\.com/", $_SERVER['HTTP_HOST']) && ($_SERVER['REQUEST_URI'] == '/')) { header("Location: https://www.matelma.com/de-de"); exit(); } } elseif (isset($_COOKIE['preferedcountry']) && ($_COOKIE['preferedcountry'] == 4)) { // cookie:luxemburg //cookie:luxemburg site:matelma.com -> be-fr?? //new if (preg_match("/matelma\.com/", $_SERVER['HTTP_HOST']) && ($_SERVER['REQUEST_URI'] == '/')) { header("Location: https://www.matelma.com/de-de"); exit(); } } } // AANPASSEN VAN EEN REACTIE (KAN OVERAL) if ($_POST['actie'] == 'pasReactieAan' && Profiel::isIngelogd() && $_POST['reactieId'] > 0 && !empty($_POST['reactieVeld']) && !empty($_POST['reactieSoort'])) { Profiel::pasReactieAan($_POST['reactieId'], $_POST['reactieVeld'], $_POST['reactieSoort']); } Profiel::log(); Controller::route(); if ((Templater::getIdPageContent() != 'tuinwinkel_winkelwagen') && (Templater::getIdPageContent() != 'tuinwinkel_product') && (Templater::getIdPageContent() != 'tuinadvies_encyclopedie')) { //niet op detail product $_SESSION['last_overview_page'] = ($_SERVER['REDIRECT_HTTPS'] == 'on' ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; //terug naar overzicht } if ((Templater::getIdPageContent() != 'tuinadvies_zoeken') && (Templater::getIdPageContent() != 'tuinadvies_homepage')) $_SESSION['last_selected_zone'] = Controller::getZone(); $uri_path = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH); $uri_segments = explode('/', $uri_path); $sTmpLang = 'nl-BE'; if (Taal::getTaal() == 1) { if ($_SERVER['HTTP_HOST'] == "tuinadvies.docker" || $_SERVER['HTTP_HOST'] == "tuinadvies.be") { $sTmpLang = 'nl-BE'; } elseif ($_SERVER['HTTP_HOST'] == "tuinadvies.nl") { $sTmpLang = 'nl-NL'; } } elseif (Taal::getTaal() == 3) { $sTmpLang = 'fr-BE'; if ($uri_segments[1] == "be-fr") { $sTmpLang = 'fr-BE'; } elseif ($uri_segments[1] == "fr-fr") { $sTmpLang = 'fr-FR'; } } elseif (Taal::getTaal() == 4) { $sTmpLang = 'de-DE'; } if (Templater::getIdPageContent() == 'tuinadvies_homepage') $bHomepage = true; else $bHomepage = false; if (Templater::getIdPageContent() == 'tuinadvies_zoeken') $bSearchPage = true; else $bSearchPage = false; //NOINDEX, NOFOLLOW if ( // matelma zoeken terug indexeren! // ((Templater::getIdPageContent() == 'tuinadvies_zoeken') && (Taal::getTaal() == 4)) ////MATELMA ZOEKEN -> niet in google !!!!! // or (Templater::getIdPageContent() == "profiel_profiel") //mijn tuin -> niet in google!!! or (Templater::getIdPageContent() == "profiel_beoordeling") //beoordelingen or (Templater::getIdPageContent() == "admin_admin") //admin_admin or (Templater::getIdPageContent() == "tuinwinkel_mijnbestellingen") // or (Templater::getIdPageContent() == "tuinadvies_zoeken") or // (Templater::getIdPageContent() == "tuinadvies_encyclopedie2") // or stristr($_SERVER['SERVER_NAME'], 'avisjardin.com') //to test or // stristr($_SERVER['SERVER_NAME'], 'matelma.com')//to test // or stristr($_SERVER['SERVER_NAME'], 'matelma.nl') //to test or stristr($_SERVER['SERVER_NAME'], 'matelma.fr') //to test or stristr($_SERVER['SERVER_NAME'], 'matelma.be') //to test ) { $noindexnofollow = ""; } //canonical instellen if ( (Templater::getIdPageContent() == "tuinadvies_encyclopedie2") ) { Templater::setCanonicalUrl(Url::getTuinadviesEncyclopedie()); } $manifest = Container::getManifest(); // automatisch klanten inloggen? // Controleer of de URL een 32-delige hashstring bevat if (preg_match('/\/([a-f0-9]{32})\b/i', $_SERVER['REQUEST_URI'], $matches)) { // Extract de hashstring $hash = $matches[1]; // Gebruik de hashstring om het profiel op te halen en automatisch in te loggen $profielVanHash = Profiel::getProfielByHashAutoLogin($hash); // Controleer of het profiel bestaat en de gebruiker kan worden ingelogd if (!empty($profielVanHash['profiel_email'])) { // Inloggen met behulp van profiel_email en profiel_wachtwoord Profiel::inloggen($profielVanHash['profiel_email'], $profielVanHash['profiel_wachtwoord']); //automatisch terugkeren naar huidige pagina: $newURL = preg_replace('/\/[a-f0-9]{32}\b/i', '', $_SERVER['REQUEST_URI']); if ($newURL !== $_SERVER['REQUEST_URI']) { // Stuur de gebruiker door naar de bijgewerkte URL zonder de hash //print("fwd naar $newURL
"); setcookie("preferedcountry", Taal::getLandId(), time() + 31556926, '/'); header("HTTP/1.1 301 Moved Permanently"); header("Location: " . $newURL); //print(""); exit(); } } } ?> '; ?> '; } else if ($taal == 3) { echo ''; } else if ($taal == 4) { echo ''; } // // ?> <?php echo strip_tags(Templater::getTitleTag()); ?> '; if (!empty($aHrefLangURLs['NL-NL'])) echo ''; if (!empty($aHrefLangURLs['NL-BE'])) echo ''; if (!empty($aHrefLangURLs['DE'])) echo ''; if (!empty($aHrefLangURLs['FR-FR'])) echo ''; if (!empty($aHrefLangURLs['FR-BE'])) echo ''; if (!empty($aHrefLangURLs['FR']) && $aHrefLangURLs['FR'] !== $aHrefLangURLs['FR-FR']) echo ''; $canonicalUrl = Templater::getCanonicalUrl(); if (!empty($canonicalUrl)) { echo ''; } if (Templater::getNewFile()) { echo ""; echo ""; echo ""; echo ""; echo ""; } else { echo ""; echo ""; echo ""; echo ""; echo ""; } echo ""; ?> '; } elseif (Templater::getIdPageContent() === 'tuinwinkel_categorie') { echo ''; } else { //tuinadvies_artikel echo ''; } if (Taal::getLandTaalId() > 2) //pinterest echo ''; //www.matelma.com elseif (Taal::getLandTaalId() < 3) //pinterest echo ''; elseif ((Taal::getLandTaalId() == 4) or (Taal::getLandTaalId() == 7)) //pinterest echo ''; elseif (Taal::getLandTaalId() == 3) //pinterest echo ''; //WEBWINKELKEUR $nIDWebwinkelkeur_NL = 4792; $nIDWebwinkelkeur_BE = 4817; if (((Taal::getLandId() == 1) or (Taal::getLandId() == 2)) && ((Controller::getZone() == "homepage") or (Controller::getZone() == "tuinwinkel"))) { // _webwinkelkeur_tooltip true / false // _webwinkelkeur_sidebar // _webwinkelkeur_sidebar_position left / right // _webwinkelkeur_sidebar_pixels_from_top // _webwinkelkeur_mobile top / bottom / off echo ' '; } ?> '; ?> " /> " /> '; ?> "> "> window.dataLayer = window.dataLayer || []; function gtag() { dataLayer.push(arguments); } gtag(\"consent\", \"default\", { ad_storage: \"denied\", analytics_storage: \"denied\", functionality_storage: \"denied\", personalization_storage: \"denied\", security_storage: \"granted\", wait_for_update: 500, }); gtag(\"set\", \"ads_data_redaction\", true); gtag(\"set\", \"url_passthrough\", true); "); ?> var _etmc = []; _etmc.push(["setOrgId", "510006164"]); ' . $salesforcemail . ' _etmc.push(["trackPageView"]); '; ?> "belgie.png", 2 => "nederland.png", 3 => "duitsland.jpg", 5 => "frankrijk.png"); // $aIconCountry[Taal::getLandId()] if (Taal::getTaal() > 1) //if( (Taal::getTaal()>1))// $sSiteTitle = 'Matelma'; else $sSiteTitle = 'Tuinadvies'; $aImgRubriekenProducten = array( //producten 'acties' => 'actief/solden.png', 'new' => 'actief/new.png', 737 => 'actief/zomer.png', //zomer 927 => 'actief/vaderdag.png', //vaderdag 889 => 'actief/vaderdag.png', //moederdag -> gebruikt zelfde icoon als vaderdag 928 => 'actief/waterplezier.png', 932 => 'actief/kerstcadeau.png', 937 => 'actief/plant-in-spotlight.png', 912 => 'actief/lentetips.png', //moederdag -> gebruikt zelfde icoon als vaderdag 685 => 'zaden.png', //zaaien //'actief/zaaien.png', 644 => 'actief/icons_28-kerst.png', //tips vr kerst 647 => 'actief/blad.png', //wintertips of herfsttips 'actief/winter.png' 800 => 'actief/icons_800.png', //icoon van wintertips 277 => 'tang.png', //planten opkweken 241 => 'icons_15.png', //praktisch tuinieren 303 => 'hek.png', //aanlag en inrichting 240 => 'insecten.png', //bestrijdingsmiddelen 242 => 'mand.png', //in en om het huis 302 => 'vuur.png', //deco en sfeer 243 => 'konijn.png', //huis- en tuindieren 301 => 'serres.png', //serres en tuinhuizen 304 => 'zaden.png', //zaden en bloembollen 606 => 'actief/blad.png', //planten kopen 305 => 'actief/solden.png', //tips en nieuw 694 => 'solden.png', //in de kijker 942 => 'bloemen_buiten.png' //zet de bloemetjes buiten ); $aImgRubriekenTuininfo = array( //artikelen 'encyclopedie' => 'actief/icons_31.png', 'laatste_artikelen' => 'landschap.png', //tuinkalender 505 => 'boer.png', //tuinieren 3 => 'bloem.png', //planten 2 => 'konijn.png', //dieren 75 => 'eend.png', //vijver en zwembad 548 => 'tomaat.png', //eettuin 6 => 'icons_19.png', //recepten 13 => 'bloemen.png', //bloemschikken 5 => 'landschap.png', //tuinkalender 931 => 'klimaatopwarming.png', //klimaatopwarming 938 => 'tuinkas.png', //de tuinkas 'tuinproblemen' => 'actief/vraagteken.png' ); $aImgRubriekenForum = array( //forum 'tuinbabbel' => 'babbel.png', 'forum' => 'forum.png', 'tuinfoto' => 'landschap.png', 'plantenherkenner' => 'bloem.png', 'quiz' => 'vraagteken.png', 'klussenkalender' => 'man.png', //ingelogd 'bloeikalender' => 'bloemen.png', //ingelogd 'plantenTuinvrienden' => 'icons_29.png', //ingelogd 'mijntuin' => 'landschap.png', ); $aImgBackgroundsForum = array( //artikelen 'tuinbabbel' => 'tuinbabbel.png', 'forum' => 'forum.png', 'tuinfoto' => 'tuinfotos.png', 'plantenherkenner' => 'encyclopedie.png', 'quiz' => 'quiz.png', 'klussenkalender' => 'zaaien.jpg', //ingelogd 'bloeikalender' => 'bloeikalender.png', //ingelogd 'plantenTuinvrienden' => '', //ingelogd 'mijntuin' => 'mijn_tuin.png', ); $site_menu_producten = Templater::getMenuProducten($bBackgroundImages = true); //new $site_menu_tuininfo = Templater::getMenuTuininfo($bBackgroundImages = true); //new $site_menu_forum = Templater::getMenuForum(); //new $site_menu_forum_ingelogd = Templater::getMenuForumIngelogd(); //new //} //$site_menu_user = Templater::getMenuUser();//new $site_menu_user = Templater::getMenuUser(); //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ?> // // // /////////////// google tagmanager ilse 12/18 // if(Taal::getLandTaalId()==3){ // de // echo ' // // '; // }elseif(Taal::getLandTaalId()==2){ // holland // echo ' // // '; // }elseif(Taal::getLandTaalId()==4){ // frankrijk // echo ' // // '; // }elseif(Taal::getLandTaalId()==7){ // be-fr // echo ' // // '; // }else{//belgie // echo ' // // '; // } // //noibu bug tracking code // print(""); //ilse 01/2017 -> scriptfouten voor de nederlandse site -> voorlopig in commententaar plaatsen//tuindvies_bg1.jpg // $tagmanagerCode = Templater::getTagManagerCode(); // // if(! empty($tagmanagerCode)){ // echo " // "; // } echo '
'; // BERICHTEN if (Profiel::isIngelogd()) { $aantalNotificaties = Profiel::getAantalNotificaties(); $aantalBerichten = Profiel::getAantalNieuweBerichten(); $nBerichten = $aantalNotificaties; $nBerichten += $aantalBerichten; if ($nBerichten > 0) { //label label-pill notification label-danger $notificatieString = "" . ($nBerichten > 99 ? "99+" : $nBerichten) . ""; } } $isKamerplantOnline = false; $isBoekettenOnline = false; $isZadenOnline = false; foreach ($site_menu_producten['items'] as $item) { if ($item['label'] == "MENU_PLANTEN_IN_HUIS") { $isKamerplantOnline = true; } if ($item['label'] == "MENU_BOEKETTEN") { $isBoekettenOnline = true; } if ($item['label'] == "ZADEN") { $isZadenOnline = true; } foreach ($item['submenu'] as $subitem) { if ($subitem['label'] == "MENU_PLANTEN_IN_HUIS") { $isKamerplantOnline = true; } if ($subitem['label'] == "MENU_BOEKETTEN") { $isBoekettenOnline = true; } if ($subitem['label'] == "ZADEN") { $isZadenOnline = true; } foreach ($subitem['submenu'] as $subsubitem) { if ($subsubitem['label'] == "MENU_PLANTEN_IN_HUIS") { $isKamerplantOnline = true; } if ($subsubitem['label'] == "MENU_BOEKETTEN") { $isBoekettenOnline = true; } if ($subsubitem['label'] == "ZADEN") { $isZadenOnline = true; } } } } /////////////////////////////////////// ///////// MOBILE /////////////////////////////////////// //sidebar op mobiel //mobiel menu echo ""; //sticky header voor black friday if ($_SESSION['toonKortingscodePopup']) { //data ophalen en in array steken om popup vorm te geven: $extraPopupData['popupBackgroundUrl'] = $shopInstellingen['popupBackgroundUrl']; $extraPopupData['popupDelayTijd'] = $shopInstellingen['popupDelayTijd']; $extraPopupData['popupBackgroundColor'] = $shopInstellingen['popupBackgroundColor']; $extraPopupData['popupTextBackgroundColor'] = $shopInstellingen['popupTextBackgroundColor']; $extraPopupData['popupDelayFirstClose'] = $shopInstellingen['popupDelayFirstClose']; $extraPopupData['popupDelaySecondClose'] = $shopInstellingen['popupDelaySecondClose']; $extraPopupData['popupFinalNextShow'] = $shopInstellingen['popupFinalNextShow']; $extraPopupData['stickyBannerBackgroundColor'] = $shopInstellingen['stickyBannerBackgroundColor']; print("
" . Templater::vertaal("KORTINGSCODEPOPUP_STCKYHEADER") . "
"); } echo ''; ?>
"; echo "
"; echo "
"; echo "menu"; echo "
"; echo "
"; //MENU if ((Taal::getTaal() == 4) or (Taal::getTaal() == 3)) $sLogoMobile = '/img/header_new/Tuinadvies-logo-mobile-COM.png'; elseif (Taal::getLandId() == 2) //nl $sLogoMobile = '/img/header_new/Tuinadvies-logo-mobile-NL.png'; elseif (Taal::getLandId() == 1) //be- $sLogoMobile = '/img/header_new/Tuinadvies-logo-mobile-BE.png'; echo "" . $sSiteTitle . ""; echo "
"; echo ""; echo "
"; echo "
"; //zoeken echo "
"; echo "
"; echo "
"; //ZOEKEN MOBILE echo "
"; echo "
"; echo ""; echo "
"; echo "
"; echo "
"; echo "
"; echo "
"; echo "
"; echo ''; echo "
"; echo '
'; echo '
'; $aFullScreenPages = array(); $aFullScreenPages[] = 'tuinadvies_encyclopedie2'; $aFullScreenPages[] = 'tuinwinkel_categorie-planten'; $aFullScreenPages[] = 'tuinwinkel_home'; $aFullScreenPages[] = 'tuinwinkel_tags'; $aFullScreenPages[] = 'tuinwinkel_actieproducten'; $aFullScreenPages[] = 'tuinwinkel_in-de-kijker'; $aFullScreenPages[] = 'tuinwinkel_info'; $aFullScreenPages[] = 'tuinwinkel_wie-zijn-we'; $aFullScreenPages[] = 'tuinwinkel_verlanglijst'; $aFullScreenPages[] = 'tuinwinkel_product-new'; $aFullScreenPages[] = 'tuinwinkel_product'; $aFullScreenPages[] = 'tuinwinkel_merken'; $aFullScreenPages[] = 'tuinwinkel_winkelwagen'; $aFullScreenPages[] = 'tuinwinkel_bestellen'; $aFullScreenPages[] = 'plantenbeheer_overzicht'; $aFullScreenPages[] = 'plantenbeheer_willaert'; $aFullScreenPages[] = 'plantenbeheer_codes'; $aFullScreenPages[] = 'plantenbeheer_statistieken'; $aFullScreenPages[] = 'plantenbeheer_opvolging'; $aFullScreenPages[] = 'plantenbeheer_historie'; $aFullScreenPages[] = 'plantenbeheer_labels'; $aFullScreenPages[] = 'plantenbeheer_bestellijst'; $aFullScreenPages[] = 'plantenbeheer_bestellijst_externe_leverancier'; $aFullScreenPages[] = 'plantenbeheer_planten_overzicht'; $aFullScreenPages[] = 'plantenbeheer_orders_flx'; $aFullScreenPages[] = 'floralux_flyer'; $aFullScreenPages[] = 'admin_moderator_plant'; $aFullScreenPages[] = 'admin_admin'; $aFullScreenPages[] = 'profiel_registreer'; $style_extra = ''; if (($bHomepage) or (in_array(Templater::getIdPageContent(), $aFullScreenPages)) or ($bSearchPage)) { $style_extra = 'width:100% !important;'; } echo '
'; echo '
'; echo '
'; echo '
' . implode("", Templater::getMeldingen()) . '
'; if (Controller::getZone() == 'tuinwinkel') { if ((trim(Templater::vertaal("WEBSHOP_OFFLINE")) != "WEBSHOP_OFFLINE") && (trim(Templater::vertaal("WEBSHOP_OFFLINE")) != "")) echo '
' . Templater::vertaal("WEBSHOP_OFFLINE") . '
'; } echo Templater::getContent(); echo '
'; echo '
'; echo '
'; if ((!$bHomepage) && (!in_array(Templater::getIdPageContent(), $aFullScreenPages)) && (!$bSearchPage)) { // @todo: here is the product sidebar generated ?>
'; //new echo ''; echo ''; ?>
" alt="">
' /> getVersionedPath('/scripts/jquery-ui-1.12.1/jquery-ui.min.js') . "'>"; echo ""; echo ""; echo ""; echo ""; } else { echo ""; echo ""; echo ""; echo ""; } if (Profiel::isWebmaster()) //if($_SERVER['REMOTE_ADDR'] == Templater::getTuinadviesIp()) echo "

" . Database::getDebug() . "

"; if ($_SESSION["lazyload"]) { //http://jquery.eisbehr.de/lazy/ echo ""; echo ' '; } echo ""; if (count(Templater::getScriptFiles()) > 0) { foreach (Templater::getScriptFiles() as $item) { if (strpos($item, '/scripts/admin/plantenbeheer/') === 0) { //niets wijzigen, scripts uit oude plantenbeheer zijn niet gemnified en daardoor zou het path hieronder foutief worden } else { $item = str_replace(['/scripts/', '/styles/lightbox/'], ['styles/build/js/', 'styles/build/js/lightbox/'], $item); } echo "\n\n"; } } echo ""; ?> getVersionedPath('/scripts/serviceworker.min.js') . "'>"; // } echo ""; // echo ""; // echo ""; // echo ""; ?> '; // echo '
'; // echo '
'; // echo 'Cookie // '.str_replace('#LINK_END#', '', str_replace('#LINK_BEGIN#', '', Templater::vertaal("COOKIES_INTRO"))).''; // echo '
'; // echo '
'; // $baseUrlHttps = Templater::getBaseUrlHttps(); // $baseUrlHttps = str_replace(['/de-de', '/fr-fr', '/be-fr'], ['', '', ''], $baseUrlHttps); // echo ""; // echo ''; // echo '
'; // echo '
'; // echo ''; // } ?> '; } if ($_SESSION['artikelCadeaubonCodeIsJuistToegevoegd'] == 1) { echo ' '; unset($_SESSION['artikelCadeaubonCodeIsJuistToegevoegd']); // anders blijft deze popup veschijnen } //op bepaalde onderdelen van de site mag een popup getoond woren //afhankelijk van de status van de bezoeker (niet ingelogd of wel ingelogd (en bijhorende status)) wordt een poup getoond: //testsessie maken om de bday te testen if ($_GET['bdaytest'] != '') { $_SESSION['bdaytest'] = $_GET['bdaytest']; } $mktPopup = Marketing::getMarketing_popup(); echo ($mktPopup); $extraPopup = Marketing::getExtraPopup($extraPopupData); echo ($extraPopup); ?> '; echo '{'; echo '"@context": "https://schema.org/",'; echo '"@type": "Organization",'; echo '"name": "' . Templater::getMetaSiteName() . '",'; echo '"description": "De grootste online tuinsite van België en Nederland. Alles voor uw tuin. Ruim assortiment aan de beste prijs.",'; echo '"image": "https://www.tuinadvies.be/img/header_new/Tuinadvies-logo-BE.png",'; echo '"url": "https://www.tuinadvies.be",'; echo '"email": "[email protected]",'; echo '"telephone": "+32 9 330 95 88 ",'; echo '"sameAs": [ "https://www.facebook.com/tuinadvies/", "https://twitter.com/tuinadviesbe", "https://be.linkedin.com/company/tuinadvies", "https://www.instagram.com/tuinadvies/", "https://www.pinterest.com/tuinadvies/" ],'; echo '"address": {'; echo '"@type": "PostalAddress",'; echo '"addressLocality": "Evergem",'; echo '"addressCountry": "BE",'; echo '"postalCode": "9940",'; echo '"streetAddress": "Jacques Paryslaan 4c"'; echo '},'; echo '"potentialAction": {'; echo '"@type": "SearchAction",'; echo '"target": "https://www.tuinadvies.be/zoek/{zoekveld}",'; echo '"query-input": "name=zoekveld"'; echo '}'; echo '}'; echo ''; } elseif (Taal::getLandId() == 2) //NL { echo ''; } elseif (Taal::getLandId() == 3) //DE { echo ''; } elseif (Taal::getLandId() == 5) //FR { echo ''; } elseif (Taal::getLandTaalId() == 7) //BE-FR { echo ''; } // $code = Templater::getGoogleAnalyticsCode(); // $codeAdwords = Templater::getGoogleAdwordsCode(); // if (!empty($code)) { // $codeAdwordsComment = str_replace("AW-", "", $codeAdwords); // print(" // // // // // "); // } // if (preg_match("/" . Templater::genereerKorteTitelMetCijfers(Templater::vertaal("TUINWINKEL")) . "/", $_SERVER['REQUEST_URI'])) { // echo Templater::getGoogleAnalyticsTuinwinkelCode(); // } echo Marketing::getEnhancedEcommerceTag(); echo Marketing::getAnalyticsUserIdTag(); echo Marketing::getMSClarifyTag(); ?> 0) && (in_array(Templater::getIdPageContent(), $aPagesProductorder))) //nieuwe volgorde + niet op productpagina { $_SESSION['product_order'] = $_SESSION['new_product_order']; $_SESSION['product_order2'] = $_SESSION['new_product_order']; } elseif (in_array(Templater::getIdPageContent(), $aPagesProductorder)) //niet detailpagina { $_SESSION['product_order'] = array(); $_SESSION['product_order2'] = array(); } $aPagesPlantorder = array('tuinadvies_encyclopedie2'); //overzichtspagina if ((sizeof($_SESSION["new_plant_order"]) > 0) && (in_array(Templater::getIdPageContent(), $aPagesPlantorder))) //nieuwe volgorde + niet op productpagina { $_SESSION['plant_order'] = $_SESSION['new_plant_order']; $_SESSION['plant_order2'] = $_SESSION['new_plant_order']; } elseif (in_array(Templater::getIdPageContent(), $aPagesPlantorder)) //niet detailpagina { $_SESSION['plant_order'] = array(); $_SESSION['plant_order2'] = array(); } if (Profiel::isTestPerson()) { $sTmpContent = ''; if ((!$bHomepage) && (!in_array(Templater::getIdPageContent(), $aFullScreenPages)) && (!$bSearchPage)) { $sTmpContent .= '
' . Templater::getSideBar() . '
'; } $sTmpContent .= '
'; $sTmpContent .= '
'; } $sTmpContent .= Templater::getContent(); $sTmpContent .= '
'; $sTmpContent .= '
'; $sTmpContent .= '
'; $sTmpContent .= '
'; shuffle($_SESSION["save_labels_trans"]); if (Profiel::isWebmaster()) { $aToSave = array_slice($_SESSION["save_labels_trans"], 0, 400); } else $aToSave = array_slice($_SESSION["save_labels_trans"], 0, 20); //random 1 per pageload.... 3 elements foreach ($aToSave as $item) { if (($item != '') && ($item == strtoupper($item))) //enkel upper { $sth = Database::prepare('INSERT INTO csv_pages SET page = :page, label = :label, host = :host, uri = :uri, content = :content, datum = :datum ON DUPLICATE KEY UPDATE uri = :uri, content = :content, datum = :datum '); $sth->bindValue("page", Templater::getIdPageContent(), PDO::PARAM_STR); $sth->bindValue("label", trim($item), PDO::PARAM_STR); $sth->bindValue("host", $_SERVER['HTTP_HOST'], PDO::PARAM_STR); $sth->bindValue("uri", $_SERVER['REQUEST_URI'], PDO::PARAM_STR); $sth->bindValue("content", $sTmpContent, PDO::PARAM_STR); $sth->bindValue("datum", date('Y-m-d H:i:s', time()), PDO::PARAM_STR); Database::execute($sth); } } } if (!Templater::getNewFile()) { $afzenderNaam = my_mb_ucfirst(Templater::getWebshopNaam()); $afzenderEmail = '[email protected]'; $onderwerp = 'old design!!!'; $mailbody = '
'; $mailbody .= " page:" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; $ontvangerEmail = '[email protected]'; $ontvangerNaam = 'ilse'; $bijlage = ''; //Mail::sendMail($afzenderNaam, $afzenderEmail, $onderwerp, $mailbody, $ontvangerEmail, $ontvangerNaam, $bijlage); } //controleren als de URL een bepaalde parameter bevat, want dit gaat over een actie van flyertjes in floraluxwinkels. if ((preg_match('/s-fr-flx/', $_SERVER['REQUEST_URI'])) or (preg_match('/s-nl-flx/', $_SERVER['REQUEST_URI']))) { $return = Winkelwagen::cadeaubonCodeToevoegenAanWinkelwagen("FLORALUX", 1); } //elke pageview wordt geteld als een tellerke $_SESSION['aantalPageViews']++; //als de logging aan staat, dan voor elke pageview bepaalde waarden bijhouden if ($shopInstellingen['querylogging'] == 1) { $peakUsage = sprintf("%01.2f", (memory_get_peak_usage() - $headMemory) / 1024 / 1024); $actualLink = "https://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; $x = explode(" ", microtime()); $pageLoad = ($x[0] + $x[1]) - $beginPageLoad; $sth = Database::prepare('INSERT INTO tube0712_log.frontendquerylog SET url = :url, ip = :ip, datum = :datum, querytime = :querytime, loadtime = :loadtime, peakusage = :peakusage, querycount = :querycount, querries = :querries '); $sth->bindValue("url", $actualLink, PDO::PARAM_STR); $sth->bindValue("ip", $_SERVER['REMOTE_ADDR'], PDO::PARAM_STR); $sth->bindValue("datum", time(), PDO::PARAM_STR); $sth->bindValue("querytime", Database::getTotalQueryTime(), PDO::PARAM_STR); $sth->bindValue("loadtime", $pageLoad, PDO::PARAM_STR); $sth->bindValue("peakusage", $peakUsage, PDO::PARAM_STR); $sth->bindValue("querycount", Database::getQueryCount(), PDO::PARAM_STR); $sth->bindValue("querries", Database::getQueryList(), PDO::PARAM_STR); Database::execute($sth); } ?>