webdogjcn Posted June 5, 2006 Share Posted June 5, 2006 Okay so, I need to know how to do the following with my forum:[ol type=\'1\'][*]Figuring out whether or not the user has viewed the newest post or not[*]Creating a Quick Reply box (im guessing I will have to do this w/ javascript if I want it without having to reload the page)[*]removing html from the title entry (so the user cant put in like <b><image src=''>HEY LOOK AT ME</b> to make their post title stand out)[/ol]I have four tables in my db: categories, forums, topics, repliesYou should be able to figure out how I am trying to do it from there. I really need this so if you can help out at all that would be really appreciated Quote Link to comment https://forums.phpfreaks.com/topic/11253-building-a-forum-and-need-help/ Share on other sites More sharing options...
localhost Posted June 5, 2006 Share Posted June 5, 2006 1. You might want to use cookies like vBulletin uses, I am not sure exactly how it is used so you might have to do more looking up on that.2. Quick reply box is just the normal reply box on that page, and without it refreshing you will have to use AJAX. vBulletin has only used that just recently in vBulletin 3.5.4.3. You have to use striptags with PHP they basically disallow whatever you want, <b> <i> <u> etc etc. Quote Link to comment https://forums.phpfreaks.com/topic/11253-building-a-forum-and-need-help/#findComment-42108 Share on other sites More sharing options...
webdogjcn Posted June 5, 2006 Author Share Posted June 5, 2006 alright, I will look into AJAX and stiptags, the main problem with cookies is Im not sure how I can store all of the information into one cookies w/o it being huge I thought of this:[code]$temp=$_COOKIE['topicsread'];$topic_id=",$_GET['id'];"$cookie_life = 365*24*3600;Setcookie(topicsread,$temp.$topic_id,time()+$cookie_life);[/code]Then expanding it up with EXPLODE where "," is found and somehow searching the resulting array for the newest topic id and if it is there then display the "No New Posts image" and else display the "New Posts Image".Two problems arise:1. I do not think I can add a "," in there like that2. I do not know how to search an array Quote Link to comment https://forums.phpfreaks.com/topic/11253-building-a-forum-and-need-help/#findComment-42128 Share on other sites More sharing options...
.josh Posted June 5, 2006 Share Posted June 5, 2006 for checking to see whether a post/thread was read or not, i would do a query that checks the time of the last post in each thread, vs. the time you last logged in and/or accessed a page while logged in. Quote Link to comment https://forums.phpfreaks.com/topic/11253-building-a-forum-and-need-help/#findComment-42133 Share on other sites More sharing options...
webdogjcn Posted June 5, 2006 Author Share Posted June 5, 2006 the problem with that is that if several posts were made since you've been online...they will all appear as though they have been read Quote Link to comment https://forums.phpfreaks.com/topic/11253-building-a-forum-and-need-help/#findComment-42140 Share on other sites More sharing options...
Daguse Posted June 5, 2006 Share Posted June 5, 2006 for Problem 3, I would use htmlentities($title).That way if they do make a title with HTML it will echo the HTML tags as text.... all you would see is <b><image src=''>HEY LOOK AT ME</b>. Quote Link to comment https://forums.phpfreaks.com/topic/11253-building-a-forum-and-need-help/#findComment-42148 Share on other sites More sharing options...
Buyocat Posted June 5, 2006 Share Posted June 5, 2006 To keep track of posts read I would make a separate table that contains user ids and post ids then when you load the page you query that table for the specific user id and mark each post id that comes up as "read" on the display side.This would of course mean that each time you open a page it checks for the user id and post id in that table and if it doesn't find the couple enters it. Quote Link to comment https://forums.phpfreaks.com/topic/11253-building-a-forum-and-need-help/#findComment-42149 Share on other sites More sharing options...
localhost Posted June 5, 2006 Share Posted June 5, 2006 "for Problem 3, I would use htmlentities($title).That way if they do make a title with HTML it will echo the HTML tags as text.... all you would see is HEY LOOK AT ME."dont you mean you would see <b>HEY LOOK AT ME.</b>??? Quote Link to comment https://forums.phpfreaks.com/topic/11253-building-a-forum-and-need-help/#findComment-42150 Share on other sites More sharing options...
webdogjcn Posted June 5, 2006 Author Share Posted June 5, 2006 okay...ill use the htmlentities...I think I understand buyocat, but if I get a lot of users and end up with a lot of posts this will use a great deal of db space Quote Link to comment https://forums.phpfreaks.com/topic/11253-building-a-forum-and-need-help/#findComment-42158 Share on other sites More sharing options...
Buyocat Posted June 5, 2006 Share Posted June 5, 2006 Web if you're using small or medium ints for key values I'm sure it won't be a huge burden and frankly by the time you got enough users/posts to make this an issue you would probably be such a success that you would want to upgrade to a private server anyway. Quote Link to comment https://forums.phpfreaks.com/topic/11253-building-a-forum-and-need-help/#findComment-42161 Share on other sites More sharing options...
webdogjcn Posted June 5, 2006 Author Share Posted June 5, 2006 alright, thanks everyone I will post later if I have anymore questions Quote Link to comment https://forums.phpfreaks.com/topic/11253-building-a-forum-and-need-help/#findComment-42163 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.