Automatically exported from code.google.com/p/planningalerts
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

unsubscribe.php 1.4 KiB

17 anni fa
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?php
  2. require_once ("config.php");
  3. require_once ("user.php");
  4. $unsubscribe_page = new unsubscribe_page;
  5. class unsubscribe_page {
  6. //Properties
  7. var $postcode = "";
  8. var $alert_area_size = 0;
  9. //Constructor
  10. function unsubscribe_page() {
  11. $this->setup();
  12. $this->bind();
  13. }
  14. //Setup
  15. function setup (){
  16. //Grab the user
  17. if(isset($_GET['cid'])){
  18. $confirm_id = $_GET['cid'];
  19. }else{
  20. header("HTTP/1.0 404 Not Found");
  21. exit;
  22. }
  23. $user = new user();
  24. if ($user->load_from_confirm_id($confirm_id)){
  25. //Grab the postcode and area
  26. $this->postcode = $user->postcode;
  27. $this->alert_area_size = alert_size_to_meters($user->alert_area_size);
  28. //delete the user
  29. $user->delete();
  30. }else{
  31. header("HTTP/1.0 404 Not Found");
  32. exit;
  33. }
  34. }
  35. //Bind
  36. function bind() {
  37. $form_action = $_SERVER['PHP_SELF'];
  38. //smarty
  39. $smarty = new Smarty;
  40. $smarty->force_compile = true;
  41. $smarty->compile_dir = SMARTY_COMPILE_DIRECTORY;
  42. $smarty->assign("menu_item", "signup");
  43. $smarty->assign("page_title","Unsubscribed");
  44. $smarty->assign("postcode", $this->postcode);
  45. $smarty->assign("alert_area_size", $this->alert_area_size);
  46. //Render
  47. $smarty->display('unsubscribed.tpl');
  48. }
  49. }
  50. ?>