mirror of
https://github.com/e107inc/e107.git
synced 2025-08-28 08:39:57 +02:00
trackback plugin removed.
This commit is contained in:
@@ -1128,7 +1128,7 @@ class news_front
|
||||
$sql = e107::getDb();
|
||||
// <-- Cache
|
||||
|
||||
if(isset($this->pref['trackbackEnabled']) && $this->pref['trackbackEnabled'])
|
||||
/* if(isset($this->pref['trackbackEnabled']) && $this->pref['trackbackEnabled'])
|
||||
{
|
||||
$query = "
|
||||
SELECT COUNT(tb.trackback_pid) AS tb_count, n.*, u.user_id, u.user_name, u.user_customtitle, u.user_image, nc.category_id, nc.category_name, nc.category_sef,
|
||||
@@ -1143,7 +1143,7 @@ class news_front
|
||||
GROUP by n.news_id";
|
||||
}
|
||||
else
|
||||
{
|
||||
{*/
|
||||
$query = "
|
||||
SELECT n.*, u.user_id, u.user_name, u.user_customtitle, u.user_image, nc.category_id, nc.category_name, nc.category_sef, nc.category_icon, nc.category_meta_keywords,
|
||||
nc.category_meta_description
|
||||
@@ -1155,7 +1155,7 @@ class news_front
|
||||
AND n.news_start < ".time()."
|
||||
AND (n.news_end=0 || n.news_end>".time().")
|
||||
AND n.news_id=".intval($this->subAction);
|
||||
}
|
||||
// }
|
||||
|
||||
|
||||
if ($sql->gen($query))
|
||||
@@ -1375,7 +1375,7 @@ class news_front
|
||||
case "item" :
|
||||
$sub_action = intval($this->subAction);
|
||||
$news_total = 1;
|
||||
if(isset($this->pref['trackbackEnabled']) && $this->pref['trackbackEnabled'])
|
||||
/* if(isset($this->pref['trackbackEnabled']) && $this->pref['trackbackEnabled'])
|
||||
{
|
||||
$query = "
|
||||
SELECT COUNT(tb.trackback_pid) AS tb_count, n.*, u.user_id, u.user_name, u.user_customtitle, u.user_image, nc.category_id, nc.category_name, nc.category_sef,
|
||||
@@ -1389,7 +1389,7 @@ class news_front
|
||||
GROUP by n.news_id";
|
||||
}
|
||||
else
|
||||
{
|
||||
{*/
|
||||
$query = "
|
||||
SELECT n.*, u.user_id, u.user_name, u.user_customtitle, u.user_image, nc.category_id, nc.category_name, nc.category_sef, nc.category_icon,
|
||||
nc.category_meta_keywords, nc.category_meta_description, nc.category_template
|
||||
@@ -1398,7 +1398,7 @@ class news_front
|
||||
LEFT JOIN #news_category AS nc ON n.news_category = nc.category_id
|
||||
WHERE n.news_id=".$this->subAction." AND n.news_class REGEXP '".e_CLASS_REGEXP."' AND NOT (n.news_class REGEXP ".$this->nobody_regexp.")
|
||||
AND n.news_start < ".time()." AND (n.news_end=0 || n.news_end>".time().")";
|
||||
}
|
||||
// }
|
||||
|
||||
$noNewsMessage = LAN_NEWS_83;
|
||||
break;
|
||||
@@ -1463,7 +1463,7 @@ class news_front
|
||||
$interval = $this->pref['newsposts']-$this->pref['newsposts_archive']; // Number of 'full' posts to show
|
||||
|
||||
// Get number of news item to show
|
||||
if(isset($this->pref['trackbackEnabled']) && $this->pref['trackbackEnabled']) {
|
||||
/* if(isset($this->pref['trackbackEnabled']) && $this->pref['trackbackEnabled']) {
|
||||
$query = "
|
||||
SELECT SQL_CALC_FOUND_ROWS COUNT(tb.trackback_pid) AS tb_count, n.*, u.user_id, u.user_name, u.user_customtitle, u.user_image, nc.category_id,
|
||||
nc.category_name, nc.category_sef, nc.category_icon, nc.category_meta_keywords, nc.category_meta_description, nc.category_template,
|
||||
@@ -1479,11 +1479,11 @@ class news_front
|
||||
ORDER BY news_sticky DESC, ".$this->order." DESC LIMIT ".intval($this->from).",".ITEMVIEW;
|
||||
}
|
||||
else
|
||||
{
|
||||
{*/
|
||||
$query = $this->getQuery();
|
||||
|
||||
|
||||
}
|
||||
// }
|
||||
|
||||
$noNewsMessage = LAN_NEWS_83;
|
||||
} // END - switch($action)
|
||||
|
@@ -1,65 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) 2008-2013 e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
* Plugin administration - Trackback
|
||||
*
|
||||
* $URL$
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
require_once("../../class2.php");
|
||||
if (!getperms("P") || !e107::isInstalled('trackback'))
|
||||
{
|
||||
e107::redirect('admin');
|
||||
exit() ;
|
||||
}
|
||||
|
||||
e107::includeLan(e_PLUGIN."trackback/languages/".e_LANGUAGE."_admin_trackback.php");
|
||||
|
||||
require_once(e_ADMIN."auth.php");
|
||||
$frm = e107::getForm();
|
||||
$mes = e107::getMessage();
|
||||
|
||||
if (isset($_POST['updatesettings']))
|
||||
{
|
||||
$temp = array();
|
||||
if ($pref['trackbackEnabled'] != $_POST['trackbackEnabled'])
|
||||
{
|
||||
$temp['trackbackEnabled'] = $_POST['trackbackEnabled'];
|
||||
$e107cache->clear('news.php');
|
||||
}
|
||||
$temp['trackbackString'] = $tp->toDB($_POST['trackbackString']);
|
||||
|
||||
e107::getConfig('core')->setPref($temp)->save(false);
|
||||
|
||||
}
|
||||
|
||||
$ns->tablerender($caption, $mes->render() . $text);
|
||||
|
||||
$text = "
|
||||
<form method='post' action='".e_SELF."'>
|
||||
<table class='table adminform'>
|
||||
<tr>
|
||||
<td>".TRACKBACK_L7."</td>
|
||||
<td>".$frm->radio_switch('trackbackEnabled', $pref['trackbackEnabled'])."</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>".TRACKBACK_L8."</td>
|
||||
<td><input size='50' class='tbox' type='text' name='trackbackString' value='".$pref['trackbackString']."' /> </td>
|
||||
</table>
|
||||
<div class='buttons-bar center'>
|
||||
".$frm->admin_button('updatesettings', LAN_UPDATE, 'update')."
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
";
|
||||
|
||||
$ns->tablerender(TRACKBACK_L10, $text);
|
||||
|
||||
require_once(e_ADMIN."footer.php");
|
@@ -1,126 +0,0 @@
|
||||
<?php
|
||||
|
||||
|
||||
//v2.x Standard for extending admin areas.
|
||||
|
||||
|
||||
class trackback_admin
|
||||
{
|
||||
private $active = false;
|
||||
|
||||
|
||||
function __construct()
|
||||
{
|
||||
$pref = e107::pref('core','trackbackEnabled');
|
||||
$this->active = vartrue($pref);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Extend Admin-ui Parameters
|
||||
* @param $ui admin-ui object
|
||||
* @return array
|
||||
*/
|
||||
public function config($ui)
|
||||
{
|
||||
$action = $ui->getAction(); // current mode: create, edit, list
|
||||
$type = $ui->getEventName(); // 'wmessage', 'news' etc.
|
||||
|
||||
$config = array();
|
||||
|
||||
switch($type)
|
||||
{
|
||||
case "news":
|
||||
|
||||
if($this->active == true)
|
||||
{
|
||||
$config['fields']['urls'] = array ( 'title' =>LAN_NEWS_35, 'type' => 'textarea', 'tab'=>1, 'writeParms'=> array('size'=>'xxlarge', 'placeholder'=>''), 'width' => 'auto', 'help' => '', 'readParms' => '', 'class' => 'left', 'thclass' => 'left', );
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
//Note: 'urls' will be returned as $_POST['x_trackback_urls']. ie. x_{PLUGIN_FOLDER}_{YOURKEY}
|
||||
|
||||
return $config;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Process Posted Data.
|
||||
* @param $ui admin-ui object
|
||||
*/
|
||||
public function process($ui)
|
||||
{
|
||||
$data = $ui->getPosted();
|
||||
e107::getMessage()->addDebug(print_a($data,true));
|
||||
|
||||
if($data['news_id'] && $this->active)
|
||||
{
|
||||
$excerpt = e107::getParser()->text_truncate(strip_tags(e107::getParser()->post_toHTML($data['news_body'])), 100, '...');
|
||||
|
||||
// $id=mysql_insert_id();
|
||||
$permLink = e107::getInstance()->base_path."comment.php?comment.news.".intval($data['news_id']);
|
||||
|
||||
require_once(e_PLUGIN."trackback/trackbackClass.php");
|
||||
$trackback = new trackbackClass();
|
||||
|
||||
if($data['x_trackback_urls'])
|
||||
{
|
||||
$urlArray = explode("\n", $data['x_trackback_urls']);
|
||||
foreach($urlArray as $pingurl)
|
||||
{
|
||||
if(!$terror = $trackback->sendTrackback($permLink, $pingurl, $data['news_title'], $excerpt))
|
||||
{
|
||||
|
||||
e107::getMessage()->add("Successfully pinged {$pingurl}.", E_MESSAGE_SUCCESS);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
e107::getMessage()->add("was unable to ping {$pingurl}<br />[ Error message returned was : '{$terror}'. ]", E_MESSAGE_ERROR);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
if(isset($_POST['pingback_urls']))
|
||||
{
|
||||
if ($urlArray = $trackback->getPingUrls($data['news_body'])) //FIXME - missing method!!!
|
||||
{
|
||||
foreach($urlArray as $pingurl)
|
||||
{
|
||||
|
||||
if ($trackback->sendTrackback($permLink, $pingurl, $data['news_title'], $excerpt))
|
||||
{
|
||||
|
||||
e107::getMessage()->add("Successfully pinged {$pingurl}.", E_MESSAGE_SUCCESS);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
e107::getMessage()->add("Pingback to {$pingurl} failed ...", E_MESSAGE_ERROR);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
e107::getMessage()->add("No pingback addresses were discovered", E_MESSAGE_INFO, $smessages);
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* end trackback */
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@@ -1,19 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) 2008-2015 e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
* Plugin Trackback
|
||||
*
|
||||
*
|
||||
*/
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
|
||||
if(e107::isInstalled('trackback') && !empty($pref['trackbackEnabled']) && USER_AREA)
|
||||
{
|
||||
echo "<link rel='pingback' href='".SITEURLBASE.e_PLUGIN_ABS."trackback/trackback.php' />";
|
||||
}
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 707 B |
Binary file not shown.
Before Width: | Height: | Size: 1.6 KiB |
@@ -1,39 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) 2008-2009 e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
* Plugin administration - newsfeeds
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
|
||||
//define("TRACKBACK_L1", "Configure Trackback");
|
||||
//define("TRACKBACK_L2", "This plugin enables you to use trackback in your news posts.");
|
||||
//define("TRACKBACK_L3", "Trackback is now installed and enabled.");
|
||||
//define("TRACKBACK_L4", "Trackback settings saved.");
|
||||
//define("TRACKBACK_L5", "On");
|
||||
//define("TRACKBACK_L6", "Off");
|
||||
define("TRACKBACK_L7", "Activate trackback");
|
||||
define("TRACKBACK_L8", "Trackback URL text");
|
||||
//define("TRACKBACK_L9", "Save Settings");
|
||||
define("TRACKBACK_L10", "Trackback Settings");
|
||||
define("TRACKBACK_L11", "Trackback address for this post:");
|
||||
|
||||
define("TRACKBACK_L12", "No trackbacks for this item");
|
||||
define("TRACKBACK_L13", "Moderate trackbacks");
|
||||
//define("TRACKBACK_L14", "Delete");
|
||||
//define("TRACKBACK_L15", "Trackbacks deleted.");
|
||||
define("TRACKBACK_L16", "Trackback");
|
||||
//define("TRACKBACK_L17", "Nothing changed - not saved");
|
||||
|
||||
|
||||
// Admin log messages
|
||||
//-------------------
|
||||
//define("LAN_AL_TRACK_01", "Trackback settings changed");
|
||||
//define("LAN_AL_TRACK_02", "Trackback items deleted");
|
||||
|
@@ -1,5 +0,0 @@
|
||||
<?php
|
||||
|
||||
define("LAN_PLUGIN_TRACKBACK_NAME", "Trackback");
|
||||
define("LAN_PLUGIN_TRACKBACK_DESCRIPTION", "This plugin enables you to use trackback in your news posts.");
|
||||
|
@@ -1,89 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) 2008-2009 e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
* Plugin administration - newsfeeds
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_plugins/trackback/modtrackback.php,v $
|
||||
* $Revision$
|
||||
* $Date$
|
||||
* $Author$
|
||||
*
|
||||
*/
|
||||
$eplug_admin = true;
|
||||
require_once("../../class2.php");
|
||||
$pref = e107::pref();
|
||||
if (!getperms("P") || !e107::isInstalled('trackback') || !$pref['trackbackEnabled'])
|
||||
{
|
||||
e107::redirect();
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once(e_ADMIN."auth.php");
|
||||
if (isset($_POST['moderate']))
|
||||
{
|
||||
$temp = array();
|
||||
$sql = e107::getDb();
|
||||
|
||||
if (is_array($_POST['trackback_delete']))
|
||||
{
|
||||
foreach($_POST['trackback_delete'] as $key=>$cid)
|
||||
{
|
||||
$cid = intval($cid);
|
||||
if ($cid > 0)
|
||||
{
|
||||
$sql->delete("trackback", "trackback_id=".$cid);
|
||||
$temp[] = $cid;
|
||||
}
|
||||
}
|
||||
if (count($temp))
|
||||
{
|
||||
e107::getLog()->add('TRACK_02',implode(', ',$temp));
|
||||
}
|
||||
}
|
||||
e107::getRender()->tablerender(null, "<div style='text-align:center'><b>".LAN_DELETED."</b></div>");
|
||||
e107::getCache()->clear("news.php");
|
||||
}
|
||||
|
||||
$sql = e107::getDb();
|
||||
$text = "<div style='text-align:center'>
|
||||
<form method='post' action='".e_SELF."?".e_QUERY."'>
|
||||
<table style='".ADMIN_WIDTH."' class='fborder'>";
|
||||
|
||||
if (e_QUERY=='all')
|
||||
{
|
||||
$res=$sql->select("trackback");
|
||||
}
|
||||
else
|
||||
{
|
||||
$res=$sql->select("trackback", "*", "trackback_pid=".intval(e_QUERY));
|
||||
}
|
||||
|
||||
if (!$res)
|
||||
{
|
||||
$text .= "<tr><td class='forumheader3' style='text-align:center'>".TRACKBACK_L12.".</td></tr></table></form></div>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$tbArray = $sql -> db_getList();
|
||||
foreach($tbArray as $row)
|
||||
{
|
||||
|
||||
$text .= "<tr>
|
||||
<td class='forumheader3' style='width: 30%;'><a href='".$row['trackback_url']."' rel='external'>".$row['trackback_title']."</a></td>
|
||||
<td class='forumheader3' style='width: 40%;'>".$row['trackback_excerpt']."</td>
|
||||
<td class='forumheader3' style='width: 20%;'>".$row['trackback_blogname']."</td>
|
||||
<td class='forumheader3' style='width: 10%;'><input type='checkbox' name='trackback_delete[]' value='".$row['trackback_id']."' /> ".LAN_DELETE."</td>
|
||||
</tr>\n";
|
||||
}
|
||||
$text .= "<tr><td colspan='5' class='forumheader' style='text-align:center'><input class='btn btn-default btn-secondary button' type='submit' name='moderate' value='".TRACKBACK_L13."' /></td></tr></table></form></div>";
|
||||
}
|
||||
|
||||
e107::getRender()->tablerender(TRACKBACK_L13, $text);
|
||||
|
||||
require_once(e_ADMIN."footer.php");
|
||||
|
@@ -1,13 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<e107Plugin name="Trackback" lan="LAN_PLUGIN_TRACKBACK_NAME" version="1.1" date="2012-08-01" compatibility="1.0" installRequired="true">
|
||||
<author name="e107 Inc." url="http://e107.org" email="devs@e107.org" />
|
||||
<description lan="LAN_PLUGIN_TRACKBACK_DESCRIPTION">This plugin enables you to use trackback in your news posts.</description>
|
||||
<copyright>Copyright e107 Inc e107.org, Licensed under GPL (http://www.gnu.org/licenses/gpl.txt)</copyright>
|
||||
<adminLinks>
|
||||
<link url='admin_config.php' description='TRACKBACK_L1' icon='images/trackback_32.png' iconSmall='images/trackback_16.png' primary='true' >TRACKBACK_L1</link>
|
||||
</adminLinks>
|
||||
<mainPrefs>
|
||||
<pref name="trackbackEnabled">0</pref>
|
||||
<pref name="trackbackString">Trackback address for this post:</pref>
|
||||
</mainPrefs>
|
||||
</e107Plugin>
|
@@ -1,25 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) 2008-2009 e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
* Plugin administration - newsfeeds
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_plugins/trackback/trackback.php,v $
|
||||
* $Revision$
|
||||
* $Date$
|
||||
* $Author$
|
||||
*
|
||||
*/
|
||||
require_once("../../class2.php");
|
||||
if (!e107::isInstalled('trackback'))
|
||||
{
|
||||
exit();
|
||||
}
|
||||
header('Content-Type: text/xml');
|
||||
include(e_PLUGIN."trackback/trackbackClass.php");
|
||||
$trackback = trackbackClass::respondTrackback();
|
||||
|
@@ -1,180 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) 2008-2009 e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
* Plugin administration - newsfeeds
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_plugins/trackback/trackbackClass.php,v $
|
||||
* $Revision$
|
||||
* $Date$
|
||||
* $Author$
|
||||
*
|
||||
*/
|
||||
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
|
||||
class trackbackClass
|
||||
{
|
||||
|
||||
static function sendTrackback ($permLink, $pingUrl, $title, $excerpt)
|
||||
{
|
||||
global $e107;
|
||||
|
||||
$title = urlencode(stripslashes($title));
|
||||
$excerpt = urlencode(stripslashes($excerpt));
|
||||
$blog_name = urlencode(stripslashes(SITENAME));
|
||||
$permLink = urlencode(stripslashes($e107->base_path.$permLink));
|
||||
$query_string = "title=".$title."&url=".$permLink."&blog_name=".$blog_name."&excerpt=".$excerpt;
|
||||
|
||||
if (strpos($pingUrl, '?') !== false)
|
||||
{
|
||||
$pingUrl .= "&".$query_string;
|
||||
$fp = fopen($pingUrl, 'r');
|
||||
$response = fread($fp, 4096);
|
||||
fclose($fp);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
$trackback_url = parse_url($pingUrl);
|
||||
|
||||
if ((isset($trackback_url["query"])) && ($trackback_url["query"] != ""))
|
||||
{
|
||||
$trackback_url["query"] = "?" . $trackback_url["query"];
|
||||
}
|
||||
else
|
||||
{
|
||||
$trackback_url["query"] = "";
|
||||
}
|
||||
|
||||
if ((isset($trackback_url["port"]) && !is_numeric($trackback_url["port"])) || (!isset($trackback_url["port"])))
|
||||
{
|
||||
$trackback_url["port"] = 80;
|
||||
}
|
||||
|
||||
$header = 'POST ' . $trackback_url['path'] . $trackback_url['query'] . " HTTP/1.0\r\n";
|
||||
$header .= 'Host: '.$trackback_url['host']."\r\n";
|
||||
$header .= 'Content-Type: application/x-www-form-urlencoded; charset=utf-8'."\r\n";
|
||||
$header .= 'Content-Length: '.strlen($query_string)."\r\n";
|
||||
$header .= "\r\n";
|
||||
$header .= $query_string;
|
||||
|
||||
$socket = fsockopen($trackback_url["host"], $trackback_url["port"]);
|
||||
|
||||
if (!is_resource($socket))
|
||||
{
|
||||
return 'trackbackClass -> sendTrackback: Unable to connect to {$trackback_url[\'host\']}.';
|
||||
}
|
||||
|
||||
fwrite($socket, $header);
|
||||
|
||||
$response = "";
|
||||
while (!feof($socket)) {
|
||||
$response .= fgets($socket, 4096);
|
||||
}
|
||||
fclose($socket);
|
||||
|
||||
}
|
||||
|
||||
if(strpos($response, "<error>0</error>") !== false)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(preg_match('#\<message\>(.*?)\<\/message\>#', $response, $match))
|
||||
{
|
||||
return $match[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
return "No error returned.";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static function respondTrackback ()
|
||||
{
|
||||
global $sql, $pref, $tp, $e107cache;
|
||||
$errorMessage = "";
|
||||
if(!$pref['trackbackEnabled'])
|
||||
{
|
||||
$errorMessage = "This site does not allow trackbacks.";
|
||||
}
|
||||
|
||||
$pid = (isset($_GET['pid']) ? intval($_GET['pid']) : intval($_POST['pid']));
|
||||
$permLink = (isset($_GET['url']) ? $_GET['url'] : $_POST['url']);
|
||||
$permLink = $tp -> toDB($permLink);
|
||||
$blog_name = (isset($_GET['blog_name']) ? $_GET['blog_name'] : $_POST['blog_name']);
|
||||
$blog_name = $tp -> toDB($blog_name);
|
||||
$title = (isset($_GET['title']) ? $_GET['title'] : $_POST['title']);
|
||||
$title = $tp -> toDB($title);
|
||||
$excerpt = (isset($_GET['excerpt']) ? $_GET['excerpt'] : $_POST['excerpt']);
|
||||
$excerpt = $tp -> toDB($excerpt);
|
||||
|
||||
/* debug */
|
||||
/*
|
||||
$debug_str = "Query string: ".e_TBQS."\n";
|
||||
$debug_str .= "GET INFO: \n";
|
||||
foreach($_GET as $key => $get)
|
||||
{
|
||||
$debug_str .= "$key => $get\n";
|
||||
}
|
||||
$debug_str .= "POST INFO: \n";
|
||||
foreach($_POST as $key => $get)
|
||||
{
|
||||
$debug_str .= "$key => $get\n";
|
||||
}
|
||||
$sql -> db_Insert("debug", "0, '".time()."', '$debug_str' ");
|
||||
*/
|
||||
/* end debug */
|
||||
|
||||
|
||||
if(!$pid)
|
||||
{
|
||||
$errorMessage = "No permanent ID sent.";
|
||||
}
|
||||
|
||||
if(!isset($pid) || !is_numeric($pid))
|
||||
{
|
||||
$errorMessage = "No known item with that pid (pid sent as ".$pid.").";
|
||||
}
|
||||
|
||||
$excerpt = ($excerpt ? strip_tags($excerpt) : "I found your news item interesting, I've added a trackback to it on my website :)");
|
||||
$title = ($title ? $title : "Trackbacking your news item ...");
|
||||
$blog_name = ($blog_name ? $blog_name : "Anonymous site");
|
||||
|
||||
if(!$errorMessage)
|
||||
{
|
||||
if(!$sql->insert("trackback", "0, {$pid}, '{$title}', '{$excerpt}', '{$permLink}', '{$blog_name}' "))
|
||||
{
|
||||
$errorMessage = "Unable to enter your trackback information into the database -> 0, {$pid}, '{$title}', '{$excerpt}', '{$permLink}', '{$blog_name}'";
|
||||
}
|
||||
else
|
||||
{
|
||||
$e107cache->clear("comment.php?news.{$pid}");
|
||||
}
|
||||
}
|
||||
|
||||
if($errorMessage)
|
||||
{
|
||||
echo '<?xml version="1.0" encoding="utf-8"?'.">\n";
|
||||
echo "<response>\n";
|
||||
echo "<error>1</error>\n";
|
||||
echo "<message>".$errorMessage."</message>\n";
|
||||
echo "</response>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<?xml version="1.0" encoding="utf-8"?'.">\n";
|
||||
echo "<response>\n";
|
||||
echo "<error>0</error>\n";
|
||||
echo "</response>";
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,10 +0,0 @@
|
||||
CREATE TABLE trackback (
|
||||
`trackback_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`trackback_pid` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`trackback_title` varchar(200) NOT NULL DEFAULT '',
|
||||
`trackback_excerpt` varchar(250) NOT NULL DEFAULT '',
|
||||
`trackback_url` varchar(150) NOT NULL DEFAULT '',
|
||||
`trackback_blogname` varchar(150) NOT NULL DEFAULT '',
|
||||
PRIMARY KEY (`trackback_id`),
|
||||
KEY `trackback_pid` (`trackback_pid`)
|
||||
) ENGINE=MyISAM;
|
Reference in New Issue
Block a user