|
Navigation
>> Main Links
>> Creations/Media
>> External
|
Diary Data (2026-04-30_webrings.txt)
Hey! iDestyKK here. It's been a month since my last diary entry. Sorry about that! Webrings?Today, I wanted to write about webrings. There are a few changes on my website pertaining to webrings. In fact, changes in the last few weeks had to do with them. So, what is a webring? Well, put simply, it is a way to link websites together. Websites are linked through a circular data structure so if you click "Next" on enough sites, you'll eventually end up back where you started. It loops. Simple enough. As of writing this, my site is part of 15 webrings, linking to 30 different sites. However, my site has 2 different versions of webring pages:
Regarding the classic version, all you have to do to add a webring widget to your page is... copy and paste the code that the webring developer gives you onto your page. Regarding the simplified version, I had to reverse-engineer how the webrings worked to create custom widgets. It's not that special, actually. Reverse-engineer?Webrings are actually very simple to implement. Usually people just throw websites into an array and use some JavaScript to find where your page sits in the array, and then increments/decrements the array for next/previous. This also makes randomisation easy. The only math involved is modulo, to make the array appear circular (so the last site can link to the first and vice versa).
What I just described is how OnionRing.js works. This is a popular way to
implement webrings which I've seen and joined. So, what's the deal? Well,
most (if not, all) OnionRing webrings require you to import a
JavaScript
So if we import the variables file, we can access HTML & JavaScript
In this case, it will output Navigating the arraySo, if we want to grab the next site and the previous site, we need to navigate the array in a very specific way. You might be inclined to believe it's as simple as adding or subtracting 1. But this isn't the case. Especially in my example up above where my site is the first index in the array. If you go backwards, you need the website at index 3, not -1. The simple way to do this is the following: HTML & JavaScript
We are almost set up. Now to access the website URLs, we have to use
What about other types of webrings?The only other type I have yet to encounter is one where the webring site handles the logic instead of your site and JavaScript. These come in the form of URLs like:
In this case, it is even simpler to implement a custom widget, since you do not need to implement literally anything. Just link to those respective links in your custom widget and their site will handle the rest. PHP implementationMy simplified/consistent webrings page is generated with PHP. It still uses JavaScript to deal with OnionRing. However, the logic is put in place by PHP. My page is actually very simple on paper. It literally looks like this: HTML & PHP
Each ConclusionThat's my nerd-talk about webrings! Compared to my other reverse-engineer efforts on CN_Blog, this was much simpler to do. I like to tinker with things though, a normal thing for an engineer. But that wraps it up for this diary entry. I hope you learned something. |
An iDestyKK Production. Copyright 2016-2026, All Rights Reserved.