Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2006-11-15 18:16:24
- agustinpac
- New Member
- Registered: 2006-11-15
- Posts: 4
Adding to the comment form
Hi all!!
I’m writing a plugin that someone requested here, but I’m a newby here.
I have modified the funcion saveComment (in comment.php) and what I needed works, but I need to add a checkbox where people write their comments.
The question is how do I do that and how do I send the checkbox info (‘yes’ or ‘no’) to the function saveComment like the other parameters: name, web, message, etc.
btw, i’ll change the name of the function later.
Thanks in advance!
(Edit: updated thread subject to something more clear. -Mary)
Last edited by Mary (2007-01-02 14:47:33)
Offline
Re: Adding to the comment form
So the built-in savecomment() function calls getcomment() to get things like name, web, email, etc. You could write another version of getcomment() to include your additional checkbox. Or you could just add a line to you savecomment() function to include:
$yourvar = ps('nameofcheckbox');
Offline
#3 2006-11-15 19:01:45
- agustinpac
- New Member
- Registered: 2006-11-15
- Posts: 4
Re: Adding to the comment form
That’s what I needed!! thanks
And how do I insert the checkbox in the code? because all the others are inserted using a function like this:
<td>
<txp:comment_name_input />
</td>
<td> <txp:comment_remember /> </td>
thanks
Offline
Re: Adding to the comment form
Tags will just call a function –
<txp:asv_checkbox />
will call
function asv_checkbox($atts, $thing){
return $your_html_for_the_checkbox;
}
So create a function that will generate the html for your checkbox and just have it return that string. You can include this function in the plugin you are building right now.
Offline
Offline
Offline
#7 2006-11-16 12:26:19
- agustinpac
- New Member
- Registered: 2006-11-15
- Posts: 4
Re: Adding to the comment form
thanks guys!
I’m almost finishig it!!
I’ll let you know…
Regards
Offline
Pages: 1