Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
How do I add an extra comment input field?
I’m trying to add the subject input field to my comment area and I am having problem getting to work.
Here is what i have in in my
publish/comments.php- http://pastebin.com/401736
comment, comment display, and comment form forms-http://pastebin.com/401743
Any help would be greatly appreciated
Offline
#2 2005-10-23 00:37:26
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: How do I add an extra comment input field?
So you added a ‘subject’ field to your txp_discuss table?
Can you elaborate on exactly what the problem is?
Offline
Re: How do I add an extra comment input field?
Basically I want to give commenters an option to write a subject in there comments
sort of like in drupal
I got the subject input to show and I have added a table to txp_discuss, but I don’t know how to get the subject to show in the comments
> mary wrote:
> So you added a ‘subject’ field to your txp_discuss table?
Can you elaborate on exactly what the problem is?
Last edited by myisha (2005-10-23 08:52:28)
Offline
#4 2005-10-23 12:08:02
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: How do I add an extra comment input field?
> …“I have added a table to txp_discuss…”
I’m assuming/hoping you meant ‘field’ and not ‘table’. :)
> …but I don’t know how to get the subject to show in the comments…”
You’ll need to either create yourself a new tag by adding a couple lines to /textpattern/publish/taghandlers.php, or you can just use regular ol’ PHP:
<txp:php>echo $GLOBALS['thiscomment']['subject'];</txp:php>
Put that in your “comments” form wherever you want your subject to appear. :)
Offline
Re: How do I add an extra comment input field?
I’d like to do something similar with a new TextPattern install. The extra field will just hold a number so that users can add a rating (if they choose to). Can someone elaborate on the changes required for taghandlers.php mentioned above? Many thanks
I may just use the php solution (if easier) to display the extra field but explanation of the taghandlers.php edit would be very useful.
Is there anything else I should know? I’ll be adding an extra field to the txp_discuss table using PHPMyadmin.
Offline