Not Solved Header Link Help?
#1
Not Solved
Hi,

I have a link in my header bar, that points to a php file, which then in turn redirects to another url.

I want to make it so that when a user clicks on that link and it visits php file, that only members that are logged in can continue on and visit the link redirect in the php. If not, then tell them to login.

How would I do that?

Is there some php code that would do that?

Thanks in advance,
Nate
Reply
#2
Not Solved
Install this: http://community.mybb.com/thread-31860.html

Then wrap the link of php file with the following;
<if $mybb->user['uid'] != "0" then>LINK_OF_PHP_FILE_GOES_HERE</if>
Reply
#3
Not Solved
(2011-02-24, 04:18 PM)Yaldaram Wrote: Install this: http://community.mybb.com/thread-31860.html

Then wrap the link of php file with the following;
<if $mybb->user['uid'] != "0">LINK_OF_PHP_FILE_GOES_HERE</if>

Sorry, I have no clue how to use php really.

But do I put this in the header?

Like this?
<div class="menu">
				<ul>
					<li><a href="/">Home</a><li>
					<li><a href="/index.php">Forum</a><li>
                    <li><a href="LINK">Shop</a></li>
					<li><a href="LINK">Achievements</a><li>
                    <li><a href="LINK">IRC</a></li>
					<if $mybb->user['uid'] != "0">dynmap.php</if> 
				</ul>
			</div>
Reply
#4
Not Solved
What I say, you have to install the PHP template conditionals plugin. Then you'll be able to use PHP in templates.

After installing the above plugin, Go to: ACP > Templates > Header Templates > header > and wrap the link of that file (which you want to hide from non-registered users or from guests) with the above modification.
Reply
#5
Not Solved
(2011-02-25, 03:31 AM)Yaldaram Wrote: What I say, you have to install the PHP template conditionals plugin. Then you'll be able to use PHP in templates.

After installing the above plugin, Go to: ACP > Templates > Header Templates > header > and wrap the link of that file (which you want to hide from non-registered users or from guests) with the above modification.

Yep, did that. Your code doesn't work.

I had to do
<li><if $mybb->usergroup['gid'] == 2 || $mybb->usergroup['gid'] == 8  then><a  href="dynmap.php">DynMap</a></if></li>

I know an array would look nicer, but I am unable to get arrays to work. Not sure why.

That works. Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)