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
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.
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.