From 74afe991d8ca8aeda2311de9f12775e0f08bcbf9 Mon Sep 17 00:00:00 2001 From: Alice Rhodes Date: Sat, 22 Feb 2020 11:25:33 -0800 Subject: [PATCH] Site name support and an index listing --- frame.php | 25 +++++++++++++++---------- ring.php | 12 +++++++----- ring_index.php | 29 +++++++++++++++++++++++++++++ 3 files changed, 51 insertions(+), 15 deletions(-) create mode 100644 ring_index.php diff --git a/frame.php b/frame.php index 1345df7..d9859ec 100644 --- a/frame.php +++ b/frame.php @@ -28,19 +28,24 @@ $next = ""; $last = $ring_size - 1; +$index = array_keys( $web_ring ); + if( $id == $last ) { // are we at the end? - $next = $web_ring[0]; // first one - $prev = $web_ring[$id-1]; // previous one + $next = $index[0]; // first one + $prev = $index[$id-1]; // previous one } else if( $id == 0 ) { // are we at the beginning? - $next = $web_ring[$id+1]; // next one - $prev = $web_ring[$last]; // last one + $next = $index[$id+1]; // next one + $prev = $index[$last]; // last one } else { // somewhere in the middle - $next = $web_ring[$id+1]; - $prev = $web_ring[$id-1]; + $next = $index[$id+1]; + $prev = $index[$id-1]; } -$rand = $web_ring[rand(0,$last)]; +$rand = $index[rand(0,$last)]; +$rand_url = $web_ring[$rand]; +$prev_url = $web_ring[$prev]; +$next_url = $web_ring[$next] ?> @@ -63,9 +68,9 @@ $rand = $web_ring[rand(0,$last)];

hackers town webring

diff --git a/ring.php b/ring.php index 918d20d..8f43edb 100644 --- a/ring.php +++ b/ring.php @@ -2,12 +2,14 @@ $web_ring = array(); -$web_ring[0] = "https://alicerhodes.com/web-l00p/test.html"; -$web_ring[1] = "https://alicerhodes.com/web-l00p/page01.html"; -$web_ring[2] = "https://alicerhodes.com/web-l00p/page02.html"; -$web_ring[3] = "https://alicerhodes.com/web-l00p/page03.html"; -$web_ring[4] = "https://alicerhodes.com/web-l00p/page04.html"; +/* "Site Title" "Site URL=" */ +$web_ring["Start Page"] = "https://alicerhodes.com/web-l00p/test.html"; +$web_ring["Page 1"] = "https://alicerhodes.com/web-l00p/page01.html"; +$web_ring["Page 2"] = "https://alicerhodes.com/web-l00p/page02.html"; +$web_ring["Page 3"] = "https://alicerhodes.com/web-l00p/page03.html"; +$web_ring["Page 4"] = "https://alicerhodes.com/web-l00p/page04.html"; $ring_size = count( $web_ring ); + ?> diff --git a/ring_index.php b/ring_index.php new file mode 100644 index 0000000..f9f9fd8 --- /dev/null +++ b/ring_index.php @@ -0,0 +1,29 @@ + + + + + + web-l00p demo page + + + +
+ +

Webring Index

+ +
    +".''.$index[$i].''; +} +?> +
+ +
+ + + +