Page 1 of 1

phpBB intergration

Posted: Tue Apr 12, 2005 2:12 pm
by therat
I am trying to create an admin section using the pbpBB login system. I have created a page that only shows if the person is logged in and there user_level is ADMIN. I now need to show only part of the page to a member of a specific user group but still letting ADMIN see the whole section. I know there is probably an easier or better way of doing this, but it works for now.

Code: Select all

<?php if ($userdata) { 
                             if ($userdata['session_logged_in']) { 
                              if ($userdata['user_level'] == ADMIN) { ?>
                      <!--  BEGIN: General Config  -->
                        <div class="box">
                         <div>General Config</div>
                          <div class="boxmain">
                            &middot;&nbsp;<a href="./index.php">Admin Home</a><br />
                            &middot;&nbsp;<a href="./index.php?act=gens&do=setc">General Config</a>
                          </div>
                        <hr style="color: rgb(230, 230, 230);" width="80%" align="left" noshade="noshade" size="1" />
                        </div>
                        <!--  END: General Config  -->
                        <!--  BEGIN: Categories Admin  -->
                        <div class="box">
                         <div>Categories Admin</div>
                          <div class="boxmain">
                            &middot;&nbsp;<a href="./index.php?act=mcat&do=lcat">List Categories</a><br />
                            &middot;&nbsp;<a href="./index.php?act=mcat&do=ncat">New Category</a>
                          </div>
                        <hr style="color: rgb(230, 230, 230);" width="80%" align="left" noshade="noshade" size="1" />
                        </div>
                        <!--  END: Categories Admin  -->
                        <!--  BEGIN: Sub Categories Admin  -->
                        <div class="box">
                         <div>Sub Categories Admin</div>
                          <div class="boxmain">
                            &middot;&nbsp;<a href="./index.php?act=scat&do=lcat">List Sub Categories</a><br />
                            &middot;&nbsp;<a href="./index.php?act=scat&do=nscat">New Sub Category</a>
                          </div>
                        <hr style="color: rgb(230, 230, 230);" width="80%" align="left" noshade="noshade" size="1" />
                        </div>
                        <!--  END: Sub Categories Admin  -->
                        <?php if ($member) { ?>
                        <!--  BEGIN: New Submissions Admin  -->
                        <div class="box">
                         <div>New Submissions Admin</div>
                          <div class="boxmain">
                            &middot;&nbsp;<a href="./index.php?act=nsub&do=new">New Submissions</a>
                          </div>
                        <hr style="color: rgb(230, 230, 230);" width="80%" align="left" noshade="noshade" size="1" />
                        </div>
                        <!--  END: New Submissions Admin  -->
                        <!--  END: Left column  -->
                        <?php } } } else { echo 'ADMIN ONLY, SORRY!!'; } }?>
I now need to show the section between lines 34 & 42 if they belong to a specific group. The $member variable is called by a script called phpBB Fetch All

Code: Select all

$member = phpbb_fetch_users(7);

This just checks to see if the user is in the specified group. What do I need to change to get this working?

Posted: Tue Apr 12, 2005 2:20 pm
by Chris Corbyn
Not sure but

Code: Select all

<?php if ($member || $admin) { ?> //Or something to that effect
What's not working at the moment?

One more question... is that photo you? 8O

Posted: Tue Apr 12, 2005 2:43 pm
by hongco
d11wtq wrote:One more question... is that photo you? 8O

Code: Select all

echo "haha";

Posted: Tue Apr 12, 2005 5:39 pm
by Burrito
d11wtq wrote: One more question... is that photo you? 8O
work it d11...work it 8)

Posted: Tue Apr 12, 2005 6:06 pm
by Chris Corbyn
Well if it is therat then I think I've scared her off :lol:

Posted: Wed Apr 13, 2005 2:20 pm
by therat
d11wtq wrote:Well if it is therat then I think I've scared her off :lol:
No it's not, wrong sex 8O

Posted: Wed Apr 13, 2005 2:24 pm
by Chris Corbyn
DOH!

Did you get it working in the end?

Posted: Wed Apr 13, 2005 2:27 pm
by Burrito
1) work it d11
2) wrong sex
3) working in the end

8O

amuse me a very great deal that does

but mind out of the gutter I need to get...

Posted: Wed Apr 13, 2005 3:12 pm
by therat
d11wtq wrote:DOH!

Did you get it working in the end?
Certainly did.