Jump to content

Recommended Posts

I am building my own forum but i ran into a problem and i skipped over it and went on and set the forum up and everthing it works great but i wanna add the script that i had problem on. but its pretty basic but

 

Right now the main page lets any user create a topic but it doesnt go under any catagory or anything like that and thats what i want.. ill show you how it looks and how i want it to look it will give you a better view of what i want..

 

what i got now..

http://69.66.94.187/forum/forum1.php

what i want..

http://69.66.94.187/forum/forum2.php

 

how would i do the database and stuff i mean ill show you the script as well so someone can help me.

 

<?php

$id=$_GET['id'];

$sql = mysql_query("
SELECT f.id, f.topic, f.detail, f.datetime, f.view, f.reply, u.user_name, u.pic 
FROM forum_question as f 
LEFT JOIN users as u ON f.userid = u.userid"
);
?>


<table width="100%" height="20" border="0" align="center" cellpadding="2" cellspacing="0" bgcolor="#CFC095" class="Header_box">
<tr>
<th width="59%" align="center" bgcolor="#514833" class="background_head"><strong>Topic</strong></th>
<th width="15%" align="center" bgcolor="#514833" class="background_head"><strong>Views</strong></th>
<th width="10%" align="center" bgcolor="#514833" class="background_head"><strong>Replies</strong></th>
<th width="16%" align="center" bgcolor="#514833" class="background_head"><strong>Date/Time</strong></th>
</tr>
</table>
<table width="100%" border="1" bordercolor="CFC095" align="center" cellpadding="0" cellspacing="0" bgcolor="#CFC095" class="Box_border">

<?php
while($rows=mysql_fetch_array($sql)){
$datetime = date('D dS M Y, h:i a', strtotime($datetime));
?>
<tr>
<td width="59%" bgcolor="#4D4531" class="background"><a href="../index.php?pages=view_topic&id=<? echo $rows['id']; ?>"><? echo $rows['topic']; ?></a><BR></td>
<td width="15%" align="center" bgcolor="#4D4531" class="background"><? echo $rows['view']; ?></td>
<td width="10%" align="center" bgcolor="#4D4531" class="background"><? echo $rows['reply']; ?></td>
<td width="16%" align="center" bgcolor="#4D4531" class="background"><? echo $rows['datetime']; ?></td>
</tr>
<?php
}
?>
<tr>
<td colspan="5" align="right" bgcolor="#4D4531" class="background"><a href="../index.php?pages=create_topic"><strong>Create New Topic</strong> </a></td>
</tr>
</table>

 

This script here is called main_forum.php but im making another page for this part which will show what i want to show i hope someone can help me.

 

thank you invisionx

Link to comment
https://forums.phpfreaks.com/topic/53896-forum/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.