Jump to content
xisto Community
Sign in to follow this  
iGuest

Please help me with this indenting forum :)

Recommended Posts

i need to understand how to indent a tree...e.gmain post1..reply11......reply 111..........reply 1111..........reply 1112..........reply 1113......reply 112......reply 113..reply12......reply121..........reply 1211i want to make a forum that will show replies like that...i am using php, and have a mysql table which looks like this:CREATE TABLE `forum` ( `id` int(11) NOT NULL auto_increment, `threadnum` int(2) NOT NULL default '1', `thread` varchar(255) default NULL, `topicnum` int(2) NOT NULL default '1', `topic` varchar(255) default NULL, `order` varchar(4) NOT NULL default '1', `level` int(2) NOT NULL default '1', `reply` int(3) default NULL, `text` longtext NOT NULL, `user` varchar(30) NOT NULL default '', `time` datetime NOT NULL default '0000-00-00 00:00:00', PRIMARY KEY (`id`))threadnum through to topic are being used to list the topics and threads on previous pages.Order is an integer that increments for every new posted item in each topic. Level is an integer that increments corresponding to how far from the topic post it is. (e.g. in the diagram above 1111, 1112 etc would be level 4).'reply' is the id of the post it is a reply to.The script displays a list of threads, then displays the list of topics, and then displays the replies. It is only the replies that wont work.I've been trying to fix this for ages and cant get my head around it - any help would be much appreciated. Thanks

Share this post


Link to post
Share on other sites

ah, i worked it out and fixed it, if anyone wants to use it then let me know, its not as complex as phpbb yet though - so i'd use that if i were you :D.

Share this post


Link to post
Share on other sites

I'm interested in the same thing, but as I don't know how to change the scripts oranything, I was wondering if there is a mod to phpnuke that can change the boardto this threaded style.

Share this post


Link to post
Share on other sites

If you find in the php code for phpbb the bit that prints each post, then i might be able to help you.

Mine basically does this......

1) when posting something it works out what number post it would be, and sends that number to a field in the mysql table.

2) It also works out what level response it is, and sends that to another field.

E.g.
- if you look at
http://forums.xisto.com/no_longer_exists/
then the number in the replys refer to the order, and posts 2 and 3 would be level 2, while 2.5 would be level 3. (- the equations i've used work all the way down - though they do go to a large number of decimal places - but who cares.)

When displaying...

1) it orders the posts by the order they are supposed to be in.

2) it adds a cell with width of 15px for each level down it goes - if you highlight the responses you'll see what i mean.

http://forums.xisto.com/no_longer_exists/
(post anything you like - i've not finished it so feel free to post rubbish in it - so long as there are no obscenities)

You're welcome to my source code, but as im making my own forum i wont be able to help with implementing it into phpbb completely.


I'll post the source code in the scripts section if it will fit.

Share this post


Link to post
Share on other sites

It may sound odd, but I have been unable to find anything called "setup.php" or similar. It may possibly have to do with the fact that I decided to use the board in phpnuke rather than the freestanding phpbb.

Share this post


Link to post
Share on other sites

setup.php is just the file i contain my db connection in.

Basically that file connects to the database, and has a few variables in it - and i call it in any file i need to use mysql info.

If you look at the source code at

http://forums.xisto.com/

then scroll down, you'll see both setup.php, and the create table mysql function

Share this post


Link to post
Share on other sites

Oh well. I give up. I just can't work out where to insert the code. Thanks for your help anyway. Have a nice trip to the czech rep.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | 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.