mirror of
https://github.com/silverstripe/silverstripe-comments
synced 2024-10-22 11:05:49 +02:00
FIX: url not showing in comments template
This commit is contained in:
parent
8ab18fe1d0
commit
e18cf3e2bb
@ -137,25 +137,6 @@ class Comment extends DataObject {
|
||||
return ($parent->Title) ? $parent->Title : $parent->ClassName . " #" . $parent->ID;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is called just before this object is
|
||||
* written to the database.
|
||||
*
|
||||
* Specifically, make sure "http://" exists at the start
|
||||
* of the URL, if it doesn't have https:// or http://
|
||||
*/
|
||||
public function onBeforeWrite() {
|
||||
parent::onBeforeWrite();
|
||||
|
||||
$url = $this->CommenterURL;
|
||||
|
||||
if($url) {
|
||||
if(strtolower(substr($url, 0, 8)) != 'https://' && strtolower(substr($url, 0, 7)) != 'http://') {
|
||||
$this->CommenterURL = 'http://' . $url;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @todo needs to compare to the new {@link Commenting} configuration API
|
||||
*
|
||||
|
@ -5,25 +5,28 @@
|
||||
$Comment.XML
|
||||
<% end_if %>
|
||||
</p>
|
||||
|
||||
<p class="info">
|
||||
<% if CommenterURL %>
|
||||
<% _t('PBY','Posted by') %> <a href="$CommenterURL.ATT" rel="nofollow">$Name.XML</a>, $Created.Nice ($Created.Ago)
|
||||
<% if $URL %>
|
||||
<% _t('PBY','Posted by') %> <a href="$URL.URL" rel="nofollow">$Name.XML</a>, $Created.Nice ($Created.Ago)
|
||||
<% else %>
|
||||
<% _t('PBY','Posted by') %> $Name.XML, $Created.Nice ($Created.Ago)
|
||||
<% end_if %>
|
||||
</p>
|
||||
|
||||
<ul class="action-links">
|
||||
<% if ApproveLink %>
|
||||
<li><a href="$ApproveLink" class="approve"><% _t('APPROVE', 'approve this comment') %></a></li>
|
||||
<% end_if %>
|
||||
<% if SpamLink %>
|
||||
<li><a href="$SpamLink" class="spam"><% _t('ISSPAM','this comment is spam') %></a></li>
|
||||
<% end_if %>
|
||||
<% if HamLink %>
|
||||
<li><a href="$HamLink" class="ham"><% _t('ISNTSPAM','this comment is not spam') %></a></li>
|
||||
<% end_if %>
|
||||
<% if DeleteLink %>
|
||||
<li class="last"><a href="$DeleteLink" class="delete"><% _t('REMCOM','remove this comment') %></a></li>
|
||||
<% end_if %>
|
||||
</ul>
|
||||
<% if ApproveLink || SpamLink || HamLink || DeleteLink %>
|
||||
<ul class="action-links">
|
||||
<% if ApproveLink %>
|
||||
<li><a href="$ApproveLink" class="approve"><% _t('APPROVE', 'approve this comment') %></a></li>
|
||||
<% end_if %>
|
||||
<% if SpamLink %>
|
||||
<li><a href="$SpamLink" class="spam"><% _t('ISSPAM','this comment is spam') %></a></li>
|
||||
<% end_if %>
|
||||
<% if HamLink %>
|
||||
<li><a href="$HamLink" class="ham"><% _t('ISNTSPAM','this comment is not spam') %></a></li>
|
||||
<% end_if %>
|
||||
<% if DeleteLink %>
|
||||
<li class="last"><a href="$DeleteLink" class="delete"><% _t('REMCOM','remove this comment') %></a></li>
|
||||
<% end_if %>
|
||||
</ul>
|
||||
<% end_if %>
|
||||
|
Loading…
Reference in New Issue
Block a user