$page = $_GET['p']; if (is_file($include = $plugin->coderoot . $page . '.php')) { require $include; } else { FileNotFound(); } } else { FileNotFound(); } } elseif (isset($_GET['p']) && preg_match("/(\\w+)/", $_GET['p'], $regs)) { if ($id) { switch ($_GET['p']) { case 'subscribe': $success = (require 'admin/subscribelib2.php'); if ($success != 2) { print SubscribePage($id); } break; case 'asubscribe': ## subscribe with Ajax $_POST['subscribe'] = 1; if (isset($_GET['email']) && !isset($_POST['email'])) { $_POST['email'] = $_GET['email']; } foreach (explode(',', $GLOBALS['pagedata']['lists']) as $listid) { $_POST['list'][$listid] = 'signup'; } $_POST['htmlemail'] = 1; ## @@ should actually be taken from the subscribe page data $success = (require 'admin/subscribelib2.php'); $result = ob_get_contents();
function selectPage($id) { if (!$id) { return '<!-- no subscribe page defined -->'; } $html = ''; # if (preg_match("/(\w+)/",$_GET["p"],$regs)) { switch ($_GET["p"]) { case "preferences": if (!$_GET["id"]) { $_GET["id"] = $id; } require $this->coderoot() . "/subscribelib2.php"; $html = PreferencesPage($id, $userid); break; case "confirm": $html = ConfirmPage($id); break; case "unsubscribe": $html = UnsubscribePage($id); break; default: case "subscribe": require $this->coderoot() . "/subscribelib2.php"; $html = SubscribePage($id); break; } return $html; }