Post
Topic
Board Services
Re: CONTEST: design loyce.club home page
by
MMM005
on 04/10/2020, 15:03:46 UTC
It would also be nice to have a tiny bit of PHP (or whatever) that allows for an input field, and converts a number into an URL.
Examples

Code:
// Get $searchType from the input, where msgID=>posts, topicID=>posts and userID=>members
$searchType = "posts"; // by msgID

// Get $ID from the input (should be >= 1)
$ID = "4567891";

// testing
// $ID = "45678";
// $ID = "4567";
// $ID = "456";
// $ID = "45";
// $ID = "4";

$dirName = (strlen($ID) <= 4 ? "0" : substr($ID, 0, -4));
$url = "http://loyce.club/archive/$searchType/$dirName/$ID.html";
echo $url;

// http://loyce.club/archive/posts/456/4567891.html
// http://loyce.club/archive/posts/4/45678.html
// http://loyce.club/archive/posts/0/4567.html
// http://loyce.club/archive/posts/0/456.html
// ...

Do you mean that?