--- /dev/null
+<?php
+// vim: tabstop=2:shiftwidth=2
+
+ /* ==========================================================================================
+ * Trackback 2.0 for Nucleus CMS
+ * ==========================================================================================
+ * This program is free software and open source software; you can redistribute
+ * it and/or modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the License,
+ * or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA or visit
+ * http://www.gnu.org/licenses/gpl.html
+ * ==========================================================================================
+ */
+
+ // Compatiblity with Nucleus < = 2.0
+ if (!function_exists('sql_table')) { function sql_table($name) { return 'nucleus_' . $name; } }
+
+
+ class NP_TrackBack extends NucleusPlugin {
+
+ var $useCurl = 1; // use curl? 2:precheck+read by curl, 1: read by curl 0: fread
+
+//modify start+++++++++
+ function _createItemLink($itemid, $b){
+ global $CONF, $manager;
+ $blogurl = $b->getURL();
+
+ if (!$blogurl) {
+ if($blog) {
+ $b_tmp =& $manager->getBlog($CONF['DefaultBlog']);
+ $blogurl = $b_tmp->getURL();
+ }
+ if (!$blogurl) {
+ $blogurl = $CONF['IndexURL'];
+ if ($CONF['URLMode'] != 'pathinfo'){
+ $blogurl = $CONF['Self'];
+ }
+ }
+ }
+ if ($CONF['URLMode'] == 'pathinfo'){
+ if(substr($blogurl, -1) == '/') $blogurl = substr($blogurl,0,-1);
+ }
+ $CONF['ItemURL'] = $blogurl;
+
+ return createItemLink($itemid,'');
+ }
+//modify end+++++++++
+
+ /**************************************************************************************
+ * SKIN VARS, TEMPLATE VARS AND ACTIONS
+ */
+
+ /*
+ * TrackBack data can be inserted using skinvars (or templatevars)
+ */
+ function doSkinVar($skinType, $what = '', $tb_id = '', $amount = 'limit-1') {
+
+ global $itemid;
+
+//modify start+++++++++
+ if(eregi('limit', $tb_id)){
+ $amount = $tb_id;
+ $tb_id = '';
+ }
+ $amount = eregi_replace("limit", "", $amount);
+ $amount = intval($amount);
+//modify end+++++++++
+
+ if ($tb_id == '') $tb_id = intval($itemid);
+
+//mod by cles
+ if( $this->getBlogOption(getBlogIDFromItemID($tb_id), "AllowTrackBack") == 'yes' )
+ $isAcceptPing = ( $this->getItemOption(intval($tb_id), 'ItemAcceptPing') == 'yes' ) ? true : false ;
+ else
+ $isAcceptPing = false;
+
+ //if( $skinType == 'template' && (! $isAcceptPing ) ){
+ // return;
+ //}
+//mod by cles end
+ switch ($what) {
+
+ // Insert Auto-discovery RDF code
+ case 'tbcode':
+ case 'code':
+//mod by cles
+// if($skinType == 'item')
+
+ $spamcheck = array (
+ 'type' => 'tbcode',
+ 'id' => -1,
+ 'title' => '',
+ 'excerpt' => '',
+ 'blogname' => '',
+ 'url' => '',
+ 'return' => true,
+ 'live' => true,
+
+ /* Backwards compatibility with SpamCheck API 1*/
+ 'data' => '',
+ 'ipblock' => true,
+ );
+ global $manager;
+ $manager->notify('SpamCheck', array ('spamcheck' => & $spamcheck));
+ $spam = false;
+ if (isset($spamcheck['result']) && $spamcheck['result'] == true){
+ $spam = true;
+ }
+
+ if( ($skinType == 'item') && (!$spam) && $isAcceptPing )
+//mod by cles end
+ $this->insertCode($tb_id);
+ break;
+
+ // Insert TrackBack URL
+ case 'tburl':
+ case 'url':
+//mod by cles
+// echo $this->getTrackBackUrl($tb_id);
+ if($isAcceptPing)
+ echo $this->getTrackBackUrl($tb_id);
+ else
+ echo 'Sorry, no trackback pings are accepted.';
+//mod by cles end
+ break;
+
+ // Insert manual ping URL
+ case 'form':
+ case 'manualpingformlink':
+ echo $this->getManualPingUrl($tb_id);
+ break;
+
+ // Insert TrackBack count
+ case 'count':
+ $count = $this->getTrackBackCount($tb_id);
+ switch ($count) {
+ case 0: echo TEMPLATE::fill($this->getOption('tplTbNone'), array('number' => $count)); break;
+ case 1: echo TEMPLATE::fill($this->getOption('tplTbOne'), array('number' => $count)); break;
+ default: echo TEMPLATE::fill($this->getOption('tplTbMore'), array('number' => $count)); break;
+ }
+ break;
+
+ // Shows the TrackBack list
+ case 'list':
+ case '':
+//modify start+++++++++
+// $this->showList($tb_id);
+ $this->showList($tb_id, $amount);
+//modify end+++++++++
+ break;
+//mod by cles
+ // show requred URL
+ case 'required':
+ echo $this->getRequiredURL($tb_id);
+ break;
+
+ // shows the Local list
+ case 'locallist':
+ $this->showLocalList($tb_id);
+ break;
+//mod by cles end
+
+ default:
+ return;
+ }
+ }
+
+ /*
+ * When used in templates, the tb_id will be determined by the itemid there
+ */
+ function doTemplateVar(&$item, $what = '') {
+ $this->doSkinVar('template', $what, $item->itemid);
+ }
+
+ /*
+ * A trackback ping is to be received on the URL
+ * http://yourdomain.com/item/1234.trackback
+ * Extra variables to be passed along are url, title, excerpt, blog_name
+ */
+ function event_InitSkinParse(&$data) {
+ global $CONF, $itemid;
+ $format = requestVar('format');
+
+ if ($CONF['URLMode'] == 'pathinfo') {
+ if (preg_match('/(\/|\.)(trackback)(\/|$)/', serverVar('PATH_INFO'), $matches)) {
+ $format = $matches[2];
+ }
+ }
+
+ if ($format == 'trackback' && $data['type'] == 'item')
+ {
+ $errorMsg = $this->handlePing(intval($itemid));
+
+ if ($errorMsg != '')
+ $this->xmlResponse($errorMsg);
+ else
+ $this->xmlResponse();
+
+ exit;
+ }
+ }
+
+ /*
+ * A trackback ping is to be received on the URL
+ * http://yourdomain.com/action.php?action=plugin&name=TrackBack&tb_id=1234
+ * Extra variables to be passed along are url, title, excerpt, blog_name
+ */
+ function doAction($type)
+ {
+ global $CONF;
+ switch ($type) {
+
+ // When no action type is given, assume it's a ping
+ case '':
+ $errorMsg = $this->handlePing();
+
+ if ($errorMsg != '')
+ $this->xmlResponse($errorMsg);
+ else
+ $this->xmlResponse();
+ break;
+
+ // Manual ping
+ case 'ping':
+ $errorMsg = $this->handlePing();
+
+ if ($errorMsg != '')
+ $this->showManualPingError(intRequestVar('tb_id'), $errorMsg);
+ else
+ $this->showManualPingSuccess(intRequestVar('tb_id'));
+ break;
+
+ // Show manual ping form
+ case 'form':
+//mod by cles
+// $this->showManualPingForm(intRequestVar('tb_id'));
+ $tb_id = intRequestVar('tb_id');
+ if( $this->getBlogOption(getBlogIDFromItemID($tb_id), "AllowTrackBack") == 'yes' )
+ $isAcceptPing = ( $this->getItemOption($tb_id, 'ItemAcceptPing') == 'yes' ) ? true : false ;
+ else
+ $isAcceptPing = false;
+ if( $isAcceptPing )
+ $this->showManualPingForm($tb_id);
+ else
+ echo 'Sorry, no trackback pings are accepted.';
+//mod by cles end
+ break;
+
+ // Detect trackback
+ case 'detect':
+ list($url, $title) =
+ $this->getURIfromLink(html_entity_decode(requestVar('tb_link')));
+
+ $url = addslashes($url);
+ $url = $this->_utf8_to_javascript($url);
+
+ $title = addslashes($title);
+ $title = $this->_utf8_to_javascript($title);
+
+ echo "tbDone('" . requestVar('tb_link') . "', '" . $url . "', '" . $title . "');";
+
+ break;
+//mod by cles
+ // redirect
+ case 'redirect':
+ return $this->redirect(intRequestVar('tb_id'), requestVar('urlHash'));
+ break;
+//mod by cles end
+ case 'left':
+ echo $this->showLeftList(intRequestVar('tb_id'), intRequestVar('amount'));
+ break;
+
+ // delete a trackback(local)
+ case 'deletelc':
+ $err = $this->deleteLocal(intRequestVar('tb_id'), intRequestVar('from_id'));
+ if( $err )
+ return $err;
+ header('Location: ' . serverVar('HTTP_REFERER'));
+ break;
+ }
+
+ exit;
+ }
+
+
+
+ /**************************************************************************************
+ * OUTPUT
+ */
+
+ /*
+ * Show a list of left trackbacks for this ID
+ */
+ function showLeftList($tb_id, $offset = 0, $amount = 99999999) {
+ global $manager, $blog, $CONF;
+
+ $out = array();
+ $query = '
+ SELECT
+ url,
+ md5(url) as urlHash,
+ 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
+ ';
+ if($offset)
+ $query .= ' LIMIT '.intval($offset).', ' .intval($amount);
+ $res = mysql_query($query);
+ while ($row = mysql_fetch_array($res))
+ {
+
+ $row['blog_name'] = htmlspecialchars($row['blog_name'], ENT_QUOTES);
+ $row['title'] = htmlspecialchars($row['title'], ENT_QUOTES);
+ $row['excerpt'] = htmlspecialchars($row['excerpt'], ENT_QUOTES);
+ if (_CHARSET != 'UTF-8') {
+//modify start+++++++++
+ $row['blog_name'] = $this->_restore_to_utf8($row['blog_name']);
+ $row['title'] = $this->_restore_to_utf8($row['title']);
+ $row['excerpt'] = $this->_restore_to_utf8($row['excerpt']);
+//modify end+++++++++
+ $row['blog_name'] = $this->_utf8_to_entities($row['blog_name']);
+ $row['title'] = $this->_utf8_to_entities($row['title']);
+ $row['excerpt'] = $this->_utf8_to_entities($row['excerpt']);
+ }
+ $iVars = array(
+ 'action' => $this->getTrackBackUrl($tb_id),
+ 'form' => $this->getManualPingUrl($tb_id),
+ 'name' => $row['blog_name'],
+ 'title' => $row['title'],
+ 'excerpt' => $this->_cut_string($row['excerpt'], 400),
+ 'url' => htmlspecialchars($row['url'], ENT_QUOTES),
+ 'date' => htmlspecialchars(strftime($this->getOption('dateFormat'), $row['timestamp']), ENT_QUOTES)
+ );
+
+//mod by cles
+ if( $this->getOption('HideUrl') == 'yes' )
+ $iVars['url'] = $CONF['ActionURL'] . '?action=plugin&name=TrackBack&type=redirect&tb_id=' . $tb_id . '&urlHash=' . $row['urlHash'];
+ else
+ $iVars['url'] = $row['url'];
+//mod by cles end
+
+ $out[] = TEMPLATE::fill($this->getOption('tplItem'), $iVars);
+ }
+ mysql_free_result($res);
+
+ return @join("\n",$out);
+ }
+
+ /*
+ * Show a list of all trackbacks for this ID
+ */
+ function showList($tb_id, $amount = 0) {
+ $tb_id = intval($tb_id);
+ global $manager, $blog, $CONF, $member;
+//mod by cles
+ $enableHideurl = true;
+ // for TB LinkLookup
+ if(
+ strstr(serverVar('HTTP_USER_AGENT'),'Hatena Diary Track Forward Agent')
+ || strstr(serverVar('HTTP_USER_AGENT'),'NP_TrackBack')
+ || strstr(serverVar('HTTP_USER_AGENT'),'TBPingLinkLookup')
+ || strstr(serverVar('HTTP_USER_AGENT'),'MT::Plugin::BanNoReferTb')
+ || strstr(serverVar('HTTP_USER_AGENT'),'livedoorBlog')
+ ){
+ $enableHideurl = false;
+ $amount = '-1';
+ }
+//mod by cles end
+
+/*
+ $res = mysql_query('
+ SELECT
+ url,
+ md5(url) as urlHash,
+ blog_name,
+ excerpt,
+ title,
+ UNIX_TIMESTAMP(timestamp) AS timestamp
+ FROM
+ '.sql_table('plugin_tb').'
+ WHERE
+ tb_id = '.$tb_id .' AND
+ block = 0
+ ORDER BY
+ timestamp ASC
+ ');
+*/
+ $query = '
+ SELECT
+ url,
+ md5(url) as urlHash,
+ 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
+ ';
+ if( $amount == '-1' )
+ $query .= ' LIMIT 9999999';
+ elseif( $amount )
+ $query .= ' LIMIT '.intval($amount);
+
+ if( $amount != 0)
+ $res = mysql_query($query);
+
+ $gVars = array(
+ 'action' => $this->getTrackBackUrl(intval($tb_id)),
+ 'form' => $this->getManualPingUrl(intval($tb_id)),
+ 'required' => $this->getRequiredURL(intval($tb_id)),
+ );
+
+ if ($member->isLoggedIn() && $member->isAdmin()){
+ $gVars['admin'] = '<a href="' . $CONF['PluginURL'] . 'trackback/index.php?action=list&id=' . intval($tb_id) . '" target="_blank">[admin]</a>';
+ $gVars['pingform'] = '<a href="' . $CONF['PluginURL'] . 'trackback/index.php?action=ping&id=' . intval($tb_id) . '" target="_blank">[pingform]</a>';
+ }
+
+ echo TEMPLATE::fill($this->getOption('tplHeader'), $gVars);
+
+
+ while ($amount != 0 && $row = mysql_fetch_array($res))
+ {
+
+ $row['blog_name'] = htmlspecialchars($row['blog_name'], ENT_QUOTES);
+ $row['title'] = htmlspecialchars($row['title'], ENT_QUOTES);
+ $row['excerpt'] = htmlspecialchars($row['excerpt'], ENT_QUOTES);
+
+/*
+*/
+ if (_CHARSET != 'UTF-8') {
+//modify start+++++++++
+/*
+ $row['blog_name'] = $this->_utf8_to_entities($row['blog_name']);
+ $row['title'] = $this->_utf8_to_entities($row['title']);
+ $row['excerpt'] = $this->_utf8_to_entities($row['excerpt']);
+*/
+ $row['blog_name'] = $this->_restore_to_utf8($row['blog_name']);
+ $row['title'] = $this->_restore_to_utf8($row['title']);
+ $row['excerpt'] = $this->_restore_to_utf8($row['excerpt']);
+
+ $row['blog_name'] = mb_convert_encoding($row['blog_name'], _CHARSET, 'UTF-8');
+ $row['title'] = mb_convert_encoding($row['title'], _CHARSET, 'UTF-8');
+ $row['excerpt'] = mb_convert_encoding($row['excerpt'], _CHARSET, 'UTF-8');
+//modify end+++++++++
+ }
+
+//modify start+++++++++
+/*
+ $iVars = array(
+ 'action' => $this->getTrackBackUrl($tb_id),
+ 'form' => $this->getManualPingUrl($tb_id),
+ 'name' => $row['blog_name'],
+ 'title' => $row['title'],
+ 'excerpt' => $row['excerpt'],
+ 'url' => htmlspecialchars($row['url'], ENT_QUOTES),
+ 'date' => htmlspecialchars(strftime($this->getOption('dateFormat'), $row['timestamp'] + ($blog->getTimeOffset() * 3600)), ENT_QUOTES)
+ );
+*/
+ $iVars = array(
+ 'action' => $this->getTrackBackUrl($tb_id),
+ 'form' => $this->getManualPingUrl($tb_id),
+ 'name' => htmlspecialchars($row['blog_name'], ENT_QUOTES),
+ 'title' => htmlspecialchars($row['title'], ENT_QUOTES),
+ 'excerpt' => htmlspecialchars($this->_cut_string($row['excerpt'], 400), ENT_QUOTES),
+ 'url' => htmlspecialchars($row['url'], ENT_QUOTES),
+ 'date' => htmlspecialchars(strftime($this->getOption('dateFormat'), $row['timestamp']), ENT_QUOTES)
+ );
+
+//mod by cles
+ if( $enableHideurl && $this->getOption('HideUrl') == 'yes' )
+ $iVars['url'] = $CONF['ActionURL'] . '?action=plugin&name=TrackBack&type=redirect&tb_id=' . intval($tb_id) . '&urlHash=' . $row['urlHash'];
+ else
+ $iVars['url'] = $row['url'];
+//mod by cles end
+
+//modify end+++++++++
+ echo TEMPLATE::fill($this->getOption('tplItem'), $iVars);
+
+ }
+
+//modify start+++++++++
+ $q = '
+ SELECT
+ count(*)
+ FROM
+ '.sql_table('plugin_tb').'
+ WHERE
+ tb_id = '.intval($tb_id) .' AND
+ block = 0
+ ORDER BY
+ timestamp DESC
+ ';
+ $result = mysql_query($q);
+ $total = mysql_result($result,0,0);
+
+ if($amount != -1 && $total > $amount){
+ $leftcount = $total - $amount;
+
+ echo '<script type="text/javascript" src="' . $this->getAdminURL() . 'detectlist.php?tb_id='.intval($tb_id).'&amount='.intval($amount).'"></script>';
+
+?>
+
+<a name="restoftrackback" id="restoftrackback"></a>
+<div id="tbshownavi"><a href="#restoftrackback" onclick="resttbStart(); return false;" id="tbshow">Show left <?php echo $leftcount;?> Trackbacks</a></div>
+<div id="tbhidenavi" style="display: none;"><a href="#restoftrackback" onclick="hideresttb(); return false;">Hide <?php echo $leftcount;?> Trackbacks</a></div>
+<div id="resttb"></div>
+
+<?php
+ }
+//modify end+++++++++
+
+ if (mysql_num_rows($res) == 0)
+ {
+ echo TEMPLATE::fill($this->getOption('tplEmpty'), $gVars);
+ }
+ mysql_free_result($res);
+
+ echo TEMPLATE::fill($this->getOption('tplFooter'), $gVars);
+
+ }
+
+ /*
+ * Returns the TrackBack count for a TrackBack item
+ */
+ function getTrackBackCount($tb_id) {
+ return quickQuery('SELECT COUNT(*) as result FROM ' . sql_table('plugin_tb') . ' WHERE tb_id='.intval($tb_id).' AND block = 0');
+ }
+
+ /**
+ * Returns the manual ping URL
+ */
+ function getManualPingUrl($itemid) {
+ global $CONF;
+ return $CONF['ActionURL'] . '?action=plugin&name=TrackBack&type=form&tb_id='.$itemid;
+ }
+
+ /**
+ * Show the manual ping form
+ */
+ function showManualPingError($itemid, $status = '') {
+ global $CONF;
+
+ $form = true; $error = true; $success = false;
+ sendContentType('text/html', 'admin-trackback', _CHARSET);
+//modify start+++++++++
+// include ($this->getDirectory() . '/templates/form.html');
+ require_once($this->getDirectory() . '/template.php');
+ $mTemplate = new Trackback_Template(null, $this->getDirectory());
+ $mTemplate->set ('CONF', $CONF);
+ $mTemplate->set ('itemid', $itemid);
+ $mTemplate->set ('form', $form);
+ $mTemplate->set ('error', $error);
+ $mTemplate->set ('success', $success);
+ $mTemplate->set ('status', $status);
+ $mTemplate->template('templates/form.html');
+ echo $mTemplate->fetch();
+//modify end+++++++++
+ }
+
+ function showManualPingSuccess($itemid, $status = '') {
+ global $CONF;
+
+ $form = false; $error = false; $success = true;
+ sendContentType('text/html', 'admin-trackback', _CHARSET);
+//modify start+++++++++
+ //include ($this->getDirectory() . '/templates/form.html');
+ require_once($this->getDirectory() . '/template.php');
+ $mTemplate = new Trackback_Template(null, $this->getDirectory());
+ $mTemplate->set ('CONF', $CONF);
+ $mTemplate->set ('itemid', $itemid);
+ $mTemplate->set ('form', $form);
+ $mTemplate->set ('error', $error);
+ $mTemplate->set ('success', $success);
+ $mTemplate->set ('status', $status);
+ $mTemplate->template('templates/form.html');
+ echo $mTemplate->fetch();
+//modify end+++++++++
+ }
+
+ function showManualPingForm($itemid, $text = '') {
+ global $CONF;
+
+ $form = true; $error = false; $success = false;
+
+ // Check if we are allowed to accept pings
+ if ($this->getOption('AcceptPing') == 'no') {
+ $text = 'Sorry, no trackback pings are accepted';
+ $form = false; $error = true;
+ }
+
+ sendContentType('text/html', 'admin-trackback', _CHARSET);
+//modify start+++++++++
+ //include ($this->getDirectory() . '/templates/form.html');
+ require_once($this->getDirectory() . '/template.php');
+ $mTemplate = new Trackback_Template(null, $this->getDirectory());
+ $mTemplate->set ('CONF', $CONF);
+ $mTemplate->set ('itemid', $itemid);
+ $mTemplate->set ('form', $form);
+ $mTemplate->set ('error', $error);
+ $mTemplate->set ('success', $success);
+ $mTemplate->set ('status', $status);
+ $mTemplate->template('templates/form.html');
+ echo $mTemplate->fetch();
+//modify end+++++++++
+ }
+
+ /**
+ * Returns the trackback URL
+ */
+ function getTrackBackUrl($itemid) {
+ global $CONF, $manager;
+ return $CONF['ActionURL'] . '?action=plugin&name=TrackBack&tb_id='.$itemid;
+ }
+
+ /*
+ * Insert RDF code for item
+ */
+ function insertCode($itemid) {
+ $itemid = intval($itemid);
+ global $manager, $CONF;
+
+ $item = & $manager->getItem($itemid, 0, 0);
+ $blog = & $manager->getBlog(getBlogIDFromItemID($item['itemid']));
+
+/*
+ $CONF['ItemURL'] = preg_replace('/\/$/', '', $blog->getURL());
+ $uri = createItemLink($item['itemid'],'');
+*/
+ $uri = $this->_createItemLink($item['itemid'],$blog);
+
+ $title = strip_tags($item['title']);
+ $desc = strip_tags($item['body']);
+ $desc = $this->_cut_string($desc, 200);
+ $desc = htmlspecialchars($desc, ENT_QUOTES);
+
+ ?>
+ <!--
+ <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
+ <rdf:Description
+ rdf:about="<?php echo $uri; ?>"
+ dc:identifier="<?php echo $uri; ?>"
+ dc:title="<?php echo $title; ?>"
+ dc:description="<?php echo $desc; ?>"
+ trackback:ping="<?php echo $this->getTrackBackUrl($itemid)?>"
+ dc:date="<?php echo strftime('%Y-%m-%dT%H:%M:%S')?>" />
+ </rdf:RDF>
+ -->
+ <?php
+ }
+
+ /**
+ * Retrieving TrackBack Pings (when __mode=rss)
+ */
+ function rssResponse($tb_id) {
+ $itemid = intval($itemid);
+ global $manager, $CONF;
+ $item =& $manager->getItem($tb_id, 0, 0);
+
+ if($item)
+ {
+ $blog =& $manager->getBlog(getBlogIDFromItemID($item['itemid']));
+
+ $blog_name = $blog->getName();
+ $title = $item['title'];
+ $excerpt = $item['body'];
+
+//modify start+++++++++
+/*
+ if (_CHARSET != 'UTF-8')
+ {
+ $title = $this->_convert_to_utf8($title, $encoding);
+ $excerpt = $this->_convert_to_utf8($excerpt, $encoding);
+ $blog_name = $this->_convert_to_utf8($blog_name, $encoding);
+ }
+
+ $title = $this->_decode_entities(strip_tags($title));
+ $excerpt = $this->_decode_entities(strip_tags($excerpt));
+ $blog_name = $this->_decode_entities(strip_tags($blog_name));
+*/
+
+ $title = $this->_restore_to_utf8($title);
+ $excerpt = $this->_restore_to_utf8($excerpt);
+ $blog_name = $this->_restore_to_utf8($blog_name);
+//modify end+++++++++
+
+ $excerpt = $this->_cut_string($excerpt, 200);
+
+
+//modify start+++++++++
+/*
+ $CONF['ItemURL'] = preg_replace('/\/$/', '', $blog->getURL());
+ $url = createItemLink($item['itemid'],'');
+*/
+ $url = $this->_createItemLink($item['itemid'],$blog);
+//modify end+++++++++
+
+ // Use UTF-8 charset for output
+ header('Content-Type: text/xml');
+ echo "<","?xml version='1.0' encoding='UTF-8'?",">\n";
+
+ echo "<response>\n";
+ echo "\t<error>0</error>\n";
+ echo "\t<rss version='0.91'>\n";
+ echo "\t\t<channel>\n";
+ echo "\t\t\t<title>".htmlspecialchars($title, ENT_QUOTES)."</title>\n";
+ echo "\t\t\t<link>".htmlspecialchars($url, ENT_QUOTES)."</link>\n";
+ echo "\t\t\t<description>".htmlspecialchars($excerpt, ENT_QUOTES)."</description>\n";
+
+ $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';
+ $res = mysql_query($query);
+ while ($o = mysql_fetch_object($res))
+ {
+ // No need to do conversion, because it is already UTF-8
+ $data = array (
+ 'url' => htmlspecialchars($o->url, ENT_QUOTES),
+ 'blogname' => htmlspecialchars($this->_restore_to_utf8($o->blog_name), ENT_QUOTES),
+ 'timestamp' => strftime('%Y-%m-%d',$o->timestamp),
+ 'title' => htmlspecialchars($this->_restore_to_utf8($o->title), ENT_QUOTES),
+ 'excerpt' => htmlspecialchars($this->_restore_to_utf8($o->excerpt), ENT_QUOTES),
+ 'tburl' => $this->getTrackBackUrl($tb_id)
+ );
+
+ echo "\n";
+ echo "\t\t\t<item>\n";
+ echo "\t\t\t\t<title>".$data['title']."</title>\n";
+ echo "\t\t\t\t<link>".$data['url']."</link>\n";
+ echo "\t\t\t\t<description>".$data['excerpt']."</description>\n";
+ echo "\t\t\t</item>\n";
+ }
+ echo "\t\t</channel>\n";
+ echo "\t</rss>\n";
+ echo "</response>";
+ exit;
+ }
+ else
+ {
+ $this->xmlResponse(_ERROR_NOSUCHITEM);
+ }
+
+ }
+
+
+
+ /**************************************************************************************
+ * SENDING AND RECEIVING TRACKBACK PINGS
+ */
+
+ /*
+ * Send a Trackback ping to another website
+ */
+ function sendPing($itemid, $title, $url, $excerpt, $blog_name, $ping_url, $utf8flag=0)
+ {
+ $tempEncording = ($utf8flag)? 'UTF-8': _CHARSET;
+
+ // 1. Check some basic things
+ if (!$this->canSendPing()) {
+ return 'You\'re not allowed to send pings';
+ }
+
+ if ($this->getOption('SendPings') == 'no') {
+ return 'Sending trackback pings is disabled';
+ }
+
+ if ($ping_url == '') {
+ return 'No ping URL';
+ }
+
+ // 2. Check if protocol is correct http URL
+ $parsed_url = parse_url($ping_url);
+
+ if ($parsed_url['scheme'] != 'http' || $parsed_url['host'] == '')
+ return 'Bad ping URL';
+
+ $port = ($parsed_url['port']) ? $parsed_url['port'] : 80;
+
+ // 3. Create contents
+ if($tempEncording != _CHARSET){
+ $title = mb_convert_encoding($title, $tempEncording, _CHARSET);
+ $excerpt = mb_convert_encoding($excerpt, $tempEncording, _CHARSET);
+ $blog_name = mb_convert_encoding($blog_name, $tempEncording, _CHARSET);
+ }
+
+
+ $content = 'title=' . urlencode( $title );
+ $content .= '&url=' . urlencode( $url );
+ $content .= '&excerpt=' . urlencode( $excerpt );
+ $content .= '&blog_name=' . urlencode( $blog_name );
+
+# $user_agent = 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)';
+ $user_agent = 'NP_TrackBack/'. $this->getVersion();
+
+ // 4. Prepare HTTP request
+ $request = 'POST ' . $parsed_url['path'];
+
+ if ($parsed_url['query'] != '')
+ $request .= '?' . $parsed_url['query'];
+
+ $request .= " HTTP/1.1\r\n";
+ $request .= "Accept: */*\r\n";
+ $request .= "User-Agent: " . $user_agent . "\r\n";
+ $request .= ( $port == 80 )?
+ "Host: " . $parsed_url['host'] . "\r\n":
+ "Host: " . $parsed_url['host'] . ":" . $port . "\r\n";
+ $request .= "Connection: Keep-Alive\r\n";
+ $request .= "Cache-Control: no-cache\r\n";
+ $request .= "Connection: Close\r\n";
+ $request .= "Content-Length: " . strlen( $content ) . "\r\n";
+ $request .= ($utf8flag)?
+ "Content-Type: application/x-www-form-urlencoded; charset=UTF-8\r\n":
+ "Content-Type: application/x-www-form-urlencoded; charset="._CHARSET."\r\n";
+ $request .= "\r\n";
+ $request .= $content;
+
+ $socket = fsockopen( $parsed_url['host'], $port, $errno, $errstr );
+ if ( ! $socket )
+ return 'Could not send ping: '.$errstr.' ('.$errno.')';
+
+ // 5. Execute HTTP request
+ fputs($socket, $request);
+
+ // 6. Receive response
+ $result = '';
+ while (!feof($socket)) {
+ $result .= fgets($socket, 4096);
+ }
+
+ fclose($socket);
+
+ // instead of parsing the XML, just check for the error string
+ // [TODO] extract real error message and return that
+//modify start+++++++++
+
+ $DATA = split("\r\n\r\n", $result, 2);
+ preg_match("/HTTP\/1\.[0-1] ([0-9]+) ([^\r\n]*)\r?\n/",$DATA[0],$httpresp);
+ $respCd = $httpresp[1];
+ $respMsg = $httpresp[2];
+
+ if( $respCd != 200 ){
+ return 'An error occurred: HTTP Error: [' . $respCd . '] ' . $respMsg;
+ }
+ if ( strstr($DATA[1],'<error>0</error>') === false ){
+ preg_match("/<message>(.*?)<\/message>/",$DATA[1],$error_message);
+ if( $error_message[1] )
+ return 'An error occurred: '.htmlspecialchars($error_message[1], ENT_QUOTES);
+ else
+ return 'An error occurred: fatal error.';
+ }
+ }
+//modify end+++++++++
+
+ /*
+ * Handle a Trackback ping sent to this website
+ */
+ function handlePing($tb_id = 0) {
+ global $manager;
+
+ // Check if we are allowed to accept pings
+ if ($this->getOption('AcceptPing') == 'no') {
+ return 'Sorry, no trackback pings are accepted';
+ }
+
+ // Defaults
+ $spam = false;
+ $link = false;
+//modify start+++++++++
+// $block = true;
+ $block = false;
+//modify end+++++++++
+ if ($tb_id == 0)
+ $tb_id = intRequestVar('tb_id');
+
+ $rss = requestVar('__mode') == 'rss';
+//mod by cles
+ $enableLinkCheck = $this->isEnableLinkCheck($tb_id);
+ $block = ( $enableLinkCheck ) ? true : false ;
+//mod by cles end
+
+ if (!$tb_id) {
+ return 'TrackBack ID is missing (tb_id)';
+ }
+
+ if ((!$manager->existsItem($tb_id,0,0)) && ($this->getOption('CheckIDs') == 'yes')) {
+ return _ERROR_NOSUCHITEM;
+ }
+
+ // 0. Check if we need to output the list as rss
+ if ($rss) {
+ $this->rssResponse($tb_id);
+ return;
+ }
+//mod by cles
+ // check: accept pings.
+ if( $this->getBlogOption(getBlogIDFromItemID($tb_id), "AllowTrackBack") == 'yes' )
+ $isAcceptPing = ( $this->getItemOption($tb_id, 'ItemAcceptPing') == 'yes' ) ? true : false ;
+ else
+ $isAcceptPing = false;
+
+ if (! $isAcceptPing)
+ return 'Sorry, no trackback pings are accepted.';
+//mod by cles end
+
+ // 1. Get attributes
+//modify start+++++++++
+ $b =& $manager->getBlog(getBlogIDFromItemID($tb_id));
+//modify end+++++++++
+ $url = requestVar('url');
+ $title = requestVar('title');
+ $excerpt = requestVar('excerpt');
+ $blog_name = requestVar('blog_name');
+
+ if (!$url) {
+ return 'URL is missing (url)';
+ }
+
+ // 2. Conversion of encoding...
+//modify start+++++++++
+/* if (preg_match ("/;\s*charset=([^\n]+)/is", $_SERVER["CONTENT_TYPE"], $regs))
+ $encoding = strtoupper(trim($regs[1]));
+ else
+ $encoding = $this->_detect_encoding($excerpt);
+*/
+ $encoding = $this->_detect_encoding($excerpt);
+//modify end+++++++++
+
+//modify start+++++++++
+ if (_CHARSET != 'UTF-8'){
+ $title = $this->_strip_controlchar(strip_tags(mb_convert_encoding($title, _CHARSET, $encoding)));
+ $excerpt = $this->_strip_controlchar(strip_tags(mb_convert_encoding($excerpt, _CHARSET, $encoding)));
+ $blog_name = $this->_strip_controlchar(strip_tags(mb_convert_encoding($blog_name, _CHARSET, $encoding)));
+ }else{
+ $title = $this->_strip_controlchar($this->_convert_to_utf8($title, $encoding));
+ $excerpt = $this->_strip_controlchar($this->_convert_to_utf8($excerpt, $encoding));
+ $blog_name = $this->_strip_controlchar($this->_convert_to_utf8($blog_name, $encoding));
+
+ $title = $this->_decode_entities(strip_tags($title));
+ $excerpt = $this->_decode_entities(strip_tags($excerpt));
+ $blog_name = $this->_decode_entities(strip_tags($blog_name));
+ }
+//modify end+++++++++
+
+ // 4. Save data in the DB
+ $res = @mysql_query('
+ SELECT
+ tb_id, block, spam
+ FROM
+ '.sql_table('plugin_tb').'
+ WHERE
+ url = \''.mysql_real_escape_string($url).'\' AND
+ tb_id = \''.intval($tb_id).'\'
+ ');
+
+ if (mysql_num_rows($res) != 0)
+ {
+ // Existing TB, update it
+/*
+ $res = @mysql_query('
+ UPDATE
+ '.sql_table('plugin_tb').'
+ SET
+ title = "'.mysql_real_escape_string($title).'",
+ excerpt = "'.mysql_real_escape_string($excerpt).'",
+ blog_name = "'.mysql_real_escape_string($blog_name).'",
+ timestamp = '.mysqldate(time()).'
+ WHERE
+ url = "'.mysql_real_escape_string($url).'" AND
+ tb_id = "'.$tb_id.'"
+ ');
+*/
+//modify start+++++++++
+ $rows = mysql_fetch_assoc($res);
+ $spam = ( $rows['block'] || $rows['spam'] ) ? true : false;
+ $res = @mysql_query('
+ UPDATE
+ '.sql_table('plugin_tb').'
+ SET
+ title = \''.mysql_real_escape_string($title).'\',
+ excerpt = \''.mysql_real_escape_string($excerpt).'\',
+ blog_name = \''.mysql_real_escape_string($blog_name).'\',
+ timestamp = '.mysqldate($b->getCorrectTime()).'
+ WHERE
+ url = \''.mysql_real_escape_string($url).'\' AND
+ tb_id = \''.mysql_real_escape_string(intval($tb_id)).'\'
+ ');
+//modify end+++++++++
+
+ if (!$res) {
+ return 'Could not update trackback data: '.mysql_error();
+ }
+ }
+ else
+ {
+ // 4. SPAM check (for SpamCheck API 2 /w compat. API 1)
+ $spamcheck = array (
+ 'type' => 'trackback',
+ 'id' => $tb_id,
+ 'title' => $title,
+ 'excerpt' => $excerpt,
+ 'blogname' => $blog_name,
+ 'url' => $url,
+ 'return' => true,
+ 'live' => true,
+
+ /* Backwards compatibility with SpamCheck API 1*/
+ 'data' => $url . ' ' . $title . ' ' . $excerpt . ' ' . $blog_name,
+ 'ipblock' => true,
+ );
+
+ $manager->notify('SpamCheck', array ('spamcheck' => & $spamcheck));
+
+ if (isset($spamcheck['result']) && $spamcheck['result'] == true)
+ {
+ $spam = true;
+ }
+
+ // 5. Content check (TO DO)
+ if($spam == false || $enableLinkCheck == 'ignore' ) //modify
+ {
+//mod by cles
+// $contents = $this->retrieveUrl ($url);
+//
+// if (preg_match("/(".preg_quote($_SERVER["REQUEST_URI"], '/').")|(".preg_quote($_SERVER["SERVER_NAME"], '/').")/i", $contents)) {
+// $link = true;
+// }
+ if( $enableLinkCheck ){
+ $contents = $this->retrieveUrl($url);
+
+ $linkArray = $this->getPermaLinksFromText($contents);
+ $itemLink = $this->_createItemLink($tb_id, $b);
+ $itemLinkPat = '{^' . preg_quote($itemLink) .'}i';
+ foreach($linkArray as $l) {
+ if(preg_match($itemLinkPat, $l)){
+ ACTIONLOG :: add(INFO, "Trackback: LinkCheck OK. (link: $l pat: $itemLinkPat )");
+ $link = true;
+ break;
+ }
+ }
+ if( ! $link ){
+ $cnt = @count($linkArray);
+ if( $enableLinkCheck == 'ignore' ){
+ ACTIONLOG :: add(INFO, "Trackback: LinkCheck NG. [ignore] (itemid:$tb_id from: $url cnt: $cnt pat: $itemLinkPat)");
+ return 'Sorry, trackback ping is not accepted.';
+ } else {
+ ACTIONLOG :: add(INFO, "Trackback: LinkCheck NG. [block] (itemid:$tb_id from: $url cnt: $cnt pat: $itemLinkPat");
+ }
+ }
+ }
+//mod by cles end
+ }
+
+ // 6. Determine if Trackback is safe...
+//modify start+++++++++
+// $block = $spam == true || $link == false;
+// $block = $spam == true ;
+//modify end+++++++++
+//mod by cles
+ if ( $enableLinkCheck )
+ $block = ($spam == true || $link == false);
+ else
+ $block = $spam == true ;
+//mod by cles end
+ // New TB, insert it
+/*
+ $query = '
+ INSERT INTO
+ '.sql_table('plugin_tb').'
+ SET
+ tb_id = "'.$tb_id.'",
+ block = "'.($block ? '1' : '0').'",
+ spam = "'.($spam ? '1' : '0').'",
+ link = "'.($link ? '1' : '0').'",
+ url = "'.mysql_real_escape_string($url).'",
+ title = "'.mysql_real_escape_string($title).'",
+ excerpt = "'.mysql_real_escape_string($excerpt).'",
+ blog_name = "'.mysql_real_escape_string($blog_name).'",
+ timestamp = '.mysqldate(time()).'
+ ';
+*/
+//modify start+++++++++
+ $query = '
+ INSERT INTO
+ '.sql_table('plugin_tb').'
+ SET
+ tb_id = \''.mysql_real_escape_string(intval($tb_id)).'\',
+ block = \''.($block ? '1' : '0').'\',
+ spam = \''.($spam ? '1' : '0').'\',
+ link = \''.($link ? '1' : '0').'\',
+ url = \''.mysql_real_escape_string($url).'\',
+ title = \''.mysql_real_escape_string($title).'\',
+ excerpt = \''.mysql_real_escape_string($excerpt).'\',
+ blog_name = \''.mysql_real_escape_string($blog_name).'\',
+ timestamp = '.mysqldate($b->getCorrectTime()).'
+ ';
+//modify end+++++++++
+
+ $res = @mysql_query($query);
+
+ if (!$res) {
+ return 'Could not save trackback data, possibly because of a double entry: ' . mysql_error() . $query;
+ }
+ }
+
+ // 7. Send notification e-mail if needed
+ if ($this->getOption('Notify') == 'yes' && $spam == false)
+ {
+ $destAddress = $this->getOption('NotifyEmail');
+
+
+ $vars = array (
+ 'tb_id' => $tb_id,
+ 'url' => $url,
+ 'title' => $title,
+ 'excerpt' => $excerpt,
+ 'blogname' => $blog_name
+ );
+
+//modify start+++++++++
+/*
+ $vars = array (
+ 'tb_id' => $tb_id,
+ 'url' => $url,
+ 'title' => mb_convert_encoding($title, 'ISO-2022-JP', _CHARSET),
+ 'excerpt' => mb_convert_encoding($excerpt, 'ISO-2022-JP', _CHARSET),
+ 'blogname' => mb_convert_encoding($blog_name, 'ISO-2022-JP', _CHARSET)
+ );
+*/
+//maybe not needed because japanese version has "mb_send_mail" in function notify
+//modify end+++++++++
+
+ $mailto_title = TEMPLATE::fill($this->notificationMailTitle, $vars);
+ $mailto_msg = TEMPLATE::fill($this->notificationMail, $vars);
+
+ global $CONF, $DIR_LIBS;
+
+ // make sure notification class is loaded
+ if (!class_exists('notification'))
+ include($DIR_LIBS . 'NOTIFICATION.php');
+
+ $notify = new NOTIFICATION($destAddress);
+ $notify->notify($mailto_title, $mailto_msg , $CONF['AdminEmail']);
+//mod by cles+++++++++++
+ if ($manager->pluginInstalled('NP_Cache')){
+ $p =& $manager->getPlugin('NP_Cache');
+ $p->setCurrentBlog($tb_id);
+ $p->cleanItem($tb_id);
+ $p->cleanArray(array('index'));
+ }
+//mod by cles end +++++++++++
+ }
+ return '';
+ }
+
+ function xmlResponse($errorMessage = '')
+ {
+ header('Content-Type: text/xml');
+
+ echo "<","?xml version='1.0' encoding='UTF-8'?",">\n";
+ echo "<response>\n";
+
+ if ($errorMessage)
+ echo "\t<error>1</error>\n\t<message>",htmlspecialchars($errorMessage, ENT_QUOTES),"</message>\n";
+ else
+ echo "\t<error>0</error>\n";
+
+ echo "</response>";
+ exit;
+ }
+
+ /*
+ * Check if member may send ping (check if logged in)
+ */
+ function canSendPing() {
+ global $member;
+ return $member->isLoggedIn() || $this->xmlrpc;
+ }
+
+
+//mod by cles
+ function redirect($tb_id, $urlHash){
+ global $CONF;
+ $query = 'SELECT url FROM '.sql_table('plugin_tb').' WHERE tb_id='.intval($tb_id).' and md5(url)="'.$urlHash.'"';
+ $res = mysql_query($query);
+
+ $url = $CONF['SiteURL'];
+
+ if ($o = mysql_fetch_object($res)) {
+ $url = htmlspecialchars($o->url, ENT_QUOTES);
+ }
+
+ $url = stripslashes($url);
+ $url = str_replace('&','&',$url);
+ $url = str_replace('<','<',$url);
+ $url = str_replace('>','>',$url);
+ $url = str_replace('"','"',$url);
+
+ header('Location: '.$url);
+ }
+
+ function getRequiredURL($itemid){
+ global $manager;
+ $blog = & $manager->getBlog(getBlogIDFromItemID($item['itemid']));
+ if( $this->isEnableLinkCheck($itemid) )
+ return $this->_createItemLink($itemid, $blog);
+ return null;
+ }
+
+ function isEnableLinkCheck($itemid){
+ $blogid = getBlogIDFromItemID($itemid);
+
+// if( ! $this->getBlogOption($blogid, 'enableLinkCheck') == 'yes' )
+// return false;
+
+ $val = $this->getItemOption($itemid, 'isAcceptW/OLink');
+ switch( $val ){
+ case 'default':
+ if($this->getBlogOption($blogid, 'isAcceptW/OLinkDef') == 'yes')
+ return false;
+ break;
+ case 'yes':
+ return false;
+ break;
+ case 'no':
+ break;
+ default :
+ ACTIONLOG :: add(INFO, "Trackback: Unknown Option (itemid:$itemid, value:$val)");
+ return false;
+ }
+ return $this->getBlogOption($blogid, 'isAcceptW/OLinkDef');
+ }
+//mod by cles end
+
+ /**************************************************************************************
+ * EVENTS
+ */
+
+ function event_SendTrackback($data) {
+ global $manager;
+
+ // Enable sending trackbacks for the XML-RPC API, otherwise we would
+ // get an error because the current user is not exactly logged in.
+ $this->xmlrpc = true;
+
+ $itemid = $data['tb_id'];
+ $item = &$manager->getItem($itemid, 0, 0);
+ if (!$item) return; // don't ping for draft & future
+ if ($item['draft']) return; // don't ping on draft items
+
+ // gather some more information, needed to send the ping (blog name, etc)
+ $blog =& $manager->getBlog(getBlogIDFromItemID($itemid));
+ $blog_name = $blog->getName();
+
+ $title = $data['title'] != '' ? $data['title'] : $item['title'];
+ $title = strip_tags($title);
+
+ $excerpt = $data['body'] != '' ? $data['body'] : $item['body'];
+ $excerpt = strip_tags($excerpt);
+ $excerpt = $this->_cut_string($excerpt, 200);
+
+ $CONF['ItemURL'] = preg_replace('/\/$/', '', $blog->getURL());
+ //$url = createItemLink($itemid);
+ $url = $this->_createItemLink($itemid, $blog);
+
+ while (list(,$url) = each($data['urls'])) {
+ $res = $this->sendPing($itemid, $title, $url, $excerpt, $blog_name, $url);
+ if ($res) ACTIONLOG::add(WARNING, 'TrackBack Error:' . $res . ' (' . $url . ')');
+ }
+ }
+
+ function event_RetrieveTrackback($data) {
+
+ $res = mysql_query('
+ SELECT
+ url,
+ title,
+ UNIX_TIMESTAMP(timestamp) AS timestamp
+ FROM
+ '.sql_table('plugin_tb').'
+ WHERE
+ tb_id = '.intval($data['tb_id']).' AND
+ block = 0
+ ORDER BY
+ timestamp ASC
+ ');
+
+ while ($row = mysql_fetch_array($res)) {
+
+ $trackback = array(
+ 'title' => $row['title'],
+ 'url' => $row['url'],
+ 'ip' => ''
+ );
+
+ $data['trackbacks'][] = $trackback;
+ }
+ }
+/*
+ function event_BookmarkletExtraHead($data) {
+ global $NP_TB_URL;
+ list ($NP_TB_URL,) = $this->getURIfromLink(requestVar('loglink'));
+ }
+*/
+ function event_PrepareItemForEdit($data) {
+// if (!$this->getOption('AutoXMLHttp'))
+ if ($this->getOption('AutoXMLHttp') == 'no')
+ {
+ // The space between body and more is to make sure we didn't join 2 words accidently....
+ $this->larray = $this->autoDiscovery($data['item']['body'].' '.$data['item']['more']);
+ }
+ }
+
+ /*
+ * After an item has been added to the database, send out a ping if requested
+ * (trackback_ping_url variable in request)
+ */
+ function event_PostAddItem($data) {
+ $this->pingTrackback($data);
+ }
+
+ function event_PreUpdateItem($data) {
+ $this->pingTrackback($data);
+ }
+
+ /**
+ * Add trackback options to add item form/bookmarklet
+ */
+ function event_AddItemFormExtras($data) {
+
+// global $NP_TB_URL;
+
+ ?>
+ <h3>TrackBack</h3>
+ <p>
+<!--modify start+++++++++-->
+<!-- <label for="plug_tb_url">TrackBack Ping URL:</label>
+ <input type="text" value="<?php if (isSet($NP_TB_URL)) {echo $NP_TB_URL;} ?>" id="plug_tb_url" name="trackback_ping_url" size="60" />
+-->
+<!--modify end+++++++++-->
+ <label for="plug_tb_url">TrackBack URL:</label><br />
+ <textarea id="plug_tb_url" name="trackback_ping_url" cols="60" rows="5" style="font:normal xx-small Tahoma, Arial, verdana ;"></textarea>
+<input type="button" name="btnAdd" value="<?php echo _TB_LIST_IT?>" onClick="AddStart()" />
+
+ <br />
+
+ <?php
+// if ($this->getOption('AutoXMLHttp'))
+ if ($this->getOption('AutoXMLHttp') == 'yes')
+ {
+ ?>
+ <div id="tb_auto">
+<input type="button" name="discoverit" value="Auto Discover" onclick="tbSetup();" />
+ <img id='tb_busy' src='<?php echo $this->getAdminURL(); ?>busy.gif' style="display:none;" /><br />
+ <div id="tb_auto_title"></div>
+ <table border="1"><tbody id="tb_ping_list"></tbody></table>
+ <input type="hidden" id="tb_url_amount" name="tb_url_amount" value="0" />
+ </div>
+
+ <?php
+ $this->jsautodiscovery();
+ }
+ ?>
+ </p>
+ <?php
+ }
+
+ /**
+ * Add trackback options to edit item form/bookmarklet
+ */
+ function event_EditItemFormExtras($data) {
+ global $CONF;
+ ?>
+<!-- <input type="text" value="" id="plug_tb_url" name="trackback_ping_url" size="60" /><br />-->
+ <h3>TrackBack</h3>
+ <p>
+ <label for="plug_tb_url">TrackBack URL:</label><br />
+ <textarea id="plug_tb_url" name="trackback_ping_url" cols="60" rows="5" style="font:normal xx-small Tahoma, Arial, verdana ;"></textarea>
+<input type="button" name="btnAdd" value="<?php echo _TB_LIST_IT?>" onClick="AddStart()" />
+
+ <?php
+// if ($this->getOption('AutoXMLHttp'))
+ if ($this->getOption('AutoXMLHttp') == 'yes')
+ {
+ ?>
+
+
+ <div id="tb_auto">
+<input type="button" name="discoverit" value="Auto Discover" onclick="tbSetup();" />
+ <img id='tb_busy' src='<?php echo $this->getAdminURL(); ?>busy.gif' style="display:none;" /><br />
+ <div id="tb_auto_title"></div>
+ <table border="1"><tbody id="tb_ping_list"></tbody></table>
+ <input type="hidden" id="tb_url_amount" name="tb_url_amount" value="0" />
+ </div>
+
+ <?php
+ $this->jsautodiscovery();
+ }
+ else
+ {
+ if (count($this->larray) > 0)
+ {
+ ?>
+ Auto Discovered Ping URL's:<br />
+ <?php
+ echo '<input type="hidden" name="tb_url_amount" value="'.count($this->larray).'" />';
+
+ $i = 0;
+
+ while (list($url, $title) = each ($this->larray))
+ {
+//modify start+++++++++
+ if (_CHARSET != 'UTF-8') {
+ $title = $this->_utf8_to_entities($title);
+ $title = mb_convert_encoding($title, _CHARSET, 'UTF-8');
+ }
+//modify end+++++++++
+
+ echo '<input type="checkbox" name="tb_url_'.$i.
+ '" value="'.$url.'" id="tb_url_'.$i.
+ '" /><label for="tb_url_'.$i.'" title="'.$url.'">'.$title.'</label><br />';
+
+ $i++;
+ }
+ }
+ }
+ ?>
+ </p>
+ <?php
+ }
+
+ /**
+ * Insert Javascript AutoDiscovery routines
+ */
+ function jsautodiscovery()
+ {
+ global $CONF;
+
+ ?>
+ <script type='text/javascript' src='<?php echo $this->getAdminURL(); ?>autodetect.php'></script>
+ <?php
+ }
+
+ /**
+ * Ping all URLs
+ */
+ function pingTrackback($data) {
+ global $manager, $CONF;
+
+ $ping_urls_count = 0;
+ $ping_urls = array();
+ $utf8flag = array();
+ $localflag = array();
+
+ $ping_url = requestVar('trackback_ping_url');
+//modify start+++++++++
+/*
+ if ($ping_url) {
+ $ping_urls[0] = $ping_url;
+ $ping_urls_count++;
+ }
+*/
+ if (trim($ping_url)) {
+ $ping_urlsTemp = array();
+ $ping_urlsTemp = preg_split("/[\s,]+/", trim($ping_url));
+ for($i=0;$i<count($ping_urlsTemp);$i++){
+ $ping_urls[] = trim($ping_urlsTemp[$i]);
+ $ping_urls_count++;
+ }
+ }
+//modify end+++++++++
+
+ $tb_url_amount = requestVar('tb_url_amount');
+ for ($i=0;$i<$tb_url_amount;$i++) {
+ $tb_temp_url = requestVar('tb_url_'.$i);
+ if ($tb_temp_url) {
+ $ping_urls[$ping_urls_count] = $tb_temp_url;
+ $utf8flag[$ping_urls_count] = (requestVar('tb_url_'.$i.'_utf8') == 'on')? 1: 0;
+ $localflag[$ping_urls_count] = (requestVar('tb_url_'.$i.'_local') == 'on')? 1: 0;
+ $ping_urls_count++;
+ }
+ }
+
+ if ($ping_urls_count <= 0) {
+ return;
+ }
+
+ $itemid = $data['itemid'];
+ $item = &$manager->getItem($itemid, 0, 0);
+ if (!$item) return; // don't ping for draft & future
+ if ($item['draft']) return; // don't ping on draft items
+
+ // gather some more information, needed to send the ping (blog name, etc)
+ $blog =& $manager->getBlog(getBlogIDFromItemID($itemid));
+ $blog_name = $blog->getName();
+
+ $title = $data['title'] != '' ? $data['title'] : $item['title'];
+ $title = strip_tags($title);
+
+ $excerpt = $data['body'] != '' ? $data['body'] : $item['body'];
+ $excerpt = strip_tags($excerpt);
+ $excerpt = $this->_cut_string($excerpt, 200);
+
+/*
+ $CONF['ItemURL'] = preg_replace('/\/$/', '', $blog->getURL());
+ $url = createItemLink($itemid);
+*/
+ $url = $this->_createItemLink($item['itemid'],$blog);
+
+ // send the ping(s) (add errors to actionlog)
+ for ($i=0; $i<count($ping_urls); $i++) {
+ if( ! $localflag[$i] )
+ $res = $this->sendPing($itemid, $title, $url, $excerpt, $blog_name, $ping_urls[$i], $utf8flag[$i]);
+ else
+ $res = $this->handleLocalPing($itemid, $title, $excerpt, $blog_name, $ping_urls[$i]);
+ if ($res) ACTIONLOG::add(WARNING, 'TrackBack Error:' . $res . ' (' . $ping_urls[$i] . ')');
+ }
+ }
+
+
+
+
+ /**************************************************************************************
+ * AUTO-DISCOVERY
+ */
+
+ /*
+ * Auto-Discovery of TrackBack Ping URLs based on HTML story
+ */
+ function autoDiscovery($text)
+ {
+ $links = $this->getPermaLinksFromText($text);
+ $result = array();
+
+ for ($i = 0; $i < count($links); $i++)
+ {
+ list ($url, $title) = $this->getURIfromLink($links[$i]);
+
+ if ($url != '')
+ $result[$url] = $title;
+ }
+
+ return $result;
+ }
+
+ /*
+ * Auto-Discovery of TrackBack Ping URLs based on single link
+ */
+ function getURIfromLink($link)
+ {
+
+ // Check to see if the cache contains this link
+ $res = mysql_query('SELECT url, title FROM '.sql_table('plugin_tb_lookup').' WHERE link=\''.mysql_real_escape_string($link).'\'');
+
+ if ($row = mysql_fetch_array($res))
+ {
+ if ($row['title'] != '')
+ {
+//modify start+++++++++
+ if (_CHARSET != 'UTF-8'){
+ $row['title'] = mb_convert_encoding($row['title'], 'UTF-8', _CHARSET);
+ $row['title'] = $this->_decode_entities($row['title']);
+ }
+//modify end+++++++++
+ return array (
+ $row['url'], $row['title']
+ );
+ }
+ else
+ {
+ return array (
+ $row['url'], $row['url']
+ );
+ }
+ }
+
+ // Retrieve RDF
+ if (($rdf = $this->getRDFFromLink($link)) !== false)
+ {
+ // Get PING attribute
+ if (($uri = $this->getAttributeFromRDF($rdf, 'trackback:ping')) !== false)
+ {
+ // Get TITLE attribute
+ if (($title = $this->getAttributeFromRDF($rdf, 'dc:title')) !== false)
+ {
+ // Get CREATOR attribute
+ if (($author = $this->getAttributeFromRDF($rdf, 'dc:creator')) !== false)
+ {
+ $title = $author. ": " . $title;
+ }
+
+ $uri = $this->_decode_entities($uri);
+//modify start+++++++++
+ if (_CHARSET != 'UTF-8')
+ $convertedTitle = mb_convert_encoding($title, _CHARSET, 'UTF-8');
+ else
+ $convertedTitle = $title;
+/*
+ // Store in cache
+ $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)."')");
+*/
+ // Store in cache
+ $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)."')");
+//modify end+++++++++
+ $title = $this->_decode_entities($title);
+
+ return array (
+ $uri, $title
+ );
+ }
+ else
+ {
+ $uri = html_entity_decode($uri, ENT_COMPAT);
+
+ // Store in cache
+ $res = mysql_query("INSERT INTO ".sql_table('plugin_tb_lookup')." (link, url, title) VALUES ('".mysql_real_escape_string($link)."','".mysql_real_escape_string($uri)."','')");
+
+ return array (
+ $uri, $uri
+ );
+ }
+ }
+ }
+
+ // Store in cache
+ $res = mysql_query("INSERT INTO ".sql_table('plugin_tb_lookup')." (link, url, title) VALUES ('".mysql_real_escape_string($link)."','','')");
+
+ return array ('', '');
+ }
+
+ /*
+ * Detect links used in HTML code
+ */
+ function getPermaLinksFromText($text)
+ {
+ $links = array();
+
+ if (preg_match_all('/<a ([^>]+)>/', $text, $array, PREG_SET_ORDER))
+ {
+ for ($i = 0; $i < count($array); $i++)
+ {
+ preg_match('/href="http:\/\/(.+?)"/', $array[$i][1], $matches);
+ $links['http://'.$matches[1]] = 1;
+ }
+ }
+
+ return array_keys($links);
+ }
+
+ /*
+ * Retrieve RDF code from external link
+ */
+ function getRDFFromLink($link)
+ {
+ if ($content = $this->getContents($link))
+ {
+ preg_match_all('/(<rdf:RDF.*?<\/rdf:RDF>)/sm', $content, $rdfs, PREG_SET_ORDER);
+
+ if (count($rdfs) > 1)
+ {
+ for ($i = 0; $i < count($rdfs); $i++)
+ {
+ if (preg_match('|dc:identifier="'.preg_quote($link).'"|ms',$rdfs[$i][1]))
+ {
+ return $rdfs[$i][1];
+ }
+ }
+ }
+ else
+ {
+ // No need to check the identifier
+ return $rdfs[0][1];
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Retrieve the contents of an external (X)HTML document
+ */
+ function getContents($link) {
+
+ // Use cURL extention if available
+ if (function_exists("curl_init") && $this->useCurl == 2)
+ {
+ // Make HEAD request
+ $ch = curl_init();
+ @curl_setopt($ch, CURLOPT_URL, $link);
+ @curl_setopt($ch, CURLOPT_HEADER, true);
+ @curl_setopt($ch, CURLOPT_NOBODY, true);
+ @curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
+ @curl_setopt($ch, CURLOPT_MAXREDIRS, 5);
+ @curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+ @curl_setopt($ch, CURLOPT_TIMEOUT, 20);
+ @curl_setopt($ch, CURLOPT_USERAGENT, 'NP_TrackBack/'. $this->getVersion());
+
+ $headers = curl_exec($ch);
+ curl_close($ch);
+
+ // Check if the link points to a (X)HTML document
+ if (preg_match('/Content-Type: (text\/html|application\/xhtml+xml)/i', $headers))
+ {
+ return $this->retrieveUrl ($link);
+ }
+
+ return false;
+ }
+ else
+ {
+ return $this->retrieveUrl ($link);
+ }
+ }
+
+ /*
+ * Get a single attribute from RDF
+ */
+ function getAttributeFromRDF($rdf, $attribute)
+ {
+ if (preg_match('/'.$attribute.'="([^"]+)"/', $rdf, $matches))
+ {
+ return $matches[1];
+ }
+
+ return false;
+ }
+
+
+
+
+
+
+ /**************************************************************************************/
+ /* Internal helper functions for dealing with external file retrieval */
+
+ function retrieveUrl ($url) {
+//mod by cles
+ $ua = ini_set('user_agent', 'NP_TrackBack/'. $this->getVersion());
+//mod by cles end
+ if (function_exists('curl_init') && $this->useCurl > 0)
+ {
+ // Set options
+ $ch = curl_init();
+ @curl_setopt($ch, CURLOPT_URL, $url);
+ @curl_setopt($ch, CURLOPT_HEADER, 1);
+ @curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
+ @curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1);
+ @curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
+ @curl_setopt($ch, CURLOPT_MAXREDIRS, 5);
+ @curl_setopt($ch, CURLOPT_TIMEOUT, 20);
+ @curl_setopt($ch, CURLOPT_USERAGENT, 'NP_TrackBack/'. $this->getVersion());
+
+ // Retrieve response
+ $raw = curl_exec($ch);
+ $info = curl_getinfo($ch);
+
+ // Split into headers and contents
+ $headers = substr($raw, 0, $info['header_size']);
+ $contents = substr($raw, $info['header_size']);
+
+ curl_close($ch);
+ }
+ elseif ($fp = @fopen ($url, "r"))
+ {
+//mod by cles
+// $contents = fread($fp, 8192);
+ $contents = '';
+ while (!feof($fp)) {
+ $contents .= fread($fp, 8192);
+ }
+//mod by cles end
+ $headers = '';
+
+ fclose($fp);
+ }
+//mod by cles
+ ini_set('user_agent', $ua);
+//mod by cles end
+
+ // Next normalize the encoding to UTF8...
+ $contents = $this->_convert_to_utf8_auto($contents, $headers);
+
+ return $contents;
+ }
+
+
+ /**************************************************************************************/
+ /* Internal helper functions for dealing with encodings and entities */
+
+ var $entities_cp1251 = array (
+ '€' => '€',
+ '‚' => '‚',
+ 'ƒ' => 'ƒ',
+ '„' => '„',
+ '…' => '…',
+ '†' => '†',
+ '‡' => '‡',
+ 'ˆ' => 'ˆ',
+ '‰' => '‰',
+ 'Š' => 'Š',
+ '‹' => '‹',
+ 'Œ' => 'Œ',
+ 'Ž' => 'Ž',
+ '‘' => '‘',
+ '’' => '’',
+ '“' => '“',
+ '”' => '”',
+ '•' => '•',
+ '–' => '–',
+ '—' => '—',
+ '˜' => '˜',
+ '™' => '™',
+ 'š' => 'š',
+ '›' => '›',
+ 'œ' => 'œ',
+ 'ž' => 'ž',
+ 'Ÿ' => 'Ÿ',
+ );
+
+ var $entities_default = array (
+ '"' => '"',
+ '&' => '&',
+ ''' => ''',
+ '<' => '<',
+ '>' => '>',
+ );
+
+ var $entities_latin = array (
+ ' ' => ' ',
+ '¡' => '¡',
+ '¢' => '¢',
+ '£' => '£',
+ '¤' => '¤',
+ '¥' => '¥',
+ '¦' => '¦',
+ '§' => '§',
+ '¨' => '¨',
+ '©' => '©',
+ 'ª' => 'ª',
+ '«' => '«',
+ '¬' => '¬',
+ '­' => '­',
+ '®' => '®',
+ '¯' => '¯',
+ '°' => '°',
+ '±' => '±',
+ '²' => '²',
+ '³' => '³',
+ '´' => '´',
+ 'µ' => 'µ',
+ '¶' => '¶',
+ '·' => '·',
+ '¸' => '¸',
+ '¹' => '¹',
+ 'º' => 'º',
+ '»' => '»',
+ '¼' => '¼',
+ '½' => '½',
+ '¾' => '¾',
+ '¿' => '¿',
+ 'À' => 'À',
+ 'Á' => 'Á',
+ 'Â' => 'Â',
+ 'Ã' => 'Ã',
+ 'Ä' => 'Ä',
+ 'Å' => 'Å',
+ 'Æ' => 'Æ',
+ 'Ç' => 'Ç',
+ 'È' => 'È',
+ 'É' => 'É',
+ 'Ê' => 'Ê',
+ 'Ë' => 'Ë',
+ 'Ì' => 'Ì',
+ 'Í' => 'Í',
+ 'Î' => 'Î',
+ 'Ï' => 'Ï',
+ 'Ð' => 'Ð',
+ 'Ñ' => 'Ñ',
+ 'Ò' => 'Ò',
+ 'Ó' => 'Ó',
+ 'Ô' => 'Ô',
+ 'Õ' => 'Õ',
+ 'Ö' => 'Ö',
+ '×' => '×',
+ 'Ø' => 'Ø',
+ 'Ù' => 'Ù',
+ 'Ú' => 'Ú',
+ 'Û' => 'Û',
+ 'Ü' => 'Ü',
+ 'Ý' => 'Ý',
+ 'Þ' => 'Þ',
+ 'ß' => 'ß',
+ 'à' => 'à',
+ 'á' => 'á',
+ 'â' => 'â',
+ 'ã' => 'ã',
+ 'ä' => 'ä',
+ 'å' => 'å',
+ 'æ' => 'æ',
+ 'ç' => 'ç',
+ 'è' => 'è',
+ 'é' => 'é',
+ 'ê' => 'ê',
+ 'ë' => 'ë',
+ 'ì' => 'ì',
+ 'í' => 'í',
+ 'î' => 'î',
+ 'ï' => 'ï',
+ 'ð' => 'ð',
+ 'ñ' => 'ñ',
+ 'ò' => 'ò',
+ 'ó' => 'ó',
+ 'ô' => 'ô',
+ 'õ' => 'õ',
+ 'ö' => 'ö',
+ '÷' => '÷',
+ 'ø' => 'ø',
+ 'ù' => 'ù',
+ 'ú' => 'ú',
+ 'û' => 'û',
+ 'ü' => 'ü',
+ 'ý' => 'ý',
+ 'þ' => 'þ',
+ 'ÿ' => 'ÿ',
+ );
+
+ var $entities_extended = array (
+ 'Œ' => 'Œ',
+ 'œ' => 'å',
+ 'Š' => 'Š',
+ 'š' => 'š',
+ 'Ÿ' => 'Ÿ',
+ 'ˆ' => 'ˆ',
+ '˜' => '˜',
+ '&esnp;' => ' ',
+ ' ' => ' ',
+ ' ' => ' ',
+ '‌' => '‌',
+ '‍' => '‍',
+ '‎' => '‎',
+ '‏' => '‏',
+ '–' => '–',
+ '—' => '—',
+ '‘' => '‘',
+ '’' => '’',
+ '‚' => '‚',
+ '“' => '“',
+ '”' => '”',
+ '„' => '„',
+ '†' => '†',
+ '‡' => '‡',
+ '‰' => '‰',
+ '‹' => '‹',
+ '›' => '›',
+ '€' => '€',
+ 'ƒ' => 'ƒ',
+ 'Α' => 'Α',
+ 'Β' => 'Β',
+ 'Γ' => 'Γ',
+ 'Δ' => 'Δ',
+ 'Ε' => 'Ε',
+ 'Ζ' => 'Ζ',
+ 'Η' => 'Η',
+ 'Θ' => 'Θ',
+ 'Ι' => 'Ι',
+ 'Κ' => 'Κ',
+ 'Λ' => 'Λ',
+ 'Μ' => 'Μ',
+ 'Ν' => 'Ν',
+ 'Ξ' => 'Ξ',
+ 'Ο' => 'Ο',
+ 'Π' => 'Π',
+ 'Ρ' => 'Ρ',
+ 'Σ' => 'Σ',
+ 'Τ' => 'Τ',
+ 'Υ' => 'Υ',
+ 'Φ' => 'Φ',
+ 'Χ' => 'Χ',
+ 'Ψ' => 'Ψ',
+ 'Ω' => 'Ω',
+ 'α' => 'α',
+ 'β' => 'β',
+ 'γ' => 'γ',
+ 'δ' => 'δ',
+ 'ε' => 'ε',
+ 'ζ' => 'ζ',
+ 'η' => 'η',
+ 'θ' => 'θ',
+ 'ι' => 'ι',
+ 'κ' => 'κ',
+ 'λ' => 'λ',
+ 'μ' => 'μ',
+ 'ν' => 'ν',
+ 'ξ' => 'ξ',
+ 'ο' => 'ο',
+ 'π' => 'π',
+ 'ρ' => 'ρ',
+ 'ς' => 'ς',
+ 'σ' => 'σ',
+ 'τ' => 'τ',
+ 'υ' => 'υ',
+ 'φ' => 'φ',
+ 'χ' => 'χ',
+ 'ψ' => 'ψ',
+ 'ω' => 'ω',
+ 'ϑ' => 'ϑ',
+ 'ϒ' => 'ϒ',
+ 'ϖ' => 'ϖ',
+ '•' => '•',
+ '…' => '…',
+ '′' => '′',
+ '″' => '″',
+ '‾' => '‾',
+ '⁄' => '⁄',
+ '℘' => '℘',
+ 'ℑ' => 'ℑ',
+ 'ℜ' => 'ℜ',
+ '™' => '™',
+ 'ℵ' => 'ℵ',
+ '←' => '←',
+ '↑' => '↑',
+ '→' => '→',
+ '↓' => '↓',
+ '↔' => '↔',
+ '↵' => '↵',
+ '⇐' => '⇐',
+ '⇑' => '⇑',
+ '⇒' => '⇒',
+ '⇓' => '⇓',
+ '⇔' => '⇔',
+ '∀' => '∀',
+ '∂' => '∂',
+ '∃' => '∃',
+ '∅' => '∅',
+ '∇' => '∇',
+ '∈' => '∈',
+ '∉' => '∉',
+ '∋' => '∋',
+ '∏' => '∏',
+ '∑' => '∑',
+ '−' => '−',
+ '∗' => '∗',
+ '√' => '√',
+ '∝' => '∝',
+ '∞' => '∞',
+ '∠' => '∠',
+ '∧' => '∧',
+ '∨' => '∨',
+ '∩' => '∩',
+ '∪' => '∪',
+ '∫' => '∫',
+ '∴' => '∴',
+ '∼' => '∼',
+ '≅' => '≅',
+ '≈' => '≈',
+ '≠' => '≠',
+ '≡' => '≡',
+ '≤' => '≤',
+ '≥' => '≥',
+ '⊂' => '⊂',
+ '⊃' => '⊃',
+ '⊄' => '⊄',
+ '⊆' => '⊆',
+ '⊇' => '⊇',
+ '⊕' => '⊕',
+ '⊗' => '⊗',
+ '⊥' => '⊥',
+ '⋅' => '⋅',
+ '⌈' => '⌈',
+ '⌉' => '⌉',
+ '⌊' => '⌊',
+ '⌋' => '⌋',
+ '⟨' => '〈',
+ '⟩' => '〉',
+ '◊' => '◊',
+ '♠' => '♠',
+ '♣' => '♣',
+ '♥' => '♥',
+ '♦' => '♦',
+ );
+
+
+//modify start+++++++++
+ function _restore_to_utf8($contents)
+ {
+ if (_CHARSET != 'UTF-8')
+ {
+ $contents = mb_convert_encoding($contents, 'UTF-8', _CHARSET);
+ }
+ $contents = $this->_decode_entities(strip_tags($contents));
+ return $contents;
+ }
+//modify end+++++++++
+ function _detect_encoding($string)
+ {
+//modify start+++++++++
+ if (function_exists('mb_convert_encoding')) {
+ $encoding = (preg_match ("/;\s*charset=([^\n]+)/is", serverVar("CONTENT_TYPE"), $regs))?
+ strtoupper(trim($regs[1])):
+ '';
+
+ if ( ($encoding !="") && ((mb_http_input("P") == "") || ( strtolower( ini_get("mbstring.http_input") ) == "pass")) ) {
+ return $encoding;
+ } else {
+ $encoding = mb_detect_encoding($string, 'UTF-8,EUC-JP,SJIS,ISO-8859-1,ASCII,JIS');
+ }
+ return ( $encoding ) ? $encoding : 'ISO-8859-1';
+ }
+//modify end+++++++++
+ if (!ereg("[\x80-\xFF]", $string) && !ereg("\x1B", $string))
+ return 'US-ASCII';
+
+ if (!ereg("[\x80-\xFF]", $string) && ereg("\x1B", $string))
+ return 'ISO-2022-JP';
+
+ if (preg_match("/^([\x01-\x7F]|[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF][\x80-\xBF])+$/", $string) == 1)
+ return 'UTF-8';
+
+ if (preg_match("/^([\x01-\x7F]|\x8E[\xA0-\xDF]|\x8F[xA1-\xFE][\xA1-\xFE]|[\xA1-\xFE][\xA1-\xFE])+$/", $string) == 1)
+ return 'EUC-JP';
+
+ if (preg_match("/^([\x01-\x7F]|[\xA0-\xDF]|[\x81-\xFC][\x40-\xFC])+$/", $string) == 1)
+ return 'Shift_JIS';
+
+ return 'ISO-8859-1';
+ }
+
+ function _convert_to_utf8($contents, $encoding)
+ {
+ $done = false;
+
+//modify start+++++++++
+// if (!$done && function_exists('iconv'))
+// {
+//
+// $result = @iconv($encoding, 'UTF-8//IGNORE', $contents);
+//
+// if ($result)
+// {
+// $contents = $result;
+// $done = true;
+// }
+// }
+
+ if(!$done && function_exists('mb_convert_encoding'))
+ {
+
+ if( function_exists('mb_substitute_character') ){
+ @mb_substitute_character('none');
+ }
+ $result = @mb_convert_encoding($contents, 'UTF-8', $encoding );
+
+ if ($result)
+ {
+ $contents = $result;
+ $done = true;
+ }
+ }
+
+ if (!$done && function_exists('iconv'))
+ {
+
+ $result = @iconv($encoding, 'UTF-8//IGNORE', $contents);
+
+ if ($result)
+ {
+ $contents = $result;
+ $done = true;
+ }
+ }
+//modify end+++++++++
+ return $contents;
+ }
+
+ function _convert_to_utf8_auto($contents, $headers = '')
+ {
+ /* IN: string in unknown encoding, headers received during transfer
+ * OUT: string in UTF-8 encoding
+ */
+
+ $str = substr($contents, 0, 4096);
+ $len = strlen($str);
+ $pos = 0;
+ $out = '';
+
+ while ($pos < $len)
+ {
+ $ord = ord($str[$pos]);
+
+ if ($ord > 32 && $ord < 128)
+ $out .= $str[$pos];
+
+ $pos++;
+ }
+
+ // Detection of encoding, check headers
+ if (preg_match ("/;\s*charset=([^\n]+)/is", $headers, $regs))
+ $encoding = strtoupper(trim($regs[1]));
+
+ // Then check meta inside document
+ if (preg_match ("/;\s*charset=([^\"']+)/is", $out, $regs))
+ $encoding = strtoupper(trim($regs[1]));
+
+ // Then check xml declaration
+ if (preg_match("/<\?xml.+encoding\s*=\s*[\"|']([^\"']+)[\"|']\s*\?>/i", $out, $regs))
+ $encoding = strtoupper(trim($regs[1]));
+
+ // Converts
+ return $this->_convert_to_utf8($contents, $encoding);
+ }
+
+ function _decode_entities($string)
+ {
+ /* IN: string in UTF-8 containing entities
+ * OUT: string in UTF-8 without entities
+ */
+
+ /// Convert all hexadecimal entities to decimal entities
+ $string = preg_replace('/&#[Xx]([0-9A-Fa-f]+);/e', "'&#'.hexdec('\\1').';'", $string);
+
+ // Deal with invalid cp1251 numeric entities
+ $string = strtr($string, $this->entities_cp1251);
+
+ // Convert all named entities to numeric entities
+ $string = strtr($string, $this->entities_default);
+ $string = strtr($string, $this->entities_latin);
+ $string = strtr($string, $this->entities_extended);
+
+ // Convert all numeric entities to UTF-8
+ $string = preg_replace('/&#([0-9]+);/e', "'&#x'.dechex('\\1').';'", $string);
+ $string = preg_replace('/&#[Xx]([0-9A-Fa-f]+);/e', "NP_TrackBack::_hex_to_utf8('\\1')", $string);
+
+ return $string;
+ }
+
+ function _hex_to_utf8($s)
+ {
+ /* IN: string containing one hexadecimal Unicode character
+ * OUT: string containing one binary UTF-8 character
+ */
+
+ $c = hexdec($s);
+
+ if ($c < 0x80) {
+ $str = chr($c);
+ }
+ else if ($c < 0x800) {
+ $str = chr(0xC0 | $c>>6) . chr(0x80 | $c & 0x3F);
+ }
+ else if ($c < 0x10000) {
+ $str = chr(0xE0 | $c>>12) . chr(0x80 | $c>>6 & 0x3F) . chr(0x80 | $c & 0x3F);
+ }
+ else if ($c < 0x200000) {
+ $str = chr(0xF0 | $c>>18) . chr(0x80 | $c>>12 & 0x3F) . chr(0x80 | $c>>6 & 0x3F) . chr(0x80 | $c & 0x3F);
+ }
+
+ return $str;
+ }
+
+ function _utf8_to_entities($string)
+ {
+ /* IN: string in UTF-8 encoding
+ * OUT: string consisting of only characters ranging from 0x00 to 0x7f,
+ * using numeric entities to represent the other characters
+ */
+
+ $len = strlen ($string);
+ $pos = 0;
+ $out = '';
+
+ while ($pos < $len)
+ {
+ $ascii = ord (substr ($string, $pos, 1));
+
+ if ($ascii >= 0xF0)
+ {
+ $byte[1] = ord(substr ($string, $pos, 1)) - 0xF0;
+ $byte[2] = ord(substr ($string, $pos + 1, 1)) - 0x80;
+ $byte[3] = ord(substr ($string, $pos + 2, 1)) - 0x80;
+ $byte[4] = ord(substr ($string, $pos + 3, 1)) - 0x80;
+
+ $char_code = ($byte[1] << 18) + ($byte[2] << 12) + ($byte[3] << 6) + $byte[4];
+ $pos += 4;
+ }
+ elseif (($ascii >= 0xE0) && ($ascii < 0xF0))
+ {
+ $byte[1] = ord(substr ($string, $pos, 1)) - 0xE0;
+ $byte[2] = ord(substr ($string, $pos + 1, 1)) - 0x80;
+ $byte[3] = ord(substr ($string, $pos + 2, 1)) - 0x80;
+
+ $char_code = ($byte[1] << 12) + ($byte[2] << 6) + $byte[3];
+ $pos += 3;
+ }
+ elseif (($ascii >= 0xC0) && ($ascii < 0xE0))
+ {
+ $byte[1] = ord(substr ($string, $pos, 1)) - 0xC0;
+ $byte[2] = ord(substr ($string, $pos + 1, 1)) - 0x80;
+
+ $char_code = ($byte[1] << 6) + $byte[2];
+ $pos += 2;
+ }
+ else
+ {
+ $char_code = ord(substr ($string, $pos, 1));
+ $pos += 1;
+ }
+
+ if ($char_code < 0x80)
+ $out .= chr($char_code);
+ else
+ $out .= '&#'. str_pad($char_code, 5, '0', STR_PAD_LEFT) . ';';
+ }
+
+ return $out;
+ }
+
+ function _utf8_to_javascript($string)
+ {
+ /* IN: string in UTF-8 encoding
+ * OUT: string consisting of only characters ranging from 0x00 to 0x7f,
+ * using javascript escapes to represent the other characters
+ */
+
+ $len = strlen ($string);
+ $pos = 0;
+ $out = '';
+
+ while ($pos < $len)
+ {
+ $ascii = ord (substr ($string, $pos, 1));
+
+ if ($ascii >= 0xF0)
+ {
+ $byte[1] = ord(substr ($string, $pos, 1)) - 0xF0;
+ $byte[2] = ord(substr ($string, $pos + 1, 1)) - 0x80;
+ $byte[3] = ord(substr ($string, $pos + 2, 1)) - 0x80;
+ $byte[4] = ord(substr ($string, $pos + 3, 1)) - 0x80;
+
+ $char_code = ($byte[1] << 18) + ($byte[2] << 12) + ($byte[3] << 6) + $byte[4];
+ $pos += 4;
+ }
+ elseif (($ascii >= 0xE0) && ($ascii < 0xF0))
+ {
+ $byte[1] = ord(substr ($string, $pos, 1)) - 0xE0;
+ $byte[2] = ord(substr ($string, $pos + 1, 1)) - 0x80;
+ $byte[3] = ord(substr ($string, $pos + 2, 1)) - 0x80;
+
+ $char_code = ($byte[1] << 12) + ($byte[2] << 6) + $byte[3];
+ $pos += 3;
+ }
+ elseif (($ascii >= 0xC0) && ($ascii < 0xE0))
+ {
+ $byte[1] = ord(substr ($string, $pos, 1)) - 0xC0;
+ $byte[2] = ord(substr ($string, $pos + 1, 1)) - 0x80;
+
+ $char_code = ($byte[1] << 6) + $byte[2];
+ $pos += 2;
+ }
+ else
+ {
+ $char_code = ord(substr ($string, $pos, 1));
+ $pos += 1;
+ }
+
+ if ($char_code < 0x80)
+ $out .= chr($char_code);
+ else
+ $out .= '\\u'. str_pad(dechex($char_code), 4, '0', STR_PAD_LEFT);
+ }
+
+ return $out;
+ }
+/*
+ function _cut_string($string, $dl = 0) {
+
+ $defaultLength = $dl > 0 ? $dl : $this->getOption('defaultLength');
+
+ if ($defaultLength < 1)
+ return $string;
+
+ $border = 6;
+ $count = 0;
+ $lastvalue = 0;
+
+ for ($i = 0; $i < strlen($string); $i++)
+ {
+ $value = ord($string[$i]);
+
+ if ($value > 127)
+ {
+ if ($value >= 192 && $value <= 223)
+ $i++;
+ elseif ($value >= 224 && $value <= 239)
+ $i = $i + 2;
+ elseif ($value >= 240 && $value <= 247)
+ $i = $i + 3;
+
+ if ($lastvalue <= 223 && $value >= 223 &&
+ $count >= $defaultLength - $border)
+ {
+ return substr($string, 0, $i) . '...';
+ }
+
+ // Chinese and Japanese characters are
+ // wider than Latin characters
+ if ($value >= 224)
+ $count++;
+
+ }
+ elseif ($string[$i] == '/' || $string[$i] == '?' ||
+ $string[$i] == '-' || $string[$i] == ':' ||
+ $string[$i] == ',' || $string[$i] == ';')
+ {
+ if ($count >= $defaultLength - $border)
+ return substr($string, 0, $i) . '...';
+ }
+ elseif ($string[$i] == ' ')
+ {
+ if ($count >= $defaultLength - $border)
+ return substr($string, 0, $i) . '...';
+ }
+
+ if ($count == $defaultLength)
+ return substr($string, 0, $i + 1) . '...';
+
+ $lastvalue = $value;
+ $count++;
+ }
+
+ return $string;
+ }
+*/
+
+function _cut_string($string, $dl = 0) {
+ $maxLength = $dl > 0 ? $dl : $this->getOption('defaultLength');
+
+ if ($maxLength < 1)
+ return $string;
+ if (strlen($string) > $maxLength)
+ $string = mb_strimwidth($string, 0, $maxLength, '...', _CHARSET);
+
+ return $string;
+}
+
+function _strip_controlchar($string){
+ $string = preg_replace("/[\x01-\x08\x0b\x0c\x0e-\x1f\x7f]+/","",$string);
+ $string = str_replace("\0","",$string);
+ return $string;
+}
+
+//modify start+++++++++
+ function checkTableVersion(){
+ $res = sql_query("SHOW FIELDS from ".sql_table('plugin_tb') );
+ $fieldnames = array();
+ while ($co = mysql_fetch_assoc($res)) {
+ if($co['Field'] == 'block') return true;
+ }
+ return false;
+ }
+//modify end+++++++++
+
+/*---------------------------------------------------------------------------------- */
+/* LOCAL */
+/*---------------------------------------------------------------------------------- */
+ /**
+ * Handle an incoming TrackBack ping and save the data in the database
+ */
+ function handleLocalPing($itemid, $title, $excerpt, $blog_name, $ping_url){
+ global $manager;
+ $ping_url = trim($ping_url);
+
+ if( preg_match("/^.+tb_id=([0-9]+)$/",$ping_url,$idnum) ){
+ $tb_id = intval($idnum[1]);
+ } elseif ( preg_match("/([0-9]+)\.trackback/",$ping_url,$idnum) ){
+ $tb_id = intval($idnum[1]);
+ } elseif ( preg_match("/itemid=([0-9]+)/",$ping_url,$idnum) ){
+ $tb_id = intval($idnum[1]);
+ }
+
+ if ((!$manager->existsItem($tb_id,0,0)) && ($this->getOption('CheckIDs') == 'yes'))
+ return _ERROR_NOSUCHITEM . "[ $tb_id ]";
+
+ // save data in the DB
+ $query = 'INSERT INTO ' . sql_table('plugin_tb_lc') . " (tb_id, from_id) VALUES ('".intval($tb_id)."','".intval($itemid)."')";
+ $res = @mysql_query($query);
+ if (!$res)
+ return 'Could not save trackback data, possibly because of a double entry: ' . mysql_error();
+ }
+
+ /**
+ * Show the list of TrackBack pings for a certain Trackback ID
+ */
+ function showLocalList($tb_id) {
+ global $CONF;
+
+ // create SQL query
+ $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';
+ $res = mysql_query($query);
+
+ $vars = array(
+ 'tburl' => $this->getTrackBackUrl($tb_id)
+ );
+
+ // when no TrackBack pings are found
+ if (!$res || mysql_num_rows($res) == 0) {
+ echo TEMPLATE::fill($this->getOption('tplLocalEmpty'), $vars);
+ return;
+ }
+
+ // when TrackBack pings are found
+ echo TEMPLATE::fill($this->getOption('tplLocalHeader'), $vars);
+
+ while ($o = mysql_fetch_object($res)) {
+ $canDelete = $this->canDelete($tb_id);
+ $data = array(
+ 'url' => createItemLink($o->from_id),
+ 'blogname' => htmlspecialchars(getBlogNameFromID($o->iblog)),
+ 'timestamp' => strftime('%Y-%m-%d',strtotime($o->itime)),
+ 'title' => htmlspecialchars($o->ititle),
+ 'excerpt' => htmlspecialchars(shorten(strip_tags($o->ibody),200,'...')),
+ 'delete' => $canDelete?'<a href="'.$CONF['ActionURL'].'?action=plugin&name=TrackBack&type=deletelc&tb_id='.$tb_id.'&from_id='.$o->from_id.'">[delete]</a>':'',
+ 'tburl' => $this->getTrackBackUrl($tb_id),
+ 'commentcount'=> quickQuery('SELECT COUNT(*) as result FROM '.sql_table('comment').' WHERE citem=' . intval($o->from_id))
+ );
+ echo TEMPLATE::fill($this->getOption('tplLocalItem'), $data);
+ }
+ echo TEMPLATE::fill($this->getOption('tplLocalFooter'), $vars);
+ }
+
+ /**
+ * Delete a TrackBack item, redirect to referer
+ */
+ function deleteLocal($tb_id, $from_id) {
+ if (!$this->canDelete($tb_id))
+ return 'You\'re not allowed to delete this trackback item';
+ $query = 'DELETE FROM ' . sql_table('plugin_tb_lc') . " WHERE tb_id='" . intval($tb_id) . "' and from_id='" . intval($from_id) ."'";
+ mysql_query($query);
+ return '';
+ }
+
+ function canDelete($tb_id) {
+ global $member, $manager;
+
+ if (!$member->isLoggedIn()) return 0;
+
+ $checkIDs = $this->getOption('CheckIDs');
+ $itemExists =& $manager->existsItem($tb_id,0,0);
+
+ // if CheckIDs option is set, check if member canEdit($tb_id)
+ // if CheckIDs option is not set, and item exists, check if member canEdit($tb_id)
+ // if CheckIDs option is not set, and item does not exists, check if member isAdmin()
+
+ if (($checkIDs == 'yes') || ($itemExists))
+ return $member->canAlterItem($tb_id);
+ else
+ return $member->isAdmin();
+ }
+
+ /**************************************************************************************/
+ /* Plugin API calls, for installation, configuration and setup */
+
+ function getName() { return 'TrackBack'; }
+ function getAuthor() { return 'rakaz + nakahara21 + hsur'; }
+ function getURL() { return 'http://blog.cles.jp/np_cles/category/31/subcatid/3'; }
+ function getVersion() { return '2.0.3 jp6'; }
+ function getDescription() { return _TB_DESCRIPTION; }
+
+//modify start+++++++++
+/*
+ function getTableList() { return array(sql_table("plugin_tb"), sql_table("plugin_tb_lookup")); }
+ function getEventList() { return array('QuickMenu','PostAddItem','AddItemFormExtras','EditItemFormExtras','PreUpdateItem','PrepareItemForEdit', 'BookmarkletExtraHead'); }
+*/
+ function getTableList() { return array(sql_table("plugin_tb"), sql_table("plugin_tb_lookup"), sql_table('plugin_tb_lc')); }
+
+ function getEventList() { return array('QuickMenu','PostAddItem','AddItemFormExtras','EditItemFormExtras','PreUpdateItem','PrepareItemForEdit', 'BookmarkletExtraHead', 'RetrieveTrackback', 'SendTrackback', 'InitSkinParse'); }
+//modify end+++++++++
+ function getMinNucleusVersion() { return 200; }
+
+ function supportsFeature($feature) {
+ switch($feature) {
+ case 'SqlTablePrefix':
+ return 1;
+//modify start+++++++++
+// case 'HelpPage':
+// return 1;
+//modify end+++++++++
+ default:
+ return 0;
+ }
+ }
+
+
+ function hasAdminArea() { return 1; }
+
+ function event_QuickMenu(&$data) {
+ global $member, $nucleus, $blogid;
+
+ // only show to admins
+ if (!$member->isLoggedIn() || !$member->isAdmin()) return;
+
+ array_push(
+ $data['options'],
+ array(
+ 'title' => 'Trackback',
+ 'url' => $this->getAdminURL(),
+ 'tooltip' => 'Manage your trackbacks'
+ )
+ );
+ }
+
+ function install() {
+ $this->createOption('AcceptPing', _TB_AcceptPing,'yesno','yes');
+ $this->createOption('SendPings', _TB_SendPings,'yesno','yes');
+ $this->createOption('AutoXMLHttp', _TB_AutoXMLHttp, 'yesno', 'yes');
+ $this->createOption('CheckIDs', _TB_CheckIDs,'yesno','yes');
+
+ $this->createOption('tplHeader', _TB_tplHeader, 'textarea', _TB_tplHeader_VAL);
+ $this->createOption('tplEmpty', _TB_tplEmpty, 'textarea', _TB_tplEmpty_VAL);
+ $this->createOption('tplItem', _TB_tplItem, 'textarea', _TB_tplItem_VAL);
+ $this->createOption('tplFooter', _TB_tplFooter, 'textarea', _TB_tplFooter_VAL);
+//mod by cles
+ $this->createOption('tplLocalHeader', _TB_tplLocalHeader, 'textarea', _TB_tplLocalHeader_VAL);
+ $this->createOption('tplLocalEmpty', _TB_tplLocalEmpty, 'textarea', _TB_tplLocalEmpty_VAL);
+ $this->createOption('tplLocalItem', _TB_tplLocalItem, 'textarea', _TB_tplLocalItem_VAL);
+ $this->createOption('tplLocalFooter', _TB_tplLocalFooter, 'textarea', _TB_tplLocalFooter_VAL);
+//mod by cles end
+
+ $this->createOption('tplTbNone', _TB_tplTbNone, 'text', "No Trackbacks");
+ $this->createOption('tplTbOne', _TB_tplTbOne, 'text', "1 Trackback");
+ $this->createOption('tplTbMore', _TB_tplTbMore, 'text', "<%number%> Trackbacks");
+ $this->createOption('dateFormat', _TB_dateFormat, 'text', _TB_dateFormat_VAL);
+
+ $this->createOption('Notify', _TB_Notify,'yesno','no');
+ $this->createOption('NotifyEmail', _TB_NotifyEmail,'text','');
+
+ $this->createOption('DropTable', _TB_DropTable,'yesno','no');
+//mod by cles
+ $this->createOption('HideUrl',_TB_HideUrl,'yesno','yes');
+ $this->createItemOption('ItemAcceptPing',_TB_ItemAcceptPing,'yesno','yes');
+ $this->createItemOption('isAcceptW/OLink',_TB_isAcceptWOLink,'select','default', _TB_isAcceptWOLink_VAL);
+
+ $this->createBlogOption('isAcceptW/OLinkDef',_TB_isAcceptWOLinkDef,'select','block', _TB_isAcceptWOLinkDef_VAL);
+ $this->createBlogOption('AllowTrackBack',_TB_AllowTrackBack,'yesno','yes');
+//mod by cles end
+
+ /* Create tables */
+ mysql_query("
+ CREATE TABLE IF NOT EXISTS
+ ".sql_table('plugin_tb')."
+ (
+ `id` INT(11) NOT NULL AUTO_INCREMENT,
+ `tb_id` INT(11) NOT NULL,
+ `url` TEXT NOT NULL,
+ `block` TINYINT(4) NOT NULL,
+ `spam` TINYINT(4) NOT NULL,
+ `link` TINYINT(4) NOT NULL,
+ `title` TEXT,
+ `excerpt` TEXT,
+ `blog_name` TEXT,
+ `timestamp` DATETIME,
+
+ PRIMARY KEY (`id`)
+ )
+ ");
+
+ mysql_query("
+ CREATE TABLE IF NOT EXISTS
+ ".sql_table('plugin_tb_lookup')."
+ (
+ `link` TEXT NOT NULL,
+ `url` TEXT NOT NULL,
+ `title` TEXT,
+
+ PRIMARY KEY (`link` (100))
+ )
+ ");
+//modify start+++++++++
+ @mysql_query('ALTER TABLE `' . sql_table('plugin_tb') . '` ADD INDEX `tb_id_block_timestamp_idx` ( `tb_id`, `block`, `timestamp` DESC )');
+ @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))');
+//modify end+++++++++
+ }
+
+ function uninstall() {
+ if ($this->getOption('DropTable') == 'yes') {
+ mysql_query ('DROP TABLE '.sql_table('plugin_tb'));
+ mysql_query ('DROP TABLE '.sql_table('plugin_tb_lookup'));
+ mysql_query ("DROP table ".sql_table('plugin_tb_lc'));
+ }
+ }
+
+ function init() {
+ // include language file for this plugin
+ $language = ereg_replace( '[\\|/]', '', getLanguageName());
+ if (file_exists($this->getDirectory().'language/'.$language.'.php'))
+ include_once($this->getDirectory().'language/'.$language.'.php');
+ else
+ include_once($this->getDirectory().'language/'.'english.php');
+ $this->notificationMail = _TB_NORTIFICATION_MAIL_BODY;
+ $this->notificationMailTitle = _TB_NORTIFICATION_MAIL_TITLE;
+ }
+ }
+
+?>
--- /dev/null
+
+
+ 0.9.0 Initial version of Referer by Xiffy
+ 0.9.1 Added the possibility to call pop, 10 to show the most populair pages
+ Minor bugfixes for htmlspecialchars
+ Added substr to trim the line. Internet Explorer makes long lines instead of braking them
+ 0.9.2 Added timeoffset functionality to refWhen ...
+ 0.9.3 Added three display options (needs reinstallation!)
+ Bugfixes and another calling option; lastall
+ Added "-" on each refer*
+
+ ------------------------------------------------------------
+
+ 1.0 Initial release
+ 1.1 Version that takes advantage of the new features in Nucleus v2.0
+ (v1.55 users still need to addapt their templates)
+ 1.2 - Fix: Typo (cechkids)
+ - Fix: $CONF['ActionURL'] instead of $CONF['SiteURL'] . 'action.php'
+ - Fix: also works with php option 'short_open_tags' set to Off
+ - Added: manualpingform
+ - Requires Nucleus v2.0...
+ - Support for tableprefix (Nucleus versions > 2.0)
+
+ 1.3 Release by caw
+ - Removed: Table backwards compatibility code
+ - Added: Support for adding TrackBack when editing item
+ - Change: Table name changed from [nucleus_]plugin_tb to [nucleus_]plug_trackback
+
+ 1.4 Release by TeRanEX
+ (didn't wrote anything myself, only merged some modifications)
+ - Added: Table backwards compatibility code (was removed in 1.3 but I don't
+ see any reason why)
+ - Change: Table name changed from [nucleus_]plug_trackback to [nucleus_]plugin_tb
+ again (what was the reason for the change in 1.3?
+ - Added all fixes/mods/additions of thread http://forum.nucleuscms.org/viewtopic.php?t=3247
+ - Send a ping on edit item
+ - sendPing with POST instead of GET
+ - "Retrieving TrackBack Pings" Implementation
+ - "Auto-Discovery of TrackBack Ping URLs" Implementation
+ - automatically-detecting trackbackURL of permalink linked by item
+ - Change: the RDF output so that it looks the same as in the MT TrackBack Spec
+ (see http://forum.nucleuscms.org/viewtopic.php?t=1974)
+
+ 1.5 Release by admun and TeRanEX
+ - Added: Trackback updates, sending the newest data
+ - Added: Autodiscovery to the bookmarklet
+ - Added: Autodiscovery to the pingform
+ - Fixed: Autodiscovery now looks also in the 'more'-part of an item
+ - Changed/fixed: autodiscovery when editing an item, now you can check a checkbox for
+ every trackback that was discovered and you want to ping
+ - Added: License info
+ - Changed: The description of the plugin
+
+ ------------------------------------------------------------
+
+ 2.0a Release by Niels Leenheer (rakaz)
+ - Added: Caching of auto-detected trackback URLs in a database table
+ - Added: If the cURL extension is present a HEAD request is send first, to make
+ sure we are dealing with a (X)HTML page and not some large binary file format.
+ - Added: The auto-detection of trackback URLs now happen in real time - as you type -
+ thanks to client-side Javascript and the XmlHttpRequest object which requests
+ the required data from the plugin.
+
+ 2.0b - Added spinning auto-detection indicator
+ - Added support for multiple character encoding methods. The plugin
+ works internally fully in UTF-8 (Unicode) and can convert other
+ character encodings. The output of the plugin is in UTF-8 or in US-ASCII
+ with unicode characters encoded using numeric entities.
+ - Added spam protection using the Blacklist plugin (thanks to Xiffy for
+ helping me out by adding a generic spam check API to his plugin).
+ - Added a check to see if the page which send the trackback actually
+ contains a link to our server. If not, then it is probably a spamming
+ attempt and block by default.
+ - The output of this plugin is now fully configurable. You can specify
+ you're own (X)HTML code.
+ - Added a admin interface which can be used to manage trackbacks and
+ manually send trackbacks to other sites. It is possible to delete
+ trackbacks, but also to block and unblock trackbacks. All trackbacks
+ which are marked as spam are not deleted automatically, but they end
+ up in a list called 'Blocked trackbacks'. You can manually verify this
+ list and unblock any trackback which is marked as spam by mistake.
+ - Fixed a number of bugs, including missing hostnames and double // in
+ URLs. Fixed a bug introduced in 2.0a which prevented the title and
+ excerpt from showing up when sending trackbacks from a newly created
+ story. Also filtering of tags is more stringent.
+
+ - REMOVED: Manual ping forms. The form which is need to ping other
+ weblogs is now integrated into the admin interface. The form needed
+ for other weblog authors to manually add trackbacks to your website
+ will return in the next release.
+ - REMOVED: The ability to show a list of trackbacks in a popup window.
+ This will probably return in the next release.
+ - REMOVED: The ability to delete trackbacks directly from the list
+ shown to administrators. This is now handled by the admin interface.
+
+ 2.0 final
+ - Made the help page Nucleus 3.2 compatible
+ - Added a manual ping form, which allows weblog authors to add a trackback
+ to your stories even when their software doesn't support trackbacks.
+ - Removed <language>en</language> from the RSS output, because we can't
+ be sure about the language of the contents of the RSS stream.
+
+ 2.0.1 - Security fix: Plugin admin interface was exposed to all logged in users,
+ not only to users with admin rights.
+
+ 2.0.2 - Added autodetection of the encoding of trackbacks, which is needed when
+ a trackback is send in a foreign encoding by a sender which does not
+ support version 1.2 of the trackback specifications. Supported encodings:
+ US-ASCII, ISO-2022-JP, UTF-8, EUC-JP, Shift_JIS. If the encoding is not
+ specified according to version 1.2 of the specs AND it is not one of the
+ encodings specified above, the plugin will assume it is encoding using
+ ISO-8859-1.
+ - Added two new events SendTrackback and RetrieveTrackback which can be
+ used by other plugins or the XML-RPC APIs to allow external blog editors
+ to send trackbacks. (This functionality does require a modification to
+ the XML-RPC APIs).
+ - Added support for more clean Trackback URLs, for example:
+ http://www.rakaz.nl/nucleus/item/84.trackback or
+ http://www.rakaz.nl/nucleus/item.php?id=84&format=trackback
+
+ 2.0.3 - Added support for a more advanced version of the SpamCheck API
+
+
\ No newline at end of file
--- /dev/null
+<?php
+
+ $strRel = '../../../';
+ include($strRel . 'config.php');
+?>
+
+ var TrackbackAction = "<?php echo $CONF['ActionURL'];?>";
+ var xmlhttp = false;
+ var inProgress = false;
+
+ var TrackbackAction = "<?php echo $CONF['ActionURL'];?>";
+ var TrackbackSource = new Array;
+ var TrackbackName = new Array;
+ var TrackbackURL = new Array;
+
+ var LookupTable = new Array;
+ var Lookup = '';
+ var countTotal = 0;
+
+ var regexp = /href\s*=\s*([\"\'])(http:[^\"\'>]+)([\"\'])/ig;
+
+
+ function tbParseLinks ()
+ {
+ oinputbody = document.getElementById('inputbody');
+ oinputmore = document.getElementById('inputmore');
+ full = oinputbody.value + ' ' + oinputmore.value;
+
+ while (vArray = regexp.exec(full))
+ {
+ unused = true;
+
+ if (Lookup == vArray[2])
+ unused = false;
+
+ for (var i = 0; i < LookupTable.length; i++)
+ if (LookupTable[i] == vArray[2])
+ unused = false;
+
+ for (var i = 0; i < TrackbackSource.length; i++)
+ if (TrackbackSource[i] == vArray[2])
+ unused = false;
+
+ if (unused == true)
+ LookupTable.push(vArray[2]);
+ }
+ }
+
+ function tbAutoDetect()
+ {
+ if (LookupTable.length > 0)
+ {
+ tbBusy(true);
+
+ if (!inProgress)
+ {
+ // We have something to do and the connection is free
+ Lookup = LookupTable.shift();
+ inProgress = true;
+
+ // The reason we use GET instead of POST is because
+ // Opera does not properly support setting headers yet,
+ // which is a requirement for using POST.
+ xmlhttp.open("GET", TrackbackAction + "?action=plugin&name=TrackBack&type=detect&tb_link=" + escape(Lookup), true);
+ xmlhttp.onreadystatechange = tbStateChange;
+ xmlhttp.send('');
+ }
+ else
+ {
+ // Still busy... simply wait until next turn
+ }
+ }
+ else
+ {
+ // Nothing to do, check back later...
+ if (Lookup == '')
+ {
+ tbBusy(false);
+ }
+ }
+ }
+
+ function tbStateChange ()
+ {
+ if (inProgress == true && xmlhttp.readyState == 4 && xmlhttp.status == 200)
+ {
+ eval (xmlhttp.responseText);
+ inProgress = false;
+ Lookup = '';
+ }
+ }
+
+ function tbBusy(toggle)
+ {
+
+ if (toggle)
+ {
+ document.forms[0].discoverit.style.color = "#888888";
+ document.forms[0].discoverit.style.fontWeight="bold";
+ document.forms[0].discoverit.value = " Loading ....";
+ }
+ else
+ {
+ document.forms[0].discoverit.style.color = "#888888";
+ document.forms[0].discoverit.style.fontWeight="bold";
+ document.forms[0].discoverit.value = " D o n e ! ";
+ }
+
+ o = document.getElementById('tb_busy');
+
+ if (o)
+ {
+ if (toggle)
+ o.style.display = '';
+ else
+ o.style.display = 'none'
+ }
+ }
+
+ function tbDone(source, url, name)
+ {
+ TrackbackSource.push(source);
+ TrackbackURL.push(url);
+ TrackbackName.push(name);
+
+// var parent = document.getElementById('tb_auto');
+ var amount = document.getElementById('tb_url_amount');
+ var subtitle = document.getElementById('tb_auto_title');
+ var listtable = document.getElementById('tb_ping_list');
+
+ if (url != '')
+ {
+// count = parseInt(amount.value);
+ count = countTotal;
+
+ mycurrent_row=document.createElement("TR");
+
+ checkbox = document.createElement("input");
+ checkbox.type = 'checkbox';
+ checkbox.name = "tb_url_" + count;
+ checkbox.id = "tb_url_" + count;
+ checkbox.value = url;
+ checkbox.defaultChecked = true;
+
+ label = document.createElement("label");
+ label.htmlFor = "tb_url_" + count;
+ label.title = source;
+
+ text = document.createTextNode(name);
+ label.appendChild(text);
+
+
+// br = document.createElement("br");
+
+// subtitle.innerHTML = "Auto Discovered Ping URL's:";
+// parent.appendChild(checkbox);
+// parent.appendChild(label);
+
+ mycurrent_cell=document.createElement("TD");
+ mycurrent_cell.appendChild(checkbox);
+ mycurrent_row.appendChild(mycurrent_cell);
+ mycurrent_cell=document.createElement("TD");
+ mycurrent_cell.appendChild(label);
+ mycurrent_row.appendChild(mycurrent_cell);
+
+ //utf8?
+ checkboxU = document.createElement("input");
+ checkboxU.type = 'checkbox';
+ checkboxU.name = "tb_url_" + count + "_utf8";
+ checkboxU.id = "tb_url_" + count + "_utf8";
+ checkboxU.defaultChecked = false;
+
+ labelU = document.createElement("label");
+ labelU.htmlFor = "tb_url_" + count + "_utf8";
+ labelU.title = "utf8?";
+
+ text = document.createTextNode("utf8?");
+ labelU.appendChild(text);
+ mycurrent_cell=document.createElement("TD");
+ mycurrent_cell.appendChild(checkboxU);
+ mycurrent_cell.appendChild(labelU);
+ mycurrent_row.appendChild(mycurrent_cell);
+
+
+ if(url.indexOf("<?php echo $CONF['IndexURL'];?>",0) != -1)
+ {
+ //local?
+ checkboxL = document.createElement("input");
+ checkboxL.type = 'checkbox';
+ checkboxL.name = "tb_url_" + count + "_local";
+ checkboxL.id = "tb_url_" + count + "_local";
+ checkboxL.defaultChecked = true;
+
+ labelL = document.createElement("label");
+ labelL.htmlFor = "tb_url_" + count + "_local";
+ labelL.title = "local?";
+
+ text = document.createTextNode("local?");
+ labelL.appendChild(text);
+// parent.appendChild(checkboxL);
+// parent.appendChild(labelL);
+ mycurrent_cell=document.createElement("TD");
+ mycurrent_cell.appendChild(checkboxL);
+ mycurrent_cell.appendChild(labelL);
+ mycurrent_row.appendChild(mycurrent_cell);
+
+ }
+ else
+ {
+ mycurrent_cell=document.createElement("TD");
+ mycurrent_row.appendChild(mycurrent_cell);
+ }
+// parent.appendChild(br);
+ listtable.appendChild(mycurrent_row);
+
+// amount.value = count + 1;
+ countTotal++;
+ amount.value = countTotal;
+ }
+ else
+ {
+ subtitle.innerHTML = "No Trackbak URLs.";
+ }
+ }
+
+ function tbSetup()
+ {
+ try
+ {
+ xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
+ }
+ catch (e)
+ {
+ try
+ {
+ xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
+ }
+ catch (e)
+ {
+ xmlhttp = false;
+ }
+ }
+
+ if (!xmlhttp && typeof XMLHttpRequest!='undefined')
+ {
+ xmlhttp = new XMLHttpRequest();
+ }
+
+ setInterval ('tbParseLinks();', 500);
+ setInterval ('tbAutoDetect();', 500);
+
+ if (window.onloadtrackback)
+ window.onloadtrackback();
+ }
+
+ function AddStart()
+ {
+ var strString = "";
+ strString = document.forms[0].trackback_ping_url.value;
+ strArray = strString.split("\n");
+ for (var i = 0; i < strArray.length; i++)
+ {
+ strTemp = trim(strArray[i]);
+ if (strTemp != "" && strTemp.match(/^http/))
+ {
+ tbDone(strTemp,strTemp,strTemp);
+ }
+ }
+ document.forms[0].trackback_ping_url.value = '';
+ }
+
+ function trim(string)
+ {
+ return string.replace(/(^\s*)|(\s*$)/g,'');
+ }
--- /dev/null
+<?php
+ $strRel = '../../../';
+ include($strRel . 'config.php');
+
+?>
+ var TrackbackAction = "<?php echo $CONF['ActionURL'];?>";
+ var tb_id = "<?php echo intRequestVar('tb_id')?>";
+ var tb_amount = "<?php echo intRequestVar('amount')?>";
+ var xmlhttp = false;
+
+ function resttbStart()
+ {
+ document.getElementById("tbhidenavi").style.display = "block";
+ document.getElementById("tbshownavi").style.display = "none";
+ try
+ {
+ xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
+ }
+ catch (e)
+ {
+ try
+ {
+ xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
+ }
+ catch (e)
+ {
+ xmlhttp = false;
+ }
+ }
+
+ if (!xmlhttp && typeof XMLHttpRequest!='undefined')
+ {
+ xmlhttp = new XMLHttpRequest();
+ }
+
+ if (xmlhttp)
+ {
+ loadXMLDoc();
+ }
+
+ }
+
+ function loadXMLDoc()
+ {
+
+ var url = TrackbackAction + '?action=plugin&name=TrackBack&type=left&tb_id=' + tb_id + '&amount=' + tb_amount;
+
+ xmlhttp.onreadystatechange=xmlhttpChange
+ xmlhttp.open("GET",url,true)
+ xmlhttp.send('')
+ }
+
+ function xmlhttpChange()
+ {
+ if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
+ {
+ var result = document.getElementById("resttb");
+ result.innerHTML = xmlhttp.responseText;
+ }
+ }
+
+ function hideresttb()
+ {
+ var result = document.getElementById("resttb");
+ result.innerHTML = "";
+
+ document.getElementById("tbhidenavi").style.display = "none";
+ document.getElementById("tbshownavi").style.display = "block";
+
+ }
--- /dev/null
+<h2>Help</h2>
+
+
+<h3>Skin variables</h3>
+
+<p>
+ <code><%TrackBack(list)%></code>
+</p>
+<p>
+ Show a list of trackbacks for the current page. Optionally it is also possible to
+ add an additional parameter, the story id number, which makes it possible to
+ show a list of trackbacks from a different page. The output of this variable is
+ fully configurable in the plugin options.
+</p>
+
+<p>
+ <code><%TrackBack(code)%></code>
+</p>
+<p>
+ Inserts a small piece of invisible RDF code in the page, which is used by other
+ weblogs to auto-detect the trackback URL. If you do not include this variable in
+ your skin for item pages, other weblogs will not be able to auto-detect that your
+ weblog is able to accept trackbacks.
+</p>
+
+<p>
+ <code><%TrackBack(form)%></code>
+</p>
+<p>
+ Insert the URL to a manual ping form. Using this form authors of other weblogs
+ can add trackbacks to your stories, even when their software does not support
+ trackbacks, such as Blogger. A link to this form is included in the footer of
+ the trackback list by default. If you want to place this link somewhere else
+ on your page, simply remove the <code><%form%></code> variable from the
+ <em>Footer</em> field in the plugin settings and add the skinvar somewhere on
+ your webpage.
+</p>
+
+<p>
+ <code><%TrackBack(url)%></code>
+</p>
+<p>
+ Insert the Trackback Ping URL. A this URL is also included in the footer of
+ the trackback list by default. If you want to place this link somewhere else
+ on your page, simply remove the <code><%action%></code> variable from the
+ <em>Footer</em> field in the plugin settings and add the skinvar somewhere on
+ your webpage.
+</p>
+
+<h3>Template variables</h3>
+
+<p>
+ All the skin variables documented above are also available as template variables.
+</p>
+
+<p>
+ <code><%TrackBack(count)%></code>
+</p>
+<p>
+ If you want to include an indication of how many trackbacks are present for each
+ page you can use this variable. By default this variable will show: "No Trackbacks",
+ "1 Trackback", "2 Trackbacks", etc. This is however also fully configurable in
+ the plugin options.
+</p>
+
+
+<h3>Changing the output</h3>
+
+<p>
+ It is possible to fully change the output of this plugin. You can manually change
+ the XHTML code in the plugin options, but you can also use CSS to style the default
+ output to your liking. Below you will find an example of what a little snippet of
+ CSS can do.
+</p>
+
+<pre>div.tb {
+ border: 1px solid #000; background: #FFF;
+}
+div.tb div.head {
+ padding: 4px;
+ background: #000; color: #FFF;
+ font-weight: bold; text-transform: lowercase; letter-spacing: 0.6em;
+}
+div.tb div.empty {
+ padding: 4px;
+ font-size: 95%;
+}
+div.tb div.item {
+ padding: 4px;
+}
+div.tb div.item div.name {
+ margin-bottom: 8px;
+ font-size: 120%; font-weight: bold;
+}
+div.tb div.item div.body {
+ font-size: 95%;
+}
+div.tb div.item div.body a {
+ font-weight: bold;
+}
+div.tb div.item div.date {
+ margin-bottom: 8px;
+ color: #888;
+ font-size: 85%; text-align: right;
+}
+div.tb div.info {
+ padding: 4px;
+ color: #FFF; background: #888;
+ font-size: 85%; font-style: italic;
+}</pre>
+
--- /dev/null
+<?php
+
+ $strRel = '../../../';
+ include($strRel . 'config.php');
+ include($DIR_LIBS . 'PLUGINADMIN.php');
+ include('template.php');
+
+
+ // Send out Content-type
+ sendContentType('application/xhtml+xml', 'admin-trackback', _CHARSET);
+
+ // Compatiblity with Nucleus < = 2.0
+ if (!function_exists('sql_table')) { function sql_table($name) { return 'nucleus_' . $name; } }
+
+
+
+ $oPluginAdmin = new PluginAdmin('TrackBack');
+
+ if (!($member->isLoggedIn() && $member->isAdmin()))
+ {
+ $oPluginAdmin->start();
+ echo '<p>' . _ERROR_DISALLOWED . '</p>';
+ $oPluginAdmin->end();
+ exit;
+ }
+
+ $oPluginAdmin->start();
+
+//modify start+++++++++
+ $plug =& $oPluginAdmin->plugin;
+ $tableVersion = $plug->checkTableVersion();
+
+ // include language file for this plugin
+ $language = ereg_replace( '[\\|/]', '', getLanguageName());
+ if (file_exists($plug->getDirectory().'language/'.$language.'.php'))
+ include_once($plug->getDirectory().'language/'.$language.'.php');
+ else
+ include_once($plug->getDirectory().'language/'.'english.php');
+//modify end+++++++++
+
+ $mTemplate = new Trackback_Template();
+ $mTemplate->set ('CONF', $CONF);
+ $mTemplate->set ('plugid', $plug->getID());
+ $mTemplate->template('templates/menu.html');
+ echo $mTemplate->fetch();
+
+ $oTemplate = new Trackback_Template();
+ $oTemplate->set ('CONF', $CONF);
+
+ // Actions
+ $action = requestVar('action');
+
+ switch($action) {
+
+//modify start+++++++++
+ case 'tableUpgrade':
+ mysql_query("
+ CREATE TABLE IF NOT EXISTS
+ ".sql_table('plugin_tb_lookup')."
+ (
+ `link` TEXT NOT NULL,
+ `url` TEXT NOT NULL,
+ `title` TEXT,
+
+ PRIMARY KEY (`link` (100))
+ )
+ ");
+ echo $q = "ALTER TABLE ".sql_table('plugin_tb')."
+ ADD `block` TINYINT( 4 ) NOT NULL AFTER `url` ,
+ ADD `spam` TINYINT( 4 ) NOT NULL AFTER `block` ,
+ ADD `link` TINYINT( 4 ) NOT NULL AFTER `spam` ,
+ CHANGE `url` `url` TEXT NOT NULL,
+ CHANGE `title` `title` TEXT NOT NULL,
+ CHANGE `excerpt` `excerpt` TEXT NOT NULL,
+ CHANGE `blog_name` `blog_name` TEXT NOT NULL,
+ DROP PRIMARY KEY,
+ ADD `id` INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST ;";
+ $res = @mysql_query($q);
+ if (!$res){
+ echo 'Could not alter table: ' . mysql_error();
+ }else{
+ $tableVersion = 1;
+ $oTemplate->template('templates/updatetablefinished.html');
+ }
+ @mysql_query('ALTER TABLE `' . sql_table('plugin_tb') . '` ADD INDEX `tb_id_block_timestamp_idx` ( `tb_id`, `block`, `timestamp` DESC )');
+ break;
+//modify end+++++++++
+
+ case 'block':
+ $tb = intRequestVar('tb');
+
+ $res = mysql_query ("
+ UPDATE
+ ".sql_table('plugin_tb')."
+ SET
+ block = 1
+ WHERE
+ id = '".$tb."'
+ ");
+
+ $action = requestVar('next');
+ break;
+ case 'blocked_clear':
+ $res = mysql_query ("DELETE FROM ".sql_table('plugin_tb')." WHERE block = 1");
+ $action = requestVar('next');
+ break;
+
+ case 'blocked_spamclear':
+ $res = mysql_query ("DELETE FROM ".sql_table('plugin_tb')." WHERE block = 1 and spam = 1");
+ $action = requestVar('next');
+ break;
+
+ case 'unblock':
+ $tb = intRequestVar('tb');
+
+ $res = mysql_query ("
+ UPDATE
+ ".sql_table('plugin_tb')."
+ SET
+ block = 0
+ WHERE
+ id = '".$tb."'
+ ");
+
+ $action = requestVar('next');
+ break;
+
+ case 'delete':
+ $tb = intRequestVar('tb');
+
+ $res = mysql_query ("
+ DELETE FROM
+ ".sql_table('plugin_tb')."
+ WHERE
+ id = '".$tb."'
+ ");
+
+ $action = requestVar('next');
+ break;
+
+ case 'sendping':
+ $title = requestVar('title');
+ $url = requestVar('url');
+ $excerpt = requestVar('excerpt');
+ $blog_name = requestVar('blog_name');
+ $ping_url = requestVar('ping_url');
+
+ // No charset conversion needs to be done here, because
+ // the charset used to receive the info is used to send
+ // it...
+
+ if ($ping_url) {
+ $error = $oPluginAdmin->plugin->sendPing(0, $title, $url, $excerpt, $blog_name, $ping_url);
+
+ if ($error) {
+ echo '<b>TrackBack Error:' . $error . '</b>';
+ }
+ }
+
+ $action = requestVar('next');
+ break;
+ case 'ping':
+ $id = intRequestVar('id');
+
+ $usePathInfo = ($CONF['URLMode'] == 'pathinfo');
+ if ($usePathInfo)
+ @ include($strRel . 'fancyurls.config.php');
+
+ global $manager;
+ $itemData = $manager->getItem($id, 0, 0);
+
+ if(is_array($itemData)){
+ $blog =& $manager->getBlog($itemData['blogid']);
+ $CONF['ItemURL'] = ($usePathInfo)? preg_replace('/\/$/', '', $blog->getURL()): $blog->getURL();
+ $itemData['url'] = createItemLink($id);
+ $itemData['excerpt'] = shorten(strip_tags($itemData['body'].$itemData['more']), 250, '...');
+ $itemData['blogname'] = $blog->getName();
+ }else{
+ $itemData = array();
+ $itemData['url'] = $CONF['IndexURL'];
+ $itemData['blogname'] = $CONF['SiteName'];
+ }
+ $oTemplate->set('item', $itemData);
+
+ $oTemplate->template('templates/ping.html');
+ break;
+ }
+
+ // Pages
+ switch($action) {
+
+ case 'help':
+ $oTemplate->template('help.html');
+ break;
+
+ case 'ping':
+ $oTemplate->template('templates/ping.html');
+ break;
+
+ case 'blocked':
+ $start = intRequestVar('start') ? intRequestVar('start') : 0;
+ $amount = intRequestVar('amount') ? intRequestVar('amount') : 25;
+
+ $rres = mysql_query ("
+ SELECT
+ COUNT(*) AS count
+ FROM
+ ".sql_table('plugin_tb')." AS t,
+ ".sql_table('item')." AS i
+ WHERE
+ t.tb_id = i.inumber AND
+ t.block = 1
+ ");
+
+ if ($row = mysql_fetch_array($rres))
+ $count = $row['count'];
+ else
+ $count = 0;
+
+ $rres = mysql_query ("
+ SELECT
+ i.ititle AS story,
+ i.inumber AS story_id,
+ t.id AS id,
+ t.title AS title,
+ t.blog_name AS blog_name,
+ t.excerpt AS excerpt,
+ t.url AS url,
+ -- UNIX_TIMESTAMP(t.timestamp) AS timestamp,
+ t.timestamp AS timestamp,
+ t.spam AS spam,
+ t.link AS link
+ FROM
+ ".sql_table('plugin_tb')." AS t,
+ ".sql_table('item')." AS i
+ WHERE
+ t.tb_id = i.inumber AND
+ t.block = 1
+ ORDER BY
+ timestamp DESC
+ LIMIT
+ ".$start.",".$amount."
+ ");
+
+ $items = array();
+
+ while ($rrow = mysql_fetch_array($rres))
+ {
+ $rrow['title'] = $oPluginAdmin->plugin->_cut_string($rrow['title'], 50);
+ $rrow['title'] = $oPluginAdmin->plugin->_strip_controlchar($rrow['title']);
+ $rrow['title'] = htmlspecialchars($rrow['title']);
+// $rrow['title'] = _CHARSET == 'UTF-8' ? $rrow['title'] : $oPluginAdmin->plugin->_utf8_to_entities($rrow['title']);
+
+ $rrow['blog_name'] = $oPluginAdmin->plugin->_cut_string($rrow['blog_name'], 50);
+ $rrow['blog_name'] = $oPluginAdmin->plugin->_strip_controlchar($rrow['blog_name']);
+ $rrow['blog_name'] = htmlspecialchars($rrow['blog_name']);
+// $rrow['blog_name'] = _CHARSET == 'UTF-8' ? $rrow['blog_name'] : $oPluginAdmin->plugin->_utf8_to_entities($rrow['blog_name']);
+
+ $rrow['excerpt'] = $oPluginAdmin->plugin->_cut_string($rrow['excerpt'], 800);
+ $rrow['excerpt'] = $oPluginAdmin->plugin->_strip_controlchar($rrow['excerpt']);
+ $rrow['excerpt'] = htmlspecialchars($rrow['excerpt']);
+// $rrow['excerpt'] = _CHARSET == 'UTF-8' ? $rrow['excerpt'] : $oPluginAdmin->plugin->_utf8_to_entities($rrow['excerpt']);
+
+ $rrow['url'] = htmlspecialchars($rrow['url'], ENT_QUOTES);
+ $rrow['timestamp'] = htmlspecialchars($rrow['timestamp'], ENT_QUOTES);
+
+ $blog = & $manager->getBlog(getBlogIDFromItemID($item['itemid']));
+ $rrow['story_url'] = $oPluginAdmin->plugin->_createItemLink($rrow['story_id'], $blog);
+ $rrow['story'] = htmlspecialchars(strip_tags($rrow['story']), ENT_QUOTES);
+
+ $items[] = $rrow;
+ }
+
+ $oTemplate->set ('amount', $amount);
+ $oTemplate->set ('count', $count);
+ $oTemplate->set ('start', $start);
+ $oTemplate->set ('items', $items);
+ $oTemplate->template('templates/blocked.html');
+ break;
+
+ case 'all':
+ $start = intRequestVar('start') ? intRequestVar('start') : 0;
+ $amount = intRequestVar('amount') ? intRequestVar('amount') : 25;
+
+ $rres = mysql_query ("
+ SELECT
+ COUNT(*) AS count
+ FROM
+ ".sql_table('plugin_tb')." AS t,
+ ".sql_table('item')." AS i
+ WHERE
+ t.tb_id = i.inumber AND
+ t.block = 0
+ ");
+
+ if ($row = mysql_fetch_array($rres))
+ $count = $row['count'];
+ else
+ $count = 0;
+
+ $rres = mysql_query ("
+ SELECT
+ i.ititle AS story,
+ i.inumber AS story_id,
+ t.id AS id,
+ t.title AS title,
+ t.blog_name AS blog_name,
+ t.excerpt AS excerpt,
+ t.url AS url,
+ UNIX_TIMESTAMP(t.timestamp) AS timestamp
+ FROM
+ ".sql_table('plugin_tb')." AS t,
+ ".sql_table('item')." AS i
+ WHERE
+ t.tb_id = i.inumber AND
+ t.block = 0
+ ORDER BY
+ timestamp DESC
+ LIMIT
+ ".$start.",".$amount."
+ ");
+
+ $items = array();
+
+ while ($rrow = mysql_fetch_array($rres))
+ {
+ $rrow['title'] = $oPluginAdmin->plugin->_cut_string($rrow['title'], 50);
+ $rrow['title'] = $oPluginAdmin->plugin->_strip_controlchar($rrow['title']);
+ $rrow['title'] = htmlspecialchars($rrow['title']);
+// $rrow['title'] = _CHARSET == 'UTF-8' ? $rrow['title'] : $oPluginAdmin->plugin->_utf8_to_entities($rrow['title']);
+
+ $rrow['blog_name'] = $oPluginAdmin->plugin->_cut_string($rrow['blog_name'], 50);
+ $rrow['blog_name'] = $oPluginAdmin->plugin->_strip_controlchar($rrow['blog_name']);
+ $rrow['blog_name'] = htmlspecialchars($rrow['blog_name']);
+// $rrow['blog_name'] = _CHARSET == 'UTF-8' ? $rrow['blog_name'] : $oPluginAdmin->plugin->_utf8_to_entities($rrow['blog_name']);
+
+ $rrow['excerpt'] = $oPluginAdmin->plugin->_cut_string($rrow['excerpt'], 800);
+ $rrow['excerpt'] = $oPluginAdmin->plugin->_strip_controlchar($rrow['excerpt']);
+ $rrow['excerpt'] = htmlspecialchars($rrow['excerpt']);
+// $rrow['excerpt'] = _CHARSET == 'UTF-8' ? $rrow['excerpt'] : $oPluginAdmin->plugin->_utf8_to_entities($rrow['excerpt']);
+
+ $rrow['url'] = htmlspecialchars($rrow['url'], ENT_QUOTES);
+
+ $blog = & $manager->getBlog(getBlogIDFromItemID($item['itemid']));
+ $rrow['story_url'] = $oPluginAdmin->plugin->_createItemLink($rrow['story_id'], $blog);
+ $rrow['story'] = htmlspecialchars(strip_tags($rrow['story']), ENT_QUOTES);
+
+ $items[] = $rrow;
+ }
+
+ $oTemplate->set ('amount', $amount);
+ $oTemplate->set ('count', $count);
+ $oTemplate->set ('start', $start);
+ $oTemplate->set ('items', $items);
+ $oTemplate->template('templates/all.html');
+ break;
+
+ case 'list':
+ $id = requestVar('id');
+ $start = intRequestVar('start') ? intRequestVar('start') : 0;
+ $amount = intRequestVar('amount') ? intRequestVar('amount') : 25;
+
+ $ires = mysql_query ("
+ SELECT
+ ititle,
+ inumber
+ FROM
+ ".sql_table('item')."
+ WHERE
+ inumber = '".$id."'
+ ");
+
+ if ($irow = mysql_fetch_array($ires))
+ {
+ $story['id'] = $id;
+ $story['title'] = $irow['ititle'];
+
+ $rres = mysql_query ("
+ SELECT
+ COUNT(*) AS count
+ FROM
+ ".sql_table('plugin_tb')." AS t
+ WHERE
+ t.tb_id = '".$id."' AND
+ t.block = 0
+ ");
+
+ if ($row = mysql_fetch_array($rres))
+ $count = $row['count'];
+ else
+ $count = 0;
+
+ $rres = mysql_query ("
+ SELECT
+ t.id AS id,
+ t.title AS title,
+ t.blog_name AS blog_name,
+ t.excerpt AS excerpt,
+ t.url AS url,
+ UNIX_TIMESTAMP(t.timestamp) AS timestamp
+ FROM
+ ".sql_table('plugin_tb')." AS t
+ WHERE
+ t.tb_id = '".$id."' AND
+ t.block = 0
+ ORDER BY
+ timestamp DESC
+ LIMIT
+ ".$start.",".$amount."
+ ");
+
+ $items = array();
+
+ while ($rrow = mysql_fetch_array($rres))
+ {
+ $rrow['title'] = $oPluginAdmin->plugin->_cut_string($rrow['title'], 50);
+ $rrow['title'] = $oPluginAdmin->plugin->_strip_controlchar($rrow['title']);
+ $rrow['title'] = htmlspecialchars($rrow['title']);
+// $rrow['title'] = _CHARSET == 'UTF-8' ? $rrow['title'] : $oPluginAdmin->plugin->_utf8_to_entities($rrow['title']);
+
+ $rrow['blog_name'] = $oPluginAdmin->plugin->_cut_string($rrow['blog_name'], 50);
+ $rrow['blog_name'] = $oPluginAdmin->plugin->_strip_controlchar($rrow['blog_name']);
+ $rrow['blog_name'] = htmlspecialchars($rrow['blog_name']);
+// $rrow['blog_name'] = _CHARSET == 'UTF-8' ? $rrow['blog_name'] : $oPluginAdmin->plugin->_utf8_to_entities($rrow['blog_name']);
+
+ $rrow['excerpt'] = $oPluginAdmin->plugin->_cut_string($rrow['excerpt'], 800);
+ $rrow['excerpt'] = $oPluginAdmin->plugin->_strip_controlchar($rrow['excerpt']);
+ $rrow['excerpt'] = htmlspecialchars($rrow['excerpt']);
+// $rrow['excerpt'] = _CHARSET == 'UTF-8' ? $rrow['excerpt'] : $oPluginAdmin->plugin->_utf8_to_entities($rrow['excerpt']);
+
+ $rrow['url'] = htmlspecialchars($rrow['url'], ENT_QUOTES);
+ $rrow['story'] = htmlspecialchars(strip_tags($rrow['story']), ENT_QUOTES);
+ $items[] = $rrow;
+ }
+
+ $oTemplate->set ('amount', $amount);
+ $oTemplate->set ('count', $count);
+ $oTemplate->set ('start', $start);
+ $oTemplate->set ('items', $items);
+ $oTemplate->set ('story', $story);
+ $oTemplate->template('templates/list.html');
+ }
+
+ break;
+
+
+ case 'index':
+ $bres = mysql_query ("
+ SELECT
+ bnumber AS bnumber,
+ bname AS bname,
+ burl AS burl
+ FROM
+ ".sql_table('blog')."
+ ORDER BY
+ bname
+ ");
+
+ $blogs = array();
+
+ while ($brow = mysql_fetch_array($bres))
+ {
+ $ires = mysql_query ("
+ SELECT
+ i.inumber AS inumber,
+ i.ititle AS ititle,
+ COUNT(*) AS total
+ FROM
+ ".sql_table('item')." AS i,
+ ".sql_table('plugin_tb')." AS t
+ WHERE
+ i.iblog = ".$brow['bnumber']." AND
+ t.tb_id = i.inumber AND
+ t.block = 0
+ GROUP BY
+ i.inumber
+ ORDER BY
+ i.inumber DESC
+ ");
+
+ $items = array();
+
+ while ($irow = mysql_fetch_array($ires))
+ {
+ $items[] = $irow;
+ }
+
+ $brow['items'] = $items;
+ $blogs[] = $brow;
+ }
+
+ $oTemplate->set ('blogs', $blogs);
+ $oTemplate->template('templates/index.html');
+ break;
+
+ default:
+ //modify start+++++++++
+ if(!$tableVersion){
+ $oTemplate->template('templates/updatetable.html');
+ }
+ //modify end+++++++++
+ break;
+ }
+
+ // Create the admin area page
+ echo $oTemplate->fetch();
+ $oPluginAdmin->end();
+
+?>
--- /dev/null
+<h2>¥Ø¥ë¥×</h2>
+
+
+<h3>¥¹¥¥ó¤Ø¤Îµ½ÒÎã</h3>
+
+<p>
+ <h4><%TrackBack(list)%></h4>
+</p>
+<p>
+ ¼õ¤±¼è¤Ã¤¿¥È¥é¥Ã¥¯¥Ð¥Ã¥¯¤Î°ìÍ÷¤òɽ¼¨¤·¤Þ¤¹¡£<br />
+ ¤Þ¤¿¡¢ <strong><%TrackBack(list,12)%></strong>¤Î¤è¤¦¤Ë¥Ñ¥é¥á¡¼¥¿¤Î2¤Ä¤á¤Ëµ»öid¤ò¤Ä¤±¤ë¤È¡¢¤½¤Îµ»öid¤Ëping¤µ¤ì¤¿¥È¥é¥Ã¥¯¥Ð¥Ã¥¯¤Î°ìÍ÷¤òËä¤á¹þ¤à¤³¤È¤â²Äǽ¤Ç¤¹¡£<br />°ìÍ÷ɽ¼¨¤Î¥Ç¥¶¥¤¥ó(¥Æ¥ó¥×¥ì¡¼¥È)¤Ï¡¢¥×¥é¥°¥¤¥ó¤Î¥ª¥×¥·¥ç¥ó(ÊÔ½¸)²èÌ̤ˤƥ«¥¹¥¿¥Þ¥¤¥º¤Ç¤¤Þ¤¹¡£</p>
+
+<p>
+ <h4><%TrackBack(list)%></h4>
+</p>
+<p>
+ ¼õ¤±¼è¤Ã¤¿¥È¥é¥Ã¥¯¥Ð¥Ã¥¯¤Î°ìÍ÷¤òɽ¼¨¤·¤Þ¤¹¡£<br />
+ ¤Þ¤¿¡¢ <strong><%TrackBack(list,12)%></strong>¤Î¤è¤¦¤Ë¥Ñ¥é¥á¡¼¥¿¤Î2¤Ä¤á¤Ëµ»öid¤ò¤Ä¤±¤ë¤È¡¢¤½¤Îµ»öid¤Ëping¤µ¤ì¤¿¥È¥é¥Ã¥¯¥Ð¥Ã¥¯¤Î°ìÍ÷¤òËä¤á¹þ¤à¤³¤È¤â²Äǽ¤Ç¤¹¡£<br />°ìÍ÷ɽ¼¨¤Î¥Ç¥¶¥¤¥ó(¥Æ¥ó¥×¥ì¡¼¥È)¤Ï¡¢¥×¥é¥°¥¤¥ó¤Î¥ª¥×¥·¥ç¥ó(ÊÔ½¸)²èÌ̤ˤƥ«¥¹¥¿¥Þ¥¤¥º¤Ç¤¤Þ¤¹¡£
+</p>
+<p>
+ ¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¤¹¤Ù¤Æ¤Î¥È¥é¥Ã¥¯¥Ð¥Ã¥¯¤¬É½¼¨¤µ¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¤¬¡¢Â¿¿ô¤Î¥È¥é¥Ã¥¯¥Ð¥Ã¥¯¤¬¤¢¤ë¤è¤¦¤Ê¾ì¹ç¤Ë¤ÏºÇ¿·¤Î¤â¤Î¤À¤±¤òɽ¼¨¤·¤Æ¡¢»Ä¤ê¤ÎÉôʬ¤òÀޤꤿ¤¿¤à¤³¤È¤¬¤Ç¤¤Þ¤¹¡£<br />
+<br />
+¡¦ºÇ¿·¤Î5·ï¤À¤±¤òɽ¼¨¤·¤Æ¡¢¤¢¤È¤ÏÀޤꤿ¤¿¤à¾ì¹ç<br />
+<strong><%TrackBack(list, limit5)%></strong><br />
+<br />
+¡¦1.x·Ï¤ÈƱ¤¸¤è¤¦¤Ë¤¹¤Ù¤Æ¤Î¥È¥é¥Ã¥¯¥Ð¥Ã¥¯¤òŸ³«¤¹¤ë¾ì¹ç¡Ê¥Ç¥Õ¥©¥ë¥È¡Ë<br />
+<strong><%TrackBack(list, limit-1)%></strong><br />
+<br />
+¡¦¤¹¤Ù¤Æ¤Î¥È¥é¥Ã¥¯¥Ð¥Ã¥¯¤òÀޤꤿ¤¿¤ó¤À¾õÂ֤ˤ¹¤ë¾ì¹ç<br />
+<strong><%TrackBack(list, limit0)%></strong><br />
+</p>
+<p>
+ µ»öid¤Î»ØÄê¤È¤ÈÀޤꤿ¤¿¤ß¤òƱ»þ¤Ë»È¤¦¾ì¹ç¤Ë¤Ï<strong><%TrackBack(list,<em>µ»öid</em>,<em>limit0</em>)%></strong>¤Î¤è¤¦¤Ë»ØÄꤷ¤Þ¤¹¡£
+</p>
+
+<p>
+ <h4><%TrackBack(form)%></h4>
+</p>
+<p>
+ ¼êÆ°¤Ç¥È¥é¥Ã¥¯¥Ð¥Ã¥¯¤ò¼õ¤±ÉÕ¤±¤ëÆþÎÏ¥Õ¥©¡¼¥à¥Ú¡¼¥¸¤Ø¤Î¥ê¥ó¥¯url¤òɽ¼¨¤·¤Þ¤¹¡£<br />
+ ¥ê¥ó¥¯Àè¥Ú¡¼¥¸¤ÇÁê¼ê¦¤Ë¥È¥é¥Ã¥¯¥Ð¥Ã¥¯Á÷¿®µ¡Ç½¤¬¤Ê¤¤¾ì¹ç¤Ç¤âµ»öÍ×Ìó¤Èurl¤ò¼õ¤±ÉÕ¤±¤ë¤³¤È¤¬¤Ç¤¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡£<br /><br />
+ <blockquote>ÊØÍø¤Ê»È¤¤Êý¤È¤·¤Æ¤Ï¡¢¤³¤Î¥×¥é¥°¥¤¥ó¤Î¥ª¥×¥·¥ç¥ó(ÊÔ½¸)²èÌ̤ˤƥȥé¥Ã¥¯¥Ð¥Ã¥¯É½¼¨ÀìÍѥƥó¥×¥ì¡¼¥È¤Î¡Ö¥Õ¥Ã¥¿¡×¤Î½ê¤Ë¡¢
+ <pre>¤³¤Îµ»ö¤Ø¤Î¼êÆ°¥È¥é¥Ã¥¯¥Ð¥Ã¥¯¤Ï
+<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>¤«¤é¤É¤¦¤¾¡£
+</pre>
+ ¤È½ñ¤Â¤·¤Æ¤ª¤¯¤È¡¢¾åµ<strong><%TrackBack(list)%></strong>¤ò½ñ¤¤¤¿²Õ½ê¤Ë¼«Æ°Åª¤Ë¤³¤Î¼êÆ°ping¥Õ¥©¡¼¥à¤Ø¤Î¥ê¥ó¥¯¤¬É½¼¨¤µ¤ì¡¢¼êÆ°ping¥Õ¥©¡¼¥à¤¬¥Ý¥Ã¥×¥¢¥Ã¥×¤¹¤ë¤è¤¦¤Ë¤Ç¤¤Þ¤¹¡£<br />
+ ¤â¤Á¤í¤ó¡¢¥Æ¥ó¥×¥ì¡¼¥È¤Ë<strong><%form%></strong>¤òËä¤á¹þ¤Þ¤º¤Ë¡¢¥¹¥¥ó¤ÎÊ̤ξì½ê¤Ë¸ÄÊ̤Ë<a href='<%TrackBack(form)%></a>¤È½ñ¤¤¤Æ¤â(½ñ¤«¤Ê¤¯¤Æ¤â)·ë¹½¤Ç¤¹¡£</blockquote>
+
+</p>
+
+<p>
+ <h4><%TrackBack(url)%></h4>
+</p>
+<p>
+ ¤¤¤ï¤æ¤ë¥È¥é¥Ã¥¯¥Ð¥Ã¥¯URL(Áê¼ê¦¤«¤é¸«¤¿pingÀè)¤òɽ¼¨¤·¤Þ¤¹¡£<br />
+ ¤Þ¤¿¡¢¤³¤Î¥×¥é¥°¥¤¥ó¤Î¥ª¥×¥·¥ç¥ó(ÊÔ½¸)²èÌ̤ˤÆÀßÄê¤Ç¤¤ë¥È¥é¥Ã¥¯¥Ð¥Ã¥¯É½¼¨ÀìÍѥƥó¥×¥ì¡¼¥ÈÆâ¤Ë¤Ï<strong><%action%></strong>¤È½ñ¤¹þ¤à¤È¡¢¥È¥é¥Ã¥¯¥Ð¥Ã¥¯url¤ËÊÑ´¹¤µ¤ì¤Þ¤¹¡£<br />
+ <blockquote>Î㤨¤Ð¡¢¥È¥é¥Ã¥¯¥Ð¥Ã¥¯É½¼¨ÀìÍѥƥó¥×¥ì¡¼¥È¤Î¡Ö¥Õ¥Ã¥¿¡×¤Î½ê¤Ë¡¢
+ <pre>¤³¤Îµ»ö¤Ø¤Î¥È¥é¥Ã¥¯¥Ð¥Ã¥¯url:<a href='<%action%>'><%action%></a>
+(±¦¥¯¥ê¥Ã¥¯¤Ç¥·¥ç¡¼¥È¥«¥Ã¥È¤Î¥³¥Ô¡¼¤ò¤´ÍøÍѤ¯¤À¤µ¤¤)
+</pre>
+ ¤È½ñ¤¤¤Æ¤ª¤±¤Ð¡¢¸ÄÊ̤Ë<strong><%TrackBack(url)%></strong>¤ò¥¹¥¥ó¤Ë½ñ¤¹þ¤Þ¤Ê¤¯¤Æ¤â<strong><%TrackBack(list)%></strong>¤ò½ñ¤¤¤¿¾ì½ê¤Ëɽ¼¨¤µ¤ì¤Þ¤¹¡£</blockquote>
+</p>
+
+<h3>¥Æ¥ó¥×¥ì¡¼¥ÈÆâ¤Îµ½ÒÎã</h3>
+
+<p>
+ ¢¨¾åµ¤Î¥¹¥¥óµ½ÒÎã¤Ï¤¹¤Ù¤Æ¥Æ¥ó¥×¥ì¡¼¥ÈÆâ¤Ç¤â»ÈÍѤǤ¤Þ¤¹¡£
+</p>
+
+<p>
+ <h4><%TrackBack(count)%></h4>
+</p>
+<p>
+ µ»ö¤´¤È¤Î²¿·ï¥È¥é¥Ã¥¯¥Ð¥Ã¥¯·ï¿ô¤òɽ¼¨¤·¤Þ¤¹¡£<br />
+ ¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï"No Trackbacks",
+ "1 Trackback", "2 Trackbacks",¤Î¤è¤¦¤Ëɽ¼¨¤µ¤ì¤Þ¤¹¡£<br />
+ ¥×¥é¥°¥¤¥ó¤Î¥ª¥×¥·¥ç¥ó(ÊÔ½¸)²èÌ̤ˤÆÀßÄꤷ¤Æ¤¯¤À¤µ¤¤¡£
+</p>
+
+
+<h3>ɽ¼¨¤Î¥«¥¹¥¿¥Þ¥¤¥º</h3>
+
+<p>
+ ¥È¥é¥Ã¥¯¥Ð¥Ã¥¯´ØÏ¢¤Îɽ¼¨ÊýË¡¤Ï¥Æ¥ó¥×¥ì¡¼¥È¤òÊÔ½¸¤¹¤ë¤³¤È¤Ë¤è¤Ã¤Æ¥«¥¹¥¿¥Þ¥¤¥º¤Ç¤¤Þ¤¹¤¬¡¢¿§¤ä;Çò¤Ê¤É¤Î¥Ç¥¶¥¤¥ó¤ÏCSS¦¤Ç»ØÄꤹ¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£¥Æ¥ó¥×¥ì¡¼¥ÈÆâ¤ËÆþÎϤ·¤¿¥¯¥é¥¹Ì¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ïcss¤Ç»ØÄꤷ¤Æ¤¯¤À¤µ¤¤¡£¥Ç¥Õ¥©¥ë¥È¤Î¥Æ¥ó¥×¥ì¡¼¥È¤ò¾þ¤ëCSS¥×¥í¥Ñ¥Æ¥£¤ÎÎã¤ò¤¢¤²¤Æ¤ª¤¤Þ¤¹¡£
+</p>
+
+<pre>div.tb {
+ border: 1px solid #000; background: #FFF;
+}
+div.tb div.head {
+ padding: 4px;
+ background: #000; color: #FFF;
+ font-weight: bold; text-transform: lowercase; letter-spacing: 0.6em;
+}
+div.tb div.empty {
+ padding: 4px;
+ font-size: 95%;
+}
+div.tb div.item {
+ padding: 4px;
+}
+div.tb div.item div.name {
+ margin-bottom: 8px;
+ font-size: 120%; font-weight: bold;
+}
+div.tb div.item div.body {
+ font-size: 95%;
+}
+div.tb div.item div.body a {
+ font-weight: bold;
+}
+div.tb div.item div.date {
+ margin-bottom: 8px;
+ color: #888;
+ font-size: 85%; text-align: right;
+}
+div.tb div.info {
+ padding: 4px;
+ color: #FFF; background: #888;
+ font-size: 85%; font-style: italic;
+}</pre>
+
+<h3>ÆüËܸìÈǹ¹¿·ÍúÎò</h3>
+
+<ul>
+ <li>Version 2.0.3jp6 : (2006/09/30)</li>
+ <li>¡¡[Fixed] ¥»¥¥å¥ê¥Æ¥£¤Î¸þ¾å</li>
+
+ <li>Version 2.0.3jp5 : (2006/09/16)</li>
+ <li>¡¡[Fixed] getPermaLinksFromText()Æâ¤ÎURLÃê½Ð¥ë¡¼¥Á¥ó¤ÎÉÔ¶ñ¹ç¤ò½¤Àµ</li>
+ <li>¡¡[Fixed] Auto-Discovery»þ¤ËSQL¥¨¥é¡¼¤¬½Ð¤ëÉÔ¶ñ¹ç¤ò½¤Àµ</li>
+ <li>¡¡[Fixed] ´ÉÍý²èÌ̤ǥѡ¼¥¹¥¨¥é¡¼¤¬½Ð¤ë¾ì¹ç¤¬¤¢¤ëÉÔ¶ñ¹ç¤ò½¤Àµ</li>
+ <li>¡¡[Changed] SQL¤Î¥¯¥©¡¼¥È¤ò"¤«¤é'¤ËÊѹ¹</li>
+ <li>¡¡[Fixed] mb_emulator´Ä¶¤Ë¤Æ¥¨¥é¡¼¤¬½Ð¤ëÌäÂê¤ò½¤Àµ</li>
+ <li>¡¡[Fixed] curl¤¬Í¸ú¤Ê´Ä¶¤Ç¥¨¥é¡¼¤¬½Ð¤ëÌäÂê¤ò½¤Àµ</li>
+
+ <li>Version 2.0.3jp4 : (2006/07/15)</li>
+ <li>¡¡[Added] AutoDiscoveryURL½ÐÎÏ»þ¤ËSpamCheck¤ò¹Ô¤¦¤è¤¦¤Ë¤·¤¿</li>
+ <li>¡¡[Added] ¥á¥Ã¥»¡¼¥¸¡¢¥Ç¥Õ¥©¥ë¥ÈÃͤòÆüËܸ첽</li>
+ <li>¡¡[Added] Âç¼êASP¤Î¸ÀµÚ¥È¥é¥Ã¥¯¥Ð¥Ã¥¯¥Á¥§¥Ã¥¯¤ÎºÝ¤ËURL¤Î¥ê¥À¥¤¥ì¥¯¥È¤ò²ò½ü¤¹¤ë¤è¤¦¤Ë¤·¤¿</li>
+</ul>
\ No newline at end of file
--- /dev/null
+<h2>
+ All trackbacks
+ <?php if ($count > $amount): ?>
+ (Page <?php echo ceil($start / $amount) + 1;?> of <?php echo ceil($count / $amount);?>)
+ <?php endif; ?>
+</h2>
+
+<?php if(count($items)): ?>
+<?php if ($count > $amount): ?>
+<table class="navigation">
+ <tr>
+ <td style='padding: 0;'>
+ <?php if ($start > 0): ?>
+ <form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
+ <div>
+ <input type="submit" value="<< Previous" />
+ <input type="hidden" name="action" value="all" />
+ <input type="hidden" name="start" value="<?php echo max(0,$start - $amount);?>" />
+ </div>
+ </form>
+ <?php endif; ?>
+ </td>
+ <td style='padding: 0; text-align: right;'>
+ <?php if ($start + $amount < $count): ?>
+ <form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
+ <div>
+ <input type="submit" value="Next > >" />
+ <input type="hidden" name="action" value="all" />
+ <input type="hidden" name="start" value="<?php echo ($start + $amount);?>" />
+ </div>
+ </form>
+ <?php endif; ?>
+ </td>
+ </tr>
+</table>
+<?php endif; ?>
+
+<table>
+ <thead>
+ <tr>
+ <th>Story</th>
+ <th>Title, Blog and Excerpt</th>
+ <th>Date</th>
+ <th colspan='3'>Actions</th>
+ </tr>
+ </thead>
+ <tbody>
+ <?php while (list(,$item) = each ($items)): ?>
+ <tr onmouseover='focusRow(this);' onmouseout='blurRow(this);'>
+ <td>
+ <a href="<? echo $item['story_url']; ?>"><?php echo $item['story'];?></a>
+ </td>
+ <td>
+ <strong><?php echo $item['title'];?></strong>
+ <em>(<?php echo $item['blog_name'];?>)</em><br />
+ <?php echo $item['excerpt'];?>
+ </td>
+ <td>
+ <?php echo str_replace(' ', ' ', date("Y-m-d @ H:i",$item['timestamp']));?>
+ </td>
+ <td>
+ <a href='<?php echo $item['url'];?>'>Visit</a>
+ </td>
+ <td>
+ <a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=block&tb=<?php echo $item['id'];?>&next=all&start=<?php echo $start;?>'>Block</a>
+ </td>
+ <td>
+ <a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=delete&tb=<?php echo $item['id'];?>&next=all&start=<?php echo $start;?>'>Delete</a>
+ </td>
+ </tr>
+ <?php endwhile; ?>
+ </tbody>
+</table>
+
+<?php if ($count > $amount): ?>
+<table class="navigation">
+ <tr>
+ <td style='padding: 0;'>
+ <?php if ($start > 0): ?>
+ <form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
+ <div>
+ <input type="submit" value="<< Previous" />
+ <input type="hidden" name="action" value="all" />
+ <input type="hidden" name="start" value="<?php echo max(0,$start - $amount);?>" />
+ </div>
+ </form>
+ <?php endif; ?>
+ </td>
+ <td style='padding: 0; text-align: right;'>
+ <?php if ($start + $amount < $count): ?>
+ <form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
+ <div>
+ <input type="submit" value="Next > >" />
+ <input type="hidden" name="action" value="all" />
+ <input type="hidden" name="start" value="<?php echo ($start + $amount);?>" />
+ </div>
+ </form>
+ <?php endif; ?>
+ </td>
+ </tr>
+</table>
+<?php endif; ?>
+<?php endif; ?>
+
--- /dev/null
+<h2>
+ ¥Ö¥í¥Ã¥¯¤µ¤ì¤¿¥È¥é¥Ã¥¯¥Ð¥Ã¥¯
+ <?php if ($count > $amount): ?>
+ (Page <?php echo ceil($start / $amount) + 1;?> of <?php echo ceil($count / $amount);?>)
+ <?php endif; ?>
+</h2>
+
+<ul>
+ <li><a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=blocked_clear&next=blocked'>¥Ö¥í¥Ã¥¯¤µ¤ì¤¿¥È¥é¥Ã¥¯¥Ð¥Ã¥¯¤Î¥¯¥ê¥¢</a></li>
+ <li><a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=blocked_spamclear&next=blocked'>spamȽÄꤵ¤ì¤¿¥È¥é¥Ã¥¯¥Ð¥Ã¥¯¤Î¥¯¥ê¥¢</a></li>
+</ul>
+
+<?php if(count($items)): ?>
+<?php if ($count > $amount): ?>
+<table class="navigation">
+ <tr>
+ <td style='padding: 0;'>
+ <?php if ($start > 0): ?>
+ <form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
+ <div>
+ <input type="submit" value="<< Previous" />
+ <input type="hidden" name="action" value="blocked" />
+ <input type="hidden" name="start" value="<?php echo max(0,$start - $amount);?>" />
+ </div>
+ </form>
+ <?php endif; ?>
+ </td>
+ <td style='padding: 0; text-align: right;'>
+ <?php if ($start + $amount < $count): ?>
+ <form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
+ <div>
+ <input type="submit" value="Next > >" />
+ <input type="hidden" name="action" value="blocked" />
+ <input type="hidden" name="start" value="<?php echo ($start + $amount);?>" />
+ </div>
+ </form>
+ <?php endif; ?>
+ </td>
+ </tr>
+</table>
+<?php endif; ?>
+
+<table>
+ <thead>
+ <tr>
+ <th>Date</th>
+ <th>Story</th>
+ <th>Title, Blog and Excerpt</th>
+ <th>Spam?</th>
+ <th>Link?</th>
+ <th colspan='3'>Actions</th>
+ </tr>
+ </thead>
+ <tbody>
+ <?php while (list(,$item) = each ($items)): ?>
+ <tr onmouseover='focusRow(this);' onmouseout='blurRow(this);'>
+ <td>
+ <?php echo $item['timestamp'];?>
+ </td>
+ <td>
+ <a href="<? echo $item['story_url']; ?>"><?php echo $item['story'];?></a>
+ </td>
+ <td>
+ <strong><?php echo $item['title'];?></strong>
+ <em>(<?php echo $item['blog_name'];?>)</em><br />
+ <?php echo $item['excerpt'];?>
+ </td>
+ <td>
+ <?php echo $item['spam'] ?
+ '<span style="color: darkred;">Yes</span>' :
+ '<span style="color: darkgreen;">No</span>';?>
+ </td>
+ <td>
+ <?php echo $item['link'] ?
+ '<span style="color: darkgreen;">Yes</span>' :
+ '<span style="color: darkred;">No</span>';?>
+ </td>
+ <td>
+ <a href='<?php echo $item['url'];?>'>Visit</a>
+ </td>
+ <td>
+ <a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=unblock&tb=<?php echo $item['id'];?>&next=blocked&start=<?php echo $start;?>'>Unblock</a>
+ </td>
+ <td>
+ <a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=delete&tb=<?php echo $item['id'];?>&next=blocked&start=<?php echo $start;?>'>Delete</a>
+ </td>
+ </tr>
+ <?php endwhile; ?>
+ </tbody>
+</table>
+
+<?php if ($count > $amount): ?>
+<table class="navigation">
+ <tr>
+ <td style='padding: 0;'>
+ <?php if ($start > 0): ?>
+ <form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
+ <div>
+ <input type="submit" value="<< Previous" />
+ <input type="hidden" name="action" value="blocked" />
+ <input type="hidden" name="start" value="<?php echo max(0,$start - $amount);?>" />
+ </div>
+ </form>
+ <?php endif; ?>
+ </td>
+ <td style='padding: 0; text-align: right;'>
+ <?php if ($start + $amount < $count): ?>
+ <form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
+ <div>
+ <input type="submit" value="Next > >" />
+ <input type="hidden" name="action" value="blocked" />
+ <input type="hidden" name="start" value="<?php echo ($start + $amount);?>" />
+ </div>
+ </form>
+ <?php endif; ?>
+ </td>
+ </tr>
+</table>
+<?php endif; ?>
+<?php endif; ?>
+
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+ <head>
+ <title>TrackBack¤Î¼êÆ°Á÷¿®</title>
+ <link rel="stylesheet" type="text/css" href="<?php echo $CONF['AdminURL']?>styles/bookmarklet.css" />
+ </head>
+
+ <body>
+ <h1>TrackBack¤Î¼êÆ°Á÷¿®</h1>
+<?php if ($success): ?>
+ <p>
+ <strong>¥È¥é¥Ã¥¯¥Ð¥Ã¥¯¤ÎÁ÷¿®¤¬´°Î»¤·¤Þ¤·¤¿</strong>
+ </p>
+<?php endif; ?>
+<?php if ($error): ?>
+ <p>
+ <strong><?php echo $status; ?></strong>
+ </p>
+<?php endif; ?>
+<?php if ($form): ?>
+ <form method="post" action="<?php echo $CONF['ActionURL'] ?>">
+
+ <div>
+ <input type="hidden" name="tb_id" value="<?php echo $itemid;?>" />
+ <input type="hidden" name="action" value="plugin" />
+ <input type="hidden" name="name" value="TrackBack" />
+ <input type="hidden" name="type" value="ping" />
+
+ <table>
+ <tr>
+ <td>¤¢¤Ê¤¿¤Îµ»ö¤Îurl</td>
+ <td><input type="text" value="" name="url" size="60" /></td>
+ </tr>
+ <tr>
+ <td>µ»ö¤Î¥¿¥¤¥È¥ë</td>
+ <td><input type="text" value="" name="title" size="60" /></td>
+ </tr>
+ <tr>
+ <td>µ»ö¤ÎÍ×Ìóʸ</td>
+ <td><textarea name="excerpt" cols="40" rows="5"></textarea></td>
+ </tr>
+ <tr>
+ <td>¤¢¤Ê¤¿¤Îblog¤Î̾Á°</td>
+ <td><input type="text" value="" name="blog_name" size="60" /></td>
+ </tr>
+ <tr>
+ <td>¥È¥é¥Ã¥¯¥Ð¥Ã¥¯Á÷¿®</td>
+ <td><input type="submit" value="¥È¥é¥Ã¥¯¥Ð¥Ã¥¯¤òÁ÷¿®¤¹¤ë" /></td>
+ </tr>
+ </table>
+ </div>
+
+ </form>
+<?php endif; ?>
+ </body>
+</html>
\ No newline at end of file
--- /dev/null
+<h2>Overview of all items</h2>
+
+<?php if(count($blogs)): ?>
+
+<table>
+<?php while (list(,$blog) = each ($blogs)): ?>
+<?php if(count($blog['items'])): ?>
+ <thead>
+ <tr>
+ <th>Blog: <?php echo htmlspecialchars($blog['bname']);?></th>
+ <th>Total</th>
+ <th>Action</th>
+ </tr>
+ </thead>
+ <tbody>
+ <?php while (list(,$item) = each ($blog['items'])): ?>
+ <tr onmouseover='focusRow(this);' onmouseout='blurRow(this);'>
+ <td>
+ <?php echo $item['ititle'];?>
+ </td>
+ <td>
+ <?php echo htmlspecialchars($item['total']);?>
+ </td>
+ <td>
+ <a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=list&id=<?php echo $item['inumber'];?>'>Trackbacks</a>
+ </td>
+ </tr>
+ <?php endwhile; ?>
+ </tbody>
+<?php endif; ?>
+<?php endwhile; ?>
+</table>
+<?php endif; ?>
+
+
--- /dev/null
+<h2>
+ All trackbacks for "<?php echo $story['title'];?>"
+ <?php if ($count > $amount): ?>
+ (Page <?php echo ceil($start / $amount) + 1;?> of <?php echo ceil($count / $amount);?>)
+ <?php endif; ?>
+</h2>
+
+<?php if(count($items)): ?>
+<?php if ($count > $amount): ?>
+<table class="navigation">
+ <tr>
+ <td style='padding: 0;'>
+ <?php if ($start > 0): ?>
+ <form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
+ <div>
+ <input type="submit" value="<< Previous" />
+ <input type="hidden" name="action" value="list" />
+ <input type="hidden" name="id" value="<?php echo $story['id'];?>" />
+ <input type="hidden" name="start" value="<?php echo max(0,$start - $amount);?>" />
+ </div>
+ </form>
+ <?php endif; ?>
+ </td>
+ <td style='padding: 0; text-align: right;'>
+ <?php if ($start + $amount < $count): ?>
+ <form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
+ <div>
+ <input type="submit" value="Next > >" />
+ <input type="hidden" name="action" value="list" />
+ <input type="hidden" name="id" value="<?php echo $story['id'];?>" />
+ <input type="hidden" name="start" value="<?php echo ($start + $amount);?>" />
+ </div>
+ </form>
+ <?php endif; ?>
+ </td>
+ </tr>
+</table>
+<?php endif; ?>
+
+<table>
+ <thead>
+ <tr>
+ <th>Title, Blog and Excerpt</th>
+ <th>Date</th>
+ <th colspan='3'>Actions</th>
+ </tr>
+ </thead>
+ <tbody>
+ <?php while (list(,$item) = each ($items)): ?>
+ <tr onmouseover='focusRow(this);' onmouseout='blurRow(this);'>
+ <td>
+ <strong><?php echo $item['title'];?></strong>
+ <em>(<?php echo $item['blog_name'];?>)</em><br />
+ <?php echo $item['excerpt'];?>
+ </td>
+ <td>
+ <?php echo str_replace(' ', ' ', date("Y-m-d @ H:i",$item['timestamp']));?>
+ </td>
+ <td>
+ <a href='<?php echo $item['url'];?>'>Visit</a>
+ </td>
+ <td>
+ <a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=block&tb=<?php echo $item['id'];?>&next=list&id=<?php echo $story['id'];?>&start=<?php echo $start;?>'>Block</a>
+ </td>
+ <td>
+ <a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=delete&tb=<?php echo $item['id'];?>&next=list&id=<?php echo $story['id'];?>&start=<?php echo $start;?>'>Delete</a>
+ </td>
+ </tr>
+ <?php endwhile; ?>
+ </tbody>
+</table>
+
+<?php if ($count > $amount): ?>
+<table class="navigation">
+ <tr>
+ <td style='padding: 0;'>
+ <?php if ($start > 0): ?>
+ <form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
+ <div>
+ <input type="submit" value="<< Previous" />
+ <input type="hidden" name="action" value="list" />
+ <input type="hidden" name="id" value="<?php echo $story['id'];?>" />
+ <input type="hidden" name="start" value="<?php echo max(0,$start - $amount);?>" />
+ </div>
+ </form>
+ <?php endif; ?>
+ </td>
+ <td style='padding: 0; text-align: right;'>
+ <?php if ($start + $amount < $count): ?>
+ <form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
+ <div>
+ <input type="submit" value="Next > >" />
+ <input type="hidden" name="action" value="list" />
+ <input type="hidden" name="id" value="<?php echo $story['id'];?>" />
+ <input type="hidden" name="start" value="<?php echo ($start + $amount);?>" />
+ </div>
+ </form>
+ <?php endif; ?>
+ </td>
+ </tr>
+</table>
+<?php endif; ?>
+<?php endif; ?>
+
--- /dev/null
+
+<h2>Trackback</h2>
+
+<ul>
+ <li><a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=index'>Overview of all items</a></li>
+ <li><a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=all'>¥È¥é¥Ã¥¯¥Ð¥Ã¥¯¤ÎÁ´¥Ç¡¼¥¿</a></li>
+ <li><a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=blocked'>¥Ö¥í¥Ã¥¯¤µ¤ì¤¿¥È¥é¥Ã¥¯¥Ð¥Ã¥¯</a></li>
+ <li><a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=ping'>¼êÆ°ping</a></li>
+ <li><a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=help'>¥Ø¥ë¥×</a></li>
+ <li><a href='<?php echo $CONF['AdminURL'];?>index.php?action=pluginoptions&plugid=<?php echo $plugid;?>'>¥×¥é¥°¥¤¥ó¥ª¥×¥·¥ç¥óÀßÄê</a></li>
+</ul>
\ No newline at end of file
--- /dev/null
+<h2>¼êÆ°ping¥Õ¥©¡¼¥à</h2>
+
+<form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
+
+ <input type="hidden" name="action" value="sendping" />
+ <input type="hidden" name="next" value="ping" />
+
+ <table>
+ <tr>
+ <th colspan='2'>¼êÆ°ping</th>
+ </tr>
+ <tr>
+ <td>¤¢¤Ê¤¿¤Îurl</td>
+ <td>
+ <input type="text" name="url" size="60" value="<?php echo htmlspecialchars($item['url']);?>" />
+ </td>
+ </tr>
+ <tr>
+ <td>µ»ö¤Î¥¿¥¤¥È¥ë</td>
+ <td>
+ <input type="text" name="title" size="60" value="<?php echo htmlspecialchars($item['title']);?>" />
+ </td>
+ </tr>
+ <tr>
+ <td>µ»ö¤ÎÍ×Ìóʸ</td>
+ <td>
+ <textarea name="excerpt" cols="40" rows="5"><?php echo $item['excerpt'];?></textarea>
+ </td>
+ </tr>
+ <tr>
+ <td>Blog̾</td>
+ <td>
+ <input type="text" name="blog_name" size="60" value="<?php echo htmlspecialchars($item['blogname']);?>" />
+ </td>
+ </tr>
+ <tr>
+ <td>pingÀèurl</td>
+ <td>
+ <input type="text" value="" name="ping_url" size="60" />
+ </td>
+ </tr>
+ <tr>
+ <td>Á÷¿®</td>
+ <td><input type="submit" value="Á÷¿®" /></td>
+ </tr>
+ </table>
+
+</form>
\ No newline at end of file
--- /dev/null
+<blockquote style="color: red;border:1px solid red;padding:1em;"><b>¥¢¥Ã¥×¥Ç¡¼¥È¤¬É¬ÍפǤ¹:</b><br />
+¤³¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç±¿ÍѤ¹¤ë¤¿¤á¤Ë¤ÏDBÆâ¤Î¥Æ¡¼¥Ö¥ë¤Î¥¢¥Ã¥×¥Ç¡¼¥È¤¬É¬ÍפǤ¹¡£<br />
+º£¤Þ¤Ç¤Î¥Ç¡¼¥¿¤¬ºï½ü¤µ¤ì¤ë¤³¤È¤Ï¤¢¤ê¤Þ¤»¤ó¡£
+²¼¤Î¥¢¥Ã¥×¥Ç¡¼¥È¥Ü¥¿¥ó¤ò²¡¤·¤Æ¤¯¤À¤µ¤¤¡£
+
+ <form method="post"><div>
+ <input type="hidden" name="action" value="tableUpgrade" />
+ <input type="submit" tabindex="10" value="upgrade table" />
+ </div></form>
+</blockquote>
+
--- /dev/null
+<blockquote style="color: red;border:1px solid red;padding:1em;">
+¥Æ¡¼¥Ö¥ë¤Î¥¢¥Ã¥×¥Ç¡¼¥È¤Ï´°Î»¤·¤Þ¤·¤¿¡£
+</blockquote>
+
--- /dev/null
+<h2>ヘルプ</h2>
+
+
+<h3>スキンへの記述例</h3>
+
+<p>
+ <h4><%TrackBack(list)%></h4>
+</p>
+<p>
+ 受け取ったトラックバックの一覧を表示します。<br />
+ また、 <strong><%TrackBack(list,12)%></strong>のようにパラメータの2つめに記事idをつけると、その記事idにpingされたトラックバックの一覧を埋め込むことも可能です。<br />一覧表示のデザイン(テンプレート)は、プラグインのオプション(編集)画面にてカスタマイズできます。</p>
+
+<p>
+ <h4><%TrackBack(list)%></h4>
+</p>
+<p>
+ 受け取ったトラックバックの一覧を表示します。<br />
+ また、 <strong><%TrackBack(list,12)%></strong>のようにパラメータの2つめに記事idをつけると、その記事idにpingされたトラックバックの一覧を埋め込むことも可能です。<br />一覧表示のデザイン(テンプレート)は、プラグインのオプション(編集)画面にてカスタマイズできます。
+</p>
+<p>
+ デフォルトではすべてのトラックバックが表示されるようになっていますが、多数のトラックバックがあるような場合には最新のものだけを表示して、残りの部分を折りたたむことができます。<br />
+<br />
+・最新の5件だけを表示して、あとは折りたたむ場合<br />
+<strong><%TrackBack(list, limit5)%></strong><br />
+<br />
+・1.x系と同じようにすべてのトラックバックを展開する場合(デフォルト)<br />
+<strong><%TrackBack(list, limit-1)%></strong><br />
+<br />
+・すべてのトラックバックを折りたたんだ状態にする場合<br />
+<strong><%TrackBack(list, limit0)%></strong><br />
+</p>
+<p>
+ 記事idの指定とと折りたたみを同時に使う場合には<strong><%TrackBack(list,<em>記事id</em>,<em>limit0</em>)%></strong>のように指定します。
+</p>
+
+<p>
+ <h4><%TrackBack(form)%></h4>
+</p>
+<p>
+ 手動でトラックバックを受け付ける入力フォームページへのリンクurlを表示します。<br />
+ リンク先ページで相手側にトラックバック送信機能がない場合でも記事要約とurlを受け付けることができるようになります。<br /><br />
+ <blockquote>便利な使い方としては、このプラグインのオプション(編集)画面にてトラックバック表示専用テンプレートの「フッタ」の所に、
+ <pre>この記事への手動トラックバックは
+<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>からどうぞ。
+</pre>
+ と書き足しておくと、上記<strong><%TrackBack(list)%></strong>を書いた箇所に自動的にこの手動pingフォームへのリンクが表示され、手動pingフォームがポップアップするようにできます。<br />
+ もちろん、テンプレートに<strong><%form%></strong>を埋め込まずに、スキンの別の場所に個別に<a href='<%TrackBack(form)%></a>と書いても(書かなくても)結構です。</blockquote>
+
+</p>
+
+<p>
+ <h4><%TrackBack(url)%></h4>
+</p>
+<p>
+ いわゆるトラックバックURL(相手側から見たping先)を表示します。<br />
+ また、このプラグインのオプション(編集)画面にて設定できるトラックバック表示専用テンプレート内には<strong><%action%></strong>と書き込むと、トラックバックurlに変換されます。<br />
+ <blockquote>例えば、トラックバック表示専用テンプレートの「フッタ」の所に、
+ <pre>この記事へのトラックバックurl:<a href='<%action%>'><%action%></a>
+(右クリックでショートカットのコピーをご利用ください)
+</pre>
+ と書いておけば、個別に<strong><%TrackBack(url)%></strong>をスキンに書き込まなくても<strong><%TrackBack(list)%></strong>を書いた場所に表示されます。</blockquote>
+</p>
+
+<h3>テンプレート内の記述例</h3>
+
+<p>
+ ※上記のスキン記述例はすべてテンプレート内でも使用できます。
+</p>
+
+<p>
+ <h4><%TrackBack(count)%></h4>
+</p>
+<p>
+ 記事ごとの何件トラックバック件数を表示します。<br />
+ デフォルトでは"No Trackbacks",
+ "1 Trackback", "2 Trackbacks",のように表示されます。<br />
+ プラグインのオプション(編集)画面にて設定してください。
+</p>
+
+
+<h3>表示のカスタマイズ</h3>
+
+<p>
+ トラックバック関連の表示方法はテンプレートを編集することによってカスタマイズできますが、色や余白などのデザインはCSS側で指定する必要があります。テンプレート内に入力したクラス名のプロパティはcssで指定してください。デフォルトのテンプレートを飾るCSSプロパティの例をあげておきます。
+</p>
+
+<pre>div.tb {
+ border: 1px solid #000; background: #FFF;
+}
+div.tb div.head {
+ padding: 4px;
+ background: #000; color: #FFF;
+ font-weight: bold; text-transform: lowercase; letter-spacing: 0.6em;
+}
+div.tb div.empty {
+ padding: 4px;
+ font-size: 95%;
+}
+div.tb div.item {
+ padding: 4px;
+}
+div.tb div.item div.name {
+ margin-bottom: 8px;
+ font-size: 120%; font-weight: bold;
+}
+div.tb div.item div.body {
+ font-size: 95%;
+}
+div.tb div.item div.body a {
+ font-weight: bold;
+}
+div.tb div.item div.date {
+ margin-bottom: 8px;
+ color: #888;
+ font-size: 85%; text-align: right;
+}
+div.tb div.info {
+ padding: 4px;
+ color: #FFF; background: #888;
+ font-size: 85%; font-style: italic;
+}</pre>
+
+<h3>日本語版更新履歴</h3>
+
+<ul>
+ <li>Version 2.0.3jp6 : (2006/09/30)</li>
+ <li> [Fixed] セキュリティの向上</li>
+
+ <li>Version 2.0.3jp5 : (2006/09/16)</li>
+ <li> [Fixed] getPermaLinksFromText()内のURL抽出ルーチンの不具合を修正</li>
+ <li> [Fixed] Auto-Discovery時にSQLエラーが出る不具合を修正</li>
+ <li> [Fixed] 管理画面でパースエラーが出る場合がある不具合を修正</li>
+ <li> [Changed] SQLのクォートを"から'に変更</li>
+ <li> [Fixed] mb_emulator環境にてエラーが出る問題を修正</li>
+ <li> [Fixed] curlが有効な環境でエラーが出る問題を修正</li>
+
+ <li>Version 2.0.3jp4 : (2006/07/15)</li>
+ <li> [Added] AutoDiscoveryURL出力時にSpamCheckを行うようにした</li>
+ <li> [Added] メッセージ、デフォルト値を日本語化</li>
+ <li> [Added] 大手ASPの言及トラックバックチェックの際にURLのリダイレクトを解除するようにした</li>
+</ul>
\ No newline at end of file
--- /dev/null
+<h2>
+ All trackbacks
+ <?php if ($count > $amount): ?>
+ (Page <?php echo ceil($start / $amount) + 1;?> of <?php echo ceil($count / $amount);?>)
+ <?php endif; ?>
+</h2>
+
+<?php if(count($items)): ?>
+<?php if ($count > $amount): ?>
+<table class="navigation">
+ <tr>
+ <td style='padding: 0;'>
+ <?php if ($start > 0): ?>
+ <form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
+ <div>
+ <input type="submit" value="<< Previous" />
+ <input type="hidden" name="action" value="all" />
+ <input type="hidden" name="start" value="<?php echo max(0,$start - $amount);?>" />
+ </div>
+ </form>
+ <?php endif; ?>
+ </td>
+ <td style='padding: 0; text-align: right;'>
+ <?php if ($start + $amount < $count): ?>
+ <form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
+ <div>
+ <input type="submit" value="Next > >" />
+ <input type="hidden" name="action" value="all" />
+ <input type="hidden" name="start" value="<?php echo ($start + $amount);?>" />
+ </div>
+ </form>
+ <?php endif; ?>
+ </td>
+ </tr>
+</table>
+<?php endif; ?>
+
+<table>
+ <thead>
+ <tr>
+ <th>Story</th>
+ <th>Title, Blog and Excerpt</th>
+ <th>Date</th>
+ <th colspan='3'>Actions</th>
+ </tr>
+ </thead>
+ <tbody>
+ <?php while (list(,$item) = each ($items)): ?>
+ <tr onmouseover='focusRow(this);' onmouseout='blurRow(this);'>
+ <td>
+ <a href="<? echo $item['story_url']; ?>"><?php echo $item['story'];?></a>
+ </td>
+ <td>
+ <strong><?php echo $item['title'];?></strong>
+ <em>(<?php echo $item['blog_name'];?>)</em><br />
+ <?php echo $item['excerpt'];?>
+ </td>
+ <td>
+ <?php echo str_replace(' ', ' ', date("Y-m-d @ H:i",$item['timestamp']));?>
+ </td>
+ <td>
+ <a href='<?php echo $item['url'];?>'>Visit</a>
+ </td>
+ <td>
+ <a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=block&tb=<?php echo $item['id'];?>&next=all&start=<?php echo $start;?>'>Block</a>
+ </td>
+ <td>
+ <a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=delete&tb=<?php echo $item['id'];?>&next=all&start=<?php echo $start;?>'>Delete</a>
+ </td>
+ </tr>
+ <?php endwhile; ?>
+ </tbody>
+</table>
+
+<?php if ($count > $amount): ?>
+<table class="navigation">
+ <tr>
+ <td style='padding: 0;'>
+ <?php if ($start > 0): ?>
+ <form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
+ <div>
+ <input type="submit" value="<< Previous" />
+ <input type="hidden" name="action" value="all" />
+ <input type="hidden" name="start" value="<?php echo max(0,$start - $amount);?>" />
+ </div>
+ </form>
+ <?php endif; ?>
+ </td>
+ <td style='padding: 0; text-align: right;'>
+ <?php if ($start + $amount < $count): ?>
+ <form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
+ <div>
+ <input type="submit" value="Next > >" />
+ <input type="hidden" name="action" value="all" />
+ <input type="hidden" name="start" value="<?php echo ($start + $amount);?>" />
+ </div>
+ </form>
+ <?php endif; ?>
+ </td>
+ </tr>
+</table>
+<?php endif; ?>
+<?php endif; ?>
+
--- /dev/null
+<h2>
+ ブロックされたトラックバック
+ <?php if ($count > $amount): ?>
+ (Page <?php echo ceil($start / $amount) + 1;?> of <?php echo ceil($count / $amount);?>)
+ <?php endif; ?>
+</h2>
+
+<ul>
+ <li><a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=blocked_clear&next=blocked'>ブロックされたトラックバックのクリア</a></li>
+ <li><a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=blocked_spamclear&next=blocked'>spam判定されたトラックバックのクリア</a></li>
+</ul>
+
+<?php if(count($items)): ?>
+<?php if ($count > $amount): ?>
+<table class="navigation">
+ <tr>
+ <td style='padding: 0;'>
+ <?php if ($start > 0): ?>
+ <form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
+ <div>
+ <input type="submit" value="<< Previous" />
+ <input type="hidden" name="action" value="blocked" />
+ <input type="hidden" name="start" value="<?php echo max(0,$start - $amount);?>" />
+ </div>
+ </form>
+ <?php endif; ?>
+ </td>
+ <td style='padding: 0; text-align: right;'>
+ <?php if ($start + $amount < $count): ?>
+ <form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
+ <div>
+ <input type="submit" value="Next > >" />
+ <input type="hidden" name="action" value="blocked" />
+ <input type="hidden" name="start" value="<?php echo ($start + $amount);?>" />
+ </div>
+ </form>
+ <?php endif; ?>
+ </td>
+ </tr>
+</table>
+<?php endif; ?>
+
+<table>
+ <thead>
+ <tr>
+ <th>Date</th>
+ <th>Story</th>
+ <th>Title, Blog and Excerpt</th>
+ <th>Spam?</th>
+ <th>Link?</th>
+ <th colspan='3'>Actions</th>
+ </tr>
+ </thead>
+ <tbody>
+ <?php while (list(,$item) = each ($items)): ?>
+ <tr onmouseover='focusRow(this);' onmouseout='blurRow(this);'>
+ <td>
+ <?php echo $item['timestamp'];?>
+ </td>
+ <td>
+ <a href="<? echo $item['story_url']; ?>"><?php echo $item['story'];?></a>
+ </td>
+ <td>
+ <strong><?php echo $item['title'];?></strong>
+ <em>(<?php echo $item['blog_name'];?>)</em><br />
+ <?php echo $item['excerpt'];?>
+ </td>
+ <td>
+ <?php echo $item['spam'] ?
+ '<span style="color: darkred;">Yes</span>' :
+ '<span style="color: darkgreen;">No</span>';?>
+ </td>
+ <td>
+ <?php echo $item['link'] ?
+ '<span style="color: darkgreen;">Yes</span>' :
+ '<span style="color: darkred;">No</span>';?>
+ </td>
+ <td>
+ <a href='<?php echo $item['url'];?>'>Visit</a>
+ </td>
+ <td>
+ <a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=unblock&tb=<?php echo $item['id'];?>&next=blocked&start=<?php echo $start;?>'>Unblock</a>
+ </td>
+ <td>
+ <a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=delete&tb=<?php echo $item['id'];?>&next=blocked&start=<?php echo $start;?>'>Delete</a>
+ </td>
+ </tr>
+ <?php endwhile; ?>
+ </tbody>
+</table>
+
+<?php if ($count > $amount): ?>
+<table class="navigation">
+ <tr>
+ <td style='padding: 0;'>
+ <?php if ($start > 0): ?>
+ <form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
+ <div>
+ <input type="submit" value="<< Previous" />
+ <input type="hidden" name="action" value="blocked" />
+ <input type="hidden" name="start" value="<?php echo max(0,$start - $amount);?>" />
+ </div>
+ </form>
+ <?php endif; ?>
+ </td>
+ <td style='padding: 0; text-align: right;'>
+ <?php if ($start + $amount < $count): ?>
+ <form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
+ <div>
+ <input type="submit" value="Next > >" />
+ <input type="hidden" name="action" value="blocked" />
+ <input type="hidden" name="start" value="<?php echo ($start + $amount);?>" />
+ </div>
+ </form>
+ <?php endif; ?>
+ </td>
+ </tr>
+</table>
+<?php endif; ?>
+<?php endif; ?>
+
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+ <head>
+ <title>TrackBackの手動送信</title>
+ <link rel="stylesheet" type="text/css" href="<?php echo $CONF['AdminURL']?>styles/bookmarklet.css" />
+ </head>
+
+ <body>
+ <h1>TrackBackの手動送信</h1>
+<?php if ($success): ?>
+ <p>
+ <strong>トラックバックの送信が完了しました</strong>
+ </p>
+<?php endif; ?>
+<?php if ($error): ?>
+ <p>
+ <strong><?php echo $status; ?></strong>
+ </p>
+<?php endif; ?>
+<?php if ($form): ?>
+ <form method="post" action="<?php echo $CONF['ActionURL'] ?>">
+
+ <div>
+ <input type="hidden" name="tb_id" value="<?php echo $itemid;?>" />
+ <input type="hidden" name="action" value="plugin" />
+ <input type="hidden" name="name" value="TrackBack" />
+ <input type="hidden" name="type" value="ping" />
+
+ <table>
+ <tr>
+ <td>あなたの記事のurl</td>
+ <td><input type="text" value="" name="url" size="60" /></td>
+ </tr>
+ <tr>
+ <td>記事のタイトル</td>
+ <td><input type="text" value="" name="title" size="60" /></td>
+ </tr>
+ <tr>
+ <td>記事の要約文</td>
+ <td><textarea name="excerpt" cols="40" rows="5"></textarea></td>
+ </tr>
+ <tr>
+ <td>あなたのblogの名前</td>
+ <td><input type="text" value="" name="blog_name" size="60" /></td>
+ </tr>
+ <tr>
+ <td>トラックバック送信</td>
+ <td><input type="submit" value="トラックバックを送信する" /></td>
+ </tr>
+ </table>
+ </div>
+
+ </form>
+<?php endif; ?>
+ </body>
+</html>
\ No newline at end of file
--- /dev/null
+<h2>Overview of all items</h2>
+
+<?php if(count($blogs)): ?>
+
+<table>
+<?php while (list(,$blog) = each ($blogs)): ?>
+<?php if(count($blog['items'])): ?>
+ <thead>
+ <tr>
+ <th>Blog: <?php echo htmlspecialchars($blog['bname']);?></th>
+ <th>Total</th>
+ <th>Action</th>
+ </tr>
+ </thead>
+ <tbody>
+ <?php while (list(,$item) = each ($blog['items'])): ?>
+ <tr onmouseover='focusRow(this);' onmouseout='blurRow(this);'>
+ <td>
+ <?php echo $item['ititle'];?>
+ </td>
+ <td>
+ <?php echo htmlspecialchars($item['total']);?>
+ </td>
+ <td>
+ <a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=list&id=<?php echo $item['inumber'];?>'>Trackbacks</a>
+ </td>
+ </tr>
+ <?php endwhile; ?>
+ </tbody>
+<?php endif; ?>
+<?php endwhile; ?>
+</table>
+<?php endif; ?>
+
+
--- /dev/null
+<h2>
+ All trackbacks for "<?php echo $story['title'];?>"
+ <?php if ($count > $amount): ?>
+ (Page <?php echo ceil($start / $amount) + 1;?> of <?php echo ceil($count / $amount);?>)
+ <?php endif; ?>
+</h2>
+
+<?php if(count($items)): ?>
+<?php if ($count > $amount): ?>
+<table class="navigation">
+ <tr>
+ <td style='padding: 0;'>
+ <?php if ($start > 0): ?>
+ <form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
+ <div>
+ <input type="submit" value="<< Previous" />
+ <input type="hidden" name="action" value="list" />
+ <input type="hidden" name="id" value="<?php echo $story['id'];?>" />
+ <input type="hidden" name="start" value="<?php echo max(0,$start - $amount);?>" />
+ </div>
+ </form>
+ <?php endif; ?>
+ </td>
+ <td style='padding: 0; text-align: right;'>
+ <?php if ($start + $amount < $count): ?>
+ <form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
+ <div>
+ <input type="submit" value="Next > >" />
+ <input type="hidden" name="action" value="list" />
+ <input type="hidden" name="id" value="<?php echo $story['id'];?>" />
+ <input type="hidden" name="start" value="<?php echo ($start + $amount);?>" />
+ </div>
+ </form>
+ <?php endif; ?>
+ </td>
+ </tr>
+</table>
+<?php endif; ?>
+
+<table>
+ <thead>
+ <tr>
+ <th>Title, Blog and Excerpt</th>
+ <th>Date</th>
+ <th colspan='3'>Actions</th>
+ </tr>
+ </thead>
+ <tbody>
+ <?php while (list(,$item) = each ($items)): ?>
+ <tr onmouseover='focusRow(this);' onmouseout='blurRow(this);'>
+ <td>
+ <strong><?php echo $item['title'];?></strong>
+ <em>(<?php echo $item['blog_name'];?>)</em><br />
+ <?php echo $item['excerpt'];?>
+ </td>
+ <td>
+ <?php echo str_replace(' ', ' ', date("Y-m-d @ H:i",$item['timestamp']));?>
+ </td>
+ <td>
+ <a href='<?php echo $item['url'];?>'>Visit</a>
+ </td>
+ <td>
+ <a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=block&tb=<?php echo $item['id'];?>&next=list&id=<?php echo $story['id'];?>&start=<?php echo $start;?>'>Block</a>
+ </td>
+ <td>
+ <a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=delete&tb=<?php echo $item['id'];?>&next=list&id=<?php echo $story['id'];?>&start=<?php echo $start;?>'>Delete</a>
+ </td>
+ </tr>
+ <?php endwhile; ?>
+ </tbody>
+</table>
+
+<?php if ($count > $amount): ?>
+<table class="navigation">
+ <tr>
+ <td style='padding: 0;'>
+ <?php if ($start > 0): ?>
+ <form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
+ <div>
+ <input type="submit" value="<< Previous" />
+ <input type="hidden" name="action" value="list" />
+ <input type="hidden" name="id" value="<?php echo $story['id'];?>" />
+ <input type="hidden" name="start" value="<?php echo max(0,$start - $amount);?>" />
+ </div>
+ </form>
+ <?php endif; ?>
+ </td>
+ <td style='padding: 0; text-align: right;'>
+ <?php if ($start + $amount < $count): ?>
+ <form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
+ <div>
+ <input type="submit" value="Next > >" />
+ <input type="hidden" name="action" value="list" />
+ <input type="hidden" name="id" value="<?php echo $story['id'];?>" />
+ <input type="hidden" name="start" value="<?php echo ($start + $amount);?>" />
+ </div>
+ </form>
+ <?php endif; ?>
+ </td>
+ </tr>
+</table>
+<?php endif; ?>
+<?php endif; ?>
+
--- /dev/null
+
+<h2>Trackback</h2>
+
+<ul>
+ <li><a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=index'>Overview of all items</a></li>
+ <li><a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=all'>トラックバックの全データ</a></li>
+ <li><a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=blocked'>ブロックされたトラックバック</a></li>
+ <li><a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=ping'>手動ping</a></li>
+ <li><a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=help'>ヘルプ</a></li>
+ <li><a href='<?php echo $CONF['AdminURL'];?>index.php?action=pluginoptions&plugid=<?php echo $plugid;?>'>プラグインオプション設定</a></li>
+</ul>
\ No newline at end of file
--- /dev/null
+<h2>手動pingフォーム</h2>
+
+<form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
+
+ <input type="hidden" name="action" value="sendping" />
+ <input type="hidden" name="next" value="ping" />
+
+ <table>
+ <tr>
+ <th colspan='2'>手動ping</th>
+ </tr>
+ <tr>
+ <td>あなたのurl</td>
+ <td>
+ <input type="text" name="url" size="60" value="<?php echo htmlspecialchars($item['url']);?>" />
+ </td>
+ </tr>
+ <tr>
+ <td>記事のタイトル</td>
+ <td>
+ <input type="text" name="title" size="60" value="<?php echo htmlspecialchars($item['title']);?>" />
+ </td>
+ </tr>
+ <tr>
+ <td>記事の要約文</td>
+ <td>
+ <textarea name="excerpt" cols="40" rows="5"><?php echo $item['excerpt'];?></textarea>
+ </td>
+ </tr>
+ <tr>
+ <td>Blog名</td>
+ <td>
+ <input type="text" name="blog_name" size="60" value="<?php echo htmlspecialchars($item['blogname']);?>" />
+ </td>
+ </tr>
+ <tr>
+ <td>ping先url</td>
+ <td>
+ <input type="text" value="" name="ping_url" size="60" />
+ </td>
+ </tr>
+ <tr>
+ <td>送信</td>
+ <td><input type="submit" value="送信" /></td>
+ </tr>
+ </table>
+
+</form>
\ No newline at end of file
--- /dev/null
+<blockquote style="color: red;border:1px solid red;padding:1em;"><b>アップデートが必要です:</b><br />
+このバージョンで運用するためにはDB内のテーブルのアップデートが必要です。<br />
+今までのデータが削除されることはありません。
+下のアップデートボタンを押してください。
+
+ <form method="post"><div>
+ <input type="hidden" name="action" value="tableUpgrade" />
+ <input type="submit" tabindex="10" value="upgrade table" />
+ </div></form>
+</blockquote>
+
--- /dev/null
+<blockquote style="color: red;border:1px solid red;padding:1em;">
+テーブルのアップデートは完了しました。
+</blockquote>
+
--- /dev/null
+<?php
+define('_TB_LIST_IT', 'List it');
+define('_TB_DESCRIPTION', 'Send trackbacks to other weblogs and receive tracbacks from others.');
+
+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%>");
+define('_TB_NORTIFICATION_MAIL_TITLE', "New Trackback received for ID <%tb_id%>");
+
+define('_TB_AcceptPing', 'Accept pings');
+define('_TB_SendPings', 'Allow sending pings');
+define('_TB_AutoXMLHttp', 'Auto-detect Trackback URLs as you type');
+define('_TB_CheckIDs', 'Only allow valid itemids as trackback-ids');
+
+define('_TB_tplHeader', 'Header');
+define('_TB_tplEmpty', 'Empty');
+define('_TB_tplItem', 'Item');
+define('_TB_tplFooter', 'Footer');
+
+define('_TB_tplHeader_VAL', "<div class=\"tb\">\n\t<div class=\"head\">Trackback</div><%admin%>\n\n");
+define('_TB_tplEmpty_VAL', "\t<div class=\"empty\">\n\t\tThere are currently no trackbacks for this item.\n\t</div>\n\n");
+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");
+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>");
+
+define('_TB_tplLocalHeader_VAL', "<div class=\"tblocal\">\n\t<div class=\"head\">Local Trackback</div>\n\n");
+define('_TB_tplLocalEmpty_VAL', "");
+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");
+define('_TB_tplLocalFooter_VAL', "\t</div>");
+
+define('_TB_tplLocalHeader', 'Header (Local)');
+define('_TB_tplLocalEmpty', 'Empty (Local)');
+define('_TB_tplLocalItem', 'Item (Local)');
+define('_TB_tplLocalFooter', 'Footer (Local)');
+
+define('_TB_tplTbNone', 'Trackback count (none)');
+define('_TB_tplTbOne', 'Trackback count (one)');
+define('_TB_tplTbMore', 'Trackback count (more)');
+
+define('_TB_dateFormat', 'Date format');
+define('_TB_dateFormat_VAL', "%e/%m/%g");
+
+define('_TB_Notify', 'Send e-mail notification on ping receipt');
+define('_TB_NotifyEmail', 'Which e-mail address to send these notification to?');
+define('_TB_DropTable', 'Clear the database when uninstalling');
+define('_TB_HideUrl', 'Hide external URL');
+define('_TB_ItemAcceptPing', 'Accept pings');
+define('_TB_isAcceptWOLink', 'Accept pings w/o link ?');
+define('_TB_isAcceptWOLinkDef', 'Accept pings w/o link ? (blog default)');
+define('_TB_AllowTrackBack', 'Accept pings to this blog');
+
+define('_TB_isAcceptWOLink_VAL', 'default|default|yes|yes|no|no');
+define('_TB_isAcceptWOLinkDef_VAL', 'yes|yes|no (block)|block|no (ignore)|ignore');
+?>
\ No newline at end of file
--- /dev/null
+<?php
+define('_TB_LIST_IT', 'Á÷¿®¥ê¥¹¥È¤ËÄɲÃ');
+define('_TB_DESCRIPTION', '¥È¥é¥Ã¥¯¥Ð¥Ã¥¯¤Î¼õÁ÷¿®¤ò¹Ô¤¤¤Þ¤¹');
+
+define('_TB_NORTIFICATION_MAIL_BODY', "<%blogname%> ¤«¤é ID:<%tb_id%> ¤Îµ»ö¤ËÂФ·¤Æ¥È¥é¥Ã¥¯¥Ð¥Ã¥¯¤ò¼õ¿®¤·¤Þ¤·¤¿¡£ ¾ÜºÙ¤Ï²¼µ¤Î¤È¤ª¤ê¤Ç¤¹:\n\nURL:\t<%url%>\n¥¿¥¤¥È¥ë:\t<%title%>\n³µÍ×:\t<%excerpt%>\n¥Ö¥í¥°Ì¾:\t<%blogname%>");
+define('_TB_NORTIFICATION_MAIL_TITLE', "¥È¥é¥Ã¥¯¥Ð¥Ã¥¯¤ò¼õ¿®¤·¤Þ¤·¤¿ ID:<%tb_id%>");
+
+define('_TB_AcceptPing', '¥È¥é¥Ã¥¯¥Ð¥Ã¥¯¤Î¼õÉÕ¤ò¤¹¤ë¤«?');
+define('_TB_SendPings', '¥È¥é¥Ã¥¯¥Ð¥Ã¥¯¤ÎÁ÷¿®¤ò²Äǽ¤Ë¤¹¤ë¤«?');
+define('_TB_AutoXMLHttp', 'autodiscoveryµ¡Ç½(µ»öÆâ¤Î¥ê¥ó¥¯Àè¤ÎTrackbackURL¤Î¼«Æ°¸¡ÃÎ)¤ò»È¤¦¤«?');
+define('_TB_CheckIDs', 'ping¼õÉÕ»þ¤Ë͸ú¤Êitemid¤«¤É¤¦¤«¤ò¥Á¥§¥Ã¥¯¤¹¤ë¤«?');
+
+define('_TB_tplHeader', 'TB°ìÍ÷¥Æ¥ó¥×¥ì¡¼¥È(¥Ø¥Ã¥ÀÉô)');
+define('_TB_tplEmpty', 'TB°ìÍ÷¥Æ¥ó¥×¥ì¡¼¥È(0·ï¤Î¤È¤)');
+define('_TB_tplItem', 'TB°ìÍ÷¥Æ¥ó¥×¥ì¡¼¥È(¥¢¥¤¥Æ¥àÉô)');
+define('_TB_tplFooter', 'TB°ìÍ÷¥Æ¥ó¥×¥ì¡¼¥È(¥Õ¥Ã¥¿Éô)');
+
+define('_TB_tplHeader_VAL', "<div class=\"tb\">\n\t<div class=\"head\">¥È¥é¥Ã¥¯¥Ð¥Ã¥¯</div><%admin%>\n\n");
+define('_TB_tplEmpty_VAL', "\t<div class=\"empty\">\n\t\t¤³¤Î¥¨¥ó¥È¥ê¤Ë¥È¥é¥Ã¥¯¥Ð¥Ã¥¯¤Ï¤¢¤ê¤Þ¤»¤ó\n\t</div>\n\n");
+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");
+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>");
+
+define('_TB_tplLocalHeader', '¥í¡¼¥«¥ëTB°ìÍ÷¥Æ¥ó¥×¥ì¡¼¥È(¥Ø¥Ã¥ÀÉô)');
+define('_TB_tplLocalEmpty', '¥í¡¼¥«¥ëTB°ìÍ÷¥Æ¥ó¥×¥ì¡¼¥È(0·ï¤Î¤È¤)');
+define('_TB_tplLocalItem', '¥í¡¼¥«¥ëTB°ìÍ÷¥Æ¥ó¥×¥ì¡¼¥È(¥¢¥¤¥Æ¥àÉô)');
+define('_TB_tplLocalFooter', '¥í¡¼¥«¥ëTB°ìÍ÷¥Æ¥ó¥×¥ì¡¼¥È(¥Õ¥Ã¥¿Éô)');
+
+define('_TB_tplLocalHeader_VAL', "<div class=\"tblocal\">\n\t<div class=\"head\">¥í¡¼¥«¥ë¥È¥é¥Ã¥¯¥Ð¥Ã¥¯</div>\n\n");
+define('_TB_tplLocalEmpty_VAL', "");
+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");
+define('_TB_tplLocalFooter_VAL', "\t</div>");
+
+define('_TB_tplTbNone', 'TB¿ôɽ¼¨·Á¼°(0·ï)');
+define('_TB_tplTbOne', 'TB¿ôɽ¼¨·Á¼°(1·ï)');
+define('_TB_tplTbMore', 'TB¿ôɽ¼¨·Á¼°(2·ï°Ê¾å)');
+define('_TB_dateFormat', 'ÆüÉդηÁ¼°');
+define('_TB_dateFormat_VAL', "%Y/%m/%d %H:%I");
+
+define('_TB_Notify', 'ping¼õÉÕ»þ¤Ë¥á¡¼¥ëÁ÷¿®¤¹¤ë¤«?');
+define('_TB_NotifyEmail', 'ping¼õÉÕ»þ¤Î¥á¡¼¥ëÁ÷¿®Àè');
+define('_TB_DropTable', '¥×¥é¥°¥¤¥ó¤Îºï½ü»þ¤Ë¥Ç¡¼¥¿¤òºï½ü¤¹¤ë¤«?');
+define('_TB_HideUrl', '°ìÍ÷ɽ¼¨¤ÎºÝ¤Ë³°Éô¤ÎURL¤ò¥ê¥À¥¤¥ì¥¯¥È¤ËÊÑ´¹¤¹¤ë¤«?');
+define('_TB_ItemAcceptPing', 'TB¤ò¼õÉÕ¤¹¤ë¤«?');
+define('_TB_isAcceptWOLink', '¸ÀµÚ¥ê¥ó¥¯¤¬¤Ê¤¯¤Æ¤âTB¤ò¼õÉÕ¤¹¤ë¤«?');
+define('_TB_isAcceptWOLinkDef', '¸ÀµÚ¥ê¥ó¥¯¤¬¤Ê¤¯¤Æ¤âTB¤ò¼õÉÕ¤¹¤ë¤«? (blog¥Ç¥Õ¥©¥ë¥È)');
+define('_TB_AllowTrackBack', '¤³¤Î¥Ö¥í¥°¤ÇTB¤ò¼õÉÕ¤¹¤ë¤«?');
+
+define('_TB_isAcceptWOLink_VAL', '¥Ö¥í¥°¥Ç¥Õ¥©¥ë¥È¤Ë½¾¤¦|default|¤Ï¤¤|yes|¤¤¤¤¤¨|no');
+define('_TB_isAcceptWOLinkDef_VAL', '¤Ï¤¤|yes|¤¤¤¤¤¨(ÊÝα)|block|¤¤¤¤¤¨(̵»ë)|ignore');
+?>
\ No newline at end of file
--- /dev/null
+<?php
+define('_TB_LIST_IT', '送信リストに追加');
+define('_TB_DESCRIPTION', 'トラックバックの受送信を行います');
+
+define('_TB_NORTIFICATION_MAIL_BODY', "<%blogname%> から ID:<%tb_id%> の記事に対してトラックバックを受信しました。 詳細は下記のとおりです:\n\nURL:\t<%url%>\nタイトル:\t<%title%>\n概要:\t<%excerpt%>\nブログ名:\t<%blogname%>");
+define('_TB_NORTIFICATION_MAIL_TITLE', "トラックバックを受信しました ID:<%tb_id%>");
+
+define('_TB_AcceptPing', 'トラックバックの受付をするか?');
+define('_TB_SendPings', 'トラックバックの送信を可能にするか?');
+define('_TB_AutoXMLHttp', 'autodiscovery機能(記事内のリンク先のTrackbackURLの自動検知)を使うか?');
+define('_TB_CheckIDs', 'ping受付時に有効なitemidかどうかをチェックするか?');
+
+define('_TB_tplHeader', 'TB一覧テンプレート(ヘッダ部)');
+define('_TB_tplEmpty', 'TB一覧テンプレート(0件のとき)');
+define('_TB_tplItem', 'TB一覧テンプレート(アイテム部)');
+define('_TB_tplFooter', 'TB一覧テンプレート(フッタ部)');
+
+define('_TB_tplHeader_VAL', "<div class=\"tb\">\n\t<div class=\"head\">トラックバック</div><%admin%>\n\n");
+define('_TB_tplEmpty_VAL', "\t<div class=\"empty\">\n\t\tこのエントリにトラックバックはありません\n\t</div>\n\n");
+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");
+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>");
+
+define('_TB_tplLocalHeader', 'ローカルTB一覧テンプレート(ヘッダ部)');
+define('_TB_tplLocalEmpty', 'ローカルTB一覧テンプレート(0件のとき)');
+define('_TB_tplLocalItem', 'ローカルTB一覧テンプレート(アイテム部)');
+define('_TB_tplLocalFooter', 'ローカルTB一覧テンプレート(フッタ部)');
+
+define('_TB_tplLocalHeader_VAL', "<div class=\"tblocal\">\n\t<div class=\"head\">ローカルトラックバック</div>\n\n");
+define('_TB_tplLocalEmpty_VAL', "");
+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");
+define('_TB_tplLocalFooter_VAL', "\t</div>");
+
+define('_TB_tplTbNone', 'TB数表示形式(0件)');
+define('_TB_tplTbOne', 'TB数表示形式(1件)');
+define('_TB_tplTbMore', 'TB数表示形式(2件以上)');
+define('_TB_dateFormat', '日付の形式');
+define('_TB_dateFormat_VAL', "%Y/%m/%d %H:%I");
+
+define('_TB_Notify', 'ping受付時にメール送信するか?');
+define('_TB_NotifyEmail', 'ping受付時のメール送信先');
+define('_TB_DropTable', 'プラグインの削除時にデータを削除するか?');
+define('_TB_HideUrl', '一覧表示の際に外部のURLをリダイレクトに変換するか?');
+define('_TB_ItemAcceptPing', 'TBを受付するか?');
+define('_TB_isAcceptWOLink', '言及リンクがなくてもTBを受付するか?');
+define('_TB_isAcceptWOLinkDef', '言及リンクがなくてもTBを受付するか? (blogデフォルト)');
+define('_TB_AllowTrackBack', 'このブログでTBを受付するか?');
+
+define('_TB_isAcceptWOLink_VAL', 'ブログデフォルトに従う|default|はい|yes|いいえ|no');
+define('_TB_isAcceptWOLinkDef_VAL', 'はい|yes|いいえ(保留)|block|いいえ(無視)|ignore');
+?>
\ No newline at end of file
--- /dev/null
+#!/bin/bash -x
+
+FILES=`find japanese-utf8.templates -name '*html'`
+
+for utf8file in $FILES
+do
+ eucfile=`echo $utf8file | sed 's/japanese-utf8/japanese-euc/'`
+ nkf -e -W -d < $utf8file > $eucfile
+done
--- /dev/null
+<?php
+class Trackback_Template {
+ var $vars;
+
+ function Trackback_Template($file = null, $prefix = '') {
+ $this->file = ($prefix ? $prefix . '/' : '') . $file;
+ $this->prefix = $prefix;
+ }
+
+ function set($name, $value) {
+ $this->vars[$name] = is_object($value) ? $value->fetch() : $value;
+ }
+
+ function template($file = null) {
+ $language = ereg_replace( '[\\|/]', '', getLanguageName());
+ $this->file = (file_exists(($this->prefix ? $this->prefix . '/' : '') . $language.'.'.$file))? ($this->prefix ? $this->prefix . '/' : '') . $language.'.'.$file: ($this->prefix ? $this->prefix . '/' : '') . $file;
+ }
+
+ function fetch($file = null) {
+ if(!$file) $file = $this->file;
+ else ($prefix ? $prefix . '/' : '') . $file;
+
+ if ($file != null)
+ {
+ if (is_array($this->vars)) extract($this->vars);
+
+ ob_start();
+ include($file);
+ $contents = ob_get_contents();
+ ob_end_clean();
+
+ return $contents;
+ }
+ }
+}
+
+?>
\ No newline at end of file
--- /dev/null
+<h2>
+ All trackbacks
+ <?php if ($count > $amount): ?>
+ (Page <?php echo ceil($start / $amount) + 1;?> of <?php echo ceil($count / $amount);?>)
+ <?php endif; ?>
+</h2>
+
+<?php if(count($items)): ?>
+<?php if ($count > $amount): ?>
+<table class="navigation">
+ <tr>
+ <td style='padding: 0;'>
+ <?php if ($start > 0): ?>
+ <form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
+ <div>
+ <input type="submit" value="<< Previous" />
+ <input type="hidden" name="action" value="all" />
+ <input type="hidden" name="start" value="<?php echo max(0,$start - $amount);?>" />
+ </div>
+ </form>
+ <?php endif; ?>
+ </td>
+ <td style='padding: 0; text-align: right;'>
+ <?php if ($start + $amount < $count): ?>
+ <form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
+ <div>
+ <input type="submit" value="Next > >" />
+ <input type="hidden" name="action" value="all" />
+ <input type="hidden" name="start" value="<?php echo ($start + $amount);?>" />
+ </div>
+ </form>
+ <?php endif; ?>
+ </td>
+ </tr>
+</table>
+<?php endif; ?>
+
+<table>
+ <thead>
+ <tr>
+ <th>Story</th>
+ <th>Title, Blog and Excerpt</th>
+ <th>Date</th>
+ <th colspan='3'>Actions</th>
+ </tr>
+ </thead>
+ <tbody>
+ <?php while (list(,$item) = each ($items)): ?>
+ <tr onmouseover='focusRow(this);' onmouseout='blurRow(this);'>
+ <td>
+ <a href="<? echo $item['story_url']; ?>"><?php echo $item['story'];?></a>
+ </td>
+ <td>
+ <strong><?php echo $item['title'];?></strong>
+ <em>(<?php echo $item['blog_name'];?>)</em><br />
+ <?php echo $item['excerpt'];?>
+ </td>
+ <td>
+ <?php echo str_replace(' ', ' ', date("Y-m-d @ H:i",$item['timestamp']));?>
+ </td>
+ <td>
+ <a href='<?php echo $item['url'];?>'>Visit</a>
+ </td>
+ <td>
+ <a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=block&tb=<?php echo $item['id'];?>&next=all&start=<?php echo $start;?>'>Block</a>
+ </td>
+ <td>
+ <a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=delete&tb=<?php echo $item['id'];?>&next=all&start=<?php echo $start;?>'>Delete</a>
+ </td>
+ </tr>
+ <?php endwhile; ?>
+ </tbody>
+</table>
+
+<?php if ($count > $amount): ?>
+<table class="navigation">
+ <tr>
+ <td style='padding: 0;'>
+ <?php if ($start > 0): ?>
+ <form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
+ <div>
+ <input type="submit" value="<< Previous" />
+ <input type="hidden" name="action" value="all" />
+ <input type="hidden" name="start" value="<?php echo max(0,$start - $amount);?>" />
+ </div>
+ </form>
+ <?php endif; ?>
+ </td>
+ <td style='padding: 0; text-align: right;'>
+ <?php if ($start + $amount < $count): ?>
+ <form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
+ <div>
+ <input type="submit" value="Next > >" />
+ <input type="hidden" name="action" value="all" />
+ <input type="hidden" name="start" value="<?php echo ($start + $amount);?>" />
+ </div>
+ </form>
+ <?php endif; ?>
+ </td>
+ </tr>
+</table>
+<?php endif; ?>
+<?php endif; ?>
+
--- /dev/null
+<h2>
+ Blocked trackbacks
+ <?php if ($count > $amount): ?>
+ (Page <?php echo ceil($start / $amount) + 1;?> of <?php echo ceil($count / $amount);?>)
+ <?php endif; ?>
+</h2>
+
+<ul>
+ <li><a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=blocked_clear&next=blocked'>Clear blocked trackbacks</a></li>
+ <li><a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=blocked_spamclear&next=blocked'>Clear spam trackbacks</a></li>
+</ul>
+
+<?php if(count($items)): ?>
+<?php if ($count > $amount): ?>
+<table class="navigation">
+ <tr>
+ <td style='padding: 0;'>
+ <?php if ($start > 0): ?>
+ <form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
+ <div>
+ <input type="submit" value="<< Previous" />
+ <input type="hidden" name="action" value="blocked" />
+ <input type="hidden" name="start" value="<?php echo max(0,$start - $amount);?>" />
+ </div>
+ </form>
+ <?php endif; ?>
+ </td>
+ <td style='padding: 0; text-align: right;'>
+ <?php if ($start + $amount < $count): ?>
+ <form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
+ <div>
+ <input type="submit" value="Next > >" />
+ <input type="hidden" name="action" value="blocked" />
+ <input type="hidden" name="start" value="<?php echo ($start + $amount);?>" />
+ </div>
+ </form>
+ <?php endif; ?>
+ </td>
+ </tr>
+</table>
+<?php endif; ?>
+
+<table>
+ <thead>
+ <tr>
+ <th>Date</th>
+ <th>Story</th>
+ <th>Title, Blog and Excerpt</th>
+ <th>Spam?</th>
+ <th>Link?</th>
+ <th colspan='3'>Actions</th>
+ </tr>
+ </thead>
+ <tbody>
+ <?php while (list(,$item) = each ($items)): ?>
+ <tr onmouseover='focusRow(this);' onmouseout='blurRow(this);'>
+ <td>
+ <?php echo $item['timestamp'];?>
+ </td>
+ <td>
+ <a href="<? echo $item['story_url']; ?>"><?php echo $item['story'];?></a>
+ </td>
+ <td>
+ <strong><?php echo $item['title'];?></strong>
+ <em>(<?php echo $item['blog_name'];?>)</em><br />
+ <?php echo $item['excerpt'];?>
+ </td>
+ <td>
+ <?php echo $item['spam'] ?
+ '<span style="color: darkred;">Yes</span>' :
+ '<span style="color: darkgreen;">No</span>';?>
+ </td>
+ <td>
+ <?php echo $item['link'] ?
+ '<span style="color: darkgreen;">Yes</span>' :
+ '<span style="color: darkred;">No</span>';?>
+ </td>
+ <td>
+ <a href='<?php echo $item['url'];?>'>Visit</a>
+ </td>
+ <td>
+ <a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=unblock&tb=<?php echo $item['id'];?>&next=blocked&start=<?php echo $start;?>'>Unblock</a>
+ </td>
+ <td>
+ <a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=delete&tb=<?php echo $item['id'];?>&next=blocked&start=<?php echo $start;?>'>Delete</a>
+ </td>
+ </tr>
+ <?php endwhile; ?>
+ </tbody>
+</table>
+
+<?php if ($count > $amount): ?>
+<table class="navigation">
+ <tr>
+ <td style='padding: 0;'>
+ <?php if ($start > 0): ?>
+ <form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
+ <div>
+ <input type="submit" value="<< Previous" />
+ <input type="hidden" name="action" value="blocked" />
+ <input type="hidden" name="start" value="<?php echo max(0,$start - $amount);?>" />
+ </div>
+ </form>
+ <?php endif; ?>
+ </td>
+ <td style='padding: 0; text-align: right;'>
+ <?php if ($start + $amount < $count): ?>
+ <form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
+ <div>
+ <input type="submit" value="Next > >" />
+ <input type="hidden" name="action" value="blocked" />
+ <input type="hidden" name="start" value="<?php echo ($start + $amount);?>" />
+ </div>
+ </form>
+ <?php endif; ?>
+ </td>
+ </tr>
+</table>
+<?php endif; ?>
+<?php endif; ?>
+
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+ <head>
+ <title>Add TrackBack</title>
+ <link rel="stylesheet" type="text/css" href="<?php echo $CONF['AdminURL']?>styles/bookmarklet.css" />
+ </head>
+
+ <body>
+ <h1>TrackBack Ping</h1>
+<?php if ($success): ?>
+ <p>
+ <strong>Your trackback has been received properly.</strong>
+ </p>
+<?php endif; ?>
+<?php if ($error): ?>
+ <p>
+ <strong><?php echo $status; ?></strong>
+ </p>
+<?php endif; ?>
+<?php if ($form): ?>
+ <form method="post" action="<?php echo $CONF['ActionURL'] ?>">
+
+ <div>
+ <input type="hidden" name="tb_id" value="<?php echo $itemid;?>" />
+ <input type="hidden" name="action" value="plugin" />
+ <input type="hidden" name="name" value="TrackBack" />
+ <input type="hidden" name="type" value="ping" />
+
+ <table>
+ <tr>
+ <td>Article URL</td>
+ <td><input type="text" value="" name="url" size="60" /></td>
+ </tr>
+ <tr>
+ <td>Article Title</td>
+ <td><input type="text" value="" name="title" size="60" /></td>
+ </tr>
+ <tr>
+ <td>Excerpt from article</td>
+ <td><textarea name="excerpt" cols="40" rows="5"></textarea></td>
+ </tr>
+ <tr>
+ <td>Your Blog Name</td>
+ <td><input type="text" value="" name="blog_name" size="60" /></td>
+ </tr>
+ <tr>
+ <td>Add TrackBack</td>
+ <td><input type="submit" value="Add TrackBack" /></td>
+ </tr>
+ </table>
+ </div>
+
+ </form>
+<?php endif; ?>
+ </body>
+</html>
\ No newline at end of file
--- /dev/null
+<h2>Overview of all items</h2>
+
+<?php if(count($blogs)): ?>
+
+<table>
+<?php while (list(,$blog) = each ($blogs)): ?>
+<?php if(count($blog['items'])): ?>
+ <thead>
+ <tr>
+ <th>Blog: <?php echo htmlspecialchars($blog['bname']);?></th>
+ <th>Total</th>
+ <th>Action</th>
+ </tr>
+ </thead>
+ <tbody>
+ <?php while (list(,$item) = each ($blog['items'])): ?>
+ <tr onmouseover='focusRow(this);' onmouseout='blurRow(this);'>
+ <td>
+ <?php echo $item['ititle'];?>
+ </td>
+ <td>
+ <?php echo htmlspecialchars($item['total']);?>
+ </td>
+ <td>
+ <a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=list&id=<?php echo $item['inumber'];?>'>Trackbacks</a>
+ </td>
+ </tr>
+ <?php endwhile; ?>
+ </tbody>
+<?php endif; ?>
+<?php endwhile; ?>
+</table>
+<?php endif; ?>
+
+
--- /dev/null
+<h2>
+ All trackbacks for "<?php echo $story['title'];?>"
+ <?php if ($count > $amount): ?>
+ (Page <?php echo ceil($start / $amount) + 1;?> of <?php echo ceil($count / $amount);?>)
+ <?php endif; ?>
+</h2>
+
+<?php if(count($items)): ?>
+<?php if ($count > $amount): ?>
+<table class="navigation">
+ <tr>
+ <td style='padding: 0;'>
+ <?php if ($start > 0): ?>
+ <form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
+ <div>
+ <input type="submit" value="<< Previous" />
+ <input type="hidden" name="action" value="list" />
+ <input type="hidden" name="id" value="<?php echo $story['id'];?>" />
+ <input type="hidden" name="start" value="<?php echo max(0,$start - $amount);?>" />
+ </div>
+ </form>
+ <?php endif; ?>
+ </td>
+ <td style='padding: 0; text-align: right;'>
+ <?php if ($start + $amount < $count): ?>
+ <form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
+ <div>
+ <input type="submit" value="Next > >" />
+ <input type="hidden" name="action" value="list" />
+ <input type="hidden" name="id" value="<?php echo $story['id'];?>" />
+ <input type="hidden" name="start" value="<?php echo ($start + $amount);?>" />
+ </div>
+ </form>
+ <?php endif; ?>
+ </td>
+ </tr>
+</table>
+<?php endif; ?>
+
+<table>
+ <thead>
+ <tr>
+ <th>Title, Blog and Excerpt</th>
+ <th>Date</th>
+ <th colspan='3'>Actions</th>
+ </tr>
+ </thead>
+ <tbody>
+ <?php while (list(,$item) = each ($items)): ?>
+ <tr onmouseover='focusRow(this);' onmouseout='blurRow(this);'>
+ <td>
+ <strong><?php echo $item['title'];?></strong>
+ <em>(<?php echo $item['blog_name'];?>)</em><br />
+ <?php echo $item['excerpt'];?>
+ </td>
+ <td>
+ <?php echo str_replace(' ', ' ', date("Y-m-d @ H:i",$item['timestamp']));?>
+ </td>
+ <td>
+ <a href='<?php echo $item['url'];?>'>Visit</a>
+ </td>
+ <td>
+ <a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=block&tb=<?php echo $item['id'];?>&next=list&id=<?php echo $story['id'];?>&start=<?php echo $start;?>'>Block</a>
+ </td>
+ <td>
+ <a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=delete&tb=<?php echo $item['id'];?>&next=list&id=<?php echo $story['id'];?>&start=<?php echo $start;?>'>Delete</a>
+ </td>
+ </tr>
+ <?php endwhile; ?>
+ </tbody>
+</table>
+
+<?php if ($count > $amount): ?>
+<table class="navigation">
+ <tr>
+ <td style='padding: 0;'>
+ <?php if ($start > 0): ?>
+ <form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
+ <div>
+ <input type="submit" value="<< Previous" />
+ <input type="hidden" name="action" value="list" />
+ <input type="hidden" name="id" value="<?php echo $story['id'];?>" />
+ <input type="hidden" name="start" value="<?php echo max(0,$start - $amount);?>" />
+ </div>
+ </form>
+ <?php endif; ?>
+ </td>
+ <td style='padding: 0; text-align: right;'>
+ <?php if ($start + $amount < $count): ?>
+ <form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
+ <div>
+ <input type="submit" value="Next > >" />
+ <input type="hidden" name="action" value="list" />
+ <input type="hidden" name="id" value="<?php echo $story['id'];?>" />
+ <input type="hidden" name="start" value="<?php echo ($start + $amount);?>" />
+ </div>
+ </form>
+ <?php endif; ?>
+ </td>
+ </tr>
+</table>
+<?php endif; ?>
+<?php endif; ?>
+
--- /dev/null
+
+<h2>Trackback</h2>
+
+<ul>
+ <li><a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=index'>Overview of all items</a></li>
+ <li><a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=all'>All trackbacks</a></li>
+ <li><a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=blocked'>Blocked trackbacks</a></li>
+ <li><a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=ping'>Manually ping another weblog</a></li>
+ <li><a href='<?php echo $CONF['PluginURL'];?>trackback/index.php?action=help'>Help</a></li>
+ <li><a href='<?php echo $CONF['AdminURL'];?>index.php?action=pluginoptions&plugid=<?php echo $plugid;?>'>Plugin Options</a></li>
+</ul>
+
+<p> </p>
+
--- /dev/null
+
+<h2>Manually ping another weblog</h2>
+
+<form method="post" action="<?php echo $CONF['PluginURL'];?>trackback/index.php">
+
+ <input type="hidden" name="action" value="sendping" />
+ <input type="hidden" name="next" value="ping" />
+
+ <table>
+ <tr>
+ <th colspan='2'>Manually Ping</th>
+ </tr>
+ <tr>
+ <td>Your URL</td>
+ <td>
+ <input type="text" name="url" size="60" value="<?php echo htmlspecialchars($item['url']);?>" />
+ </td>
+ </tr>
+ <tr>
+ <td>Your Title</td>
+ <td>
+ <input type="text" value="" name="title" size="60" value="<?php echo htmlspecialchars($item['title']);?>" />
+ </td>
+ </tr>
+ <tr>
+ <td>Your Excerpt</td>
+ <td>
+ <textarea name="excerpt" cols="40" rows="5"><?php echo $item['excerpt'];?></textarea>
+ </td>
+ </tr>
+ <tr>
+ <td>Your Blog Name</td>
+ <td>
+ <input type="text" name="blog_name" size="60" value="<?php echo htmlspecialchars($item['blogname']);?>" />
+ </td>
+ </tr>
+ <tr>
+ <td>External Ping URL</td>
+ <td>
+ <input type="text" value="" name="ping_url" size="60" />
+ </td>
+ </tr>
+ <tr>
+ <td>Send Ping</td>
+ <td><input type="submit" value="Send Ping" /></td>
+ </tr>
+ </table>
+
+</form>
\ No newline at end of file