Jump to content

Message boards


otuatail

Recommended Posts

I have written a message board and it has been test properly, the problem is it looks naff in apearance. When I see this message board I would like to model it on this. I can't work out the top section. It seems to be in 3 sections pinned to top, pinned to top and read only, and the rest with the occasioal read only.

I can't work out the best query. all entries will be in the same table with a field type maybee of

1=Pinned

2=Pinned read only

3=other.  But then there is the ocasional read only.  their is one of these now 18 recs down.

 

Any Idea on a table structure. Would it require 3 seperate queries. Not good.

 

Desmond.

 

Link to comment
https://forums.phpfreaks.com/topic/75821-message-boards/
Share on other sites

Its a simple case of having some sort of status field and using the ORDER by clause on your query.

 

This should relate only to if a topic is pinned. You will need a different field for locking threads.

 

The reason why it appears that we have pinned, followed by pinned and read only, followed by others is simply because those which are pinned and NOT read only, have, of course, been posted in more recently that the read only topics.

 

The query to grab the topics would order by status(pinned or not) then by last post. Wether or not a topic is read only has nothing to do with the ordering.

Link to comment
https://forums.phpfreaks.com/topic/75821-message-boards/#findComment-383750
Share on other sites

I think I am going to need 3 fields 2 for the Pined and locked and a 3rd for normal locking.........

 

`id` int() NOT NULL auto_increment,

`pinned` varchar(1),

'lock' varchar(1),

`subject` varchar(255),

`content' text'

'lock2` varchar(1),  // for normal locking

 

$SQL = "SELECT * FROM Table ORDER BY pinned, lock";

 

 

Link to comment
https://forums.phpfreaks.com/topic/75821-message-boards/#findComment-383757
Share on other sites

I think I am going to need 3 fields 2 for the Pined and locked and a 3rd for normal locking.........

 

`id` int() NOT NULL auto_increment,

`pinned` varchar(1),

'lock' varchar(1),

`subject` varchar(255),

`content' text'

'lock2` varchar(1),  // for normal locking

 

$SQL = "SELECT * FROM Table ORDER BY pinned, lock";

 

 

 

Since we are talking about speeding things up don't use a varchar use an int(1) or bool, as this is simpler storage methods.  and the * operator aint' good eitehr

Link to comment
https://forums.phpfreaks.com/topic/75821-message-boards/#findComment-383759
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.