Page 1 of 1

PHP Forum Help

Posted: Mon May 26, 2008 6:02 pm
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

Re: PHP Forum Help

Posted: Mon May 26, 2008 6:08 pm
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

Re: PHP Forum Help

Posted: Mon May 26, 2008 6:17 pm
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.

COOL IT, GUYS

Posted: Mon May 26, 2008 7:25 pm
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.