Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Solved: 4 Years, 3 Months ago Check if user is logged
#1
Solved: 4 Years, 3 Months ago
How can I check if a user is logged?
I'd like to show a button in the header only to members and I don't want to modify the header_welcomeblock_member.

Thank you
  • header_welcomeblock_member
Reply
#2
Solved: 4 Years, 3 Months ago
(07-17-2015, 10:36 AM)Zlatan Wrote: How can I check if a user is logged?
You could search him/her in the memberlist
(07-17-2015, 10:36 AM)Zlatan Wrote: I'd like to show a button in the header only to members and I don't want to modify the header_welcomeblock_member.
Don't you see the contradiction in this? Which template do you have in mind when header_welcomeblock_member is not an option?
And further, where must this button bring you to?
Regards, Ad Bakker (NL)
Reply
#3
Solved: 4 Years, 3 Months ago
(07-17-2015, 10:55 AM)Ad Bakker Wrote:
(07-17-2015, 10:36 AM)Zlatan Wrote: How can I check if a user is logged?
You could search him/her in the memberlist
(07-17-2015, 10:36 AM)Zlatan Wrote: I'd like to show a button in the header only to members and I don't want to modify the header_welcomeblock_member.
Don't you see the contradiction in this? Which template do you have in mind when header_welcomeblock_member is not an option?
And further, where must this button bring you to?

I want members to have a link that when is clicked redirect them to an external page,
can I do something like this in the header template?
<?php if ($mybb->user['uid']) ?>
                            <li ><a href="{$mybb->settings['bburl']}/externalpage.html" target="_blank"> External Page {$lang->toplinks_externalpage}</a ></li >
Reply
#4
Solved: 4 Years, 3 Months ago
^ you can use php in templates plugin to use such php based condition in the header template
however it would be better to use template conditionals plugin (instead of php in templates) & add a simple condition

required codes guidance is available at the plugins release threads there
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)