PHP Forum Help

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
Smackie
Forum Contributor
Posts: 302
Joined: Sat Jan 29, 2005 2:33 pm

PHP Forum Help

Post by Smackie »

Greetings,

I been working on a forum. its almost complete.. but im having a problem (btw this forum is for only my site). I am calling all the categories out from a while loop and was wondering if someone could tell me how i can some of the categories were only selected members can view thie topics and stuff.?

here is the page..

Code: Select all

<table width="100%" height="20" border="0" bgcolor="000033" cellpadding="2" cellspacing="0">
  <tr>
    <th class="txt" width="80%">Forum</th>
    <th class="txt" width="10%">Topics</th>
    <th class="txt" width="10%">Post</th>
  </tr>
</table>
<?php
    $get_category = mysql_query("SELECT * FROM category GROUP BY id") or die(mysql_error());
        while($row = mysql_fetch_array($get_category)) {
        ?>
<table width="100%" height="20" border="0" bgcolor="00255d" cellpadding="2" cellspacing="0">
  <tr>
    <th class="txt" width="60%" align="left"><B><U><font size="2"><?php echo $row['category']; ?></font></u></b></th>
  </tr>
</table>
<table width="100%"  border="1" bordercolor="CFC095"  bgcolor="000033" cellpadding="3" cellspacing="0">
<?php 
    $id = $_GET['id'];  
    $get_topic = mysql_query("SELECT * FROM header WHERE catid=" . $row['id'] . " ORDER BY catid") or die(mysql_error());   
        while($topic_info = mysql_fetch_array($get_topic)) {
            $id = $topic_info['id'];
            $catid = $topic_info['catid'];
            $heading = stripslashes($topic_info['heading']);
            $description = $topic_info['description'];
 
    $get_num_topics = mysql_query("SELECT catid FROM forum_question WHERE catid = $catid");
    $topics = mysql_num_rows($get_num_topics);
 
    $get_num_posts = mysql_query("SELECT catid FROM forum_answer WHERE catid = $catid");
    $posts = mysql_num_rows($get_num_posts);
    ?>
  <tr>
    <td class="txt" width="80%" align="left"><a href="../index.php?seashadows=topic&catid=<?php echo $catid; ?>&id=<?php echo $id; ?>"><?php echo $heading; ?></a><br /><?php echo $description; ?></td>
    <td class="txt" width="10%"><?php echo $topics; ?></td>
    <td class="txt" width="10%"><?php echo $posts; ?></td>
<?php
 
    if($_SESSION['user_level'] == 5) {
    
 
?>
  <tr>
    <td class="txt" align="right" colspan="3"><a class="two" href="../index.php?seashadows=header_functions&id=<?php echo $id; ?>">Edit</a> | <a class="two" href="../index.php?seashadows=header_functions&action=delete1&id=<?php echo $id; ?>">Delete</a></td>
  </tr>
    <tr>
    <td class="txt" align="right" colspan="3"><a href="../index.php?seashadows=add_heading"><strong>Create New Subject</strong></a></td>
  </tr>
  <?php
  }
  }
  }
  ?>
  </table>
here is what the page looks like
http://seashadows.uni.cc/index.php?seashadows=forum

i need Promotion Review Board to only be shown to people who are selected.

i was thinking about using if statements but how i was doing it wasn't working right. but i hope someone can help me. :banghead:


Thank you,

Smackie
hansford
Forum Commoner
Posts: 91
Joined: Mon May 26, 2008 12:38 am

Re: PHP Forum Help

Post by hansford »

Greetings,

I been working on a forum. its almost complete.. but im having a problem (btw this forum is for only my site). I am calling all the categories out from a while loop and was wondering if someone could tell me how i can some of the categories were only selected members can view thie topics and stuff.?

please read you comments/quertions - you sound like a retard who should not be programming to begin with as no one can make sense of what the hell it is you are wanting - sorry
Smackie
Forum Contributor
Posts: 302
Joined: Sat Jan 29, 2005 2:33 pm

Re: PHP Forum Help

Post by Smackie »

well you must be the retard dude.. i have a While loop to call out the catagories for the forum. I need one of them category to be selected members only. CAN YOU UNDERSTAND THAT!? And where do you get off saying i don't need to be programming? your not mr all time programmer god so you don't have a place to talk on telling someone they don't need to program. and if you don't understand what im saying why don't you look at the script and trying figuring out or ask in a nice way to explain myself in a better way.
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

COOL IT, GUYS

Post by califdon »

We don't permit flaming like that in this forum. If you can't post something constructive, don't post anything. Now let's all get back to PHP development.
Post Reply