Dotclear

source: inc/public/default-templates/post.html @ 1674:00146501e490

Revision 1674:00146501e490, 10.4 KB checked in by Florent Cotton <florent.cotton@…>, 11 years ago (diff)

Support des pingbacks : après le support de la détection et de l'envoi de pingbacks, au tour du support en réception.
Dans le détail (ou presque) :

  • Ajout d'un endpoint "pingback.ping" XML-RPC, mais le tout le gros du traitement est dans le fichier class.dc.trackback.php
  • Ajout d'une méthode "receive_pb" dans la classe dcTrackback pour la prise en charge quasi-complète de la réception et enregistrement d'un pingback.
  • Ajout d'une balise template {{tpl:BlogXMLRPCURL}} pour retourner l'URL du serveur XML-RPC du blog courant
  • Ajout d'un bloc au niveau des en-têtes dans les templates par défaut post.html et page.html pour la mise en oeuvre si besoin d'un <link rel="pingback" ../>
  • Ajout de l'envoi d'un en-tête HTTP supplémentaire "X-Pingback" dans les gestionnaires d'URLs pour les types "post" et "pages"

Reste plus qu'à tester en conditions réelles et à polir au besoin.

Line 
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{{tpl:BlogLanguage}}" lang="{{tpl:BlogLanguage}}">
4<head>
5  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6  <meta name="ROBOTS" content="{{tpl:BlogMetaRobots}}" />
7 
8  <title>{{tpl:EntryTitle encode_html="1"}} - {{tpl:BlogName encode_html="1"}}</title>
9  <meta name="description" lang="{{tpl:EntryLang}}" content="{{tpl:EntryContent full="1" encode_html="1" remove_html="1" cut_string="180"}}" />
10  <meta name="copyright" content="{{tpl:BlogCopyrightNotice encode_html="1"}}" />
11  <meta name="author" content="{{tpl:EntryAuthorCommonName encode_html="1"}}" />
12  <meta name="date" scheme="W3CDTF" content="{{tpl:EntryDate iso8601="1"}}" />
13 
14  <link rel="schema.dc" href="http://purl.org/dc/elements/1.1/" />
15  <meta name="dc.title" content="{{tpl:EntryTitle encode_html="1"}}" />
16  <meta name="dc.description" lang="{{tpl:EntryLang}}" content="{{tpl:EntryContent full="1" encode_html="1" remove_html="1" cut_string="180"}}" />
17  <meta name="dc.creator" content="{{tpl:EntryAuthorCommonName encode_html="1"}}" />
18  <meta name="dc.language" content="{{tpl:EntryLang}}" />
19  <meta name="dc.publisher" content="{{tpl:BlogEditor encode_html="1"}}" />
20  <meta name="dc.rights" content="{{tpl:BlogCopyrightNotice encode_html="1"}}" />
21  <meta name="dc.date" scheme="W3CDTF" content="{{tpl:EntryDate iso8601="1"}}" />
22  <meta name="dc.type" content="text" />
23  <meta name="dc.format" content="text/html" />
24 
25  <link rel="top" href="{{tpl:BlogURL}}" title="{{tpl:lang Home}}" />
26  <link rel="contents" href="{{tpl:BlogArchiveURL}}" title="{{tpl:lang Archives}}" />
27  <tpl:EntryIf pings_active="1"><link rel="pingback" href="{{tpl:BlogXMLRPCURL}}" /></tpl:EntryIf>
28 
29  <tpl:EntryNext><link rel="next" href="{{tpl:EntryURL}}"
30  title="{{tpl:EntryTitle encode_html="1"}}" /></tpl:EntryNext>
31 
32  <tpl:EntryPrevious><link rel="prev" href="{{tpl:EntryURL}}"
33  title="{{tpl:EntryTitle encode_html="1"}}" /></tpl:EntryPrevious>
34 
35  <link rel="alternate" type="application/atom+xml" title="Atom 1.0" href="{{tpl:BlogFeedURL type="atom"}}" />
36 
37  {{tpl:include src="_head.html"}}
38 
39  <script type="text/javascript" src="{{tpl:BlogThemeURL}}/../default/js/post.js"></script>
40  <script type="text/javascript">
41  //<![CDATA[
42  var post_remember_str = '{{tpl:lang Remember me on this blog}}';
43  //]]>
44  </script>
45</head>
46
47<body class="dc-post">
48<div id="page">
49{{tpl:EntryPingData}}
50
51{{tpl:include src="_top.html"}}
52
53<div id="wrapper">
54
55<div id="main">
56  <div id="content">
57 
58  <p id="navlinks">
59  <tpl:EntryPrevious><a href="{{tpl:EntryURL}}"
60  title="{{tpl:EntryTitle encode_html="1"}}" class="prev">&#171; {{tpl:EntryTitle encode_html="1"
61  cut_string="50"}}</a></tpl:EntryPrevious>
62  <tpl:EntryNext> <span>-</span> <a href="{{tpl:EntryURL}}"
63  title="{{tpl:EntryTitle encode_html="1"}}" class="next">{{tpl:EntryTitle encode_html="1"
64  cut_string="50"}} &#187;</a></tpl:EntryNext>
65  </p>
66 
67  <div id="p{{tpl:EntryID}}" class="post">
68    <h2 class="post-title">{{tpl:EntryTitle encode_html="1"}}</h2>
69   
70    <p class="post-info">{{tpl:lang By}} {{tpl:EntryAuthorLink}}
71    {{tpl:lang on}} {{tpl:EntryDate}}, {{tpl:EntryTime}}
72    <tpl:EntryIf has_category="1">
73    - <a href="{{tpl:EntryCategoryURL}}">{{tpl:EntryCategory encode_html="1"}}</a>
74    </tpl:EntryIf>
75    - <a href="{{tpl:EntryURL}}">{{tpl:lang Permalink}}</a>
76    </p>
77   
78    <tpl:EntryTags>
79    <tpl:TagsHeader><ul class="post-tags"></tpl:TagsHeader>
80    <li><a href="{{tpl:TagURL}}" rel="tag">{{tpl:TagID}}</a></li>
81    <tpl:TagsFooter></ul></tpl:TagsFooter>
82    </tpl:EntryTags>
83   
84    <!-- # --BEHAVIOR-- publicEntryBeforeContent -->
85    {{tpl:SysBehavior behavior="publicEntryBeforeContent"}}
86   
87    <!-- # Entry with an excerpt -->
88    <tpl:EntryIf extended="1">
89      <div class="post-excerpt">{{tpl:EntryExcerpt}}</div>
90    </tpl:EntryIf>
91   
92    <div class="post-content">{{tpl:EntryContent}}</div>
93   
94    <!-- # --BEHAVIOR-- publicEntryAfterContent -->
95    {{tpl:SysBehavior behavior="publicEntryAfterContent"}}
96  </div>
97 
98  <!-- # Attachments -->
99  <tpl:Attachments>
100    <tpl:AttachmentsHeader>
101      <div id="attachments">
102      <h3>{{tpl:lang Attachments}}</h3>
103      <ul>
104    </tpl:AttachmentsHeader>
105      <li class="{{tpl:AttachmentType}}">
106        <tpl:AttachmentIf is_mp3="1">
107          {{tpl:include src="_mp3_player.html"/}} -
108        </tpl:AttachmentIf>
109        <tpl:AttachmentIf is_flv="1">
110          {{tpl:include src="_flv_player.html"/}}
111        </tpl:AttachmentIf>
112        <tpl:AttachmentIf is_flv="0">
113          <a href="{{tpl:AttachmentURL}}"
114          title="{{tpl:AttachmentFileName}} ({{tpl:AttachmentSize}})">{{tpl:AttachmentTitle}}</a>
115        </tpl:AttachmentIf>
116      </li>
117    <tpl:AttachmentsFooter>
118      </ul>
119      </div>
120    </tpl:AttachmentsFooter>
121  </tpl:Attachments>
122 
123  <!-- # Comments -->
124  <tpl:EntryIf show_comments="1">
125    <tpl:Comments>
126    <tpl:CommentsHeader>
127      <div id="comments">
128        <h3>{{tpl:lang Comments}}</h3>
129      <dl>
130    </tpl:CommentsHeader>
131      <dt id="c{{tpl:CommentID}}" class="{{tpl:CommentIfMe}} {{tpl:CommentIfOdd}} {{tpl:CommentIfFirst}}"><a
132      href="#c{{tpl:CommentID}}" class="comment-number">{{tpl:CommentOrderNumber}}.</a>
133      {{tpl:lang On}} {{tpl:CommentDate}}, {{tpl:CommentTime}}
134      {{tpl:lang by}} {{tpl:CommentAuthorLink}}</dt>
135     
136      <dd class="{{tpl:CommentIfMe}} {{tpl:CommentIfOdd}} {{tpl:CommentIfFirst}}">
137      <!-- # --BEHAVIOR-- publicCommentBeforeContent -->
138      {{tpl:SysBehavior behavior="publicCommentBeforeContent"}}
139     
140      {{tpl:CommentContent}}
141     
142      <!-- # --BEHAVIOR-- publicCommentAfterContent -->
143      {{tpl:SysBehavior behavior="publicCommentAfterContent"}}
144      </dd>
145    <tpl:CommentsFooter>
146      </dl>
147      </div>
148    </tpl:CommentsFooter>
149    </tpl:Comments>
150  </tpl:EntryIf>
151 
152  <tpl:EntryIf comments_active="1">   
153    <tpl:SysIfFormError>
154      <p class="error" id="pr">{{tpl:SysFormError}}</p>
155    </tpl:SysIfFormError>
156   
157    <tpl:SysIfCommentPublished>
158      <p class="message" id="pr">{{tpl:lang Your comment has been published.}}</p>
159    </tpl:SysIfCommentPublished>
160   
161    <tpl:SysIfCommentPending>
162      <p class="message" id="pr">{{tpl:lang Your comment has been submitted and
163      will be reviewed for publication.}}</p>
164    </tpl:SysIfCommentPending>
165   
166    <!-- # Comment form -->
167    <form action="{{tpl:EntryURL}}#pr" method="post" id="comment-form">
168      <tpl:IfCommentPreview>
169        <div id="pr">
170          <h3>{{tpl:lang Your comment}}</h3>
171          <dl>
172            <dd class="comment-preview">{{tpl:CommentPreviewContent}}</dd>
173          </dl>
174          <p class="buttons"><input type="submit" class="submit" value="{{tpl:lang send}}" /></p>
175        </div>
176      </tpl:IfCommentPreview>
177     
178      <h3>{{tpl:lang Add a comment}}</h3>
179      <fieldset>
180        <!-- # --BEHAVIOR-- publicCommentFormBeforeContent -->
181        {{tpl:SysBehavior behavior="publicCommentFormBeforeContent"}}
182       
183        <p class="field"><label for="c_name">{{tpl:lang Name or nickname}}&nbsp;:</label>
184        <input name="c_name" id="c_name" type="text" size="30" maxlength="255"
185        value="{{tpl:CommentPreviewName encode_html="1"}}" />
186        </p>
187       
188        <p class="field"><label for="c_mail">{{tpl:lang Email address}}&nbsp;:</label>
189        <input name="c_mail" id="c_mail" type="text" size="30" maxlength="255"
190        value="{{tpl:CommentPreviewEmail encode_html="1"}}" />
191        </p>
192       
193        <p class="field"><label for="c_site">{{tpl:lang Website}} ({{tpl:lang optional}})&nbsp;:</label>
194        <input name="c_site" id="c_site" type="text" size="30" maxlength="255"
195        value="{{tpl:CommentPreviewSite encode_html="1"}}" />
196        </p>
197       
198        <p style="display:none"><input name="f_mail" type="text" size="30"
199        maxlength="255" value="" /></p>
200       
201        <p class="field"><label for="c_content">{{tpl:lang Comment}}&nbsp;:</label>
202        <textarea name="c_content" id="c_content" cols="35"
203        rows="7">{{tpl:CommentPreviewContent raw="1" encode_html="1"}}</textarea>
204        </p>
205        <p class="form-help">{{tpl:CommentHelp}}</p>
206       
207        <!-- # --BEHAVIOR-- publicCommentFormAfterContent -->
208        {{tpl:SysBehavior behavior="publicCommentFormAfterContent"}}
209      </fieldset>
210     
211      <fieldset>
212        <p class="buttons"><input type="submit" class="preview" name="preview" value="{{tpl:lang preview}}" />
213        <tpl:IfCommentPreview><input type="submit" class="submit" value="{{tpl:lang send}}" /></tpl:IfCommentPreview></p>
214      </fieldset>
215    </form>
216  </tpl:EntryIf>
217 
218  <!-- # Trackbacks -->
219  <tpl:EntryIf show_pings="1">
220    <div id="pings">
221    <h3>{{tpl:lang They posted on the same topic}}</h3>
222    <tpl:Pings>
223      <tpl:PingsHeader>
224      <dl>
225      </tpl:PingsHeader>
226        <dt id="c{{tpl:PingID}}" class="{{tpl:PingIfOdd}} {{tpl:PingIfFirst}}"><a href="#c{{tpl:PingID}}"
227        class="ping-number">{{tpl:PingOrderNumber}}.</a>
228        {{tpl:lang On}} {{tpl:PingDate}}, {{tpl:PingTime}}
229        {{tpl:lang by}} {{tpl:PingBlogName encode_html="1"}}</dt>
230       
231        <dd class="{{tpl:PingIfOdd}} {{tpl:PingIfFirst}}">
232        <!-- # --BEHAVIOR-- publicPingBeforeContent -->
233        {{tpl:SysBehavior behavior="publicPingBeforeContent"}}
234       
235        <p><a href="{{tpl:PingAuthorURL}}"
236        {{tpl:PingNoFollow}}>{{tpl:PingTitle encode_html="1"}}</a></p>
237        {{tpl:PingContent}}
238       
239        <!-- # --BEHAVIOR-- publicPingAfterContent -->
240        {{tpl:SysBehavior behavior="publicPingAfterContent"}}
241        </dd>
242      <tpl:PingsFooter>
243      </dl>
244      </tpl:PingsFooter>
245    </tpl:Pings>
246    </div>
247  </tpl:EntryIf>
248 
249  <tpl:EntryIf pings_active="1">
250    <p id="ping-url">{{tpl:lang Trackback URL}}&nbsp;: {{tpl:EntryPingLink}}</p>
251  </tpl:EntryIf>
252 
253  <tpl:EntryIf operator="or" comments_active="1" pings_active="1">
254  <p id="comments-feed"><a class="feed" href="{{tpl:BlogFeedURL type="atom"}}/comments/{{tpl:EntryID}}"
255  title="{{tpl:lang This post's comments Atom feed}}">{{tpl:lang This post's comments feed}}</a></p>
256  </tpl:EntryIf>
257  </div>
258</div> <!-- End #main -->
259
260<div id="sidebar">
261  <div id="blognav">
262    {{tpl:Widgets type="nav"}}
263  </div> <!-- End #blognav -->
264 
265  <div id="blogextra">
266    {{tpl:Widgets type="extra"}}
267  </div> <!-- End #blogextra -->
268</div>
269
270</div> <!-- End #wrapper -->
271
272{{tpl:include src="_footer.html"}}
273</div> <!-- End #page -->
274</body>
275</html>
Note: See TracBrowser for help on using the repository browser.

Sites map