Conner's Family


Just a few more

Added code to make it send an email to the site contact address whenever a new comment is posted. (Discovered/Resolved by Samson.)

Fixed a bug that would have allowed a blog viewer to potentially post a comment to a non-existant blog thus creating SQL errors. (Discovered/Resolved by Samson.)

Made it so that the comment count beneath each blog post shows whether or not that blog post is closed to further comments already. (Discovered/Resolved by Samson.) (For an example of this, click on the calendar to the beginning of January.)

Made it so that 'auto post closings' happen automatically when an admin logs into the admin control panel. (Resolved by Samson & Devenon.)

Made it so that when an admin selects the option of manually reopening/closing blog posts, the listing function will report a count of how many there are to do either function with or exit out gracefully with a message indicating that there are none if there aren't any blogs posts to reopen/close currently instead. (Discovered/Resolved by Devenon.)

Posted by: Conner Feb 7, 2007, 3:42 am
Comments:
Posted by: Conner On Feb 7, 2007, 3:44 am
Really just a test comment to see how the email notification works out.

Posted by: Devenon On Feb 7, 2007, 11:30 am
You've been busy!  I put in most of the same changes as you, though I didn't do the whole error check for the non-existent blog comment posting.  I wasn't sure exactly what he was trying to do there.  I'm sure I'll figure it out later.

I've also taken his e-mail and modified it a bit so now it does show the subject of the post, and it shows it as an actual link, since I've turned his plain-text e-mail to html e-mail.  Keep up the good work.  And thanks for your continual support in showing credit. :)

Posted by: Conner On Feb 7, 2007, 12:04 pm
From what I could tell, if someone had altered the address bar on the comments page, it'd let them attempt to post a comment to a non-existant blog entry which would cause a bit of havoc for the database, so what he's done is move the check for a valid blog post to before accepting the comment. *shrug* ..my guess is that it's something that would really only 'work' on a fluke anyway, but with his fix it shouldn't 'work' at all now.

The email does show the subject line of the post that the comment is attached to as he wrote it, it just didn't show it as a link to the post like he'd wanted. How'd you manage to get it to send it as html formatted email with the hyperlink he was after? What I think would be really cool is if it could work like forum notifications do any email the others who've left comments as well so they could 'track' for responses from the admin.. and I agree with Samson that it'd be really nice if we could make comments recognize the admins and require a logon to post as an admin for comments and then not send the email notice if it was an admin comment unless it was sending it to the other admins, but that'd require my other idea about allowing for a seperate email for each admin instead of, or in addition to, a site email along with a drop down selector for the contact page so that you could choose to send your contact to a specific admin or the whole site. Maybe eventually I'll figure out how to do that too... in fact, it wouldn't hurt if the comment notification email had a copy of the comment itself as well in it, then you could read it in your email and decide whether to respond by visiting the site and posting a new comment (like this one) in response or just be satisfied with having read it in your email.

Hey, you know me, I give credit because there isn't that much I can take credit for so I like to encourage others to give me credit when it's due by example. ;)

I still need to get your smilies 'fix' in place too yet...

Posted by: Conner On Feb 7, 2007, 12:21 pm
Ok, added in Devenon's modification to make the email notifications use html format and link to the blog entry. :)

Posted by: Conner On Feb 9, 2007, 12:51 pm
Really just a test post because I've added in smilie support and the email notice of new comment html enhancement (Both by Devenon), so now, as you can plainly see, our blog entries, comments, and (not so obvious to anyone who's not an admin) our emails from the site all support smilies. :)

Posted by: Devenon On Feb 10, 2007, 1:05 pm
I can see you added the smileys!  It looks good! :D  And if you noticed, they also show up on the main page which lists the blog posts!  Hope you like the html message with the comment in it too ;)

Posted by: Samson On Feb 11, 2007, 5:53 pm
Quote:
*shrug* ..my guess is that it's something that would really only 'work' on a fluke anyway, but with his fix it shouldn't 'work' at all now.


It's not a fluke if a hacker tried to do it as a means of making it reveal info. There are developer extensions that also let you alter the $_POST and $_GET variables you submit to the site, so you do need to be mindful of this. Moving the check up is more of a me being paranoid security thing than anything else.

Posted by: Conner On Feb 12, 2007, 2:46 am
Thanks for the explaination, Samson, I'll relay that to Devenon. I had made the change because I respect your opinion on these matters, but hadn't understood what it was needed for.

Valid XHTML 1.1! Valid CSS!