Jump to content

Building a Forum and need help


webdogjcn

Recommended Posts

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, replies
You 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
Link to comment
https://forums.phpfreaks.com/topic/11253-building-a-forum-and-need-help/
Share on other sites

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.
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 that
2. I do not know how to search an array
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.

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.