miniBB ® miniBB®
miniBB Support Forums
 | Forums | Register | Reply | Search | Statistics | Manual |
Specific miniBB Support Forums / Specific /   

How can I mark a special link exclusively for members

Author Jaime
Registered
#1 | Posted: 9 Jun 2012 10:16 
The code here make links in posts global only for members.

Is there a way, as an admin or mod, mark a special link in an article exclusively for members ?.
This special link will then be visible only to members.

Author Paul
Lead Developer
#2 | Posted: 9 Jun 2012 12:18 
Jaime:
Is there a way, as an admin or mod, mark a special link in an article exclusively for members ?.
This special link will then be visible only to members.

There is such way, but the implementation of it is not that quick. First of all, we need to introduce a special [url] tag which would contain at least a special ID or something like this (that way we could recognize the "special" links from "regular" links). Then the function you have mentioned, would be extended to replace such links only.

Author Jaime
Registered
#3 | Posted: 8 Dec 2012 10:27 
I've now solved for me like this: I define in the setup options: $adminHTML=TRUE; Now I can use HTML in posts.

Will i now make a special link only to members, i create the link code into a span tag :)

if($GLOBALS['user_id']==0) {
$GLOBALS['posterText']=preg_replace("#<span class=\"hidelinkforguests\"><a href=\"(.+?)>(.*?)</a></span>#is", '[Available to Members only]', $GLOBALS['posterText']);
}

[Available to Members only] can be omitted, then a guest sees nothing from the link.

Author Paul
Lead Developer
#4 | Posted: 8 Dec 2012 16:23 
I think it's a bit wrong solution. The script will save the code straight, so this rule works only at the stage of posting the message.
As far as I understood from your post, you want to display some certain link to members, and do not display it to guests (or by some other rule).
This is possible only if in the database you already have stored this link.
But parseMessage function, when displaying a message, and regarding who's logge in, could apply a certain formatting operation to this text.

Author Jaime
Registered
#5 | Posted: 9 Dec 2012 08:31 
Thank you Paul, for this helpful information. And, I do not really need.

Specific miniBB Support Forums / Specific / How can I mark a special link exclusively for members Top

Your Reply Click this icon to move up to the quoted message

 Short link for this topic:

 ?
Only registered users are allowed to post here. Please, enter your username/password details upon posting a message, or register first.


Before posting, make sure your message is compliant with our forum posting rules. If not, it may be locked or deleted with no explanation.
 
miniBB Support Forums Powered by Forum Software miniBB ® Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contacts
Proceed with the Captcha add-on: protect your miniBB-forums from the automated spam and flood.
Captcha Addon for miniBB