Skip to content

Commit

Permalink
API Remove Trackback support
Browse files Browse the repository at this point in the history
It was disabled since migrating the module to SS3,
and the whole concept has become less relevant since spammers discovered trackbacks
(ref http://en.wikipedia.org/wiki/Trackback#Spam).

Since we don't have the resources to make a spam-proof trackback system,
its prudent to remove it instead.
  • Loading branch information
chillu committed Apr 10, 2013
1 parent 7f01944 commit d351d33
Show file tree
Hide file tree
Showing 11 changed files with 9 additions and 466 deletions.
20 changes: 0 additions & 20 deletions code/BlogEntry.php
Expand Up @@ -37,10 +37,6 @@ class BlogEntry extends Page {
'ShowInMenus' => false
);

private static $extensions = array(
'TrackBackDecorator'
);

/**
* Is WYSIWYG editing allowed?
* @var boolean
Expand Down Expand Up @@ -174,21 +170,6 @@ function EditURL() {
return ($this->getParent()) ? $this->getParent()->Link('post') . '/' . $this->ID . '/' : false;
}

/**
* Check to see if trackbacks are enabled.
*/
function TrackBacksEnabled() {
return ($this->getParent()) ? $this->getParent()->TrackBacksEnabled : false;
}

function trackbackping() {
if($this->TrackBacksEnabled() && $this->hasExtension('TrackBackDecorator')) {
return $this->decoratedTrackbackping();
} else {
Controller::curr()->redirect($this->Link());
}
}

function IsOwner() {
if(method_exists($this->Parent(), 'IsOwner')) {
return $this->Parent()->IsOwner();
Expand Down Expand Up @@ -251,7 +232,6 @@ class BlogEntry_Controller extends Page_Controller {

private static $allowed_actions = array(
'index',
'trackbackping',
'unpublishPost',
'PageComments',
'SearchForm'
Expand Down
19 changes: 9 additions & 10 deletions code/BlogHolder.php
Expand Up @@ -14,15 +14,14 @@
class BlogHolder extends BlogTree implements PermissionProvider {

private static $icon = "blog/images/blogholder-file.png";

private static $description = "Displays listings of blog entries";

private static $singular_name = 'Blog Holder Page';

private static $plural_name = 'Blog Holder Pages';

private static $db = array(
'TrackBacksEnabled' => 'Boolean',
'AllowCustomAuthors' => 'Boolean',
'ShowFullEntry' => 'Boolean',
);
Expand All @@ -42,13 +41,13 @@ function getCMSFields() {
$fields = parent::getCMSFields();
SiteTree::enableCMSFieldsExtensions();

//sets the ID and Name Map for Blog Ownership
$owners = new DropdownField('OwnerID', 'Blog owner', $blogOwners->map('ID', 'Name')->toArray());
$owners->setEmptyString('(None)');
$owners->setHasEmptyDefault(true);

$fields->addFieldToTab('Root.Main', new CheckboxField('TrackBacksEnabled', 'Enable TrackBacks'), "Content");
$fields->addFieldToTab('Root.Main', $owners, "Content");
$fields->addFieldToTab(
'Root.Main',
DropdownField::create('OwnerID', 'Blog owner', $blogOwners->map('ID', 'Name')->toArray())
->setEmptyString('(None)')
->setHasEmptyDefault(true),
"Content"
);
$fields->addFieldToTab('Root.Main', new CheckboxField('AllowCustomAuthors', 'Allow non-admins to have a custom author field'), "Content");
$fields->addFieldToTab("Root.Main", new CheckboxField("ShowFullEntry", "Show Full Entry"), "Content");

Expand Down
161 changes: 0 additions & 161 deletions code/TrackBackDecorator.php

This file was deleted.

24 changes: 0 additions & 24 deletions code/TrackBackPing.php

This file was deleted.

55 changes: 0 additions & 55 deletions code/TrackBackURL.php

This file was deleted.

20 changes: 0 additions & 20 deletions templates/Includes/TrackBacks.ss

This file was deleted.

3 changes: 0 additions & 3 deletions templates/Layout/BlogEntry.ss
Expand Up @@ -18,8 +18,5 @@

<% if IsOwner %><p class="edit-post"><a href="$EditURL" id="editpost" title="<% _t('EDITTHIS', 'Edit this post') %>"><% _t('EDITTHIS', 'Edit this post') %></a> | <a href="$Link(unpublishPost)" id="unpublishpost"><% _t('UNPUBLISHTHIS', 'Unpublish this post') %></a></p><% end_if %>

<% if TrackBacksEnabled %>
<% include TrackBacks %>
<% end_if %>
$PageComments
</div>
5 changes: 0 additions & 5 deletions templates/TrackBackPingReturn.ss

This file was deleted.

3 changes: 0 additions & 3 deletions templates/TrackBackRdf.ss

This file was deleted.

0 comments on commit d351d33

Please sign in to comment.