Compare commits

...

23 Commits

Author SHA1 Message Date
  Aayla Semyonova (she/her) 8553d1e690
This is the only filter that works??? 4 months ago
  Aayla Semyonova (she/her) ef429d7efb
Fixed meta tags for / 4 months ago
  Aayla Semyonova (she/her) 799e557121
Added meta tags to / 4 months ago
  Aayla Semyonova (she/her) 0eed3538a9
Added meta tags to /resources and subpages 4 months ago
  Aayla Semyonova (she/her) 3c2c74b904
Added meta tags to /resolutions 4 months ago
  Aayla Semyonova (she/her) 9b7b55e31c
Added meta tags to /news/index.php 4 months ago
  Aayla Semyonova (she/her) 1b159a29d1
Added TODO comment 4 months ago
  Aayla Semyonova (she/her) fa3a3fc0b3
Added meta tags to /news/story.php 4 months ago
  Aayla Semyonova (she/her) e12fa11900
Added meta tags to /leadership 4 months ago
  Aayla Semyonova (she/her) ec310ffbd7
Added meta tags to /instructor 4 months ago
  Aayla Semyonova (she/her) f5b37b7dd7
Added warning 4 months ago
  Aayla Semyonova (she/her) 2d4a77606b
Added meta tags to /edu 4 months ago
  Aayla Semyonova (she/her) 6e87976e73
Added tags to /contact 4 months ago
  Aayla Semyonova (she/her) 610a826a62
Added tags to /chapters 4 months ago
  Aayla Semyonova (she/her) adfd494281
Added tags to /canary 4 months ago
  Aayla Semyonova (she/her) d33cb1b88d
Added tags to /bylaws 4 months ago
  Aayla Semyonova (she/her) 6567faaa7b
Added tags to /about 4 months ago
  Aayla Semyonova (she/her) 9b041fe0b7
Update to create_tags() function 4 months ago
  Aayla Semyonova (she/her) c413d7c1d9
Changed commits 4 months ago
  Aayla Semyonova (she/her) 68100650bc
Made function to create meta tags 4 months ago
  Aayla Semyonova (she/her) 9aef150fd0
Removed unused files 4 months ago
  Aayla Semyonova (she/her) 190d6c7e54
Removed <title> tags from pages 4 months ago
  Aayla Semyonova (she/her) 5f1724b8c1
Created meta_tags/* 4 months ago
17 changed files with 137 additions and 30 deletions
Split View
  1. +4
    -2
      about/index.php
  2. +7
    -2
      bylaws/index.php
  3. +7
    -2
      canary/index.php
  4. +7
    -1
      chapters/index.php
  5. +4
    -2
      contact/index.php
  6. +7
    -2
      edu/index.php
  7. +6
    -2
      index.php
  8. +4
    -2
      instructor/index.php
  9. +4
    -2
      leadership/index.php
  10. +4
    -2
      news/index.php
  11. +9
    -2
      news/story.php
  12. +52
    -0
      res/php/headtags.php
  13. +0
    -1
      res/template.php
  14. +4
    -2
      resolutions/index.php
  15. +7
    -2
      resources/carry-laws/index.php
  16. +7
    -2
      resources/hunting-laws/index.php
  17. +4
    -2
      resources/index.php

+ 4
- 2
about/index.php View File

@ -19,8 +19,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Socialist Rifle Association - About</title>
<?php include("../res/php/headtags.php") ?>
<?php
include("../res/php/headtags.php");
create_tags();
?>
</head>
<body>
<?php include("../res/php/top.php") ?>


+ 7
- 2
bylaws/index.php View File

@ -19,8 +19,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Socialist Rifle Association - Bylaws</title>
<?php include("../res/php/headtags.php") ?>
<?php
include("../res/php/headtags.php");
create_tags(
"Current Bylaws",
"The current bylaws of the Socialist Rifle Association"
);
?>
</head>
<body>
<?php include("../res/php/top.php") ?>


+ 7
- 2
canary/index.php View File

@ -19,8 +19,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Socialist Rifle Association - Warrant Canary</title>
<?php include("../res/php/headtags.php") ?>
<?php
include("../res/php/headtags.php");
create_tags(
"Warrant Canary",
"The warrant canary published regularly by the Socialist Rifle Association"
);
?>
<style>
code {


+ 7
- 1
chapters/index.php View File

@ -19,7 +19,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Socialist Rifle Association</title>
<?php
include("../res/php/headtags.php");
// TODO: Come back with a description and image
create_tags();
?>
<link rel="icon" href="../img/favicon.png">
<link rel="stylesheet" type="text/css" href="https://srastatic.nyc3.cdn.digitaloceanspaces.com/web/css/style.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">


+ 4
- 2
contact/index.php View File

@ -19,8 +19,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Socialist Rifle Association - Contact Us</title>
<?php include("../res/php/headtags.php") ?>
<?php
include("../res/php/headtags.php");
create_tags();
?>
</head>
<body>
<?php include("../res/php/top.php") ?>


+ 7
- 2
edu/index.php View File

@ -19,8 +19,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Socialist Rifle Association</title>
<?php include("../res/php/headtags.php") ?>
<?php
include("../res/php/headtags.php");
create_tags(
"Education",
"Educational materials provided by the Socialist Rifle Assocation"
);
?>
</head>
<body>


+ 6
- 2
index.php View File

@ -19,8 +19,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Socialist Rifle Association</title>
<?php include("res/php/headtags.php"); ?>
<?php
include("res/php/headtags.php");
create_tags(
"Home"
);
?>
</head>
<style type="text/css">
@keyframes banner-slide-down {


+ 4
- 2
instructor/index.php View File

@ -19,8 +19,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Socialist Rifle Association</title>
<?php include("../res/php/headtags.php") ?>
<?php
include("../res/php/headtags.php");
create_tags();
?>
</head>
<body>
<?php include("../res/php/top.php") ?>


+ 4
- 2
leadership/index.php View File

@ -19,8 +19,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Socialist Rifle Association - Leadership</title>
<?php include("../res/php/headtags.php") ?>
<?php
include("../res/php/headtags.php");
create_tags();
?>
<style>
/* Style the button that is used to open and close the collapsible content */
.collapsible {


+ 4
- 2
news/index.php View File

@ -19,8 +19,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Socialist Rifle Association</title>
<?php include("../res/php/headtags.php") ?>
<?php
include("../res/php/headtags.php");
create_tags();
?>
<style type="text/css">
h1 {
font-size: 1.5em;


+ 9
- 2
news/story.php View File

@ -28,8 +28,15 @@ else {
<!DOCTYPE html>
<html lang="en">
<head>
<title>Socialist Rifle Association</title>
<?php include("../res/php/headtags.php") ?>
<?php
include("../res/php/headtags.php");
// TODO: Stop hardcoding this when the admin panel is ready
create_tags(
$data['title'],
$data['subtitle'],
"https://srastatic.nyc3.cdn.digitaloceanspaces.com/web/img/news/$file/" . $data['thumb']
);
?>
</head>
<body>
<?php


+ 52
- 0
res/php/headtags.php View File

@ -19,6 +19,58 @@
<link rel="icon" href="https://srastatic.nyc3.cdn.digitaloceanspaces.com/web/img/theme/favicon.png">
<link rel="stylesheet" type="text/css" href="/res/css/style.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Primary Meta Tags -->
<?php
// Create meta tags
function create_tag($property, $content) {
return "<meta property='$property' content='$content'>";
}
function create_tags($pageName = null, $pageDescription = null, $pageImage = null) {
// Resolve default arguments
if ($pageName === null) {
// FIXME: FILTER_SANITIZE_EMAIL is the wrong filter for this and is potentially insecure.
// ! Do not deploy.
$pageName = ucwords(
filter_var($_SERVER['REQUEST_URI'], FILTER_SANITIZE_EMAIL)
);
}
if ($pageDescription === null) {
$pageDescription = "";
}
// TODO: Stop hardcoding this once the admin panel is ready.
if ($pageImage === null) {
$pageImage = "https://srastatic.nyc3.cdn.digitaloceanspaces.com/web/img/logo/national/Socialist%20Rifle%20Association%20logo.png";
}
// Define a nested array of property => content because capitalism is the most
// efficient allocation of resources and having to create 3 slightly different
// tags with the same value because they're for different platforms is the free
// market at work producing efficient outcomes that we should accept the resuling
// inequality of.
//
// Holy fucking shit I hate the tech industry so much.
$metaTags = array(
$pageName . " - Socialist Rifle Association" => array(["title", "og:title", "twitter:title"]),
$pageDescription => array(["description", "og:description", "twitter:description"]),
$pageImage => array(["og:image", "twitter:image"]),
// FIXME: I'm not quite certain why, but using user input in this way feels extemely insecure.
// ! Do not deploy until fixed.
"https://socialistra.org" . filter_var($_SERVER['REQUEST_URI'], FILTER_SANITIZE_URL) => array(["og:url", "twitter:url"])
);
foreach ($metaTags as $value => $tags) {
foreach (array_values($tags) as $tag_array) {
foreach($tag_array as $tag) {
echo create_tag($tag, $value);
}
}
}
// Create regular title tag
echo "<title>$pageName - Socialist Rifle Association</title>";
}
?>
<!-- Custom Scripts -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js" type="text/javascript"></script>
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.1.0/css/all.css" integrity="sha384-lKuwvrZot6UHsBSfcMvOkWwlCMgc0TaWr+30HWe3a4ltaBwTZhyTEggF5tJv8tbt" crossorigin="anonymous">
<!-- Global site tag (gtag.js) - Google Analytics -->


+ 0
- 1
res/template.php View File

@ -19,7 +19,6 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Socialist Rifle Association</title>
<?php include("../res/php/headtags.php") ?>
</head>
<body>


+ 4
- 2
resolutions/index.php View File

@ -19,8 +19,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Socialist Rifle Association</title>
<?php include("../res/php/headtags.php") ?>
<?php
include("../res/php/headtags.php");
create_tags();
?>
<style type="text/css">
p {
font-weight: 200;


+ 7
- 2
resources/carry-laws/index.php View File

@ -19,8 +19,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Socialist Rifle Association</title>
<?php include("../../res/php/headtags.php") ?>
<?php
include("../res/php/headtags.php");
create_tags(
"State Carry Laws",
"A list of firearms carry laws by state."
);
?>
<style type="text/css">
ul.state-cont {
width: 100%;


+ 7
- 2
resources/hunting-laws/index.php View File

@ -19,8 +19,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Socialist Rifle Association</title>
<?php include("../../res/php/headtags.php") ?>
<?php
include("../res/php/headtags.php");
create_tags(
"State Hunting Laws",
"A list of hunting laws by state"
);
?>
<style type="text/css">
ul.state-cont {
width: 100%;


+ 4
- 2
resources/index.php View File

@ -19,8 +19,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Socialist Rifle Association</title>
<?php include("../res/php/headtags.php") ?>
<?php
include("../res/php/headtags.php");
create_tags();
?>
</head>
<body>
<?php include("../res/php/top.php") ?>


Loading…
Cancel
Save