prepare($FindCats);
$stmt->execute();
$subcatphotos = mysqli_fetch_assoc($stmt->get_result());
if($subcatphotos){
$photoID = $subcatphotos['photoID'];
$photoTitle = $subcatphotos['photoTitle'];
$photoDescription = $subcatphotos['photoDescription'];
$photoDescription = str_replace(" i "," I ",str_replace("& ","and ",str_replace("\n","",str_replace("\r","",str_replace("\r\n","",str_replace("\r\n\r\n","",str_replace("'","'",str_replace("|","",$photoDescription))))))));
if (!empty($photoTitle)) {
$seoTitle = "Inspiring Photo: " . $photoTitle . " #" . $photoID;
$seoMetaDescription = $photoTitle . " ";
} else {
$seoTitle = "Inspiring Photo at BetterPhoto: Untitled Photograph #" . $photoID;
}
if (strlen($seoTitle) > 65) {
$seoTitle = left($seoTitle,62) . "...";
}
if (!empty($photoDescription)) {
$seoMetaDescription .= "- Photographer's Description: " . $photoDescription;
} else {
$seoMetaDescription .= "- See this inspiring, creative photo curated by the editors at BetterPhoto. Photo #" . $photoID;
}
}
} else {
header("Location: /gallery.php");
exit();
}
}
require '/var/www/html/betterphoto.fun/public_html/_mailerThatWorks.php';
require '../incHeadWithoutRequired.php';
// we use for nextPhoto button
$justPhotoID=0;
$mem4show = $_GET['mem4show'] ?? ''; // if they want to see photos in their fav categories
$mem4gall = $_GET['mem4gall'] ?? ''; // if they only want to see their own photos
$mem4Wins = $_GET['mem4Wins'] ?? '';
$contestCatID = $_GET['contestCatID'] ?? '';
$camID = $_GET['camID'] ?? '';
$catID = $_GET['catID'] ?? '';
if (empty($catID)) {
$catID = $_GET['galleryID'] ?? '';
}
$FavMemID = $_GET['FavMemID'] ?? '';
$Favpt = $_GET['Favpt'] ?? '';
$sortBye = $_GET['sortBye'] ?? '';
$cn = $_GET['cn'] ?? '';
$courseID = $_GET['courseID'] ?? '';
if (!empty($courseID)) {
// do a double check on courseID
$q="SELECT courseID FROM CoursesMemberCross WHERE memberID = " . $memAuth . " AND courseID = " . $courseID;
$datacchk = mysqli_query($conn, $q);
$tCountcchk=mysqli_num_rows($datacchk);
if ($tCountcchk == 0) {
// not a real course student
$courseID = '';
}
}
$critiquePrefGrow1 = $_GET['critiquePrefGrow1'] ?? '';
if (empty($critiquePrefGrow1)) {
// do a double check on critiquePref
$q="SELECT critiquePrefGrow FROM Members WHERE memberID = " . $memAuth;
$datacchkCQ = mysqli_query($conn, $q);
$tCountcchkCQ=mysqli_num_rows($datacchkCQ);
if ($tCountcchkCQ == 1) {
// wants it straight
$critiquePrefGrow1 = 'GROW';
} else {
$critiquePrefGrow1 = 'LOVE';
}
}
// for going back to right page in category when they go back
$start = $_GET['s'] ?? '';
// for finding prev and next
$rowNumber = $_GET['rowNumber'] ?? '';
$rowsPerPage = $_GET['rowsPerPage'] ?? '';
//??
$memberGall = $_GET['memberGall'] ?? '';
if ($mem4gall == "" && $mem4Wins == "" && $mem4show == "" && $contestCatID == "" && $camID == "" && ($catID == "" || $catID == "FAV") && $Favpt == "" && $sortBye == "") {
$justPhotoID=1;
}
//now that we've passed the JustOnePhoto gate, reset some things
if ($sortBye == "") {
$sortBye="New";
}
//$sortBye=strtoupper($sortBye); WHY WAS THIS HERE
// for prev and next photo buttons
if ($sortBye == "Love") {
// works only when photoScore is in the first part of the SQL SELECT
$sqlOrderBy = "n.photoScore";
//} elseif $sortBye == "NEWPIX" && $mem4gall = "0") { same as above but NOT personal
// NEWEST UPLOADS
} elseif ($sortBye == "New") {
$sqlOrderBy = "p.dateCreated";// same as by photoID
// default to MOST RECENTLY CATEGORIZED
} else {
// sorting by new categorized, SAME AS $sortBye == "New" ???
// works only when photoScore is in the first part of the SQL SELECT
$sqlOrderBy = "pcc.dateCreated";
}
if ($mem4gall == "") {
$mem4gall="0";
}
if (!empty($catID) && is_numeric($catID) == false) {
header("Location: /galleryTOCDynoSub.php?cat=541");
exit();
}
$originURL=$_SERVER['SCRIPT_NAME']."?".$_SERVER['QUERY_STRING'];
if (strpos($originURL,"/photocourses/") > 0) {
$photoCatID=str_replace("https://www.BetterPhoto.com/photocourses/","",strtolower($originURL));
if (_instr(0,$photoCatID,"/",0) > 0) {
$photoCatID=substr($photoCatID,0,(_instr(0,$photoCatID,"/",0)-1));
}
/*
if (is_numeric($photoCatID) == true) {
header("Location: /photocourses/".$photoCatID."/gallDetail.php?photoID=".$photoID);
exit();
}
*/
}
// FUNCTIONS
function sb_MemberFavoritePhotographer($conn, $memberID, $favPhotographerID) {
// sp_CheckExistenceOfMemberFavPhotographerByMemberID member likes favPhotog
$q="SELECT favID FROM PhotographerFavorites WHERE favPhotographerID = " . $favPhotographerID . " AND memberID = " . $memberID;
$data = mysqli_query($conn, $q);
$tCount=mysqli_num_rows($data);
if ($tCount == 0) {
// not a favorite photographer yet, show add link
echo " ";
echo "Follow this photographer";
} else {
// already a favorite, show remove link
while($ImageSet = mysqli_fetch_assoc($data)) {
$favID = $ImageSet['favID'];
}
echo "
";
echo "Stop followin'";
}
}
function sb_link2SendPrivateMemberMessage($memberID) {
echo "
";
echo "Send a Message";
}
?>
prepare($query);
$stmt->bind_param("i", $memberID);
$stmt->execute();
$stmt->store_result();
if ($stmt->num_rows > 0) {
// Member is whitelisted, adjust the baseline score
$baseline_score = 0.1; // or any value you deem appropriate for bypassing reCAPTCHA
} else {
// Proceed with the regular reCAPTCHA validation
if ($recaptcha->score < 0.5 && $memberID <= 540331) {
// The score is lower but the member is a long-time user (low memberID), accept
$baseline_score = 0.3;
}
}
// Continue with the rest of your logic
$stmt->close();
}
// Take action based on the score returned:
if ($recaptcha->score >= $baseline_score) {
// successful recaptcha
// check for errors
if (empty($input)) {
$errors[] = "No discussion input.";
// input too long
} elseif (strlen($input) > 3000) {
$errors[] = "Discussion input too long.";
}
} else {
// What happens when the CAPTCHA failed
// notify
$toAddress = "jim.miotke@gmail.com";
$toName = "BetterPhoto Owner";
$subject = "Photo Detail RecapthaFailed score=".$recaptcha->score ." baseline=".$baseline_score;
$str = "A reCAPTCHA failure occurred.\n";
$str .= "Member ID: " . $memberID . "\n";
$str .= "User IP: " . $_SERVER['REMOTE_ADDR'] . "\n";
$str .= "Date and Time: " . date("Y-m-d H:i:s") . "\n";
$str .= "Score: " . $recaptcha->score . "\n";
$str .= "Baseline Score: ".$baseline_score;
mailerThatRocks($toAddress, $subject, $str, $toName);
$errors[] = "
The reCAPTCHA failed. Rest assured, Team BetterPhoto has been notified. Error code: " . $baseline_score . " This sometimes happens when you're on the page for more than 2 minutes before posting. Other times, it has to do with privacy settings on your browser. One solution: next time, write your comment somewhere else (such as the URL field above), select & copy what you write, paste your comment into the discussion, and click 'Send' button. Then, if it fails, you can go back and try to paste it in again. Thanks for your patience. ";
}
} elseif (empty($courseID)) {
// no posted recaptcha
$errors[] = "No reCAPTCHA posted.";
}
if (empty($errors)) {
//echo "
TEST";
// clean out the weird characters use html entities or similar???
$memberID = mysqli_real_escape_string($conn, $memberID);
$threadID = mysqli_real_escape_string($conn, $threadID);
$topic = mysqli_real_escape_string($conn, $topic);
$input = mysqli_real_escape_string($conn, $input);
$notifyMemberInTheFuture = mysqli_real_escape_string($conn, $notifyMemberInTheFuture);
$photoID = mysqli_real_escape_string($conn, $photoID);
if (strpos(strtolower($topic),"betterphoto.") === FALSE) {
$topic = str_replace("http", "", str_replace("https", "", str_replace(">", "", str_replace("", "", str_replace("','>',str_replace('""','',str_replace(",","'",$topic))) Replace(Replace(Replace(""),vbCrLf," 111 111 q2=" . $q;
// if there is one, this thread has a cat so update newestThread
if ($dataD = mysqli_query($conn, $SQLpicStamp)) {
while($tid = mysqli_fetch_assoc($dataD)) {
$discCat = $tid['catID'];
}
}
$qC="UPDATE DiscCats SET newestThreadID = " . $threadID4picStamp . ", lastActivity = '" . date('Y-m-d H:i:s') . "' WHERE catID = " . $discCat;
$dataUp2 = mysqli_query($conn, $qC);
} else { // a course
// put in course critiques here
if ($inputType == "additionalComment") {
// insert discussion response
$q="INSERT INTO CourseCritiqueResponses (memberID, inputMemo, threadID, notifyMember) VALUES (" . $memberID . ", '" . $input . "', " . $threadID . ", '" . $notifyMemberInTheFuture . "')";
//echo " TestoInA=".$q;
$dataI = mysqli_query($conn, $q);
} else {
// insert discussion
$q="INSERT INTO CourseCritiques (memberID, topic, inputMemo, hasPhotos, notifyMember, dateModified) VALUES (" . $memberID . ", '" . $topic . "', '" . $input . "', 'Yes', '" . $notifyMemberInTheFuture . "', '" . date('Y-m-d H:i:s') . "')";
//echo " TestoInD=".$q;
$dataI = mysqli_query($conn, $q);
}
// Now get the threadID or inputID for the item just inserted, used to stamp photos
if ($inputType == "additionalComment") {
$SQLTHREADID="SELECT threadID FROM CourseCritiqueResponses ORDER BY inputID DESC LIMIT 1";
} else {
$SQLTHREADID="SELECT MAX(threadID) AS threadID FROM CourseCritiques";
}
if ($dataD = mysqli_query($conn, $SQLTHREADID)) {
while($tid = mysqli_fetch_assoc($dataD)) {
$newThreadInputID = $tid['threadID'];
}
}
// if this photo is getting a 1st comment, stamp photo with threadID and put this discussion into NEW DISCS cat
if (!empty($photoID) && $inputType == "comment") {
$SQLUPDATEPHOTO ="UPDATE Photos SET courseCritiqueThreadID = " . $newThreadInputID . " WHERE photoID = " . $photoID;
$dataU = mysqli_query($conn, $SQLUPDATEPHOTO);
$q1="INSERT INTO CourseCritiqueCatsCross (catID, threadID) VALUES (103, " . $newThreadInputID . ")";
//echo " Testo1a=".$q1;
$dataInA = mysqli_query($conn, $q1);
}
// if an answer was inserted, stamp discuss thread with current date for dateModified and put disc into NEW RESPONSES cat
$prevdiscCat = "";
// it's a comment not a start of a new discussion
if ($inputType == "additionalComment") {
$q="UPDATE CourseCritiques SET dateModified = '" . date('Y-m-d H:i:s') . "' WHERE threadID = " . $threadID;
//echo " Testo=".$q;
$dataU = mysqli_query($conn, $q);
// check if this thread has been categorized
$q="SELECT catID FROM CourseCritiqueCatsCross WHERE threadID = " . $threadID . "";
// if there is one, this thread has a cat so update it
$dataU2 = mysqli_query($conn, $q);
$tCountInCat = mysqli_num_rows($dataU2);
// it has already been catted
if ($tCountInCat > 0){
while($cid = mysqli_fetch_assoc($dataU2)) {
$prevdiscCat = $cid['catID'];
}
// if it's previous cat is NEW DISC, make it NEW RESPONSE now
if ($prevdiscCat == 103) {
$q8="UPDATE CourseCritiqueCatsCross SET catID=104 WHERE (threadID=" . $threadID . " AND catID=103)";
//echo " Testo8=".$q8;
$dataIn8 = mysqli_query($conn, $q8);
} elseif ($prevdiscCat == 104) {
// it's already in 101 so maybe put it to a AdminCat Queue
$q1="INSERT INTO CourseCritiqueCatsCross (catID, threadID) VALUES (112, " . $threadID . ")";
// $dataInA = mysqli_query($conn, $q1);
}
} else {
$q1="INSERT INTO CourseCritiqueCatsCross (catID, threadID) VALUES (104, " . $threadID . ")";
//echo " Testo1=".$q1;
$dataInA = mysqli_query($conn, $q1);
}
}
}
$partThatDoesntChange = "To see it (and be inspired), visit BetterPhoto.com at:\n\n";
$partThatDoesntChange .= "https://www.BetterPhoto.com/gallery/dynoGallDetail.php?photoID=" . $photoID . "&courseID=" . $courseID . "\n\n";
$partThatDoesntChange .= "Thanks!\n\n";
$partThatDoesntChange .= Application("name_customerSupport") . "\n";
$partThatDoesntChange .= Application("email_customerSupport") . "\n\n" . Application("universalSignature") . "\n\n\n\n";
$partThatDoesntChange .= "P.S. Some email programs may display the following code better than the above link; if yours does, feel free to use it: Alternate link to BetterPhoto.com \n\n";
if ($photoID == 850) { // go to the video page
} else {
// when the original commenter indicated they wanted notification (so for Responses only)
if ($notifyDiscOrig == "Yes" && !empty($emailOrig)) {
// first is their email address any good?
// sp_CheckEmailStatusByEmail"
$q="SELECT emailStatus FROM Members WHERE email = '" . $emailDisc . "'";
if ($resultE = mysqli_query($conn, $q)) {
while ($dataE = mysqli_fetch_assoc($resultE)) {
$emailStatusQ = $dataE['emailStatus'];
}
if ($emailStatusQ != "BAD" && $emailStatusQ != "HRD" && $threadID != '1736976') {
// create the object to send the email
if (!empty($courseID) && !empty($memberNamePh)) {
$subject = "Course Critique on Photo by " . $memberNamePh . ", at BetterPhoto.com - #" . $photoID;
} elseif (!empty($memberNamePh)) {
$subject = "Discussion on Photo by " . $memberNamePh . ", at BetterPhoto.com - #" . $threadID;
} else {
$subject = "Photo Discussion at BetterPhoto.com - #" . $threadID;
}
$responseForm = "Hi " . $firstNameOrig . "\n\n";
$responseForm .= "There has been recent activity on ";
if (!empty($firstNamePh)) {
$responseForm .= $firstNamePh . "'s ";
} else {
$responseForm .= "a ";
}
$responseForm .= "photo at BetterPhoto.com. \n\n";
$responseForm .= $partThatDoesntChange . "\n\n";
$responseForm .= "#" . $memberID . " - " . "-NoteOrig=Yes---";
$toAddress = $emailDisc; // respond to original commenter
// during testing ++++++MAIL++++ go to me
//$toAddress = "jimtestin@ProductiveAndHappy.com";
$toName = "BetterPhoto Original Photo Commenter";
$message = $responseForm;
mailerThatRocks($toAddress, $subject, $message, $toName);
}
}
}
} // End if // video
// when the photographer indicated they wanted notification
//I am not receiving any notifications when I receive comments on my photos
if ($notifyPh == "Yes") {
// sp_CheckEmailStatusByEmail
$q="SELECT emailStatus FROM Members WHERE email = '" . $emailPh . "'";
if ($dataP = mysqli_query($conn, $q)) {
while ($rowP = mysqli_fetch_assoc($dataP)) {
$emailStatusPh = $rowP['emailStatus'];
}
$threadID4email = $threadID;
if ($inputType == "comment") {
$threadID4email = $newThreadInputID;
}
if ($emailStatusPh != "BAD" && $emailStatusPh != "HRD" && $threadID4email != '1736976') {
// during testing ++++++MAIL++++ go to me
//$toAddress = "jimtestin@ProductiveAndHappy.com";
//echo " subject1=" . $subject;
//echo " form1=" . $responseFormPh;
// if this is not the questioner (who has already been dealt with)
if ($emailPh != $emailOrig) {
// create the object to send the email
if (!empty($courseID) && !empty($memberNamePh)) {
$subject = "Course Critique: Photo by " . $memberNamePh . ", at BetterPhoto.com - #" . $photoID;
} elseif (!empty($memberNamePh)) {
$subject = "Discussion on Photo by " . $memberNamePh . ", at BetterPhoto.com - #" . $threadID4email;
} else {
$subject = "Photo Discussion at BetterPhoto.com - #" . $threadID4email;
}
$responseFormPh = "Hi " . $firstNamePh . "\n\n";
$responseFormPh .= "There has been recent activity on your photo at BetterPhoto.com. \n\n";
$responseFormPh .= $partThatDoesntChange . "\n\n";
$responseFormPh .= "#" . $memberID . "-NotePH=Yes---";
$toAddress = $emailPh; //"eiKoae2uzXEsvy@dkimvalidator.com" // respond to photographer
$toName = "BetterPhoto Photographer";
$message = $responseFormPh;
mailerThatRocks($toAddress, $subject, $message, $toName);
}
}
}
}
if ($photoID == 850) { // go to the video page
} else {
if ($inputType == "additionalComment") {
// get all answerers on this thread with non-bad emails
// only gets members with global "notify me" turned on
// sp_FindDiscussersEmailsByThreadID"
if (empty($courseID)) {
$q="SELECT m.email, m.firstName, m.memberID FROM Members m INNER JOIN DiscussionResponses a ON a.memberID = m.memberID WHERE ((a.threadID = " . $threadID . " ) AND (a.status != 'ARC') AND (m.emailStatus != 'BAD') AND (a.notifyMember = 'Yes')) ORDER BY m.memberID";
} else {
$q="SELECT m.email, m.firstName, m.memberID FROM Members m INNER JOIN CourseCritiqueResponses a ON a.memberID = m.memberID WHERE ((a.threadID = " . $threadID . " ) AND (a.status != 'ARC') AND (m.emailStatus != 'BAD') AND (a.notifyMember = 'Yes')) ORDER BY m.memberID";
}
$dataA = mysqli_query($conn, $q);
while($aid = mysqli_fetch_assoc($dataA)) {
$AnswererEmail = $aid['email'];
$AnswererFName = $aid['firstName'];
$AnswererMemberID = $aid['memberID'];
// response to answerers; exclude the most recent inputter; skip it when looping
if ($AnswererMemberID != $memberID) {
// only do it once for those who have many answers on the thread
if ($AnswererMemberID != $laterpreviousAnswererMemberID) {
//if this is not the questioner or photographer (who have already been dealt with)
if ($AnswererEmail != $emailOrig && $AnswererEmail != $emailPh && $threadID != '1736976') {
// create the object to send the email
if (!empty($courseID) && !empty($memberNamePh)) {
$subject = "Course Critique on Photo by " . $memberNamePh . ", at BetterPhoto.com - #" . $photoID;
} elseif (!empty($memberNamePh)) {
$subject = "Discussion on Photo by " . $memberNamePh . ", at BetterPhoto.com - #" . $threadID;
} else {
$subject = "Photo Discussion at BetterPhoto.com - #" . $threadID;
}
$responseForm = "Hi " . $AnswererFName . "\n\n";
$responseForm .= "There has been recent activity on ";
if (!empty($firstNamePh)) {
$responseForm .= $firstNamePh . "'s ";
} else {
$responseForm = $responseForm . "a ";
}
$responseForm .= "photo at BetterPhoto.com.\n\n" . $partThatDoesntChange;
$responseForm .= "P.P.S. If you would like to stop being notified each time there is activity on this thread, visit:\n" .
"https://www.BetterPhoto.com/notifyNoMore.php?pOrQ=p&t=" . $threadID . "&m=" . $AnswererMemberID . "\r\n\r\n\r\n\r\n";
$responseForm .= "#" . $memberID . "-Aid" . $AnswererMemberID . "-lpAid" . $laterpreviousAnswererMemberID;
if (!empty($AnswererEmail)) {
$toAddress = $AnswererEmail;
} else {
$toAddress = "jimError@ProductiveAndHappy.com";
}
$toName = "BetterPhoto Photo Commenter";
$message = $responseForm;
mailerThatRocks($toAddress, $subject, $message, $toName);
}
}
}
$laterpreviousAnswererMemberID = $AnswererMemberID;
} // EmailRSA.movenext loop
} // End if ' if an additional comment, go thru other additional comments
} // End if // don't do if video
$q="SELECT role, firstName, lastName FROM MemberVolunteers mv JOIN Members m ON m.memberID = mv.memberID WHERE mv.memberID = " . $memberID;
$dataXV = mysqli_query($conn, $q);
$tCountXV = mysqli_num_rows($dataXV);
if ($tCountXV > 0){
while ($Sid = mysqli_fetch_assoc($dataXV)) {
$roleBPV = $Sid['role'];
$firstNameBPV = $Sid['firstName'];
$lastNameBPV = $Sid['lastName'];
}
//if($memberID == "18159" || $memberID == "512652" || $memberID == "514903" || $memberID == "294243" || $memberID == "50267" || $memberID == "521275" || $memberID == "342009" || $memberID == "365554" || $memberID == "525882" || $memberID == "463726" || $memberID == "169334" || $memberID == "516663" || $memberID == "49948" || $memberID == "522088" || $memberID == "38076" || $memberID == "138988" || $memberID == "23144" || $memberID == "412484" || $memberID == "126389" || $memberID == "274303" || $memberID == "52305" || $memberID == "529909" || $memberID == "151641" || $memberID == "516876"){
// Notify me of team work
$subject = "9x9 Discussion by " . $roleBPV . ": " . $firstNameBPV . " " . $lastNameBPV;
$strN = "Nice 9 x 9 to " . $memberID . "\n\nTo see, go to:\n" . "https://www.BetterPhoto.com/gallery/dynoGallDetail.php?photoID=" . $photoID . "&courseID=" . $courseID . "\n\nEnjoy!\n\n";
$toAddress = "jim@ProductiveAndHappy.com";
$toName = "BetterPhoto Owner";
$message = $strN;
//mailerThatRocks($toAddress, $subject, $message, $toName);
}
} else {
// show the errors
echo ' echo=".$q;
$dataPic = mysqli_query($conn, $q);
if ($ImageSet = mysqli_fetch_assoc($dataPic)) {
$photoName = $ImageSet['photoName'];
$photoTitle = $ImageSet['photoTitle'];
if (empty($photoTitle)) $photoTitle = "Untitled";
$photoDescription = $ImageSet['photoDescription'];
$phMemberID = $ImageSet['memberID'];
$photoDirectory = $ImageSet['directory'];
$post = $ImageSet['post'];
$threadID = $ImageSet['threadID'];
$inputID = $ImageSet['InputID'];
$discussThreadID = $ImageSet['DiscussThreadID'];
$courseCritiqueThreadID = $ImageSet['courseCritiqueThreadID'];
$cameraID = $ImageSet['cameraID'];
$contestWinner = $ImageSet['contestWinner'];
$dateCreated = $ImageSet['dateCreated'];
$photoWidthLarge = $ImageSet['photoWidthLarge'];
$photoHeightLarge = $ImageSet['photoHeightLarge'];
$exifData = $ImageSet['exifData'];
$notifyPh = $ImageSet['notifyMember'];
$dateEnteredContest = $ImageSet['dateEnteredContest'];
if (empty($catID)) $catID = $ImageSet['catID'];
// clear photoDescription if it contains a link JIM 3/2016
if (strpos(strtolower($photoDescription)," 0) {
if (strpos(strtolower($photoDescription),"betterphoto.") > 0) { // and it's not a good internal link
$photoDescription = str_replace("http:", "https:", $photoDescription);
} else {
$photoDescription = "";
}
}
// USE SITE URL here instead +++++++++++ AmazonDirectoryFlag = 0 ' isAmazonDirectory(photoDirectory)
// get keywords if there are any
// sp_GetMatchingKeywordsByPhotoIDOnly photoID
$photoKeywords = '';
$q="SELECT keyword, count(photoKeywordCrossID) FROM KeywordsCross kc JOIN Keywords k ON kc.keywordID = k.keywordID WHERE photoID = " . $photoID . " GROUP BY keyword HAVING count(photoKeywordCrossID) > 0 ORDER BY count(photoKeywordCrossID) DESC";
// SHUT OFF JUNE 2020 $dataKW = mysqli_query($conn, $q);
//while($kSet = mysqli_fetch_assoc($dataKW)) {
//$photoKeywords .= strtolower($kSet['keyword']) . ', ';
//}
// trim final comma
if (right($photoKeywords, 2) == ', ') {
$photoKeywords = rtrim($photoKeywords,', ');
}
// do a check to see if this is a Editor's Pick
$isEC = sp_ValidateEditorsChoicePhoto($conn, $photoID);
// do a check to see if this is a POTD photo
$isPOTD = sp_ValidatePotdPhoto($conn, $photoID);
// do a check to see if this is a GEM photo
$isGOTD = sp_ValidateGemPhoto($conn, $photoID);
//echo " post=".$post;
if ($post == "Yes") { // if public or an example from a photo course lesson
?>
This photo has been removed, or set to private. The website owner likely is only wants to publish it on his or her BetterPholio Website.
Either way, the photo you have requested is not set to publically display here. Return.
Sorry - the photo you have requested is not available. Return.';
}
?>
"),"|",""),"'","'")s
input = Replace(Replace(input,"",""),"","")
input = Replace(Replace(input,"http://lsqrd.blogspot.com/",""),"blogspot","")
input = Replace(Replace(input,"",""),"
","")
*/
if (empty($courseID)) { // a regular discussion
if ($inputType == "additionalComment") {
// insert discussion response
// sp_InsertDiscussionResponse memberID // The Judges 121519
$q="INSERT INTO DiscussionResponses (memberID, inputMemo, identityInfo, threadID, notifyMember) VALUES (" . $memberID . ", '" . $input . "', '" . $identityInfo . "', " . $threadID . ", '" . $notifyMemberInTheFuture . "')";
$dataI = mysqli_query($conn, $q);
} else {
// insert discussion
$q="INSERT INTO Discussions (memberID, topic, inputMemo, identityInfo, hasPhotos, notifyMember, dateModified) VALUES (" . $memberID . ", '" . $topic . "', '" . $input . "', '" . $identityInfo . "', 'Yes', '" . $notifyMemberInTheFuture . "', '" . date('Y-m-d H:i:s') . "')";
$dataI = mysqli_query($conn, $q);
}
// Now get the threadID or inputID for the item just inserted, used to stamp photos
if ($inputType == "additionalComment") {
$SQLTHREADID="SELECT threadID FROM DiscussionResponses ORDER BY inputID DESC LIMIT 1";
} else {
$SQLTHREADID="SELECT MAX(threadID) AS threadID FROM Discussions";
}
if ($dataD = mysqli_query($conn, $SQLTHREADID)) {
while($tid = mysqli_fetch_assoc($dataD)) {
$newThreadInputID = $tid['threadID'];
}
}
// if this photo is getting a 1st comment, stamp photo with threadID and put this discussion into NEW DISCS cat
if (!empty($photoID) && $inputType == "comment") {
$SQLUPDATEPHOTO ="UPDATE Photos SET discussThreadID = " . $newThreadInputID . " WHERE photoID = " . $photoID;
$dataU = mysqli_query($conn, $SQLUPDATEPHOTO);
$q1="INSERT INTO DiscCatsCross (catID, threadID) VALUES (100, " . $newThreadInputID . ")";
$dataInA = mysqli_query($conn, $q1);
}
// if an answer was inserted, stamp discuss thread with current date for dateModified and put disc into NEW RESPONSES cat
$prevdiscCat = "";
// it's a comment not a start of a new discussion
if ($inputType == "additionalComment") {
$SQLUPDATEQ="UPDATE Discussions SET dateModified = '" . date('Y-m-d H:i:s') . "' WHERE threadID = " . $threadID;
$dataU = mysqli_query($conn, $SQLUPDATEQ);
// check if this thread has been categorized
$q="SELECT catID FROM DiscCatsCross WHERE threadID = " . $threadID . "";
// if there is one, this thread has a cat so update it
$dataU2 = mysqli_query($conn, $q);
$tCountInCat = mysqli_num_rows($dataU2);
// it has already been catted
if ($tCountInCat > 0){
while($cid = mysqli_fetch_assoc($dataU2)) {
$prevdiscCat = $cid['catID'];
}
// if it's previous cat is NEW DISC, make it NEW RESPONSE now
if ($prevdiscCat == 100) {
$q8="UPDATE DiscCatsCross SET catID=101 WHERE (threadID=" . $threadID . " AND catID=100)";
$dataIn8 = mysqli_query($conn, $q8);
} elseif ($prevdiscCat == 101) {
// $q9="UPDATE DiscCatsCross SET catID=101 WHERE (threadID=" . $threadID . " AND catID=101)";
// $dataIn8 = mysqli_query($conn, $q9);
// it's already in 101 so maybe put it to a AdminCat Queue
$q1="INSERT INTO DiscCatsCross (catID, threadID) VALUES (112, " . $threadID . ")";
$dataInA = mysqli_query($conn, $q1);
}
} else {
$q1="INSERT INTO DiscCatsCross (catID, threadID) VALUES (101, " . $threadID . ")";
$dataInA = mysqli_query($conn, $q1);
}
}
/*
103 How Did U?;
104 Digital Tech
102 Friendly Praise
111 Before and After
113 Where
114 Constructive
105 Trad Tech;
110 Trouble
115 Suggestions
116 Thoughtful Analysis
*/
//this newestThread is used for discussion categories page, to show newest image
// if it's a new thread, use new threadID to update 100 in DiscCats
$discCat = 101;
$threadID4picStamp = $threadID;
if ($inputType == "comment") {
$threadID4picStamp = $newThreadInputID;
$discCat = 100;
}
// after it's gone through 100 then 101 ... it will be put into another cat
// if it's already been categorized... get lowest cat with this threadID
$SQLpicStamp="SELECT catID FROM DiscCatsCross WHERE threadID = " . $threadID4picStamp . " ORDER BY catID LIMIT 1";
//echo "
query($q);
while ($rsMembV = $stmt->fetch_array()) {
$crewRole = $rsMembV['role'];
}
if (!empty($crewRole)) {
echo '
';
}
?>
Copyright for this photo belongs solely to .
Images may not be copied, downloaded, or used in any way without the expressed, written permission of the photographer.
Report this photo
Log in to follow or message this photographer or report this photo.
Nothing to See Here...
Photo Not Found