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.
This commit is contained in:
2025-09-30 23:32:20 -04:00
parent 4d51954c3c
commit fbac9f923d
6 changed files with 48 additions and 36 deletions

View File

@@ -130,11 +130,11 @@ include 'header.php';
<form method="POST" action="upload_confirm.php" enctype="multipart/form-data">
<table class="upload">
<tr>
<td>Host Email (<a href="<?php echo "${baseurl}about.html#email"; ?>" target="_blank">?</a>):</td>
<td>Host Email (<a href="<?php echo "${referrerurl}about.html#email"; ?>" target="_blank">?</a>):</td>
<td><?php echo $email;?></td>
</tr>
<tr>
<td>Image: (<a href="<?php echo "${baseurl}about.html#image"; ?>" target="_blank">?</a>)</td>
<td>Image: (<a href="<?php echo "${referrerurl}about.html#image"; ?>" target="_blank">?</a>)</td>
<td>
<?php
echo "<img src=\"$image_url\" alt=\"host image\" /><br /><small><em>";
@@ -180,15 +180,15 @@ include 'header.php';
<h2>Please fill in some information about this episode</h2>
<table class="upload">
<tr>
<td><strong>Title(*) (<a href="<?php echo "${baseurl}about.html#Title"; ?>" target="_blank">?</a>):</strong></td>
<td><strong>Title(*) (<a href="<?php echo "${referrerurl}about.html#Title"; ?>" target="_blank">?</a>):</strong></td>
<td><input required type="text" name="title" size="50" maxlength="100" placeholder="Enter a short descriptive title for your show."></td>
</tr>
<tr>
<td><strong>Summary(*) (<a href="<?php echo "${baseurl}about.html#Short_Summary"; ?>" target="_blank">?</a>):</strong></td>
<td><strong>Summary(*) (<a href="<?php echo "${referrerurl}about.html#Short_Summary"; ?>" target="_blank">?</a>):</strong></td>
<td><input required type="text" name="summary" size="70" maxlength="100" placeholder="This is a short 100 character summary of what your show is about."></td>
</tr>
<tr>
<td><strong>Explicit: (<a href="<?php echo "${baseurl}about.html#Explicit"; ?>" target="_blank">?</a>)</strong></td>
<td><strong>Explicit: (<a href="<?php echo "${referrerurl}about.html#Explicit"; ?>" target="_blank">?</a>)</strong></td>
<td>
Is the show <em>Explicit</em> ?:
<input required type="radio" name="explicit" value="Yes">Yes
@@ -197,7 +197,7 @@ include 'header.php';
</td>
</tr>
<tr>
<td><strong>License: (<a href="<?php echo "${baseurl}about.html#License"; ?>" target="_blank">?</a>)</strong></td>
<td><strong>License: (<a href="<?php echo "${referrerurl}about.html#License"; ?>" target="_blank">?</a>)</strong></td>
<td>
<select name="license">
<option value="CC-BY-SA" selected>CC-BY-SA</option>
@@ -212,7 +212,7 @@ include 'header.php';
</td>
</tr>
<tr>
<td><strong>Notes(*) (<a href="<?php echo "${baseurl}about.html#show_notes"; ?>" target="_blank">?</a>):</strong></td>
<td><strong>Notes(*) (<a href="<?php echo "${referrerurl}about.html#show_notes"; ?>" target="_blank">?</a>):</strong></td>
<td>
<noscript>
<textarea required name="notes" maxlength="40000" rows="20" cols="70" placeholder="Please add your show notes here." ></textarea>
@@ -222,7 +222,7 @@ include 'header.php';
</tr>
<noscript>
<tr>
<td>Format: (<a href="<?php echo "${baseurl}about.html#shownotes_format"; ?>" target="_blank">?</a>)</td>
<td>Format: (<a href="<?php echo "${referrerurl}about.html#shownotes_format"; ?>" target="_blank">?</a>)</td>
<td>
<small>What format if any did you just use in the show notes above ?</small><br />
<select name="shownotes_format">
@@ -237,7 +237,7 @@ include 'header.php';
</tr>
</noscript>
<tr>
<td>Series: (<a href="<?php echo "${baseurl}about.html#series"; ?>" target="_blank">?</a>)</td>
<td>Series: (<a href="<?php echo "${referrerurl}about.html#series"; ?>" target="_blank">?</a>)</td>
<td>
<?php
$result = mysqli_query($connection, "SELECT id, name FROM miniseries WHERE private=0 ORDER BY name ASC");
@@ -251,22 +251,22 @@ include 'header.php';
</td>
</tr>
<tr>
<td>Tags: (<a href="<?php echo "${baseurl}about.html#tags"; ?>" target="_blank">?</a>)</td>
<td>Tags: (<a href="<?php echo "${referrerurl}about.html#tags"; ?>" target="_blank">?</a>)</td>
<td><input required type="text" name="tags" size="70" maxlength="100" placeholder="Add a list of comma separated tags." /><br />
Add a list of <strong>comma separated</strong> tags.<br />
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.
</td>
</tr>
<tr>
<td><strong>Upload Method: (<a href="<?php echo "${baseurl}about.html#upload_method"; ?>" target="_blank">?</a>)</strong></td>
<td><strong>Upload Method: (<a href="<?php echo "${referrerurl}about.html#upload_method"; ?>" target="_blank">?</a>)</strong></td>
<td>
<em>You have the choice of the following upload options:</em> <br />
<p>
<strong>1. Upload now</strong> via this browser: (<a href="<?php echo "${baseurl}about.html#browser"; ?>" target="_blank">?</a>)<br />
<strong>1. Upload now</strong> via this browser: (<a href="<?php echo "${referrerurl}about.html#browser"; ?>" target="_blank">?</a>)<br />
<input type="file" multiple="multiple" name="media_files[]" title="select if using the http upload option" />
</p>
<p>
<strong>2. Provide a url</strong> we we can directly download it from: (<a href="<?php echo "${baseurl}about.html#url"; ?>" target="_blank">?</a>)<br />
<strong>2. Provide a url</strong> we we can directly download it from: (<a href="<?php echo "${referrerurl}about.html#url"; ?>" target="_blank">?</a>)<br />
This must be accessable using a curl or wget command.<br />
Please avoid services that require login or downloading via a browser.<br />
<input type="url" size="30" name="url" placeholder="https://example.com/hpr9999.flac">