• R/O
  • HTTP
  • SSH
  • HTTPS

nucleus-plugins: Commit

Nucleus CMS日本語版用プラグインのうち、日本語版開発者がサポートしているもの


Commit MetaInfo

Revision552659abf97109e39ce2814150a41670ed870fb8 (tree)
Time2006-09-30 18:48:40
Authorhsur <hsur@1ca2...>
Commiterhsur

Log Message

v2.0.3 jp6 import

git-svn-id: https://svn.sourceforge.jp/svnroot/nucleus-jp/plugin@387 1ca29b6e-896d-4ea0-84a5-967f57386b96

Change Summary

Incremental Difference

--- /dev/null
+++ b/trunk/NP_TrackBack/NP_TrackBack.php
@@ -0,0 +1,2723 @@
1+<?php
2+// vim: tabstop=2:shiftwidth=2
3+
4+ /* ==========================================================================================
5+ * Trackback 2.0 for Nucleus CMS
6+ * ==========================================================================================
7+ * This program is free software and open source software; you can redistribute
8+ * it and/or modify it under the terms of the GNU General Public License as
9+ * published by the Free Software Foundation; either version 2 of the License,
10+ * or (at your option) any later version.
11+ *
12+ * This program is distributed in the hope that it will be useful, but WITHOUT
13+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15+ * more details.
16+ *
17+ * You should have received a copy of the GNU General Public License along
18+ * with this program; if not, write to the Free Software Foundation, Inc.,
19+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA or visit
20+ * http://www.gnu.org/licenses/gpl.html
21+ * ==========================================================================================
22+ */
23+
24+ // Compatiblity with Nucleus < = 2.0
25+ if (!function_exists('sql_table')) { function sql_table($name) { return 'nucleus_' . $name; } }
26+
27+
28+ class NP_TrackBack extends NucleusPlugin {
29+
30+ var $useCurl = 1; // use curl? 2:precheck+read by curl, 1: read by curl 0: fread
31+
32+//modify start+++++++++
33+ function _createItemLink($itemid, $b){
34+ global $CONF, $manager;
35+ $blogurl = $b->getURL();
36+
37+ if (!$blogurl) {
38+ if($blog) {
39+ $b_tmp =& $manager->getBlog($CONF['DefaultBlog']);
40+ $blogurl = $b_tmp->getURL();
41+ }
42+ if (!$blogurl) {
43+ $blogurl = $CONF['IndexURL'];
44+ if ($CONF['URLMode'] != 'pathinfo'){
45+ $blogurl = $CONF['Self'];
46+ }
47+ }
48+ }
49+ if ($CONF['URLMode'] == 'pathinfo'){
50+ if(substr($blogurl, -1) == '/') $blogurl = substr($blogurl,0,-1);
51+ }
52+ $CONF['ItemURL'] = $blogurl;
53+
54+ return createItemLink($itemid,'');
55+ }
56+//modify end+++++++++
57+
58+ /**************************************************************************************
59+ * SKIN VARS, TEMPLATE VARS AND ACTIONS
60+ */
61+
62+ /*
63+ * TrackBack data can be inserted using skinvars (or templatevars)
64+ */
65+ function doSkinVar($skinType, $what = '', $tb_id = '', $amount = 'limit-1') {
66+
67+ global $itemid;
68+
69+//modify start+++++++++
70+ if(eregi('limit', $tb_id)){
71+ $amount = $tb_id;
72+ $tb_id = '';
73+ }
74+ $amount = eregi_replace("limit", "", $amount);
75+ $amount = intval($amount);
76+//modify end+++++++++
77+
78+ if ($tb_id == '') $tb_id = intval($itemid);
79+
80+//mod by cles
81+ if( $this->getBlogOption(getBlogIDFromItemID($tb_id), "AllowTrackBack") == 'yes' )
82+ $isAcceptPing = ( $this->getItemOption(intval($tb_id), 'ItemAcceptPing') == 'yes' ) ? true : false ;
83+ else
84+ $isAcceptPing = false;
85+
86+ //if( $skinType == 'template' && (! $isAcceptPing ) ){
87+ // return;
88+ //}
89+//mod by cles end
90+ switch ($what) {
91+
92+ // Insert Auto-discovery RDF code
93+ case 'tbcode':
94+ case 'code':
95+//mod by cles
96+// if($skinType == 'item')
97+
98+ $spamcheck = array (
99+ 'type' => 'tbcode',
100+ 'id' => -1,
101+ 'title' => '',
102+ 'excerpt' => '',
103+ 'blogname' => '',
104+ 'url' => '',
105+ 'return' => true,
106+ 'live' => true,
107+
108+ /* Backwards compatibility with SpamCheck API 1*/
109+ 'data' => '',
110+ 'ipblock' => true,
111+ );
112+ global $manager;
113+ $manager->notify('SpamCheck', array ('spamcheck' => & $spamcheck));
114+ $spam = false;
115+ if (isset($spamcheck['result']) && $spamcheck['result'] == true){
116+ $spam = true;
117+ }
118+
119+ if( ($skinType == 'item') && (!$spam) && $isAcceptPing )
120+//mod by cles end
121+ $this->insertCode($tb_id);
122+ break;
123+
124+ // Insert TrackBack URL
125+ case 'tburl':
126+ case 'url':
127+//mod by cles
128+// echo $this->getTrackBackUrl($tb_id);
129+ if($isAcceptPing)
130+ echo $this->getTrackBackUrl($tb_id);
131+ else
132+ echo 'Sorry, no trackback pings are accepted.';
133+//mod by cles end
134+ break;
135+
136+ // Insert manual ping URL
137+ case 'form':
138+ case 'manualpingformlink':
139+ echo $this->getManualPingUrl($tb_id);
140+ break;
141+
142+ // Insert TrackBack count
143+ case 'count':
144+ $count = $this->getTrackBackCount($tb_id);
145+ switch ($count) {
146+ case 0: echo TEMPLATE::fill($this->getOption('tplTbNone'), array('number' => $count)); break;
147+ case 1: echo TEMPLATE::fill($this->getOption('tplTbOne'), array('number' => $count)); break;
148+ default: echo TEMPLATE::fill($this->getOption('tplTbMore'), array('number' => $count)); break;
149+ }
150+ break;
151+
152+ // Shows the TrackBack list
153+ case 'list':
154+ case '':
155+//modify start+++++++++
156+// $this->showList($tb_id);
157+ $this->showList($tb_id, $amount);
158+//modify end+++++++++
159+ break;
160+//mod by cles
161+ // show requred URL
162+ case 'required':
163+ echo $this->getRequiredURL($tb_id);
164+ break;
165+
166+ // shows the Local list
167+ case 'locallist':
168+ $this->showLocalList($tb_id);
169+ break;
170+//mod by cles end
171+
172+ default:
173+ return;
174+ }
175+ }
176+
177+ /*
178+ * When used in templates, the tb_id will be determined by the itemid there
179+ */
180+ function doTemplateVar(&$item, $what = '') {
181+ $this->doSkinVar('template', $what, $item->itemid);
182+ }
183+
184+ /*
185+ * A trackback ping is to be received on the URL
186+ * http://yourdomain.com/item/1234.trackback
187+ * Extra variables to be passed along are url, title, excerpt, blog_name
188+ */
189+ function event_InitSkinParse(&$data) {
190+ global $CONF, $itemid;
191+ $format = requestVar('format');
192+
193+ if ($CONF['URLMode'] == 'pathinfo') {
194+ if (preg_match('/(\/|\.)(trackback)(\/|$)/', serverVar('PATH_INFO'), $matches)) {
195+ $format = $matches[2];
196+ }
197+ }
198+
199+ if ($format == 'trackback' && $data['type'] == 'item')
200+ {
201+ $errorMsg = $this->handlePing(intval($itemid));
202+
203+ if ($errorMsg != '')
204+ $this->xmlResponse($errorMsg);
205+ else
206+ $this->xmlResponse();
207+
208+ exit;
209+ }
210+ }
211+
212+ /*
213+ * A trackback ping is to be received on the URL
214+ * http://yourdomain.com/action.php?action=plugin&name=TrackBack&tb_id=1234
215+ * Extra variables to be passed along are url, title, excerpt, blog_name
216+ */
217+ function doAction($type)
218+ {
219+ global $CONF;
220+ switch ($type) {
221+
222+ // When no action type is given, assume it's a ping
223+ case '':
224+ $errorMsg = $this->handlePing();
225+
226+ if ($errorMsg != '')
227+ $this->xmlResponse($errorMsg);
228+ else
229+ $this->xmlResponse();
230+ break;
231+
232+ // Manual ping
233+ case 'ping':
234+ $errorMsg = $this->handlePing();
235+
236+ if ($errorMsg != '')
237+ $this->showManualPingError(intRequestVar('tb_id'), $errorMsg);
238+ else
239+ $this->showManualPingSuccess(intRequestVar('tb_id'));
240+ break;
241+
242+ // Show manual ping form
243+ case 'form':
244+//mod by cles
245+// $this->showManualPingForm(intRequestVar('tb_id'));
246+ $tb_id = intRequestVar('tb_id');
247+ if( $this->getBlogOption(getBlogIDFromItemID($tb_id), "AllowTrackBack") == 'yes' )
248+ $isAcceptPing = ( $this->getItemOption($tb_id, 'ItemAcceptPing') == 'yes' ) ? true : false ;
249+ else
250+ $isAcceptPing = false;
251+ if( $isAcceptPing )
252+ $this->showManualPingForm($tb_id);
253+ else
254+ echo 'Sorry, no trackback pings are accepted.';
255+//mod by cles end
256+ break;
257+
258+ // Detect trackback
259+ case 'detect':
260+ list($url, $title) =
261+ $this->getURIfromLink(html_entity_decode(requestVar('tb_link')));
262+
263+ $url = addslashes($url);
264+ $url = $this->_utf8_to_javascript($url);
265+
266+ $title = addslashes($title);
267+ $title = $this->_utf8_to_javascript($title);
268+
269+ echo "tbDone('" . requestVar('tb_link') . "', '" . $url . "', '" . $title . "');";
270+
271+ break;
272+//mod by cles
273+ // redirect
274+ case 'redirect':
275+ return $this->redirect(intRequestVar('tb_id'), requestVar('urlHash'));
276+ break;
277+//mod by cles end
278+ case 'left':
279+ echo $this->showLeftList(intRequestVar('tb_id'), intRequestVar('amount'));
280+ break;
281+
282+ // delete a trackback(local)
283+ case 'deletelc':
284+ $err = $this->deleteLocal(intRequestVar('tb_id'), intRequestVar('from_id'));
285+ if( $err )
286+ return $err;
287+ header('Location: ' . serverVar('HTTP_REFERER'));
288+ break;
289+ }
290+
291+ exit;
292+ }
293+
294+
295+
296+ /**************************************************************************************
297+ * OUTPUT
298+ */
299+
300+ /*
301+ * Show a list of left trackbacks for this ID
302+ */
303+ function showLeftList($tb_id, $offset = 0, $amount = 99999999) {
304+ global $manager, $blog, $CONF;
305+
306+ $out = array();
307+ $query = '
308+ SELECT
309+ url,
310+ md5(url) as urlHash,
311+ blog_name,
312+ excerpt,
313+ title,
314+ UNIX_TIMESTAMP(timestamp) AS timestamp
315+ FROM
316+ '.sql_table('plugin_tb').'
317+ WHERE
318+ tb_id = '.intval($tb_id).' AND
319+ block = 0
320+ ORDER BY
321+ timestamp DESC
322+ ';
323+ if($offset)
324+ $query .= ' LIMIT '.intval($offset).', ' .intval($amount);
325+ $res = mysql_query($query);
326+ while ($row = mysql_fetch_array($res))
327+ {
328+
329+ $row['blog_name'] = htmlspecialchars($row['blog_name'], ENT_QUOTES);
330+ $row['title'] = htmlspecialchars($row['title'], ENT_QUOTES);
331+ $row['excerpt'] = htmlspecialchars($row['excerpt'], ENT_QUOTES);
332+ if (_CHARSET != 'UTF-8') {
333+//modify start+++++++++
334+ $row['blog_name'] = $this->_restore_to_utf8($row['blog_name']);
335+ $row['title'] = $this->_restore_to_utf8($row['title']);
336+ $row['excerpt'] = $this->_restore_to_utf8($row['excerpt']);
337+//modify end+++++++++
338+ $row['blog_name'] = $this->_utf8_to_entities($row['blog_name']);
339+ $row['title'] = $this->_utf8_to_entities($row['title']);
340+ $row['excerpt'] = $this->_utf8_to_entities($row['excerpt']);
341+ }
342+ $iVars = array(
343+ 'action' => $this->getTrackBackUrl($tb_id),
344+ 'form' => $this->getManualPingUrl($tb_id),
345+ 'name' => $row['blog_name'],
346+ 'title' => $row['title'],
347+ 'excerpt' => $this->_cut_string($row['excerpt'], 400),
348+ 'url' => htmlspecialchars($row['url'], ENT_QUOTES),
349+ 'date' => htmlspecialchars(strftime($this->getOption('dateFormat'), $row['timestamp']), ENT_QUOTES)
350+ );
351+
352+//mod by cles
353+ if( $this->getOption('HideUrl') == 'yes' )
354+ $iVars['url'] = $CONF['ActionURL'] . '?action=plugin&amp;name=TrackBack&amp;type=redirect&amp;tb_id=' . $tb_id . '&amp;urlHash=' . $row['urlHash'];
355+ else
356+ $iVars['url'] = $row['url'];
357+//mod by cles end
358+
359+ $out[] = TEMPLATE::fill($this->getOption('tplItem'), $iVars);
360+ }
361+ mysql_free_result($res);
362+
363+ return @join("\n",$out);
364+ }
365+
366+ /*
367+ * Show a list of all trackbacks for this ID
368+ */
369+ function showList($tb_id, $amount = 0) {
370+ $tb_id = intval($tb_id);
371+ global $manager, $blog, $CONF, $member;
372+//mod by cles
373+ $enableHideurl = true;
374+ // for TB LinkLookup
375+ if(
376+ strstr(serverVar('HTTP_USER_AGENT'),'Hatena Diary Track Forward Agent')
377+ || strstr(serverVar('HTTP_USER_AGENT'),'NP_TrackBack')
378+ || strstr(serverVar('HTTP_USER_AGENT'),'TBPingLinkLookup')
379+ || strstr(serverVar('HTTP_USER_AGENT'),'MT::Plugin::BanNoReferTb')
380+ || strstr(serverVar('HTTP_USER_AGENT'),'livedoorBlog')
381+ ){
382+ $enableHideurl = false;
383+ $amount = '-1';
384+ }
385+//mod by cles end
386+
387+/*
388+ $res = mysql_query('
389+ SELECT
390+ url,
391+ md5(url) as urlHash,
392+ blog_name,
393+ excerpt,
394+ title,
395+ UNIX_TIMESTAMP(timestamp) AS timestamp
396+ FROM
397+ '.sql_table('plugin_tb').'
398+ WHERE
399+ tb_id = '.$tb_id .' AND
400+ block = 0
401+ ORDER BY
402+ timestamp ASC
403+ ');
404+*/
405+ $query = '
406+ SELECT
407+ url,
408+ md5(url) as urlHash,
409+ blog_name,
410+ excerpt,
411+ title,
412+ UNIX_TIMESTAMP(timestamp) AS timestamp
413+ FROM
414+ '.sql_table('plugin_tb').'
415+ WHERE
416+ tb_id = '.intval($tb_id) .' AND
417+ block = 0
418+ ORDER BY
419+ timestamp DESC
420+ ';
421+ if( $amount == '-1' )
422+ $query .= ' LIMIT 9999999';
423+ elseif( $amount )
424+ $query .= ' LIMIT '.intval($amount);
425+
426+ if( $amount != 0)
427+ $res = mysql_query($query);
428+
429+ $gVars = array(
430+ 'action' => $this->getTrackBackUrl(intval($tb_id)),
431+ 'form' => $this->getManualPingUrl(intval($tb_id)),
432+ 'required' => $this->getRequiredURL(intval($tb_id)),
433+ );
434+
435+ if ($member->isLoggedIn() && $member->isAdmin()){
436+ $gVars['admin'] = '<a href="' . $CONF['PluginURL'] . 'trackback/index.php?action=list&amp;id=' . intval($tb_id) . '" target="_blank">[admin]</a>';
437+ $gVars['pingform'] = '<a href="' . $CONF['PluginURL'] . 'trackback/index.php?action=ping&amp;id=' . intval($tb_id) . '" target="_blank">[pingform]</a>';
438+ }
439+
440+ echo TEMPLATE::fill($this->getOption('tplHeader'), $gVars);
441+
442+
443+ while ($amount != 0 && $row = mysql_fetch_array($res))
444+ {
445+
446+ $row['blog_name'] = htmlspecialchars($row['blog_name'], ENT_QUOTES);
447+ $row['title'] = htmlspecialchars($row['title'], ENT_QUOTES);
448+ $row['excerpt'] = htmlspecialchars($row['excerpt'], ENT_QUOTES);
449+
450+/*
451+*/
452+ if (_CHARSET != 'UTF-8') {
453+//modify start+++++++++
454+/*
455+ $row['blog_name'] = $this->_utf8_to_entities($row['blog_name']);
456+ $row['title'] = $this->_utf8_to_entities($row['title']);
457+ $row['excerpt'] = $this->_utf8_to_entities($row['excerpt']);
458+*/
459+ $row['blog_name'] = $this->_restore_to_utf8($row['blog_name']);
460+ $row['title'] = $this->_restore_to_utf8($row['title']);
461+ $row['excerpt'] = $this->_restore_to_utf8($row['excerpt']);
462+
463+ $row['blog_name'] = mb_convert_encoding($row['blog_name'], _CHARSET, 'UTF-8');
464+ $row['title'] = mb_convert_encoding($row['title'], _CHARSET, 'UTF-8');
465+ $row['excerpt'] = mb_convert_encoding($row['excerpt'], _CHARSET, 'UTF-8');
466+//modify end+++++++++
467+ }
468+
469+//modify start+++++++++
470+/*
471+ $iVars = array(
472+ 'action' => $this->getTrackBackUrl($tb_id),
473+ 'form' => $this->getManualPingUrl($tb_id),
474+ 'name' => $row['blog_name'],
475+ 'title' => $row['title'],
476+ 'excerpt' => $row['excerpt'],
477+ 'url' => htmlspecialchars($row['url'], ENT_QUOTES),
478+ 'date' => htmlspecialchars(strftime($this->getOption('dateFormat'), $row['timestamp'] + ($blog->getTimeOffset() * 3600)), ENT_QUOTES)
479+ );
480+*/
481+ $iVars = array(
482+ 'action' => $this->getTrackBackUrl($tb_id),
483+ 'form' => $this->getManualPingUrl($tb_id),
484+ 'name' => htmlspecialchars($row['blog_name'], ENT_QUOTES),
485+ 'title' => htmlspecialchars($row['title'], ENT_QUOTES),
486+ 'excerpt' => htmlspecialchars($this->_cut_string($row['excerpt'], 400), ENT_QUOTES),
487+ 'url' => htmlspecialchars($row['url'], ENT_QUOTES),
488+ 'date' => htmlspecialchars(strftime($this->getOption('dateFormat'), $row['timestamp']), ENT_QUOTES)
489+ );
490+
491+//mod by cles
492+ if( $enableHideurl && $this->getOption('HideUrl') == 'yes' )
493+ $iVars['url'] = $CONF['ActionURL'] . '?action=plugin&amp;name=TrackBack&amp;type=redirect&amp;tb_id=' . intval($tb_id) . '&amp;urlHash=' . $row['urlHash'];
494+ else
495+ $iVars['url'] = $row['url'];
496+//mod by cles end
497+
498+//modify end+++++++++
499+ echo TEMPLATE::fill($this->getOption('tplItem'), $iVars);
500+
501+ }
502+
503+//modify start+++++++++
504+ $q = '
505+ SELECT
506+ count(*)
507+ FROM
508+ '.sql_table('plugin_tb').'
509+ WHERE
510+ tb_id = '.intval($tb_id) .' AND
511+ block = 0
512+ ORDER BY
513+ timestamp DESC
514+ ';
515+ $result = mysql_query($q);
516+ $total = mysql_result($result,0,0);
517+
518+ if($amount != -1 && $total > $amount){
519+ $leftcount = $total - $amount;
520+
521+ echo '<script type="text/javascript" src="' . $this->getAdminURL() . 'detectlist.php?tb_id='.intval($tb_id).'&amp;amount='.intval($amount).'"></script>';
522+
523+?>
524+
525+<a name="restoftrackback" id="restoftrackback"></a>
526+<div id="tbshownavi"><a href="#restoftrackback" onclick="resttbStart(); return false;" id="tbshow">Show left <?php echo $leftcount;?> Trackbacks</a></div>
527+<div id="tbhidenavi" style="display: none;"><a href="#restoftrackback" onclick="hideresttb(); return false;">Hide <?php echo $leftcount;?> Trackbacks</a></div>
528+<div id="resttb"></div>
529+
530+<?php
531+ }
532+//modify end+++++++++
533+
534+ if (mysql_num_rows($res) == 0)
535+ {
536+ echo TEMPLATE::fill($this->getOption('tplEmpty'), $gVars);
537+ }
538+ mysql_free_result($res);
539+
540+ echo TEMPLATE::fill($this->getOption('tplFooter'), $gVars);
541+
542+ }
543+
544+ /*
545+ * Returns the TrackBack count for a TrackBack item
546+ */
547+ function getTrackBackCount($tb_id) {
548+ return quickQuery('SELECT COUNT(*) as result FROM ' . sql_table('plugin_tb') . ' WHERE tb_id='.intval($tb_id).' AND block = 0');
549+ }
550+
551+ /**
552+ * Returns the manual ping URL
553+ */
554+ function getManualPingUrl($itemid) {
555+ global $CONF;
556+ return $CONF['ActionURL'] . '?action=plugin&amp;name=TrackBack&amp;type=form&amp;tb_id='.$itemid;
557+ }
558+
559+ /**
560+ * Show the manual ping form
561+ */
562+ function showManualPingError($itemid, $status = '') {
563+ global $CONF;
564+
565+ $form = true; $error = true; $success = false;
566+ sendContentType('text/html', 'admin-trackback', _CHARSET);
567+//modify start+++++++++
568+// include ($this->getDirectory() . '/templates/form.html');
569+ require_once($this->getDirectory() . '/template.php');
570+ $mTemplate = new Trackback_Template(null, $this->getDirectory());
571+ $mTemplate->set ('CONF', $CONF);
572+ $mTemplate->set ('itemid', $itemid);
573+ $mTemplate->set ('form', $form);
574+ $mTemplate->set ('error', $error);
575+ $mTemplate->set ('success', $success);
576+ $mTemplate->set ('status', $status);
577+ $mTemplate->template('templates/form.html');
578+ echo $mTemplate->fetch();
579+//modify end+++++++++
580+ }
581+
582+ function showManualPingSuccess($itemid, $status = '') {
583+ global $CONF;
584+
585+ $form = false; $error = false; $success = true;
586+ sendContentType('text/html', 'admin-trackback', _CHARSET);
587+//modify start+++++++++
588+ //include ($this->getDirectory() . '/templates/form.html');
589+ require_once($this->getDirectory() . '/template.php');
590+ $mTemplate = new Trackback_Template(null, $this->getDirectory());
591+ $mTemplate->set ('CONF', $CONF);
592+ $mTemplate->set ('itemid', $itemid);
593+ $mTemplate->set ('form', $form);
594+ $mTemplate->set ('error', $error);
595+ $mTemplate->set ('success', $success);
596+ $mTemplate->set ('status', $status);
597+ $mTemplate->template('templates/form.html');
598+ echo $mTemplate->fetch();
599+//modify end+++++++++
600+ }
601+
602+ function showManualPingForm($itemid, $text = '') {
603+ global $CONF;
604+
605+ $form = true; $error = false; $success = false;
606+
607+ // Check if we are allowed to accept pings
608+ if ($this->getOption('AcceptPing') == 'no') {
609+ $text = 'Sorry, no trackback pings are accepted';
610+ $form = false; $error = true;
611+ }
612+
613+ sendContentType('text/html', 'admin-trackback', _CHARSET);
614+//modify start+++++++++
615+ //include ($this->getDirectory() . '/templates/form.html');
616+ require_once($this->getDirectory() . '/template.php');
617+ $mTemplate = new Trackback_Template(null, $this->getDirectory());
618+ $mTemplate->set ('CONF', $CONF);
619+ $mTemplate->set ('itemid', $itemid);
620+ $mTemplate->set ('form', $form);
621+ $mTemplate->set ('error', $error);
622+ $mTemplate->set ('success', $success);
623+ $mTemplate->set ('status', $status);
624+ $mTemplate->template('templates/form.html');
625+ echo $mTemplate->fetch();
626+//modify end+++++++++
627+ }
628+
629+ /**
630+ * Returns the trackback URL
631+ */
632+ function getTrackBackUrl($itemid) {
633+ global $CONF, $manager;
634+ return $CONF['ActionURL'] . '?action=plugin&amp;name=TrackBack&amp;tb_id='.$itemid;
635+ }
636+
637+ /*
638+ * Insert RDF code for item
639+ */
640+ function insertCode($itemid) {
641+ $itemid = intval($itemid);
642+ global $manager, $CONF;
643+
644+ $item = & $manager->getItem($itemid, 0, 0);
645+ $blog = & $manager->getBlog(getBlogIDFromItemID($item['itemid']));
646+
647+/*
648+ $CONF['ItemURL'] = preg_replace('/\/$/', '', $blog->getURL());
649+ $uri = createItemLink($item['itemid'],'');
650+*/
651+ $uri = $this->_createItemLink($item['itemid'],$blog);
652+
653+ $title = strip_tags($item['title']);
654+ $desc = strip_tags($item['body']);
655+ $desc = $this->_cut_string($desc, 200);
656+ $desc = htmlspecialchars($desc, ENT_QUOTES);
657+
658+ ?>
659+ <!--
660+ <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
661+ xmlns:dc="http://purl.org/dc/elements/1.1/"
662+ xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
663+ <rdf:Description
664+ rdf:about="<?php echo $uri; ?>"
665+ dc:identifier="<?php echo $uri; ?>"
666+ dc:title="<?php echo $title; ?>"
667+ dc:description="<?php echo $desc; ?>"
668+ trackback:ping="<?php echo $this->getTrackBackUrl($itemid)?>"
669+ dc:date="<?php echo strftime('%Y-%m-%dT%H:%M:%S')?>" />
670+ </rdf:RDF>
671+ -->
672+ <?php
673+ }
674+
675+ /**
676+ * Retrieving TrackBack Pings (when __mode=rss)
677+ */
678+ function rssResponse($tb_id) {
679+ $itemid = intval($itemid);
680+ global $manager, $CONF;
681+ $item =& $manager->getItem($tb_id, 0, 0);
682+
683+ if($item)
684+ {
685+ $blog =& $manager->getBlog(getBlogIDFromItemID($item['itemid']));
686+
687+ $blog_name = $blog->getName();
688+ $title = $item['title'];
689+ $excerpt = $item['body'];
690+
691+//modify start+++++++++
692+/*
693+ if (_CHARSET != 'UTF-8')
694+ {
695+ $title = $this->_convert_to_utf8($title, $encoding);
696+ $excerpt = $this->_convert_to_utf8($excerpt, $encoding);
697+ $blog_name = $this->_convert_to_utf8($blog_name, $encoding);
698+ }
699+
700+ $title = $this->_decode_entities(strip_tags($title));
701+ $excerpt = $this->_decode_entities(strip_tags($excerpt));
702+ $blog_name = $this->_decode_entities(strip_tags($blog_name));
703+*/
704+
705+ $title = $this->_restore_to_utf8($title);
706+ $excerpt = $this->_restore_to_utf8($excerpt);
707+ $blog_name = $this->_restore_to_utf8($blog_name);
708+//modify end+++++++++
709+
710+ $excerpt = $this->_cut_string($excerpt, 200);
711+
712+
713+//modify start+++++++++
714+/*
715+ $CONF['ItemURL'] = preg_replace('/\/$/', '', $blog->getURL());
716+ $url = createItemLink($item['itemid'],'');
717+*/
718+ $url = $this->_createItemLink($item['itemid'],$blog);
719+//modify end+++++++++
720+
721+ // Use UTF-8 charset for output
722+ header('Content-Type: text/xml');
723+ echo "<","?xml version='1.0' encoding='UTF-8'?",">\n";
724+
725+ echo "<response>\n";
726+ echo "\t<error>0</error>\n";
727+ echo "\t<rss version='0.91'>\n";
728+ echo "\t\t<channel>\n";
729+ echo "\t\t\t<title>".htmlspecialchars($title, ENT_QUOTES)."</title>\n";
730+ echo "\t\t\t<link>".htmlspecialchars($url, ENT_QUOTES)."</link>\n";
731+ echo "\t\t\t<description>".htmlspecialchars($excerpt, ENT_QUOTES)."</description>\n";
732+
733+ $query = 'SELECT url, blog_name, excerpt, title, UNIX_TIMESTAMP(timestamp) as timestamp FROM '.sql_table('plugin_tb').' WHERE tb_id='.intval($tb_id).' AND block = 0 ORDER BY timestamp DESC';
734+ $res = mysql_query($query);
735+ while ($o = mysql_fetch_object($res))
736+ {
737+ // No need to do conversion, because it is already UTF-8
738+ $data = array (
739+ 'url' => htmlspecialchars($o->url, ENT_QUOTES),
740+ 'blogname' => htmlspecialchars($this->_restore_to_utf8($o->blog_name), ENT_QUOTES),
741+ 'timestamp' => strftime('%Y-%m-%d',$o->timestamp),
742+ 'title' => htmlspecialchars($this->_restore_to_utf8($o->title), ENT_QUOTES),
743+ 'excerpt' => htmlspecialchars($this->_restore_to_utf8($o->excerpt), ENT_QUOTES),
744+ 'tburl' => $this->getTrackBackUrl($tb_id)
745+ );
746+
747+ echo "\n";
748+ echo "\t\t\t<item>\n";
749+ echo "\t\t\t\t<title>".$data['title']."</title>\n";
750+ echo "\t\t\t\t<link>".$data['url']."</link>\n";
751+ echo "\t\t\t\t<description>".$data['excerpt']."</description>\n";
752+ echo "\t\t\t</item>\n";
753+ }
754+ echo "\t\t</channel>\n";
755+ echo "\t</rss>\n";
756+ echo "</response>";
757+ exit;
758+ }
759+ else
760+ {
761+ $this->xmlResponse(_ERROR_NOSUCHITEM);
762+ }
763+
764+ }
765+
766+
767+
768+ /**************************************************************************************
769+ * SENDING AND RECEIVING TRACKBACK PINGS
770+ */
771+
772+ /*
773+ * Send a Trackback ping to another website
774+ */
775+ function sendPing($itemid, $title, $url, $excerpt, $blog_name, $ping_url, $utf8flag=0)
776+ {
777+ $tempEncording = ($utf8flag)? 'UTF-8': _CHARSET;
778+
779+ // 1. Check some basic things
780+ if (!$this->canSendPing()) {
781+ return 'You\'re not allowed to send pings';
782+ }
783+
784+ if ($this->getOption('SendPings') == 'no') {
785+ return 'Sending trackback pings is disabled';
786+ }
787+
788+ if ($ping_url == '') {
789+ return 'No ping URL';
790+ }
791+
792+ // 2. Check if protocol is correct http URL
793+ $parsed_url = parse_url($ping_url);
794+
795+ if ($parsed_url['scheme'] != 'http' || $parsed_url['host'] == '')
796+ return 'Bad ping URL';
797+
798+ $port = ($parsed_url['port']) ? $parsed_url['port'] : 80;
799+
800+ // 3. Create contents
801+ if($tempEncording != _CHARSET){
802+ $title = mb_convert_encoding($title, $tempEncording, _CHARSET);
803+ $excerpt = mb_convert_encoding($excerpt, $tempEncording, _CHARSET);
804+ $blog_name = mb_convert_encoding($blog_name, $tempEncording, _CHARSET);
805+ }
806+
807+
808+ $content = 'title=' . urlencode( $title );
809+ $content .= '&url=' . urlencode( $url );
810+ $content .= '&excerpt=' . urlencode( $excerpt );
811+ $content .= '&blog_name=' . urlencode( $blog_name );
812+
813+# $user_agent = 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)';
814+ $user_agent = 'NP_TrackBack/'. $this->getVersion();
815+
816+ // 4. Prepare HTTP request
817+ $request = 'POST ' . $parsed_url['path'];
818+
819+ if ($parsed_url['query'] != '')
820+ $request .= '?' . $parsed_url['query'];
821+
822+ $request .= " HTTP/1.1\r\n";
823+ $request .= "Accept: */*\r\n";
824+ $request .= "User-Agent: " . $user_agent . "\r\n";
825+ $request .= ( $port == 80 )?
826+ "Host: " . $parsed_url['host'] . "\r\n":
827+ "Host: " . $parsed_url['host'] . ":" . $port . "\r\n";
828+ $request .= "Connection: Keep-Alive\r\n";
829+ $request .= "Cache-Control: no-cache\r\n";
830+ $request .= "Connection: Close\r\n";
831+ $request .= "Content-Length: " . strlen( $content ) . "\r\n";
832+ $request .= ($utf8flag)?
833+ "Content-Type: application/x-www-form-urlencoded; charset=UTF-8\r\n":
834+ "Content-Type: application/x-www-form-urlencoded; charset="._CHARSET."\r\n";
835+ $request .= "\r\n";
836+ $request .= $content;
837+
838+ $socket = fsockopen( $parsed_url['host'], $port, $errno, $errstr );
839+ if ( ! $socket )
840+ return 'Could not send ping: '.$errstr.' ('.$errno.')';
841+
842+ // 5. Execute HTTP request
843+ fputs($socket, $request);
844+
845+ // 6. Receive response
846+ $result = '';
847+ while (!feof($socket)) {
848+ $result .= fgets($socket, 4096);
849+ }
850+
851+ fclose($socket);
852+
853+ // instead of parsing the XML, just check for the error string
854+ // [TODO] extract real error message and return that
855+//modify start+++++++++
856+
857+ $DATA = split("\r\n\r\n", $result, 2);
858+ preg_match("/HTTP\/1\.[0-1] ([0-9]+) ([^\r\n]*)\r?\n/",$DATA[0],$httpresp);
859+ $respCd = $httpresp[1];
860+ $respMsg = $httpresp[2];
861+
862+ if( $respCd != 200 ){
863+ return 'An error occurred: HTTP Error: [' . $respCd . '] ' . $respMsg;
864+ }
865+ if ( strstr($DATA[1],'<error>0</error>') === false ){
866+ preg_match("/<message>(.*?)<\/message>/",$DATA[1],$error_message);
867+ if( $error_message[1] )
868+ return 'An error occurred: '.htmlspecialchars($error_message[1], ENT_QUOTES);
869+ else
870+ return 'An error occurred: fatal error.';
871+ }
872+ }
873+//modify end+++++++++
874+
875+ /*
876+ * Handle a Trackback ping sent to this website
877+ */
878+ function handlePing($tb_id = 0) {
879+ global $manager;
880+
881+ // Check if we are allowed to accept pings
882+ if ($this->getOption('AcceptPing') == 'no') {
883+ return 'Sorry, no trackback pings are accepted';
884+ }
885+
886+ // Defaults
887+ $spam = false;
888+ $link = false;
889+//modify start+++++++++
890+// $block = true;
891+ $block = false;
892+//modify end+++++++++
893+ if ($tb_id == 0)
894+ $tb_id = intRequestVar('tb_id');
895+
896+ $rss = requestVar('__mode') == 'rss';
897+//mod by cles
898+ $enableLinkCheck = $this->isEnableLinkCheck($tb_id);
899+ $block = ( $enableLinkCheck ) ? true : false ;
900+//mod by cles end
901+
902+ if (!$tb_id) {
903+ return 'TrackBack ID is missing (tb_id)';
904+ }
905+
906+ if ((!$manager->existsItem($tb_id,0,0)) && ($this->getOption('CheckIDs') == 'yes')) {
907+ return _ERROR_NOSUCHITEM;
908+ }
909+
910+ // 0. Check if we need to output the list as rss
911+ if ($rss) {
912+ $this->rssResponse($tb_id);
913+ return;
914+ }
915+//mod by cles
916+ // check: accept pings.
917+ if( $this->getBlogOption(getBlogIDFromItemID($tb_id), "AllowTrackBack") == 'yes' )
918+ $isAcceptPing = ( $this->getItemOption($tb_id, 'ItemAcceptPing') == 'yes' ) ? true : false ;
919+ else
920+ $isAcceptPing = false;
921+
922+ if (! $isAcceptPing)
923+ return 'Sorry, no trackback pings are accepted.';
924+//mod by cles end
925+
926+ // 1. Get attributes
927+//modify start+++++++++
928+ $b =& $manager->getBlog(getBlogIDFromItemID($tb_id));
929+//modify end+++++++++
930+ $url = requestVar('url');
931+ $title = requestVar('title');
932+ $excerpt = requestVar('excerpt');
933+ $blog_name = requestVar('blog_name');
934+
935+ if (!$url) {
936+ return 'URL is missing (url)';
937+ }
938+
939+ // 2. Conversion of encoding...
940+//modify start+++++++++
941+/* if (preg_match ("/;\s*charset=([^\n]+)/is", $_SERVER["CONTENT_TYPE"], $regs))
942+ $encoding = strtoupper(trim($regs[1]));
943+ else
944+ $encoding = $this->_detect_encoding($excerpt);
945+*/
946+ $encoding = $this->_detect_encoding($excerpt);
947+//modify end+++++++++
948+
949+//modify start+++++++++
950+ if (_CHARSET != 'UTF-8'){
951+ $title = $this->_strip_controlchar(strip_tags(mb_convert_encoding($title, _CHARSET, $encoding)));
952+ $excerpt = $this->_strip_controlchar(strip_tags(mb_convert_encoding($excerpt, _CHARSET, $encoding)));
953+ $blog_name = $this->_strip_controlchar(strip_tags(mb_convert_encoding($blog_name, _CHARSET, $encoding)));
954+ }else{
955+ $title = $this->_strip_controlchar($this->_convert_to_utf8($title, $encoding));
956+ $excerpt = $this->_strip_controlchar($this->_convert_to_utf8($excerpt, $encoding));
957+ $blog_name = $this->_strip_controlchar($this->_convert_to_utf8($blog_name, $encoding));
958+
959+ $title = $this->_decode_entities(strip_tags($title));
960+ $excerpt = $this->_decode_entities(strip_tags($excerpt));
961+ $blog_name = $this->_decode_entities(strip_tags($blog_name));
962+ }
963+//modify end+++++++++
964+
965+ // 4. Save data in the DB
966+ $res = @mysql_query('
967+ SELECT
968+ tb_id, block, spam
969+ FROM
970+ '.sql_table('plugin_tb').'
971+ WHERE
972+ url = \''.mysql_real_escape_string($url).'\' AND
973+ tb_id = \''.intval($tb_id).'\'
974+ ');
975+
976+ if (mysql_num_rows($res) != 0)
977+ {
978+ // Existing TB, update it
979+/*
980+ $res = @mysql_query('
981+ UPDATE
982+ '.sql_table('plugin_tb').'
983+ SET
984+ title = "'.mysql_real_escape_string($title).'",
985+ excerpt = "'.mysql_real_escape_string($excerpt).'",
986+ blog_name = "'.mysql_real_escape_string($blog_name).'",
987+ timestamp = '.mysqldate(time()).'
988+ WHERE
989+ url = "'.mysql_real_escape_string($url).'" AND
990+ tb_id = "'.$tb_id.'"
991+ ');
992+*/
993+//modify start+++++++++
994+ $rows = mysql_fetch_assoc($res);
995+ $spam = ( $rows['block'] || $rows['spam'] ) ? true : false;
996+ $res = @mysql_query('
997+ UPDATE
998+ '.sql_table('plugin_tb').'
999+ SET
1000+ title = \''.mysql_real_escape_string($title).'\',
1001+ excerpt = \''.mysql_real_escape_string($excerpt).'\',
1002+ blog_name = \''.mysql_real_escape_string($blog_name).'\',
1003+ timestamp = '.mysqldate($b->getCorrectTime()).'
1004+ WHERE
1005+ url = \''.mysql_real_escape_string($url).'\' AND
1006+ tb_id = \''.mysql_real_escape_string(intval($tb_id)).'\'
1007+ ');
1008+//modify end+++++++++
1009+
1010+ if (!$res) {
1011+ return 'Could not update trackback data: '.mysql_error();
1012+ }
1013+ }
1014+ else
1015+ {
1016+ // 4. SPAM check (for SpamCheck API 2 /w compat. API 1)
1017+ $spamcheck = array (
1018+ 'type' => 'trackback',
1019+ 'id' => $tb_id,
1020+ 'title' => $title,
1021+ 'excerpt' => $excerpt,
1022+ 'blogname' => $blog_name,
1023+ 'url' => $url,
1024+ 'return' => true,
1025+ 'live' => true,
1026+
1027+ /* Backwards compatibility with SpamCheck API 1*/
1028+ 'data' => $url . ' ' . $title . ' ' . $excerpt . ' ' . $blog_name,
1029+ 'ipblock' => true,
1030+ );
1031+
1032+ $manager->notify('SpamCheck', array ('spamcheck' => & $spamcheck));
1033+
1034+ if (isset($spamcheck['result']) && $spamcheck['result'] == true)
1035+ {
1036+ $spam = true;
1037+ }
1038+
1039+ // 5. Content check (TO DO)
1040+ if($spam == false || $enableLinkCheck == 'ignore' ) //modify
1041+ {
1042+//mod by cles
1043+// $contents = $this->retrieveUrl ($url);
1044+//
1045+// if (preg_match("/(".preg_quote($_SERVER["REQUEST_URI"], '/').")|(".preg_quote($_SERVER["SERVER_NAME"], '/').")/i", $contents)) {
1046+// $link = true;
1047+// }
1048+ if( $enableLinkCheck ){
1049+ $contents = $this->retrieveUrl($url);
1050+
1051+ $linkArray = $this->getPermaLinksFromText($contents);
1052+ $itemLink = $this->_createItemLink($tb_id, $b);
1053+ $itemLinkPat = '{^' . preg_quote($itemLink) .'}i';
1054+ foreach($linkArray as $l) {
1055+ if(preg_match($itemLinkPat, $l)){
1056+ ACTIONLOG :: add(INFO, "Trackback: LinkCheck OK. (link: $l pat: $itemLinkPat )");
1057+ $link = true;
1058+ break;
1059+ }
1060+ }
1061+ if( ! $link ){
1062+ $cnt = @count($linkArray);
1063+ if( $enableLinkCheck == 'ignore' ){
1064+ ACTIONLOG :: add(INFO, "Trackback: LinkCheck NG. [ignore] (itemid:$tb_id from: $url cnt: $cnt pat: $itemLinkPat)");
1065+ return 'Sorry, trackback ping is not accepted.';
1066+ } else {
1067+ ACTIONLOG :: add(INFO, "Trackback: LinkCheck NG. [block] (itemid:$tb_id from: $url cnt: $cnt pat: $itemLinkPat");
1068+ }
1069+ }
1070+ }
1071+//mod by cles end
1072+ }
1073+
1074+ // 6. Determine if Trackback is safe...
1075+//modify start+++++++++
1076+// $block = $spam == true || $link == false;
1077+// $block = $spam == true ;
1078+//modify end+++++++++
1079+//mod by cles
1080+ if ( $enableLinkCheck )
1081+ $block = ($spam == true || $link == false);
1082+ else
1083+ $block = $spam == true ;
1084+//mod by cles end
1085+ // New TB, insert it
1086+/*
1087+ $query = '
1088+ INSERT INTO
1089+ '.sql_table('plugin_tb').'
1090+ SET
1091+ tb_id = "'.$tb_id.'",
1092+ block = "'.($block ? '1' : '0').'",
1093+ spam = "'.($spam ? '1' : '0').'",
1094+ link = "'.($link ? '1' : '0').'",
1095+ url = "'.mysql_real_escape_string($url).'",
1096+ title = "'.mysql_real_escape_string($title).'",
1097+ excerpt = "'.mysql_real_escape_string($excerpt).'",
1098+ blog_name = "'.mysql_real_escape_string($blog_name).'",
1099+ timestamp = '.mysqldate(time()).'
1100+ ';
1101+*/
1102+//modify start+++++++++
1103+ $query = '
1104+ INSERT INTO
1105+ '.sql_table('plugin_tb').'
1106+ SET
1107+ tb_id = \''.mysql_real_escape_string(intval($tb_id)).'\',
1108+ block = \''.($block ? '1' : '0').'\',
1109+ spam = \''.($spam ? '1' : '0').'\',
1110+ link = \''.($link ? '1' : '0').'\',
1111+ url = \''.mysql_real_escape_string($url).'\',
1112+ title = \''.mysql_real_escape_string($title).'\',
1113+ excerpt = \''.mysql_real_escape_string($excerpt).'\',
1114+ blog_name = \''.mysql_real_escape_string($blog_name).'\',
1115+ timestamp = '.mysqldate($b->getCorrectTime()).'
1116+ ';
1117+//modify end+++++++++
1118+
1119+ $res = @mysql_query($query);
1120+
1121+ if (!$res) {
1122+ return 'Could not save trackback data, possibly because of a double entry: ' . mysql_error() . $query;
1123+ }
1124+ }
1125+
1126+ // 7. Send notification e-mail if needed
1127+ if ($this->getOption('Notify') == 'yes' && $spam == false)
1128+ {
1129+ $destAddress = $this->getOption('NotifyEmail');
1130+
1131+
1132+ $vars = array (
1133+ 'tb_id' => $tb_id,
1134+ 'url' => $url,
1135+ 'title' => $title,
1136+ 'excerpt' => $excerpt,
1137+ 'blogname' => $blog_name
1138+ );
1139+
1140+//modify start+++++++++
1141+/*
1142+ $vars = array (
1143+ 'tb_id' => $tb_id,
1144+ 'url' => $url,
1145+ 'title' => mb_convert_encoding($title, 'ISO-2022-JP', _CHARSET),
1146+ 'excerpt' => mb_convert_encoding($excerpt, 'ISO-2022-JP', _CHARSET),
1147+ 'blogname' => mb_convert_encoding($blog_name, 'ISO-2022-JP', _CHARSET)
1148+ );
1149+*/
1150+//maybe not needed because japanese version has "mb_send_mail" in function notify
1151+//modify end+++++++++
1152+
1153+ $mailto_title = TEMPLATE::fill($this->notificationMailTitle, $vars);
1154+ $mailto_msg = TEMPLATE::fill($this->notificationMail, $vars);
1155+
1156+ global $CONF, $DIR_LIBS;
1157+
1158+ // make sure notification class is loaded
1159+ if (!class_exists('notification'))
1160+ include($DIR_LIBS . 'NOTIFICATION.php');
1161+
1162+ $notify = new NOTIFICATION($destAddress);
1163+ $notify->notify($mailto_title, $mailto_msg , $CONF['AdminEmail']);
1164+//mod by cles+++++++++++
1165+ if ($manager->pluginInstalled('NP_Cache')){
1166+ $p =& $manager->getPlugin('NP_Cache');
1167+ $p->setCurrentBlog($tb_id);
1168+ $p->cleanItem($tb_id);
1169+ $p->cleanArray(array('index'));
1170+ }
1171+//mod by cles end +++++++++++
1172+ }
1173+ return '';
1174+ }
1175+
1176+ function xmlResponse($errorMessage = '')
1177+ {
1178+ header('Content-Type: text/xml');
1179+
1180+ echo "<","?xml version='1.0' encoding='UTF-8'?",">\n";
1181+ echo "<response>\n";
1182+
1183+ if ($errorMessage)
1184+ echo "\t<error>1</error>\n\t<message>",htmlspecialchars($errorMessage, ENT_QUOTES),"</message>\n";
1185+ else
1186+ echo "\t<error>0</error>\n";
1187+
1188+ echo "</response>";
1189+ exit;
1190+ }
1191+
1192+ /*
1193+ * Check if member may send ping (check if logged in)
1194+ */
1195+ function canSendPing() {
1196+ global $member;
1197+ return $member->isLoggedIn() || $this->xmlrpc;
1198+ }
1199+
1200+
1201+//mod by cles
1202+ function redirect($tb_id, $urlHash){
1203+ global $CONF;
1204+ $query = 'SELECT url FROM '.sql_table('plugin_tb').' WHERE tb_id='.intval($tb_id).' and md5(url)="'.$urlHash.'"';
1205+ $res = mysql_query($query);
1206+
1207+ $url = $CONF['SiteURL'];
1208+
1209+ if ($o = mysql_fetch_object($res)) {
1210+ $url = htmlspecialchars($o->url, ENT_QUOTES);
1211+ }
1212+
1213+ $url = stripslashes($url);
1214+ $url = str_replace('&amp;','&',$url);
1215+ $url = str_replace('&lt;','<',$url);
1216+ $url = str_replace('&gt;','>',$url);
1217+ $url = str_replace('&quot;','"',$url);
1218+
1219+ header('Location: '.$url);
1220+ }
1221+
1222+ function getRequiredURL($itemid){
1223+ global $manager;
1224+ $blog = & $manager->getBlog(getBlogIDFromItemID($item['itemid']));
1225+ if( $this->isEnableLinkCheck($itemid) )
1226+ return $this->_createItemLink($itemid, $blog);
1227+ return null;
1228+ }
1229+
1230+ function isEnableLinkCheck($itemid){
1231+ $blogid = getBlogIDFromItemID($itemid);
1232+
1233+// if( ! $this->getBlogOption($blogid, 'enableLinkCheck') == 'yes' )
1234+// return false;
1235+
1236+ $val = $this->getItemOption($itemid, 'isAcceptW/OLink');
1237+ switch( $val ){
1238+ case 'default':
1239+ if($this->getBlogOption($blogid, 'isAcceptW/OLinkDef') == 'yes')
1240+ return false;
1241+ break;
1242+ case 'yes':
1243+ return false;
1244+ break;
1245+ case 'no':
1246+ break;
1247+ default :
1248+ ACTIONLOG :: add(INFO, "Trackback: Unknown Option (itemid:$itemid, value:$val)");
1249+ return false;
1250+ }
1251+ return $this->getBlogOption($blogid, 'isAcceptW/OLinkDef');
1252+ }
1253+//mod by cles end
1254+
1255+ /**************************************************************************************
1256+ * EVENTS
1257+ */
1258+
1259+ function event_SendTrackback($data) {
1260+ global $manager;
1261+
1262+ // Enable sending trackbacks for the XML-RPC API, otherwise we would
1263+ // get an error because the current user is not exactly logged in.
1264+ $this->xmlrpc = true;
1265+
1266+ $itemid = $data['tb_id'];
1267+ $item = &$manager->getItem($itemid, 0, 0);
1268+ if (!$item) return; // don't ping for draft & future
1269+ if ($item['draft']) return; // don't ping on draft items
1270+
1271+ // gather some more information, needed to send the ping (blog name, etc)
1272+ $blog =& $manager->getBlog(getBlogIDFromItemID($itemid));
1273+ $blog_name = $blog->getName();
1274+
1275+ $title = $data['title'] != '' ? $data['title'] : $item['title'];
1276+ $title = strip_tags($title);
1277+
1278+ $excerpt = $data['body'] != '' ? $data['body'] : $item['body'];
1279+ $excerpt = strip_tags($excerpt);
1280+ $excerpt = $this->_cut_string($excerpt, 200);
1281+
1282+ $CONF['ItemURL'] = preg_replace('/\/$/', '', $blog->getURL());
1283+ //$url = createItemLink($itemid);
1284+ $url = $this->_createItemLink($itemid, $blog);
1285+
1286+ while (list(,$url) = each($data['urls'])) {
1287+ $res = $this->sendPing($itemid, $title, $url, $excerpt, $blog_name, $url);
1288+ if ($res) ACTIONLOG::add(WARNING, 'TrackBack Error:' . $res . ' (' . $url . ')');
1289+ }
1290+ }
1291+
1292+ function event_RetrieveTrackback($data) {
1293+
1294+ $res = mysql_query('
1295+ SELECT
1296+ url,
1297+ title,
1298+ UNIX_TIMESTAMP(timestamp) AS timestamp
1299+ FROM
1300+ '.sql_table('plugin_tb').'
1301+ WHERE
1302+ tb_id = '.intval($data['tb_id']).' AND
1303+ block = 0
1304+ ORDER BY
1305+ timestamp ASC
1306+ ');
1307+
1308+ while ($row = mysql_fetch_array($res)) {
1309+
1310+ $trackback = array(
1311+ 'title' => $row['title'],
1312+ 'url' => $row['url'],
1313+ 'ip' => ''
1314+ );
1315+
1316+ $data['trackbacks'][] = $trackback;
1317+ }
1318+ }
1319+/*
1320+ function event_BookmarkletExtraHead($data) {
1321+ global $NP_TB_URL;
1322+ list ($NP_TB_URL,) = $this->getURIfromLink(requestVar('loglink'));
1323+ }
1324+*/
1325+ function event_PrepareItemForEdit($data) {
1326+// if (!$this->getOption('AutoXMLHttp'))
1327+ if ($this->getOption('AutoXMLHttp') == 'no')
1328+ {
1329+ // The space between body and more is to make sure we didn't join 2 words accidently....
1330+ $this->larray = $this->autoDiscovery($data['item']['body'].' '.$data['item']['more']);
1331+ }
1332+ }
1333+
1334+ /*
1335+ * After an item has been added to the database, send out a ping if requested
1336+ * (trackback_ping_url variable in request)
1337+ */
1338+ function event_PostAddItem($data) {
1339+ $this->pingTrackback($data);
1340+ }
1341+
1342+ function event_PreUpdateItem($data) {
1343+ $this->pingTrackback($data);
1344+ }
1345+
1346+ /**
1347+ * Add trackback options to add item form/bookmarklet
1348+ */
1349+ function event_AddItemFormExtras($data) {
1350+
1351+// global $NP_TB_URL;
1352+
1353+ ?>
1354+ <h3>TrackBack</h3>
1355+ <p>
1356+<!--modify start+++++++++-->
1357+<!-- <label for="plug_tb_url">TrackBack Ping URL:</label>
1358+ <input type="text" value="<?php if (isSet($NP_TB_URL)) {echo $NP_TB_URL;} ?>" id="plug_tb_url" name="trackback_ping_url" size="60" />
1359+-->
1360+<!--modify end+++++++++-->
1361+ <label for="plug_tb_url">TrackBack URL:</label><br />
1362+ <textarea id="plug_tb_url" name="trackback_ping_url" cols="60" rows="5" style="font:normal xx-small Tahoma, Arial, verdana ;"></textarea>
1363+<input type="button" name="btnAdd" value="<?php echo _TB_LIST_IT?>" onClick="AddStart()" />
1364+
1365+ <br />
1366+
1367+ <?php
1368+// if ($this->getOption('AutoXMLHttp'))
1369+ if ($this->getOption('AutoXMLHttp') == 'yes')
1370+ {
1371+ ?>
1372+ <div id="tb_auto">
1373+<input type="button" name="discoverit" value="Auto Discover" onclick="tbSetup();" />
1374+ <img id='tb_busy' src='<?php echo $this->getAdminURL(); ?>busy.gif' style="display:none;" /><br />
1375+ <div id="tb_auto_title"></div>
1376+ <table border="1"><tbody id="tb_ping_list"></tbody></table>
1377+ <input type="hidden" id="tb_url_amount" name="tb_url_amount" value="0" />
1378+ </div>
1379+
1380+ <?php
1381+ $this->jsautodiscovery();
1382+ }
1383+ ?>
1384+ </p>
1385+ <?php
1386+ }
1387+
1388+ /**
1389+ * Add trackback options to edit item form/bookmarklet
1390+ */
1391+ function event_EditItemFormExtras($data) {
1392+ global $CONF;
1393+ ?>
1394+<!-- <input type="text" value="" id="plug_tb_url" name="trackback_ping_url" size="60" /><br />-->
1395+ <h3>TrackBack</h3>
1396+ <p>
1397+ <label for="plug_tb_url">TrackBack URL:</label><br />
1398+ <textarea id="plug_tb_url" name="trackback_ping_url" cols="60" rows="5" style="font:normal xx-small Tahoma, Arial, verdana ;"></textarea>
1399+<input type="button" name="btnAdd" value="<?php echo _TB_LIST_IT?>" onClick="AddStart()" />
1400+
1401+ <?php
1402+// if ($this->getOption('AutoXMLHttp'))
1403+ if ($this->getOption('AutoXMLHttp') == 'yes')
1404+ {
1405+ ?>
1406+
1407+
1408+ <div id="tb_auto">
1409+<input type="button" name="discoverit" value="Auto Discover" onclick="tbSetup();" />
1410+ <img id='tb_busy' src='<?php echo $this->getAdminURL(); ?>busy.gif' style="display:none;" /><br />
1411+ <div id="tb_auto_title"></div>
1412+ <table border="1"><tbody id="tb_ping_list"></tbody></table>
1413+ <input type="hidden" id="tb_url_amount" name="tb_url_amount" value="0" />
1414+ </div>
1415+
1416+ <?php
1417+ $this->jsautodiscovery();
1418+ }
1419+ else
1420+ {
1421+ if (count($this->larray) > 0)
1422+ {
1423+ ?>
1424+ Auto Discovered Ping URL's:<br />
1425+ <?php
1426+ echo '<input type="hidden" name="tb_url_amount" value="'.count($this->larray).'" />';
1427+
1428+ $i = 0;
1429+
1430+ while (list($url, $title) = each ($this->larray))
1431+ {
1432+//modify start+++++++++
1433+ if (_CHARSET != 'UTF-8') {
1434+ $title = $this->_utf8_to_entities($title);
1435+ $title = mb_convert_encoding($title, _CHARSET, 'UTF-8');
1436+ }
1437+//modify end+++++++++
1438+
1439+ echo '<input type="checkbox" name="tb_url_'.$i.
1440+ '" value="'.$url.'" id="tb_url_'.$i.
1441+ '" /><label for="tb_url_'.$i.'" title="'.$url.'">'.$title.'</label><br />';
1442+
1443+ $i++;
1444+ }
1445+ }
1446+ }
1447+ ?>
1448+ </p>
1449+ <?php
1450+ }
1451+
1452+ /**
1453+ * Insert Javascript AutoDiscovery routines
1454+ */
1455+ function jsautodiscovery()
1456+ {
1457+ global $CONF;
1458+
1459+ ?>
1460+ <script type='text/javascript' src='<?php echo $this->getAdminURL(); ?>autodetect.php'></script>
1461+ <?php
1462+ }
1463+
1464+ /**
1465+ * Ping all URLs
1466+ */
1467+ function pingTrackback($data) {
1468+ global $manager, $CONF;
1469+
1470+ $ping_urls_count = 0;
1471+ $ping_urls = array();
1472+ $utf8flag = array();
1473+ $localflag = array();
1474+
1475+ $ping_url = requestVar('trackback_ping_url');
1476+//modify start+++++++++
1477+/*
1478+ if ($ping_url) {
1479+ $ping_urls[0] = $ping_url;
1480+ $ping_urls_count++;
1481+ }
1482+*/
1483+ if (trim($ping_url)) {
1484+ $ping_urlsTemp = array();
1485+ $ping_urlsTemp = preg_split("/[\s,]+/", trim($ping_url));
1486+ for($i=0;$i<count($ping_urlsTemp);$i++){
1487+ $ping_urls[] = trim($ping_urlsTemp[$i]);
1488+ $ping_urls_count++;
1489+ }
1490+ }
1491+//modify end+++++++++
1492+
1493+ $tb_url_amount = requestVar('tb_url_amount');
1494+ for ($i=0;$i<$tb_url_amount;$i++) {
1495+ $tb_temp_url = requestVar('tb_url_'.$i);
1496+ if ($tb_temp_url) {
1497+ $ping_urls[$ping_urls_count] = $tb_temp_url;
1498+ $utf8flag[$ping_urls_count] = (requestVar('tb_url_'.$i.'_utf8') == 'on')? 1: 0;
1499+ $localflag[$ping_urls_count] = (requestVar('tb_url_'.$i.'_local') == 'on')? 1: 0;
1500+ $ping_urls_count++;
1501+ }
1502+ }
1503+
1504+ if ($ping_urls_count <= 0) {
1505+ return;
1506+ }
1507+
1508+ $itemid = $data['itemid'];
1509+ $item = &$manager->getItem($itemid, 0, 0);
1510+ if (!$item) return; // don't ping for draft & future
1511+ if ($item['draft']) return; // don't ping on draft items
1512+
1513+ // gather some more information, needed to send the ping (blog name, etc)
1514+ $blog =& $manager->getBlog(getBlogIDFromItemID($itemid));
1515+ $blog_name = $blog->getName();
1516+
1517+ $title = $data['title'] != '' ? $data['title'] : $item['title'];
1518+ $title = strip_tags($title);
1519+
1520+ $excerpt = $data['body'] != '' ? $data['body'] : $item['body'];
1521+ $excerpt = strip_tags($excerpt);
1522+ $excerpt = $this->_cut_string($excerpt, 200);
1523+
1524+/*
1525+ $CONF['ItemURL'] = preg_replace('/\/$/', '', $blog->getURL());
1526+ $url = createItemLink($itemid);
1527+*/
1528+ $url = $this->_createItemLink($item['itemid'],$blog);
1529+
1530+ // send the ping(s) (add errors to actionlog)
1531+ for ($i=0; $i<count($ping_urls); $i++) {
1532+ if( ! $localflag[$i] )
1533+ $res = $this->sendPing($itemid, $title, $url, $excerpt, $blog_name, $ping_urls[$i], $utf8flag[$i]);
1534+ else
1535+ $res = $this->handleLocalPing($itemid, $title, $excerpt, $blog_name, $ping_urls[$i]);
1536+ if ($res) ACTIONLOG::add(WARNING, 'TrackBack Error:' . $res . ' (' . $ping_urls[$i] . ')');
1537+ }
1538+ }
1539+
1540+
1541+
1542+
1543+ /**************************************************************************************
1544+ * AUTO-DISCOVERY
1545+ */
1546+
1547+ /*
1548+ * Auto-Discovery of TrackBack Ping URLs based on HTML story
1549+ */
1550+ function autoDiscovery($text)
1551+ {
1552+ $links = $this->getPermaLinksFromText($text);
1553+ $result = array();
1554+
1555+ for ($i = 0; $i < count($links); $i++)
1556+ {
1557+ list ($url, $title) = $this->getURIfromLink($links[$i]);
1558+
1559+ if ($url != '')
1560+ $result[$url] = $title;
1561+ }
1562+
1563+ return $result;
1564+ }
1565+
1566+ /*
1567+ * Auto-Discovery of TrackBack Ping URLs based on single link
1568+ */
1569+ function getURIfromLink($link)
1570+ {
1571+
1572+ // Check to see if the cache contains this link
1573+ $res = mysql_query('SELECT url, title FROM '.sql_table('plugin_tb_lookup').' WHERE link=\''.mysql_real_escape_string($link).'\'');
1574+
1575+ if ($row = mysql_fetch_array($res))
1576+ {
1577+ if ($row['title'] != '')
1578+ {
1579+//modify start+++++++++
1580+ if (_CHARSET != 'UTF-8'){
1581+ $row['title'] = mb_convert_encoding($row['title'], 'UTF-8', _CHARSET);
1582+ $row['title'] = $this->_decode_entities($row['title']);
1583+ }
1584+//modify end+++++++++
1585+ return array (
1586+ $row['url'], $row['title']
1587+ );
1588+ }
1589+ else
1590+ {
1591+ return array (
1592+ $row['url'], $row['url']
1593+ );
1594+ }
1595+ }
1596+
1597+ // Retrieve RDF
1598+ if (($rdf = $this->getRDFFromLink($link)) !== false)
1599+ {
1600+ // Get PING attribute
1601+ if (($uri = $this->getAttributeFromRDF($rdf, 'trackback:ping')) !== false)
1602+ {
1603+ // Get TITLE attribute
1604+ if (($title = $this->getAttributeFromRDF($rdf, 'dc:title')) !== false)
1605+ {
1606+ // Get CREATOR attribute
1607+ if (($author = $this->getAttributeFromRDF($rdf, 'dc:creator')) !== false)
1608+ {
1609+ $title = $author. ": " . $title;
1610+ }
1611+
1612+ $uri = $this->_decode_entities($uri);
1613+//modify start+++++++++
1614+ if (_CHARSET != 'UTF-8')
1615+ $convertedTitle = mb_convert_encoding($title, _CHARSET, 'UTF-8');
1616+ else
1617+ $convertedTitle = $title;
1618+/*
1619+ // Store in cache
1620+ $res = mysql_query("INSERT INTO ".sql_table('plugin_tb_lookup')." (link, url, title) VALUES ('".mysql_real_escape_string($link)."','".mysql_real_escape_string($uri)."','".mysql_real_escape_string($title)."')");
1621+*/
1622+ // Store in cache
1623+ $res = mysql_query("INSERT INTO ".sql_table('plugin_tb_lookup')." (link, url, title) VALUES ('".mysql_real_escape_string($link)."','".mysql_real_escape_string($uri)."','".mysql_real_escape_string($convertedTitle)."')");
1624+//modify end+++++++++
1625+ $title = $this->_decode_entities($title);
1626+
1627+ return array (
1628+ $uri, $title
1629+ );
1630+ }
1631+ else
1632+ {
1633+ $uri = html_entity_decode($uri, ENT_COMPAT);
1634+
1635+ // Store in cache
1636+ $res = mysql_query("INSERT INTO ".sql_table('plugin_tb_lookup')." (link, url, title) VALUES ('".mysql_real_escape_string($link)."','".mysql_real_escape_string($uri)."','')");
1637+
1638+ return array (
1639+ $uri, $uri
1640+ );
1641+ }
1642+ }
1643+ }
1644+
1645+ // Store in cache
1646+ $res = mysql_query("INSERT INTO ".sql_table('plugin_tb_lookup')." (link, url, title) VALUES ('".mysql_real_escape_string($link)."','','')");
1647+
1648+ return array ('', '');
1649+ }
1650+
1651+ /*
1652+ * Detect links used in HTML code
1653+ */
1654+ function getPermaLinksFromText($text)
1655+ {
1656+ $links = array();
1657+
1658+ if (preg_match_all('/<a ([^>]+)>/', $text, $array, PREG_SET_ORDER))
1659+ {
1660+ for ($i = 0; $i < count($array); $i++)
1661+ {
1662+ preg_match('/href="http:\/\/(.+?)"/', $array[$i][1], $matches);
1663+ $links['http://'.$matches[1]] = 1;
1664+ }
1665+ }
1666+
1667+ return array_keys($links);
1668+ }
1669+
1670+ /*
1671+ * Retrieve RDF code from external link
1672+ */
1673+ function getRDFFromLink($link)
1674+ {
1675+ if ($content = $this->getContents($link))
1676+ {
1677+ preg_match_all('/(<rdf:RDF.*?<\/rdf:RDF>)/sm', $content, $rdfs, PREG_SET_ORDER);
1678+
1679+ if (count($rdfs) > 1)
1680+ {
1681+ for ($i = 0; $i < count($rdfs); $i++)
1682+ {
1683+ if (preg_match('|dc:identifier="'.preg_quote($link).'"|ms',$rdfs[$i][1]))
1684+ {
1685+ return $rdfs[$i][1];
1686+ }
1687+ }
1688+ }
1689+ else
1690+ {
1691+ // No need to check the identifier
1692+ return $rdfs[0][1];
1693+ }
1694+ }
1695+
1696+ return false;
1697+ }
1698+
1699+ /**
1700+ * Retrieve the contents of an external (X)HTML document
1701+ */
1702+ function getContents($link) {
1703+
1704+ // Use cURL extention if available
1705+ if (function_exists("curl_init") && $this->useCurl == 2)
1706+ {
1707+ // Make HEAD request
1708+ $ch = curl_init();
1709+ @curl_setopt($ch, CURLOPT_URL, $link);
1710+ @curl_setopt($ch, CURLOPT_HEADER, true);
1711+ @curl_setopt($ch, CURLOPT_NOBODY, true);
1712+ @curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
1713+ @curl_setopt($ch, CURLOPT_MAXREDIRS, 5);
1714+ @curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
1715+ @curl_setopt($ch, CURLOPT_TIMEOUT, 20);
1716+ @curl_setopt($ch, CURLOPT_USERAGENT, 'NP_TrackBack/'. $this->getVersion());
1717+
1718+ $headers = curl_exec($ch);
1719+ curl_close($ch);
1720+
1721+ // Check if the link points to a (X)HTML document
1722+ if (preg_match('/Content-Type: (text\/html|application\/xhtml+xml)/i', $headers))
1723+ {
1724+ return $this->retrieveUrl ($link);
1725+ }
1726+
1727+ return false;
1728+ }
1729+ else
1730+ {
1731+ return $this->retrieveUrl ($link);
1732+ }
1733+ }
1734+
1735+ /*
1736+ * Get a single attribute from RDF
1737+ */
1738+ function getAttributeFromRDF($rdf, $attribute)
1739+ {
1740+ if (preg_match('/'.$attribute.'="([^"]+)"/', $rdf, $matches))
1741+ {
1742+ return $matches[1];
1743+ }
1744+
1745+ return false;
1746+ }
1747+
1748+
1749+
1750+
1751+
1752+
1753+ /**************************************************************************************/
1754+ /* Internal helper functions for dealing with external file retrieval */
1755+
1756+ function retrieveUrl ($url) {
1757+//mod by cles
1758+ $ua = ini_set('user_agent', 'NP_TrackBack/'. $this->getVersion());
1759+//mod by cles end
1760+ if (function_exists('curl_init') && $this->useCurl > 0)
1761+ {
1762+ // Set options
1763+ $ch = curl_init();
1764+ @curl_setopt($ch, CURLOPT_URL, $url);
1765+ @curl_setopt($ch, CURLOPT_HEADER, 1);
1766+ @curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
1767+ @curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1);
1768+ @curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
1769+ @curl_setopt($ch, CURLOPT_MAXREDIRS, 5);
1770+ @curl_setopt($ch, CURLOPT_TIMEOUT, 20);
1771+ @curl_setopt($ch, CURLOPT_USERAGENT, 'NP_TrackBack/'. $this->getVersion());
1772+
1773+ // Retrieve response
1774+ $raw = curl_exec($ch);
1775+ $info = curl_getinfo($ch);
1776+
1777+ // Split into headers and contents
1778+ $headers = substr($raw, 0, $info['header_size']);
1779+ $contents = substr($raw, $info['header_size']);
1780+
1781+ curl_close($ch);
1782+ }
1783+ elseif ($fp = @fopen ($url, "r"))
1784+ {
1785+//mod by cles
1786+// $contents = fread($fp, 8192);
1787+ $contents = '';
1788+ while (!feof($fp)) {
1789+ $contents .= fread($fp, 8192);
1790+ }
1791+//mod by cles end
1792+ $headers = '';
1793+
1794+ fclose($fp);
1795+ }
1796+//mod by cles
1797+ ini_set('user_agent', $ua);
1798+//mod by cles end
1799+
1800+ // Next normalize the encoding to UTF8...
1801+ $contents = $this->_convert_to_utf8_auto($contents, $headers);
1802+
1803+ return $contents;
1804+ }
1805+
1806+
1807+ /**************************************************************************************/
1808+ /* Internal helper functions for dealing with encodings and entities */
1809+
1810+ var $entities_cp1251 = array (
1811+ '&#128;' => '&#8364;',
1812+ '&#130;' => '&#8218;',
1813+ '&#131;' => '&#402;',
1814+ '&#132;' => '&#8222;',
1815+ '&#133;' => '&#8230;',
1816+ '&#134;' => '&#8224;',
1817+ '&#135;' => '&#8225;',
1818+ '&#136;' => '&#710;',
1819+ '&#137;' => '&#8240;',
1820+ '&#138;' => '&#352;',
1821+ '&#139;' => '&#8249;',
1822+ '&#140;' => '&#338;',
1823+ '&#142;' => '&#381;',
1824+ '&#145;' => '&#8216;',
1825+ '&#146;' => '&#8217;',
1826+ '&#147;' => '&#8220;',
1827+ '&#148;' => '&#8221;',
1828+ '&#149;' => '&#8226;',
1829+ '&#150;' => '&#8211;',
1830+ '&#151;' => '&#8212;',
1831+ '&#152;' => '&#732;',
1832+ '&#153;' => '&#8482;',
1833+ '&#154;' => '&#353;',
1834+ '&#155;' => '&#8250;',
1835+ '&#156;' => '&#339;',
1836+ '&#158;' => '&#382;',
1837+ '&#159;' => '&#376;',
1838+ );
1839+
1840+ var $entities_default = array (
1841+ '&quot;' => '&#34;',
1842+ '&amp;' => '&#38;',
1843+ '&apos;' => '&#39;',
1844+ '&lt;' => '&#60;',
1845+ '&gt;' => '&#62;',
1846+ );
1847+
1848+ var $entities_latin = array (
1849+ '&nbsp;' => '&#160;',
1850+ '&iexcl;' => '&#161;',
1851+ '&cent;' => '&#162;',
1852+ '&pound;' => '&#163;',
1853+ '&curren;' => '&#164;',
1854+ '&yen;' => '&#165;',
1855+ '&brvbar;' => '&#166;',
1856+ '&sect;' => '&#167;',
1857+ '&uml;' => '&#168;',
1858+ '&copy;' => '&#169;',
1859+ '&ordf;' => '&#170;',
1860+ '&laquo;' => '&#171;',
1861+ '&not;' => '&#172;',
1862+ '&shy;' => '&#173;',
1863+ '&reg;' => '&#174;',
1864+ '&macr;' => '&#175;',
1865+ '&deg;' => '&#176;',
1866+ '&plusmn;' => '&#177;',
1867+ '&sup2;' => '&#178;',
1868+ '&sup3;' => '&#179;',
1869+ '&acute;' => '&#180;',
1870+ '&micro;' => '&#181;',
1871+ '&para;' => '&#182;',
1872+ '&middot;' => '&#183;',
1873+ '&cedil;' => '&#184;',
1874+ '&sup1;' => '&#185;',
1875+ '&ordm;' => '&#186;',
1876+ '&raquo;' => '&#187;',
1877+ '&frac14;' => '&#188;',
1878+ '&frac12;' => '&#189;',
1879+ '&frac34;' => '&#190;',
1880+ '&iquest;' => '&#191;',
1881+ '&Agrave;' => '&#192;',
1882+ '&Aacute;' => '&#193;',
1883+ '&Acirc;' => '&#194;',
1884+ '&Atilde;' => '&#195;',
1885+ '&Auml;' => '&#196;',
1886+ '&Aring;' => '&#197;',
1887+ '&AElig;' => '&#198;',
1888+ '&Ccedil;' => '&#199;',
1889+ '&Egrave;' => '&#200;',
1890+ '&Eacute;' => '&#201;',
1891+ '&Ecirc;' => '&#202;',
1892+ '&Euml;' => '&#203;',
1893+ '&Igrave;' => '&#204;',
1894+ '&Iacute;' => '&#205;',
1895+ '&Icirc;' => '&#206;',
1896+ '&Iuml;' => '&#207;',
1897+ '&ETH;' => '&#208;',
1898+ '&Ntilde;' => '&#209;',
1899+ '&Ograve;' => '&#210;',
1900+ '&Oacute;' => '&#211;',
1901+ '&Ocirc;' => '&#212;',
1902+ '&Otilde;' => '&#213;',
1903+ '&Ouml;' => '&#214;',
1904+ '&times;' => '&#215;',
1905+ '&Oslash;' => '&#216;',
1906+ '&Ugrave;' => '&#217;',
1907+ '&Uacute;' => '&#218;',
1908+ '&Ucirc;' => '&#219;',
1909+ '&Uuml;' => '&#220;',
1910+ '&Yacute;' => '&#221;',
1911+ '&THORN;' => '&#222;',
1912+ '&szlig;' => '&#223;',
1913+ '&agrave;' => '&#224;',
1914+ '&aacute;' => '&#225;',
1915+ '&acirc;' => '&#226;',
1916+ '&atilde;' => '&#227;',
1917+ '&auml;' => '&#228;',
1918+ '&aring;' => '&#229;',
1919+ '&aelig;' => '&#230;',
1920+ '&ccedil;' => '&#231;',
1921+ '&egrave;' => '&#232;',
1922+ '&eacute;' => '&#233;',
1923+ '&ecirc;' => '&#234;',
1924+ '&euml;' => '&#235;',
1925+ '&igrave;' => '&#236;',
1926+ '&iacute;' => '&#237;',
1927+ '&icirc;' => '&#238;',
1928+ '&iuml;' => '&#239;',
1929+ '&eth;' => '&#240;',
1930+ '&ntilde;' => '&#241;',
1931+ '&ograve;' => '&#242;',
1932+ '&oacute;' => '&#243;',
1933+ '&ocirc;' => '&#244;',
1934+ '&otilde;' => '&#245;',
1935+ '&ouml;' => '&#246;',
1936+ '&divide;' => '&#247;',
1937+ '&oslash;' => '&#248;',
1938+ '&ugrave;' => '&#249;',
1939+ '&uacute;' => '&#250;',
1940+ '&ucirc;' => '&#251;',
1941+ '&uuml;' => '&#252;',
1942+ '&yacute;' => '&#253;',
1943+ '&thorn;' => '&#254;',
1944+ '&yuml;' => '&#255;',
1945+ );
1946+
1947+ var $entities_extended = array (
1948+ '&OElig;' => '&#338;',
1949+ '&oelig;' => '&#229;',
1950+ '&Scaron;' => '&#352;',
1951+ '&scaron;' => '&#353;',
1952+ '&Yuml;' => '&#376;',
1953+ '&circ;' => '&#710;',
1954+ '&tilde;' => '&#732;',
1955+ '&esnp;' => '&#8194;',
1956+ '&emsp;' => '&#8195;',
1957+ '&thinsp;' => '&#8201;',
1958+ '&zwnj;' => '&#8204;',
1959+ '&zwj;' => '&#8205;',
1960+ '&lrm;' => '&#8206;',
1961+ '&rlm;' => '&#8207;',
1962+ '&ndash;' => '&#8211;',
1963+ '&mdash;' => '&#8212;',
1964+ '&lsquo;' => '&#8216;',
1965+ '&rsquo;' => '&#8217;',
1966+ '&sbquo;' => '&#8218;',
1967+ '&ldquo;' => '&#8220;',
1968+ '&rdquo;' => '&#8221;',
1969+ '&bdquo;' => '&#8222;',
1970+ '&dagger;' => '&#8224;',
1971+ '&Dagger;' => '&#8225;',
1972+ '&permil;' => '&#8240;',
1973+ '&lsaquo;' => '&#8249;',
1974+ '&rsaquo;' => '&#8250;',
1975+ '&euro;' => '&#8364;',
1976+ '&fnof;' => '&#402;',
1977+ '&Alpha;' => '&#913;',
1978+ '&Beta;' => '&#914;',
1979+ '&Gamma;' => '&#915;',
1980+ '&Delta;' => '&#916;',
1981+ '&Epsilon;' => '&#917;',
1982+ '&Zeta;' => '&#918;',
1983+ '&Eta;' => '&#919;',
1984+ '&Theta;' => '&#920;',
1985+ '&Iota;' => '&#921;',
1986+ '&Kappa;' => '&#922;',
1987+ '&Lambda;' => '&#923;',
1988+ '&Mu;' => '&#924;',
1989+ '&Nu;' => '&#925;',
1990+ '&Xi;' => '&#926;',
1991+ '&Omicron;' => '&#927;',
1992+ '&Pi;' => '&#928;',
1993+ '&Rho;' => '&#929;',
1994+ '&Sigma;' => '&#931;',
1995+ '&Tau;' => '&#932;',
1996+ '&Upsilon;' => '&#933;',
1997+ '&Phi;' => '&#934;',
1998+ '&Chi;' => '&#935;',
1999+ '&Psi;' => '&#936;',
2000+ '&Omega;' => '&#937;',
2001+ '&alpha;' => '&#945;',
2002+ '&beta;' => '&#946;',
2003+ '&gamma;' => '&#947;',
2004+ '&delta;' => '&#948;',
2005+ '&epsilon;' => '&#949;',
2006+ '&zeta;' => '&#950;',
2007+ '&eta;' => '&#951;',
2008+ '&theta;' => '&#952;',
2009+ '&iota;' => '&#953;',
2010+ '&kappa;' => '&#954;',
2011+ '&lambda;' => '&#955;',
2012+ '&mu;' => '&#956;',
2013+ '&nu;' => '&#957;',
2014+ '&xi;' => '&#958;',
2015+ '&omicron;' => '&#959;',
2016+ '&pi;' => '&#960;',
2017+ '&rho;' => '&#961;',
2018+ '&sigmaf;' => '&#962;',
2019+ '&sigma;' => '&#963;',
2020+ '&tau;' => '&#964;',
2021+ '&upsilon;' => '&#965;',
2022+ '&phi;' => '&#966;',
2023+ '&chi;' => '&#967;',
2024+ '&psi;' => '&#968;',
2025+ '&omega;' => '&#969;',
2026+ '&thetasym;' => '&#977;',
2027+ '&upsih;' => '&#978;',
2028+ '&piv;' => '&#982;',
2029+ '&bull;' => '&#8226;',
2030+ '&hellip;' => '&#8230;',
2031+ '&prime;' => '&#8242;',
2032+ '&Prime;' => '&#8243;',
2033+ '&oline;' => '&#8254;',
2034+ '&frasl;' => '&#8260;',
2035+ '&weierp;' => '&#8472;',
2036+ '&image;' => '&#8465;',
2037+ '&real;' => '&#8476;',
2038+ '&trade;' => '&#8482;',
2039+ '&alefsym;' => '&#8501;',
2040+ '&larr;' => '&#8592;',
2041+ '&uarr;' => '&#8593;',
2042+ '&rarr;' => '&#8594;',
2043+ '&darr;' => '&#8595;',
2044+ '&harr;' => '&#8596;',
2045+ '&crarr;' => '&#8629;',
2046+ '&lArr;' => '&#8656;',
2047+ '&uArr;' => '&#8657;',
2048+ '&rArr;' => '&#8658;',
2049+ '&dArr;' => '&#8659;',
2050+ '&hArr;' => '&#8660;',
2051+ '&forall;' => '&#8704;',
2052+ '&part;' => '&#8706;',
2053+ '&exist;' => '&#8707;',
2054+ '&empty;' => '&#8709;',
2055+ '&nabla;' => '&#8711;',
2056+ '&isin;' => '&#8712;',
2057+ '&notin;' => '&#8713;',
2058+ '&ni;' => '&#8715;',
2059+ '&prod;' => '&#8719;',
2060+ '&sum;' => '&#8721;',
2061+ '&minus;' => '&#8722;',
2062+ '&lowast;' => '&#8727;',
2063+ '&radic;' => '&#8730;',
2064+ '&prop;' => '&#8733;',
2065+ '&infin;' => '&#8734;',
2066+ '&ang;' => '&#8736;',
2067+ '&and;' => '&#8743;',
2068+ '&or;' => '&#8744;',
2069+ '&cap;' => '&#8745;',
2070+ '&cup;' => '&#8746;',
2071+ '&int;' => '&#8747;',
2072+ '&there4;' => '&#8756;',
2073+ '&sim;' => '&#8764;',
2074+ '&cong;' => '&#8773;',
2075+ '&asymp;' => '&#8776;',
2076+ '&ne;' => '&#8800;',
2077+ '&equiv;' => '&#8801;',
2078+ '&le;' => '&#8804;',
2079+ '&ge;' => '&#8805;',
2080+ '&sub;' => '&#8834;',
2081+ '&sup;' => '&#8835;',
2082+ '&nsub;' => '&#8836;',
2083+ '&sube;' => '&#8838;',
2084+ '&supe;' => '&#8839;',
2085+ '&oplus;' => '&#8853;',
2086+ '&otimes;' => '&#8855;',
2087+ '&perp;' => '&#8869;',
2088+ '&sdot;' => '&#8901;',
2089+ '&lceil;' => '&#8968;',
2090+ '&rceil;' => '&#8969;',
2091+ '&lfloor;' => '&#8970;',
2092+ '&rfloor;' => '&#8971;',
2093+ '&lang;' => '&#9001;',
2094+ '&rang;' => '&#9002;',
2095+ '&loz;' => '&#9674;',
2096+ '&spades;' => '&#9824;',
2097+ '&clubs;' => '&#9827;',
2098+ '&hearts;' => '&#9829;',
2099+ '&diams;' => '&#9830;',
2100+ );
2101+
2102+
2103+//modify start+++++++++
2104+ function _restore_to_utf8($contents)
2105+ {
2106+ if (_CHARSET != 'UTF-8')
2107+ {
2108+ $contents = mb_convert_encoding($contents, 'UTF-8', _CHARSET);
2109+ }
2110+ $contents = $this->_decode_entities(strip_tags($contents));
2111+ return $contents;
2112+ }
2113+//modify end+++++++++
2114+ function _detect_encoding($string)
2115+ {
2116+//modify start+++++++++
2117+ if (function_exists('mb_convert_encoding')) {
2118+ $encoding = (preg_match ("/;\s*charset=([^\n]+)/is", serverVar("CONTENT_TYPE"), $regs))?
2119+ strtoupper(trim($regs[1])):
2120+ '';
2121+
2122+ if ( ($encoding !="") && ((mb_http_input("P") == "") || ( strtolower( ini_get("mbstring.http_input") ) == "pass")) ) {
2123+ return $encoding;
2124+ } else {
2125+ $encoding = mb_detect_encoding($string, 'UTF-8,EUC-JP,SJIS,ISO-8859-1,ASCII,JIS');
2126+ }
2127+ return ( $encoding ) ? $encoding : 'ISO-8859-1';
2128+ }
2129+//modify end+++++++++
2130+ if (!ereg("[\x80-\xFF]", $string) && !ereg("\x1B", $string))
2131+ return 'US-ASCII';
2132+
2133+ if (!ereg("[\x80-\xFF]", $string) && ereg("\x1B", $string))
2134+ return 'ISO-2022-JP';
2135+
2136+ if (preg_match("/^([\x01-\x7F]|[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF][\x80-\xBF])+$/", $string) == 1)
2137+ return 'UTF-8';
2138+
2139+ if (preg_match("/^([\x01-\x7F]|\x8E[\xA0-\xDF]|\x8F[xA1-\xFE][\xA1-\xFE]|[\xA1-\xFE][\xA1-\xFE])+$/", $string) == 1)
2140+ return 'EUC-JP';
2141+
2142+ if (preg_match("/^([\x01-\x7F]|[\xA0-\xDF]|[\x81-\xFC][\x40-\xFC])+$/", $string) == 1)
2143+ return 'Shift_JIS';
2144+
2145+ return 'ISO-8859-1';
2146+ }
2147+
2148+ function _convert_to_utf8($contents, $encoding)
2149+ {
2150+ $done = false;
2151+
2152+//modify start+++++++++
2153+// if (!$done && function_exists('iconv'))
2154+// {
2155+//
2156+// $result = @iconv($encoding, 'UTF-8//IGNORE', $contents);
2157+//
2158+// if ($result)
2159+// {
2160+// $contents = $result;
2161+// $done = true;
2162+// }
2163+// }
2164+
2165+ if(!$done && function_exists('mb_convert_encoding'))
2166+ {
2167+
2168+ if( function_exists('mb_substitute_character') ){
2169+ @mb_substitute_character('none');
2170+ }
2171+ $result = @mb_convert_encoding($contents, 'UTF-8', $encoding );
2172+
2173+ if ($result)
2174+ {
2175+ $contents = $result;
2176+ $done = true;
2177+ }
2178+ }
2179+
2180+ if (!$done && function_exists('iconv'))
2181+ {
2182+
2183+ $result = @iconv($encoding, 'UTF-8//IGNORE', $contents);
2184+
2185+ if ($result)
2186+ {
2187+ $contents = $result;
2188+ $done = true;
2189+ }
2190+ }
2191+//modify end+++++++++
2192+ return $contents;
2193+ }
2194+
2195+ function _convert_to_utf8_auto($contents, $headers = '')
2196+ {
2197+ /* IN: string in unknown encoding, headers received during transfer
2198+ * OUT: string in UTF-8 encoding
2199+ */
2200+
2201+ $str = substr($contents, 0, 4096);
2202+ $len = strlen($str);
2203+ $pos = 0;
2204+ $out = '';
2205+
2206+ while ($pos < $len)
2207+ {
2208+ $ord = ord($str[$pos]);
2209+
2210+ if ($ord > 32 && $ord < 128)
2211+ $out .= $str[$pos];
2212+
2213+ $pos++;
2214+ }
2215+
2216+ // Detection of encoding, check headers
2217+ if (preg_match ("/;\s*charset=([^\n]+)/is", $headers, $regs))
2218+ $encoding = strtoupper(trim($regs[1]));
2219+
2220+ // Then check meta inside document
2221+ if (preg_match ("/;\s*charset=([^\"']+)/is", $out, $regs))
2222+ $encoding = strtoupper(trim($regs[1]));
2223+
2224+ // Then check xml declaration
2225+ if (preg_match("/<\?xml.+encoding\s*=\s*[\"|']([^\"']+)[\"|']\s*\?>/i", $out, $regs))
2226+ $encoding = strtoupper(trim($regs[1]));
2227+
2228+ // Converts
2229+ return $this->_convert_to_utf8($contents, $encoding);
2230+ }
2231+
2232+ function _decode_entities($string)
2233+ {
2234+ /* IN: string in UTF-8 containing entities
2235+ * OUT: string in UTF-8 without entities
2236+ */
2237+
2238+ /// Convert all hexadecimal entities to decimal entities
2239+ $string = preg_replace('/&#[Xx]([0-9A-Fa-f]+);/e', "'&#'.hexdec('\\1').';'", $string);
2240+
2241+ // Deal with invalid cp1251 numeric entities
2242+ $string = strtr($string, $this->entities_cp1251);
2243+
2244+ // Convert all named entities to numeric entities
2245+ $string = strtr($string, $this->entities_default);
2246+ $string = strtr($string, $this->entities_latin);
2247+ $string = strtr($string, $this->entities_extended);
2248+
2249+ // Convert all numeric entities to UTF-8
2250+ $string = preg_replace('/&#([0-9]+);/e', "'&#x'.dechex('\\1').';'", $string);
2251+ $string = preg_replace('/&#[Xx]([0-9A-Fa-f]+);/e', "NP_TrackBack::_hex_to_utf8('\\1')", $string);
2252+
2253+ return $string;
2254+ }
2255+
2256+ function _hex_to_utf8($s)
2257+ {
2258+ /* IN: string containing one hexadecimal Unicode character
2259+ * OUT: string containing one binary UTF-8 character
2260+ */
2261+
2262+ $c = hexdec($s);
2263+
2264+ if ($c < 0x80) {
2265+ $str = chr($c);
2266+ }
2267+ else if ($c < 0x800) {
2268+ $str = chr(0xC0 | $c>>6) . chr(0x80 | $c & 0x3F);
2269+ }
2270+ else if ($c < 0x10000) {
2271+ $str = chr(0xE0 | $c>>12) . chr(0x80 | $c>>6 & 0x3F) . chr(0x80 | $c & 0x3F);
2272+ }
2273+ else if ($c < 0x200000) {
2274+ $str = chr(0xF0 | $c>>18) . chr(0x80 | $c>>12 & 0x3F) . chr(0x80 | $c>>6 & 0x3F) . chr(0x80 | $c & 0x3F);
2275+ }
2276+
2277+ return $str;
2278+ }
2279+
2280+ function _utf8_to_entities($string)
2281+ {
2282+ /* IN: string in UTF-8 encoding
2283+ * OUT: string consisting of only characters ranging from 0x00 to 0x7f,
2284+ * using numeric entities to represent the other characters
2285+ */
2286+
2287+ $len = strlen ($string);
2288+ $pos = 0;
2289+ $out = '';
2290+
2291+ while ($pos < $len)
2292+ {
2293+ $ascii = ord (substr ($string, $pos, 1));
2294+
2295+ if ($ascii >= 0xF0)
2296+ {
2297+ $byte[1] = ord(substr ($string, $pos, 1)) - 0xF0;
2298+ $byte[2] = ord(substr ($string, $pos + 1, 1)) - 0x80;
2299+ $byte[3] = ord(substr ($string, $pos + 2, 1)) - 0x80;
2300+ $byte[4] = ord(substr ($string, $pos + 3, 1)) - 0x80;
2301+
2302+ $char_code = ($byte[1] << 18) + ($byte[2] << 12) + ($byte[3] << 6) + $byte[4];
2303+ $pos += 4;
2304+ }
2305+ elseif (($ascii >= 0xE0) && ($ascii < 0xF0))
2306+ {
2307+ $byte[1] = ord(substr ($string, $pos, 1)) - 0xE0;
2308+ $byte[2] = ord(substr ($string, $pos + 1, 1)) - 0x80;
2309+ $byte[3] = ord(substr ($string, $pos + 2, 1)) - 0x80;
2310+
2311+ $char_code = ($byte[1] << 12) + ($byte[2] << 6) + $byte[3];
2312+ $pos += 3;
2313+ }
2314+ elseif (($ascii >= 0xC0) && ($ascii < 0xE0))
2315+ {
2316+ $byte[1] = ord(substr ($string, $pos, 1)) - 0xC0;
2317+ $byte[2] = ord(substr ($string, $pos + 1, 1)) - 0x80;
2318+
2319+ $char_code = ($byte[1] << 6) + $byte[2];
2320+ $pos += 2;
2321+ }
2322+ else
2323+ {
2324+ $char_code = ord(substr ($string, $pos, 1));
2325+ $pos += 1;
2326+ }
2327+
2328+ if ($char_code < 0x80)
2329+ $out .= chr($char_code);
2330+ else
2331+ $out .= '&#'. str_pad($char_code, 5, '0', STR_PAD_LEFT) . ';';
2332+ }
2333+
2334+ return $out;
2335+ }
2336+
2337+ function _utf8_to_javascript($string)
2338+ {
2339+ /* IN: string in UTF-8 encoding
2340+ * OUT: string consisting of only characters ranging from 0x00 to 0x7f,
2341+ * using javascript escapes to represent the other characters
2342+ */
2343+
2344+ $len = strlen ($string);
2345+ $pos = 0;
2346+ $out = '';
2347+
2348+ while ($pos < $len)
2349+ {
2350+ $ascii = ord (substr ($string, $pos, 1));
2351+
2352+ if ($ascii >= 0xF0)
2353+ {
2354+ $byte[1] = ord(substr ($string, $pos, 1)) - 0xF0;
2355+ $byte[2] = ord(substr ($string, $pos + 1, 1)) - 0x80;
2356+ $byte[3] = ord(substr ($string, $pos + 2, 1)) - 0x80;
2357+ $byte[4] = ord(substr ($string, $pos + 3, 1)) - 0x80;
2358+
2359+ $char_code = ($byte[1] << 18) + ($byte[2] << 12) + ($byte[3] << 6) + $byte[4];
2360+ $pos += 4;
2361+ }
2362+ elseif (($ascii >= 0xE0) && ($ascii < 0xF0))
2363+ {
2364+ $byte[1] = ord(substr ($string, $pos, 1)) - 0xE0;
2365+ $byte[2] = ord(substr ($string, $pos + 1, 1)) - 0x80;
2366+ $byte[3] = ord(substr ($string, $pos + 2, 1)) - 0x80;
2367+
2368+ $char_code = ($byte[1] << 12) + ($byte[2] << 6) + $byte[3];
2369+ $pos += 3;
2370+ }
2371+ elseif (($ascii >= 0xC0) && ($ascii < 0xE0))
2372+ {
2373+ $byte[1] = ord(substr ($string, $pos, 1)) - 0xC0;
2374+ $byte[2] = ord(substr ($string, $pos + 1, 1)) - 0x80;
2375+
2376+ $char_code = ($byte[1] << 6) + $byte[2];
2377+ $pos += 2;
2378+ }
2379+ else
2380+ {
2381+ $char_code = ord(substr ($string, $pos, 1));
2382+ $pos += 1;
2383+ }
2384+
2385+ if ($char_code < 0x80)
2386+ $out .= chr($char_code);
2387+ else
2388+ $out .= '\\u'. str_pad(dechex($char_code), 4, '0', STR_PAD_LEFT);
2389+ }
2390+
2391+ return $out;
2392+ }
2393+/*
2394+ function _cut_string($string, $dl = 0) {
2395+
2396+ $defaultLength = $dl > 0 ? $dl : $this->getOption('defaultLength');
2397+
2398+ if ($defaultLength < 1)
2399+ return $string;
2400+
2401+ $border = 6;
2402+ $count = 0;
2403+ $lastvalue = 0;
2404+
2405+ for ($i = 0; $i < strlen($string); $i++)
2406+ {
2407+ $value = ord($string[$i]);
2408+
2409+ if ($value > 127)
2410+ {
2411+ if ($value >= 192 && $value <= 223)
2412+ $i++;
2413+ elseif ($value >= 224 && $value <= 239)
2414+ $i = $i + 2;
2415+ elseif ($value >= 240 && $value <= 247)
2416+ $i = $i + 3;
2417+
2418+ if ($lastvalue <= 223 && $value >= 223 &&
2419+ $count >= $defaultLength - $border)
2420+ {
2421+ return substr($string, 0, $i) . '...';
2422+ }
2423+
2424+ // Chinese and Japanese characters are
2425+ // wider than Latin characters
2426+ if ($value >= 224)
2427+ $count++;
2428+
2429+ }
2430+ elseif ($string[$i] == '/' || $string[$i] == '?' ||
2431+ $string[$i] == '-' || $string[$i] == ':' ||
2432+ $string[$i] == ',' || $string[$i] == ';')
2433+ {
2434+ if ($count >= $defaultLength - $border)
2435+ return substr($string, 0, $i) . '...';
2436+ }
2437+ elseif ($string[$i] == ' ')
2438+ {
2439+ if ($count >= $defaultLength - $border)
2440+ return substr($string, 0, $i) . '...';
2441+ }
2442+
2443+ if ($count == $defaultLength)
2444+ return substr($string, 0, $i + 1) . '...';
2445+
2446+ $lastvalue = $value;
2447+ $count++;
2448+ }
2449+
2450+ return $string;
2451+ }
2452+*/
2453+
2454+function _cut_string($string, $dl = 0) {
2455+ $maxLength = $dl > 0 ? $dl : $this->getOption('defaultLength');
2456+
2457+ if ($maxLength < 1)
2458+ return $string;
2459+ if (strlen($string) > $maxLength)
2460+ $string = mb_strimwidth($string, 0, $maxLength, '...', _CHARSET);
2461+
2462+ return $string;
2463+}
2464+
2465+function _strip_controlchar($string){
2466+ $string = preg_replace("/[\x01-\x08\x0b\x0c\x0e-\x1f\x7f]+/","",$string);
2467+ $string = str_replace("\0","",$string);
2468+ return $string;
2469+}
2470+
2471+//modify start+++++++++
2472+ function checkTableVersion(){
2473+ $res = sql_query("SHOW FIELDS from ".sql_table('plugin_tb') );
2474+ $fieldnames = array();
2475+ while ($co = mysql_fetch_assoc($res)) {
2476+ if($co['Field'] == 'block') return true;
2477+ }
2478+ return false;
2479+ }
2480+//modify end+++++++++
2481+
2482+/*---------------------------------------------------------------------------------- */
2483+/* LOCAL */
2484+/*---------------------------------------------------------------------------------- */
2485+ /**
2486+ * Handle an incoming TrackBack ping and save the data in the database
2487+ */
2488+ function handleLocalPing($itemid, $title, $excerpt, $blog_name, $ping_url){
2489+ global $manager;
2490+ $ping_url = trim($ping_url);
2491+
2492+ if( preg_match("/^.+tb_id=([0-9]+)$/",$ping_url,$idnum) ){
2493+ $tb_id = intval($idnum[1]);
2494+ } elseif ( preg_match("/([0-9]+)\.trackback/",$ping_url,$idnum) ){
2495+ $tb_id = intval($idnum[1]);
2496+ } elseif ( preg_match("/itemid=([0-9]+)/",$ping_url,$idnum) ){
2497+ $tb_id = intval($idnum[1]);
2498+ }
2499+
2500+ if ((!$manager->existsItem($tb_id,0,0)) && ($this->getOption('CheckIDs') == 'yes'))
2501+ return _ERROR_NOSUCHITEM . "[ $tb_id ]";
2502+
2503+ // save data in the DB
2504+ $query = 'INSERT INTO ' . sql_table('plugin_tb_lc') . " (tb_id, from_id) VALUES ('".intval($tb_id)."','".intval($itemid)."')";
2505+ $res = @mysql_query($query);
2506+ if (!$res)
2507+ return 'Could not save trackback data, possibly because of a double entry: ' . mysql_error();
2508+ }
2509+
2510+ /**
2511+ * Show the list of TrackBack pings for a certain Trackback ID
2512+ */
2513+ function showLocalList($tb_id) {
2514+ global $CONF;
2515+
2516+ // create SQL query
2517+ $query = 'SELECT t.from_id as from_id , i.ititle as ititle, i.ibody as ibody, i.itime as itime, i.iblog as iblog FROM '.sql_table('plugin_tb_lc').' as t, '.sql_table('item').' as i WHERE t.tb_id='.intval($tb_id) .' and i.inumber=t.from_id ORDER BY i.itime DESC';
2518+ $res = mysql_query($query);
2519+
2520+ $vars = array(
2521+ 'tburl' => $this->getTrackBackUrl($tb_id)
2522+ );
2523+
2524+ // when no TrackBack pings are found
2525+ if (!$res || mysql_num_rows($res) == 0) {
2526+ echo TEMPLATE::fill($this->getOption('tplLocalEmpty'), $vars);
2527+ return;
2528+ }
2529+
2530+ // when TrackBack pings are found
2531+ echo TEMPLATE::fill($this->getOption('tplLocalHeader'), $vars);
2532+
2533+ while ($o = mysql_fetch_object($res)) {
2534+ $canDelete = $this->canDelete($tb_id);
2535+ $data = array(
2536+ 'url' => createItemLink($o->from_id),
2537+ 'blogname' => htmlspecialchars(getBlogNameFromID($o->iblog)),
2538+ 'timestamp' => strftime('%Y-%m-%d',strtotime($o->itime)),
2539+ 'title' => htmlspecialchars($o->ititle),
2540+ 'excerpt' => htmlspecialchars(shorten(strip_tags($o->ibody),200,'...')),
2541+ 'delete' => $canDelete?'<a href="'.$CONF['ActionURL'].'?action=plugin&amp;name=TrackBack&amp;type=deletelc&amp;tb_id='.$tb_id.'&amp;from_id='.$o->from_id.'">[delete]</a>':'',
2542+ 'tburl' => $this->getTrackBackUrl($tb_id),
2543+ 'commentcount'=> quickQuery('SELECT COUNT(*) as result FROM '.sql_table('comment').' WHERE citem=' . intval($o->from_id))
2544+ );
2545+ echo TEMPLATE::fill($this->getOption('tplLocalItem'), $data);
2546+ }
2547+ echo TEMPLATE::fill($this->getOption('tplLocalFooter'), $vars);
2548+ }
2549+
2550+ /**
2551+ * Delete a TrackBack item, redirect to referer
2552+ */
2553+ function deleteLocal($tb_id, $from_id) {
2554+ if (!$this->canDelete($tb_id))
2555+ return 'You\'re not allowed to delete this trackback item';
2556+ $query = 'DELETE FROM ' . sql_table('plugin_tb_lc') . " WHERE tb_id='" . intval($tb_id) . "' and from_id='" . intval($from_id) ."'";
2557+ mysql_query($query);
2558+ return '';
2559+ }
2560+
2561+ function canDelete($tb_id) {
2562+ global $member, $manager;
2563+
2564+ if (!$member->isLoggedIn()) return 0;
2565+
2566+ $checkIDs = $this->getOption('CheckIDs');
2567+ $itemExists =& $manager->existsItem($tb_id,0,0);
2568+
2569+ // if CheckIDs option is set, check if member canEdit($tb_id)
2570+ // if CheckIDs option is not set, and item exists, check if member canEdit($tb_id)
2571+ // if CheckIDs option is not set, and item does not exists, check if member isAdmin()
2572+
2573+ if (($checkIDs == 'yes') || ($itemExists))
2574+ return $member->canAlterItem($tb_id);
2575+ else
2576+ return $member->isAdmin();
2577+ }
2578+
2579+ /**************************************************************************************/
2580+ /* Plugin API calls, for installation, configuration and setup */
2581+
2582+ function getName() { return 'TrackBack'; }
2583+ function getAuthor() { return 'rakaz + nakahara21 + hsur'; }
2584+ function getURL() { return 'http://blog.cles.jp/np_cles/category/31/subcatid/3'; }
2585+ function getVersion() { return '2.0.3 jp6'; }
2586+ function getDescription() { return _TB_DESCRIPTION; }
2587+
2588+//modify start+++++++++
2589+/*
2590+ function getTableList() { return array(sql_table("plugin_tb"), sql_table("plugin_tb_lookup")); }
2591+ function getEventList() { return array('QuickMenu','PostAddItem','AddItemFormExtras','EditItemFormExtras','PreUpdateItem','PrepareItemForEdit', 'BookmarkletExtraHead'); }
2592+*/
2593+ function getTableList() { return array(sql_table("plugin_tb"), sql_table("plugin_tb_lookup"), sql_table('plugin_tb_lc')); }
2594+
2595+ function getEventList() { return array('QuickMenu','PostAddItem','AddItemFormExtras','EditItemFormExtras','PreUpdateItem','PrepareItemForEdit', 'BookmarkletExtraHead', 'RetrieveTrackback', 'SendTrackback', 'InitSkinParse'); }
2596+//modify end+++++++++
2597+ function getMinNucleusVersion() { return 200; }
2598+
2599+ function supportsFeature($feature) {
2600+ switch($feature) {
2601+ case 'SqlTablePrefix':
2602+ return 1;
2603+//modify start+++++++++
2604+// case 'HelpPage':
2605+// return 1;
2606+//modify end+++++++++
2607+ default:
2608+ return 0;
2609+ }
2610+ }
2611+
2612+
2613+ function hasAdminArea() { return 1; }
2614+
2615+ function event_QuickMenu(&$data) {
2616+ global $member, $nucleus, $blogid;
2617+
2618+ // only show to admins
2619+ if (!$member->isLoggedIn() || !$member->isAdmin()) return;
2620+
2621+ array_push(
2622+ $data['options'],
2623+ array(
2624+ 'title' => 'Trackback',
2625+ 'url' => $this->getAdminURL(),
2626+ 'tooltip' => 'Manage your trackbacks'
2627+ )
2628+ );
2629+ }
2630+
2631+ function install() {
2632+ $this->createOption('AcceptPing', _TB_AcceptPing,'yesno','yes');
2633+ $this->createOption('SendPings', _TB_SendPings,'yesno','yes');
2634+ $this->createOption('AutoXMLHttp', _TB_AutoXMLHttp, 'yesno', 'yes');
2635+ $this->createOption('CheckIDs', _TB_CheckIDs,'yesno','yes');
2636+
2637+ $this->createOption('tplHeader', _TB_tplHeader, 'textarea', _TB_tplHeader_VAL);
2638+ $this->createOption('tplEmpty', _TB_tplEmpty, 'textarea', _TB_tplEmpty_VAL);
2639+ $this->createOption('tplItem', _TB_tplItem, 'textarea', _TB_tplItem_VAL);
2640+ $this->createOption('tplFooter', _TB_tplFooter, 'textarea', _TB_tplFooter_VAL);
2641+//mod by cles
2642+ $this->createOption('tplLocalHeader', _TB_tplLocalHeader, 'textarea', _TB_tplLocalHeader_VAL);
2643+ $this->createOption('tplLocalEmpty', _TB_tplLocalEmpty, 'textarea', _TB_tplLocalEmpty_VAL);
2644+ $this->createOption('tplLocalItem', _TB_tplLocalItem, 'textarea', _TB_tplLocalItem_VAL);
2645+ $this->createOption('tplLocalFooter', _TB_tplLocalFooter, 'textarea', _TB_tplLocalFooter_VAL);
2646+//mod by cles end
2647+
2648+ $this->createOption('tplTbNone', _TB_tplTbNone, 'text', "No Trackbacks");
2649+ $this->createOption('tplTbOne', _TB_tplTbOne, 'text', "1 Trackback");
2650+ $this->createOption('tplTbMore', _TB_tplTbMore, 'text', "<%number%> Trackbacks");
2651+ $this->createOption('dateFormat', _TB_dateFormat, 'text', _TB_dateFormat_VAL);
2652+
2653+ $this->createOption('Notify', _TB_Notify,'yesno','no');
2654+ $this->createOption('NotifyEmail', _TB_NotifyEmail,'text','');
2655+
2656+ $this->createOption('DropTable', _TB_DropTable,'yesno','no');
2657+//mod by cles
2658+ $this->createOption('HideUrl',_TB_HideUrl,'yesno','yes');
2659+ $this->createItemOption('ItemAcceptPing',_TB_ItemAcceptPing,'yesno','yes');
2660+ $this->createItemOption('isAcceptW/OLink',_TB_isAcceptWOLink,'select','default', _TB_isAcceptWOLink_VAL);
2661+
2662+ $this->createBlogOption('isAcceptW/OLinkDef',_TB_isAcceptWOLinkDef,'select','block', _TB_isAcceptWOLinkDef_VAL);
2663+ $this->createBlogOption('AllowTrackBack',_TB_AllowTrackBack,'yesno','yes');
2664+//mod by cles end
2665+
2666+ /* Create tables */
2667+ mysql_query("
2668+ CREATE TABLE IF NOT EXISTS
2669+ ".sql_table('plugin_tb')."
2670+ (
2671+ `id` INT(11) NOT NULL AUTO_INCREMENT,
2672+ `tb_id` INT(11) NOT NULL,
2673+ `url` TEXT NOT NULL,
2674+ `block` TINYINT(4) NOT NULL,
2675+ `spam` TINYINT(4) NOT NULL,
2676+ `link` TINYINT(4) NOT NULL,
2677+ `title` TEXT,
2678+ `excerpt` TEXT,
2679+ `blog_name` TEXT,
2680+ `timestamp` DATETIME,
2681+
2682+ PRIMARY KEY (`id`)
2683+ )
2684+ ");
2685+
2686+ mysql_query("
2687+ CREATE TABLE IF NOT EXISTS
2688+ ".sql_table('plugin_tb_lookup')."
2689+ (
2690+ `link` TEXT NOT NULL,
2691+ `url` TEXT NOT NULL,
2692+ `title` TEXT,
2693+
2694+ PRIMARY KEY (`link` (100))
2695+ )
2696+ ");
2697+//modify start+++++++++
2698+ @mysql_query('ALTER TABLE `' . sql_table('plugin_tb') . '` ADD INDEX `tb_id_block_timestamp_idx` ( `tb_id`, `block`, `timestamp` DESC )');
2699+ @mysql_query('CREATE TABLE IF NOT EXISTS ' . sql_table('plugin_tb_lc'). ' (tb_id int(11) not null, from_id int(11) not null, PRIMARY KEY (tb_id,from_id))');
2700+//modify end+++++++++
2701+ }
2702+
2703+ function uninstall() {
2704+ if ($this->getOption('DropTable') == 'yes') {
2705+ mysql_query ('DROP TABLE '.sql_table('plugin_tb'));
2706+ mysql_query ('DROP TABLE '.sql_table('plugin_tb_lookup'));
2707+ mysql_query ("DROP table ".sql_table('plugin_tb_lc'));
2708+ }
2709+ }
2710+
2711+ function init() {
2712+ // include language file for this plugin
2713+ $language = ereg_replace( '[\\|/]', '', getLanguageName());
2714+ if (file_exists($this->getDirectory().'language/'.$language.'.php'))
2715+ include_once($this->getDirectory().'language/'.$language.'.php');
2716+ else
2717+ include_once($this->getDirectory().'language/'.'english.php');
2718+ $this->notificationMail = _TB_NORTIFICATION_MAIL_BODY;
2719+ $this->notificationMailTitle = _TB_NORTIFICATION_MAIL_TITLE;
2720+ }
2721+ }
2722+
2723+?>
--- /dev/null
+++ b/trunk/NP_TrackBack/trackback/CHANGELOG.txt
@@ -0,0 +1,123 @@
1+
2+
3+ 0.9.0 Initial version of Referer by Xiffy
4+ 0.9.1 Added the possibility to call pop, 10 to show the most populair pages
5+ Minor bugfixes for htmlspecialchars
6+ Added substr to trim the line. Internet Explorer makes long lines instead of braking them
7+ 0.9.2 Added timeoffset functionality to refWhen ...
8+ 0.9.3 Added three display options (needs reinstallation!)
9+ Bugfixes and another calling option; lastall
10+ Added "-" on each refer*
11+
12+ ------------------------------------------------------------
13+
14+ 1.0 Initial release
15+ 1.1 Version that takes advantage of the new features in Nucleus v2.0
16+ (v1.55 users still need to addapt their templates)
17+ 1.2 - Fix: Typo (cechkids)
18+ - Fix: $CONF['ActionURL'] instead of $CONF['SiteURL'] . 'action.php'
19+ - Fix: also works with php option 'short_open_tags' set to Off
20+ - Added: manualpingform
21+ - Requires Nucleus v2.0...
22+ - Support for tableprefix (Nucleus versions > 2.0)
23+
24+ 1.3 Release by caw
25+ - Removed: Table backwards compatibility code
26+ - Added: Support for adding TrackBack when editing item
27+ - Change: Table name changed from [nucleus_]plugin_tb to [nucleus_]plug_trackback
28+
29+ 1.4 Release by TeRanEX
30+ (didn't wrote anything myself, only merged some modifications)
31+ - Added: Table backwards compatibility code (was removed in 1.3 but I don't
32+ see any reason why)
33+ - Change: Table name changed from [nucleus_]plug_trackback to [nucleus_]plugin_tb
34+ again (what was the reason for the change in 1.3?
35+ - Added all fixes/mods/additions of thread http://forum.nucleuscms.org/viewtopic.php?t=3247
36+ - Send a ping on edit item
37+ - sendPing with POST instead of GET
38+ - "Retrieving TrackBack Pings" Implementation
39+ - "Auto-Discovery of TrackBack Ping URLs" Implementation
40+ - automatically-detecting trackbackURL of permalink linked by item
41+ - Change: the RDF output so that it looks the same as in the MT TrackBack Spec
42+ (see http://forum.nucleuscms.org/viewtopic.php?t=1974)
43+
44+ 1.5 Release by admun and TeRanEX
45+ - Added: Trackback updates, sending the newest data
46+ - Added: Autodiscovery to the bookmarklet
47+ - Added: Autodiscovery to the pingform
48+ - Fixed: Autodiscovery now looks also in the 'more'-part of an item
49+ - Changed/fixed: autodiscovery when editing an item, now you can check a checkbox for
50+ every trackback that was discovered and you want to ping
51+ - Added: License info
52+ - Changed: The description of the plugin
53+
54+ ------------------------------------------------------------
55+
56+ 2.0a Release by Niels Leenheer (rakaz)
57+ - Added: Caching of auto-detected trackback URLs in a database table
58+ - Added: If the cURL extension is present a HEAD request is send first, to make
59+ sure we are dealing with a (X)HTML page and not some large binary file format.
60+ - Added: The auto-detection of trackback URLs now happen in real time - as you type -
61+ thanks to client-side Javascript and the XmlHttpRequest object which requests
62+ the required data from the plugin.
63+
64+ 2.0b - Added spinning auto-detection indicator
65+ - Added support for multiple character encoding methods. The plugin
66+ works internally fully in UTF-8 (Unicode) and can convert other
67+ character encodings. The output of the plugin is in UTF-8 or in US-ASCII
68+ with unicode characters encoded using numeric entities.
69+ - Added spam protection using the Blacklist plugin (thanks to Xiffy for
70+ helping me out by adding a generic spam check API to his plugin).
71+ - Added a check to see if the page which send the trackback actually
72+ contains a link to our server. If not, then it is probably a spamming
73+ attempt and block by default.
74+ - The output of this plugin is now fully configurable. You can specify
75+ you're own (X)HTML code.
76+ - Added a admin interface which can be used to manage trackbacks and
77+ manually send trackbacks to other sites. It is possible to delete
78+ trackbacks, but also to block and unblock trackbacks. All trackbacks
79+ which are marked as spam are not deleted automatically, but they end
80+ up in a list called 'Blocked trackbacks'. You can manually verify this
81+ list and unblock any trackback which is marked as spam by mistake.
82+ - Fixed a number of bugs, including missing hostnames and double // in
83+ URLs. Fixed a bug introduced in 2.0a which prevented the title and
84+ excerpt from showing up when sending trackbacks from a newly created
85+ story. Also filtering of tags is more stringent.
86+
87+ - REMOVED: Manual ping forms. The form which is need to ping other
88+ weblogs is now integrated into the admin interface. The form needed
89+ for other weblog authors to manually add trackbacks to your website
90+ will return in the next release.
91+ - REMOVED: The ability to show a list of trackbacks in a popup window.
92+ This will probably return in the next release.
93+ - REMOVED: The ability to delete trackbacks directly from the list
94+ shown to administrators. This is now handled by the admin interface.
95+
96+ 2.0 final
97+ - Made the help page Nucleus 3.2 compatible
98+ - Added a manual ping form, which allows weblog authors to add a trackback
99+ to your stories even when their software doesn't support trackbacks.
100+ - Removed <language>en</language> from the RSS output, because we can't
101+ be sure about the language of the contents of the RSS stream.
102+
103+ 2.0.1 - Security fix: Plugin admin interface was exposed to all logged in users,
104+ not only to users with admin rights.
105+
106+ 2.0.2 - Added autodetection of the encoding of trackbacks, which is needed when
107+ a trackback is send in a foreign encoding by a sender which does not
108+ support version 1.2 of the trackback specifications. Supported encodings:
109+ US-ASCII, ISO-2022-JP, UTF-8, EUC-JP, Shift_JIS. If the encoding is not
110+ specified according to version 1.2 of the specs AND it is not one of the
111+ encodings specified above, the plugin will assume it is encoding using
112+ ISO-8859-1.
113+ - Added two new events SendTrackback and RetrieveTrackback which can be
114+ used by other plugins or the XML-RPC APIs to allow external blog editors
115+ to send trackbacks. (This functionality does require a modification to
116+ the XML-RPC APIs).
117+ - Added support for more clean Trackback URLs, for example:
118+ http://www.rakaz.nl/nucleus/item/84.trackback or
119+ http://www.rakaz.nl/nucleus/item.php?id=84&format=trackback
120+
121+ 2.0.3 - Added support for a more advanced version of the SpamCheck API
122+
123+
\ No newline at end of file
--- /dev/null
+++ b/trunk/NP_TrackBack/trackback/autodetect.php
@@ -0,0 +1,275 @@
1+<?php
2+
3+ $strRel = '../../../';
4+ include($strRel . 'config.php');
5+?>
6+
7+ var TrackbackAction = "<?php echo $CONF['ActionURL'];?>";
8+ var xmlhttp = false;
9+ var inProgress = false;
10+
11+ var TrackbackAction = "<?php echo $CONF['ActionURL'];?>";
12+ var TrackbackSource = new Array;
13+ var TrackbackName = new Array;
14+ var TrackbackURL = new Array;
15+
16+ var LookupTable = new Array;
17+ var Lookup = '';
18+ var countTotal = 0;
19+
20+ var regexp = /href\s*=\s*([\"\'])(http:[^\"\'>]+)([\"\'])/ig;
21+
22+
23+ function tbParseLinks ()
24+ {
25+ oinputbody = document.getElementById('inputbody');
26+ oinputmore = document.getElementById('inputmore');
27+ full = oinputbody.value + ' ' + oinputmore.value;
28+
29+ while (vArray = regexp.exec(full))
30+ {
31+ unused = true;
32+
33+ if (Lookup == vArray[2])
34+ unused = false;
35+
36+ for (var i = 0; i < LookupTable.length; i++)
37+ if (LookupTable[i] == vArray[2])
38+ unused = false;
39+
40+ for (var i = 0; i < TrackbackSource.length; i++)
41+ if (TrackbackSource[i] == vArray[2])
42+ unused = false;
43+
44+ if (unused == true)
45+ LookupTable.push(vArray[2]);
46+ }
47+ }
48+
49+ function tbAutoDetect()
50+ {
51+ if (LookupTable.length > 0)
52+ {
53+ tbBusy(true);
54+
55+ if (!inProgress)
56+ {
57+ // We have something to do and the connection is free
58+ Lookup = LookupTable.shift();
59+ inProgress = true;
60+
61+ // The reason we use GET instead of POST is because
62+ // Opera does not properly support setting headers yet,
63+ // which is a requirement for using POST.
64+ xmlhttp.open("GET", TrackbackAction + "?action=plugin&name=TrackBack&type=detect&tb_link=" + escape(Lookup), true);
65+ xmlhttp.onreadystatechange = tbStateChange;
66+ xmlhttp.send('');
67+ }
68+ else
69+ {
70+ // Still busy... simply wait until next turn
71+ }
72+ }
73+ else
74+ {
75+ // Nothing to do, check back later...
76+ if (Lookup == '')
77+ {
78+ tbBusy(false);
79+ }
80+ }
81+ }
82+
83+ function tbStateChange ()
84+ {
85+ if (inProgress == true && xmlhttp.readyState == 4 && xmlhttp.status == 200)
86+ {
87+ eval (xmlhttp.responseText);
88+ inProgress = false;
89+ Lookup = '';
90+ }
91+ }
92+
93+ function tbBusy(toggle)
94+ {
95+
96+ if (toggle)
97+ {
98+ document.forms[0].discoverit.style.color = "#888888";
99+ document.forms[0].discoverit.style.fontWeight="bold";
100+ document.forms[0].discoverit.value = " Loading ....";
101+ }
102+ else
103+ {
104+ document.forms[0].discoverit.style.color = "#888888";
105+ document.forms[0].discoverit.style.fontWeight="bold";
106+ document.forms[0].discoverit.value = " D o n e ! ";
107+ }
108+
109+ o = document.getElementById('tb_busy');
110+
111+ if (o)
112+ {
113+ if (toggle)
114+ o.style.display = '';
115+ else
116+ o.style.display = 'none'
117+ }
118+ }
119+
120+ function tbDone(source, url, name)
121+ {
122+ TrackbackSource.push(source);
123+ TrackbackURL.push(url);
124+ TrackbackName.push(name);
125+
126+// var parent = document.getElementById('tb_auto');
127+ var amount = document.getElementById('tb_url_amount');
128+ var subtitle = document.getElementById('tb_auto_title');
129+ var listtable = document.getElementById('tb_ping_list');
130+
131+ if (url != '')
132+ {
133+// count = parseInt(amount.value);
134+ count = countTotal;
135+
136+ mycurrent_row=document.createElement("TR");
137+
138+ checkbox = document.createElement("input");
139+ checkbox.type = 'checkbox';
140+ checkbox.name = "tb_url_" + count;
141+ checkbox.id = "tb_url_" + count;
142+ checkbox.value = url;
143+ checkbox.defaultChecked = true;
144+
145+ label = document.createElement("label");
146+ label.htmlFor = "tb_url_" + count;
147+ label.title = source;
148+
149+ text = document.createTextNode(name);
150+ label.appendChild(text);
151+
152+
153+// br = document.createElement("br");
154+
155+// subtitle.innerHTML = "Auto Discovered Ping URL's:";
156+// parent.appendChild(checkbox);
157+// parent.appendChild(label);
158+
159+ mycurrent_cell=document.createElement("TD");
160+ mycurrent_cell.appendChild(checkbox);
161+ mycurrent_row.appendChild(mycurrent_cell);
162+ mycurrent_cell=document.createElement("TD");
163+ mycurrent_cell.appendChild(label);
164+ mycurrent_row.appendChild(mycurrent_cell);
165+
166+ //utf8?
167+ checkboxU = document.createElement("input");
168+ checkboxU.type = 'checkbox';
169+ checkboxU.name = "tb_url_" + count + "_utf8";
170+ checkboxU.id = "tb_url_" + count + "_utf8";
171+ checkboxU.defaultChecked = false;
172+
173+ labelU = document.createElement("label");
174+ labelU.htmlFor = "tb_url_" + count + "_utf8";
175+ labelU.title = "utf8?";
176+
177+ text = document.createTextNode("utf8?");
178+ labelU.appendChild(text);
179+ mycurrent_cell=document.createElement("TD");
180+ mycurrent_cell.appendChild(checkboxU);
181+ mycurrent_cell.appendChild(labelU);
182+ mycurrent_row.appendChild(mycurrent_cell);
183+
184+
185+ if(url.indexOf("<?php echo $CONF['IndexURL'];?>",0) != -1)
186+ {
187+ //local?
188+ checkboxL = document.createElement("input");
189+ checkboxL.type = 'checkbox';
190+ checkboxL.name = "tb_url_" + count + "_local";
191+ checkboxL.id = "tb_url_" + count + "_local";
192+ checkboxL.defaultChecked = true;
193+
194+ labelL = document.createElement("label");
195+ labelL.htmlFor = "tb_url_" + count + "_local";
196+ labelL.title = "local?";
197+
198+ text = document.createTextNode("local?");
199+ labelL.appendChild(text);
200+// parent.appendChild(checkboxL);
201+// parent.appendChild(labelL);
202+ mycurrent_cell=document.createElement("TD");
203+ mycurrent_cell.appendChild(checkboxL);
204+ mycurrent_cell.appendChild(labelL);
205+ mycurrent_row.appendChild(mycurrent_cell);
206+
207+ }
208+ else
209+ {
210+ mycurrent_cell=document.createElement("TD");
211+ mycurrent_row.appendChild(mycurrent_cell);
212+ }
213+// parent.appendChild(br);
214+ listtable.appendChild(mycurrent_row);
215+
216+// amount.value = count + 1;
217+ countTotal++;
218+ amount.value = countTotal;
219+ }
220+ else
221+ {
222+ subtitle.innerHTML = "No Trackbak URLs.";
223+ }
224+ }
225+
226+ function tbSetup()
227+ {
228+ try
229+ {
230+ xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
231+ }
232+ catch (e)
233+ {
234+ try
235+ {
236+ xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
237+ }
238+ catch (e)
239+ {
240+ xmlhttp = false;
241+ }
242+ }
243+
244+ if (!xmlhttp && typeof XMLHttpRequest!='undefined')
245+ {
246+ xmlhttp = new XMLHttpRequest();
247+ }
248+
249+ setInterval ('tbParseLinks();', 500);
250+ setInterval ('tbAutoDetect();', 500);
251+
252+ if (window.onloadtrackback)
253+ window.onloadtrackback();
254+ }
255+
256+ function AddStart()
257+ {
258+ var strString = "";
259+ strString = document.forms[0].trackback_ping_url.value;
260+ strArray = strString.split("\n");
261+ for (var i = 0; i < strArray.length; i++)
262+ {
263+ strTemp = trim(strArray[i]);
264+ if (strTemp != "" && strTemp.match(/^http/))
265+ {
266+ tbDone(strTemp,strTemp,strTemp);
267+ }
268+ }
269+ document.forms[0].trackback_ping_url.value = '';
270+ }
271+
272+ function trim(string)
273+ {
274+ return string.replace(/(^\s*)|(\s*$)/g,'');
275+ }
Binary files /dev/null and b/trunk/NP_TrackBack/trackback/busy.gif differ
--- /dev/null
+++ b/trunk/NP_TrackBack/trackback/detectlist.php
@@ -0,0 +1,70 @@
1+<?php
2+ $strRel = '../../../';
3+ include($strRel . 'config.php');
4+
5+?>
6+ var TrackbackAction = "<?php echo $CONF['ActionURL'];?>";
7+ var tb_id = "<?php echo intRequestVar('tb_id')?>";
8+ var tb_amount = "<?php echo intRequestVar('amount')?>";
9+ var xmlhttp = false;
10+
11+ function resttbStart()
12+ {
13+ document.getElementById("tbhidenavi").style.display = "block";
14+ document.getElementById("tbshownavi").style.display = "none";
15+ try
16+ {
17+ xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
18+ }
19+ catch (e)
20+ {
21+ try
22+ {
23+ xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
24+ }
25+ catch (e)
26+ {
27+ xmlhttp = false;
28+ }
29+ }
30+
31+ if (!xmlhttp && typeof XMLHttpRequest!='undefined')
32+ {
33+ xmlhttp = new XMLHttpRequest();
34+ }
35+
36+ if (xmlhttp)
37+ {
38+ loadXMLDoc();
39+ }
40+
41+ }
42+
43+ function loadXMLDoc()
44+ {
45+
46+ var url = TrackbackAction + '?action=plugin&name=TrackBack&type=left&tb_id=' + tb_id + '&amount=' + tb_amount;
47+
48+ xmlhttp.onreadystatechange=xmlhttpChange
49+ xmlhttp.open("GET",url,true)
50+ xmlhttp.send('')
51+ }
52+
53+ function xmlhttpChange()
54+ {
55+ if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
56+ {
57+ var result = document.getElementById("resttb");
58+ result.innerHTML = xmlhttp.responseText;
59+ }
60+ }
61+
62+ function hideresttb()
63+ {
64+ var result = document.getElementById("resttb");
65+ result.innerHTML = "";
66+
67+ document.getElementById("tbhidenavi").style.display = "none";
68+ document.getElementById("tbshownavi").style.display = "block";
69+
70+ }
--- /dev/null
+++ b/trunk/NP_TrackBack/trackback/help.html
@@ -0,0 +1,111 @@
1+<h2>Help</h2>
2+
3+
4+<h3>Skin variables</h3>
5+
6+<p>
7+ <code>&lt;%TrackBack(list)%&gt;</code>
8+</p>
9+<p>
10+ Show a list of trackbacks for the current page. Optionally it is also possible to
11+ add an additional parameter, the story id number, which makes it possible to
12+ show a list of trackbacks from a different page. The output of this variable is
13+ fully configurable in the plugin options.
14+</p>
15+
16+<p>
17+ <code>&lt;%TrackBack(code)%&gt;</code>
18+</p>
19+<p>
20+ Inserts a small piece of invisible RDF code in the page, which is used by other
21+ weblogs to auto-detect the trackback URL. If you do not include this variable in
22+ your skin for item pages, other weblogs will not be able to auto-detect that your
23+ weblog is able to accept trackbacks.
24+</p>
25+
26+<p>
27+ <code>&lt;%TrackBack(form)%&gt;</code>
28+</p>
29+<p>
30+ Insert the URL to a manual ping form. Using this form authors of other weblogs
31+ can add trackbacks to your stories, even when their software does not support
32+ trackbacks, such as Blogger. A link to this form is included in the footer of
33+ the trackback list by default. If you want to place this link somewhere else
34+ on your page, simply remove the <code>&lt;%form%&gt;</code> variable from the
35+ <em>Footer</em> field in the plugin settings and add the skinvar somewhere on
36+ your webpage.
37+</p>
38+
39+<p>
40+ <code>&lt;%TrackBack(url)%&gt;</code>
41+</p>
42+<p>
43+ Insert the Trackback Ping URL. A this URL is also included in the footer of
44+ the trackback list by default. If you want to place this link somewhere else
45+ on your page, simply remove the <code>&lt;%action%&gt;</code> variable from the
46+ <em>Footer</em> field in the plugin settings and add the skinvar somewhere on
47+ your webpage.
48+</p>
49+
50+<h3>Template variables</h3>
51+
52+<p>
53+ All the skin variables documented above are also available as template variables.
54+</p>
55+
56+<p>
57+ <code>&lt;%TrackBack(count)%&gt;</code>
58+</p>
59+<p>
60+ If you want to include an indication of how many trackbacks are present for each
61+ page you can use this variable. By default this variable will show: "No Trackbacks",
62+ "1 Trackback", "2 Trackbacks", etc. This is however also fully configurable in
63+ the plugin options.
64+</p>
65+
66+
67+<h3>Changing the output</h3>
68+
69+<p>
70+ It is possible to fully change the output of this plugin. You can manually change
71+ the XHTML code in the plugin options, but you can also use CSS to style the default
72+ output to your liking. Below you will find an example of what a little snippet of
73+ CSS can do.
74+</p>
75+
76+<pre>div.tb {
77+ border: 1px solid #000; background: #FFF;
78+}
79+div.tb div.head {
80+ padding: 4px;
81+ background: #000; color: #FFF;
82+ font-weight: bold; text-transform: lowercase; letter-spacing: 0.6em;
83+}
84+div.tb div.empty {
85+ padding: 4px;
86+ font-size: 95%;
87+}
88+div.tb div.item {
89+ padding: 4px;
90+}
91+div.tb div.item div.name {
92+ margin-bottom: 8px;
93+ font-size: 120%; font-weight: bold;
94+}
95+div.tb div.item div.body {
96+ font-size: 95%;
97+}
98+div.tb div.item div.body a {
99+ font-weight: bold;
100+}
101+div.tb div.item div.date {
102+ margin-bottom: 8px;
103+ color: #888;
104+ font-size: 85%; text-align: right;
105+}
106+div.tb div.info {
107+ padding: 4px;
108+ color: #FFF; background: #888;
109+ font-size: 85%; font-style: italic;
110+}</pre>
111+
--- /dev/null
+++ b/trunk/NP_TrackBack/trackback/index.php
@@ -0,0 +1,509 @@
1+<?php
2+
3+ $strRel = '../../../';
4+ include($strRel . 'config.php');
5+ include($DIR_LIBS . 'PLUGINADMIN.php');
6+ include('template.php');
7+
8+
9+ // Send out Content-type
10+ sendContentType('application/xhtml+xml', 'admin-trackback', _CHARSET);
11+
12+ // Compatiblity with Nucleus < = 2.0
13+ if (!function_exists('sql_table')) { function sql_table($name) { return 'nucleus_' . $name; } }
14+
15+
16+
17+ $oPluginAdmin = new PluginAdmin('TrackBack');
18+
19+ if (!($member->isLoggedIn() && $member->isAdmin()))
20+ {
21+ $oPluginAdmin->start();
22+ echo '<p>' . _ERROR_DISALLOWED . '</p>';
23+ $oPluginAdmin->end();
24+ exit;
25+ }
26+
27+ $oPluginAdmin->start();
28+
29+//modify start+++++++++
30+ $plug =& $oPluginAdmin->plugin;
31+ $tableVersion = $plug->checkTableVersion();
32+
33+ // include language file for this plugin
34+ $language = ereg_replace( '[\\|/]', '', getLanguageName());
35+ if (file_exists($plug->getDirectory().'language/'.$language.'.php'))
36+ include_once($plug->getDirectory().'language/'.$language.'.php');
37+ else
38+ include_once($plug->getDirectory().'language/'.'english.php');
39+//modify end+++++++++
40+
41+ $mTemplate = new Trackback_Template();
42+ $mTemplate->set ('CONF', $CONF);
43+ $mTemplate->set ('plugid', $plug->getID());
44+ $mTemplate->template('templates/menu.html');
45+ echo $mTemplate->fetch();
46+
47+ $oTemplate = new Trackback_Template();
48+ $oTemplate->set ('CONF', $CONF);
49+
50+ // Actions
51+ $action = requestVar('action');
52+
53+ switch($action) {
54+
55+//modify start+++++++++
56+ case 'tableUpgrade':
57+ mysql_query("
58+ CREATE TABLE IF NOT EXISTS
59+ ".sql_table('plugin_tb_lookup')."
60+ (
61+ `link` TEXT NOT NULL,
62+ `url` TEXT NOT NULL,
63+ `title` TEXT,
64+
65+ PRIMARY KEY (`link` (100))
66+ )
67+ ");
68+ echo $q = "ALTER TABLE ".sql_table('plugin_tb')."
69+ ADD `block` TINYINT( 4 ) NOT NULL AFTER `url` ,
70+ ADD `spam` TINYINT( 4 ) NOT NULL AFTER `block` ,
71+ ADD `link` TINYINT( 4 ) NOT NULL AFTER `spam` ,
72+ CHANGE `url` `url` TEXT NOT NULL,
73+ CHANGE `title` `title` TEXT NOT NULL,
74+ CHANGE `excerpt` `excerpt` TEXT NOT NULL,
75+ CHANGE `blog_name` `blog_name` TEXT NOT NULL,
76+ DROP PRIMARY KEY,
77+ ADD `id` INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST ;";
78+ $res = @mysql_query($q);
79+ if (!$res){
80+ echo 'Could not alter table: ' . mysql_error();
81+ }else{
82+ $tableVersion = 1;
83+ $oTemplate->template('templates/updatetablefinished.html');
84+ }
85+ @mysql_query('ALTER TABLE `' . sql_table('plugin_tb') . '` ADD INDEX `tb_id_block_timestamp_idx` ( `tb_id`, `block`, `timestamp` DESC )');
86+ break;
87+//modify end+++++++++
88+
89+ case 'block':
90+ $tb = intRequestVar('tb');
91+
92+ $res = mysql_query ("
93+ UPDATE
94+ ".sql_table('plugin_tb')."
95+ SET
96+ block = 1
97+ WHERE
98+ id = '".$tb."'
99+ ");
100+
101+ $action = requestVar('next');
102+ break;
103+ case 'blocked_clear':
104+ $res = mysql_query ("DELETE FROM ".sql_table('plugin_tb')." WHERE block = 1");
105+ $action = requestVar('next');
106+ break;
107+
108+ case 'blocked_spamclear':
109+ $res = mysql_query ("DELETE FROM ".sql_table('plugin_tb')." WHERE block = 1 and spam = 1");
110+ $action = requestVar('next');
111+ break;
112+
113+ case 'unblock':
114+ $tb = intRequestVar('tb');
115+
116+ $res = mysql_query ("
117+ UPDATE
118+ ".sql_table('plugin_tb')."
119+ SET
120+ block = 0
121+ WHERE
122+ id = '".$tb."'
123+ ");
124+
125+ $action = requestVar('next');
126+ break;
127+
128+ case 'delete':
129+ $tb = intRequestVar('tb');
130+
131+ $res = mysql_query ("
132+ DELETE FROM
133+ ".sql_table('plugin_tb')."
134+ WHERE
135+ id = '".$tb."'
136+ ");
137+
138+ $action = requestVar('next');
139+ break;
140+
141+ case 'sendping':
142+ $title = requestVar('title');
143+ $url = requestVar('url');
144+ $excerpt = requestVar('excerpt');
145+ $blog_name = requestVar('blog_name');
146+ $ping_url = requestVar('ping_url');
147+
148+ // No charset conversion needs to be done here, because
149+ // the charset used to receive the info is used to send
150+ // it...
151+
152+ if ($ping_url) {
153+ $error = $oPluginAdmin->plugin->sendPing(0, $title, $url, $excerpt, $blog_name, $ping_url);
154+
155+ if ($error) {
156+ echo '<b>TrackBack Error:' . $error . '</b>';
157+ }
158+ }
159+
160+ $action = requestVar('next');
161+ break;
162+ case 'ping':
163+ $id = intRequestVar('id');
164+
165+ $usePathInfo = ($CONF['URLMode'] == 'pathinfo');
166+ if ($usePathInfo)
167+ @ include($strRel . 'fancyurls.config.php');
168+
169+ global $manager;
170+ $itemData = $manager->getItem($id, 0, 0);
171+
172+ if(is_array($itemData)){
173+ $blog =& $manager->getBlog($itemData['blogid']);
174+ $CONF['ItemURL'] = ($usePathInfo)? preg_replace('/\/$/', '', $blog->getURL()): $blog->getURL();
175+ $itemData['url'] = createItemLink($id);
176+ $itemData['excerpt'] = shorten(strip_tags($itemData['body'].$itemData['more']), 250, '...');
177+ $itemData['blogname'] = $blog->getName();
178+ }else{
179+ $itemData = array();
180+ $itemData['url'] = $CONF['IndexURL'];
181+ $itemData['blogname'] = $CONF['SiteName'];
182+ }
183+ $oTemplate->set('item', $itemData);
184+
185+ $oTemplate->template('templates/ping.html');
186+ break;
187+ }
188+
189+ // Pages
190+ switch($action) {
191+
192+ case 'help':
193+ $oTemplate->template('help.html');
194+ break;
195+
196+ case 'ping':
197+ $oTemplate->template('templates/ping.html');
198+ break;
199+
200+ case 'blocked':
201+ $start = intRequestVar('start') ? intRequestVar('start') : 0;
202+ $amount = intRequestVar('amount') ? intRequestVar('amount') : 25;
203+
204+ $rres = mysql_query ("
205+ SELECT
206+ COUNT(*) AS count
207+ FROM
208+ ".sql_table('plugin_tb')." AS t,
209+ ".sql_table('item')." AS i
210+ WHERE
211+ t.tb_id = i.inumber AND
212+ t.block = 1
213+ ");
214+
215+ if ($row = mysql_fetch_array($rres))
216+ $count = $row['count'];
217+ else
218+ $count = 0;
219+
220+ $rres = mysql_query ("
221+ SELECT
222+ i.ititle AS story,
223+ i.inumber AS story_id,
224+ t.id AS id,
225+ t.title AS title,
226+ t.blog_name AS blog_name,
227+ t.excerpt AS excerpt,
228+ t.url AS url,
229+ -- UNIX_TIMESTAMP(t.timestamp) AS timestamp,
230+ t.timestamp AS timestamp,
231+ t.spam AS spam,
232+ t.link AS link
233+ FROM
234+ ".sql_table('plugin_tb')." AS t,
235+ ".sql_table('item')." AS i
236+ WHERE
237+ t.tb_id = i.inumber AND
238+ t.block = 1
239+ ORDER BY
240+ timestamp DESC
241+ LIMIT
242+ ".$start.",".$amount."
243+ ");
244+
245+ $items = array();
246+
247+ while ($rrow = mysql_fetch_array($rres))
248+ {
249+ $rrow['title'] = $oPluginAdmin->plugin->_cut_string($rrow['title'], 50);
250+ $rrow['title'] = $oPluginAdmin->plugin->_strip_controlchar($rrow['title']);
251+ $rrow['title'] = htmlspecialchars($rrow['title']);
252+// $rrow['title'] = _CHARSET == 'UTF-8' ? $rrow['title'] : $oPluginAdmin->plugin->_utf8_to_entities($rrow['title']);
253+
254+ $rrow['blog_name'] = $oPluginAdmin->plugin->_cut_string($rrow['blog_name'], 50);
255+ $rrow['blog_name'] = $oPluginAdmin->plugin->_strip_controlchar($rrow['blog_name']);
256+ $rrow['blog_name'] = htmlspecialchars($rrow['blog_name']);
257+// $rrow['blog_name'] = _CHARSET == 'UTF-8' ? $rrow['blog_name'] : $oPluginAdmin->plugin->_utf8_to_entities($rrow['blog_name']);
258+
259+ $rrow['excerpt'] = $oPluginAdmin->plugin->_cut_string($rrow['excerpt'], 800);
260+ $rrow['excerpt'] = $oPluginAdmin->plugin->_strip_controlchar($rrow['excerpt']);
261+ $rrow['excerpt'] = htmlspecialchars($rrow['excerpt']);
262+// $rrow['excerpt'] = _CHARSET == 'UTF-8' ? $rrow['excerpt'] : $oPluginAdmin->plugin->_utf8_to_entities($rrow['excerpt']);
263+
264+ $rrow['url'] = htmlspecialchars($rrow['url'], ENT_QUOTES);
265+ $rrow['timestamp'] = htmlspecialchars($rrow['timestamp'], ENT_QUOTES);
266+
267+ $blog = & $manager->getBlog(getBlogIDFromItemID($item['itemid']));
268+ $rrow['story_url'] = $oPluginAdmin->plugin->_createItemLink($rrow['story_id'], $blog);
269+ $rrow['story'] = htmlspecialchars(strip_tags($rrow['story']), ENT_QUOTES);
270+
271+ $items[] = $rrow;
272+ }
273+
274+ $oTemplate->set ('amount', $amount);
275+ $oTemplate->set ('count', $count);
276+ $oTemplate->set ('start', $start);
277+ $oTemplate->set ('items', $items);
278+ $oTemplate->template('templates/blocked.html');
279+ break;
280+
281+ case 'all':
282+ $start = intRequestVar('start') ? intRequestVar('start') : 0;
283+ $amount = intRequestVar('amount') ? intRequestVar('amount') : 25;
284+
285+ $rres = mysql_query ("
286+ SELECT
287+ COUNT(*) AS count
288+ FROM
289+ ".sql_table('plugin_tb')." AS t,
290+ ".sql_table('item')." AS i
291+ WHERE
292+ t.tb_id = i.inumber AND
293+ t.block = 0
294+ ");
295+
296+ if ($row = mysql_fetch_array($rres))
297+ $count = $row['count'];
298+ else
299+ $count = 0;
300+
301+ $rres = mysql_query ("
302+ SELECT
303+ i.ititle AS story,
304+ i.inumber AS story_id,
305+ t.id AS id,
306+ t.title AS title,
307+ t.blog_name AS blog_name,
308+ t.excerpt AS excerpt,
309+ t.url AS url,
310+ UNIX_TIMESTAMP(t.timestamp) AS timestamp
311+ FROM
312+ ".sql_table('plugin_tb')." AS t,
313+ ".sql_table('item')." AS i
314+ WHERE
315+ t.tb_id = i.inumber AND
316+ t.block = 0
317+ ORDER BY
318+ timestamp DESC
319+ LIMIT
320+ ".$start.",".$amount."
321+ ");
322+
323+ $items = array();
324+
325+ while ($rrow = mysql_fetch_array($rres))
326+ {
327+ $rrow['title'] = $oPluginAdmin->plugin->_cut_string($rrow['title'], 50);
328+ $rrow['title'] = $oPluginAdmin->plugin->_strip_controlchar($rrow['title']);
329+ $rrow['title'] = htmlspecialchars($rrow['title']);
330+// $rrow['title'] = _CHARSET == 'UTF-8' ? $rrow['title'] : $oPluginAdmin->plugin->_utf8_to_entities($rrow['title']);
331+
332+ $rrow['blog_name'] = $oPluginAdmin->plugin->_cut_string($rrow['blog_name'], 50);
333+ $rrow['blog_name'] = $oPluginAdmin->plugin->_strip_controlchar($rrow['blog_name']);
334+ $rrow['blog_name'] = htmlspecialchars($rrow['blog_name']);
335+// $rrow['blog_name'] = _CHARSET == 'UTF-8' ? $rrow['blog_name'] : $oPluginAdmin->plugin->_utf8_to_entities($rrow['blog_name']);
336+
337+ $rrow['excerpt'] = $oPluginAdmin->plugin->_cut_string($rrow['excerpt'], 800);
338+ $rrow['excerpt'] = $oPluginAdmin->plugin->_strip_controlchar($rrow['excerpt']);
339+ $rrow['excerpt'] = htmlspecialchars($rrow['excerpt']);
340+// $rrow['excerpt'] = _CHARSET == 'UTF-8' ? $rrow['excerpt'] : $oPluginAdmin->plugin->_utf8_to_entities($rrow['excerpt']);
341+
342+ $rrow['url'] = htmlspecialchars($rrow['url'], ENT_QUOTES);
343+
344+ $blog = & $manager->getBlog(getBlogIDFromItemID($item['itemid']));
345+ $rrow['story_url'] = $oPluginAdmin->plugin->_createItemLink($rrow['story_id'], $blog);
346+ $rrow['story'] = htmlspecialchars(strip_tags($rrow['story']), ENT_QUOTES);
347+
348+ $items[] = $rrow;
349+ }
350+
351+ $oTemplate->set ('amount', $amount);
352+ $oTemplate->set ('count', $count);
353+ $oTemplate->set ('start', $start);
354+ $oTemplate->set ('items', $items);
355+ $oTemplate->template('templates/all.html');
356+ break;
357+
358+ case 'list':
359+ $id = requestVar('id');
360+ $start = intRequestVar('start') ? intRequestVar('start') : 0;
361+ $amount = intRequestVar('amount') ? intRequestVar('amount') : 25;
362+
363+ $ires = mysql_query ("
364+ SELECT
365+ ititle,
366+ inumber
367+ FROM
368+ ".sql_table('item')."
369+ WHERE
370+ inumber = '".$id."'
371+ ");
372+
373+ if ($irow = mysql_fetch_array($ires))
374+ {
375+ $story['id'] = $id;
376+ $story['title'] = $irow['ititle'];
377+
378+ $rres = mysql_query ("
379+ SELECT
380+ COUNT(*) AS count
381+ FROM
382+ ".sql_table('plugin_tb')." AS t
383+ WHERE
384+ t.tb_id = '".$id."' AND
385+ t.block = 0
386+ ");
387+
388+ if ($row = mysql_fetch_array($rres))
389+ $count = $row['count'];
390+ else
391+ $count = 0;
392+
393+ $rres = mysql_query ("
394+ SELECT
395+ t.id AS id,
396+ t.title AS title,
397+ t.blog_name AS blog_name,
398+ t.excerpt AS excerpt,
399+ t.url AS url,
400+ UNIX_TIMESTAMP(t.timestamp) AS timestamp
401+ FROM
402+ ".sql_table('plugin_tb')." AS t
403+ WHERE
404+ t.tb_id = '".$id."' AND
405+ t.block = 0
406+ ORDER BY
407+ timestamp DESC
408+ LIMIT
409+ ".$start.",".$amount."
410+ ");
411+
412+ $items = array();
413+
414+ while ($rrow = mysql_fetch_array($rres))
415+ {
416+ $rrow['title'] = $oPluginAdmin->plugin->_cut_string($rrow['title'], 50);
417+ $rrow['title'] = $oPluginAdmin->plugin->_strip_controlchar($rrow['title']);
418+ $rrow['title'] = htmlspecialchars($rrow['title']);
419+// $rrow['title'] = _CHARSET == 'UTF-8' ? $rrow['title'] : $oPluginAdmin->plugin->_utf8_to_entities($rrow['title']);
420+
421+ $rrow['blog_name'] = $oPluginAdmin->plugin->_cut_string($rrow['blog_name'], 50);
422+ $rrow['blog_name'] = $oPluginAdmin->plugin->_strip_controlchar($rrow['blog_name']);
423+ $rrow['blog_name'] = htmlspecialchars($rrow['blog_name']);
424+// $rrow['blog_name'] = _CHARSET == 'UTF-8' ? $rrow['blog_name'] : $oPluginAdmin->plugin->_utf8_to_entities($rrow['blog_name']);
425+
426+ $rrow['excerpt'] = $oPluginAdmin->plugin->_cut_string($rrow['excerpt'], 800);
427+ $rrow['excerpt'] = $oPluginAdmin->plugin->_strip_controlchar($rrow['excerpt']);
428+ $rrow['excerpt'] = htmlspecialchars($rrow['excerpt']);
429+// $rrow['excerpt'] = _CHARSET == 'UTF-8' ? $rrow['excerpt'] : $oPluginAdmin->plugin->_utf8_to_entities($rrow['excerpt']);
430+
431+ $rrow['url'] = htmlspecialchars($rrow['url'], ENT_QUOTES);
432+ $rrow['story'] = htmlspecialchars(strip_tags($rrow['story']), ENT_QUOTES);
433+ $items[] = $rrow;
434+ }
435+
436+ $oTemplate->set ('amount', $amount);
437+ $oTemplate->set ('count', $count);
438+ $oTemplate->set ('start', $start);
439+ $oTemplate->set ('items', $items);
440+ $oTemplate->set ('story', $story);
441+ $oTemplate->template('templates/list.html');
442+ }
443+
444+ break;
445+
446+
447+ case 'index':
448+ $bres = mysql_query ("
449+ SELECT
450+ bnumber AS bnumber,
451+ bname AS bname,
452+ burl AS burl
453+ FROM
454+ ".sql_table('blog')."
455+ ORDER BY
456+ bname
457+ ");
458+
459+ $blogs = array();
460+
461+ while ($brow = mysql_fetch_array($bres))
462+ {
463+ $ires = mysql_query ("
464+ SELECT
465+ i.inumber AS inumber,
466+ i.ititle AS ititle,
467+ COUNT(*) AS total
468+ FROM
469+ ".sql_table('item')." AS i,
470+ ".sql_table('plugin_tb')." AS t
471+ WHERE
472+ i.iblog = ".$brow['bnumber']." AND
473+ t.tb_id = i.inumber AND
474+ t.block = 0
475+ GROUP BY
476+ i.inumber
477+ ORDER BY
478+ i.inumber DESC
479+ ");
480+
481+ $items = array();
482+
483+ while ($irow = mysql_fetch_array($ires))
484+ {
485+ $items[] = $irow;
486+ }
487+
488+ $brow['items'] = $items;
489+ $blogs[] = $brow;
490+ }
491+
492+ $oTemplate->set ('blogs', $blogs);
493+ $oTemplate->template('templates/index.html');
494+ break;
495+
496+ default:
497+ //modify start+++++++++
498+ if(!$tableVersion){
499+ $oTemplate->template('templates/updatetable.html');
500+ }
501+ //modify end+++++++++
502+ break;
503+ }
504+
505+ // Create the admin area page
506+ echo $oTemplate->fetch();
507+ $oPluginAdmin->end();
508+
509+?>
--- /dev/null
+++ b/trunk/NP_TrackBack/trackback/japanese-euc.help.html
@@ -0,0 +1,143 @@
1+<h2>ヘルプ</h2>
2+
3+
4+<h3>スキンへの記述例</h3>
5+
6+<p>
7+ <h4>&lt;%TrackBack(list)%&gt;</h4>
8+</p>
9+<p>
10+ 受け取ったトラックバックの一覧を表示します。<br />
11+ また、 <strong>&lt;%TrackBack(list,12)%&gt;</strong>のようにパラメータの2つめに記事idをつけると、その記事idにpingされたトラックバックの一覧を埋め込むことも可能です。<br />一覧表示のデザイン(テンプレート)は、プラグインのオプション(編集)画面にてカスタマイズできます。</p>
12+
13+<p>
14+ <h4>&lt;%TrackBack(list)%&gt;</h4>
15+</p>
16+<p>
17+ 受け取ったトラックバックの一覧を表示します。<br />
18+ また、 <strong>&lt;%TrackBack(list,12)%&gt;</strong>のようにパラメータの2つめに記事idをつけると、その記事idにpingされたトラックバックの一覧を埋め込むことも可能です。<br />一覧表示のデザイン(テンプレート)は、プラグインのオプション(編集)画面にてカスタマイズできます。
19+</p>
20+<p>
21+ デフォルトではすべてのトラックバックが表示されるようになっていますが、多数のトラックバックがあるような場合には最新のものだけを表示して、残りの部分を折りたたむことができます。<br />
22+<br />
23+・最新の5件だけを表示して、あとは折りたたむ場合<br />
24+<strong>&lt;%TrackBack(list, limit5)%&gt;</strong><br />
25+<br />
26+・1.x系と同じようにすべてのトラックバックを展開する場合(デフォルト)<br />
27+<strong>&lt;%TrackBack(list, limit-1)%&gt;</strong><br />
28+<br />
29+・すべてのトラックバックを折りたたんだ状態にする場合<br />
30+<strong>&lt;%TrackBack(list, limit0)%&gt;</strong><br />
31+</p>
32+<p>
33+ 記事idの指定とと折りたたみを同時に使う場合には<strong>&lt;%TrackBack(list,<em>記事id</em>,<em>limit0</em>)%&gt;</strong>のように指定します。
34+</p>
35+
36+<p>
37+ <h4>&lt;%TrackBack(form)%&gt;</h4>
38+</p>
39+<p>
40+ 手動でトラックバックを受け付ける入力フォームページへのリンクurlを表示します。<br />
41+ リンク先ページで相手側にトラックバック送信機能がない場合でも記事要約とurlを受け付けることができるようになります。<br /><br />
42+ <blockquote>便利な使い方としては、このプラグインのオプション(編集)画面にてトラックバック表示専用テンプレートの「フッタ」の所に、
43+ <pre>この記事への手動トラックバックは
44+&lt;a href='&lt;%form%&gt;' onclick='window.open(this.href,
45+"trackback", "scrollbars=yes,width=600,height=340,left=10,top=10,status=yes,resizable=yes");
46+ return false;'&gt;こちらのフォーム&lt;/a&gt;からどうぞ。
47+</pre>
48+ と書き足しておくと、上記<strong>&lt;%TrackBack(list)%&gt;</strong>を書いた箇所に自動的にこの手動pingフォームへのリンクが表示され、手動pingフォームがポップアップするようにできます。<br />
49+ もちろん、テンプレートに<strong>&lt;%form%&gt;</strong>を埋め込まずに、スキンの別の場所に個別に&lt;a href='&lt;%TrackBack(form)%&gt;&lt;/a&gt;と書いても(書かなくても)結構です。</blockquote>
50+
51+</p>
52+
53+<p>
54+ <h4>&lt;%TrackBack(url)%&gt;</h4>
55+</p>
56+<p>
57+ いわゆるトラックバックURL(相手側から見たping先)を表示します。<br />
58+ また、このプラグインのオプション(編集)画面にて設定できるトラックバック表示専用テンプレート内には<strong>&lt;%action%&gt;</strong>と書き込むと、トラックバックurlに変換されます。<br />
59+ <blockquote>例えば、トラックバック表示専用テンプレートの「フッタ」の所に、
60+ <pre>この記事へのトラックバックurl:&lt;a href='&lt;%action%&gt;'&gt;&lt;%action%&gt;&lt;/a&gt;
61+(右クリックでショートカットのコピーをご利用ください)
62+</pre>
63+ と書いておけば、個別に<strong>&lt;%TrackBack(url)%&gt;</strong>をスキンに書き込まなくても<strong>&lt;%TrackBack(list)%&gt;</strong>を書いた場所に表示されます。</blockquote>
64+</p>
65+
66+<h3>テンプレート内の記述例</h3>
67+
68+<p>
69+ ※上記のスキン記述例はすべてテンプレート内でも使用できます。
70+</p>
71+
72+<p>
73+ <h4>&lt;%TrackBack(count)%&gt;</h4>
74+</p>
75+<p>
76+ 記事ごとの何件トラックバック件数を表示します。<br />
77+ デフォルトでは"No Trackbacks",
78+ "1 Trackback", "2 Trackbacks",のように表示されます。<br />
79+ プラグインのオプション(編集)画面にて設定してください。
80+</p>
81+
82+
83+<h3>表示のカスタマイズ</h3>
84+
85+<p>
86+ トラックバック関連の表示方法はテンプレートを編集することによってカスタマイズできますが、色や余白などのデザインはCSS側で指定する必要があります。テンプレート内に入力したクラス名のプロパティはcssで指定してください。デフォルトのテンプレートを飾るCSSプロパティの例をあげておきます。
87+</p>
88+
89+<pre>div.tb {
90+ border: 1px solid #000; background: #FFF;
91+}
92+div.tb div.head {
93+ padding: 4px;
94+ background: #000; color: #FFF;
95+ font-weight: bold; text-transform: lowercase; letter-spacing: 0.6em;
96+}
97+div.tb div.empty {
98+ padding: 4px;
99+ font-size: 95%;
100+}
101+div.tb div.item {
102+ padding: 4px;
103+}
104+div.tb div.item div.name {
105+ margin-bottom: 8px;
106+ font-size: 120%; font-weight: bold;
107+}
108+div.tb div.item div.body {
109+ font-size: 95%;
110+}
111+div.tb div.item div.body a {
112+ font-weight: bold;
113+}
114+div.tb div.item div.date {
115+ margin-bottom: 8px;
116+ color: #888;
117+ font-size: 85%; text-align: right;
118+}
119+div.tb div.info {
120+ padding: 4px;
121+ color: #FFF; background: #888;
122+ font-size: 85%; font-style: italic;
123+}</pre>
124+
125+<h3>日本語版更新履歴</h3>
126+
127+<ul>
128+ <li>Version 2.0.3jp6 : (2006/09/30)</li>
129+ <li> [Fixed] セキュリティの向上</li>
130+
131+ <li>Version 2.0.3jp5 : (2006/09/16)</li>
132+ <li> [Fixed] getPermaLinksFromText()内のURL抽出ルーチンの不具合を修正</li>
133+ <li> [Fixed] Auto-Discovery時にSQLエラーが出る不具合を修正</li>
134+ <li> [Fixed] 管理画面でパースエラーが出る場合がある不具合を修正</li>
135+ <li> [Changed] SQLのクォートを"から'に変更</li>
136+ <li> [Fixed] mb_emulator環境にてエラーが出る問題を修正</li>
137+ <li> [Fixed] curlが有効な環境でエラーが出る問題を修正</li>
138+
139+ <li>Version 2.0.3jp4 : (2006/07/15)</li>
140+ <li> [Added] AutoDiscoveryURL出力時にSpamCheckを行うようにした</li>
141+ <li> [Added] メッセージ、デフォルト値を日本語化</li>
142+ <li> [Added] 大手ASPの言及トラックバックチェックの際にURLのリダイレクトを解除するようにした</li>
143+</ul>
\ No newline at end of file
--- /dev/null
+++ b/trunk/NP_TrackBack/trackback/japanese-euc.templates/all.html
@@ -0,0 +1,104 @@
1+<h2>
2+ All trackbacks
3+ <?php if ($count > $amount): ?>
4+ (Page <?php echo ceil($start / $amount) + 1;?> of <?php echo ceil($count / $amount);?>)
5+ <?php endif; ?>
6+</h2>
7+
8+<?php if(count($items)): ?>
9+<?php if ($count > $amount): ?>
10+<table class="navigation">
11+ <tr>
12+ <td style='padding: 0;'>
13+ <?php if ($start > 0): ?>
14+ <form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
15+ <div>
16+ <input type="submit" value="&lt;&lt; Previous" />
17+ <input type="hidden" name="action" value="all" />
18+ <input type="hidden" name="start" value="<?php echo max(0,$start - $amount);?>" />
19+ </div>
20+ </form>
21+ <?php endif; ?>
22+ </td>
23+ <td style='padding: 0; text-align: right;'>
24+ <?php if ($start + $amount < $count): ?>
25+ <form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
26+ <div>
27+ <input type="submit" value="Next &gt; &gt;" />
28+ <input type="hidden" name="action" value="all" />
29+ <input type="hidden" name="start" value="<?php echo ($start + $amount);?>" />
30+ </div>
31+ </form>
32+ <?php endif; ?>
33+ </td>
34+ </tr>
35+</table>
36+<?php endif; ?>
37+
38+<table>
39+ <thead>
40+ <tr>
41+ <th>Story</th>
42+ <th>Title, Blog and Excerpt</th>
43+ <th>Date</th>
44+ <th colspan='3'>Actions</th>
45+ </tr>
46+ </thead>
47+ <tbody>
48+ <?php while (list(,$item) = each ($items)): ?>
49+ <tr onmouseover='focusRow(this);' onmouseout='blurRow(this);'>
50+ <td>
51+ <a href="<? echo $item['story_url']; ?>"><?php echo $item['story'];?></a>
52+ </td>
53+ <td>
54+ <strong><?php echo $item['title'];?></strong>
55+ <em>(<?php echo $item['blog_name'];?>)</em><br />
56+ <?php echo $item['excerpt'];?>
57+ </td>
58+ <td>
59+ <?php echo str_replace(' ', '&nbsp;', date("Y-m-d @ H:i",$item['timestamp']));?>
60+ </td>
61+ <td>
62+ <a href='<?php echo $item['url'];?>'>Visit</a>
63+ </td>
64+ <td>
65+ <a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=block&amp;tb=<?php echo $item['id'];?>&amp;next=all&amp;start=<?php echo $start;?>'>Block</a>
66+ </td>
67+ <td>
68+ <a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=delete&amp;tb=<?php echo $item['id'];?>&amp;next=all&amp;start=<?php echo $start;?>'>Delete</a>
69+ </td>
70+ </tr>
71+ <?php endwhile; ?>
72+ </tbody>
73+</table>
74+
75+<?php if ($count > $amount): ?>
76+<table class="navigation">
77+ <tr>
78+ <td style='padding: 0;'>
79+ <?php if ($start > 0): ?>
80+ <form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
81+ <div>
82+ <input type="submit" value="&lt;&lt; Previous" />
83+ <input type="hidden" name="action" value="all" />
84+ <input type="hidden" name="start" value="<?php echo max(0,$start - $amount);?>" />
85+ </div>
86+ </form>
87+ <?php endif; ?>
88+ </td>
89+ <td style='padding: 0; text-align: right;'>
90+ <?php if ($start + $amount < $count): ?>
91+ <form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
92+ <div>
93+ <input type="submit" value="Next &gt; &gt;" />
94+ <input type="hidden" name="action" value="all" />
95+ <input type="hidden" name="start" value="<?php echo ($start + $amount);?>" />
96+ </div>
97+ </form>
98+ <?php endif; ?>
99+ </td>
100+ </tr>
101+</table>
102+<?php endif; ?>
103+<?php endif; ?>
104+
--- /dev/null
+++ b/trunk/NP_TrackBack/trackback/japanese-euc.templates/blocked.html
@@ -0,0 +1,121 @@
1+<h2>
2+ ブロックされたトラックバック
3+ <?php if ($count > $amount): ?>
4+ (Page <?php echo ceil($start / $amount) + 1;?> of <?php echo ceil($count / $amount);?>)
5+ <?php endif; ?>
6+</h2>
7+
8+<ul>
9+ <li><a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=blocked_clear&amp;next=blocked'>ブロックされたトラックバックのクリア</a></li>
10+ <li><a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=blocked_spamclear&amp;next=blocked'>spam判定されたトラックバックのクリア</a></li>
11+</ul>
12+
13+<?php if(count($items)): ?>
14+<?php if ($count > $amount): ?>
15+<table class="navigation">
16+ <tr>
17+ <td style='padding: 0;'>
18+ <?php if ($start > 0): ?>
19+ <form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
20+ <div>
21+ <input type="submit" value="&lt;&lt; Previous" />
22+ <input type="hidden" name="action" value="blocked" />
23+ <input type="hidden" name="start" value="<?php echo max(0,$start - $amount);?>" />
24+ </div>
25+ </form>
26+ <?php endif; ?>
27+ </td>
28+ <td style='padding: 0; text-align: right;'>
29+ <?php if ($start + $amount < $count): ?>
30+ <form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
31+ <div>
32+ <input type="submit" value="Next &gt; &gt;" />
33+ <input type="hidden" name="action" value="blocked" />
34+ <input type="hidden" name="start" value="<?php echo ($start + $amount);?>" />
35+ </div>
36+ </form>
37+ <?php endif; ?>
38+ </td>
39+ </tr>
40+</table>
41+<?php endif; ?>
42+
43+<table>
44+ <thead>
45+ <tr>
46+ <th>Date</th>
47+ <th>Story</th>
48+ <th>Title, Blog and Excerpt</th>
49+ <th>Spam?</th>
50+ <th>Link?</th>
51+ <th colspan='3'>Actions</th>
52+ </tr>
53+ </thead>
54+ <tbody>
55+ <?php while (list(,$item) = each ($items)): ?>
56+ <tr onmouseover='focusRow(this);' onmouseout='blurRow(this);'>
57+ <td>
58+ <?php echo $item['timestamp'];?>
59+ </td>
60+ <td>
61+ <a href="<? echo $item['story_url']; ?>"><?php echo $item['story'];?></a>
62+ </td>
63+ <td>
64+ <strong><?php echo $item['title'];?></strong>
65+ <em>(<?php echo $item['blog_name'];?>)</em><br />
66+ <?php echo $item['excerpt'];?>
67+ </td>
68+ <td>
69+ <?php echo $item['spam'] ?
70+ '<span style="color: darkred;">Yes</span>' :
71+ '<span style="color: darkgreen;">No</span>';?>
72+ </td>
73+ <td>
74+ <?php echo $item['link'] ?
75+ '<span style="color: darkgreen;">Yes</span>' :
76+ '<span style="color: darkred;">No</span>';?>
77+ </td>
78+ <td>
79+ <a href='<?php echo $item['url'];?>'>Visit</a>
80+ </td>
81+ <td>
82+ <a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=unblock&amp;tb=<?php echo $item['id'];?>&amp;next=blocked&amp;start=<?php echo $start;?>'>Unblock</a>
83+ </td>
84+ <td>
85+ <a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=delete&amp;tb=<?php echo $item['id'];?>&amp;next=blocked&amp;start=<?php echo $start;?>'>Delete</a>
86+ </td>
87+ </tr>
88+ <?php endwhile; ?>
89+ </tbody>
90+</table>
91+
92+<?php if ($count > $amount): ?>
93+<table class="navigation">
94+ <tr>
95+ <td style='padding: 0;'>
96+ <?php if ($start > 0): ?>
97+ <form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
98+ <div>
99+ <input type="submit" value="&lt;&lt; Previous" />
100+ <input type="hidden" name="action" value="blocked" />
101+ <input type="hidden" name="start" value="<?php echo max(0,$start - $amount);?>" />
102+ </div>
103+ </form>
104+ <?php endif; ?>
105+ </td>
106+ <td style='padding: 0; text-align: right;'>
107+ <?php if ($start + $amount < $count): ?>
108+ <form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
109+ <div>
110+ <input type="submit" value="Next &gt; &gt;" />
111+ <input type="hidden" name="action" value="blocked" />
112+ <input type="hidden" name="start" value="<?php echo ($start + $amount);?>" />
113+ </div>
114+ </form>
115+ <?php endif; ?>
116+ </td>
117+ </tr>
118+</table>
119+<?php endif; ?>
120+<?php endif; ?>
121+
--- /dev/null
+++ b/trunk/NP_TrackBack/trackback/japanese-euc.templates/form.html
@@ -0,0 +1,56 @@
1+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2+<html>
3+ <head>
4+ <title>TrackBackの手動送信</title>
5+ <link rel="stylesheet" type="text/css" href="<?php echo $CONF['AdminURL']?>styles/bookmarklet.css" />
6+ </head>
7+
8+ <body>
9+ <h1>TrackBackの手動送信</h1>
10+<?php if ($success): ?>
11+ <p>
12+ <strong>トラックバックの送信が完了しました</strong>
13+ </p>
14+<?php endif; ?>
15+<?php if ($error): ?>
16+ <p>
17+ <strong><?php echo $status; ?></strong>
18+ </p>
19+<?php endif; ?>
20+<?php if ($form): ?>
21+ <form method="post" action="<?php echo $CONF['ActionURL'] ?>">
22+
23+ <div>
24+ <input type="hidden" name="tb_id" value="<?php echo $itemid;?>" />
25+ <input type="hidden" name="action" value="plugin" />
26+ <input type="hidden" name="name" value="TrackBack" />
27+ <input type="hidden" name="type" value="ping" />
28+
29+ <table>
30+ <tr>
31+ <td>あなたの記事のurl</td>
32+ <td><input type="text" value="" name="url" size="60" /></td>
33+ </tr>
34+ <tr>
35+ <td>記事のタイトル</td>
36+ <td><input type="text" value="" name="title" size="60" /></td>
37+ </tr>
38+ <tr>
39+ <td>記事の要約文</td>
40+ <td><textarea name="excerpt" cols="40" rows="5"></textarea></td>
41+ </tr>
42+ <tr>
43+ <td>あなたのblogの名前</td>
44+ <td><input type="text" value="" name="blog_name" size="60" /></td>
45+ </tr>
46+ <tr>
47+ <td>トラックバック送信</td>
48+ <td><input type="submit" value="トラックバックを送信する" /></td>
49+ </tr>
50+ </table>
51+ </div>
52+
53+ </form>
54+<?php endif; ?>
55+ </body>
56+</html>
\ No newline at end of file
--- /dev/null
+++ b/trunk/NP_TrackBack/trackback/japanese-euc.templates/index.html
@@ -0,0 +1,35 @@
1+<h2>Overview of all items</h2>
2+
3+<?php if(count($blogs)): ?>
4+
5+<table>
6+<?php while (list(,$blog) = each ($blogs)): ?>
7+<?php if(count($blog['items'])): ?>
8+ <thead>
9+ <tr>
10+ <th>Blog: <?php echo htmlspecialchars($blog['bname']);?></th>
11+ <th>Total</th>
12+ <th>Action</th>
13+ </tr>
14+ </thead>
15+ <tbody>
16+ <?php while (list(,$item) = each ($blog['items'])): ?>
17+ <tr onmouseover='focusRow(this);' onmouseout='blurRow(this);'>
18+ <td>
19+ <?php echo $item['ititle'];?>
20+ </td>
21+ <td>
22+ <?php echo htmlspecialchars($item['total']);?>
23+ </td>
24+ <td>
25+ <a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=list&amp;id=<?php echo $item['inumber'];?>'>Trackbacks</a>
26+ </td>
27+ </tr>
28+ <?php endwhile; ?>
29+ </tbody>
30+<?php endif; ?>
31+<?php endwhile; ?>
32+</table>
33+<?php endif; ?>
34+
35+
--- /dev/null
+++ b/trunk/NP_TrackBack/trackback/japanese-euc.templates/list.html
@@ -0,0 +1,104 @@
1+<h2>
2+ All trackbacks for &quot;<?php echo $story['title'];?>&quot;
3+ <?php if ($count > $amount): ?>
4+ (Page <?php echo ceil($start / $amount) + 1;?> of <?php echo ceil($count / $amount);?>)
5+ <?php endif; ?>
6+</h2>
7+
8+<?php if(count($items)): ?>
9+<?php if ($count > $amount): ?>
10+<table class="navigation">
11+ <tr>
12+ <td style='padding: 0;'>
13+ <?php if ($start > 0): ?>
14+ <form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
15+ <div>
16+ <input type="submit" value="&lt;&lt; Previous" />
17+ <input type="hidden" name="action" value="list" />
18+ <input type="hidden" name="id" value="<?php echo $story['id'];?>" />
19+ <input type="hidden" name="start" value="<?php echo max(0,$start - $amount);?>" />
20+ </div>
21+ </form>
22+ <?php endif; ?>
23+ </td>
24+ <td style='padding: 0; text-align: right;'>
25+ <?php if ($start + $amount < $count): ?>
26+ <form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
27+ <div>
28+ <input type="submit" value="Next &gt; &gt;" />
29+ <input type="hidden" name="action" value="list" />
30+ <input type="hidden" name="id" value="<?php echo $story['id'];?>" />
31+ <input type="hidden" name="start" value="<?php echo ($start + $amount);?>" />
32+ </div>
33+ </form>
34+ <?php endif; ?>
35+ </td>
36+ </tr>
37+</table>
38+<?php endif; ?>
39+
40+<table>
41+ <thead>
42+ <tr>
43+ <th>Title, Blog and Excerpt</th>
44+ <th>Date</th>
45+ <th colspan='3'>Actions</th>
46+ </tr>
47+ </thead>
48+ <tbody>
49+ <?php while (list(,$item) = each ($items)): ?>
50+ <tr onmouseover='focusRow(this);' onmouseout='blurRow(this);'>
51+ <td>
52+ <strong><?php echo $item['title'];?></strong>
53+ <em>(<?php echo $item['blog_name'];?>)</em><br />
54+ <?php echo $item['excerpt'];?>
55+ </td>
56+ <td>
57+ <?php echo str_replace(' ', '&nbsp;', date("Y-m-d @ H:i",$item['timestamp']));?>
58+ </td>
59+ <td>
60+ <a href='<?php echo $item['url'];?>'>Visit</a>
61+ </td>
62+ <td>
63+ <a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=block&amp;tb=<?php echo $item['id'];?>&amp;next=list&amp;id=<?php echo $story['id'];?>&amp;start=<?php echo $start;?>'>Block</a>
64+ </td>
65+ <td>
66+ <a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=delete&amp;tb=<?php echo $item['id'];?>&amp;next=list&amp;id=<?php echo $story['id'];?>&amp;start=<?php echo $start;?>'>Delete</a>
67+ </td>
68+ </tr>
69+ <?php endwhile; ?>
70+ </tbody>
71+</table>
72+
73+<?php if ($count > $amount): ?>
74+<table class="navigation">
75+ <tr>
76+ <td style='padding: 0;'>
77+ <?php if ($start > 0): ?>
78+ <form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
79+ <div>
80+ <input type="submit" value="&lt;&lt; Previous" />
81+ <input type="hidden" name="action" value="list" />
82+ <input type="hidden" name="id" value="<?php echo $story['id'];?>" />
83+ <input type="hidden" name="start" value="<?php echo max(0,$start - $amount);?>" />
84+ </div>
85+ </form>
86+ <?php endif; ?>
87+ </td>
88+ <td style='padding: 0; text-align: right;'>
89+ <?php if ($start + $amount < $count): ?>
90+ <form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
91+ <div>
92+ <input type="submit" value="Next &gt; &gt;" />
93+ <input type="hidden" name="action" value="list" />
94+ <input type="hidden" name="id" value="<?php echo $story['id'];?>" />
95+ <input type="hidden" name="start" value="<?php echo ($start + $amount);?>" />
96+ </div>
97+ </form>
98+ <?php endif; ?>
99+ </td>
100+ </tr>
101+</table>
102+<?php endif; ?>
103+<?php endif; ?>
104+
--- /dev/null
+++ b/trunk/NP_TrackBack/trackback/japanese-euc.templates/menu.html
@@ -0,0 +1,11 @@
1+
2+<h2>Trackback</h2>
3+
4+<ul>
5+ <li><a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=index'>Overview of all items</a></li>
6+ <li><a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=all'>トラックバックの全データ</a></li>
7+ <li><a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=blocked'>ブロックされたトラックバック</a></li>
8+ <li><a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=ping'>手動ping</a></li>
9+ <li><a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=help'>ヘルプ</a></li>
10+ <li><a href='<?php echo $CONF['AdminURL'];?>index.php?action=pluginoptions&amp;plugid=<?php echo $plugid;?>'>プラグインオプション設定</a></li>
11+</ul>
\ No newline at end of file
--- /dev/null
+++ b/trunk/NP_TrackBack/trackback/japanese-euc.templates/ping.html
@@ -0,0 +1,48 @@
1+<h2>手動pingフォーム</h2>
2+
3+<form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
4+
5+ <input type="hidden" name="action" value="sendping" />
6+ <input type="hidden" name="next" value="ping" />
7+
8+ <table>
9+ <tr>
10+ <th colspan='2'>手動ping</th>
11+ </tr>
12+ <tr>
13+ <td>あなたのurl</td>
14+ <td>
15+ <input type="text" name="url" size="60" value="<?php echo htmlspecialchars($item['url']);?>" />
16+ </td>
17+ </tr>
18+ <tr>
19+ <td>記事のタイトル</td>
20+ <td>
21+ <input type="text" name="title" size="60" value="<?php echo htmlspecialchars($item['title']);?>" />
22+ </td>
23+ </tr>
24+ <tr>
25+ <td>記事の要約文</td>
26+ <td>
27+ <textarea name="excerpt" cols="40" rows="5"><?php echo $item['excerpt'];?></textarea>
28+ </td>
29+ </tr>
30+ <tr>
31+ <td>Blog名</td>
32+ <td>
33+ <input type="text" name="blog_name" size="60" value="<?php echo htmlspecialchars($item['blogname']);?>" />
34+ </td>
35+ </tr>
36+ <tr>
37+ <td>ping先url</td>
38+ <td>
39+ <input type="text" value="" name="ping_url" size="60" />
40+ </td>
41+ </tr>
42+ <tr>
43+ <td>送信</td>
44+ <td><input type="submit" value="送信" /></td>
45+ </tr>
46+ </table>
47+
48+</form>
\ No newline at end of file
--- /dev/null
+++ b/trunk/NP_TrackBack/trackback/japanese-euc.templates/updatetable.html
@@ -0,0 +1,11 @@
1+<blockquote style="color: red;border:1px solid red;padding:1em;"><b>アップデートが必要です:</b><br />
2+このバージョンで運用するためにはDB内のテーブルのアップデートが必要です。<br />
3+今までのデータが削除されることはありません。
4+下のアップデートボタンを押してください。
5+
6+ <form method="post"><div>
7+ <input type="hidden" name="action" value="tableUpgrade" />
8+ <input type="submit" tabindex="10" value="upgrade table" />
9+ </div></form>
10+</blockquote>
11+
--- /dev/null
+++ b/trunk/NP_TrackBack/trackback/japanese-euc.templates/updatetablefinished.html
@@ -0,0 +1,4 @@
1+<blockquote style="color: red;border:1px solid red;padding:1em;">
2+テーブルのアップデートは完了しました。
3+</blockquote>
4+
--- /dev/null
+++ b/trunk/NP_TrackBack/trackback/japanese-utf8.help.html
@@ -0,0 +1,143 @@
1+<h2>ヘルプ</h2>
2+
3+
4+<h3>スキンへの記述例</h3>
5+
6+<p>
7+ <h4>&lt;%TrackBack(list)%&gt;</h4>
8+</p>
9+<p>
10+ 受け取ったトラックバックの一覧を表示します。<br />
11+ また、 <strong>&lt;%TrackBack(list,12)%&gt;</strong>のようにパラメータの2つめに記事idをつけると、その記事idにpingされたトラックバックの一覧を埋め込むことも可能です。<br />一覧表示のデザイン(テンプレート)は、プラグインのオプション(編集)画面にてカスタマイズできます。</p>
12+
13+<p>
14+ <h4>&lt;%TrackBack(list)%&gt;</h4>
15+</p>
16+<p>
17+ 受け取ったトラックバックの一覧を表示します。<br />
18+ また、 <strong>&lt;%TrackBack(list,12)%&gt;</strong>のようにパラメータの2つめに記事idをつけると、その記事idにpingされたトラックバックの一覧を埋め込むことも可能です。<br />一覧表示のデザイン(テンプレート)は、プラグインのオプション(編集)画面にてカスタマイズできます。
19+</p>
20+<p>
21+ デフォルトではすべてのトラックバックが表示されるようになっていますが、多数のトラックバックがあるような場合には最新のものだけを表示して、残りの部分を折りたたむことができます。<br />
22+<br />
23+・最新の5件だけを表示して、あとは折りたたむ場合<br />
24+<strong>&lt;%TrackBack(list, limit5)%&gt;</strong><br />
25+<br />
26+・1.x系と同じようにすべてのトラックバックを展開する場合(デフォルト)<br />
27+<strong>&lt;%TrackBack(list, limit-1)%&gt;</strong><br />
28+<br />
29+・すべてのトラックバックを折りたたんだ状態にする場合<br />
30+<strong>&lt;%TrackBack(list, limit0)%&gt;</strong><br />
31+</p>
32+<p>
33+ 記事idの指定とと折りたたみを同時に使う場合には<strong>&lt;%TrackBack(list,<em>記事id</em>,<em>limit0</em>)%&gt;</strong>のように指定します。
34+</p>
35+
36+<p>
37+ <h4>&lt;%TrackBack(form)%&gt;</h4>
38+</p>
39+<p>
40+ 手動でトラックバックを受け付ける入力フォームページへのリンクurlを表示します。<br />
41+ リンク先ページで相手側にトラックバック送信機能がない場合でも記事要約とurlを受け付けることができるようになります。<br /><br />
42+ <blockquote>便利な使い方としては、このプラグインのオプション(編集)画面にてトラックバック表示専用テンプレートの「フッタ」の所に、
43+ <pre>この記事への手動トラックバックは
44+&lt;a href='&lt;%form%&gt;' onclick='window.open(this.href,
45+"trackback", "scrollbars=yes,width=600,height=340,left=10,top=10,status=yes,resizable=yes");
46+ return false;'&gt;こちらのフォーム&lt;/a&gt;からどうぞ。
47+</pre>
48+ と書き足しておくと、上記<strong>&lt;%TrackBack(list)%&gt;</strong>を書いた箇所に自動的にこの手動pingフォームへのリンクが表示され、手動pingフォームがポップアップするようにできます。<br />
49+ もちろん、テンプレートに<strong>&lt;%form%&gt;</strong>を埋め込まずに、スキンの別の場所に個別に&lt;a href='&lt;%TrackBack(form)%&gt;&lt;/a&gt;と書いても(書かなくても)結構です。</blockquote>
50+
51+</p>
52+
53+<p>
54+ <h4>&lt;%TrackBack(url)%&gt;</h4>
55+</p>
56+<p>
57+ いわゆるトラックバックURL(相手側から見たping先)を表示します。<br />
58+ また、このプラグインのオプション(編集)画面にて設定できるトラックバック表示専用テンプレート内には<strong>&lt;%action%&gt;</strong>と書き込むと、トラックバックurlに変換されます。<br />
59+ <blockquote>例えば、トラックバック表示専用テンプレートの「フッタ」の所に、
60+ <pre>この記事へのトラックバックurl:&lt;a href='&lt;%action%&gt;'&gt;&lt;%action%&gt;&lt;/a&gt;
61+(右クリックでショートカットのコピーをご利用ください)
62+</pre>
63+ と書いておけば、個別に<strong>&lt;%TrackBack(url)%&gt;</strong>をスキンに書き込まなくても<strong>&lt;%TrackBack(list)%&gt;</strong>を書いた場所に表示されます。</blockquote>
64+</p>
65+
66+<h3>テンプレート内の記述例</h3>
67+
68+<p>
69+ ※上記のスキン記述例はすべてテンプレート内でも使用できます。
70+</p>
71+
72+<p>
73+ <h4>&lt;%TrackBack(count)%&gt;</h4>
74+</p>
75+<p>
76+ 記事ごとの何件トラックバック件数を表示します。<br />
77+ デフォルトでは"No Trackbacks",
78+ "1 Trackback", "2 Trackbacks",のように表示されます。<br />
79+ プラグインのオプション(編集)画面にて設定してください。
80+</p>
81+
82+
83+<h3>表示のカスタマイズ</h3>
84+
85+<p>
86+ トラックバック関連の表示方法はテンプレートを編集することによってカスタマイズできますが、色や余白などのデザインはCSS側で指定する必要があります。テンプレート内に入力したクラス名のプロパティはcssで指定してください。デフォルトのテンプレートを飾るCSSプロパティの例をあげておきます。
87+</p>
88+
89+<pre>div.tb {
90+ border: 1px solid #000; background: #FFF;
91+}
92+div.tb div.head {
93+ padding: 4px;
94+ background: #000; color: #FFF;
95+ font-weight: bold; text-transform: lowercase; letter-spacing: 0.6em;
96+}
97+div.tb div.empty {
98+ padding: 4px;
99+ font-size: 95%;
100+}
101+div.tb div.item {
102+ padding: 4px;
103+}
104+div.tb div.item div.name {
105+ margin-bottom: 8px;
106+ font-size: 120%; font-weight: bold;
107+}
108+div.tb div.item div.body {
109+ font-size: 95%;
110+}
111+div.tb div.item div.body a {
112+ font-weight: bold;
113+}
114+div.tb div.item div.date {
115+ margin-bottom: 8px;
116+ color: #888;
117+ font-size: 85%; text-align: right;
118+}
119+div.tb div.info {
120+ padding: 4px;
121+ color: #FFF; background: #888;
122+ font-size: 85%; font-style: italic;
123+}</pre>
124+
125+<h3>日本語版更新履歴</h3>
126+
127+<ul>
128+ <li>Version 2.0.3jp6 : (2006/09/30)</li>
129+ <li> [Fixed] セキュリティの向上</li>
130+
131+ <li>Version 2.0.3jp5 : (2006/09/16)</li>
132+ <li> [Fixed] getPermaLinksFromText()内のURL抽出ルーチンの不具合を修正</li>
133+ <li> [Fixed] Auto-Discovery時にSQLエラーが出る不具合を修正</li>
134+ <li> [Fixed] 管理画面でパースエラーが出る場合がある不具合を修正</li>
135+ <li> [Changed] SQLのクォートを"から'に変更</li>
136+ <li> [Fixed] mb_emulator環境にてエラーが出る問題を修正</li>
137+ <li> [Fixed] curlが有効な環境でエラーが出る問題を修正</li>
138+
139+ <li>Version 2.0.3jp4 : (2006/07/15)</li>
140+ <li> [Added] AutoDiscoveryURL出力時にSpamCheckを行うようにした</li>
141+ <li> [Added] メッセージ、デフォルト値を日本語化</li>
142+ <li> [Added] 大手ASPの言及トラックバックチェックの際にURLのリダイレクトを解除するようにした</li>
143+</ul>
\ No newline at end of file
--- /dev/null
+++ b/trunk/NP_TrackBack/trackback/japanese-utf8.templates/all.html
@@ -0,0 +1,104 @@
1+<h2>
2+ All trackbacks
3+ <?php if ($count > $amount): ?>
4+ (Page <?php echo ceil($start / $amount) + 1;?> of <?php echo ceil($count / $amount);?>)
5+ <?php endif; ?>
6+</h2>
7+
8+<?php if(count($items)): ?>
9+<?php if ($count > $amount): ?>
10+<table class="navigation">
11+ <tr>
12+ <td style='padding: 0;'>
13+ <?php if ($start > 0): ?>
14+ <form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
15+ <div>
16+ <input type="submit" value="&lt;&lt; Previous" />
17+ <input type="hidden" name="action" value="all" />
18+ <input type="hidden" name="start" value="<?php echo max(0,$start - $amount);?>" />
19+ </div>
20+ </form>
21+ <?php endif; ?>
22+ </td>
23+ <td style='padding: 0; text-align: right;'>
24+ <?php if ($start + $amount < $count): ?>
25+ <form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
26+ <div>
27+ <input type="submit" value="Next &gt; &gt;" />
28+ <input type="hidden" name="action" value="all" />
29+ <input type="hidden" name="start" value="<?php echo ($start + $amount);?>" />
30+ </div>
31+ </form>
32+ <?php endif; ?>
33+ </td>
34+ </tr>
35+</table>
36+<?php endif; ?>
37+
38+<table>
39+ <thead>
40+ <tr>
41+ <th>Story</th>
42+ <th>Title, Blog and Excerpt</th>
43+ <th>Date</th>
44+ <th colspan='3'>Actions</th>
45+ </tr>
46+ </thead>
47+ <tbody>
48+ <?php while (list(,$item) = each ($items)): ?>
49+ <tr onmouseover='focusRow(this);' onmouseout='blurRow(this);'>
50+ <td>
51+ <a href="<? echo $item['story_url']; ?>"><?php echo $item['story'];?></a>
52+ </td>
53+ <td>
54+ <strong><?php echo $item['title'];?></strong>
55+ <em>(<?php echo $item['blog_name'];?>)</em><br />
56+ <?php echo $item['excerpt'];?>
57+ </td>
58+ <td>
59+ <?php echo str_replace(' ', '&nbsp;', date("Y-m-d @ H:i",$item['timestamp']));?>
60+ </td>
61+ <td>
62+ <a href='<?php echo $item['url'];?>'>Visit</a>
63+ </td>
64+ <td>
65+ <a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=block&amp;tb=<?php echo $item['id'];?>&amp;next=all&amp;start=<?php echo $start;?>'>Block</a>
66+ </td>
67+ <td>
68+ <a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=delete&amp;tb=<?php echo $item['id'];?>&amp;next=all&amp;start=<?php echo $start;?>'>Delete</a>
69+ </td>
70+ </tr>
71+ <?php endwhile; ?>
72+ </tbody>
73+</table>
74+
75+<?php if ($count > $amount): ?>
76+<table class="navigation">
77+ <tr>
78+ <td style='padding: 0;'>
79+ <?php if ($start > 0): ?>
80+ <form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
81+ <div>
82+ <input type="submit" value="&lt;&lt; Previous" />
83+ <input type="hidden" name="action" value="all" />
84+ <input type="hidden" name="start" value="<?php echo max(0,$start - $amount);?>" />
85+ </div>
86+ </form>
87+ <?php endif; ?>
88+ </td>
89+ <td style='padding: 0; text-align: right;'>
90+ <?php if ($start + $amount < $count): ?>
91+ <form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
92+ <div>
93+ <input type="submit" value="Next &gt; &gt;" />
94+ <input type="hidden" name="action" value="all" />
95+ <input type="hidden" name="start" value="<?php echo ($start + $amount);?>" />
96+ </div>
97+ </form>
98+ <?php endif; ?>
99+ </td>
100+ </tr>
101+</table>
102+<?php endif; ?>
103+<?php endif; ?>
104+
--- /dev/null
+++ b/trunk/NP_TrackBack/trackback/japanese-utf8.templates/blocked.html
@@ -0,0 +1,121 @@
1+<h2>
2+ ブロックされたトラックバック
3+ <?php if ($count > $amount): ?>
4+ (Page <?php echo ceil($start / $amount) + 1;?> of <?php echo ceil($count / $amount);?>)
5+ <?php endif; ?>
6+</h2>
7+
8+<ul>
9+ <li><a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=blocked_clear&amp;next=blocked'>ブロックされたトラックバックのクリア</a></li>
10+ <li><a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=blocked_spamclear&amp;next=blocked'>spam判定されたトラックバックのクリア</a></li>
11+</ul>
12+
13+<?php if(count($items)): ?>
14+<?php if ($count > $amount): ?>
15+<table class="navigation">
16+ <tr>
17+ <td style='padding: 0;'>
18+ <?php if ($start > 0): ?>
19+ <form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
20+ <div>
21+ <input type="submit" value="&lt;&lt; Previous" />
22+ <input type="hidden" name="action" value="blocked" />
23+ <input type="hidden" name="start" value="<?php echo max(0,$start - $amount);?>" />
24+ </div>
25+ </form>
26+ <?php endif; ?>
27+ </td>
28+ <td style='padding: 0; text-align: right;'>
29+ <?php if ($start + $amount < $count): ?>
30+ <form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
31+ <div>
32+ <input type="submit" value="Next &gt; &gt;" />
33+ <input type="hidden" name="action" value="blocked" />
34+ <input type="hidden" name="start" value="<?php echo ($start + $amount);?>" />
35+ </div>
36+ </form>
37+ <?php endif; ?>
38+ </td>
39+ </tr>
40+</table>
41+<?php endif; ?>
42+
43+<table>
44+ <thead>
45+ <tr>
46+ <th>Date</th>
47+ <th>Story</th>
48+ <th>Title, Blog and Excerpt</th>
49+ <th>Spam?</th>
50+ <th>Link?</th>
51+ <th colspan='3'>Actions</th>
52+ </tr>
53+ </thead>
54+ <tbody>
55+ <?php while (list(,$item) = each ($items)): ?>
56+ <tr onmouseover='focusRow(this);' onmouseout='blurRow(this);'>
57+ <td>
58+ <?php echo $item['timestamp'];?>
59+ </td>
60+ <td>
61+ <a href="<? echo $item['story_url']; ?>"><?php echo $item['story'];?></a>
62+ </td>
63+ <td>
64+ <strong><?php echo $item['title'];?></strong>
65+ <em>(<?php echo $item['blog_name'];?>)</em><br />
66+ <?php echo $item['excerpt'];?>
67+ </td>
68+ <td>
69+ <?php echo $item['spam'] ?
70+ '<span style="color: darkred;">Yes</span>' :
71+ '<span style="color: darkgreen;">No</span>';?>
72+ </td>
73+ <td>
74+ <?php echo $item['link'] ?
75+ '<span style="color: darkgreen;">Yes</span>' :
76+ '<span style="color: darkred;">No</span>';?>
77+ </td>
78+ <td>
79+ <a href='<?php echo $item['url'];?>'>Visit</a>
80+ </td>
81+ <td>
82+ <a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=unblock&amp;tb=<?php echo $item['id'];?>&amp;next=blocked&amp;start=<?php echo $start;?>'>Unblock</a>
83+ </td>
84+ <td>
85+ <a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=delete&amp;tb=<?php echo $item['id'];?>&amp;next=blocked&amp;start=<?php echo $start;?>'>Delete</a>
86+ </td>
87+ </tr>
88+ <?php endwhile; ?>
89+ </tbody>
90+</table>
91+
92+<?php if ($count > $amount): ?>
93+<table class="navigation">
94+ <tr>
95+ <td style='padding: 0;'>
96+ <?php if ($start > 0): ?>
97+ <form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
98+ <div>
99+ <input type="submit" value="&lt;&lt; Previous" />
100+ <input type="hidden" name="action" value="blocked" />
101+ <input type="hidden" name="start" value="<?php echo max(0,$start - $amount);?>" />
102+ </div>
103+ </form>
104+ <?php endif; ?>
105+ </td>
106+ <td style='padding: 0; text-align: right;'>
107+ <?php if ($start + $amount < $count): ?>
108+ <form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
109+ <div>
110+ <input type="submit" value="Next &gt; &gt;" />
111+ <input type="hidden" name="action" value="blocked" />
112+ <input type="hidden" name="start" value="<?php echo ($start + $amount);?>" />
113+ </div>
114+ </form>
115+ <?php endif; ?>
116+ </td>
117+ </tr>
118+</table>
119+<?php endif; ?>
120+<?php endif; ?>
121+
--- /dev/null
+++ b/trunk/NP_TrackBack/trackback/japanese-utf8.templates/form.html
@@ -0,0 +1,56 @@
1+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2+<html>
3+ <head>
4+ <title>TrackBackの手動送信</title>
5+ <link rel="stylesheet" type="text/css" href="<?php echo $CONF['AdminURL']?>styles/bookmarklet.css" />
6+ </head>
7+
8+ <body>
9+ <h1>TrackBackの手動送信</h1>
10+<?php if ($success): ?>
11+ <p>
12+ <strong>トラックバックの送信が完了しました</strong>
13+ </p>
14+<?php endif; ?>
15+<?php if ($error): ?>
16+ <p>
17+ <strong><?php echo $status; ?></strong>
18+ </p>
19+<?php endif; ?>
20+<?php if ($form): ?>
21+ <form method="post" action="<?php echo $CONF['ActionURL'] ?>">
22+
23+ <div>
24+ <input type="hidden" name="tb_id" value="<?php echo $itemid;?>" />
25+ <input type="hidden" name="action" value="plugin" />
26+ <input type="hidden" name="name" value="TrackBack" />
27+ <input type="hidden" name="type" value="ping" />
28+
29+ <table>
30+ <tr>
31+ <td>あなたの記事のurl</td>
32+ <td><input type="text" value="" name="url" size="60" /></td>
33+ </tr>
34+ <tr>
35+ <td>記事のタイトル</td>
36+ <td><input type="text" value="" name="title" size="60" /></td>
37+ </tr>
38+ <tr>
39+ <td>記事の要約文</td>
40+ <td><textarea name="excerpt" cols="40" rows="5"></textarea></td>
41+ </tr>
42+ <tr>
43+ <td>あなたのblogの名前</td>
44+ <td><input type="text" value="" name="blog_name" size="60" /></td>
45+ </tr>
46+ <tr>
47+ <td>トラックバック送信</td>
48+ <td><input type="submit" value="トラックバックを送信する" /></td>
49+ </tr>
50+ </table>
51+ </div>
52+
53+ </form>
54+<?php endif; ?>
55+ </body>
56+</html>
\ No newline at end of file
--- /dev/null
+++ b/trunk/NP_TrackBack/trackback/japanese-utf8.templates/index.html
@@ -0,0 +1,35 @@
1+<h2>Overview of all items</h2>
2+
3+<?php if(count($blogs)): ?>
4+
5+<table>
6+<?php while (list(,$blog) = each ($blogs)): ?>
7+<?php if(count($blog['items'])): ?>
8+ <thead>
9+ <tr>
10+ <th>Blog: <?php echo htmlspecialchars($blog['bname']);?></th>
11+ <th>Total</th>
12+ <th>Action</th>
13+ </tr>
14+ </thead>
15+ <tbody>
16+ <?php while (list(,$item) = each ($blog['items'])): ?>
17+ <tr onmouseover='focusRow(this);' onmouseout='blurRow(this);'>
18+ <td>
19+ <?php echo $item['ititle'];?>
20+ </td>
21+ <td>
22+ <?php echo htmlspecialchars($item['total']);?>
23+ </td>
24+ <td>
25+ <a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=list&amp;id=<?php echo $item['inumber'];?>'>Trackbacks</a>
26+ </td>
27+ </tr>
28+ <?php endwhile; ?>
29+ </tbody>
30+<?php endif; ?>
31+<?php endwhile; ?>
32+</table>
33+<?php endif; ?>
34+
35+
--- /dev/null
+++ b/trunk/NP_TrackBack/trackback/japanese-utf8.templates/list.html
@@ -0,0 +1,104 @@
1+<h2>
2+ All trackbacks for &quot;<?php echo $story['title'];?>&quot;
3+ <?php if ($count > $amount): ?>
4+ (Page <?php echo ceil($start / $amount) + 1;?> of <?php echo ceil($count / $amount);?>)
5+ <?php endif; ?>
6+</h2>
7+
8+<?php if(count($items)): ?>
9+<?php if ($count > $amount): ?>
10+<table class="navigation">
11+ <tr>
12+ <td style='padding: 0;'>
13+ <?php if ($start > 0): ?>
14+ <form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
15+ <div>
16+ <input type="submit" value="&lt;&lt; Previous" />
17+ <input type="hidden" name="action" value="list" />
18+ <input type="hidden" name="id" value="<?php echo $story['id'];?>" />
19+ <input type="hidden" name="start" value="<?php echo max(0,$start - $amount);?>" />
20+ </div>
21+ </form>
22+ <?php endif; ?>
23+ </td>
24+ <td style='padding: 0; text-align: right;'>
25+ <?php if ($start + $amount < $count): ?>
26+ <form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
27+ <div>
28+ <input type="submit" value="Next &gt; &gt;" />
29+ <input type="hidden" name="action" value="list" />
30+ <input type="hidden" name="id" value="<?php echo $story['id'];?>" />
31+ <input type="hidden" name="start" value="<?php echo ($start + $amount);?>" />
32+ </div>
33+ </form>
34+ <?php endif; ?>
35+ </td>
36+ </tr>
37+</table>
38+<?php endif; ?>
39+
40+<table>
41+ <thead>
42+ <tr>
43+ <th>Title, Blog and Excerpt</th>
44+ <th>Date</th>
45+ <th colspan='3'>Actions</th>
46+ </tr>
47+ </thead>
48+ <tbody>
49+ <?php while (list(,$item) = each ($items)): ?>
50+ <tr onmouseover='focusRow(this);' onmouseout='blurRow(this);'>
51+ <td>
52+ <strong><?php echo $item['title'];?></strong>
53+ <em>(<?php echo $item['blog_name'];?>)</em><br />
54+ <?php echo $item['excerpt'];?>
55+ </td>
56+ <td>
57+ <?php echo str_replace(' ', '&nbsp;', date("Y-m-d @ H:i",$item['timestamp']));?>
58+ </td>
59+ <td>
60+ <a href='<?php echo $item['url'];?>'>Visit</a>
61+ </td>
62+ <td>
63+ <a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=block&amp;tb=<?php echo $item['id'];?>&amp;next=list&amp;id=<?php echo $story['id'];?>&amp;start=<?php echo $start;?>'>Block</a>
64+ </td>
65+ <td>
66+ <a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=delete&amp;tb=<?php echo $item['id'];?>&amp;next=list&amp;id=<?php echo $story['id'];?>&amp;start=<?php echo $start;?>'>Delete</a>
67+ </td>
68+ </tr>
69+ <?php endwhile; ?>
70+ </tbody>
71+</table>
72+
73+<?php if ($count > $amount): ?>
74+<table class="navigation">
75+ <tr>
76+ <td style='padding: 0;'>
77+ <?php if ($start > 0): ?>
78+ <form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
79+ <div>
80+ <input type="submit" value="&lt;&lt; Previous" />
81+ <input type="hidden" name="action" value="list" />
82+ <input type="hidden" name="id" value="<?php echo $story['id'];?>" />
83+ <input type="hidden" name="start" value="<?php echo max(0,$start - $amount);?>" />
84+ </div>
85+ </form>
86+ <?php endif; ?>
87+ </td>
88+ <td style='padding: 0; text-align: right;'>
89+ <?php if ($start + $amount < $count): ?>
90+ <form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
91+ <div>
92+ <input type="submit" value="Next &gt; &gt;" />
93+ <input type="hidden" name="action" value="list" />
94+ <input type="hidden" name="id" value="<?php echo $story['id'];?>" />
95+ <input type="hidden" name="start" value="<?php echo ($start + $amount);?>" />
96+ </div>
97+ </form>
98+ <?php endif; ?>
99+ </td>
100+ </tr>
101+</table>
102+<?php endif; ?>
103+<?php endif; ?>
104+
--- /dev/null
+++ b/trunk/NP_TrackBack/trackback/japanese-utf8.templates/menu.html
@@ -0,0 +1,11 @@
1+
2+<h2>Trackback</h2>
3+
4+<ul>
5+ <li><a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=index'>Overview of all items</a></li>
6+ <li><a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=all'>トラックバックの全データ</a></li>
7+ <li><a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=blocked'>ブロックされたトラックバック</a></li>
8+ <li><a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=ping'>手動ping</a></li>
9+ <li><a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=help'>ヘルプ</a></li>
10+ <li><a href='<?php echo $CONF['AdminURL'];?>index.php?action=pluginoptions&amp;plugid=<?php echo $plugid;?>'>プラグインオプション設定</a></li>
11+</ul>
\ No newline at end of file
--- /dev/null
+++ b/trunk/NP_TrackBack/trackback/japanese-utf8.templates/ping.html
@@ -0,0 +1,48 @@
1+<h2>手動pingフォーム</h2>
2+
3+<form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
4+
5+ <input type="hidden" name="action" value="sendping" />
6+ <input type="hidden" name="next" value="ping" />
7+
8+ <table>
9+ <tr>
10+ <th colspan='2'>手動ping</th>
11+ </tr>
12+ <tr>
13+ <td>あなたのurl</td>
14+ <td>
15+ <input type="text" name="url" size="60" value="<?php echo htmlspecialchars($item['url']);?>" />
16+ </td>
17+ </tr>
18+ <tr>
19+ <td>記事のタイトル</td>
20+ <td>
21+ <input type="text" name="title" size="60" value="<?php echo htmlspecialchars($item['title']);?>" />
22+ </td>
23+ </tr>
24+ <tr>
25+ <td>記事の要約文</td>
26+ <td>
27+ <textarea name="excerpt" cols="40" rows="5"><?php echo $item['excerpt'];?></textarea>
28+ </td>
29+ </tr>
30+ <tr>
31+ <td>Blog名</td>
32+ <td>
33+ <input type="text" name="blog_name" size="60" value="<?php echo htmlspecialchars($item['blogname']);?>" />
34+ </td>
35+ </tr>
36+ <tr>
37+ <td>ping先url</td>
38+ <td>
39+ <input type="text" value="" name="ping_url" size="60" />
40+ </td>
41+ </tr>
42+ <tr>
43+ <td>送信</td>
44+ <td><input type="submit" value="送信" /></td>
45+ </tr>
46+ </table>
47+
48+</form>
\ No newline at end of file
--- /dev/null
+++ b/trunk/NP_TrackBack/trackback/japanese-utf8.templates/updatetable.html
@@ -0,0 +1,11 @@
1+<blockquote style="color: red;border:1px solid red;padding:1em;"><b>アップデートが必要です:</b><br />
2+このバージョンで運用するためにはDB内のテーブルのアップデートが必要です。<br />
3+今までのデータが削除されることはありません。
4+下のアップデートボタンを押してください。
5+
6+ <form method="post"><div>
7+ <input type="hidden" name="action" value="tableUpgrade" />
8+ <input type="submit" tabindex="10" value="upgrade table" />
9+ </div></form>
10+</blockquote>
11+
--- /dev/null
+++ b/trunk/NP_TrackBack/trackback/japanese-utf8.templates/updatetablefinished.html
@@ -0,0 +1,4 @@
1+<blockquote style="color: red;border:1px solid red;padding:1em;">
2+テーブルのアップデートは完了しました。
3+</blockquote>
4+
--- /dev/null
+++ b/trunk/NP_TrackBack/trackback/language/english.php
@@ -0,0 +1,51 @@
1+<?php
2+define('_TB_LIST_IT', 'List it');
3+define('_TB_DESCRIPTION', 'Send trackbacks to other weblogs and receive tracbacks from others.');
4+
5+define('_TB_NORTIFICATION_MAIL_BODY', "Your weblog received a new trackback from <%blogname%> for ID <%tb_id%>. Below are the full details:\n\nURL:\t<%url%>\nTitle:\t<%title%>\nExcerpt:\t<%excerpt%>\nBlogname:\t<%blogname%>");
6+define('_TB_NORTIFICATION_MAIL_TITLE', "New Trackback received for ID <%tb_id%>");
7+
8+define('_TB_AcceptPing', 'Accept pings');
9+define('_TB_SendPings', 'Allow sending pings');
10+define('_TB_AutoXMLHttp', 'Auto-detect Trackback URLs as you type');
11+define('_TB_CheckIDs', 'Only allow valid itemids as trackback-ids');
12+
13+define('_TB_tplHeader', 'Header');
14+define('_TB_tplEmpty', 'Empty');
15+define('_TB_tplItem', 'Item');
16+define('_TB_tplFooter', 'Footer');
17+
18+define('_TB_tplHeader_VAL', "<div class=\"tb\">\n\t<div class=\"head\">Trackback</div><%admin%>\n\n");
19+define('_TB_tplEmpty_VAL', "\t<div class=\"empty\">\n\t\tThere are currently no trackbacks for this item.\n\t</div>\n\n");
20+define('_TB_tplItem_VAL', "\t<div class=\"item\">\n\t\t<div class=\"name\"><%name%></div>\n\t\t<div class=\"body\">\n\t\t\t<a href=\"<%url%>\"><%title%>:</a> <%excerpt%>\n\t\t</div>\n\t\t<div class=\"date\">\n\t\t\t<%date%>\n\t\t</div>\n\t</div>\n\n");
21+define('_TB_tplFooter_VAL', "\t<div class=\"info\">\n\t\tUse this <a href=\"<%action%>\">TrackBack url</a> to ping this item (right-click, copy link target).\n\t\tIf your blog does not support Trackbacks you can manually add your trackback by using <a href=\"<%form%>\" onclick=\"window.open(this.href, 'trackback', 'scrollbars=yes,width=600,height=340,left=10,top=10,status=yes,resizable=yes'); return false;\">this form</a>.\n\t</div>\n</div>");
22+
23+define('_TB_tplLocalHeader_VAL', "<div class=\"tblocal\">\n\t<div class=\"head\">Local Trackback</div>\n\n");
24+define('_TB_tplLocalEmpty_VAL', "");
25+define('_TB_tplLocalItem_VAL', "\t<div class=\"item\">\n\t\t<div class=\"body\">\n\t\t\t<%delete%> <a href=\"<%url%>\"><%title%></a>: <%excerpt%>\n\t\t</div>\n\t\t<div class=\"date\">\n\t\t\t<%timestamp%>\n\t\t</div>\n\t</div>\n\n");
26+define('_TB_tplLocalFooter_VAL', "\t</div>");
27+
28+define('_TB_tplLocalHeader', 'Header (Local)');
29+define('_TB_tplLocalEmpty', 'Empty (Local)');
30+define('_TB_tplLocalItem', 'Item (Local)');
31+define('_TB_tplLocalFooter', 'Footer (Local)');
32+
33+define('_TB_tplTbNone', 'Trackback count (none)');
34+define('_TB_tplTbOne', 'Trackback count (one)');
35+define('_TB_tplTbMore', 'Trackback count (more)');
36+
37+define('_TB_dateFormat', 'Date format');
38+define('_TB_dateFormat_VAL', "%e/%m/%g");
39+
40+define('_TB_Notify', 'Send e-mail notification on ping receipt');
41+define('_TB_NotifyEmail', 'Which e-mail address to send these notification to?');
42+define('_TB_DropTable', 'Clear the database when uninstalling');
43+define('_TB_HideUrl', 'Hide external URL');
44+define('_TB_ItemAcceptPing', 'Accept pings');
45+define('_TB_isAcceptWOLink', 'Accept pings w/o link ?');
46+define('_TB_isAcceptWOLinkDef', 'Accept pings w/o link ? (blog default)');
47+define('_TB_AllowTrackBack', 'Accept pings to this blog');
48+
49+define('_TB_isAcceptWOLink_VAL', 'default|default|yes|yes|no|no');
50+define('_TB_isAcceptWOLinkDef_VAL', 'yes|yes|no (block)|block|no (ignore)|ignore');
51+?>
\ No newline at end of file
--- /dev/null
+++ b/trunk/NP_TrackBack/trackback/language/japanese-euc.php
@@ -0,0 +1,50 @@
1+<?php
2+define('_TB_LIST_IT', '送信リストに追加');
3+define('_TB_DESCRIPTION', 'トラックバックの受送信を行います');
4+
5+define('_TB_NORTIFICATION_MAIL_BODY', "<%blogname%> から ID:<%tb_id%> の記事に対してトラックバックを受信しました。 詳細は下記のとおりです:\n\nURL:\t<%url%>\nタイトル:\t<%title%>\n概要:\t<%excerpt%>\nブログ名:\t<%blogname%>");
6+define('_TB_NORTIFICATION_MAIL_TITLE', "トラックバックを受信しました ID:<%tb_id%>");
7+
8+define('_TB_AcceptPing', 'トラックバックの受付をするか?');
9+define('_TB_SendPings', 'トラックバックの送信を可能にするか?');
10+define('_TB_AutoXMLHttp', 'autodiscovery機能(記事内のリンク先のTrackbackURLの自動検知)を使うか?');
11+define('_TB_CheckIDs', 'ping受付時に有効なitemidかどうかをチェックするか?');
12+
13+define('_TB_tplHeader', 'TB一覧テンプレート(ヘッダ部)');
14+define('_TB_tplEmpty', 'TB一覧テンプレート(0件のとき)');
15+define('_TB_tplItem', 'TB一覧テンプレート(アイテム部)');
16+define('_TB_tplFooter', 'TB一覧テンプレート(フッタ部)');
17+
18+define('_TB_tplHeader_VAL', "<div class=\"tb\">\n\t<div class=\"head\">トラックバック</div><%admin%>\n\n");
19+define('_TB_tplEmpty_VAL', "\t<div class=\"empty\">\n\t\tこのエントリにトラックバックはありません\n\t</div>\n\n");
20+define('_TB_tplItem_VAL', "\t<div class=\"item\">\n\t\t<div class=\"name\"><%name%></div>\n\t\t<div class=\"body\">\n\t\t\t<a href=\"<%url%>\"><%title%>:</a> <%excerpt%>\n\t\t</div>\n\t\t<div class=\"date\">\n\t\t\t<%date%>\n\t\t</div>\n\t</div>\n\n");
21+define('_TB_tplFooter_VAL', "\t<div class=\"info\">\n\t\tこの<a href=\"<%action%>\">トラックバックURL</a>を使ってこの記事にトラックバックを送ることができます。\n\t\tもしあなたのブログがトラックバック送信に対応していない場合には<a href=\"<%form%>\" onclick=\"window.open(this.href, 'trackback', 'scrollbars=yes,width=600,height=340,left=10,top=10,status=yes,resizable=yes'); return false;\">こちらのフォーム</a>からトラックバックを送信することができます。.\n\t</div>\n</div>");
22+
23+define('_TB_tplLocalHeader', 'ローカルTB一覧テンプレート(ヘッダ部)');
24+define('_TB_tplLocalEmpty', 'ローカルTB一覧テンプレート(0件のとき)');
25+define('_TB_tplLocalItem', 'ローカルTB一覧テンプレート(アイテム部)');
26+define('_TB_tplLocalFooter', 'ローカルTB一覧テンプレート(フッタ部)');
27+
28+define('_TB_tplLocalHeader_VAL', "<div class=\"tblocal\">\n\t<div class=\"head\">ローカルトラックバック</div>\n\n");
29+define('_TB_tplLocalEmpty_VAL', "");
30+define('_TB_tplLocalItem_VAL', "\t<div class=\"item\">\n\t\t<div class=\"body\">\n\t\t\t<%delete%> <a href=\"<%url%>\"><%title%></a>: <%excerpt%>\n\t\t</div>\n\t\t<div class=\"date\">\n\t\t\t<%timestamp%>\n\t\t</div>\n\t</div>\n\n");
31+define('_TB_tplLocalFooter_VAL', "\t</div>");
32+
33+define('_TB_tplTbNone', 'TB数表示形式(0件)');
34+define('_TB_tplTbOne', 'TB数表示形式(1件)');
35+define('_TB_tplTbMore', 'TB数表示形式(2件以上)');
36+define('_TB_dateFormat', '日付の形式');
37+define('_TB_dateFormat_VAL', "%Y/%m/%d %H:%I");
38+
39+define('_TB_Notify', 'ping受付時にメール送信するか?');
40+define('_TB_NotifyEmail', 'ping受付時のメール送信先');
41+define('_TB_DropTable', 'プラグインの削除時にデータを削除するか?');
42+define('_TB_HideUrl', '一覧表示の際に外部のURLをリダイレクトに変換するか?');
43+define('_TB_ItemAcceptPing', 'TBを受付するか?');
44+define('_TB_isAcceptWOLink', '言及リンクがなくてもTBを受付するか?');
45+define('_TB_isAcceptWOLinkDef', '言及リンクがなくてもTBを受付するか? (blogデフォルト)');
46+define('_TB_AllowTrackBack', 'このブログでTBを受付するか?');
47+
48+define('_TB_isAcceptWOLink_VAL', 'ブログデフォルトに従う|default|はい|yes|いいえ|no');
49+define('_TB_isAcceptWOLinkDef_VAL', 'はい|yes|いいえ(保留)|block|いいえ(無視)|ignore');
50+?>
\ No newline at end of file
--- /dev/null
+++ b/trunk/NP_TrackBack/trackback/language/japanese-utf8.php
@@ -0,0 +1,50 @@
1+<?php
2+define('_TB_LIST_IT', '送信リストに追加');
3+define('_TB_DESCRIPTION', 'トラックバックの受送信を行います');
4+
5+define('_TB_NORTIFICATION_MAIL_BODY', "<%blogname%> から ID:<%tb_id%> の記事に対してトラックバックを受信しました。 詳細は下記のとおりです:\n\nURL:\t<%url%>\nタイトル:\t<%title%>\n概要:\t<%excerpt%>\nブログ名:\t<%blogname%>");
6+define('_TB_NORTIFICATION_MAIL_TITLE', "トラックバックを受信しました ID:<%tb_id%>");
7+
8+define('_TB_AcceptPing', 'トラックバックの受付をするか?');
9+define('_TB_SendPings', 'トラックバックの送信を可能にするか?');
10+define('_TB_AutoXMLHttp', 'autodiscovery機能(記事内のリンク先のTrackbackURLの自動検知)を使うか?');
11+define('_TB_CheckIDs', 'ping受付時に有効なitemidかどうかをチェックするか?');
12+
13+define('_TB_tplHeader', 'TB一覧テンプレート(ヘッダ部)');
14+define('_TB_tplEmpty', 'TB一覧テンプレート(0件のとき)');
15+define('_TB_tplItem', 'TB一覧テンプレート(アイテム部)');
16+define('_TB_tplFooter', 'TB一覧テンプレート(フッタ部)');
17+
18+define('_TB_tplHeader_VAL', "<div class=\"tb\">\n\t<div class=\"head\">トラックバック</div><%admin%>\n\n");
19+define('_TB_tplEmpty_VAL', "\t<div class=\"empty\">\n\t\tこのエントリにトラックバックはありません\n\t</div>\n\n");
20+define('_TB_tplItem_VAL', "\t<div class=\"item\">\n\t\t<div class=\"name\"><%name%></div>\n\t\t<div class=\"body\">\n\t\t\t<a href=\"<%url%>\"><%title%>:</a> <%excerpt%>\n\t\t</div>\n\t\t<div class=\"date\">\n\t\t\t<%date%>\n\t\t</div>\n\t</div>\n\n");
21+define('_TB_tplFooter_VAL', "\t<div class=\"info\">\n\t\tこの<a href=\"<%action%>\">トラックバックURL</a>を使ってこの記事にトラックバックを送ることができます。\n\t\tもしあなたのブログがトラックバック送信に対応していない場合には<a href=\"<%form%>\" onclick=\"window.open(this.href, 'trackback', 'scrollbars=yes,width=600,height=340,left=10,top=10,status=yes,resizable=yes'); return false;\">こちらのフォーム</a>からトラックバックを送信することができます。.\n\t</div>\n</div>");
22+
23+define('_TB_tplLocalHeader', 'ローカルTB一覧テンプレート(ヘッダ部)');
24+define('_TB_tplLocalEmpty', 'ローカルTB一覧テンプレート(0件のとき)');
25+define('_TB_tplLocalItem', 'ローカルTB一覧テンプレート(アイテム部)');
26+define('_TB_tplLocalFooter', 'ローカルTB一覧テンプレート(フッタ部)');
27+
28+define('_TB_tplLocalHeader_VAL', "<div class=\"tblocal\">\n\t<div class=\"head\">ローカルトラックバック</div>\n\n");
29+define('_TB_tplLocalEmpty_VAL', "");
30+define('_TB_tplLocalItem_VAL', "\t<div class=\"item\">\n\t\t<div class=\"body\">\n\t\t\t<%delete%> <a href=\"<%url%>\"><%title%></a>: <%excerpt%>\n\t\t</div>\n\t\t<div class=\"date\">\n\t\t\t<%timestamp%>\n\t\t</div>\n\t</div>\n\n");
31+define('_TB_tplLocalFooter_VAL', "\t</div>");
32+
33+define('_TB_tplTbNone', 'TB数表示形式(0件)');
34+define('_TB_tplTbOne', 'TB数表示形式(1件)');
35+define('_TB_tplTbMore', 'TB数表示形式(2件以上)');
36+define('_TB_dateFormat', '日付の形式');
37+define('_TB_dateFormat_VAL', "%Y/%m/%d %H:%I");
38+
39+define('_TB_Notify', 'ping受付時にメール送信するか?');
40+define('_TB_NotifyEmail', 'ping受付時のメール送信先');
41+define('_TB_DropTable', 'プラグインの削除時にデータを削除するか?');
42+define('_TB_HideUrl', '一覧表示の際に外部のURLをリダイレクトに変換するか?');
43+define('_TB_ItemAcceptPing', 'TBを受付するか?');
44+define('_TB_isAcceptWOLink', '言及リンクがなくてもTBを受付するか?');
45+define('_TB_isAcceptWOLinkDef', '言及リンクがなくてもTBを受付するか? (blogデフォルト)');
46+define('_TB_AllowTrackBack', 'このブログでTBを受付するか?');
47+
48+define('_TB_isAcceptWOLink_VAL', 'ブログデフォルトに従う|default|はい|yes|いいえ|no');
49+define('_TB_isAcceptWOLinkDef_VAL', 'はい|yes|いいえ(保留)|block|いいえ(無視)|ignore');
50+?>
\ No newline at end of file
--- /dev/null
+++ b/trunk/NP_TrackBack/trackback/mkeuc.sh
@@ -0,0 +1,9 @@
1+#!/bin/bash -x
2+
3+FILES=`find japanese-utf8.templates -name '*html'`
4+
5+for utf8file in $FILES
6+do
7+ eucfile=`echo $utf8file | sed 's/japanese-utf8/japanese-euc/'`
8+ nkf -e -W -d < $utf8file > $eucfile
9+done
--- /dev/null
+++ b/trunk/NP_TrackBack/trackback/template.php
@@ -0,0 +1,37 @@
1+<?php
2+class Trackback_Template {
3+ var $vars;
4+
5+ function Trackback_Template($file = null, $prefix = '') {
6+ $this->file = ($prefix ? $prefix . '/' : '') . $file;
7+ $this->prefix = $prefix;
8+ }
9+
10+ function set($name, $value) {
11+ $this->vars[$name] = is_object($value) ? $value->fetch() : $value;
12+ }
13+
14+ function template($file = null) {
15+ $language = ereg_replace( '[\\|/]', '', getLanguageName());
16+ $this->file = (file_exists(($this->prefix ? $this->prefix . '/' : '') . $language.'.'.$file))? ($this->prefix ? $this->prefix . '/' : '') . $language.'.'.$file: ($this->prefix ? $this->prefix . '/' : '') . $file;
17+ }
18+
19+ function fetch($file = null) {
20+ if(!$file) $file = $this->file;
21+ else ($prefix ? $prefix . '/' : '') . $file;
22+
23+ if ($file != null)
24+ {
25+ if (is_array($this->vars)) extract($this->vars);
26+
27+ ob_start();
28+ include($file);
29+ $contents = ob_get_contents();
30+ ob_end_clean();
31+
32+ return $contents;
33+ }
34+ }
35+}
36+
37+?>
\ No newline at end of file
--- /dev/null
+++ b/trunk/NP_TrackBack/trackback/templates/all.html
@@ -0,0 +1,104 @@
1+<h2>
2+ All trackbacks
3+ <?php if ($count > $amount): ?>
4+ (Page <?php echo ceil($start / $amount) + 1;?> of <?php echo ceil($count / $amount);?>)
5+ <?php endif; ?>
6+</h2>
7+
8+<?php if(count($items)): ?>
9+<?php if ($count > $amount): ?>
10+<table class="navigation">
11+ <tr>
12+ <td style='padding: 0;'>
13+ <?php if ($start > 0): ?>
14+ <form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
15+ <div>
16+ <input type="submit" value="&lt;&lt; Previous" />
17+ <input type="hidden" name="action" value="all" />
18+ <input type="hidden" name="start" value="<?php echo max(0,$start - $amount);?>" />
19+ </div>
20+ </form>
21+ <?php endif; ?>
22+ </td>
23+ <td style='padding: 0; text-align: right;'>
24+ <?php if ($start + $amount < $count): ?>
25+ <form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
26+ <div>
27+ <input type="submit" value="Next &gt; &gt;" />
28+ <input type="hidden" name="action" value="all" />
29+ <input type="hidden" name="start" value="<?php echo ($start + $amount);?>" />
30+ </div>
31+ </form>
32+ <?php endif; ?>
33+ </td>
34+ </tr>
35+</table>
36+<?php endif; ?>
37+
38+<table>
39+ <thead>
40+ <tr>
41+ <th>Story</th>
42+ <th>Title, Blog and Excerpt</th>
43+ <th>Date</th>
44+ <th colspan='3'>Actions</th>
45+ </tr>
46+ </thead>
47+ <tbody>
48+ <?php while (list(,$item) = each ($items)): ?>
49+ <tr onmouseover='focusRow(this);' onmouseout='blurRow(this);'>
50+ <td>
51+ <a href="<? echo $item['story_url']; ?>"><?php echo $item['story'];?></a>
52+ </td>
53+ <td>
54+ <strong><?php echo $item['title'];?></strong>
55+ <em>(<?php echo $item['blog_name'];?>)</em><br />
56+ <?php echo $item['excerpt'];?>
57+ </td>
58+ <td>
59+ <?php echo str_replace(' ', '&nbsp;', date("Y-m-d @ H:i",$item['timestamp']));?>
60+ </td>
61+ <td>
62+ <a href='<?php echo $item['url'];?>'>Visit</a>
63+ </td>
64+ <td>
65+ <a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=block&amp;tb=<?php echo $item['id'];?>&amp;next=all&amp;start=<?php echo $start;?>'>Block</a>
66+ </td>
67+ <td>
68+ <a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=delete&amp;tb=<?php echo $item['id'];?>&amp;next=all&amp;start=<?php echo $start;?>'>Delete</a>
69+ </td>
70+ </tr>
71+ <?php endwhile; ?>
72+ </tbody>
73+</table>
74+
75+<?php if ($count > $amount): ?>
76+<table class="navigation">
77+ <tr>
78+ <td style='padding: 0;'>
79+ <?php if ($start > 0): ?>
80+ <form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
81+ <div>
82+ <input type="submit" value="&lt;&lt; Previous" />
83+ <input type="hidden" name="action" value="all" />
84+ <input type="hidden" name="start" value="<?php echo max(0,$start - $amount);?>" />
85+ </div>
86+ </form>
87+ <?php endif; ?>
88+ </td>
89+ <td style='padding: 0; text-align: right;'>
90+ <?php if ($start + $amount < $count): ?>
91+ <form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
92+ <div>
93+ <input type="submit" value="Next &gt; &gt;" />
94+ <input type="hidden" name="action" value="all" />
95+ <input type="hidden" name="start" value="<?php echo ($start + $amount);?>" />
96+ </div>
97+ </form>
98+ <?php endif; ?>
99+ </td>
100+ </tr>
101+</table>
102+<?php endif; ?>
103+<?php endif; ?>
104+
--- /dev/null
+++ b/trunk/NP_TrackBack/trackback/templates/blocked.html
@@ -0,0 +1,121 @@
1+<h2>
2+ Blocked trackbacks
3+ <?php if ($count > $amount): ?>
4+ (Page <?php echo ceil($start / $amount) + 1;?> of <?php echo ceil($count / $amount);?>)
5+ <?php endif; ?>
6+</h2>
7+
8+<ul>
9+ <li><a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=blocked_clear&amp;next=blocked'>Clear blocked trackbacks</a></li>
10+ <li><a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=blocked_spamclear&amp;next=blocked'>Clear spam trackbacks</a></li>
11+</ul>
12+
13+<?php if(count($items)): ?>
14+<?php if ($count > $amount): ?>
15+<table class="navigation">
16+ <tr>
17+ <td style='padding: 0;'>
18+ <?php if ($start > 0): ?>
19+ <form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
20+ <div>
21+ <input type="submit" value="&lt;&lt; Previous" />
22+ <input type="hidden" name="action" value="blocked" />
23+ <input type="hidden" name="start" value="<?php echo max(0,$start - $amount);?>" />
24+ </div>
25+ </form>
26+ <?php endif; ?>
27+ </td>
28+ <td style='padding: 0; text-align: right;'>
29+ <?php if ($start + $amount < $count): ?>
30+ <form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
31+ <div>
32+ <input type="submit" value="Next &gt; &gt;" />
33+ <input type="hidden" name="action" value="blocked" />
34+ <input type="hidden" name="start" value="<?php echo ($start + $amount);?>" />
35+ </div>
36+ </form>
37+ <?php endif; ?>
38+ </td>
39+ </tr>
40+</table>
41+<?php endif; ?>
42+
43+<table>
44+ <thead>
45+ <tr>
46+ <th>Date</th>
47+ <th>Story</th>
48+ <th>Title, Blog and Excerpt</th>
49+ <th>Spam?</th>
50+ <th>Link?</th>
51+ <th colspan='3'>Actions</th>
52+ </tr>
53+ </thead>
54+ <tbody>
55+ <?php while (list(,$item) = each ($items)): ?>
56+ <tr onmouseover='focusRow(this);' onmouseout='blurRow(this);'>
57+ <td>
58+ <?php echo $item['timestamp'];?>
59+ </td>
60+ <td>
61+ <a href="<? echo $item['story_url']; ?>"><?php echo $item['story'];?></a>
62+ </td>
63+ <td>
64+ <strong><?php echo $item['title'];?></strong>
65+ <em>(<?php echo $item['blog_name'];?>)</em><br />
66+ <?php echo $item['excerpt'];?>
67+ </td>
68+ <td>
69+ <?php echo $item['spam'] ?
70+ '<span style="color: darkred;">Yes</span>' :
71+ '<span style="color: darkgreen;">No</span>';?>
72+ </td>
73+ <td>
74+ <?php echo $item['link'] ?
75+ '<span style="color: darkgreen;">Yes</span>' :
76+ '<span style="color: darkred;">No</span>';?>
77+ </td>
78+ <td>
79+ <a href='<?php echo $item['url'];?>'>Visit</a>
80+ </td>
81+ <td>
82+ <a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=unblock&amp;tb=<?php echo $item['id'];?>&amp;next=blocked&amp;start=<?php echo $start;?>'>Unblock</a>
83+ </td>
84+ <td>
85+ <a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=delete&amp;tb=<?php echo $item['id'];?>&amp;next=blocked&amp;start=<?php echo $start;?>'>Delete</a>
86+ </td>
87+ </tr>
88+ <?php endwhile; ?>
89+ </tbody>
90+</table>
91+
92+<?php if ($count > $amount): ?>
93+<table class="navigation">
94+ <tr>
95+ <td style='padding: 0;'>
96+ <?php if ($start > 0): ?>
97+ <form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
98+ <div>
99+ <input type="submit" value="&lt;&lt; Previous" />
100+ <input type="hidden" name="action" value="blocked" />
101+ <input type="hidden" name="start" value="<?php echo max(0,$start - $amount);?>" />
102+ </div>
103+ </form>
104+ <?php endif; ?>
105+ </td>
106+ <td style='padding: 0; text-align: right;'>
107+ <?php if ($start + $amount < $count): ?>
108+ <form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
109+ <div>
110+ <input type="submit" value="Next &gt; &gt;" />
111+ <input type="hidden" name="action" value="blocked" />
112+ <input type="hidden" name="start" value="<?php echo ($start + $amount);?>" />
113+ </div>
114+ </form>
115+ <?php endif; ?>
116+ </td>
117+ </tr>
118+</table>
119+<?php endif; ?>
120+<?php endif; ?>
121+
--- /dev/null
+++ b/trunk/NP_TrackBack/trackback/templates/form.html
@@ -0,0 +1,56 @@
1+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2+<html>
3+ <head>
4+ <title>Add TrackBack</title>
5+ <link rel="stylesheet" type="text/css" href="<?php echo $CONF['AdminURL']?>styles/bookmarklet.css" />
6+ </head>
7+
8+ <body>
9+ <h1>TrackBack Ping</h1>
10+<?php if ($success): ?>
11+ <p>
12+ <strong>Your trackback has been received properly.</strong>
13+ </p>
14+<?php endif; ?>
15+<?php if ($error): ?>
16+ <p>
17+ <strong><?php echo $status; ?></strong>
18+ </p>
19+<?php endif; ?>
20+<?php if ($form): ?>
21+ <form method="post" action="<?php echo $CONF['ActionURL'] ?>">
22+
23+ <div>
24+ <input type="hidden" name="tb_id" value="<?php echo $itemid;?>" />
25+ <input type="hidden" name="action" value="plugin" />
26+ <input type="hidden" name="name" value="TrackBack" />
27+ <input type="hidden" name="type" value="ping" />
28+
29+ <table>
30+ <tr>
31+ <td>Article URL</td>
32+ <td><input type="text" value="" name="url" size="60" /></td>
33+ </tr>
34+ <tr>
35+ <td>Article Title</td>
36+ <td><input type="text" value="" name="title" size="60" /></td>
37+ </tr>
38+ <tr>
39+ <td>Excerpt from article</td>
40+ <td><textarea name="excerpt" cols="40" rows="5"></textarea></td>
41+ </tr>
42+ <tr>
43+ <td>Your Blog Name</td>
44+ <td><input type="text" value="" name="blog_name" size="60" /></td>
45+ </tr>
46+ <tr>
47+ <td>Add TrackBack</td>
48+ <td><input type="submit" value="Add TrackBack" /></td>
49+ </tr>
50+ </table>
51+ </div>
52+
53+ </form>
54+<?php endif; ?>
55+ </body>
56+</html>
\ No newline at end of file
--- /dev/null
+++ b/trunk/NP_TrackBack/trackback/templates/index.html
@@ -0,0 +1,35 @@
1+<h2>Overview of all items</h2>
2+
3+<?php if(count($blogs)): ?>
4+
5+<table>
6+<?php while (list(,$blog) = each ($blogs)): ?>
7+<?php if(count($blog['items'])): ?>
8+ <thead>
9+ <tr>
10+ <th>Blog: <?php echo htmlspecialchars($blog['bname']);?></th>
11+ <th>Total</th>
12+ <th>Action</th>
13+ </tr>
14+ </thead>
15+ <tbody>
16+ <?php while (list(,$item) = each ($blog['items'])): ?>
17+ <tr onmouseover='focusRow(this);' onmouseout='blurRow(this);'>
18+ <td>
19+ <?php echo $item['ititle'];?>
20+ </td>
21+ <td>
22+ <?php echo htmlspecialchars($item['total']);?>
23+ </td>
24+ <td>
25+ <a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=list&amp;id=<?php echo $item['inumber'];?>'>Trackbacks</a>
26+ </td>
27+ </tr>
28+ <?php endwhile; ?>
29+ </tbody>
30+<?php endif; ?>
31+<?php endwhile; ?>
32+</table>
33+<?php endif; ?>
34+
35+
--- /dev/null
+++ b/trunk/NP_TrackBack/trackback/templates/list.html
@@ -0,0 +1,104 @@
1+<h2>
2+ All trackbacks for &quot;<?php echo $story['title'];?>&quot;
3+ <?php if ($count > $amount): ?>
4+ (Page <?php echo ceil($start / $amount) + 1;?> of <?php echo ceil($count / $amount);?>)
5+ <?php endif; ?>
6+</h2>
7+
8+<?php if(count($items)): ?>
9+<?php if ($count > $amount): ?>
10+<table class="navigation">
11+ <tr>
12+ <td style='padding: 0;'>
13+ <?php if ($start > 0): ?>
14+ <form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
15+ <div>
16+ <input type="submit" value="&lt;&lt; Previous" />
17+ <input type="hidden" name="action" value="list" />
18+ <input type="hidden" name="id" value="<?php echo $story['id'];?>" />
19+ <input type="hidden" name="start" value="<?php echo max(0,$start - $amount);?>" />
20+ </div>
21+ </form>
22+ <?php endif; ?>
23+ </td>
24+ <td style='padding: 0; text-align: right;'>
25+ <?php if ($start + $amount < $count): ?>
26+ <form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
27+ <div>
28+ <input type="submit" value="Next &gt; &gt;" />
29+ <input type="hidden" name="action" value="list" />
30+ <input type="hidden" name="id" value="<?php echo $story['id'];?>" />
31+ <input type="hidden" name="start" value="<?php echo ($start + $amount);?>" />
32+ </div>
33+ </form>
34+ <?php endif; ?>
35+ </td>
36+ </tr>
37+</table>
38+<?php endif; ?>
39+
40+<table>
41+ <thead>
42+ <tr>
43+ <th>Title, Blog and Excerpt</th>
44+ <th>Date</th>
45+ <th colspan='3'>Actions</th>
46+ </tr>
47+ </thead>
48+ <tbody>
49+ <?php while (list(,$item) = each ($items)): ?>
50+ <tr onmouseover='focusRow(this);' onmouseout='blurRow(this);'>
51+ <td>
52+ <strong><?php echo $item['title'];?></strong>
53+ <em>(<?php echo $item['blog_name'];?>)</em><br />
54+ <?php echo $item['excerpt'];?>
55+ </td>
56+ <td>
57+ <?php echo str_replace(' ', '&nbsp;', date("Y-m-d @ H:i",$item['timestamp']));?>
58+ </td>
59+ <td>
60+ <a href='<?php echo $item['url'];?>'>Visit</a>
61+ </td>
62+ <td>
63+ <a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=block&amp;tb=<?php echo $item['id'];?>&amp;next=list&amp;id=<?php echo $story['id'];?>&amp;start=<?php echo $start;?>'>Block</a>
64+ </td>
65+ <td>
66+ <a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=delete&amp;tb=<?php echo $item['id'];?>&amp;next=list&amp;id=<?php echo $story['id'];?>&amp;start=<?php echo $start;?>'>Delete</a>
67+ </td>
68+ </tr>
69+ <?php endwhile; ?>
70+ </tbody>
71+</table>
72+
73+<?php if ($count > $amount): ?>
74+<table class="navigation">
75+ <tr>
76+ <td style='padding: 0;'>
77+ <?php if ($start > 0): ?>
78+ <form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
79+ <div>
80+ <input type="submit" value="&lt;&lt; Previous" />
81+ <input type="hidden" name="action" value="list" />
82+ <input type="hidden" name="id" value="<?php echo $story['id'];?>" />
83+ <input type="hidden" name="start" value="<?php echo max(0,$start - $amount);?>" />
84+ </div>
85+ </form>
86+ <?php endif; ?>
87+ </td>
88+ <td style='padding: 0; text-align: right;'>
89+ <?php if ($start + $amount < $count): ?>
90+ <form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
91+ <div>
92+ <input type="submit" value="Next &gt; &gt;" />
93+ <input type="hidden" name="action" value="list" />
94+ <input type="hidden" name="id" value="<?php echo $story['id'];?>" />
95+ <input type="hidden" name="start" value="<?php echo ($start + $amount);?>" />
96+ </div>
97+ </form>
98+ <?php endif; ?>
99+ </td>
100+ </tr>
101+</table>
102+<?php endif; ?>
103+<?php endif; ?>
104+
--- /dev/null
+++ b/trunk/NP_TrackBack/trackback/templates/menu.html
@@ -0,0 +1,14 @@
1+
2+<h2>Trackback</h2>
3+
4+<ul>
5+ <li><a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=index'>Overview of all items</a></li>
6+ <li><a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=all'>All trackbacks</a></li>
7+ <li><a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=blocked'>Blocked trackbacks</a></li>
8+ <li><a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=ping'>Manually ping another weblog</a></li>
9+ <li><a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=help'>Help</a></li>
10+ <li><a href='<?php echo $CONF['AdminURL'];?>index.php?action=pluginoptions&amp;plugid=<?php echo $plugid;?>'>Plugin Options</a></li>
11+</ul>
12+
13+<p>&nbsp;</p>
14+
--- /dev/null
+++ b/trunk/NP_TrackBack/trackback/templates/ping.html
@@ -0,0 +1,49 @@
1+
2+<h2>Manually ping another weblog</h2>
3+
4+<form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
5+
6+ <input type="hidden" name="action" value="sendping" />
7+ <input type="hidden" name="next" value="ping" />
8+
9+ <table>
10+ <tr>
11+ <th colspan='2'>Manually Ping</th>
12+ </tr>
13+ <tr>
14+ <td>Your URL</td>
15+ <td>
16+ <input type="text" name="url" size="60" value="<?php echo htmlspecialchars($item['url']);?>" />
17+ </td>
18+ </tr>
19+ <tr>
20+ <td>Your Title</td>
21+ <td>
22+ <input type="text" value="" name="title" size="60" value="<?php echo htmlspecialchars($item['title']);?>" />
23+ </td>
24+ </tr>
25+ <tr>
26+ <td>Your Excerpt</td>
27+ <td>
28+ <textarea name="excerpt" cols="40" rows="5"><?php echo $item['excerpt'];?></textarea>
29+ </td>
30+ </tr>
31+ <tr>
32+ <td>Your Blog Name</td>
33+ <td>
34+ <input type="text" name="blog_name" size="60" value="<?php echo htmlspecialchars($item['blogname']);?>" />
35+ </td>
36+ </tr>
37+ <tr>
38+ <td>External Ping URL</td>
39+ <td>
40+ <input type="text" value="" name="ping_url" size="60" />
41+ </td>
42+ </tr>
43+ <tr>
44+ <td>Send Ping</td>
45+ <td><input type="submit" value="Send Ping" /></td>
46+ </tr>
47+ </table>
48+
49+</form>
\ No newline at end of file
Show on old repository browser