phpBB intergration

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
therat
Forum Commoner
Posts: 62
Joined: Wed Oct 01, 2003 2:44 pm
Location: London

phpBB intergration

Post 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?
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post 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
hongco
Forum Contributor
Posts: 186
Joined: Sun Feb 20, 2005 2:49 pm

Post by hongco »

d11wtq wrote:One more question... is that photo you? 8O

Code: Select all

echo "haha";
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

d11wtq wrote: One more question... is that photo you? 8O
work it d11...work it 8)
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Well if it is therat then I think I've scared her off :lol:
therat
Forum Commoner
Posts: 62
Joined: Wed Oct 01, 2003 2:44 pm
Location: London

Post 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
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

DOH!

Did you get it working in the end?
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post 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...
therat
Forum Commoner
Posts: 62
Joined: Wed Oct 01, 2003 2:44 pm
Location: London

Post by therat »

d11wtq wrote:DOH!

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