implemented article composer functionality + interface, login & signup functionality + interface, auth permission functionality reflected in the nav, and determined a unified accent color accessible in dark and light mode

This commit is contained in:
Joshua Ashton
2025-03-25 13:09:05 -06:00
parent c0fc9e9d00
commit 0a27cd1f5c
11 changed files with 624 additions and 53 deletions
+19 -2
View File
@@ -20,7 +20,7 @@ if ($_SERVER['HTTP_HOST'] == 'localhost') {
/*
* Handles any queries that should have only one row results.
*/
function query_db_one_result($query_stmt)
function query_one_result($query_stmt)
{
$conn = get_connection();
$results = mysqli_query($conn, $query_stmt);
@@ -32,7 +32,7 @@ function query_db_one_result($query_stmt)
return mysqli_fetch_assoc($results);
}
function query_db_one_or_more_results($query_stmt)
function query_one_or_more_results($query_stmt)
{
$conn = get_connection();
$results = mysqli_query($conn, $query_stmt);
@@ -44,6 +44,23 @@ function query_db_one_or_more_results($query_stmt)
return $results;
}
/*
* Executes a statement. Type is typically either 0 or 1, where 0 is an INSERT or UPDATE,
* and 1 is DELETE. This is to determine whether a boolean value should be returned or
* the ID of the row(s).
*/
function exec_statement($stmt, $type)
{
$conn = get_connection();
$results = mysqli_query($conn, $stmt);
if ($type == 0)
$results = mysqli_insert_id($conn);
mysqli_close($conn);
return $results;
}
function get_connection()
{
// Connect to the DB