News:

Wondering if this will always be free?  See why free is better.

Main Menu

Hide links based on membergroups

Started by ~DS~, March 23, 2010, 08:38:53 PM

Previous topic - Next topic

~DS~

How to hide links(url links) that I don't want certain members based on membergroups?

I already posted it at SP and it's worth posting here too.
"There is no god, and that's the simple truth. If every trace of any single religion were wiped out and nothing were passed on, it would never be created exactly that way again. There might be some other nonsense in its place, but not that exact nonsense. If all of science were wiped out, it would still be true and someone would find a way to figure it all out again."
~Penn Jillette – God, NO! – 2011

Arantor

You could always start from modifying the Registered Links mod...

~DS~

Quote from: Arantor on March 23, 2010, 08:40:16 PM
You could always start from modifying the Registered Links mod...
I don't want a mod, just the html code for the block.
"There is no god, and that's the simple truth. If every trace of any single religion were wiped out and nothing were passed on, it would never be created exactly that way again. There might be some other nonsense in its place, but not that exact nonsense. If all of science were wiped out, it would still be true and someone would find a way to figure it all out again."
~Penn Jillette – God, NO! – 2011

~DS~

Let's look at my signatures for example where you see three links that link to SD, DP, SA.

One membergroup can see whole 3 links and the others can only see one.
"There is no god, and that's the simple truth. If every trace of any single religion were wiped out and nothing were passed on, it would never be created exactly that way again. There might be some other nonsense in its place, but not that exact nonsense. If all of science were wiped out, it would still be true and someone would find a way to figure it all out again."
~Penn Jillette – God, NO! – 2011

Arantor

Yes.... to do that is a modification of the URL bbcode, the foundation of which is the Registered Links mod. There's absolutely no way in just HTML to do it, so it has to be done in SMF itself in a modification of the bbcode somehow.

~DS~

Ahh, not what i am looking for, it would be something simliar to this
'show' => !$user_info['is_guest'],
But membergroups.

So it would hide invisible to certain membergroups.
"There is no god, and that's the simple truth. If every trace of any single religion were wiped out and nothing were passed on, it would never be created exactly that way again. There might be some other nonsense in its place, but not that exact nonsense. If all of science were wiped out, it would still be true and someone would find a way to figure it all out again."
~Penn Jillette – God, NO! – 2011

Arantor


~DS~

Quote from: Arantor on March 23, 2010, 09:09:28 PM
What groups?
There are some groups I have created. Let's said that regular group can see one link in the block, Charter membergoup can see 3 links only visible to them.
"There is no god, and that's the simple truth. If every trace of any single religion were wiped out and nothing were passed on, it would never be created exactly that way again. There might be some other nonsense in its place, but not that exact nonsense. If all of science were wiped out, it would still be true and someone would find a way to figure it all out again."
~Penn Jillette – God, NO! – 2011

Arantor

And what ids would these groups have? What rules are around them being visible or not?

~DS~

Quote from: Arantor on March 23, 2010, 09:13:51 PM
And what ids would these groups have? What rules are around them being visible or not?

ids are 16, 17, 20.  Because I don't want to create another block, I as admin, will see 2 blocks. So that's why I want to do it in one block
"There is no god, and that's the simple truth. If every trace of any single religion were wiped out and nothing were passed on, it would never be created exactly that way again. There might be some other nonsense in its place, but not that exact nonsense. If all of science were wiped out, it would still be true and someone would find a way to figure it all out again."
~Penn Jillette – God, NO! – 2011

Arantor

So what are the rules around them being visible?

Bear in mind we're talking about the url bbcode in general, so it applies equally to all links.

~DS~

Quote from: Arantor on March 23, 2010, 09:19:09 PM
So what are the rules around them being visible?

Bear in mind we're talking about the url bbcode in general, so it applies equally to all links.
Those links link to a hidden private board only for certain membergroup, namely Charter. If it was visible which other membergroup doesn't have a access, it will return a error. "You are a not allow to access the board or is off limit to you" blah, blah.

You understand now?
"There is no god, and that's the simple truth. If every trace of any single religion were wiped out and nothing were passed on, it would never be created exactly that way again. There might be some other nonsense in its place, but not that exact nonsense. If all of science were wiped out, it would still be true and someone would find a way to figure it all out again."
~Penn Jillette – God, NO! – 2011

Arantor

I do but I don't see how you can possibly implement it without more work.

A link is a link is a link. You have to somehow indicate that a link should be hidden, because otherwise it's just [url=destination]text[/url]. Something needs to be in there to tell it on a per link basis to show/hide it, the solution I talked about applies to every link.

~DS~

BBC might work but since portal block does not have this. (SP)
What about this:

Something to do with 'show' true or false?
if ($type == 'block' && $id == 1)

to
if ($type == 'group' && $id == 1)

Sorry, I am no coder.  :-[
"There is no god, and that's the simple truth. If every trace of any single religion were wiped out and nothing were passed on, it would never be created exactly that way again. There might be some other nonsense in its place, but not that exact nonsense. If all of science were wiped out, it would still be true and someone would find a way to figure it all out again."
~Penn Jillette – God, NO! – 2011

Arantor

Where is that 'show' option exactly?

~DS~

Quote from: Arantor on March 23, 2010, 10:15:52 PM
Where is that 'show' option exactly?
I dunno really, just giving it idea.
This is a example:
<a href="http://www.simplemachines.org/community/index.php?topic=372389.0">Charter</a>
We can hide this link with a BBC based on membergroup id.

But it will not work unless some knows the html or BBC code that hides and invisible to everyone expect the id.

* Dismal Shadow is confused

"There is no god, and that's the simple truth. If every trace of any single religion were wiped out and nothing were passed on, it would never be created exactly that way again. There might be some other nonsense in its place, but not that exact nonsense. If all of science were wiped out, it would still be true and someone would find a way to figure it all out again."
~Penn Jillette – God, NO! – 2011

~DS~

Something simliar to this?
'show' => !$user_info['is_guest'],
tag around the code I provide above me.
"There is no god, and that's the simple truth. If every trace of any single religion were wiped out and nothing were passed on, it would never be created exactly that way again. There might be some other nonsense in its place, but not that exact nonsense. If all of science were wiped out, it would still be true and someone would find a way to figure it all out again."
~Penn Jillette – God, NO! – 2011

Arantor

Doesn't work like that.

There are two ways this can go, something in the URL bbcode:
[url show=16,17,20 url=address]link[/url]

Or we create a custom tag:
[charter][url=address]text[/url][/charter]

I already sorta did that in Guest and Member Tag mod that Robbo now maintains.

~DS~

Quote from: Arantor on March 24, 2010, 06:39:53 AM
Doesn't work like that.

There are two ways this can go, something in the URL bbcode:
[url show=16,17,20 url=address]link[/url]

Or we create a custom tag:
[charter][url=address]text[/url][/charter]

I already sorta did that in Guest and Member Tag mod that Robbo now maintains.
Ummm...This might work.

Problem is it use html in the block

<a href="http://www.simplemachines.org/community/index.php?topic=372389.0">Charter</a> | <a href="http://www.simplemachines.org/community/index.php?topic=372389.0">Moderator's Hideout</a>
"There is no god, and that's the simple truth. If every trace of any single religion were wiped out and nothing were passed on, it would never be created exactly that way again. There might be some other nonsense in its place, but not that exact nonsense. If all of science were wiped out, it would still be true and someone would find a way to figure it all out again."
~Penn Jillette – God, NO! – 2011

Arantor

Can you use raw PHP?

If you're limited to basic HTML, there is NO way of doing it within the block itself.

Advertisement: