From fbac9f923d952bb7e25a119566c5f382b3c5a90d Mon Sep 17 00:00:00 2001 From: Roan Horning Date: Tue, 30 Sep 2025 23:32:20 -0400 Subject: [PATCH] Update files to use global $referrerurl variable If possible, capture the referring URL to use in links to static website pages. This way when coming from a distributed HPR website and not hackerpublicradio.com, clicking on a page link will return you to the original domain. --- hub/calendar.php | 12 ++++++------ hub/header.php | 30 +++++++++++++++--------------- hub/index.php | 2 ++ hub/request.php | 4 ++-- hub/upload.php | 26 +++++++++++++------------- ini/credentials.php | 10 ++++++++++ 6 files changed, 48 insertions(+), 36 deletions(-) diff --git a/hub/calendar.php b/hub/calendar.php index 9764e79..d1b5231 100644 --- a/hub/calendar.php +++ b/hub/calendar.php @@ -258,10 +258,10 @@ The HPR Schedule is entirely community driven and we recommend that you<

-There are only days to wait until next free slot. Please consider ">recording a show for us. +There are only days to wait until next free slot. Please consider ">recording a show for us.

    -
  1. Review the updated ">Stuff you need to know page.
  2. +
  3. Review the updated ">Stuff you need to know page.
  4. Select a date, or post to the reserve queue.
  5. Click the link in the confirmation email
  6. Then ">fill in a form.
  7. @@ -275,22 +275,22 @@ There are only days to wait un
  8. When the queue is filling up then leave some slots free for new contributors.
  9. Post non urgent shows into the first empty week.
  10. If you are uploading a series of shows then post them one every two weeks.
  11. -
  12. If you have a non urgent show that is timeless, then add it to the Reserve Queue.
  13. +
  14. If you have a non urgent show that is timeless, then add it to the Reserve Queue.

Add to the Reserve Queue ?

-request.php?id=9999">Post your show to the reserve queue if you don't care when it will be released. ">ⓘ +request.php?id=9999">Post your show to the reserve queue if you don't care when it will be released. about.html#reserve_queue";">ⓘ

Select a date in the current schedule ?

-Schedule the release day your show will be aired. ">ⓘ +Schedule the release day your show will be aired. about.html#scheduling_guidelines">ⓘ

-

Next Two Months ">ⓘ

+

Next Two Months about.html#workflow">ⓘ

diff --git a/hub/header.php b/hub/header.php index c259767..7d884c4 100644 --- a/hub/header.php +++ b/hub/header.php @@ -31,9 +31,9 @@ - + @@ -42,16 +42,16 @@
- +

- Site Map + Site Map - skip to main content

- Hacker - Public - Radio + Hacker + Public + Radio

Your ideas, projects, opinions - podcasted.

New episodes every weekday Monday through Friday.
@@ -60,14 +60,14 @@

diff --git a/hub/index.php b/hub/index.php index c62f900..a5f69c2 100644 --- a/hub/index.php +++ b/hub/index.php @@ -1,3 +1,5 @@ + + diff --git a/hub/request.php b/hub/request.php index 834b7f6..5034691 100644 --- a/hub/request.php +++ b/hub/request.php @@ -158,7 +158,7 @@ include 'header.php';

Requesting a slot for your show.

Please select your desired slot, and enter a valid email address.
- See our ">help page for more information + See our ">help page for more information

@@ -197,7 +197,7 @@ include 'header.php';
-

You must have your audio recording ready to upload ">before you pick a slot.

+

You must have your audio recording ready to upload ">before you pick a slot.

diff --git a/hub/upload.php b/hub/upload.php index 28b04ff..23cad7e 100644 --- a/hub/upload.php +++ b/hub/upload.php @@ -130,11 +130,11 @@ include 'header.php';

- + - +
Host Email (" target="_blank">?):Host Email (" target="_blank">?):
Image: (" target="_blank">?)Image: (" target="_blank">?)
"; @@ -180,15 +180,15 @@ include 'header.php';

Please fill in some information about this episode

- + - + - + - + - + - + - + - + - +
Title(*) (" target="_blank">?):Title(*) (" target="_blank">?):
Summary(*) (" target="_blank">?):Summary(*) (" target="_blank">?):
Explicit: (" target="_blank">?)Explicit: (" target="_blank">?) Is the show Explicit ?: Yes @@ -197,7 +197,7 @@ include 'header.php';
License: (" target="_blank">?)License: (" target="_blank">?)
Notes(*) (" target="_blank">?):Notes(*) (" target="_blank">?):
Format: (" target="_blank">?)Format: (" target="_blank">?) What format if any did you just use in the show notes above ?
Series: (" target="_blank">?)Series: (" target="_blank">?)
Tags: (" target="_blank">?)Tags: (" target="_blank">?)
Add a list of comma separated tags.
If you can provide tags for your show that would be appreciated; you are certainly the best judge of what makes good tags, but if not then a volunteer will add them later.
Upload Method: (" target="_blank">?)Upload Method: (" target="_blank">?) You have the choice of the following upload options:

- 1. Upload now via this browser: (" target="_blank">?)
+ 1. Upload now via this browser: (" target="_blank">?)

- 2. Provide a url we we can directly download it from: (" target="_blank">?)
+ 2. Provide a url we we can directly download it from: (" target="_blank">?)
This must be accessable using a curl or wget command.
Please avoid services that require login or downloading via a browser.
diff --git a/ini/credentials.php b/ini/credentials.php index 2db9372..78b44cf 100644 --- a/ini/credentials.php +++ b/ini/credentials.php @@ -20,4 +20,14 @@ $naughty_stings_file = '/path/to/strings.txt'; $justification_file = '/path/to/justification.txt'; # Read more: http://vidiame.com/php/how-to-block-multiple-ip-addresses-using-php +# The $referrerurl is used for links to pages from the orginating HPR site. +$referrerurl = $baseurl; +session_start(); +if ($_SESSION['referrerurl']) { + $referrerurl = $_SESSION['referrerurl']; +} +else if ($_SERVER["HTTP_REFERER"] && !str_starts_with($_SERVER["HTTP_REFERER"], $hubBaseurl)) { + $_SESSION['referrerurl'] = $_SERVER["HTTP_REFERER"]; + $referrerurl = $_SERVER["HTTP_REFERER"]; +} ?>