Morbius
13th of November 2002 (Wed), 11:53
I'm new here and to this program. I have 2 simple questions, but first, I really like this PHP app, great coding. :)
If these have been asked already then I apologize ahead of time.
1) If I wanted to use just one payment method (ie PayPal) is there a way to bypass the Select Ordering Method all together and just go to the paypal form?
2) Any idea when the final version will be ready for sale ($35 I read somewhere).
I know PHP fairly well so don't be afraid to spit out code to me. I just don't really have the time to dissect the code at this moment.
Thanks a bunch,
-George
Pekka
13th of November 2002 (Wed), 12:34
Morbius wrote:
2) Any idea when the final version will be ready for sale ($35 I read somewhere).
I try to get 1.3 ready in a week, because in the end of next week I'll have 10-day tour in england and that would delay release unneccesarily. Most of it is ready in code - the rest is lots of typing.
1) If I wanted to use just one payment method (ie PayPal) is there a way to bypass the Select Ordering Method all together and just go to the paypal form?
I know PHP fairly well so don't be afraid to spit out code to me. I just don't really have the time to dissect the code at this moment.
There is no easy way.
the new code goes between
$isforsale = mysql_num_rows($fetch_ee_commerce_template_usage);
if ($isforsale != "0") {
and its
}
Basically you must copy order php's middle into photo.php, insert template and data includes as text, remove fetchsettings includes and html top page code from order code, remove template selection dropdown and its text, replace latter query basics with "mysql_data_seek($basics,0);" and force a fixed template id.
Here's the insertion code for paypal template version 2, I did in 5 minutes to test theory above, it is untested but seems to work. Note that there may be changes in release version which can make this code die.
The code can look like a mess in the forum page, just copy and paste it to correct position on page.
I'll code an easy way to do this in future EE, so that when one template is selected you can choose to display the template on photo page.
if (isset ($HTTP_POST_VARS['template'])) {
$template = $HTTP_POST_VARS['template'];
}
if (!isset($template)) {
$template = "0";
}
if (!isset ($exhibition)) {
print "E: No commerce data specified, can not proceed. {$nogood}"; exit();
}
if (!isset ($photo)) {
print "P: No commerce data specified, can not proceed. {$nogood}"; exit();
}
$fetch_security = mysql_query(
"
SELECT DISTINCT
ee_exhibition.ee_exhibition_id,
ee_exhibition.ee_exhibition_pass,
ee_photo.ee_photo_id
FROM
ee_exhibition,
ee_photo,
ee_photo_to_exhibition
WHERE
ee_exhibition.ee_exhibition_id = '$exhibition'
AND ee_exhibition.ee_exhibition_pass = '$pass'
AND ee_photo.ee_photo_id = ee_photo_to_exhibition.ee_photo_id
AND ee_photo.ee_photo_id = '$photo'
AND ee_photo.ee_photo_for_www = 'yes'
"
);
if (!$fetch_security) {
echo("Error in performing query for fetch_security: " .
mysql_error() .
"");
exit();
}
if (mysql_num_rows($fetch_security)=="0") {
print "SECURITY INFO: INCORRECT PHOTO ID {$nogood}"; exit();
}
// 3rd level security:
while ($checkdata = mysql_fetch_array($fetch_security)) {
$checkexhib = $checkdata["ee_exhibition_id"];
if ($exhibition != $checkdata["ee_exhibition_id"]) {
print "S: INCORRECT EXHIBITION ID {$nogood}"; exit();
}
$checkphoto = $checkdata["ee_photo_id"];
if ($photo != $checkdata["ee_photo_id"]) {
print "S: INCORRECT PHOTO ID {$nogood}"; exit();
}
$checkpass = $checkdata["ee_exhibition_pass"];
if ($pass != $checkdata["ee_exhibition_pass"]) {
print "S: INCORRECT PASSWORD {$nogood}"; exit();
}
}
$fetch_ee_commerce_template_usage = mysql_query(
"
SELECT DISTINCT
ee_photo_to_ee_commerce_template_id
FROM
ee_photo_to_ee_commerce_template,
ee_photo,
ee_commerce_template
WHERE
ee_photo.ee_photo_id = ee_photo_to_ee_commerce_template.ee_photo_id
AND ee_commerce_template.ee_commerce_template_id = ee_photo_to_ee_commerce_template.ee_commerce_templ ate_id
AND ee_photo.ee_photo_id = '$photo'
"
);
if (!$fetch_ee_commerce_template_usage) {
echo("Error in performing query for fetch_ee_commerce_template_usage: " .
mysql_error() .
"");
exit();
}
$isforsale = mysql_num_rows($fetch_ee_commerce_template_usage);
if ($isforsale == "0") {
print "NFS: INCORRECT PASSWORD {$nogood}"; exit();
}
// now use id and exhibition to get file, imagelink, header, owner, thumblink
mysql_data_seek($basics,0);
while
( $xyz = mysql_fetch_array($basics) )
{
$ownername = ee_stripslashes($xyz["ee_owner_name"]);
$owner = $xyz["ee_owner_id"];
$ownerhome = ee_stripslashes($xyz["ownerlocation"]) . ", " . ee_stripslashes($xyz["ownercountry"]);
$header = ee_stripslashes($xyz["ee_photo_header"]);
$shooting_date = $xyz["ee_photo_exif_date"];
$text = $xyz["ee_photo_text"];
$microthumbpath = ee_stripslashes($xyz["ee_microthumb_path_url"]);
$thumbpath = ee_stripslashes($xyz["ee_thumb_path_url"]);
$lens = ee_stripslashes($xyz["ee_lens_displayname"]);
$lens_id = $xyz["ee_lens_id"];
$zoom = $xyz["ee_photo_exif_zoom"];
$focus = $xyz["ee_photo_exif_focus"];
$iso = $xyz["ee_photo_exif_iso"];
$ev = $xyz["ee_photo_exif_ev"];
$flash = $xyz["ee_photo_exif_flash"];
$shutter = $xyz["ee_photo_exif_shutter"];
$mode = $xyz["ee_photo_exif_mode"];
$metering = $xyz['ee_photo_exif_metering'];
$shutterunit = $xyz["ee_photo_shutter_unit"];
$aperture = $xyz["ee_photo_exif_aperture"];
$country = $xyz["ee_country_name"];
$city = ee_stripslashes($xyz["ee_location_name"]);
$show = $xyz["ee_photo_for_www"];
$file = ee_stripslashes($xyz["ee_photo_filename"]);
$orientation = $xyz["ee_photo_orientation"];
$hor = $xyz["ee_photo_size_x"];
$ver = $xyz["ee_photo_size_y"];
$light = $xyz["ee_light_description"];
$id = $xyz["ee_photo_id"];
$camera = ee_stripslashes($xyz["ee_camera_displayname"]);
$camera_id = ee_stripslashes($xyz["ee_camera_id"]);
$retouch = ee_stripslashes($xyz["ee_photo_retouch"]);
$darkroom = ee_stripslashes($xyz["ee_photo_darkroom"]);
$workflow = $xyz["ee_workflow_id"];
$workflow_header = $xyz["ee_workflow_name"];
$support = $xyz["ee_photo_camerasupport"];
$counter_id = $xyz["ee_counter_id"];
$multiplier = $xyz["ee_camera_focal_multiplier"];
$showdetail = $xyz["ee_photo_showdetail"];
$alt = "Photo by $ownername. ";
$indexlink = " " . $s_indexlink . "";
$photo_meta_keywords = ee_stripslashes($xyz["ee_photo_meta_keywords"]);
$photo_showcountry = $xyz["ee_photo_showcountry"];
}
fixedpath($thumbpath,$file);
$thumbpath = $url;
$photographer = $ownername;
$used_sizes = mysql_query(
"
SELECT
ee_photo_to_ee_commerce_template.ee_size_id
FROM
ee_photo_to_ee_commerce_template,
ee_size
WHERE
ee_size.ee_size_id = ee_photo_to_ee_commerce_template.ee_size_id
AND ee_photo_to_ee_commerce_template.ee_photo_id = '$photo'
AND ee_photo_to_ee_commerce_template.ee_commerce_templ ate_id = '$template'
"
);
if (!$used_sizes) {
$queryname = "used_sizes";
include($toroot . "db_error.php");
}
$used_size = "";
while
($row = mysql_fetch_array($used_sizes)) {
$used_size = $row["ee_size_id"];
}
//print "photo: " . $photo . "";
//print "template: " . $template . "";
//print "used size: " . $used_size . "";
//print "thumb: " . $thumbpath . "";
//print "url: " . $url . "";
$get_commerce_path = mysql_query(
"
SELECT
ee_size_url
FROM
ee_size
WHERE
ee_size.ee_size_id = '$used_size'
"
);
if (!$get_commerce_path) {
$queryname = "get_commerce_path";
include($toroot . "db_error.php");
}
$commerce_path = "";
while
($row = mysql_fetch_array($get_commerce_path)) {
$commerce_path = $row["ee_size_url"];
}
$x = "";
$y = "";
fixedpath($commerce_path,$file);
$goodlink = $url;
$retriesleft = "0";
$errorlink = "";
checkthumb(0);
//print "photo: " . $photo . "";
//print "template: " . $template . "";
//print "used size: " . $used_size . "";
//print "thumb: " . $thumbpath . "";
//print "url: " . $url . "";
if ($goodlink != "") {
$dimensions = getimagesize($goodlink);
$x = $dimensions[0];
$y = $dimensions[1];
}
$image = "";
print "";
print "Order '" . @ee_stripslashes($header) . "'";
print "";
//print "Select ordering method:";
$fetchtemplates = mysql_query(
"
SELECT
ee_commerce_template.ee_commerce_template_id,
ee_commerce_template.ee_commerce_template_name,
ee_commerce_template.ee_commerce_template_path,
ee_commerce_template.ee_commerce_template_comment
FROM
ee_commerce_template,
ee_photo_to_ee_commerce_template
WHERE
ee_commerce_template.ee_commerce_template_id = ee_photo_to_ee_commerce_template.ee_commerce_templ ate_id
AND ee_photo_to_ee_commerce_template.ee_photo_id = '$photo'
ORDER by
ee_commerce_template_id
"
);
if (!$fetchtemplates) {
$queryname = "fetchtemplates";
include($toroot . "db_error.php");
}
unset($varlist);
$varlist = array();
array_push($varlist, $sortby_off, $sort_row, $order, $search_row, $keyword, $category, $select_output, $offset, $pass, $size, $exhibition, $perpage, $revealforms);
$varlist = rawurlencode(serialize($varlist));
?>
1. Select paper size:
Morbius
13th of November 2002 (Wed), 12:51
WOW! Thank you much for your very quick reply. I will try the code out as soon as I can.
I look forward to the final release (hope this code will work with it :) ).
railer
19th of December 2002 (Thu), 13:27
Greetings and Happy Holidays!
Where is EE Commerce? I don't see any reference to it on the EE pages except here in this forum.
-------
Ooops! I just found the link to the 1.3 Release Candidate http://photography-on-the.net/forum/showthread.php?t=5552#25527, which includes EE Commerce. Excellent!
Railer
vBulletin® v3.6.12, Copyright ©2000-2012, Jelsoft Enterprises Ltd.