Server IP : 149.202.105.228 / Your IP : 216.73.216.18 Web Server : Apache System : Linux webm129.cluster030.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64 User : atfycaf ( 116275) PHP Version : 7.4.33 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/atfycaf/www/admin/ |
Upload File : |
<?php include "globalVars.php"; if (isset($_POST["bgID"])) { $bgID = $_POST["bgID"]; $bgImageQuery = mysqli_query($conn, "SELECT * FROM pageBG WHERE id = '$bgID'"); while ($bIQ = mysqli_fetch_array($bgImageQuery)) { $bgImage = $bIQ["bgImage"]; $pagesLock = $bIQ["pagesLock"]; $x1 = $bIQ["homeX1"]; $y1 = $bIQ["homeY1"]; $x2 = $bIQ["homeX2"]; $y2 = $bIQ["homeY2"]; } $bgImageOrig = $SERVER_ROOT ."/images/pagesBG/". substr_replace($bgImage, "-original", "-4", 0); $bgImageHome = $SERVER_ROOT ."/images/pagesBG/". $bgImage; $bgImageOrigURL = $Iurl ."pagesBG/". substr_replace($bgImage, "-original", "-4", 0); $bgImageHomeURL = $Iurl ."pagesBG/". $bgImage; $bgImageTitleURL = $Iurl ."pagesBG/". substr_replace($bgImage, "-title", "-4", 0); list($width, $height) = @getimagesize($bgImageOrig); $imgRatio = $width/$height; include "header.php"; ?> <h2>Update a Page Background - Home Page Photo</h2> <?php if (isset($_POST["updateBG"])) { $photoTitleEN = $_POST["photoTitle_en"]; $pagesLock = $_POST["pagesLock"]; foreach($langURLArray as $dbLang) { $bgTitle = str_replace($encBad, $encGood, $_POST["photoTitle_".$dbLang]); if (trim($bgTitle) == "") { $bgTitle = $photoTitleEN; } mysqli_query($conn, "UPDATE pageBGTitle_". $dbLang ." SET bgTitle = '". addslashes($bgTitle) ."' WHERE id = '$bgID'") or die (mysqli_error($conn)); } $x1 = $_POST["x1"]; $y1 = $_POST["y1"]; $x2 = $_POST["x2"]; $y2 = $_POST["y2"]; $imageCrop = ($x2 - $x1)."x". ($y2 - $y1) ."+". $x1 ."+". $y1; $newSize = "1920x630"; list($width, $height) = getimagesize($bgImageOrig); $imgRatio = $width/$height; if ($width != 1920) { exec("/usr/bin/convert -crop $imageCrop $bgImageOrig $bgImageHome"); exec("/usr/bin/convert -auto-orient -resize $newSize -strip -quality 75 -limit thread 2 $bgImageHome $bgImageHome"); } mysqli_query($conn, "UPDATE pageBG SET pagesLock = '$pagesLock', homeX1 = '$x1', homeY1 = '$y1', homeX2 = '$x2', homeY2 = '$y2' WHERE id = '$bgID'"); $trackDate = date("Y-m-d H:i:s"); mysqli_query($conn, "INSERT INTO userActions (dateCreated, adminID, pageTracking, databaseUpdated, updateDetails) VALUES ('$trackDate', '$adminID', 'admin/pagesBGEdit-1.html', 'pageBG', 'The User ". addslashes($adminName) ." <$adminEmail> updated the background slide ". addslashes($photoTitleEN) ."')"); $randID = mt_rand(1,99999999); ?> <p>Success! The header background has been updated.</p> <p><strong>Home Page:</strong><br> <img src="<?php echo $bgImageHomeURL ?>?rV=<?php echo $randID ?>" width="960"></p> <p><strong>Other Pages:</strong><br> <img src="<?php echo $bgImageTitleURL ?>?rV=<?php echo $randID ?>" width="960"></p> <form action="pagesBGEdit-2.html" method="post"> <input type="hidden" name="bgID" value="<?php echo $bgID ?>"> <button type="submit" class="submitButton">Update the Title Image</button> </form> <a href="pagesBG.html" class="submitButton">View all Backgrounds</a> <?php } else { ?> <form action="pagesBGEdit-2.html" method="post"> <input type="hidden" name="bgID" value="<?php echo $bgID ?>"> <button type="submit" class="submitButton">Update the Title Image</button> </form> <?php if (count($langArray) != 1) { ?> <div id="langSelector"> <?php foreach($langArray as $langArrayURL=>$langArrayDisplay) { ?> <a id="<?php echo $langArrayURL ?>Selector"<?php if ($langArrayURL == "en") {?> class="selectedLang"<?php } ?>><?php echo $langArrayDisplay ?></a> <?php } ?> </div> <?php } ?> <form action="pagesBGEdit-1.html" method="post"> <input type="hidden" id="bgID" name="bgID" value="<?php echo $bgID ?>" /> <input type="hidden" id="x1" name="x1" value="<?php echo $x1 ?>" /> <input type="hidden" id="y1" name="y1" value="<?php echo $y1 ?>" /> <input type="hidden" id="x2" name="x2" value="<?php echo $x2 ?>" /> <input type="hidden" id="y2" name="y2" value="<?php echo $y2 ?>" /> <?php foreach($langArray as $langTab=>$langDisplay) { $photoTitleQuery = mysqli_query($conn, "SELECT * FROM pageBGTitle_". $langTab ." WHERE id = '$bgID'"); while ($pTQ = mysqli_fetch_array($photoTitleQuery)) { $photoTitle = $pTQ["bgTitle"]; } ?> <div class="descTab" id="<?php echo $langTab ?>SelectorTab"> <div class="pFormRow"> <div class="pFormTitle"><?php echo $langDisplay ?> Photo Title:</div> <div class="pFormInput"> <input type="text" name="photoTitle_<?php echo $langTab ?>" id="photoTitle_<?php echo $langTab ?>" size="50" value="<?php echo $photoTitle ?>"<?php if ($langTab == "en") {?> required<?php } ?> /> <div class="pFormLabel"> <label class="labelName"><?php echo $langDisplay ?> Photo Title:</label> </div> </div> </div> </div> <?php } ?> <div class="descStTab"> <div class="pFormRow"> <div class="pFormTitle">Limit to one page:</div> <div class="pFormSelect"> <select name="pagesLock"> <option value="0"<?php if ($pagesLock == "0") {?> selected<?php } ?>>Show on all pages</option> <?php $pageQuery = mysqli_query($conn, "SELECT * FROM pages_en ORDER BY id ASC") or die (mysqli_error()); while ($pQ = mysqli_fetch_array($pageQuery)) { $pageID = $pQ["id"]; $pageName = $pQ["menuTitle"]; ?> <option value="<?php echo $pageID ?>"<?php if ($pagesLock == $pageID) {?> selected<?php } ?>><?php echo $pageName ?></option> <?php } ?> </select> <div class="pFormLabel"> <label class="labelName">Limit to one page:</label> </div> </div> </div> </div> <div class="descLogoBGTab"> <div id="areaSelectPreviewContainer"> <div id="areaSelectPreview"><img src="<?php echo $bgImageOrigURL ?>" width="<?php echo $width ?>"></div> </div> </div> <p>You can crop the photo to the position you want to display on the home page. Above is a preview of how the photo will look. On the next page you can crop the photo for the property lists and other pages.<br><br><strong>If you cannot see all of the full size photo below, press CTRL + - (minus key) to zoom out. Press CTRL + 0 (zero key) to zoom back to normal size.</strong></p> <div class="descImgBGTab" id="uploadedPhoto"><img id="areaSelectPhoto" src="<?php echo $bgImageOrigURL ?>" width="<?php echo $width ?>"></div> <input type="submit" class="submitButton" name="updateBG" value="Save background" /> </form> <?php } ?> <?php include "footer.php"; } else { header("Location:/admin/pagesBG.html"); } ?>