&s=&sortBye= &s=' . $start . '&p=' . $pages . ' &s=&p= &s=".$start."&p=".$pages." */ /* categories - first 3 are too long, esp on mobile... blocking top images... truncate and/or go to a different view in mobile maybe push them into MORE button, if I can then use column lay out on favorite photographers page */ // BIG DEAL /* PhotoCatsCrossOptimize Vs. vw_PhotosPublic p with (NOEXPAND) +++++++++++++++ what are we doing with this view, and does a JOB optimize categories */ /* To Do on this page AND on the POTD listing - what if "p" IS brought in via querystring, still gotta do the following search $cmdGetPhotosCount = "SELECT count(p.photoID) FROM PhotoCatsCross pcc JOIN Photos p ON pcc.photoID = p.photoID WHERE catID IN (".$cateString.") ORDER BY dateCreated DESC"; */ // sp_GetPageOfImages4TheShowByMemIDSortLove" /* deal with start in signInUniversalSQL signUpgtlSQL */ $seoTitle = "See a curated set of beautiful, inspiring photos in these picture galleries at BetterPhoto"; $seoMetaDescription = "Get motivated by wonderful photos to shoot more photography yourself - or just to feel uplifted and inspired. Check out these amazing, curated photography galleries."; require '../incHead.php'; /* updaterAccess=Request.Querystring("updaterAccess") 'check for session variable If updaterAccess = "" Then updaterAccess = Session("updaterAccess") End if */ $memberID = $_GET['memberID'] ?? 0; $memberID = mysqli_real_escape_string($conn, $memberID); $email = $_GET['email'] ?? ''; if (!empty($email)) { // first try to get memberID from email $qMem = "SELECT memberID FROM Members WHERE email = '" . $email . "'"; $stmtE = mysqli_query($conn, $qMem); $tCountM = mysqli_num_rows($stmtE); if ($tCountM > 0){ while($mSet = mysqli_fetch_assoc($stmtE)) { $memberID = $mSet['memberID']; } } } if (!is_numeric($memberID)) { exit; } $sortBye = $_GET['sortBye'] ?? 'New'; // by default, show recently categorized first $cn = $_GET['cn'] ?? ''; // catName4URL $galleryContent = "gallery-content2"; $galleryColGrid = "col-md-3"; $photoSize = "m"; // if they got here from links to dynoGall2 but prefer another gallery, handle if (!empty($galleryPreferenceCA1)) { if ($galleryPreferenceCA1 == 2) { // what used to be "-2" 2 across $galleryContent = "gallery-content1"; $galleryColGrid = "col-md-6"; $photoSize = "m"; } elseif ($galleryPreferenceCA1 == 3) { // what used to be "-3" 4 across $galleryContent = "gallery-content"; $galleryColGrid = "col-md-4"; $photoSize = "t"; } } // if there really is a memberID if ($memberID > 0) { $reallyIn = 0; // if this memberID is in our db $cechMem = "SELECT memberID FROM Members WHERE memberID = ".$memberID; $stmt = $conn->query($cechMem); while ($RMrecordset = $stmt->fetch_array()) { $reallyIn = 1; } if ($reallyIn == 0) {// echo "
not a match"; exit; } // for dynamic display of menus, esp when long or they are in mobile $nonHamburgerMenuLimit = 3; // get all cats this member likes $cmdGetCategories = "SELECT x.catID, c.catName FROM PhotoCatsCrossTheShow x JOIN PhotoCats c ON x.catID = c.catID WHERE x.memberID = ".$memberID." ORDER BY catLevel DESC "; $catIDarr = array(); if ($result=mysqli_query($conn,$cmdGetCategories)) { // they have categories selected // Return the number of rows in result set $totalCountOfCats = mysqli_num_rows($result); // +++ needed ??? no mysqli_data_seek($result,0); if ($totalCountOfCats > 0) { // not zero results // push cat IDs into an array for photo getting select later while($row=mysqli_fetch_array($result)) { $catID = $row['catID']; $catIDarr[] = $catID; } } else { // zero results header("Location: ../selector.php?mID=".$memberID); } } else { // they have no categories header("Location: ../selector.php?mID=".$memberID); } // set CONDITIONS here, use to get count, then use again to get photos $cateString = implode(",", $catIDarr); $rowsPerPage = (isset($_GET['rowsPerPage']) ? $_GET['rowsPerPage'] : 12); // get all photos in all cats if ($sortBye == "Love" ) { $cmdGetPhotosCount = "SELECT count(p.photoID) FROM PhotoCatsCross pcc JOIN Photos p ON pcc.photoID = p.photoID INNER JOIN (SELECT favPhotoID, COUNT(favPhotoID) as photoScore FROM PhotoFavorites GROUP BY favPhotoID) n ON pcco.PhotoID = n.favPhotoID WHERE catID IN (".$cateString.") AND post in ('Yes','PVT')"; } else { $cmdGetPhotosCount = "SELECT count(p.photoID) FROM PhotoCatsCross pcc JOIN Photos p ON pcc.photoID = p.photoID WHERE catID IN (".$cateString.") AND post in ('Yes','PVT')"; } $r = mysqli_query($conn, $cmdGetPhotosCount) or die("SQL Error: " . mysqli_error($conn)); $rowC = @mysqli_fetch_array($r, MYSQLI_ASSOC); $tCount = $rowC[0]; if (isset($_GET['p']) && is_numeric($_GET['p'])) { // if # of pages is already here, passed in via query $pages = $_GET['p']; } else { // Calc # of pages if ($tCount > $rowsPerPage) { // more than 1 page $pages = ceil ($tCount/$rowsPerPage); } else { $pages = 1; } } if (isset($_GET['s']) && is_numeric($_GET['s'])) { // we have a start page $start = $_GET['s']; } else { $start = 0; } $rowsOnLastPage = $tCount % $rowsPerPage; $cmdGetPhotos = "SELECT p.photoID, catID, p.dateCreated, photoName, photoTitle, photoWidth, photoHeight, memberID, directory, threadID, inputID, discussThreadID, DATE_FORMAT(p.dateCreated, '%M %d, %Y') AS dateMade, contestWinner FROM PhotoCatsCross pcc JOIN Photos p ON pcc.photoID = p.photoID"; if ($sortBye == "Love" ) { // sp_GetPageOfImages4TheShowByMemIDSortLove $cmdGetPhotos .= " INNER JOIN (SELECT favPhotoID, COUNT(favPhotoID) as photoScore FROM PhotoFavorites GROUP BY favPhotoID) n ON pcc.photoID = n.favPhotoID WHERE catID IN (".$cateString.") AND post in ('Yes','PVT') ORDER BY n.photoScore DESC LIMIT ?,?"; } else { // sort by photoID when "New" $cmdGetPhotos .= " WHERE catID IN (".$cateString.") AND post in ('Yes','PVT') ORDER BY dateMade DESC LIMIT ?,?"; } // end sort by if then //echo "
biggerSQL=".$cmdGetPhotos; $stmt = $conn->prepare($cmdGetPhotos); $stmt->bind_param('ii', $start, $rowsPerPage); $stmt->execute(); $result2 = $stmt->get_result(); ?>
"; echo ""; if (!empty($memberNamePh)) { echo "© ".$memberNamePh; } echo ""; showDlxOrProIfMemberHasOne_Shortened($conn, $phMemberID); ?>