PHP Forum Help
Posted: Mon May 26, 2008 6:02 pm
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..
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.
Thank you,
Smackie
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>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.
Thank you,
Smackie