f95zone Displays "You must be registered to view links" for users who are not logged in.

_ZONE

New Member
Jan 4, 2023
2
0
I'm a beginner web developer and am very curious as to how all external connections are recognized and replaced (are they all?).
I know about regular expressions, but the ones I written myself don't handle the part where the url is connected to the text.
domain/pathblabla blabla is not part of the url.
how does f95zone do it :)
 

Count Morado

Devoted Member
Respected User
Jan 21, 2022
8,350
16,106
I'm a beginner web developer and am very curious as to how all external connections are recognized and replaced (are they all?).
I know about regular expressions, but the ones I written myself don't handle the part where the url is connected to the text.
domain/pathblabla blabla is not part of the url.
how does f95zone do it :)
Wrong forum to ask - don't even know if there is an applicable forum on this site to ask except maybe off-topic. You'd probably be better off looking for a site which has forums specifically for questions like this.

However, it's just a few lines of code which says, in brief - if user logged in, then show link class, else show spoiler class. It has nothing to do with the URL.

I don't know how "beginner" you are - but depending upon the application you are using to build a forum (Xenforo is used for F95), there is a wealth of custom code available for use if you have no clue how to do it yourself at the present time.
 
  • Like
Reactions: _ZONE

_ZONE

New Member
Jan 4, 2023
2
0
thank you for your reply. it is indeed a bad idea to ask such questions here and I will follow your advice.
thanks again.:)
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,971
16,228
Wrong forum to ask - don't even know if there is an applicable forum on this site to ask except maybe off-topic.
I guess the dev section is the less off-topic for this. But there's a grumpy grandpa there that would sarcastically cringe I guess.


However, it's just a few lines of code which says, in brief - if user logged in, then show link class, else show spoiler class. It has nothing to do with the URL.
More precisely it's probably linked to the BBcode tag used. Server side when the page is built, there's something like:
Code:
CASE BBcode:
  [...]
  "link":
       ADD formatBBcode( content )
  [...]

FNCT formatBBcode( content ):
   IF UserLogged:
       return formatted content
   ELSE
      return obfuscation
And detecting if the user is or not logged is done through the cookies.