View Full Version : links only for selected usergroups
luroca
10-27-2005, 10:00 PM
Please, excuse my poor English, I post mostly with a online translator.
This simple hack allows to post links to websites only to selected usegroups.
Naturally, you must edit the plugin to set your authorized usergroups.
Example:
If the user is of a authorized usergroup, in the post it appears this:
www.vbulletin.com/forum
If he is not authorized, it appears:
NO_LINK
If this hack exists, sorry but I don?t find it.
Thanks to MioTraGusa for his aportation.
Don?t be timid, click Install :)
Please, feel free to improve and correct this hack.
lexx27
10-28-2005, 12:47 PM
any screenshot?
Shack Networks
10-28-2005, 01:10 PM
I think he explained the basics above and even I got the jist of it without the need for a screen shot and I am dumb and fat lol....
luroca
10-28-2005, 01:12 PM
No problem, one screenshot :)
lexx27
10-28-2005, 01:17 PM
Thanks! I know that he explains it well but i prefer to see it than imagine it. Do we have the option to change the "no_link" with something else? I think your hack is very useful!
luroca
10-28-2005, 01:21 PM
Do we have the option to change the "no_link" with something else?Yes, you can edit the plugin and to change NO_LINK with another message.
lexx27
10-28-2005, 01:52 PM
Great! Installs
dede1
10-29-2005, 06:55 AM
Thank
Can anyone tell m how I can reverse the permissions ? Usually we all have a whole bunch of usergroups and wouldn´t it be more effectiv to let this script check, wether the visitor is a not registered user (or banned, or miserable or whatever user) and hides the link with the given phrase while all others see & can klick the link ?
I´ve got about 32 usergroups (and counting) and it´s a mess, to set the permissions new every time you´ll add one..
Can anyone provide th code for that ?
luroca
10-30-2005, 09:15 AM
A plugin for not registered (and so) can not see links? It looks easy, I work in it.
A plugin for not registered (and so) can not see links? It looks easy, I work in it.
Something is messing up - I setup all the usergroups which should see links but whatever I do links don?t show up for any of the specified groups.
Used code :
<?xml version="1.0" encoding="ISO-8859-1"?>
<plugins>
<plugin active="1" product="vbulletin">
<title>No links</title>
<hookname>postbit_display_complete</hookname>
<phpcode><![CDATA[if (!is_member_of($post, 2, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18 ,19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42))
{
$this->post['message'] = ereg_replace('(http|www)([[:alnum:]/\n+-=%&:_.~?]+[#[:alnum:]+]*>)', '</a>(<a href="http://www.domain.tld/register.php" title="Please register first or login!" target="_blank">No link ?</a>)', $this->post['message']);
}]]></phpcode>
</plugin>
</plugins>
Should work, or ?
Btw: a little enhancement:
$this->post['message'] = ereg_replace('(http|www)([[:alnum:]/\n+-=%&:_.~?]+[#[:alnum:]+]*>)', '</a>(<a href="http://www.domain.tld/register.php" title="Please register first or login!" target="_blank">No link ?</a>)', $this->post['message']);
will show the unregistered users the best way of getting rid of the "No Links" problem ;)
With your permission, luroca, I attach an updated xml in here. Please remember to deinstall the original xml before using this one or for some reasons the changes are not updated in your forums.
luroca
10-30-2005, 10:53 AM
You don´t need my permission to post modifications but the only change I see in your version it´s that instead of NO_LINK message you put your own customized message :surprised:
You don?t need my permission to post modifications but the only change I see in your version it?s that instead of NO_LINK message you put your own customized message :surprised:
Sure, beside that the hack won?t work as mentioned two posts before - and I have no glue why.
On the other side, I?ve tried to work with <phpcode><![CDATA[if (is_member_of($post, ... which I?m pretty sure should reverse the !is_member_of statement. But still no go - any ideas ?
luroca
10-30-2005, 11:03 AM
Something is messing up - I setup all the usergroups which should see links but whatever I do links don?t show up for any of the specified groups.
Sorry, I am not sure of understand well, this hack if for not to post links, not for not to see links.
if (!is_member_of($post, 2, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18 ,19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42)) I don?t know if this is important but it must be 18, 19, 20, not 18 ,19, 20,
Regards
board.trash
10-30-2005, 12:01 PM
hello, is it possible this plugin to activate also in archives?
if yes, i will click Install :D
luroca
10-30-2005, 12:52 PM
Hello, I have disabled the archive for the same usegroups that cannot post links, but I´ll see if possible.
board.trash
10-30-2005, 01:32 PM
but I?ll see if possible.
oh thats great, can u update your plugin pls ?
thank you very much !
MioTraGusa
10-30-2005, 01:38 PM
ok nice hack anti-spam , but if one unregistered post this:
www.test.com
http://www.test.com
http://test.com
WWW.TEST.COM
http://WWW.TEST.COM
HTTP://WWW.TEST.COM
HTTP://www.test.com
HTTP://test.com
in the post a can see:
(No link ?)
(No link ?)
(No link ?)
WWW.TEST.COM
(No link ?)
HTTP://WWW.TEST.COM
HTTP://(No link ?)
HTTP://test.com
CAPITAL-LETTERS don?t work
one little change is proposed
change:
ereg_replace
for:eregi_replace
upss..
the result
(No link ?)
(No link ?)
(No link ?)
(No link ?)
(No link ?)
(No link ?)
(No link ?)
(No link ?)
bye... Sorry for my english
luroca
10-30-2005, 01:57 PM
Thanks, MioTraGusa, updated the xml.
Sorry for my englishIt?s better than mine :D
luroca
10-30-2005, 02:01 PM
oh thats great, can u update your plugin pls ?No yet, I am a very poor ?coder?
board.trash
10-30-2005, 02:22 PM
No yet, I am a very poor ?coder?
hmm damn :devious:
anybody else can do that?
luroca
10-30-2005, 02:51 PM
Help wanted :)
MioTraGusa
10-30-2005, 03:44 PM
<i>board.trash</i> if one guesst reply the post, he can see the original links in the topic review
it is no important bug, but i comunicate it
board.trash
10-30-2005, 04:47 PM
board.trash if one guesst reply the post, he can see the original links in the topic review
it is no important bug, but i comunicate it
oh thats not really good :disappointed: thank you for the info :up:
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.