|
|
Joined: May 2004
Posts: 31
User
|
User
Joined: May 2004
Posts: 31 |
If I wanted to put a link at the top along with the rest of the links, but only wanted people from 'x' usergroup see it, how would I go about doing this?
Kind of like the admin link that only admins have access to. Well, mods do to but to a different section.
|
|
|
|
Joined: Sep 2003
Posts: 488
Code Monkey
|
Code Monkey
Joined: Sep 2003
Posts: 488 |
In ubbt.inc.php FIND THIS: // ------------------------------------------------------------------ <br /> // If they are an admin or moderator they get a link to the admin sec <br /> $target = ""; <br /> if ( ($user['U_Status'] == "Administrator") || ($user['U_Status'] == "Moderator") ) { <br /> $target = "target=\"_top\""; <br /> $adminlink = "<a href = \"$phpurl/admin/login.php?Cat=$Cat\" $target>{$ubbt_lang['ADMIN_MENU']}</a> | "; <br /> } ADD BELOW IT, THIS: $grouplink = ""; <br /> if ($user['U_Groups'] == "-X-") { <br /> $target = "target=\"_top\""; <br /> $grouplink = "<a href = \"URL GOES HERE\" $target>LINK NAME</a> · "; <br /> } Fill in the obvious details. Then add $grouplink to ubbt_registerednav.tmpl alongside with the other links. Just make sure it isn't the very last link since it has a seperator after it.
|
|
|
|
Joined: May 2004
Posts: 31
User
|
User
Joined: May 2004
Posts: 31 |
You guys are amazing. I could only wish that my brain was wired in such a way to understand all this.
Thanks Twisty!!
|
|
|
|
Joined: May 2004
Posts: 31
User
|
User
Joined: May 2004
Posts: 31 |
Hmm, did all this and it's not showing up. I'm assuming this is all right? $grouplink = "";<br /> if ($user['U_Groups'] == "-1-") {<br /> $target = "target=\"_top\"";<br /> $grouplink = "<a href = \"http://www.webpage.com\" $target>LINK NAME</a> | ";<br /> } Also, do I just put "$grouplink" (without quotes) in the ubbt_registerednav.tmpl somewhere? That's what I did but it's not showing up.
|
|
|
|
Joined: Sep 2003
Posts: 488
Code Monkey
|
Code Monkey
Joined: Sep 2003
Posts: 488 |
Last edited by Twisty; 08/17/2004 7:28 PM.
|
|
|
|
Joined: May 2004
Posts: 31
User
|
User
Joined: May 2004
Posts: 31 |
Bingo! That did it.
Thanks once again, Twisty!
|
|
|
|
Joined: May 2004
Posts: 31
User
|
User
Joined: May 2004
Posts: 31 |
It works but *everyone* can now see the link, regardless of which group they are in. Should I be putting in the group_id number or the name (ie Administrator)?
|
|
|
|
Joined: Sep 2003
Posts: 488
Code Monkey
|
Code Monkey
Joined: Sep 2003
Posts: 488 |
Actually you know what bro? That still isn't correct. *This* is what you want right here... $grouplink = ""; <br /> if ( ($user['U_Groups']) && (strstr($user['U_Groups'],"-1-") ) ) { <br /> $target = "target=\"_top\""; <br /> $grouplink = "<a href = \"http://www.webpage.com\" $target>LINK NAME</a> · "; <br /> } I rarely ever mess with group stuff so I'm a li'l rusty with it. But don't worry, I'll get you set up sooner or later 
|
|
|
|
Joined: May 2004
Posts: 31
User
|
User
Joined: May 2004
Posts: 31 |
No worries at all, Twisty! I'm just thankful there are people like yourself that are willing to help us technologically challenged folks.  And it's working perfectly now. I logged in as one of my users and the link is gone, as it should be. Thanks!!
|
|
|
|
Joined: Sep 2003
Posts: 488
Code Monkey
|
Code Monkey
Joined: Sep 2003
Posts: 488 |
'K no prob 
|
|
|
|
Joined: Nov 2001
Posts: 10,369
I type Like navaho
|
I type Like navaho
Joined: Nov 2001
Posts: 10,369 |
The other thing that you might need - depending on the the script - is to add U_Groups to the authenticate function - it's not called in every script. If this is in the menubar, You might want to go into the authenticate() function in ubbt.inc.php and add U_Groups to the query there - so that $user['U_Groups'] will be avilable in every script. 
|
|
|
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
|
|
badfrog
somewhere on the coast of Maine
Posts: 94
Joined: March 2007
|
|
Forums63
Topics37,575
Posts293,930
Members13,823
|
Most Online6,139 Sep 21st, 2024
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|
|