This is the community forum. For a developer response use the Client Area.
Follow us on Facebook, Twitter and YouTube!

Add a Title field to comments
#1

I had to rapidly implement a comment title, if anyone else needs something similar, I hope this may help.

Due to time constraints, some functionality is missing. For example:
1. There is no option to toggle 'required'. I set it to required.
2. There is no option to set field length. I set it to 80 characters.

Obviously, you can implement this missing functionality yourself or complete the integration that I missed. You can also change the code to suit your needs.

You can toggle enabled or not in the backend. I used mostly the code from Steven and took over functionality from the Comment text area. For example, checking for injection, checking against the bad word list, etc. So if a user tries to enter anything like this in the Title field, the comment submission will be set to 'to be approved', as per the comment field.

I use bootstrap, so you may have to change some of the styling to suit, if you use the supplied CSS, but I guess if you are prepared to make the changes attached, you will know how to do this.

I also shouldn't need to remind you that this worked for me, it may not work for you, use at your own risk. Remember that these changes will be lost or mangled at the next update from Steven, and of course, backup all files you intend to change if everything goes pear-shaped, so you can set it back to the way it was.

Read the file through to understand what is happening before you make any changes.

Cheers
Lisa


Attached Files
.pdf add_title_field.pdf Size: 194.85 KB  Downloads: 78
Reply
#2

Hi Lisa,

Thanks for posting this. I've seen a few people ask for it before so I'm sure it will be useful to others.

You seem to have a really good understanding of the script already!

Have you completed the interview?
Reply
#3

First Thank you for taking the time to document your hard work.  Saved me a ton of time.  

Slight error in the PDF.  Page 3
Add this $comment = $_POST['comment_title'];
Should read 
Add this $comment_title = $_POST['comment_title'];
Thanks Again

(21-Mar-2014, 07:37 PM)Lisa Wrote:  LisaI had to rapidly implement a comment title, if anyone else needs something similar, I hope this may help.

Due to time constraints, some functionality is missing. For example:
1. There is no option to toggle 'required'. I set it to required.
2. There is no option to set field length. I set it to 80 characters.

Obviously, you can implement this missing functionality yourself or complete the integration that I missed. You can also change the code to suit your needs.

You can toggle enabled or not in the backend. I used mostly the code from Steven and took over functionality from the Comment text area. For example, checking for injection, checking against the bad word list, etc. So if a user tries to enter anything like this in the Title field, the comment submission will be set to 'to be approved', as per the comment field.

I use bootstrap, so you may have to change some of the styling to suit, if you use the supplied CSS, but I guess if you are prepared to make the changes attached, you will know how to do this.

I also shouldn't need to remind you that this worked for me, it may not work for you, use at your own risk. Remember that these changes will be lost or mangled at the next update from Steven, and of course, backup all files you intend to change if everything goes pear-shaped, so you can set it back to the way it was.

Read the file through to understand what is happening before you make any changes.

Cheers
Lisa
Reply


Possibly Related Threads…
Thread / Author Replies Views Last Post

Forum Jump:


Users browsing this thread: 1 Guest(s)