';
+}
?>
\ No newline at end of file
diff --git a/includes/set-prefacc.php b/includes/set-prefacc.php
index 0592145..eabe45d 100644
--- a/includes/set-prefacc.php
+++ b/includes/set-prefacc.php
@@ -1,25 +1,27 @@
prepare("UPDATE userinfo SET prefaccid = 0, prefaccname = 'No default selected' WHERE userid = ?");
- $nap->bind_param("i", $_SESSION['userid']);
- $nap->execute();
- $nap->close();
- $_SESSION['prefaccid'] = "0";
- $_SESSION['prefaccname'] = "No default selected";
- echo 'Account preference update - no preferred account selected. ';
-} else {
- $sap = $con->prepare("SELECT accid, accemail FROM gwaccounts WHERE accid = ? AND userid = ?");
- $sap->bind_param("ii", $_POST['prefaccid'], $_SESSION['userid']);
- $sap->execute();
- $result = $sap->get_result();
- while ($row = $result->fetch_assoc()) {
- $uap = $con->prepare("UPDATE userinfo SET prefaccid = ?, prefaccname = ? WHERE userid = ?");
- $uap->bind_param("isi", $_POST['prefaccid'], $row['accemail'], $_SESSION['userid']);
- $uap->execute();
- $uap->close();
- $_SESSION['prefaccid'] = $row['accid'];
- $_SESSION['prefaccname'] = $row['accemail'];
+if (isset($_SESSION['userid'])) {
+ if ($_POST['prefaccid'] == "nopref") {
+ $nap = $con->prepare("UPDATE userinfo SET prefaccid = 0, prefaccname = 'No default selected' WHERE userid = ?");
+ $nap->bind_param("i", $_SESSION['userid']);
+ $nap->execute();
+ $nap->close();
+ $_SESSION['prefaccid'] = "0";
+ $_SESSION['prefaccname'] = "No default selected";
+ echo 'Account preference update - no preferred account selected. ';
+ } else {
+ $sap = $con->prepare("SELECT accid, accemail FROM gwaccounts WHERE accid = ? AND userid = ?");
+ $sap->bind_param("ii", $_POST['prefaccid'], $_SESSION['userid']);
+ $sap->execute();
+ $result = $sap->get_result();
+ while ($row = $result->fetch_assoc()) {
+ $uap = $con->prepare("UPDATE userinfo SET prefaccid = ?, prefaccname = ? WHERE userid = ?");
+ $uap->bind_param("isi", $_POST['prefaccid'], $row['accemail'], $_SESSION['userid']);
+ $uap->execute();
+ $uap->close();
+ $_SESSION['prefaccid'] = $row['accid'];
+ $_SESSION['prefaccname'] = $row['accemail'];
+ }
+ echo 'Guild Wars preferred account updated! ';
}
- echo 'Guild Wars preferred account updated! ';
}
?>
\ No newline at end of file
diff --git a/includes/set-prefchar.php b/includes/set-prefchar.php
new file mode 100644
index 0000000..f640c5e
--- /dev/null
+++ b/includes/set-prefchar.php
@@ -0,0 +1,5 @@
+';
+}
+?>
\ No newline at end of file
diff --git a/preferences.php b/preferences.php
index 8c3a1e5..9664f27 100644
--- a/preferences.php
+++ b/preferences.php
@@ -1,7 +1,8 @@
Change e-mail or password';
// select which GW account you want to default to
@@ -32,6 +39,19 @@ while ($row = $resacc->fetch_assoc()) {
echo '
';
// select which character from your GW account you want to default to
+echo 'the session prefaccid is: ' . $_SESSION['prefaccid'] . ' ';
+echo 'the session userid is: ' .$_SESSION['userid'] . ' ';
+echo ' ';
# needed code: select charrid from table gwchars selected by accid
// update e-mail address form
@@ -62,5 +82,6 @@ echo <<
UPDPASS;
+}
include_once ('footer.php');
?>
\ No newline at end of file
diff --git a/titlemanager.php b/titlemanager.php
index 98ac47b..a21ee55 100644
--- a/titlemanager.php
+++ b/titlemanager.php
@@ -1,82 +1,79 @@
connect_errno){
- die ('Unable to connect to database [' . $db->connect_errno . ']');
-}
-if (isset($_SESSION['title'])) {
- if ($_SESSION['title'] == "repeat") {
- $_POST['title'] = "addsubtitle";
- unset($_SESSION['title']);
- } else {
- unset($_SESSION['tr']);
- }
-}
-if ($_SESSION['admin'] == 1) {
- echo ' ';
- if (isset($_POST['title'])) {
- if ($_POST['title'] == "addtitle") {
- // included file contains all the code to add a new title
- include_once ('includes/title-add.php');
- } else if ($_POST['title'] == "titlesubmit") {
- // included file contains all the code to submit a new title
- include_once ('includes/title-submit.php');
- } else if ($_POST['title'] == "modtitle") {
- // included file contains all the code to edit a title
- include_once ('includes/title-editor.php');
- } else if ($_POST['title'] == "updatetitle") {
- // this section doesn't require human interaction
- include_once ('includes/title-update.php');
- } else if ($_POST['title'] == "addsubtitle") {
- // included file contains all code to add the title ranks and points required
- include_once ('includes/titleranks-add.php');
- } else if ($_POST['title'] == "titleranksubmit") {
- // this section doesn't require human interaction
- include_once ('includes/titleranks-submit.php');
- } else if ($_POST['title'] == "modsubtitle") {
- // included file contains all code to edit a title rank
- include_once ('includes/titleranks-editor.php');
- } else if ($_POST['title'] == "updatesubtitle") {
- // this sectionupdates modified title ranks in the database, or deletes them
- include_once ('includes/titleranks-update.php');
- }
- } else {
- unset($_SESSION['tid']);
- unset($_SESSION['tr']);
- echo 'Add titles ';
- echo 'Modify titles
';
- echo 'Add or modify title ranks and points
';
- // now to view the last 5 title entries in the database
- echo 'Here is the last 15 titles entered into the database, newest entry is on top: ';
- echo '
';
- if ($ttype == "0") {
- echo 'account';
- } else if ($ttype == "1") {
- echo 'character';
+if (isset($_SESSION['userid'])){
+ if (isset($_SESSION['title'])) {
+ if ($_SESSION['title'] == "repeat") {
+ $_POST['title'] = "addsubtitle";
+ unset($_SESSION['title']);
} else {
- echo 'Anything other than a 0 or 1 means something broke!';
- include_once ('footer.php');
- exit();
+ unset($_SESSION['tr']);
+ }
+ }
+ if ($_SESSION['admin'] == 1) {
+ echo ' ';
+ if (isset($_POST['title'])) {
+ if ($_POST['title'] == "addtitle") {
+ // included file contains all the code to add a new title
+ include_once ('includes/title-add.php');
+ } else if ($_POST['title'] == "titlesubmit") {
+ // included file contains all the code to submit a new title
+ include_once ('includes/title-submit.php');
+ } else if ($_POST['title'] == "modtitle") {
+ // included file contains all the code to edit a title
+ include_once ('includes/title-editor.php');
+ } else if ($_POST['title'] == "updatetitle") {
+ // this section doesn't require human interaction
+ include_once ('includes/title-update.php');
+ } else if ($_POST['title'] == "addsubtitle") {
+ // included file contains all code to add the title ranks and points required
+ include_once ('includes/titleranks-add.php');
+ } else if ($_POST['title'] == "titleranksubmit") {
+ // this section doesn't require human interaction
+ include_once ('includes/titleranks-submit.php');
+ } else if ($_POST['title'] == "modsubtitle") {
+ // included file contains all code to edit a title rank
+ include_once ('includes/titleranks-editor.php');
+ } else if ($_POST['title'] == "updatesubtitle") {
+ // this sectionupdates modified title ranks in the database, or deletes them
+ include_once ('includes/titleranks-update.php');
+ }
+ } else {
+ unset($_SESSION['tid']);
+ unset($_SESSION['tr']);
+ echo 'Add titles ';
+ echo 'Modify titles
';
+ echo 'Add or modify title ranks and points
';
+ // now to view the last 5 title entries in the database
+ echo 'Here is the last 15 titles entered into the database, newest entry is on top: ';
+ echo '