"") { $protocol = "https://www.larryulrich.com"; } else { $protocol = "http://www.larryulrich.com"; }
$lightbox = $_COOKIE['lightbox'];
function getlist()
{ global $lightbox;
$emaillist = "";
// always extract the cookie contents into $lightboxarray
if (strlen($lightbox) > 0)
{ $lightboxarray = explode(",",$lightbox); }
else
{ $lightboxarray = array(); }
if (count($lightboxarray) > 0)
{
if (!myconnect()) { handleerror(mysql_error(), __FILE__); exit; }
$counter = 0;
$totalimages = count($lightboxarray);
if ($totalimages > 0) { $emaillist = "$totalimages images selected:\n"; }
while ($counter < $totalimages)
{
if ($lightboxarray[$counter] > 0)
{
$query = "select i.filename from pictures=i where i.imageid='".$lightboxarray[$counter]."'" ;
$res = mysql_query($query);
if (!$res) { handleerror(mysql_error(), __FILE__); exit; }
$row = mysql_fetch_row($res);
$imageid = strtoupper($row[0]); // actually the image name
// $photographer = trim($row[2]);
// $caption = $row[1];
$caption = preg_replace("/\r\n|\n\r|\n|\r/", "", $caption); // strip out carriage returns , just in case
// $emaillist .= "$row[2]: $imageid --".strip_tags(str_replace("
",", ",str_replace("
",", ",$caption)))."\n\n ";
// $emaillist .= "$photographer: $imageid \r\n";
$emaillist .= "$imageid \r\n";
}
$counter ++;
}
}
return($emaillist);
}
function markselected($filename)
{ global $uid;
$query = "select imageid from pictures where filename = '$filename'";
$res = 0;
runquery($query, $res);
$row = mysql_fetch_row($res);
$query = "update privatelist set selected='1' where uid='$uid' and imageid=$row[0]";
$res = 0;
runquery($query, $res);
}
function markhide($filename)
{ global $uid;
$query = "select imageid from pictures where filename = '$filename'";
$res = 0;
runquery($query, $res);
$row = mysql_fetch_row($res);
$query = "update privatelist set hidden='1' where uid='$uid' and imageid=$row[0]";
// if (specialip()) { die($query); }
$res = 0;
runquery($query, $res);
}
function getprivatelist()
{ global $sessionid, $imageids, $hide, $name, $email, $subject, $uid, $irequest;
$emaillist = "";
if (!myconnect()) { handleerror(mysql_error(), __FILE__); exit; }
//$query = "select uid from users where sessionid='$sessionid'" ;
$query = "select uid, fname,lname,company,email,project from users where sessionid='$sessionid'" ;
$res = 0;
runquery($query, $res);
$row = mysql_fetch_row($res);
$uid = $row[0];
$name = $row[1]." ".$row[2];
$email = $row[4];
$subject = "Selected Images for $row[3]";
$project = $row[5];
//$counter = 0;
//$emaillist = "Image list:\n";
//$query = "select p.filename from pictures=p, privatelist=l where p.imageid=l.imageid and l.uid=$uid " ;
//$res = 0;
//runquery($query, $res);
//$row = mysql_fetch_row($res);
//while ($row > "")
// {
// $filename = strtoupper($row[0]);
// $emaillist .= "$filename \r\n";
// $row = mysql_fetch_row($res);
// }
// find any occurances of both select and hide checkboxes checked at same time
//if (is_array($imageids) and is_array($hide))
if (false)
{
$result = array_intersect($imageids, $hide);
// now remove those from both lists
for ($i = 0; $i < count($result); $i++)
{
$key = array_search($result[$i], $imageids);
if ($key) { unset($imageids[$key]); } // should always be true
$key = array_search($result[$i], $hide);
if ($key) { unset($hide[$key]); } // should always be true
}
}
for ($i=0; $i < count($irequest); $i++)
{
if ($irequest[$i] > "0")
{ $emaillist .= $irequest[$i]."\r\n"; }
// else
// { $emaillist .= $imageids[$i]."\r\n"; }
// now update database to show this image as selected
// markselected($imageids[$i]); // maybe not
}
//$emaillist .= "\r\n";
//for ($i = 0; $i < count($irequest); $i++)
// {
// if ($irequest[$i] != 0)
// { $emaillist .= $irequest[$i]."\r\n"; }
// }
// if (specialip()) { die("Select count: ". count($imageids)." Hide count: ".count($hide)); }
for ($i = 0; $i < count($hide); $i++)
{
// now update database to show this image as hidden
markhide($hide[$i]);
}
// if (count($imageids) == 0) { header("Location: privateview.php?sessionid=$sessionid"); exit; }
if ($emaillist == "") { header("Location: $protocol/privateview.php?sessionid=$sessionid"); exit; }
return($emaillist);
}
$sendlist = $_REQUEST['sendlist'];
$sendprivatelist = $_REQUEST['sendprivatelist'];
// main entry point -------------------------------------------------------------------------------
insertnocacheheaders();
if (($sendlist=="yes") or ($sendprivatelist == "yes"))
{
if ($sendprivatelist == "yes") { $imagelist = getprivatelist(); $private= "Private"; }
}
pageheader("Contact Larry Ulrich Stock Photography");
if ($sendprivatelist == "yes")
{ $bgcolor = "silver"; }
else
{ $bgcolor = "#0033CC"; }
// echo("
\n");
echo("\n");
?>
|
|
|
Search Request/Feedback Form
This form gives you a way to
send information requests or feedback, via e-mail, to Larry Ulrich Stock
Photography, Inc. The more detail you can provide about what you are
looking for the better we can serve you. Please be sure to include your
e-mail address otherwise we will not be able to reply to your message.
|
|