Jump to content


Photo

User Reviews


  • Please log in to reply
4 replies to this topic

#1 webdogjcn

webdogjcn
  • Members
  • PipPipPip
  • Advanced Member
  • 40 posts

Posted 27 May 2006 - 12:48 AM

I have no clue how I want to do this, but I am putting up some tutorials on my website and I want users to be able to write their own reviews of them. However, I am limited to one db for my whole site which means user accounts, articles, everything. Anyways I do not want to use a table for every article. I was even hoping I could have the users fill out a form and create a text file from the information and then just include it in my page. How would I do this. I am not sure where to start so if you could be as specific as possible.

#2 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 27 May 2006 - 01:56 AM

I can't think of any sensible reason to have a separate database table for each article. As well, the number of tables you can have in one database is huge (far in excess of the number of articles you'll ever write).

Despite both those, the best method is to have one table for all the articles and have an autoincremented ID for the rows and then have a second table for all the reviews - just put the articleID as one of the fields in the reviews table. Then you'll be able to pull all of the reviews for a specific article any time you want.
Legend has it that reading the manual never killed anyone.
My site

#3 webdogjcn

webdogjcn
  • Members
  • PipPipPip
  • Advanced Member
  • 40 posts

Posted 27 May 2006 - 02:57 AM

okay thak you so much. I got it working.

One Last Question:
I want users to be able to post articles/tutorials on my site, but I dont want them to have to enter in stuff like "<p class=scripting></p>" to get their stuff to look right. So, I was wondering how I can process the form they send in and replace all things like [SCRIPT] with "<p class=scripting>" or [FONTCOL=blue] with "<font color='blue'>" etc. Anyways so the user would fill out a form like this:
<form action=articlepost.php method=post>
<input type=text name="artname">
<textarea name="article"></textarea>
And take whatever is in "article" and replace all occurances of BB style coding with the actual html before inserting it into the db

#4 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 27 May 2006 - 03:05 AM

Instead of making it difficult for people to format articles the way they want, it might be better to use a 'smart textarea' that looks/works like a word-processor. Two excellent free such textarea editors are [a href=\"http://tinymce.moxiecode.com/\" target=\"_blank\"]TinyMCE[/a] and [a href=\"http://www.fckeditor.net/\" target=\"_blank\"]FCKEditor[/a]. Those could save you a lot of trouble.
Legend has it that reading the manual never killed anyone.
My site

#5 webdogjcn

webdogjcn
  • Members
  • PipPipPip
  • Advanced Member
  • 40 posts

Posted 27 May 2006 - 03:27 AM

alright I'll take a look at them, thanks for the help




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users