DEPRECATION WARNING
This documentation is not using the current rendering mechanism and is probably outdated. The extension maintainer should switch to the new system. Details on how to use the rendering mechanism can be found here.
Pingback Server for TYPO3¶
Author: | Nikolas Schmidt-Voigt |
---|---|
Created: | 2012-03-06T21:50:40 |
Changed by: | Nikolas Schmidt-Voigt |
Changed: | 2012-04-04T22:38:41 |
Classification: | nsvpingback |
Description: | The keywords help with categorizing and tagging of the manuals. You can combine two or more keywords and add additional keywords yourself. Please use at least one keyword from both lists. If your manual is NOT in english, see next tab "language" ---- forEditors (use this for editors / german "Redakteure") forAdmins (use this for Administrators) forDevelopers (use this for Developers) forBeginners (manuals covering TYPO3 basics) forIntermediates (manuals going into more depth) forAdvanced (covering the most advanced TYPO3 topics) see more: http://wiki.typo3.org/doc_template#tags ---- |
Keywords: | forAdmins, forIntermediates, pingback, blogging |
Author: | Nikolas |
Email: | n.schmidtvoigt@googlemail.com |
Language: | en |
Pingback Server for TYPO3¶
Extension Key: nsvpingback
Language: en
Version: 1.0.0
Keywords: forAdmins, forIntermediates, pingback, blogging
Copyright 2006-2012, Nikolas Schmidt-Voigt, <n.schmidtvoigt@googlemail.com>
This document is published under the Open Content License
available from http://www.opencontent.org/opl.shtml
The content of this document is related to TYPO3
- a GNU/GPL CMS/Framework available from www.typo3.org
Table of Contents¶
`Pingback Server for TYPO3 1 <#__RefHeading__5708_1738894311>`_
`Introduction 3 <#__RefHeading__5710_1738894311>`_
`Users manual 4 <#__RefHeading__467_413120346>`_
`Administration 5 <#__RefHeading__31511_818911409>`_
Alias Path for the Pingback Server 5
Simplify the detection of the Pingback Server 5
`Configuration 7 <#__RefHeading__31515_818911409>`_
`Tutorial 8 <#__RefHeading__31523_818911409>`_
`To-Do list 9 <#__RefHeading__477_413120346>`_
`ChangeLog 10 <#__RefHeading__31623_818911409>`_
Introduction¶
What does it do?¶
The extension nsvpingbacks enables TYPO3 sites to receive pingbacks from other sites. Admins and editors can manage pingbacks and approve or disapprove them individually. Nsvpingbacks works together with other extensions like tt_news and thus is especially suited for blogs based on TYPO3.
Screenshots¶
Admins set up pingback functionality by including a FE plugin on the pages that should be able to receive pingbacks:
Editors manage pingbacks in a special BE module:
Users manual¶
Editors manage pingbacks in the new BE module “Pingbacks”. This module lists all the pingbacks that a certain page received (e.g. the page with the single view for tt_news).
Beside the columns “UID”, “Date” and “(Dis-)Approve” users find arrows for sorting the table. Editors can sort the table by clicking on one of these arrows according to UID, date, or the current approval status. Editors can sort columns both by ascending and descending order.
Each row displays a single pingback. The column “Pingback” displays the title of the source, a short excerpt from the source and the target URL. By clicking the icon in the column “(Dis-)Approve” editors can change the approval status. The FE plugin will display only approved pingbacks. By clicking the icon in the column “Edit” editors may edit certain elements of the pingback. By clicking on the trash can in the column “Delete” editors delete single items. Finally, the last column allows to select several rows and perform a bulk action. Editors chose and perform bulk action at the select box below the table. Checking the box in the table header selects all rows, un- checking it de-selects all rows.
Administration¶
Setting up the FE plugin¶
In order to enable single pages in the TYPO3 site to receive pingbacks the administrator must insert the “Pingbacks” plugin on these pages. Just add a new content element, choose “General Plugin” and select “Pingbacks” on the plugin tab.
The FE plugin both controls the pingback server for this page and displays received pingbacks in FE. The most important configuration is the field “Content Identifier”. This field determines for which kind of dataset the pingbacks will be registered and shown. It should contain “pid” if the extension should assign the pingbacks to the current page as a whole. In order to assign the pingbacks to another dataset that is displayed on this page (like a single news item of the tt_news extension) the “Content Identifier” field must contain the name of the query string parameter which would designate this dataset (e.g. tx_ttnews[tt_news]).
The plugin will display all the pingbacks that have been registered for the identified content if the checkbox “Display pingbacks” is selected. It renders the pingbacks according to the template file chosen in the input field “Template File” (see the example template in EXT:nsvpingbacks/res/pi1_default.tmp and the next section for a reference of the possible markes). The date will be rendered according to the format in the input field “Dateformat” (see http://www.php.net/manual/en/function.date.php ).
Alias Path for the Pingback Server¶
An eID script will receive and register the pingbacks. Its URI is: /?eID=nsvpingbacks. Pingback clients will normally send pingbacks via a POST request. Often, these POST requests do not work well with the query string parameter eID. Therefore it is necessary to setup a rewrite rule in the .htaccess for this script. Just add these lines to your .htaccess:
<IfModule mod_rewrite.c>
RewriteRule ^nsvpingbacks/$ ?eId=nsvpingbacks [L]
</IfModule>
In order to enable the new path of the pingback server it must be assigned in the extension manager. Just choose nsvpingbacks in the list of installed extension and enter the new path (“/nsvpingbacks/”) in the field “Pingback Server Path”.
Simplify the detection of the Pingback Server¶
Wordpress blogs (which will probably send most of the pingbacks) will request the target URI on your page to check whether it is able to receive pingbacks and to find out the URI of the pingback server. First, they will send a HEAD request to check if the HTTP parameter X-Pingbacks is set. If it is not set, they will send a GET request and look for the according link element in the head section of your document.
In both cases the request from wordpress will time out after two seconds. This may be too short for many TYPO3 pages to answer the requests. Therefore, it is necessary to set the X-Pingback parameter in the HTTP header and to speed up the response to HEAD requests. In order to achieve this just add these lines to your .htaccess:
<IfModule mod_headers.c>
Header set X-Pingback http://[your-domain]/nsvpingbacks/
</IfModule>
<IfModule mod_rewrite.c>
RewriteCond %{THE_REQUEST} ^HEAD(.*)$
RewriteRule .* emptyAnswer.html [L]
</IfModule>
And add an empty file with the name “emptyAnswer.html” in the root directory of your TYPO3 system.
Configuration¶
You may configure the FE plugin of your pingback server either in the plugin’s flex form or via TypoScript. You may also include the static template for the pingback plugin with reasonable default values.
In the extension manager you can customize the pingback module. The field “Number of records” determines how many rows with pingbacks the module will display on one page. The field “Select values” contains a list with numbers of pingbacks per page which the editor can select in the module.
For debugging purposes I added the possibility to log each pingback request in an extra file. If you wish to record each pingback another blog sends to your page just check the checkbox “Log pingbacks” and enter a filename in the field “Logfile for pingbacks”.
Reference¶
Reference of TypoScript options: plugin.tx_nsvpingbacks_pi1.
template¶
Property
template
Data type
string
Description
Path to the template for the FE plugin
Default
EXT:nsvpingbacks/res/pi1_default.tmpl
dateformat¶
Property
dateformat
Data type
string
Description
Dateformat for the FE plugin (see http://www.php.net/manual/en/function.date.php for more information)
Default
d.m.Y – H:i
identifier¶
Property
identifier
Data type
string
Description
The GET parameter that identifies the content for which the pingback will be saved
Default
pid
Example¶
Settings for registering pingbacks for tt_news:
plugin.tx_nsvpingbacks_pi1 {
template = fileadming/template/pingbacks.tmpl
dateformat = m/d/Y – g:i a
identifier = tx_ttnews[tt_news]
}
Markers and sections in the template¶
ALLPINGBACKS¶
Marker/section
ALLPINGBACKS
Type
section
Description
The HTML for the whole pingback plugin if any pingback is registered for the current content.
PINGBACKITEM¶
Marker/section
PINGBACKITEM
Type
marker
Description
Each pingback subsequently
ONEPINGBACK¶
Marker/section
ONEPINGBACK
Type
section
Description
The HTML for one single pingback. The plugin renders each pingback subsequently with this section. It adds the content for all the pingbacks in the ALLPINGBACKS section at the PINGBACKITEM marker.
SOURCEURL¶
Marker/section
SOURCEURL
Type
marker
Description
The URL of the source
SOURCETITLE¶
Marker/section
SOURCETITLE
Type
marker
Description
The title of the source
SOURCEEXCERPT¶
Marker/section
SOURCEEXCERPT
Type
marker
Description
A short excerpt from the source
TARGETURL¶
Marker/section
TARGETURL
Type
marker
Description
The original URL of the target. This URL may not be the same URL as the pingbacks is now displayed at if the content the pingback is registered for is displayed on several pages with different URLs.
DATE¶
Marker/section
DATE
Type
marker
Description
The date when the server registered the pingback. The plugin will render the date according to the designated date format.
NOPINGBACKS¶
Marker/section
NOPINGBACKS
Type
Section
Description
The plugin will display this section if no pingback has been registered for this content yet.
Tutorial¶
How to setup pingbacks for tt_news:
On the page with single view:
Add a new content element “plugin”. Choose “Pingbacks” as the plugin type
Enter “tx_ttnews[tt_news]” in the field “Content identifier”
Check “Display pingbacks”
Add the path to your template
Enter a dateformat
In .htaccess:
Add a new rewrite rule for the pingback server:
<IfModule mod_rewrite.c>
RewriteRule ^nsvpingbacks/$ ?eId=nsvpingbacks [L]
</IfModule>
Add a new HTTP header:
<IfModule mod_headers.c>
Header set X-Pingback http://[your-domain]/nsvpingbacks/
</IfModule>
Add a new rewrite rule for head requests:
<IfModule mod_rewrite.c>
RewriteCond %{THE_REQUEST} ^HEAD(.*)$
RewriteRule .* emptyAnswer.html [L]
</IfModule>
Add a new emtpy file in the root directory of your TYPO3 project with the name “emptyAnswer.html”
In the extension manager go to the configuration of nsvpingbacks and enter the new path of your pingback server (“/nsvpingbacks/”) in the field “Pingback Server Path”
To-Do list¶
- spamfilter
- closer intergration into other commenting systems