';
+ echo '(Home) (Options) ';
+ if ($_SESSION['admin'] == 1){
+ echo'(Administration) ';
+ }
+ echo '(Logout ' . $_SESSION['username'] . ') ';
}
?>
\ No newline at end of file
diff --git a/index.php b/index.php
index a1bd06d..96579d6 100644
--- a/index.php
+++ b/index.php
@@ -1,3 +1,4 @@
+
here ';
}
include_once ('footer.php');
-?>
\ No newline at end of file
+?>
From 0ab125aab210eeb13e76c3d604f7db29b502c4ad Mon Sep 17 00:00:00 2001
From: mauirixxx
Date: Sat, 4 Aug 2018 14:55:12 -1000
Subject: [PATCH 02/97] no longer needed
replaced by connect.php-sample
---
connection.php-sample | 6 ------
1 file changed, 6 deletions(-)
delete mode 100644 connection.php-sample
diff --git a/connection.php-sample b/connection.php-sample
deleted file mode 100644
index e182191..0000000
--- a/connection.php-sample
+++ /dev/null
@@ -1,6 +0,0 @@
-
From 63479f27ef26b178bff8d341df59f48c43472ca2 Mon Sep 17 00:00:00 2001
From: mauirixxx
Date: Sat, 4 Aug 2018 14:56:46 -1000
Subject: [PATCH 03/97] initial commit
everything from the includes directory
---
includes/account-registration.php | 23 +++++++++++++++++++++++
includes/title-add.php | 5 +++++
includes/title-editor.php | 28 ++++++++++++++++++++++++++++
includes/titleranks-add.php | 39 +++++++++++++++++++++++++++++++++++++++
includes/titleranks-submit.php | 13 +++++++++++++
5 files changed, 108 insertions(+)
create mode 100644 includes/account-registration.php
create mode 100644 includes/title-add.php
create mode 100644 includes/title-editor.php
create mode 100644 includes/titleranks-add.php
create mode 100644 includes/titleranks-submit.php
diff --git a/includes/account-registration.php b/includes/account-registration.php
new file mode 100644
index 0000000..5266017
--- /dev/null
+++ b/includes/account-registration.php
@@ -0,0 +1,23 @@
+
\ No newline at end of file
diff --git a/includes/title-add.php b/includes/title-add.php
new file mode 100644
index 0000000..396dbe6
--- /dev/null
+++ b/includes/title-add.php
@@ -0,0 +1,5 @@
+
Title Name
Title Type
';
+echo '
Account Character
';
+echo '
';
+?>
\ No newline at end of file
diff --git a/includes/title-editor.php b/includes/title-editor.php
new file mode 100644
index 0000000..5ceb51a
--- /dev/null
+++ b/includes/title-editor.php
@@ -0,0 +1,28 @@
+';
+echo '
';
+echo ' ';
+echo 'Return to title manager';
+?>
\ No newline at end of file
diff --git a/includes/titleranks-add.php b/includes/titleranks-add.php
new file mode 100644
index 0000000..5d2f93d
--- /dev/null
+++ b/includes/titleranks-add.php
@@ -0,0 +1,39 @@
+';
+}
+echo '';
+
+echo 'Here are the currently associated title ranks, starting with rank 1: ';
+echo '
';
+}
+$stmtview->close();
+echo 'Return to title manager';
+?>
\ No newline at end of file
diff --git a/includes/title-update.php b/includes/title-update.php
new file mode 100644
index 0000000..4773de2
--- /dev/null
+++ b/includes/title-update.php
@@ -0,0 +1,26 @@
+Please check the box to verify you want to delete: ' . $_POST['titlename'] . ' ';
+ echo '
';
+ } else if ($_POST['deltitle'] == "iamsure") {
+ // this section actually deletes the title
+ $stmtdel = $con->prepare("DELETE FROM gwtitles WHERE titlenameid = ?");
+ $stmtdel->bind_param("i", $_POST['titlenameid']);
+ $stmtdel->execute();
+ $stmtdel->close();
+ echo 'Title has been deleted, redirecting!';
+ header ("Refresh:1; url=titlemanager.php");
+ }
+} else {
+ // this section updates the title name
+ $stmtupd = $con->prepare("UPDATE gwtitles SET titlename = ?, titletype = ? WHERE titlenameid = ?");
+ $stmtupd->bind_param("sii", $_POST['titlename'], $_POST['titletype'], $_POST['titlenameid']);
+ $stmtupd->execute();
+ $stmtupd->close();
+ echo 'Title updated, redirecting!';
+ header ("Refresh:1; url=titlemanager.php");
+}
+//echo 'Return to title manager'; //this line needs to go away soon
+?>
\ No newline at end of file
diff --git a/includes/verifications.php b/includes/verifications.php
new file mode 100644
index 0000000..24f4d06
--- /dev/null
+++ b/includes/verifications.php
@@ -0,0 +1,55 @@
+= 1) {
+ echo '
This e-mail address is already registered, please click on the forgot password link. Please try again! ';
+ include_once ('footer.php');
+ exit();
+ }
+}
+
+# this function verifies that a username doesn't already exist in the database
+function validateUsername($uname) {
+ $con = mysqli_connect(DATABASE_HOST, DATABASE_USER, DATABASE_PASS, DATABASE_NAME);
+ $sqlunamecheck = "SELECT username FROM userinfo WHERE userinfo.username = '" . $uname . "'";
+ $results = mysqli_query($con, $sqlunamecheck);
+ if (mysqli_num_rows($results) >= 1) {
+ echo '
This username has already been taken, please choose another one Please try again! ';
+ include_once ('footer.php');
+ exit();
+ }
+}
+
+####################
+# verifying the username doesn't already exist in the database
+$username = mysqli_real_escape_string($con, $_POST['username']);
+validateUsername($username);
+
+####################
+# verifying the e-mail address is in a valid format
+$verifyemail = validateEmail($_POST['useremail']);
+if (empty($verifyemail)) {
+ echo '
This address: ' . $_POST['useremail'] . ' is not a valid e-mail address! Please verify and type it again. ';
+ include_once ('footer.php');
+ exit();
+}
+
+usedEmail($_POST['useremail']);
+
+####################
+# verifying passwords match each other
+
+if (($_POST['userpass1']) != ($_POST['userpass2'])) {
+ echo '
The passwords don\'t match! Please try again!';
+ include_once ('footer.php');
+ exit();
+}
+?>
\ No newline at end of file
From bac2711b0a6801bfa7a655b6a8d7c9013ab878d4 Mon Sep 17 00:00:00 2001
From: mauirixxx
Date: Sat, 4 Aug 2018 14:58:51 -1000
Subject: [PATCH 05/97] replaced old files from master branch
---
login.php | 42 +++++++++++++++++++-----------------------
logout.php | 1 -
style.css | 4 +++-
3 files changed, 22 insertions(+), 25 deletions(-)
diff --git a/login.php b/login.php
index 6ebb8d2..e6ed1f0 100644
--- a/login.php
+++ b/login.php
@@ -7,33 +7,29 @@
15));
+$password = $_POST['password'];
+
if ($con->connect_errno > 0){
die ('Unable to connect to database [' . $db->connect_errno . ']');
}
-$sqllogin = "SELECT * FROM users WHERE users.username = '$username' and passwd = '$passhash'";
-if ($result = $con->query($sqllogin)){
- $row_cnt = mysqli_num_rows($result);
- if ($row_cnt > 0){
- while ($row = $result->fetch_array()){
- $uname = $row['username'];
- $uid = $row['userid'];
- $_SESSION['username'] = $uname;
- $_SESSION['userid'] = $uid;
- }
- header("refresh:1;url=index.php");
- echo 'You have successfully logged in ... Returning to index in a few seconds
';
- } else {
- echo 'That was not a valid username or password!
Back to home page ';
+include_once ('footer.php');
+?>
\ No newline at end of file
diff --git a/titlemanager.php b/titlemanager.php
new file mode 100644
index 0000000..90d8919
--- /dev/null
+++ b/titlemanager.php
@@ -0,0 +1,70 @@
+connect_errno){
+ die ('Unable to connect to database [' . $db->connect_errno . ']');
+}
+if ($_SESSION['title'] == "repeat") {
+ $_POST['title'] = "addsubtitle";
+ unset($_SESSION['title']);
+}
+if ($_SESSION['admin'] == 1) {
+ echo ' ';
+ 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 {
+ unset($_SESSION['tid']);
+ echo 'Add titles ';
+ echo 'Modify titles
';
+ echo 'Add title ranks and points to ';
+ echo 'Edit / Delete subtitle & points (code goes here)
';
+ // now to view the last 5 title entries in the database
+ echo 'Here is the last 5 titles entered into the database, newest entry is on top: ';
+ echo '
';
echo '(Home) (Options) ';
if ($_SESSION['admin'] == 1){
echo'(Administration) ';
diff --git a/login.php b/login.php
index e6ed1f0..6c80c33 100644
--- a/login.php
+++ b/login.php
@@ -9,7 +9,9 @@
You have been logged out ... Returning to login screen in a few seconds
';
}
From b0b0e71c1f204daedd864279652926651b6c2731 Mon Sep 17 00:00:00 2001
From: mauirixxx
Date: Tue, 7 Aug 2018 09:49:54 -1000
Subject: [PATCH 25/97] more undefined index fixes
---
titlemanager.php | 56 ++++++++++++++++++++++++++++++--------------------------
1 file changed, 30 insertions(+), 26 deletions(-)
diff --git a/titlemanager.php b/titlemanager.php
index 88c8c7c..b68d55a 100644
--- a/titlemanager.php
+++ b/titlemanager.php
@@ -6,35 +6,39 @@ $con = mysqli_connect(DATABASE_HOST, DATABASE_USER, DATABASE_PASS, DATABASE_NAME
if ($con->connect_errno){
die ('Unable to connect to database [' . $db->connect_errno . ']');
}
-if ($_SESSION['title'] == "repeat") {
- $_POST['title'] = "addsubtitle";
- unset($_SESSION['title']);
-} else {
- unset($_SESSION['tr']);
+if (isset($_SESSION['title'])) {
+ if ($_SESSION['title'] == "repeat") {
+ $_POST['title'] = "addsubtitle";
+ unset($_SESSION['title']);
+ } else {
+ unset($_SESSION['tr']);
+ }
}
if ($_SESSION['admin'] == 1) {
echo ' ';
- 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');
+ 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 {
unset($_SESSION['tid']);
echo 'Add titles
';
From d0ed4b8cd885bbc211408606e744d4278a3198b8 Mon Sep 17 00:00:00 2001
From: mauirixxx
Date: Tue, 7 Aug 2018 10:38:59 -1000
Subject: [PATCH 26/97] fixed bug with pre-loading the next rank after what's
saved in the database
---
includes/title-update.php | 5 ++++-
titlemanager.php | 1 +
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/includes/title-update.php b/includes/title-update.php
index 2ef5891..e06fdd4 100644
--- a/includes/title-update.php
+++ b/includes/title-update.php
@@ -9,8 +9,11 @@ if (isset($_POST['deltitle'])) {
$stmtdel = $con->prepare("DELETE FROM gwtitles WHERE titlenameid = ?");
$stmtdel->bind_param("i", $_POST['titlenameid']);
$stmtdel->execute();
+ $stmtdelst = $con->prepare("DELETE FROM gwsubtitles WHERE titlenameid = ?");
+ $stmtdelst->bind_param("i", $_POST['titlenameid']);
+ $stmtdelst->execute();
$stmtdel->close();
- echo 'Title has been deleted, redirecting!';
+ echo 'The title and associated title ranks have been deleted, redirecting!';
header ("Refresh:1; url=titlemanager.php");
}
} else {
diff --git a/titlemanager.php b/titlemanager.php
index b68d55a..537cc6f 100644
--- a/titlemanager.php
+++ b/titlemanager.php
@@ -41,6 +41,7 @@ if ($_SESSION['admin'] == 1) {
}
} else {
unset($_SESSION['tid']);
+ unset($_SESSION['tr']);
echo 'Add titles
';
echo 'Modify titles
';
include ('includes/title-select.php');
From 4e9f4104915d6c19c6ee2de46a87d24009275658 Mon Sep 17 00:00:00 2001
From: mauirixxx
Date: Tue, 7 Aug 2018 12:49:33 -1000
Subject: [PATCH 27/97] can display select title ranks in a table now
---
includes/titleranks-editor.php | 47 ++++++++++++++----------------------------
includes/titleranks-update.php | 6 ++++++
2 files changed, 21 insertions(+), 32 deletions(-)
create mode 100644 includes/titleranks-update.php
diff --git a/includes/titleranks-editor.php b/includes/titleranks-editor.php
index 1bad404..14d793f 100644
--- a/includes/titleranks-editor.php
+++ b/includes/titleranks-editor.php
@@ -6,40 +6,23 @@ error_reporting(E_ALL);
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
# delete the above when shit finally works
-$tid = $_SESSION['tid'];
-echo 'the session tid number is: ' . $_SESSION['tid'] . ' ';
+# $tid = $_SESSION['tid'] = titlenameid from database
+# $stid = $_POST['editstitle'] = stnameid from database and it should return an array of numbers
-$stid = array();
-foreach ($_POST['editstitle'] as $tredit) {
- $stid[] = (int)$tredit;
-}
-$stid = implode(',', $stid);
-echo 'the value of stid is now: ' . $stid . ' ';
-$sredit = $con->prepare("SELECT * FROM gwsubtitles WHERE titlenameid = ? AND stnameid IN (?)");
-$sredit->bind_param("is", $tid, $stid);
-$sredit->execute();
-$sredit->store_result();
-$sredit->bind_result($gwtid, $gwstid);
-while ($sredit->fetch()) {
- echo 'farts ';
-}
-$sredit->free_result();
-$sredit->close();
+echo '
';
// now to view the last 5 title entries in the database
- echo 'Here is the last 5 titles entered into the database, newest entry is on top: ';
+ echo 'Here is the last 15 titles entered into the database, newest entry is on top: ';
echo '
titleid
titlename
titletype
titletype
';
- $stmtview = $con->prepare("SELECT * FROM gwtitles ORDER BY titlenameid DESC LIMIT 5");
+ $stmtview = $con->prepare("SELECT * FROM gwtitles ORDER BY titlenameid DESC LIMIT 15");
$stmtview->execute();
$result = $stmtview->get_result();
while ($row = $result->fetch_assoc()) {
From 95034c50100c5098c5700e9151a42186f2795908 Mon Sep 17 00:00:00 2001
From: mauirixxx
Date: Tue, 7 Aug 2018 15:09:37 -1000
Subject: [PATCH 29/97] not sure what I fixed/changed here
---
titlemanager.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/titlemanager.php b/titlemanager.php
index e9c444c..98ac47b 100644
--- a/titlemanager.php
+++ b/titlemanager.php
@@ -49,7 +49,7 @@ if ($_SESSION['admin'] == 1) {
echo 'Modify titles
';
From 69db1aa93c53e04ad00762e85a831fa5047904c1 Mon Sep 17 00:00:00 2001
From: mauirixxx
Date: Tue, 7 Aug 2018 16:10:16 -1000
Subject: [PATCH 32/97] can now delete selected title ranks
---
includes/titleranks-editor.php | 4 ++--
includes/titleranks-update.php | 28 +++++++++++++++-------------
2 files changed, 17 insertions(+), 15 deletions(-)
diff --git a/includes/titleranks-editor.php b/includes/titleranks-editor.php
index 469c6bd..c1ba101 100644
--- a/includes/titleranks-editor.php
+++ b/includes/titleranks-editor.php
@@ -6,7 +6,7 @@ error_reporting(E_ALL);
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
# delete the above when shit finally works
-echo '
stnameid
titlenameid
stname
stpoints
strank
'; //save this line!!!
+echo '
stnameid
titlenameid
stname
stpoints
strank
Delete?
';
$ph = implode(",", $_POST['editstitle']);
$sredit = $con->prepare("SELECT * FROM gwsubtitles WHERE titlenameid = ? AND stnameid IN ($ph)");
$sredit->bind_param("i", $_SESSION['tid']);
@@ -15,7 +15,7 @@ $result = $sredit->get_result();
while ($row = $result->fetch_assoc()) {
echo '
';
echo '
';
- echo '
';
+ echo '
';
}
echo '
';
echo '
';
diff --git a/includes/titleranks-update.php b/includes/titleranks-update.php
index 5dd6d7a..5871e93 100644
--- a/includes/titleranks-update.php
+++ b/includes/titleranks-update.php
@@ -7,20 +7,22 @@ mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
# delete the above when shit finally works
if (isset($_POST['delsubtitle'])) {
- if ($_POST['delsubtitle'] =="yes") {
- // this title makes you verify that you want to delete this title
- echo '
Please check the box to verify you want to delete: ' . $_POST['titlename'] . ' ';
- echo '
';
- } else if ($_POST['delsubtitle'] == "iamsure") {
- // this section actually deletes the title rank(s)
- # need to deal with array data eventually
- $stmtdel = $con->prepare("DELETE FROM gwsubtitles WHERE titlenameid = ?");
- $stmtdel->bind_param("i", $_POST['titlenameid']);
- $stmtdel->execute();
- $stmtdel->close();
- echo 'Title rank(s) have been deleted, redirecting!';
- header ("Refresh:1; url=titlemanager.php");
+ echo 'the post delsubtitle might be an array?? ';
+ echo '
';
+ if ($delst = $con->prepare("DELETE FROM gwsubtitles WHERE titlenameid = ? AND stnameid = ?")) {
+ $delst->bind_param("ii", $tnameid, $stnameid);
+ for ($i = 0; $i < count($_POST['delsubtitle']); $i++) {
+ $tnameid = $_POST['titlenameid'][$i];
+ $stnameid = $_POST['delsubtitle'][$i];
+ $delst->execute();
+ }
+ $delst->close();
}
+ echo 'Title rank(s) have been deleted, redirecting!';
+ //header ("Refresh:1; url=titlemanager.php");
} else {
// this section updates the title name
if ($upd = $con->prepare("UPDATE gwsubtitles SET stname = ?, stpoints = ?, strank = ? WHERE titlenameid = ? AND stnameid = ?")) {
From 632c21f96d3d20c93d5a7b2df812daecd1a3972a Mon Sep 17 00:00:00 2001
From: mauirixxx
Date: Tue, 7 Aug 2018 16:26:36 -1000
Subject: [PATCH 33/97] fixed clicking on edit title ranks with no title ranks
actually selected
---
includes/titleranks-editor.php | 31 ++++++++++++++++++-------------
1 file changed, 18 insertions(+), 13 deletions(-)
diff --git a/includes/titleranks-editor.php b/includes/titleranks-editor.php
index c1ba101..9dbb0c3 100644
--- a/includes/titleranks-editor.php
+++ b/includes/titleranks-editor.php
@@ -6,18 +6,23 @@ error_reporting(E_ALL);
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
# delete the above when shit finally works
-echo '
stnameid
titlenameid
stname
stpoints
strank
Delete?
';
-$ph = implode(",", $_POST['editstitle']);
-$sredit = $con->prepare("SELECT * FROM gwsubtitles WHERE titlenameid = ? AND stnameid IN ($ph)");
-$sredit->bind_param("i", $_SESSION['tid']);
-$sredit->execute();
-$result = $sredit->get_result();
-while ($row = $result->fetch_assoc()) {
- echo '
';
- echo '
';
- echo '
';
+if (isset($_POST['editstitle'])) {
+ echo '
stnameid
titlenameid
stname
stpoints
strank
Delete?
';
+ $ph = implode(",", $_POST['editstitle']);
+ $sredit = $con->prepare("SELECT * FROM gwsubtitles WHERE titlenameid = ? AND stnameid IN ($ph)");
+ $sredit->bind_param("i", $_SESSION['tid']);
+ $sredit->execute();
+ $result = $sredit->get_result();
+ while ($row = $result->fetch_assoc()) {
+ echo '
';
+ echo '
';
+ echo '
';
+ }
+ echo '
';
+ echo '
';
+ echo 'Return to title manager';
+} else {
+ echo 'No title ranks selected! Please press the back button on your browser to return to the previous page.
';
-echo 'Return to title manager';
?>
\ No newline at end of file
From e702d0030347f180daae1fcab83d30b2f2dc571a Mon Sep 17 00:00:00 2001
From: mauirixxx
Date: Tue, 7 Aug 2018 23:47:02 -1000
Subject: [PATCH 34/97] enforced max in game title rank
---
includes/titleranks-add.php | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/includes/titleranks-add.php b/includes/titleranks-add.php
index 6ccef1e..dc6e0fb 100644
--- a/includes/titleranks-add.php
+++ b/includes/titleranks-add.php
@@ -40,13 +40,18 @@ $stmtname->store_result();
$stmtname->bind_result($gwtn, $gwtmr);
while ($stmtname->fetch()) {
echo 'Adding rank to title ' . $gwtn . ' The maximum rank achievable in game is ' . $gwtmr . ' ';
+ if ($tr > $gwtmr) {
+ echo ' No more ranks can be added!
';
+
echo 'Here are the currently associated title ranks, starting with rank 1: ';
echo '
stnameid
titlenameid
stname
stpoints
strank
Edit
';
From b5259d7e0896d0ddd8d18d5cc1c8330685759a5e Mon Sep 17 00:00:00 2001
From: mauirixxx
Date: Tue, 7 Aug 2018 23:51:05 -1000
Subject: [PATCH 35/97] internal formatting
---
includes/titleranks-add.php | 2 --
1 file changed, 2 deletions(-)
diff --git a/includes/titleranks-add.php b/includes/titleranks-add.php
index dc6e0fb..1f24f7c 100644
--- a/includes/titleranks-add.php
+++ b/includes/titleranks-add.php
@@ -51,8 +51,6 @@ while ($stmtname->fetch()) {
$stmtname->free_result();
$stmtname->close();
-
-
echo 'Here are the currently associated title ranks, starting with rank 1: ';
echo '
stnameid
titlenameid
stname
stpoints
strank
Edit
';
$stmtview = $con->prepare("SELECT * FROM gwsubtitles WHERE titlenameid = ? ORDER BY strank ASC");
From 6378bbf3f5ba5f72971a88919e8a9bffc9c635d6 Mon Sep 17 00:00:00 2001
From: mauirixxx
Date: Wed, 8 Aug 2018 00:13:11 -1000
Subject: [PATCH 36/97] formatting fun
---
includes/titleranks-add.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/includes/titleranks-add.php b/includes/titleranks-add.php
index 1f24f7c..8df1c6d 100644
--- a/includes/titleranks-add.php
+++ b/includes/titleranks-add.php
@@ -45,7 +45,7 @@ while ($stmtname->fetch()) {
} else {
echo '
Title Rank Name
Title Points
Rank Level
';
echo '
';
- echo '
';
+ echo '
';
}
}
$stmtname->free_result();
From 53779bfda40614800d303bc30817ee235e6d2ba2 Mon Sep 17 00:00:00 2001
From: mauirixxx
Date: Wed, 8 Aug 2018 09:41:43 -1000
Subject: [PATCH 37/97] added html options for better usability
---
header.php | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/header.php b/header.php
index 7a6b1c0..50d5556 100644
--- a/header.php
+++ b/header.php
@@ -1,6 +1,6 @@
-
-
+
+
connect_errno){
}
if (!$userid){
echo 'Please login first
Aloha, and welcome to my Guild Wars stats tracker. Please login below.';
- echo '
Username:
';
- echo '
Password:
';
+ echo '
Username:
';
+ echo '
Password:
';
echo '
';
echo 'If you haven\'t registered an account yet, please click here to create one. ';
} else {
From 65bd1f014f726b08d34d3c8c8426e7f4317acb4b Mon Sep 17 00:00:00 2001
From: mauirixxx
Date: Wed, 8 Aug 2018 09:45:04 -1000
Subject: [PATCH 38/97] starting account options page
---
preferences.php | 6 ++++++
1 file changed, 6 insertions(+)
create mode 100644 preferences.php
diff --git a/preferences.php b/preferences.php
new file mode 100644
index 0000000..2e8cd80
--- /dev/null
+++ b/preferences.php
@@ -0,0 +1,6 @@
+Change e-mail and / or password
';
+include_once ('footer.php');
+?>
\ No newline at end of file
From 2e97d3219ba4db6750b7e2da2e84630216625d52 Mon Sep 17 00:00:00 2001
From: mauirixxx
Date: Wed, 8 Aug 2018 10:24:20 -1000
Subject: [PATCH 39/97] fixed undefined variable log spam
---
register.php | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/register.php b/register.php
index cfa4b50..48196a4 100644
--- a/register.php
+++ b/register.php
@@ -3,14 +3,16 @@
connect_errno){
die ('Unable to connect to database [' . $db->connect_errno . ']');
}
-if (is_null($newuser)){
+if (empty($_POST['reguser'])){
// this block contains the code to fill out the form
echo '
';
include_once ('includes/account-registration.php');
From ac2e8a7ab1b7a238693cccd4c7930b793c9fb111 Mon Sep 17 00:00:00 2001
From: mauirixxx
Date: Wed, 8 Aug 2018 10:29:06 -1000
Subject: [PATCH 40/97] removed a no longer needed line
---
register.php | 1 -
1 file changed, 1 deletion(-)
diff --git a/register.php b/register.php
index 48196a4..8a7d22f 100644
--- a/register.php
+++ b/register.php
@@ -7,7 +7,6 @@ if (session_status() == PHP_SESSION_NONE) {
session_start();
}
include_once ('connect.php');
-//$newuser = $_POST['reguser'];
$con = mysqli_connect(DATABASE_HOST, DATABASE_USER, DATABASE_PASS, DATABASE_NAME);
if ($con->connect_errno){
die ('Unable to connect to database [' . $db->connect_errno . ']');
From d7786f4356acd8c24a289920c143073681457d8f Mon Sep 17 00:00:00 2001
From: mauirixxx
Date: Wed, 8 Aug 2018 10:35:08 -1000
Subject: [PATCH 41/97] removed old comments
---
includes/titleranks-add.php | 5 -----
1 file changed, 5 deletions(-)
diff --git a/includes/titleranks-add.php b/includes/titleranks-add.php
index 8df1c6d..74b2e56 100644
--- a/includes/titleranks-add.php
+++ b/includes/titleranks-add.php
@@ -5,11 +5,6 @@ error_reporting(E_ALL);
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
# delete the above when shit finally works
-# use "$_POST['tid']" to show title ranks already associated with the selected title
-# and above that list put the input boxes for text and number_format
-# investigate if we can put multiple input boxes and loop through them to insert into the database
-# https://stackoverflow.com/questions/34469482/how-to-insert-multiple-inputs-into-the-database-using-the-power-of-php
-
unset($_SESSION['title']);
if (isset($_SESSION['tid'])) {
From 49f36dc8e90d150fed3764307b9bedc9311742cf Mon Sep 17 00:00:00 2001
From: mauirixxx
Date: Wed, 8 Aug 2018 10:56:34 -1000
Subject: [PATCH 42/97] working on letting a user update their email address in
the database
---
includes/update-email.php | 3 +++
preferences.php | 21 ++++++++++++++++++++-
2 files changed, 23 insertions(+), 1 deletion(-)
create mode 100644 includes/update-email.php
diff --git a/includes/update-email.php b/includes/update-email.php
new file mode 100644
index 0000000..6f8e655
--- /dev/null
+++ b/includes/update-email.php
@@ -0,0 +1,3 @@
+ ';
+?>
\ No newline at end of file
diff --git a/preferences.php b/preferences.php
index 2e8cd80..c2c6762 100644
--- a/preferences.php
+++ b/preferences.php
@@ -1,6 +1,25 @@
Change e-mail and / or password
';
+if (!empty($_POST['usermail'])) {
+ //this section contains code to update the users e-mail address, maybe via an include?
+ include_once ('includes/update-email.php');
+} else {
+ //should get rid of this whole else statement, or use it to display an error?
+ echo 'this should probably be the !empty section instead ';
+ echo 'the post usermail vaiable should be blank: ' . $_POST['usermail'] . ' <- Is there a blank spot to the left? ';
+}
+echo '
Change e-mail and / or password
';
+
+// listing all session variables currently set for debugging purposes
+echo '
';
+var_dump($_SESSION);
+echo '
';
+// delete the above 3 lines when done
+
+echo '
';
+echo '
Update e-mail address
';
+echo '
';
+echo '
';
include_once ('footer.php');
?>
\ No newline at end of file
From d03a6c2306b0adc2fc74747849142f2a3c32d190 Mon Sep 17 00:00:00 2001
From: mauirixxx
Date: Wed, 8 Aug 2018 11:33:31 -1000
Subject: [PATCH 43/97] made code sane
---
includes/verifications.php | 21 ++++++++++++---------
1 file changed, 12 insertions(+), 9 deletions(-)
diff --git a/includes/verifications.php b/includes/verifications.php
index 24f4d06..b071058 100644
--- a/includes/verifications.php
+++ b/includes/verifications.php
@@ -30,20 +30,23 @@ function validateUsername($uname) {
####################
# verifying the username doesn't already exist in the database
-$username = mysqli_real_escape_string($con, $_POST['username']);
-validateUsername($username);
+if (!empty($_POST['username'])) {
+ $username = mysqli_real_escape_string($con, $_POST['username']);
+ validateUsername($username);
+}
####################
# verifying the e-mail address is in a valid format
-$verifyemail = validateEmail($_POST['useremail']);
-if (empty($verifyemail)) {
- echo '
This address: ' . $_POST['useremail'] . ' is not a valid e-mail address! Please verify and type it again. ';
- include_once ('footer.php');
- exit();
+if (!empty($_POST['useremail'])) {
+ $verifyemail = validateEmail($_POST['useremail']);
+ if (empty($verifyemail)) {
+ echo '
This address: ' . $_POST['useremail'] . ' is not a valid e-mail address! Please verify and type it again. ';
+ include_once ('footer.php');
+ exit();
+ }
+ usedEmail($_POST['useremail']);
}
-usedEmail($_POST['useremail']);
-
####################
# verifying passwords match each other
From 7949e3f8c1933b908ad311081b8535542bc157a2 Mon Sep 17 00:00:00 2001
From: mauirixxx
Date: Wed, 8 Aug 2018 11:58:00 -1000
Subject: [PATCH 44/97] users can now change their email address
---
includes/update-email.php | 10 +++++++++-
preferences.php | 13 +++++--------
2 files changed, 14 insertions(+), 9 deletions(-)
diff --git a/includes/update-email.php b/includes/update-email.php
index 6f8e655..1a19546 100644
--- a/includes/update-email.php
+++ b/includes/update-email.php
@@ -1,3 +1,11 @@
';
+include_once ('verifications.php');
+echo 'the useremail variable is: ' . $_POST['useremail'] . ' ';
+echo 'the userid variable is: ' . $_SESSION['userid'] . ' ';
+$updmail = $con->prepare("UPDATE userinfo SET usermail = ? WHERE userid = ?");
+$updmail->bind_param("si", $_POST['useremail'], $_SESSION['userid']);
+$updmail->execute();
+$_SESSION['usermail'] = $_POST['useremail'];
+echo 'Email address updated, redirecting.';
+header ("Refresh:2; url=preferences.php");
?>
\ No newline at end of file
diff --git a/preferences.php b/preferences.php
index c2c6762..3b053c8 100644
--- a/preferences.php
+++ b/preferences.php
@@ -1,25 +1,22 @@
';
- echo 'the post usermail vaiable should be blank: ' . $_POST['usermail'] . ' <- Is there a blank spot to the left? ';
}
-echo '
Change e-mail and / or password
';
+echo '
Change e-mail and / or password
';
// listing all session variables currently set for debugging purposes
echo '
';
var_dump($_SESSION);
-echo '
';
+echo ' ';
// delete the above 3 lines when done
echo '
';
echo '
Update e-mail address
';
-echo '
';
+echo '
';
echo '
';
include_once ('footer.php');
?>
\ No newline at end of file
From 64f201c6044487bcd6ddd19a7aacdbcc2cc8bf87 Mon Sep 17 00:00:00 2001
From: mauirixxx
Date: Wed, 8 Aug 2018 12:19:26 -1000
Subject: [PATCH 45/97] added warning caption about deletions their precedence
over edits
---
includes/titleranks-editor.php | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/includes/titleranks-editor.php b/includes/titleranks-editor.php
index 9dbb0c3..8533fb5 100644
--- a/includes/titleranks-editor.php
+++ b/includes/titleranks-editor.php
@@ -7,7 +7,8 @@ mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
# delete the above when shit finally works
if (isset($_POST['editstitle'])) {
- echo '
stnameid
titlenameid
stname
stpoints
strank
Delete?
';
+ echo '
Deleting takes precedence over edits - edits will have to be remade after submission
';
+ echo '
stnameid
titlenameid
stname
stpoints
strank
Delete?
';
$ph = implode(",", $_POST['editstitle']);
$sredit = $con->prepare("SELECT * FROM gwsubtitles WHERE titlenameid = ? AND stnameid IN ($ph)");
$sredit->bind_param("i", $_SESSION['tid']);
From 15db593bdfcc68f00d8acf54475bf27a1c35a540 Mon Sep 17 00:00:00 2001
From: mauirixxx
Date: Wed, 8 Aug 2018 12:20:20 -1000
Subject: [PATCH 46/97] removed debug code
---
includes/titleranks-update.php | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/includes/titleranks-update.php b/includes/titleranks-update.php
index 5871e93..427cce6 100644
--- a/includes/titleranks-update.php
+++ b/includes/titleranks-update.php
@@ -7,11 +7,6 @@ mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
# delete the above when shit finally works
if (isset($_POST['delsubtitle'])) {
- echo 'the post delsubtitle might be an array?? ';
- echo '
The passwords don\'t match! Please try again!';
include_once ('footer.php');
exit();
}
From 3a80d80b4d9e5a7d483ad584a454756d962c794b Mon Sep 17 00:00:00 2001
From: mauirixxx
Date: Wed, 8 Aug 2018 15:22:27 -1000
Subject: [PATCH 51/97] closed connection to database server
---
includes/titleranks-editor.php | 1 +
1 file changed, 1 insertion(+)
diff --git a/includes/titleranks-editor.php b/includes/titleranks-editor.php
index 8533fb5..2af48d2 100644
--- a/includes/titleranks-editor.php
+++ b/includes/titleranks-editor.php
@@ -19,6 +19,7 @@ if (isset($_POST['editstitle'])) {
echo '
';
echo '
';
}
+ $sredit->close();
echo '
';
echo '
';
echo 'Return to title manager';
From b5e7d4e9bf75272594d29c579d784fdca4cb092b Mon Sep 17 00:00:00 2001
From: mauirixxx
Date: Wed, 8 Aug 2018 15:23:06 -1000
Subject: [PATCH 52/97] fixed wording & formatting
---
includes/update-email.php | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/includes/update-email.php b/includes/update-email.php
index eddcf2f..b3089ba 100644
--- a/includes/update-email.php
+++ b/includes/update-email.php
@@ -4,6 +4,5 @@ $updmail = $con->prepare("UPDATE userinfo SET usermail = ? WHERE userid = ?");
$updmail->bind_param("si", $_POST['useremail'], $_SESSION['userid']);
$updmail->execute();
$_SESSION['usermail'] = $_POST['useremail'];
-echo 'E-mail address updated, redirecting.';
-header ("Refresh:2; url=preferences.php");
+echo 'E-mail address updated. ';
?>
\ No newline at end of file
From ddc9359a786511a8312b917aedbef86ab39b39fe Mon Sep 17 00:00:00 2001
From: mauirixxx
Date: Wed, 8 Aug 2018 15:24:23 -1000
Subject: [PATCH 53/97] added a note to myself to delete a line later
---
preferences.php | 34 +++++++++++++++++++++++++++++++++-
1 file changed, 33 insertions(+), 1 deletion(-)
diff --git a/preferences.php b/preferences.php
index cdb9cb2..54566af 100644
--- a/preferences.php
+++ b/preferences.php
@@ -6,6 +6,14 @@ if (!empty($_POST['useremail'])) {
//this section contains code to update the users e-mail address, maybe via an include?
include_once ('includes/update-email.php');
}
+
+if (!empty($_POST['oldpass'])) {
+ echo 'if the oldpass is set, execute code here (this line will go away from preferences.php!) ';
+ include_once ('includes/update-password.php');
+} else {
+ echo 'if post oldpass is NOT set, then this else statement can go away. ';
+}
+
echo '
Change e-mail or password
';
// listing all session variables currently set for debugging purposes
@@ -14,9 +22,33 @@ var_dump($_SESSION);
echo ' ';
// delete the above 3 lines when done
+// update e-mail address form
echo '
';
echo '
Update e-mail address
';
echo '
';
-echo '
';
+echo '
';
+
+// update password form
+echo <<
+
Old Password
+
+
New password
+
+
Verify password
+
+
+
+UPDPASS;
include_once ('footer.php');
?>
\ No newline at end of file
From c036f6eba8e03100cf0d24d5ee6f4e31ef62c80a Mon Sep 17 00:00:00 2001
From: mauirixxx
Date: Wed, 8 Aug 2018 15:26:48 -1000
Subject: [PATCH 54/97] forgot to close the password form
---
preferences.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/preferences.php b/preferences.php
index 54566af..ad81fb0 100644
--- a/preferences.php
+++ b/preferences.php
@@ -48,7 +48,7 @@ echo <<
-
+
UPDPASS;
include_once ('footer.php');
?>
\ No newline at end of file
From d14d47e75d9e44c9aa10097f2c9527db8c09eec3 Mon Sep 17 00:00:00 2001
From: mauirixxx
Date: Wed, 8 Aug 2018 15:29:48 -1000
Subject: [PATCH 55/97] cleaned up preferences for production use
---
preferences.php | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/preferences.php b/preferences.php
index ad81fb0..7050a4c 100644
--- a/preferences.php
+++ b/preferences.php
@@ -3,25 +3,17 @@ $pagetitle = "Account options";
include_once ('header.php');
if (!empty($_POST['useremail'])) {
- //this section contains code to update the users e-mail address, maybe via an include?
+ //this section contains code to update the users e-mail address
include_once ('includes/update-email.php');
}
if (!empty($_POST['oldpass'])) {
- echo 'if the oldpass is set, execute code here (this line will go away from preferences.php!) ';
+ // this section contains code to update the users password after verifying the old password first
include_once ('includes/update-password.php');
-} else {
- echo 'if post oldpass is NOT set, then this else statement can go away. ';
}
echo '
Change e-mail or password
';
-// listing all session variables currently set for debugging purposes
-echo '
';
-var_dump($_SESSION);
-echo '
';
-// delete the above 3 lines when done
-
// update e-mail address form
echo '
';
echo '
Update e-mail address
';
From b12392e74b46cecd22dff1f1e372974cbb4205c8 Mon Sep 17 00:00:00 2001
From: mauirixxx
Date: Wed, 8 Aug 2018 15:31:33 -1000
Subject: [PATCH 56/97] finished code to update a users password
---
includes/update-password.php | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
create mode 100644 includes/update-password.php
diff --git a/includes/update-password.php b/includes/update-password.php
new file mode 100644
index 0000000..4ced42b
--- /dev/null
+++ b/includes/update-password.php
@@ -0,0 +1,21 @@
+prepare("SELECT userpass FROM userinfo WHERE userid = ?");
+$verifypass->bind_param("i", $_SESSION['userid']);
+$verifypass->execute();
+$result = $verifypass->get_result();
+while ($row = $result->fetch_assoc()) {
+ $vp = password_verify ($_POST['oldpass'],$row['userpass']);
+ if ($vp) {
+ $hp = password_hash($_POST['userpass1'], PASSWORD_DEFAULT);
+ echo 'Verified old password, updating to new password! ';
+ $updpass = $con->prepare("UPDATE userinfo SET userpass = ? WHERE userid = ?");
+ $updpass->bind_param("si", $hp, $_SESSION['userid']);
+ $updpass->execute();
+ echo 'Password updated! ';
+ $updpass->close();
+ } else {
+ echo 'Old password doesn\'t match, password is NOT updated! ';
+ }
+}
+?>
\ No newline at end of file
From a630342bb4eca27735dff3d60e6247353a13e492 Mon Sep 17 00:00:00 2001
From: mauirixxx
Date: Wed, 8 Aug 2018 16:00:34 -1000
Subject: [PATCH 57/97] prepping for preferred gw account, and character
associated with that account
---
preferences.php | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/preferences.php b/preferences.php
index 7050a4c..0cad550 100644
--- a/preferences.php
+++ b/preferences.php
@@ -14,6 +14,12 @@ if (!empty($_POST['oldpass'])) {
echo '
Change e-mail or password
';
+// select which GW account you want to default to
+# needed code: select accid from table gwaccounts, store it in prefacc in table userinfo
+
+// select which character from your GW account you want to default to
+# needed code: select charrid from table gwchars selected by accid
+
// update e-mail address form
echo '
';
echo '
Update e-mail address
';
From 78be10320a0fd830658eb5867827a9b6e6bae25d Mon Sep 17 00:00:00 2001
From: mauirixxx
Date: Wed, 8 Aug 2018 16:16:50 -1000
Subject: [PATCH 58/97] center text input accross the site
---
style.css | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/style.css b/style.css
index 9e4c799..2c4c3d5 100644
--- a/style.css
+++ b/style.css
@@ -50,4 +50,8 @@ label {
img.resize {
width:220px;
height:300px;
+}
+
+input {
+ text-align: center;
}
\ No newline at end of file
From bf0ba8cf3b172f6960a9b53131d2a4c6ee4e84f7 Mon Sep 17 00:00:00 2001
From: mauirixxx
Date: Wed, 8 Aug 2018 16:31:04 -1000
Subject: [PATCH 59/97] can now add account names, still need to view current
names
---
addaccounts.php | 22 +++++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)
diff --git a/addaccounts.php b/addaccounts.php
index b4b079b..8fe1d0e 100644
--- a/addaccounts.php
+++ b/addaccounts.php
@@ -1,6 +1,26 @@
user page';
+
+if (!empty($_POST['accemail'])) {
+ $addacc = $con->prepare("INSERT INTO gwaccounts (userid, accemail) VALUES (?, ?)");
+ $addacc->bind_param("is", $_SESSION['userid'], $_POST['accemail']);
+ $addacc->execute();
+ $addacc->close();
+ echo 'New account added, returning to editor.';
+ header ("Refresh:1; url=addaccounts.php");
+ exit();
+}
+
+echo '
';
+echo '
Add a new Guild Wars account e-mail
';
+echo '
';
+echo '
';
+
+echo '
Current Guild Wars accounts
';
+echo '
Account name
';
+// grab account name from database and loop it in here as a read only bit
+
+echo ' Return to your user page';
include_once ('footer.php');
?>
\ No newline at end of file
From 306aa3f19bc353998de194259fc8cbfcaf77694f Mon Sep 17 00:00:00 2001
From: mauirixxx
Date: Thu, 9 Aug 2018 00:51:42 -1000
Subject: [PATCH 60/97] list current accounts tied to user
---
addaccounts.php | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/addaccounts.php b/addaccounts.php
index 8fe1d0e..e9c4875 100644
--- a/addaccounts.php
+++ b/addaccounts.php
@@ -15,12 +15,21 @@ if (!empty($_POST['accemail'])) {
echo '
';
echo '
Add a new Guild Wars account e-mail
';
echo '
';
-echo '
';
+echo '
';
-echo '
Current Guild Wars accounts
';
+echo '
Current Guild Wars accounts
';
echo '
Account name
';
// grab account name from database and loop it in here as a read only bit
+$acclist = $con->prepare("SELECT accemail FROM gwaccounts WHERE userid = ?");
+$acclist->bind_param("i", $_SESSION['userid']);
+$acclist->execute();
+$result = $acclist->get_result();
+while ($row = $result->fetch_assoc()) {
+ echo '
' . $row['accemail'] . '
';
+}
+$acclist->close();
+echo '
';
echo ' Return to your user page';
include_once ('footer.php');
?>
\ No newline at end of file
From 23618bf8fd34615d8c5e83a00ef0686135eb65a2 Mon Sep 17 00:00:00 2001
From: mauirixxx
Date: Thu, 9 Aug 2018 07:33:09 -1000
Subject: [PATCH 61/97] can select a specific account, but not do anything with
it yet
---
preferences.php | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/preferences.php b/preferences.php
index 0cad550..b8d6872 100644
--- a/preferences.php
+++ b/preferences.php
@@ -12,10 +12,25 @@ if (!empty($_POST['oldpass'])) {
include_once ('includes/update-password.php');
}
+if (!empty($_POST['prefacc'])) {
+ //this section contains code to set the users preferred game account
+ #include_once ('includes/set-prefacc.php');
+ echo 'this line will go away once the include file is completed! ';
+}
echo '
Change e-mail or password
';
// select which GW account you want to default to
# needed code: select accid from table gwaccounts, store it in prefacc in table userinfo
+echo '
'; //make this a drop down list later
- echo 'Change Guild Wars account here '; //make this a drop down list later
echo 'Add Guild Wars account here ';
}
include_once ('footer.php');
From 6bed38654eed7589f2f25bceb6ae00e6acc3a41e Mon Sep 17 00:00:00 2001
From: mauirixxx
Date: Thu, 9 Aug 2018 13:13:59 -1000
Subject: [PATCH 65/97] completed game account preferrence setting
---
preferences.php | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/preferences.php b/preferences.php
index 4be2289..dc9d96e 100644
--- a/preferences.php
+++ b/preferences.php
@@ -12,26 +12,24 @@ if (!empty($_POST['oldpass'])) {
include_once ('includes/update-password.php');
}
-if (!empty($_POST['prefacc'])) {
+if (!empty($_POST['setacc'])) {
//this section contains code to set the users preferred game account
- #include_once ('includes/set-prefacc.php');
- echo 'this line will go away once the include file is completed! ';
+ include_once ('includes/set-prefacc.php');
}
echo '
Change e-mail or password
';
// select which GW account you want to default to
-# needed code: select accid from table gwaccounts, store it in prefacc in table userinfo
-echo '
';
// grab account name from database and loop it in here as a read only bit
-$acclist = $con->prepare("SELECT accemail FROM gwaccounts WHERE userid = ?");
+$acclist = $con->prepare("SELECT accid, accemail FROM gwaccounts WHERE userid = ?");
$acclist->bind_param("i", $_SESSION['userid']);
$acclist->execute();
$result = $acclist->get_result();
while ($row = $result->fetch_assoc()) {
- echo '
| Currently selected game account: ' . $_SESSION['prefaccname'] . ' | Current character: ' . $_SESSION['prefcharname'] . ' |
';
+}
// the footer just adds a logout button at the bottom of every page for the currently logged in user
if (isset($_SESSION['userid']) && ($_SESSION['username'])) {
echo '
';
From 7c2e5f38f925e8783b463c306f6c4bf43a9564de Mon Sep 17 00:00:00 2001
From: mauirixxx
Date: Thu, 9 Aug 2018 15:33:51 -1000
Subject: [PATCH 70/97] re-ordered the links I think?
---
index.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/index.php b/index.php
index e22918d..bc46fa8 100644
--- a/index.php
+++ b/index.php
@@ -3,10 +3,10 @@
$pagetitle = "Guild Wars Stats Tracker";
include_once ('header.php');
if (isset($_SESSION['userid'])){
+ echo 'View individual character stats here
'; //make this a drop down list later
echo 'Update character stats here
';
echo ' Return to your user page';
include_once ('footer.php');
?>
\ No newline at end of file
diff --git a/addcharacters.php b/addcharacters.php
index 14c50ac..7379645 100644
--- a/addcharacters.php
+++ b/addcharacters.php
@@ -2,7 +2,7 @@
$pagetitle = "Add Characters";
include_once ('header.php');
echo 'add a new character!';
-echo '
';
+echo '
';
echo '
Add character to account: ' . $_SESSION['prefaccname'] . '
Add character to account: ' . $_SESSION['prefaccname'] . '
';
-echo '
';
-echo '
';
-include_once ('footer.php');
-?>
\ No newline at end of file
diff --git a/includes/addcharacters-submit.php b/includes/addcharacters-submit.php
new file mode 100644
index 0000000..65f4865
--- /dev/null
+++ b/includes/addcharacters-submit.php
@@ -0,0 +1,16 @@
+prepare("INSERT INTO gwchars (accid, userid, charname, birthdate, profid) VALUES (?, ?, ?, ?, ?)");
+$ac->bind_param("iissi", $_SESSION['prefaccid'], $_SESSION['userid'], $_POST['newcharname'], $_POST['bdate'], $_POST['profid']);
+$ac->execute();
+$ac->close();
+echo $_POST['newcharname'] . ' added to your account!
';
+
+?>
\ No newline at end of file
diff --git a/index.php b/index.php
index 7925576..dd901f0 100644
--- a/index.php
+++ b/index.php
@@ -7,7 +7,6 @@ if (isset($_SESSION['userid'])){
echo 'Update character stats here
';
echo 'Add Guild Wars accounts and manage characters here
';
- echo 'Add a new character to track ';
}
include_once ('footer.php');
?>
\ No newline at end of file
From 34c256edce92a2ef4fae2e57bdffebbc37c09be8 Mon Sep 17 00:00:00 2001
From: mauirixxx
Date: Fri, 10 Aug 2018 18:35:46 -1000
Subject: [PATCH 77/97] added simple check for logged in status, more stuff for
character selection
---
addaccounts.php | 4 +-
adminlanding.php | 12 ++--
includes/addcharacters-submit.php | 15 ++--
includes/set-prefacc.php | 44 ++++++------
includes/set-prefchar.php | 5 ++
preferences.php | 23 +++++-
titlemanager.php | 143 +++++++++++++++++++-------------------
7 files changed, 138 insertions(+), 108 deletions(-)
create mode 100644 includes/set-prefchar.php
diff --git a/addaccounts.php b/addaccounts.php
index c20d3f7..aaf139f 100644
--- a/addaccounts.php
+++ b/addaccounts.php
@@ -1,7 +1,8 @@
fetch_assoc()) {
}
echo '
';
echo ' Return to your user page';
+}
include_once ('footer.php');
?>
\ No newline at end of file
diff --git a/adminlanding.php b/adminlanding.php
index 81025d4..ef2840f 100644
--- a/adminlanding.php
+++ b/adminlanding.php
@@ -1,10 +1,12 @@
Welcome to the admin area!
';
-echo 'Title creator / editor here (work in progress)
';
-echo 'User editor here (not working yet) ';
+if (isset($_SESSION['userid'])){
+ unset($_SESSION['title']);
+ unset($_SESSION['tid']);
+ echo '
Welcome to the admin area!
';
+ echo 'Title creator / editor here (work in progress)
';
+ echo 'User editor here (not working yet) ';
+}
include_once ('footer.php');
?>
\ No newline at end of file
diff --git a/includes/addcharacters-submit.php b/includes/addcharacters-submit.php
index 65f4865..820cc0a 100644
--- a/includes/addcharacters-submit.php
+++ b/includes/addcharacters-submit.php
@@ -6,11 +6,12 @@ error_reporting(E_ALL);
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
# delete the above when shit finally works
-// $ac = AddCharacter
-$ac = $con->prepare("INSERT INTO gwchars (accid, userid, charname, birthdate, profid) VALUES (?, ?, ?, ?, ?)");
-$ac->bind_param("iissi", $_SESSION['prefaccid'], $_SESSION['userid'], $_POST['newcharname'], $_POST['bdate'], $_POST['profid']);
-$ac->execute();
-$ac->close();
-echo $_POST['newcharname'] . ' added to your account!
';
+}
?>
\ 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 '
Current preferred character: ' .$_SESSION['prefcharname'] . '
';
# 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
';
- include ('includes/title-select.php');
- echo '
';
- echo 'Add or modify title ranks and points
';
- include ('includes/title-select.php');
- echo '
';
- // 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
';
+ include ('includes/title-select.php');
+ echo '
';
+ echo 'Add or modify title ranks and points
';
+ include ('includes/title-select.php');
+ echo '
';
+ // 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 '
';
-# needed code: select charrid from table gwchars selected by accid
// update e-mail address form
echo '
';
From 66ba0e2580456b2345d5b0a18ebc32f698de4619 Mon Sep 17 00:00:00 2001
From: mauirixxx
Date: Sun, 12 Aug 2018 10:59:47 -1000
Subject: [PATCH 79/97] character selection QoL improvements and other stuff
---
addaccounts.php | 161 ++++++++++++++++++--------------------
includes/addaccount-submit.php | 11 +++
includes/addcharacters-submit.php | 16 ++--
includes/del-character.php | 21 +++++
includes/getaccountstats.php | 23 ++++++
includes/session-debug.php | 7 ++
includes/session-dump.php | 4 +
preferences.php | 2 -
style.css | 12 ++-
updateaccountstats.php | 8 +-
10 files changed, 166 insertions(+), 99 deletions(-)
create mode 100644 includes/addaccount-submit.php
create mode 100644 includes/del-character.php
create mode 100644 includes/getaccountstats.php
create mode 100644 includes/session-debug.php
create mode 100644 includes/session-dump.php
diff --git a/addaccounts.php b/addaccounts.php
index 25975cb..29ed9aa 100644
--- a/addaccounts.php
+++ b/addaccounts.php
@@ -1,98 +1,91 @@
prepare("INSERT INTO gwaccounts (userid, accemail) VALUES (?, ?)");
- $addacc->bind_param("is", $_SESSION['userid'], $_POST['accemail']);
- $addacc->execute();
- $addacc->close();
- echo 'New account added, returning to editor.';
- header ("Refresh:1; url=addaccounts.php");
- exit();
-}
+ if (!empty($_POST['accemail'])) {
+ // this section contains the code to add a new game account to track
+ include_once ('includes/addaccount-submit.php');
+ }
-if (!empty($_POST['delchar'])) {
- echo 'removing selected character(s) from selected account ';
- if ($delchar = $con->prepare("DELETE FROM gwchars WHERE charid = ? AND accid = ? AND userid = ?")) {
- $delchar->bind_param("iii", $delcharid, $delaccid, $_SESSION['userid']);
- for ($i = 0; $i < count($_POST['delchar']); $i++) {
- $delcharid = $_POST['charid'][$i];
- $delaccid = $_POST['accid'][$i];
- $delchar->execute();
- }
- $delchar->close();
+ if (!empty($_POST['delcharid'])) {
+ // this section contains code to delete the selected characters
+ include_once ('includes/del-character.php');
}
- $nap = $con->prepare("UPDATE userinfo SET prefcharid = 0, prefcharname = 'No default selected' WHERE userid = ?");
- $nap->bind_param("i", $_SESSION['userid']);
- $nap->execute();
- $nap->close();
- $_SESSION['prefcharid'] = "0";
- $_SESSION['prefcharname'] = "No default selected";
- echo 'Character deleted - no preferred character selected.
';
-}
-if (!empty($_POST['newcharname'])) {
- include_once ('includes/addcharacters-submit.php');
-}
+ if (!empty($_POST['newcharname'])) {
+ // this section contains code to insert a new character into the database
+ include_once ('includes/addcharacters-submit.php');
+ }
-echo '
';
+ echo ' Return to your user page';
}
include_once ('footer.php');
?>
\ No newline at end of file
diff --git a/includes/addaccount-submit.php b/includes/addaccount-submit.php
new file mode 100644
index 0000000..b8efe28
--- /dev/null
+++ b/includes/addaccount-submit.php
@@ -0,0 +1,11 @@
+prepare("INSERT INTO gwaccounts (userid, accemail) VALUES (?, ?)");
+ $addacc->bind_param("is", $_SESSION['userid'], $_POST['accemail']);
+ $addacc->execute();
+ $addacc->close();
+ echo 'New account added, returning to editor.';
+ header ("Refresh:1; url=addaccounts.php");
+ exit();
+}
+?>
\ No newline at end of file
diff --git a/includes/addcharacters-submit.php b/includes/addcharacters-submit.php
index 820cc0a..100b390 100644
--- a/includes/addcharacters-submit.php
+++ b/includes/addcharacters-submit.php
@@ -1,15 +1,13 @@
prepare("SELECT profcolor FROM gwprofessions WHERE profid = ?");
+ $pc->bind_param("i", $_POST['profid']);
+ $pc->execute();
+ $profcolor = $pc->get_result()->fetch_object()->profcolor;
// $ac = AddCharacter
- $ac = $con->prepare("INSERT INTO gwchars (accid, userid, charname, birthdate, profid) VALUES (?, ?, ?, ?, ?)");
- $ac->bind_param("iissi", $_SESSION['prefaccid'], $_SESSION['userid'], $_POST['newcharname'], $_POST['bdate'], $_POST['profid']);
+ $ac = $con->prepare("INSERT INTO gwchars (accid, userid, charname, birthdate, profid, profcolor) VALUES (?, ?, ?, ?, ?, ?)");
+ $ac->bind_param("iissis", $_SESSION['prefaccid'], $_SESSION['userid'], $_POST['newcharname'], $_POST['bdate'], $_POST['profid'], $profcolor);
$ac->execute();
$ac->close();
echo $_POST['newcharname'] . ' added to your account!
';
diff --git a/includes/del-character.php b/includes/del-character.php
new file mode 100644
index 0000000..feb8222
--- /dev/null
+++ b/includes/del-character.php
@@ -0,0 +1,21 @@
+';
+ if ($delchar = $con->prepare("DELETE FROM gwchars WHERE charid = ? AND accid = ? AND userid = ?")) {
+ $delchar->bind_param("iii", $delcharid, $delaccid, $_SESSION['userid']);
+ for ($i = 0; $i < count($_POST['delcharid']); $i++) {
+ $delcharid = $_POST['delcharid'][$i];
+ $delaccid = $_POST['accid'][$i];
+ $delchar->execute();
+ }
+ $delchar->close();
+ }
+ $nap = $con->prepare("UPDATE userinfo SET prefcharid = 0, prefcharname = 'No default selected' WHERE userid = ?");
+ $nap->bind_param("i", $_SESSION['userid']);
+ $nap->execute();
+ $nap->close();
+ $_SESSION['prefcharid'] = "0";
+ $_SESSION['prefcharname'] = "No default selected";
+ echo 'Character(s) deleted - no preferred character selected.
';
+}
+?>
\ No newline at end of file
diff --git a/includes/getaccountstats.php b/includes/getaccountstats.php
new file mode 100644
index 0000000..4500c9f
--- /dev/null
+++ b/includes/getaccountstats.php
@@ -0,0 +1,23 @@
+
';
+?>
\ No newline at end of file
diff --git a/includes/session-debug.php b/includes/session-debug.php
new file mode 100644
index 0000000..9700053
--- /dev/null
+++ b/includes/session-debug.php
@@ -0,0 +1,7 @@
+
\ No newline at end of file
diff --git a/includes/session-dump.php b/includes/session-dump.php
new file mode 100644
index 0000000..20f65ec
--- /dev/null
+++ b/includes/session-dump.php
@@ -0,0 +1,4 @@
+' . print_r($_SESSION, true) . ' ';
+echo 'Post variables:
' . print_r($_POST, true) . '
';
+?>
\ No newline at end of file
diff --git a/preferences.php b/preferences.php
index 1e46854..4df06c5 100644
--- a/preferences.php
+++ b/preferences.php
@@ -39,8 +39,6 @@ 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 '
Current preferred character: ' .$_SESSION['prefcharname'] . '
';
echo 'Title creator / editor here (work in progress)
';
- echo 'User editor here (not working yet) ';
+ echo 'User editor here (not working yet)
';
+ include_once ('includes/session-dump.php');
}
include_once ('footer.php');
?>
\ No newline at end of file
diff --git a/includes/del-account.php b/includes/del-account.php
new file mode 100644
index 0000000..1463964
--- /dev/null
+++ b/includes/del-account.php
@@ -0,0 +1,49 @@
+prepare("SELECT charid, accid FROM gwchars WHERE accid IN ($gaccid) AND userid = ?");
+ $gci->bind_param("i", $_SESSION['userid']);
+ $gci->execute();
+ $gciresults = $gci->get_result();
+ while ($gcirow = $gciresults->fetch_assoc()) {
+ $delchar = $con->prepare("DELETE FROM gwchars WHERE charid = ? AND accid = ? AND userid = ?");
+ $delchar->bind_param("iii", $gcirow['charid'], $gcirow['accid'], $_SESSION['userid']);
+ $delchar->execute();
+ $delchar->close();
+ // $dac = Delete Account Stats
+ $dac = $con->prepare("DELETE FROM gwaccstats WHERE accid = ? AND userid = ?");
+ $dac->bind_param("ii", $gcirow['accid'], $_SESSION['userid']);
+ $dac->execute();
+ $dac->close();/*
+ // $dcs = Delete Character Stats
+ $dcs = $con->prepare("DELETE FROM gwcharstats WHERE charid = ? AND accid = ? AND userid = ?");
+ $dcs->bind_param("iii", $gcirow['charid'], $gcirow['accid'], $_SESSION['userid']);
+ $dcs->execute();
+ $dcs->close(); */
+ }
+ $gci->close();
+ //this should be the last SQL query to run!
+ $delacc = $con->prepare("DELETE FROM gwaccounts WHERE accid IN ($gaccid) AND userid = ?");
+ $delacc->bind_param("i", $_SESSION['userid']);
+ $delacc->execute();
+ $delacc->close();
+ // $nap = No Account Preference
+ $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['preaccname'] = "No default selected";
+ echo 'Account(s) deleted - no preferred account selected.
';
+ // $ncp = No Character Preference
+ $ncp = $con->prepare("UPDATE userinfo SET prefcharid = 0, prefcharname = 'No default selected' WHERE userid = ?");
+ $ncp->bind_param("i", $_SESSION['userid']);
+ $ncp->execute();
+ $ncp->close();
+ $_SESSION['prefcharid'] = "0";
+ $_SESSION['prefcharname'] = "No default selected";
+ echo 'All characters related to the account have been deleted - no preferred character selected.
';
}
?>
\ No newline at end of file
diff --git a/includes/del-character.php b/includes/del-character.php
index feb8222..706b93a 100644
--- a/includes/del-character.php
+++ b/includes/del-character.php
@@ -1,6 +1,5 @@
';
if ($delchar = $con->prepare("DELETE FROM gwchars WHERE charid = ? AND accid = ? AND userid = ?")) {
$delchar->bind_param("iii", $delcharid, $delaccid, $_SESSION['userid']);
for ($i = 0; $i < count($_POST['delcharid']); $i++) {
@@ -10,12 +9,14 @@ if (isset($_SESSION['userid'])) {
}
$delchar->close();
}
+ // need to delete associate character stats as well. TODO
$nap = $con->prepare("UPDATE userinfo SET prefcharid = 0, prefcharname = 'No default selected' WHERE userid = ?");
$nap->bind_param("i", $_SESSION['userid']);
$nap->execute();
$nap->close();
$_SESSION['prefcharid'] = "0";
$_SESSION['prefcharname'] = "No default selected";
+ $_SESSION['charprofid'] = "0";
echo 'Character(s) deleted - no preferred character selected.
';
}
?>
\ No newline at end of file
diff --git a/includes/getaccountstats.php b/includes/getaccountstats.php
index af438a7..a6359ae 100644
--- a/includes/getaccountstats.php
+++ b/includes/getaccountstats.php
@@ -1,7 +1,4 @@
Account wide stats
';
echo '
Title
Title Rank
Title Points
Current Rank
Points Remaining
Max Title %
Next Rank
';
diff --git a/includes/set-prefacc.php b/includes/set-prefacc.php
index 57ffd59..da83f4b 100644
--- a/includes/set-prefacc.php
+++ b/includes/set-prefacc.php
@@ -1,6 +1,7 @@
prepare("UPDATE userinfo SET prefaccid = 0, prefaccname = 'No default selected' WHERE userid = ?");
$nap->bind_param("i", $_SESSION['userid']);
$nap->execute();
@@ -9,6 +10,7 @@ if (isset($_SESSION['userid'])) {
$_SESSION['prefaccname'] = "No default selected";
echo 'Account preference update - no preferred account selected. ';
} else {
+ // $sap = Select AccountID Preferrence
$sap = $con->prepare("SELECT accid, accemail FROM gwaccounts WHERE accid = ? AND userid = ?");
$sap->bind_param("ii", $_POST['prefaccid'], $_SESSION['userid']);
$sap->execute();
@@ -21,13 +23,15 @@ if (isset($_SESSION['userid'])) {
$_SESSION['prefaccid'] = $row['accid'];
$_SESSION['prefaccname'] = $row['accemail'];
}
- $ncp = $con->prepare("UPDATE userinfo SET prefcharid = 0, prefcharname = 'No default selected' WHERE userid = ?");
- $ncp->bind_param("i", $_SESSION['userid']);
- $ncp->execute();
- $ncp->close();
- $_SESSION['prefcharid'] = "0";
- $_SESSION['prefcharname'] = "No default selected";
- echo 'Guild Wars preferred account updated! ';
+ $sap->close();
}
+ $ncp = $con->prepare("UPDATE userinfo SET prefcharid = 0, prefcharname = 'No default selected' WHERE userid = ?");
+ $ncp->bind_param("i", $_SESSION['userid']);
+ $ncp->execute();
+ $ncp->close();
+ $_SESSION['prefcharid'] = "0";
+ $_SESSION['prefcharname'] = "No default selected";
+ $_SESSION['charprofid'] = "0";
+ echo 'Guild Wars preferred account updated! ';
}
?>
\ No newline at end of file
diff --git a/includes/set-prefchar.php b/includes/set-prefchar.php
index fa1b448..8d791cd 100644
--- a/includes/set-prefchar.php
+++ b/includes/set-prefchar.php
@@ -1,15 +1,17 @@
prepare("UPDATE userinfo SET prefcharid = 0, prefcharname = 'No default selected' WHERE userid = ?");
$ncp->bind_param("i", $_SESSION['userid']);
$ncp->execute();
$ncp->close();
$_SESSION['prefcharid'] = "0";
$_SESSION['prefcharname'] = "No default selected";
- echo 'Character preference update - no preferred character selected. ';
+ $_SESSION['charprofid'] = "0";
} else {
- $scp = $con->prepare("SELECT charid, charname FROM gwchars WHERE charid = ? AND accid = ? AND userid = ?");
+ // $scp = Selected CharID Preferrence
+ $scp = $con->prepare("SELECT charid, charname, profid FROM gwchars WHERE charid = ? AND accid = ? AND userid = ?");
$scp->bind_param("iii", $_POST['prefcharid'], $_SESSION['prefaccid'], $_SESSION['userid']);
$scp->execute();
$result = $scp->get_result();
@@ -20,8 +22,8 @@ if (isset($_SESSION['userid'])) {
$uap->close();
$_SESSION['prefcharid'] = $row['charid'];
$_SESSION['prefcharname'] = $row['charname'];
+ $_SESSION['charprofid'] = $row['profid'];
}
- echo 'Guild Wars preferred character updated! ';
}
}
?>
\ No newline at end of file
diff --git a/includes/title-add.php b/includes/title-add.php
index 16f31ab..6cc4b71 100644
--- a/includes/title-add.php
+++ b/includes/title-add.php
@@ -1,6 +1,8 @@
Title Name
Title Type
Max Rank
';
-echo '
Account Character
';
-echo '
';
-echo '
';
+if (isset($_SESSION['userid'])) {
+ echo '
Title Name
Title Type
Max Rank
';
+ echo '
Account Character
';
+ echo '
';
+ echo '
';
+}
?>
\ No newline at end of file
diff --git a/includes/title-editor.php b/includes/title-editor.php
index 86c3466..de4fca7 100644
--- a/includes/title-editor.php
+++ b/includes/title-editor.php
@@ -1,29 +1,31 @@
';
-echo '
';
+ }
+ $stmtview->close();
+ echo 'Return to title manager';
}
-$stmtview->close();
-echo 'Return to title manager';
?>
\ No newline at end of file
diff --git a/includes/title-update.php b/includes/title-update.php
index 17e85a1..8b8c6c5 100644
--- a/includes/title-update.php
+++ b/includes/title-update.php
@@ -1,28 +1,30 @@
Please check the box to verify you want to delete: ' . $_POST['titlename'] . ' ';
- echo '
';
- } else if ($_POST['deltitle'] == "iamsure") {
- // this section actually deletes the title
- $stmtdel = $con->prepare("DELETE FROM gwtitles WHERE titlenameid = ?");
- $stmtdel->bind_param("i", $_POST['titlenameid']);
- $stmtdel->execute();
- $stmtdelst = $con->prepare("DELETE FROM gwsubtitles WHERE titlenameid = ?");
- $stmtdelst->bind_param("i", $_POST['titlenameid']);
- $stmtdelst->execute();
- $stmtdel->close();
- echo 'The title and associated title ranks have been deleted, redirecting!';
+if (isset($_SESSION['userid'])) {
+ if (isset($_POST['deltitle'])) {
+ if ($_POST['deltitle'] == "yes") {
+ // this title makes you verify that you want to delete this title
+ echo '
Please check the box to verify you want to delete: ' . $_POST['titlename'] . ' ';
+ echo '
';
+ } else if ($_POST['deltitle'] == "iamsure") {
+ // this section actually deletes the title
+ $stmtdel = $con->prepare("DELETE FROM gwtitles WHERE titlenameid = ?");
+ $stmtdel->bind_param("i", $_POST['titlenameid']);
+ $stmtdel->execute();
+ $stmtdelst = $con->prepare("DELETE FROM gwsubtitles WHERE titlenameid = ?");
+ $stmtdelst->bind_param("i", $_POST['titlenameid']);
+ $stmtdelst->execute();
+ $stmtdel->close();
+ echo 'The title and associated title ranks have been deleted, redirecting!';
+ header ("Refresh:1; url=titlemanager.php");
+ }
+ } else {
+ // this section updates the title name
+ $stmtupd = $con->prepare("UPDATE gwtitles SET titlename = ?, titletype = ?, titlemaxrank = ? WHERE titlenameid = ?");
+ $stmtupd->bind_param("siii", $_POST['titlename'], $_POST['titletype'], $_POST['titlemaxrank'], $_POST['titlenameid']);
+ $stmtupd->execute();
+ $stmtupd->close();
+ echo 'Title updated, redirecting!';
header ("Refresh:1; url=titlemanager.php");
}
-} else {
- // this section updates the title name
- $stmtupd = $con->prepare("UPDATE gwtitles SET titlename = ?, titletype = ?, titlemaxrank = ? WHERE titlenameid = ?");
- $stmtupd->bind_param("siii", $_POST['titlename'], $_POST['titletype'], $_POST['titlemaxrank'], $_POST['titlenameid']);
- $stmtupd->execute();
- $stmtupd->close();
- echo 'Title updated, redirecting!';
- header ("Refresh:1; url=titlemanager.php");
}
?>
\ No newline at end of file
diff --git a/includes/titleranks-add.php b/includes/titleranks-add.php
index 74b2e56..0559e33 100644
--- a/includes/titleranks-add.php
+++ b/includes/titleranks-add.php
@@ -1,67 +1,59 @@
prepare("SELECT MAX(strank) FROM gwsubtitles WHERE titlenameid = ?");
- $trank->bind_param("i", $_POST['tid']);
- $trank->execute();
- $trank->store_result();
- $trank->bind_result($gwstmr);
- while ($trank->fetch()) {
- if (is_null($gwstmr)) {
- $tr = 1;
+if (isset($_SESSION['userid'])) {
+ unset($_SESSION['title']);
+ if (isset($_SESSION['tid'])) {
+ $_POST['tid'] = $_SESSION['tid'];
+ }
+ if (isset($_SESSION['tr'])) {
+ $tr = $_SESSION['tr'] + 1;
+ } else {
+ $trank = $con->prepare("SELECT MAX(strank) FROM gwsubtitles WHERE titlenameid = ?");
+ $trank->bind_param("i", $_POST['tid']);
+ $trank->execute();
+ $trank->store_result();
+ $trank->bind_result($gwstmr);
+ while ($trank->fetch()) {
+ if (is_null($gwstmr)) {
+ $tr = 1;
+ } else {
+ $tr = $gwstmr + 1;
+ }
+ }
+ }
+ $stmtname = $con->prepare("SELECT titlename, titlemaxrank FROM gwtitles WHERE titlenameid = ?");
+ $stmtname->bind_param("i", $_POST['tid']);
+ $stmtname->execute();
+ $stmtname->store_result();
+ $stmtname->bind_result($gwtn, $gwtmr);
+ while ($stmtname->fetch()) {
+ echo 'Adding rank to title ' . $gwtn . ' The maximum rank achievable in game is ' . $gwtmr . ' ';
+ if ($tr > $gwtmr) {
+ echo ' No more ranks can be added!
';
} else {
- $tr = $gwstmr + 1;
+ echo '
Title Rank Name
Title Points
Rank Level
';
+ echo '
';
+ echo '
';
}
}
+ $stmtname->free_result();
+ $stmtname->close();
+ echo 'Here are the currently associated title ranks, starting with rank 1: ';
+ echo '
';
+ echo 'Return to title manager';
}
-
-$stmtname = $con->prepare("SELECT titlename, titlemaxrank FROM gwtitles WHERE titlenameid = ?");
-$stmtname->bind_param("i", $_POST['tid']);
-$stmtname->execute();
-$stmtname->store_result();
-$stmtname->bind_result($gwtn, $gwtmr);
-while ($stmtname->fetch()) {
- echo 'Adding rank to title ' . $gwtn . ' The maximum rank achievable in game is ' . $gwtmr . ' ';
- if ($tr > $gwtmr) {
- echo ' No more ranks can be added!
';
- } else {
- echo '
Title Rank Name
Title Points
Rank Level
';
- echo '
';
- echo '
';
- }
-}
-$stmtname->free_result();
-$stmtname->close();
-
-echo 'Here are the currently associated title ranks, starting with rank 1: ';
-echo '
';
-echo 'Return to title manager';
?>
\ No newline at end of file
diff --git a/includes/titleranks-editor.php b/includes/titleranks-editor.php
index 2af48d2..60846df 100644
--- a/includes/titleranks-editor.php
+++ b/includes/titleranks-editor.php
@@ -1,30 +1,25 @@
Deleting takes precedence over edits - edits will have to be remade after submission
';
- echo '
stnameid
titlenameid
stname
stpoints
strank
Delete?
';
- $ph = implode(",", $_POST['editstitle']);
- $sredit = $con->prepare("SELECT * FROM gwsubtitles WHERE titlenameid = ? AND stnameid IN ($ph)");
- $sredit->bind_param("i", $_SESSION['tid']);
- $sredit->execute();
- $result = $sredit->get_result();
- while ($row = $result->fetch_assoc()) {
- echo '
Deleting takes precedence over edits - edits will have to be remade after submission
';
+ echo '
stnameid
titlenameid
stname
stpoints
strank
Delete?
';
+ $ph = implode(",", $_POST['editstitle']);
+ $sredit = $con->prepare("SELECT * FROM gwsubtitles WHERE titlenameid = ? AND stnameid IN ($ph)");
+ $sredit->bind_param("i", $_SESSION['tid']);
+ $sredit->execute();
+ $result = $sredit->get_result();
+ while ($row = $result->fetch_assoc()) {
+ echo '
';
+ echo '
';
+ echo '
';
+ }
+ $sredit->close();
+ echo '
';
+ echo '
';
+ echo 'Return to title manager';
+ } else {
+ echo 'No title ranks selected! Please press the back button on your browser to return to the previous page.
';
+ echo 'Return to title manager';
}
- $sredit->close();
- echo '
';
- echo '
';
- echo 'Return to title manager';
-} else {
- echo 'No title ranks selected! Please press the back button on your browser to return to the previous page.
';
- echo 'Return to title manager';
}
?>
\ No newline at end of file
diff --git a/includes/titleranks-submit.php b/includes/titleranks-submit.php
index 8bb44c9..14e2317 100644
--- a/includes/titleranks-submit.php
+++ b/includes/titleranks-submit.php
@@ -1,11 +1,13 @@
prepare("INSERT INTO gwsubtitles (titlenameid, stname, stpoints, strank) VALUES (?, ?, ?, ?)");
-$stmtstins->bind_param("isii", $_POST['titlenameid'], $_POST['titlerankname'], $_POST['titlepoints'], $_POST['titlerank']);
-$stmtstins->execute();
-$stmtstins->close();
-$_SESSION['title'] = "repeat";
-$_SESSION['tid'] = $_POST['titlenameid'];
-$_SESSION['tr'] = $_POST['titlerank'];
-echo 'Title rank added, redirecting!';
-header ("Refresh:1; url=titlemanager.php");
+if (isset($_SESSION['userid'])) {
+ $stmtstins = $con->prepare("INSERT INTO gwsubtitles (titlenameid, stname, stpoints, strank) VALUES (?, ?, ?, ?)");
+ $stmtstins->bind_param("isii", $_POST['titlenameid'], $_POST['titlerankname'], $_POST['titlepoints'], $_POST['titlerank']);
+ $stmtstins->execute();
+ $stmtstins->close();
+ $_SESSION['title'] = "repeat";
+ $_SESSION['tid'] = $_POST['titlenameid'];
+ $_SESSION['tr'] = $_POST['titlerank'];
+ echo 'Title rank added, redirecting!';
+ header ("Refresh:1; url=titlemanager.php");
+}
?>
\ No newline at end of file
diff --git a/includes/update-email.php b/includes/update-email.php
index b3089ba..2a2ad27 100644
--- a/includes/update-email.php
+++ b/includes/update-email.php
@@ -1,8 +1,10 @@
prepare("UPDATE userinfo SET usermail = ? WHERE userid = ?");
-$updmail->bind_param("si", $_POST['useremail'], $_SESSION['userid']);
-$updmail->execute();
-$_SESSION['usermail'] = $_POST['useremail'];
-echo 'E-mail address updated. ';
+if (isset($_SESSION['userid'])) {
+ include_once ('verifications.php');
+ $updmail = $con->prepare("UPDATE userinfo SET usermail = ? WHERE userid = ?");
+ $updmail->bind_param("si", $_POST['useremail'], $_SESSION['userid']);
+ $updmail->execute();
+ $_SESSION['usermail'] = $_POST['useremail'];
+ echo 'E-mail address updated. ';
+}
?>
\ No newline at end of file
diff --git a/includes/update-password.php b/includes/update-password.php
index 4ced42b..d15a46f 100644
--- a/includes/update-password.php
+++ b/includes/update-password.php
@@ -1,21 +1,23 @@
prepare("SELECT userpass FROM userinfo WHERE userid = ?");
-$verifypass->bind_param("i", $_SESSION['userid']);
-$verifypass->execute();
-$result = $verifypass->get_result();
-while ($row = $result->fetch_assoc()) {
- $vp = password_verify ($_POST['oldpass'],$row['userpass']);
- if ($vp) {
- $hp = password_hash($_POST['userpass1'], PASSWORD_DEFAULT);
- echo 'Verified old password, updating to new password! ';
- $updpass = $con->prepare("UPDATE userinfo SET userpass = ? WHERE userid = ?");
- $updpass->bind_param("si", $hp, $_SESSION['userid']);
- $updpass->execute();
- echo 'Password updated! ';
- $updpass->close();
- } else {
- echo 'Old password doesn\'t match, password is NOT updated! ';
+if (isset($_SESSION['userid'])) {
+ include_once ('verifications.php');
+ $verifypass = $con->prepare("SELECT userpass FROM userinfo WHERE userid = ?");
+ $verifypass->bind_param("i", $_SESSION['userid']);
+ $verifypass->execute();
+ $result = $verifypass->get_result();
+ while ($row = $result->fetch_assoc()) {
+ $vp = password_verify ($_POST['oldpass'],$row['userpass']);
+ if ($vp) {
+ $hp = password_hash($_POST['userpass1'], PASSWORD_DEFAULT);
+ echo 'Verified old password, updating to new password! ';
+ $updpass = $con->prepare("UPDATE userinfo SET userpass = ? WHERE userid = ?");
+ $updpass->bind_param("si", $hp, $_SESSION['userid']);
+ $updpass->execute();
+ echo 'Password updated! ';
+ $updpass->close();
+ } else {
+ echo 'Old password doesn\'t match, password is NOT updated! ';
+ }
}
}
?>
\ No newline at end of file
diff --git a/style.css b/style.css
index e6babb0..07e5490 100644
--- a/style.css
+++ b/style.css
@@ -68,4 +68,16 @@ submitLink:focus {
}
.percentbar { background:#CCCCCC; border:1px solid #666666; height:10px; }
-.percentbar div { background: #28B8C0; height: 10px; }
\ No newline at end of file
+.percentbar div { background: #28B8C0; height: 10px; }
+
+select *.profession-0 { background-color: #FFF; }
+select *.profession-1 { background-color: #FF8; }
+select *.profession-2 { background-color: #CF9; }
+select *.profession-3 { background-color: #ACF; }
+select *.profession-4 { background-color: #9FC; }
+select *.profession-5 { background-color: #DAF; }
+select *.profession-6 { background-color: #FBB; }
+select *.profession-7 { background-color: #FCE; }
+select *.profession-8 { background-color: #BFF; }
+select *.profession-9 { background-color: #FC9; }
+select *.profession-10 { background-color: #DDF; }
diff --git a/titlemanager.php b/titlemanager.php
index a21ee55..7a6e8ce 100644
--- a/titlemanager.php
+++ b/titlemanager.php
@@ -4,13 +4,13 @@ include_once ('header.php');
if (isset($_SESSION['userid'])){
if (isset($_SESSION['title'])) {
if ($_SESSION['title'] == "repeat") {
- $_POST['title'] = "addsubtitle";
- unset($_SESSION['title']);
- } else {
- unset($_SESSION['tr']);
- }
+ $_POST['title'] = "addsubtitle";
+ unset($_SESSION['title']);
+ } else {
+ unset($_SESSION['tr']);
}
- if ($_SESSION['admin'] == 1) {
+ }
+ if ($_SESSION['admin'] == 1) {
echo ' ';
if (isset($_POST['title'])) {
if ($_POST['title'] == "addtitle") {
From 8c4e34b764f03ffdea01ffe1e52ebf6a271aaf1f Mon Sep 17 00:00:00 2001
From: mauirixxx
Date: Thu, 16 Aug 2018 16:09:02 -1000
Subject: [PATCH 84/97] added account selector to header
---
header-list-accounts.php | 13 +++++
header.php | 15 ++++-
preferences.php | 142 ++++++++++++++++++++++-------------------------
style.css | 6 ++
updatecharstats.php | 4 +-
5 files changed, 101 insertions(+), 79 deletions(-)
create mode 100644 header-list-accounts.php
diff --git a/header-list-accounts.php b/header-list-accounts.php
new file mode 100644
index 0000000..b21affc
--- /dev/null
+++ b/header-list-accounts.php
@@ -0,0 +1,13 @@
+prepare("SELECT accid, accemail FROM gwaccounts WHERE userid = ?");
+ $als->bind_param("i", $_SESSION['userid']);
+ $als->execute();
+ $alsres = $als->get_result();
+ while ($alsrow = $alsres->fetch_assoc()) {
+ echo '';
+ }
+ $als->close();
+}
+?>
\ No newline at end of file
diff --git a/header.php b/header.php
index d3ed9f1..4854ae8 100644
--- a/header.php
+++ b/header.php
@@ -26,6 +26,10 @@ if (!$userid){
echo 'GWST';
}
echo '
';
+ if (!empty($_POST['prefaccid'])) {
+ //this section contains code to set the users preferred game account
+ include_once ('includes/set-prefacc.php');
+ }
if (!empty($_POST['prefcharid'])) {
//this section contains code to the users preferred character
include_once ('includes/set-prefchar.php');
@@ -35,10 +39,15 @@ if (!$userid){
if ($_SESSION['admin'] == 1){
echo'(Administration) ';
}
- echo '(Logout ' . $_SESSION['username'] . ') (';
- echo '';
+ echo '(';
+ echo '';
+ echo '';
+ include_once ('header-list-accounts.php');
+ echo ') ';
+ echo '(';
+ echo '';
echo '';
include_once ('header-list-chars.php');
- echo ') ';
+ echo ') (Logout ' . $_SESSION['username'] . ') ';
}
?>
\ No newline at end of file
diff --git a/preferences.php b/preferences.php
index 4df06c5..b99bc25 100644
--- a/preferences.php
+++ b/preferences.php
@@ -2,83 +2,75 @@
$pagetitle = "Account options";
include_once ('header.php');
if (isset($_SESSION['userid'])){
-
-if (!empty($_POST['useremail'])) {
- //this section contains code to update the users e-mail address
- include_once ('includes/update-email.php');
-}
-
-if (!empty($_POST['oldpass'])) {
- // this section contains code to update the users password after verifying the old password first
- include_once ('includes/update-password.php');
-}
-
-if (!empty($_POST['setacc'])) {
- //this section contains code to set the users preferred game account
- include_once ('includes/set-prefacc.php');
-}
-
-if (!empty($_POST['setchar'])) {
- //this section contains code to the users preferred character
- include_once ('includes/set-prefchar.php');
-}
-
-echo '
Set preferred account & character, or change e-mail or password
';
-
-// select which GW account you want to default to
-echo '
Current preferred account: ' .$_SESSION['prefaccname'] . '