I would like to have the editors link only display on the menu if the username is also an editor. I tried using if editors following if username but that does not seem to work. Any ideas?
Jan 8, 2003, 2:20 PM
Veteran (19537 posts)
Jan 8, 2003, 2:20 PM
Post #2 of 12
Views: 3829
Editor details are stored in a seperate table so you'd probably have to use a global.
...the link
<%endif%>
...and the code:
return $DB->table('Editors')->count({ Username => shift() });
}
Code:
<%if is_editor($Username)%> ...the link
<%endif%>
...and the code:
Code:
sub { return $DB->table('Editors')->count({ Username => shift() });
}
Jan 9, 2003, 11:04 AM
Veteran (19537 posts)
Jan 9, 2003, 11:04 AM
Post #11 of 12
Views: 3779
It should be working then.
If username is defined and they are an editor then all the global does is count from the Editors table where the username matches what you passed in, so as long as they exist in the Editors table then it should be returning 1 aka "true" and should then load the hyperlink :(
If username is defined and they are an editor then all the global does is count from the Editors table where the username matches what you passed in, so as long as they exist in the Editors table then it should be returning 1 aka "true" and should then load the hyperlink :(