phpnoob Posted November 18, 2012 Share Posted November 18, 2012 I don't want php code, only just want to know how to build it.Most forum have 2 simple way, the easy 1, only go to last post in thread, the other it go to the first unreaded post.The easy php its like thisI post the code step by step 1. counting how many post have in that thread2. start while for to select all record3. because of the first step you can get the last post id, and can put it to js, it need only a for code when need to active the js.so after the page loaded, the js will activate and go to last post by id searching in html But for how to reach the first unreaded post, cant figure how to do it, help me. Link to comment Share on other sites More sharing options...
niche Posted November 19, 2012 Share Posted November 19, 2012 (edited) Do the tutorials first http://www.w3schools...php/default.asp then decide what kind of code you need. Then start writing it. Using the forums in the way you're suggesting would take a lot of time IMO. Much more then if you just did the tutorials first. Edited November 19, 2012 by niche Link to comment Share on other sites More sharing options...
phpnoob Posted November 19, 2012 Author Share Posted November 19, 2012 Do the tutorials first http://www.w3schools...php/default.asp then decide what kind of code you need. Then start writing it. Using the forums in the way you're suggesting would take a lot of time IMO. Much more then if you just did the tutorials first.I know lots of thing about php, i have a nice website, just dont know how to make this, step by step1. select all record and start while2. check "thread mark table" for which post you see, and stop the process in last watched id post3. ...................4. ................... I hope you understand now, what i mean, and i think that 2 step its good. Link to comment Share on other sites More sharing options...
niche Posted November 19, 2012 Share Posted November 19, 2012 I'm following you now. Just post what you want steps 3 & 4 to be and post your code for step 3 (as far as you can get it). Link to comment Share on other sites More sharing options...
phpnoob Posted November 21, 2012 Author Share Posted November 21, 2012 Now i know what need to do, i was wrong about how to go to the first unreaded post :)I was check some forum, this forum to, and now i know how to make 1 :)the browsercode its like this. forum.php/forum.php?f=topicview&p=3$view=gotonewpost the p number its forumtopic id numberall select its if, and this script start with view=gotonewpost GETNote postmark table have 4 column ID + Userid + Forumtopicid + postcountid, the strategy is this, first record its insert into, the second will be update record1. select table "postmark" and search Userid and forumtopicid and get the postcountid data2. select table "forumpost" and search forumtopicid and check if have higher post then postmark/postcountid have, if have or not, put the right id to browser with header loc.Browsed code:forum.php/forum.php?f=topicview&p=3$pid=1 3. and now just need a js for searching hide div id with that number what pid have, and go to that position. Just wondering, in here why have so many code showtopic=45754&pid=255007&st=0entry255007for entry i know that that code need to js for go to that hide div id, but for pid number why need? Link to comment Share on other sites More sharing options...
justsomeguy Posted November 21, 2012 Share Posted November 21, 2012 It has both the topic and post IDs so that it knows which page to show of the topic if there are multiple pages. It shows the page with that post on it. Link to comment Share on other sites More sharing options...
phpnoob Posted November 21, 2012 Author Share Posted November 21, 2012 (edited) It has both the topic and post IDs so that it knows which page to show of the topic if there are multiple pages. It shows the page with that post on it.editedi check your post again for true or not, the multiple page its like this index.php?showtopic=45544&st=20st=20 its the code for pages, i talk sid not stLookwith pidw/o pidi was remove the pid and no different, its not do anything for pages script New questionWhat you advice for postcountid put real post id or alt 1?alt its like this, new column for counting post for each topic.Example:Forumpost tableid=1000 forumid=1 forumtopic=100 postcount=3 the topic have only 3 post, and each + record will be +1 in post count, like in here, or here those number its from of js? anyway i think its better to make this instead to add post id to postmark/postcountid column Edited November 21, 2012 by phpnoob Link to comment Share on other sites More sharing options...
justsomeguy Posted November 21, 2012 Share Posted November 21, 2012 I'm having a hard time understanding you. Link to comment Share on other sites More sharing options...
phpnoob Posted November 21, 2012 Author Share Posted November 21, 2012 I'm having a hard time understanding you.sorry i was write it to fast, check now Link to comment Share on other sites More sharing options...
justsomeguy Posted November 21, 2012 Share Posted November 21, 2012 I was only guessing what they use the post ID for, you would have to look at the code to see if they're using it. I'm not sure what your other question is, but it could work to store the post count for the posts viewed. That may be an issue if posts get deleted. Link to comment Share on other sites More sharing options...
phpnoob Posted November 21, 2012 Author Share Posted November 21, 2012 I was only guessing what they use the post ID for, you would have to look at the code to see if they're using it. I'm not sure what your other question is, but it could work to store the post count for the posts viewed. That may be an issue if posts get deleted.I post it again, maybe you miss read itSo for forum now it have 3 tableForumgroupForumtopicForumpostForumgroup have 3 columnID + Name + StatusStatus its for admin itForumtopic have 15 column, don't ask what, don't want to post what haveand Forumpost have 10 columnid + post + date + userid + forumid + topicid + sub + status + edituserid + editdateand now for postmark tablehave 4 column ID + Userid + Forumtopicid + postcountidid for delete and update, userid know why and forumtopicid to, and for postcountid to know which post was readed last this can make two way, write real Forumpost id.Example recordForumpost tableid=563 forumid=1 forumtopic=36Postmark tableID=1 Userid=3 Forumtopicid=36 postcountid=563 the other wayForumpost tableid=563 forumid=1 forumtopic=36 postcount=5id=564 forumid=1 forumtopic=36 postcount=6id=570 forumid=1 forumtopic=36 postcount=7Postmark tableID=1 Userid=3 Forumtopicid=36 postcountid=6 and if i del post? I just need to update only postcountid in Postmark table, to older 1 in each finded record And which idea you recommend? Link to comment Share on other sites More sharing options...
justsomeguy Posted November 21, 2012 Share Posted November 21, 2012 It would make sense to store the ID of the last post they read in each topic. Not a count of the number of posts they read, but the ID of the last post. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now