mirror of
https://github.com/e107inc/e107.git
synced 2025-04-21 13:11:52 +02:00
trackback plugin removed.
This commit is contained in:
parent
21e3c3f8ab
commit
94f772577a
14
comment.php
14
comment.php
@ -408,7 +408,7 @@ elseif ($action == 'comment')
|
||||
switch ($table)
|
||||
{
|
||||
case 'news' :
|
||||
if(isset($pref['trackbackEnabled']) && $pref['trackbackEnabled'])
|
||||
/*if(!empty($pref['trackbackEnabled']))
|
||||
{
|
||||
$query = "SELECT COUNT(tb.trackback_pid) AS tb_count, n.*, u.user_id, u.user_name, u.user_customtitle, nc.category_name, nc.category_icon FROM #news AS n
|
||||
LEFT JOIN #user AS u ON n.news_author = u.user_id
|
||||
@ -420,14 +420,14 @@ elseif ($action == 'comment')
|
||||
GROUP by n.news_id";
|
||||
}
|
||||
else
|
||||
{
|
||||
{*/
|
||||
$query = "SELECT n.*, u.user_id, u.user_name, u.user_customtitle, nc.category_name, nc.category_icon FROM #news AS n
|
||||
LEFT JOIN #user AS u ON n.news_author = u.user_id
|
||||
LEFT JOIN #news_category AS nc ON n.news_category = nc.category_id
|
||||
WHERE n.news_class REGEXP '".e_CLASS_REGEXP."'
|
||||
AND n.news_id={$id}
|
||||
AND n.news_allow_comments=0";
|
||||
}
|
||||
// }
|
||||
|
||||
if (!$sql->gen($query))
|
||||
{
|
||||
@ -542,16 +542,16 @@ else
|
||||
e107::redirect();
|
||||
exit;
|
||||
}
|
||||
|
||||
/*
|
||||
if(isset($pref['trackbackEnabled']) && $pref['trackbackEnabled'] && $table == 'news')
|
||||
{
|
||||
echo "<span class='smalltext'><b>".$pref['trackbackString']."</b> ".SITEURLBASE.e_PLUGIN_ABS."trackback/trackback.php?pid={$id}</span>";
|
||||
}
|
||||
}*/
|
||||
|
||||
$field = ($field ? $field : ($id ? $id : "")); // ID of associated source item
|
||||
$width = (isset($width) && $width ? $width : "");
|
||||
$cobj->compose_comment($table, $action, $field, $width, $subject, $rate=FALSE);
|
||||
|
||||
/*
|
||||
if(isset($pref['trackbackEnabled']) && $pref['trackbackEnabled'] && $table == 'news')
|
||||
{
|
||||
if($sql->select("trackback", "*", "trackback_pid={$id}"))
|
||||
@ -597,7 +597,7 @@ if(isset($pref['trackbackEnabled']) && $pref['trackbackEnabled'] && $table == 'n
|
||||
{
|
||||
echo "<div style='text-align:right'><a href='".e_PLUGIN_ABS."trackback/modtrackback.php?".$id."'>".COMLAN_317."</a></div><br />";
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
//if (!strstr(e_QUERY, "poll"))
|
||||
|
@ -168,12 +168,13 @@ class news_shortcodes extends e_shortcode
|
||||
|
||||
function sc_trackback($parm=null)
|
||||
{
|
||||
global $pref;
|
||||
return null;
|
||||
/* global $pref;
|
||||
if(!vartrue($pref['trackbackEnabled'])) { return ''; }
|
||||
$news_item = $this->news_item;
|
||||
$news_item['#'] = 'track';
|
||||
|
||||
return ($this->param['trackbackbeforestring'] ? $this->param['trackbackbeforestring'] : '')."<a href='".e107::getUrl()->create('news/view/item', $this->news_item)."'>".$this->param['trackbackstring'].$this->news_item['tb_count'].'</a>'.($this->param['trackbackafterstring'] ? $this->param['trackbackafterstring'] : '');
|
||||
return ($this->param['trackbackbeforestring'] ? $this->param['trackbackbeforestring'] : '')."<a href='".e107::getUrl()->create('news/view/item', $this->news_item)."'>".$this->param['trackbackstring'].$this->news_item['tb_count'].'</a>'.($this->param['trackbackafterstring'] ? $this->param['trackbackafterstring'] : '');*/
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,11 +0,0 @@
|
||||
<?php
|
||||
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
|
||||
$TRACKBACK = "
|
||||
<div class='fcaption'>{TITLE}</div>
|
||||
{EXCERPT}<br />From: {BLOGNAME}<br /><br />
|
||||
";
|
||||
|
||||
$TRACKBACK_RENDER_METHOD = TRUE; /* TRUE=tablerender, FALSE=echo */
|
||||
|
@ -4943,14 +4943,12 @@ class e107
|
||||
{
|
||||
|
||||
$inArray = array("'", '/**/', '/UNION/', '/SELECT/', 'AS ');
|
||||
if (strpos($_SERVER['PHP_SELF'], 'trackback') === false)
|
||||
|
||||
foreach($inArray as $res)
|
||||
{
|
||||
foreach($inArray as $res)
|
||||
{
|
||||
if(stripos($_SERVER['QUERY_STRING'], $res) !== false)
|
||||
{
|
||||
die('Access denied.');
|
||||
}
|
||||
if(stripos($_SERVER['QUERY_STRING'], $res) !== false)
|
||||
{
|
||||
die('Access denied.');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -278,9 +278,9 @@ class news {
|
||||
$tmp['caticon'] = defset('ICONSTYLE');
|
||||
$tmp['commentoffstring'] = defset('COMMENTOFFSTRING', '');
|
||||
$tmp['commentlink'] = defset('COMMENTLINK', e107::getParser()->toGlyph('fa-comment'));
|
||||
$tmp['trackbackstring'] = defset('TRACKBACKSTRING');
|
||||
/* $tmp['trackbackstring'] = defset('TRACKBACKSTRING');
|
||||
$tmp['trackbackbeforestring'] = defset('TRACKBACKBEFORESTRING');
|
||||
$tmp['trackbackafterstring'] = defset('TRACKBACKAFTERSTRING');
|
||||
$tmp['trackbackafterstring'] = defset('TRACKBACKAFTERSTRING');*/
|
||||
$tmp['itemlink'] = defset('NEWSLIST_ITEMLINK');
|
||||
$tmp['thumbnail'] = defset('NEWSLIST_THUMB', "border:0px");
|
||||
$tmp['catlink'] = defset('NEWSLIST_CATLINK');
|
||||
|
@ -88,7 +88,7 @@ class e_plugin
|
||||
"metaweblog", "newforumposts_main", "news", "newsfeed",
|
||||
"newsletter","online", "page", "pm","poll",
|
||||
"rss_menu","search_menu","siteinfo", "social", "tagcloud", "tinymce4",
|
||||
"trackback","tree_menu","user"
|
||||
"tree_menu","user"
|
||||
);
|
||||
|
||||
|
||||
|
@ -159,8 +159,8 @@ define("LAN_NEWS_30", "If selected, news item will appear above all others");
|
||||
define("LAN_NEWS_32", "Date stamp");
|
||||
define("LAN_NEWS_33", "Set the date stamp for the current news item");
|
||||
|
||||
define("LAN_NEWS_34", "Trackback");
|
||||
define("LAN_NEWS_35", "Add trackback URLs");
|
||||
// define("LAN_NEWS_34", "Trackback");
|
||||
// define("LAN_NEWS_35", "Add trackback URLs");
|
||||
// define("LAN_NEWS_36", "<b>Pingback</b> (send a pingback to all URLs in this post)");
|
||||
define("LAN_NEWS_37", "One URL per line)");
|
||||
// define("LAN_NEWS_38", "Insert images");
|
||||
|
@ -39,9 +39,9 @@ define("COMLAN_310", "Unable to accept post as that username is registered - if
|
||||
define("COMLAN_312", "Duplicate post - unable to accept.");
|
||||
define("COMLAN_313", "Location");
|
||||
define("COMLAN_314", "moderate comments");
|
||||
define("COMLAN_315", "Trackbacks");
|
||||
define("COMLAN_316", "No trackbacks for this newspost.");
|
||||
define("COMLAN_317", "Moderate trackbacks");
|
||||
// define("COMLAN_315", "Trackbacks");
|
||||
// define("COMLAN_316", "No trackbacks for this newspost.");
|
||||
// define("COMLAN_317", "Moderate trackbacks");
|
||||
define("COMLAN_318", "Edit comment");
|
||||
define("COMLAN_319", "edited");
|
||||
define("COMLAN_320", "Update comment");
|
||||
|
@ -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;
|
@ -3,7 +3,7 @@ define('LAN_THEME_1', 'e107 core theme by <a href="http://e107.org" title="e107
|
||||
define('LAN_THEME_2', 'Comments: ');
|
||||
define('LAN_THEME_3', 'Comments are turned off for this item');
|
||||
define('LAN_THEME_4', 'Read the full story');
|
||||
define('LAN_THEME_5', 'Trackbacks: ');
|
||||
// define('LAN_THEME_5', 'Trackbacks: ');
|
||||
define('LAN_THEME_8', 'in');
|
||||
define('LAN_THEME_9', 'by');
|
||||
define("LAN_THEME_11", "Latest news");
|
||||
|
@ -353,8 +353,8 @@ define('COMMENTOFFSTRING', LAN_THEME_3);
|
||||
define('PRE_EXTENDEDSTRING', '<div class="readmore">');
|
||||
define('EXTENDEDSTRING', LAN_THEME_4);
|
||||
define('POST_EXTENDEDSTRING', '</div>');
|
||||
define('TRACKBACKSTRING', LAN_THEME_5);
|
||||
define('TRACKBACKBEFORESTRING', ' :: ');
|
||||
//define('TRACKBACKSTRING', LAN_THEME_5);
|
||||
// define('TRACKBACKBEFORESTRING', ' :: ');
|
||||
define('ICONMAIL', 'mail.png');
|
||||
define('ICONPRINT', 'print.png');
|
||||
define('ICONPRINTPDF', 'pdf.png');
|
||||
|
@ -21,9 +21,8 @@ define("LAN_THEME_1", "'kubrick' by <a href='http://e107.org' title='e107.org' r
|
||||
define("LAN_THEME_2", "Comments are turned off for this item");
|
||||
define("LAN_THEME_3", "comment: ");
|
||||
define("LAN_THEME_4", "Read the rest ...");
|
||||
define("LAN_THEME_5", "Trackbacks: ");
|
||||
// define("LAN_THEME_5", "Trackbacks: ");
|
||||
define('LAN_THEME_6', 'on');
|
||||
define('LAN_THEME_7', 'by');
|
||||
|
||||
|
||||
?>
|
@ -97,7 +97,7 @@ $NEWSSTYLE = "
|
||||
{EXTENDED}
|
||||
</div>
|
||||
<div style='text-align:right' class='smalltext'>
|
||||
{NEWSCOMMENTS}{TRACKBACK}
|
||||
{NEWSCOMMENTS}
|
||||
</div>
|
||||
<br />";
|
||||
define("ICONSTYLE", "float: left; border:0");
|
||||
@ -106,8 +106,8 @@ define("COMMENTOFFSTRING", LAN_THEME_2);
|
||||
define("PRE_EXTENDEDSTRING", "<br /><br />[ ");
|
||||
define("EXTENDEDSTRING", LAN_THEME_4);
|
||||
define("POST_EXTENDEDSTRING", " ]<br />");
|
||||
define("TRACKBACKSTRING", LAN_THEME_5);
|
||||
define("TRACKBACKBEFORESTRING", " | ");
|
||||
// define("TRACKBACKSTRING", LAN_THEME_5);
|
||||
// define("TRACKBACKBEFORESTRING", " | ");
|
||||
|
||||
|
||||
// [linkstyle]
|
||||
|
@ -8,7 +8,6 @@ define("EMESSLAN_TITLE_DEBUG", "System Debug");
|
||||
define("LAN_THEME_1", "Comments are turned off for this item");
|
||||
define("LAN_THEME_2", "Read/Post Comment: ");
|
||||
define("LAN_THEME_3", "Read the rest...");
|
||||
define("LAN_THEME_4", "Trackbacks: ");
|
||||
// define("LAN_THEME_4", "Trackbacks: ");
|
||||
define("LAN_THEME_5", "Posted by ");
|
||||
define("LAN_THEME_6", "on ");
|
||||
?>
|
Loading…
x
Reference in New Issue
Block a user