assign("next_page","ggcard.php"); $smarty->assign("cmd","preview"); $smarty->assign("font_name",$font_name); $smarty->assign("imagefile",$imagefile); $smarty->assign("pu",$pu); $smarty->assign("name",$name); $smarty->assign("email",$email); $smarty->assign("recipient",$recipient); if ($pu != "") { $smarty->assign("image_url","popcard.image.php?font_name=$font_name&pu=$pu&postcard_text=$postcard_text"); } else { $smarty->assign("image_url","popcard.image.php?font_name=$font_name&imagefile=$imagefile&postcard_text=$postcard_text"); } $smarty->display('popc.02.tpl'); break; case preview: $smarty = new Smarty_PopCard; $smarty->assign("next_page","ggcard.php"); $smarty->assign("cmd","send"); $smarty->assign("font_name",$font_name); $smarty->assign("imagefile",$imagefile); $smarty->assign("send_text",$send_text); $smarty->assign("card_text",$card_text); $smarty->assign("pu",$pu); $smarty->assign("name",$name); $smarty->assign("email",$email); $smarty->assign("recipient",$recipient); if ($action && (!$email || !$recipient || !$name || !popc_email_check($recipient) || !popc_email_check($email))) { $smarty->assign("checked",false); } else { $smarty->assign("checked",true); } if ($pu != "") { $smarty->assign("image_url","popcard.image.php?font_name=$font_name&pu=$pu&postcard_text=".urlencode($card_text)); } else { $smarty->assign("image_url","popcard.image.php?font_name=$font_name&imagefile=$imagefile&postcard_text=".urlencode($card_text)); } $smarty->display('popc.03.tpl'); break; case send: ## If there is a recipient and sender e-mail address if ($recipient && $email && popc_email_check($email) && popc_email_check($email)) { ## Create the image and encode it as a base 64 text stream $imagedata = popc_output_image($font_name,$imagefile,$card_text,$cfg['quality'],$respath,"BASE64"); ## Send the email popc_sendemail(); $smarty = new Smarty_PopCard; $smarty->assign("font_name",$font_name); $smarty->assign("imagefile",$imagefile); $smarty->assign("pu",$pu); $smarty->assign("name",$name); $smarty->assign("email",$email); $smarty->assign("recipient",$recipient); if ($pu != "") { $smarty->assign("image_url","popcard.image.php?font_name=$font_name&pu=$pu&postcard_text=".urlencode($card_text)); } else { $smarty->assign("image_url","popcard.image.php?font_name=$font_name&imagefile=$imagefile&postcard_text=".urlencode($card_text)); } $smarty->display('popc.04.tpl'); } break; default: $smarty = new Smarty_PopCard; $smarty->assign("next_page","ggcard.php"); $smarty->assign("cmd","edit"); $smarty->display('popc.01.tpl'); break; } ?>