Knouen Posted August 5, 2007 Share Posted August 5, 2007 And here it is: http://pastebin.com/m1da4368b Or at least the beginning of it. Naturally I'll keep working on that. However, I have a question about two things I just don't know how to do at all. How do I keep track of, and show, the thread views? Also, if there's anything else that looks amazingly stupid and needs fixing, please tell me. Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/63426-writing-a-simple-forum/ Share on other sites More sharing options...
Knouen Posted August 6, 2007 Author Share Posted August 6, 2007 Oops. Sleep deprivation made me not post the other question. And that is... I wish to make the same input form post the data as a new thread if no other thread is being viewed, or pass a viewed thread's ID to the script to post it as a reply. if(viewing thread){ append to post/thread ID } else{ post as new thread } Something like that. Which I know means I have to pass the post or thread ID to the script. Maybe use a default value (zero or whatever) if no thread is being viewed? Quote Link to comment https://forums.phpfreaks.com/topic/63426-writing-a-simple-forum/#findComment-316621 Share on other sites More sharing options...
Gho§t Posted August 6, 2007 Share Posted August 6, 2007 How do I keep track of, and show, the thread views? You could simply have a MySQL column holding the thread view number, and then do a query every time the page loads to update that column, and add 1 to its value. if(viewing thread){ append to post/thread ID } else{ post as new thread } Use a session, cookie, or maybe GET variable to identify a thread ID. if (isset($_GET['tid'])){ /*Post to topic where*/ }else{ /*Post new topic*/ } Quote Link to comment https://forums.phpfreaks.com/topic/63426-writing-a-simple-forum/#findComment-316702 Share on other sites More sharing options...
Knouen Posted August 15, 2007 Author Share Posted August 15, 2007 http://pastebin.com/m2e2381af This (the whole website, not just this script) is absolutely frying my brain. I think I need a break. Quote Link to comment https://forums.phpfreaks.com/topic/63426-writing-a-simple-forum/#findComment-324538 Share on other sites More sharing options...
MadTechie Posted August 15, 2007 Share Posted August 15, 2007 look like your just trying to promo your site or something!! Quote Link to comment https://forums.phpfreaks.com/topic/63426-writing-a-simple-forum/#findComment-324540 Share on other sites More sharing options...
Knouen Posted September 28, 2007 Author Share Posted September 28, 2007 Ok, I'm back on this project after benig sidetracked by something else. So here's what I'm thinking. My table: create table forum{ postid int(5) not null auto-increment, parentid int(5) default null, subject tinytext not null, message text not null, name = tinytext not null, post_timestamp TIMESTAMP(, numviews int(5) default null, primary key (postid) }; GET on forum page takes in a parentid from a post if you've clicked on one. If no parentid, it is set to 0. On main page, select statement lists all with parentid==0 as threads. Click on any of those and it just displays all posts with a parentid of that thread/post. Oh, I'm not bothering with registrations, just using an image verification to block bots. So: if( get isn't set ) parentid = 0 else parentid = whatever was in get Quote Link to comment https://forums.phpfreaks.com/topic/63426-writing-a-simple-forum/#findComment-356957 Share on other sites More sharing options...
Knouen Posted September 28, 2007 Author Share Posted September 28, 2007 I'm going to stick the entire forum in a single file, since it's going to be so simple. I mean, all I have to do is display a list of threads, display a form, display a thread if one has been clicked (vie GET I suppose), and select whether the new post from that form creates a new thread or is appended to an already existing thread. All I need now is tips on organising the structure. Eg: if ( GET is zero ) { show list of threads show input form if (input form used ) { create thread } } else { show thread given by postid in GET show input form } Something like that? Quote Link to comment https://forums.phpfreaks.com/topic/63426-writing-a-simple-forum/#findComment-356969 Share on other sites More sharing options...
trq Posted September 28, 2007 Share Posted September 28, 2007 Have you got a specific question or is this just some rant? Quote Link to comment https://forums.phpfreaks.com/topic/63426-writing-a-simple-forum/#findComment-356971 Share on other sites More sharing options...
Knouen Posted September 28, 2007 Author Share Posted September 28, 2007 Have you got a specific question or is this just some rant? This thread contains no rants and many questions. Please stop posting stupid crap. Either help or leave. Quote Link to comment https://forums.phpfreaks.com/topic/63426-writing-a-simple-forum/#findComment-357097 Share on other sites More sharing options...
MadTechie Posted September 28, 2007 Share Posted September 28, 2007 This thread contains no rants and many questions. Please stop posting stupid crap. Either help or leave. I can't see any questions, i guess i'll leave, PS great way to ask for help Quote Link to comment https://forums.phpfreaks.com/topic/63426-writing-a-simple-forum/#findComment-357138 Share on other sites More sharing options...
blueman378 Posted September 28, 2007 Share Posted September 28, 2007 just to point out they are here to help, you will notice you have had no "answers" to anything you have posted, thats because you are not clearly stating what your problems are, all you are doing is posting what you are currently doing, they asked about the questions because they wanted to try and help, they could have just said no clear questions and gone away. but they didn't they decided to try again and ask you do you actually have a question to try and get you to state them clearer, next time if you want help remember that being polite usually gets the best results, in fact i am sure that if you read in the forum rules it will state that you must respect other members. now try and be more polite and remember that they are here to help as a favor its not your right to be helped, now if you want help be polite and post your questions clearly and the members of the forum will try to help you out. also you might want to look at the link in MadTechie's sig How to ask questions the smart way http://catb.org/~esr/faqs/smart-questions.html Quote Link to comment https://forums.phpfreaks.com/topic/63426-writing-a-simple-forum/#findComment-357149 Share on other sites More sharing options...
Knouen Posted September 28, 2007 Author Share Posted September 28, 2007 Have you got a specific question or is this just some rant? ^ That is not polite and respectful. Especially since it indicates a failure to have read the thread at all, and the many questions contained in it. Quote Link to comment https://forums.phpfreaks.com/topic/63426-writing-a-simple-forum/#findComment-357229 Share on other sites More sharing options...
marcus Posted September 28, 2007 Share Posted September 28, 2007 You're asking for tips, which are not questions. If you responded to thorpe in an organized manner, no doubt he would have answered. Quote Link to comment https://forums.phpfreaks.com/topic/63426-writing-a-simple-forum/#findComment-357237 Share on other sites More sharing options...
Knouen Posted September 28, 2007 Author Share Posted September 28, 2007 I'm going to stick the entire forum in a single file, since it's going to be so simple. I mean, all I have to do is display a list of threads, display a form, display a thread if one has been clicked (vie GET I suppose), and select whether the new post from that form creates a new thread or is appended to an already existing thread. All I need now is tips on organising the structure. Eg: if ( GET is zero ) { show list of threads show input form if (input form used ) { create thread } } else { show thread given by postid in GET show input form } Something like that? So how about I repeat the question regarding design, and hope for some constructive, intelligence input. Quote Link to comment https://forums.phpfreaks.com/topic/63426-writing-a-simple-forum/#findComment-357239 Share on other sites More sharing options...
marcus Posted September 28, 2007 Share Posted September 28, 2007 All I need now is tips on organising the structure. Eg: Quote Link to comment https://forums.phpfreaks.com/topic/63426-writing-a-simple-forum/#findComment-357242 Share on other sites More sharing options...
Knouen Posted September 28, 2007 Author Share Posted September 28, 2007 All I need now is tips on organising the structure. Eg: Not sure what the point of that was. If you look below the pseudo-code section, you'll see a question mark. Looks a lot like this "?". That generally indicates a question. Quote Link to comment https://forums.phpfreaks.com/topic/63426-writing-a-simple-forum/#findComment-357249 Share on other sites More sharing options...
MadTechie Posted September 28, 2007 Share Posted September 28, 2007 Okay, it seam to me, that you don't have a specific question, just a but a programming design question, which is unclear.. can you please re-phrase the question (maybe bullet point it).. or just continue to rant and your probably be left alone How to ask questions the smart way Quote Link to comment https://forums.phpfreaks.com/topic/63426-writing-a-simple-forum/#findComment-357294 Share on other sites More sharing options...
Knouen Posted September 28, 2007 Author Share Posted September 28, 2007 I'm going to stick the entire forum in a single file, since it's going to be so simple. I mean, all I have to do is display a list of threads, display a form, display a thread if one has been clicked (via GET I suppose), and select whether the new post from that form creates a new thread or is appended to an already existing thread. All I need now is tips on organising the structure. Eg: if ( GET is zero ) { show list of threads show input form if (input form used ) { create thread } } else { show thread given by postid in GET show input form } Something like that? Given the requirements mentioned, is that how you would design such a thing, if trying to gather it all into one file rather than splitting it into several? Quote Link to comment https://forums.phpfreaks.com/topic/63426-writing-a-simple-forum/#findComment-357302 Share on other sites More sharing options...
MadTechie Posted September 28, 2007 Share Posted September 28, 2007 i guess like this, yet your still unclear! <?php switch($_GET['page']) { default: case "1": //include or echo page data for default or main (1) page break; case "2": //include or echo page data for page 2 break; case "3": //include or echo page data for page 2 break; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/63426-writing-a-simple-forum/#findComment-357371 Share on other sites More sharing options...
Knouen Posted September 28, 2007 Author Share Posted September 28, 2007 i guess like this, yet your still unclear! Yes, I usually am unclear on the suggestions of others before they make them. Quote Link to comment https://forums.phpfreaks.com/topic/63426-writing-a-simple-forum/#findComment-357376 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.