} else { $sitep = $_POST["site"]; } //get site $site = $blSite->getSiteByName($sitep); //Check if site is child site if ($site->getParentSiteId() != null) { $parentsite = $blSite->getSite($site->getParentSiteId()); $site->setDefaultCarId($parentsite->getDefaultCarId()); //Overwrite Id => Make sure correct pictures are used $site->setId($parentsite->getId()); } //get car $car = $blCar->getCar($_POST["carid"]); //picture $picture = $blCarPicture->getCarPicture($_POST["carpictureid"]); $picturefolder = getcwd() . '/html/' . $site->getName() . '/' . $car->getFolderName() . '/pictures'; if (!is_dir($picturefolder)) { mkdir($picturefolder, 0777, true); chmod($picturefolder, 0777); } //check if file exists if (!file_exists(getcwd() . "/pictures/" . $picture->getName() . "." . $picture->getType())) { error_log(date("F j, Y, g:i a") . "-File not found: /pictures/" . $picture->getName() . "." . $picture->getType() . "\n", 3, getcwd() . "/log/logfile.log"); } //normal if (!file_exists($picturefolder . "/" . $picture->getName() . "." . $picture->getType())) { copy(getcwd() . "/pictures/" . $picture->getName() . "." . $picture->getType(), $picturefolder . "/" . $picture->getName() . "." . $picture->getType()); chmod($picturefolder . "/" . $picture->getName() . "." . $picture->getType(), 0777); } //thumb
<?php include_once getcwd() . "/classes/BLCar.php"; include_once getcwd() . "/classes/BLCarPicture.php"; $blCar = new BLCar(); $blCarPicture = new BLCarPicture(); if (isset($_GET["id"])) { $id = $_GET["id"]; $carpic = $blCarPicture->getCarPicture($id); $car = $blCar->getCar($carpic->getCarId()); $car->setDefaultPictureId($id); $blCar->updateCar($car); echo "<font color=\"green\">Default picture changed!</font>"; }
$defaultcarpreviewlink = $url; } //default car ytlink $carmovielistyt = $blCarMovie->getYoutubeCarMoviesByCar($defaultcar->getId()); if ($carmovielistyt != null) { $url = getYoutubeEmbedLink($carmovielistyt[0]->getUrl()); $defaultcarytlink = $url; } //default car press contact if ($presscontactoverwrite == null) { $defaultcarcontact = $blPressContact->getPressContact($defaultcar->getPressContactId()); } else { $defaultcarcontact = $presscontactoverwrite; } //default car picture $defaultcarpicture = $blCarPicture->getCarPicture($defaultcar->getDefaultPictureId()); //cars $cars = $blCar->getCarsBySiteOnline($site->getId()); //check for directory if (!is_dir(getcwd() . '/html/' . $site->getName())) { mkdir(getcwd() . '/html/' . $site->getName(), 0777, true); } //backup previous page if (!is_dir(getcwd() . '/html/' . $site->getName() . '/backup')) { mkdir(getcwd() . '/html/' . $site->getName() . '/backup', 0777, true); chmod(getcwd() . '/html/' . $site->getName() . '/backup', 0777); } if (is_file(getcwd() . '/html/' . $site->getName() . '/index.html')) { $date = date('d-m-Y_His'); copy(getcwd() . '/html/' . $site->getName() . '/index.html', getcwd() . '/html/' . $site->getName() . '/backup/index_' . $date . '.html'); chmod(getcwd() . '/html/' . $site->getName() . '/backup/index_' . $date . '.html', 0777);
$defaultcarpreviewlink = $url; } //default car ytlink $carmovielistyt = $blCarMovie->getYoutubeCarMoviesByCar($defaultcar->getId()); if (count($carmovielistyt) > 0) { $url = getYoutubeEmbedLink($carmovielistyt[0]->getUrl()); $defaultcarytlink = $url; } //default car press contact if ($presscontactoverwrite == null) { $defaultcarcontact = $blPressContact->getPressContact($defaultcar->getPressContactId()); } else { $defaultcarcontact = $presscontactoverwrite; } //default car picture $defaultcarpicture = $blCarPicture->getCarPicture($defaultcar->getDefaultPictureId()); //cars if (!isset($_GET["preview"])) { $cars = $blCar->getCarsBySiteOnline($site->getId()); } else { echo "You are now in preview mode, all cars are displayed for this site.<br />"; echo "Only show cars with state <a href=\"" . SUBFOLDER . "/site/" . $site->getName() . "\">online</a>."; $carsdesign = $blCar->getCarsDesignBySite($site->getId()); $carsrest = $blCar->getCarsBySite($site->getId()); if ($carsdesign != null) { $cars = array_merge($carsdesign, $carsrest); } else { $cars = $carsrest; } if ($carsdesign == null) { $cars = $carsrest;