The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Linking Buttons to Usernames and/or Usergroups

View previous topic View next topic Go down

Linking Buttons to Usernames and/or Usergroups

Post by 19CenturyWBTS on September 13th 2010, 4:24 pm

Greetings everyone!

This time I've a quite tricky question and I'm unsure if it's possible to do in the first place. I've this button that should be attached to a function checking who the member is and depending on the members name link to a specific forum topic. Let me elaborate on this to better explain what I mean:

Let's say we have a Member who's username is "John Doe"
Now John Doe has taken up a job with Government X in our RPG game and gotten his very own office space in one of the folders.

So far so good. Now I'd like to add an "Office" button to the menu that would lead John Doe right to his office. BUT the same office button should do the very same for other users that have different folders as their offices. So our "office" button should lead to a different part of the forum for different members.

E.g.:
John Doe -> clicks Office Button-> John Doe's Office
Jane Smith -> clicks Office Button -> Jane Smith's Office

Is that at all possible? On that account I think it would also be interesting to link buttons to usergroups memberships so a button would work differently depending on your usergroup.

I'd appreciate any feedback on these two questions. Thanks!

19CenturyWBTS
Forumember

Posts : 81
Reputation : 4
Language : English

http://19thcenturywbts.forumotion.com/forum.htm

Back to top Go down

Re: Linking Buttons to Usernames and/or Usergroups

Post by 19CenturyWBTS on September 14th 2010, 11:53 pm

I've been trying my luck with the following function:

<!-- IF L_USERNAME == John_Doe -->
<input type="button" value="Test Button 1" onClick="window.location = 'http://wherever.com';" />
<!-- ENDIF -->

In theory it would work, but I've yet been unable to find any hint of where and how forummotion handles the usernames and uservariables so one can use that in the Templates (hence I've colored that part red to indicate it's not working as desired). I've tried L_USERNAME, U_Username with and without putting it into { } but nothing worked. Has anyone a hint of how this could be accomplished? It would be awesome since that would be a pretty powerful feature. Thanks.

19CenturyWBTS
Forumember

Posts : 81
Reputation : 4
Language : English

http://19thcenturywbts.forumotion.com/forum.htm

Back to top Go down

Re: Linking Buttons to Usernames and/or Usergroups

Post by Veljko on September 15th 2010, 12:29 am

I think it is possible but you'd have to manually make that for each member. Is that ok with you?

Veljko
Active Poster

Male Posts : 1270
Reputation : 19
Language : Serbian, English, CSS, HTML, a bit of latin and german...
Location : Starlight road

Back to top Go down

Re: Linking Buttons to Usernames and/or Usergroups

Post by 19CenturyWBTS on September 15th 2010, 1:17 am

Thanks for the reply Veljko! That would really be not problem at all, in fact I had planned to do that manually for each character anyway, do you have a solution? Would be really great Smile

19CenturyWBTS
Forumember

Posts : 81
Reputation : 4
Language : English

http://19thcenturywbts.forumotion.com/forum.htm

Back to top Go down

Re: Linking Buttons to Usernames and/or Usergroups

Post by Saxaca on September 15th 2010, 3:19 pm

Well, profile fields can probably do this. Not automated. But.. Possibly-Perhaps if you set it to modifyable by member.

Saxaca
Forumember

Male Posts : 539
Reputation : 26
Language : Markup.

Back to top Go down

Re: Linking Buttons to Usernames and/or Usergroups

Post by Guest on September 15th 2010, 3:32 pm

Is that what you want:

Code:

<FORM>
<INPUT TYPE="BUTTON" VALUE="John Doe" ONCLICK="window.location.href='LINK'">
</FORM>

Guest
Guest


Back to top Go down

Re: Linking Buttons to Usernames and/or Usergroups

Post by 19CenturyWBTS on September 15th 2010, 4:25 pm

@ Gangstar15 - no I'm sorry to say but that's not at all what this is about What we are trying to get done is a Button that works differently for each user - meaning if "User A" clicks it he is lead to "Page X" but if "User X" clicks the same button in the menu he's lead to "Page Z". Is it clearer now?

@ Saxaca - Hmmm using the profile fields might work but what's the variable forumotion is using for each of those entries so one can add it into the formula so it works?


<!-- IF L_USERNAME == John_Doe -->
<input type="button" value="Test Button 1" onClick="window.location = 'http://wherever.com';" />
<!-- ENDIF -->

Needless to say if the right variable to check is found and uncovered one could easily use "OR" in the above formula to extend the code for each member. Like it it's User A then do this if it's User B then go elsewhere,... - I intend it to work like the switch used in the forummotion templates to trigger content that can only be viewed by logged in users / or guests.


19CenturyWBTS
Forumember

Posts : 81
Reputation : 4
Language : English

http://19thcenturywbts.forumotion.com/forum.htm

Back to top Go down

Re: Linking Buttons to Usernames and/or Usergroups

Post by Guest on September 15th 2010, 4:40 pm

ohh ;D i can't do that sorry ^_^

Guest
Guest


Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum