AW: Problem mit eCard
hmmm... ich habs grad mal ausprobiert und
Dein Codeschnipsel reingesetzt. Funzt aber
leider auch net. Bild findet er nicht...
Aber wenigstens wird die Meldung angezeigt,
dass die Karte verschickt wurde.
Ja, hast recht, MyBad, is son Smart-Teil.
Was könnt ich euch denn an Code noch geben?...
Die komplette php-Datei zur Detail-Seite des Bildes sieht z.B. so aus:
Vielleicht werdet ihr ja schlau draus...
<?
include("setting.php");
$db_connect = mysql_connect($db_host, $db_username, $db_password);
mysql_select_db($db_name, $db_connect) || die(mysql_error());
$sql_query = "UPDATE photo SET photo_stat_view = photo_stat_view + '1' WHERE photo_id = '$photo'";
mysql_query($sql_query) or die(mysql_error());
$sql_query = "SELECT * FROM photo WHERE photo_id = '$photo'";
$result = mysql_query($sql_query) or die(mysql_error());
$row = mysql_fetch_array($result);
$photo_id = $row[photo_id];
$photo_title = $row[photo_title];
$photo_title_mod = convert_rewrite($photo_title);
$photo_category = $row[photo_category];
$photo_desc = $row[photo_desc];
$photo_keywords = $row[photo_keywords];
$photo_date = get_formatted_date($row[photo_date]);
$photo_stat_view = $row[photo_stat_view];
$photo_stat_download = $row[photo_stat_download];
$photo_stat_ecard = $row[photo_stat_ecard];
$photo_stat_favourite = $row[photo_stat_favourite];
$i = 0;
$sql_query = "
SELECT * FROM photo_package
WHERE
package_photo = '$photo'
ORDER BY package_id ASC
";
$result = mysql_query($sql_query) or die(mysql_error());
$pack_total = mysql_num_rows($result);
$sql_query = "
SELECT * FROM photo_package
WHERE
package_photo = '$photo' AND
package_price = '0' AND
package_download = 'yes'
ORDER BY package_id ASC
";
$result = mysql_query($sql_query) or die(mysql_error());
$pack_free = mysql_num_rows($result);
if ($web_payment_method == "nosales") {
if (!$pack_free) { $photo_options = "no"; }
else {
$photo_options = "yes";
$sql_query = "
SELECT * FROM photo_package
WHERE
package_photo = '$photo' AND
package_price = '0' AND
package_download = 'yes'
ORDER BY package_id ASC
";
}
}
else {
if (!$pack_total) { $photo_options = "no"; }
else {
$photo_options = "yes";
$sql_query = "
SELECT * FROM photo_package
WHERE
package_photo = '$photo'
ORDER BY package_id ASC
";
}
}
$result = mysql_query($sql_query) or die(mysql_error());
while ($row = mysql_fetch_array($result)) {
$pack_total++;
$package_id = $row[package_id];
$package_name = $row[package_name];
$package_price = $row[package_price];
$package_price_format = $currency_symbol . " " .number_format($row[package_price], 2 ,$web_decimal_separator, $web_thousand_separator);
$package_width = $row[package_width];
$package_height = $row[package_height];
$package_qty = $row[package_qty];
$package_download = ucfirst($row[package_download]);
$package_file = $row[package_file];
$package_addurl = "system_cart_add.php?photo=$photo&package=$package_id";
if ($package_price == 0){
$package_price_format = "FREE";
$package_addurl = "photo_download.php?download=$package_id";
}
if ($i % 2 == 1) { $package_color = "F8F8F8"; }
else { $package_color = "FFFFFF"; }
$arr_pack_id[$i] = $package_id;
$arr_pack_name[$i] = $package_name;
$arr_pack_price[$i] = $package_price_format;
$arr_pack_width[$i] = $package_width;
$arr_pack_height[$i] = $package_height;
$arr_pack_qty[$i] = $package_qty;
$arr_pack_download[$i] = $package_download;
$arr_pack_color[$i] = $package_color;
$arr_pack_addurl[$i] = $package_addurl;
$i++;
}
mysql_close($db_connect);
$total_photo_keywords = 0;
$tmp_photo_keywords = explode("," , $photo_keywords);
for ($i=0; $i<= sizeof($tmp_photo_keywords); $i++) {
$curr_keyword = $tmp_photo_keywords[$i];
if (strlen($curr_keyword) > 1) {
$arr_photo_keyword[$total_photo_keywords] = $curr_keyword;
$total_photo_keywords++;
}
}
$arr_photo_keyword_text = $arr_photo_keyword;
// Hier wirds wohl interessant für die eCard...
if ($status_url_rewrite == "yes") {
$photo_detail = "photolink-$photo_title_mod-$photo_id-view.php";
$photo_ecard_url = "photolink-$photo_title_mod-$photo_id-view.php";
$photo_favourite = "photofavourite-$photo_title_mod-$photo_id-add.php";
$photo_src_url = "photodetail-$photo_title_mod-$photo_id-display.jpg";
} else {
$photo_detail = "site_detail.php?photo=$photo_id";
$photo_ecard_url = "site_detail.php?photo=$photo_id";
$photo_favourite = "system_favourite_add.php?photo=$photo_id";
$photo_src_url = "photo_viewphoto.php?photo=$photo_id";
}
// prepare for the forms
$warn = 0;
if ($cecard_from_name_warn ) { $warn++; $warning_ecard_from_name = "warning"; } else { $warning_ecard_from_name = "normal_12_black"; }
if ($cecard_from_email_warn ) { $warn++; $warning_ecard_from_email = "warning"; } else { $warning_ecard_from_email = "normal_12_black"; }
if ($cecard_to_name_warn ) { $warn++; $warning_ecard_to_name = "warning"; } else { $warning_ecard_to_name = "normal_12_black"; }
if ($cecard_to_email_warn ) { $warn++; $warning_ecard_to_email = "warning"; } else { $warning_ecard_to_email = "normal_12_black"; }
if ($cecard_message_warn ) { $warn++; $warning_ecard_message = "warning"; } else { $warning_ecard_message = "normal_12_black"; }
if ($csuccess ) {
$_SESSION["csuccess"] = "";
$success = "yes";
}
$smarty->assign("warning_ecard_from_name" , $warning_ecard_from_name );
$smarty->assign("warning_ecard_from_email" , $warning_ecard_from_email );
$smarty->assign("warning_ecard_to_name" , $warning_ecard_to_name );
$smarty->assign("warning_ecard_to_email" , $warning_ecard_to_email );
$smarty->assign("warning_ecard_message" , $warning_ecard_message );
$smarty->assign("warning_message" , $warn );
$smarty->assign("warning_success" , $success );
$smarty->assign("cecard_from_name" , $cecard_from_name );
$smarty->assign("cecard_from_email" , $cecard_from_email );
$smarty->assign("cecard_to_name" , $cecard_to_name );
$smarty->assign("cecard_to_email" , $cecard_to_email );
$smarty->assign("cecard_message" , $cecard_message );
$smarty->assign("photo_options" , $photo_options );
$smarty->assign("photo_width" , $photo_width_photo );
$smarty->assign("photo_height" , $photo_height_photo );
$smarty->assign("photo_id" , $photo );
$smarty->assign("photo_detail" , $photo_detail );
$smarty->assign("photo_title" , $photo_title );
$smarty->assign("photo_keywords_total" , $total_photo_keywords );
$smarty->assign("photo_desc" , $photo_desc );
$smarty->assign("photo_date" , $photo_date );
$smarty->assign("photo_ecard_url" , $photo_ecard_url );
$smarty->assign("photo_favourite" , $photo_favourite );
$smarty->assign("photo_src_url" , $photo_src_url );
$smarty->assign("photo_stat_view" , $photo_stat_view );
$smarty->assign("photo_stat_download" , $photo_stat_download );
$smarty->assign("photo_stat_ecard" , $photo_stat_ecard );
$smarty->assign("photo_stat_favourite" , $photo_stat_favourite );
$smarty->assign("photo_keyword" , $arr_photo_keyword );
$smarty->assign("photo_keyword_text" , $arr_photo_keyword_text );
$smarty->assign("photo_package" , $arr_pack_id );
$smarty->assign("photo_package_id" , $arr_pack_id );
$smarty->assign("photo_package_name" , $arr_pack_name );
$smarty->assign("photo_package_price" , $arr_pack_price );
$smarty->assign("photo_package_width" , $arr_pack_width );
$smarty->assign("photo_package_height" , $arr_pack_height );
$smarty->assign("photo_package_qty" , $arr_pack_qty );
$smarty->assign("photo_package_download" , $arr_pack_download );
$smarty->assign("photo_package_color" , $arr_pack_color );
$smarty->assign("photo_package_addurl" , $arr_pack_addurl );
$smarty->display('site_detail.html');
/*
print $photo_options;
print $web_payment_method . "+" . $pack_free . "+ $pack_total";
*/
?>