I searched and could not find this question being asked or answered so here goes.
Is it possible to change the url for user profiles from the basic efiction one - http://www.TWCSlibrary.net/viewuser.php?uid=1 - to one ore like fanfiction.net uses - https://www.twcslibrary.net/jennmc75 (penname)
I am not a coder so I'm afraid to experiment to figure it out.
That would require a Rewrite via .htaccess because of virtual folder and a modification of viewuser.php because of penname instead if ID.
Being on the brink of a new version, I doubt this will happen, honestly.
Self-reply, first sign of serious boredom ...
Well, I decided to implement this feature in the new version, but this morning thought "well, it can't be that hard" ... and it wasn't
So, here's the modification guide:
Step #1: open viewuser.php, find
// If uid isn't a number kill the script with an error message. The only way this happens is a hacker.
at or around line #40
insert right before it
// If uid equals an author's penname, rewrite to the ID
if(empty($uid)&&isset($_REQUEST['uid']))
{
$authorquery = dbquery("SELECT "._UIDFIELD." as uid FROM "._AUTHORTABLE." WHERE "._PENNAMEFIELD." = '".escapestring($_REQUEST['uid'])."' LIMIT 1");
list($tempuid) = dbrow($authorquery);
if(isNumber($tempuid)&&$tempuid>0) $uid = $tempuid;
}
Now you can call viewuser.php?uid=AnyName - that's ok, but not what we wanted, so ....
Step #2: open file .htaccess in the root folder, add
RewriteEngine on
RewriteRule ^authors/(.*)$ /viewuser.php?uid=$1 [R]
If you already have any rewrites there, just add the second line.
Now you can call http://yourefiction.net/authors/AnyName using the penname.
Serve ice cold with a slice of lemon.
(Usual ferengi disclaimer applies)
