Browse code

Removed need to put ID and view tags into posts

haywalk authored on 27/09/2020 16:05:52
Showing 3 changed files

... ...
@@ -20,7 +20,9 @@
20 20
 				$file = "./posts/".$posts[$i];
21 21
 				if (file_exists($file)) {
22 22
 					echo "<hr>";
23
-					readfile($file);
23
+					echo "<a href='view.php?post=".$posts[$i]."'>View/link this post</a>";
24
+                                        echo "<a id='".substr($posts[$i], 4)."'></a>";
25
+                                        readfile($file);
24 26
 				}
25 27
 
26 28
 			}
... ...
@@ -1,8 +1,3 @@
1
-<a id="26september2020"></a>
2
-
3 1
 <h3>26 September 2020 - Example post!</h3>
4 2
 
5
-<a href="view.php?post=001-26september2020">View/link this post</a>
6
-
7 3
 <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
8
-
... ...
@@ -1,13 +1,5 @@
1
-<a id="27september2020"></a>
2
-
3 1
 <h3>27 September 2020 - SimpleBlogScript</h3>
4 2
 
5
-<a href="view.php?post=002-27september2020">View/link this post</a>
6
-
7 3
 <p>This is <a href="https://www.haywalk.ca">haywalk</a>'s blog script. The code can be found <a href="https://github.com/haywalk/simpleblogscript">here</a>.</p>
8 4
 
9
-<p><b>Steps to posting:</b> To post to this blog, add a plaintext file (with no *.txt ending), and name it <code>###-DDmonthYYYY</code>, where <code>###</code> is the post number (your first post should be 1, etc.), <code>DD</code> is the day (numerical), <code>month</code> is the month (written/lowercase), and <code>YYYY</code> is the year (numerical).</p>
10
-
11
-<p>Inside the document, add a line with <code>&lt;a id="DDmonthYYYY"&gt;</code>, a title header somewhere (but you don't necessarily have to add one), and a 'view' link that links to <code>view.php?post={FILENAME}</code>, where <code>{FILENAME}</code> is the filename of your post. Then write your post! That should be it!</p>
12
-
13
-<p>Note: You can just copy these example posts and change the tags :^)</p>
5
+<p><b>Steps to posting:</b> To post to this blog, add a plaintext file (with no *.txt ending), and name it <code>###-DDmonthYYYY</code>, where <code>###</code> is the post number (your first post should be 1, etc.), <code>DD</code> is the day (numerical), <code>month</code> is the month (written/lowercase), and <code>YYYY</code> is the year (numerical). Then, you simply write your post out in HTML in your post file!</p>