Monday, December 6, 2010

Processing of question

Handling Processing of QForm

Title, body, tags run through utf-8 string first

Run title, tags, body through htmlspecialchars or htmlentities()
or even through string_tags!

In the future if we allow tags then...we will run through safe_html instead!

Make intro
Parse markdown
store [html], [plain]
or just body?

We need something like messageAdapter that will accept
submittedQuestion object

SubmittedQuestion will have:
getBody (UTF8 object is fine, it's even better because we will be able to get num-lines, num-words)
getTitle Utf8String
getTags array
getUser <- UserObject
getIP string

////

tokenize title

record:
PER_USER_TAGS
TITLE_TAGS
QUESTION_TAGS
USER_STATS... not sure what it is but we need to update count_questions of user, right?
Ideally this will be in mongo USER collection
We can have separate collection USER_STATS, it's fine and it's small...


We can also keep reputation there? Maybe but it's really inconvenient because we
need reputation in clsUserObject of oViewer.


Also... we still want similar elist items!

We also want a way to get similar questions (later)
Also need a way to check for duplicate using q_hash uid + body

Need a way to test for floodcheck per uid, per ip

so we need a flood check class that would act as a filter via observer?

It's cool

The similar creation should be done as post-echo call.
also some emailing to subscribers will be done via post-echo thingy

///

Need a way to validate and set form errors.
validate title, validateBody, validateTags

If there are errors in validation we will return the same form.

Otherwise do redirect via meta tag with 2 seconds delay
How to do meta redirect? Basically we need to still show result page
with link to view new question and will say 'you will be redirected in 3 seconds"

No comments:

Post a Comment