Added ability for comment authors to leave a URL as a separate form field

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.3@68326 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Brian Calhoun 2008-12-11 03:34:39 +00:00 committed by Sam Minnee
parent ca4a4a9c2f
commit 709e352bbc
3 changed files with 10 additions and 2 deletions

View File

@ -9,7 +9,8 @@ class PageComment extends DataObject {
"Name" => "Varchar(200)", "Name" => "Varchar(200)",
"Comment" => "Text", "Comment" => "Text",
"IsSpam" => "Boolean", "IsSpam" => "Boolean",
"NeedsModeration" => "Boolean" "NeedsModeration" => "Boolean",
"CommenterURL" => "Varchar(255)"
); );
static $has_one = array( static $has_one = array(

View File

@ -122,6 +122,8 @@ class PageCommentInterface extends RequestHandler {
$fields->push(new TextField("Name", _t('PageCommentInterface.YOURNAME', 'Your name'))); $fields->push(new TextField("Name", _t('PageCommentInterface.YOURNAME', 'Your name')));
} }
// optional commenter URL
$fields->push(new TextField("CommenterURL", _t('PageCommentInterface.COMMENTERURL', "Your website URL")));
if(MathSpamProtection::isEnabled()){ if(MathSpamProtection::isEnabled()){
$fields->push(new TextField("Math", sprintf(_t('PageCommentInterface.SPAMQUESTION', "Spam protection question: %s"), MathSpamProtection::getMathQuestion()))); $fields->push(new TextField("Math", sprintf(_t('PageCommentInterface.SPAMQUESTION', "Spam protection question: %s"), MathSpamProtection::getMathQuestion())));

View File

@ -6,7 +6,12 @@
<% end_if %> <% end_if %>
</p> </p>
<p class="info"> <p class="info">
<span><% _t('PBY','Posted by') %> $Name.XML, $Created.Nice ($Created.Ago)</span> <% if CommenterURL %>
<span><% _t('PBY','Posted by') %> <a href="$CommenterURL">$Name.XML</a>, $Created.Nice ($Created.Ago)</span>
<% else %>
<span><% _t('PBY','Posted by') %> $Name.XML, $Created.Nice ($Created.Ago)</span>
<% end_if %>
<br /> <br />
<ul class="actionLinks"> <ul class="actionLinks">
<% if ApproveLink %> <% if ApproveLink %>