* @version: 0.3 * @date: 2017-03-01 * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ class PingByHand extends JlogPlugin { function hook_adminContent($output) { //-- globals global $connect; $self = htmlspecialchars($_SERVER['REQUEST_URI']); $format = 'YYYY-MM-DD hh:mm:ss'; //-- insert pingback manually if (array_key_exists('mp_do', $_POST) && 'save' == $_POST['mp_do']) { $title = mpEscapePost('topic'); $uri = mpEscapePost('mp_uri'); $date = mpEscapePost('mp_datetime'); $articleID = mpEscapePost('mp_articleID'); $hTitle = mpEscapeHTMLPost('topic'); $hUri = mpEscapeHTMLPost('mp_uri'); $hDate = mpEscapeHTMLPost('mp_datetime'); $hID = mpEscapeHTMLPost('mp_articleID'); $stmt = $connect->prepare('INSERT INTO ' . JLOG_DB_COMMENTS . ' (name,homepage,date,reference,type) ' . 'VALUES (?,?,?,?, \'pingback\')'); $stmt->bind_param('sssi', $title, $uri, $date, $articleID); $stmt->execute(); return "

Added Pingback for $hTitle ($hDate) to article #$hID: " . $stmt->error . '

'; } //-- show input form else { $dtLen = strlen($format); return <<


EOT; } } } // functions taken from JlogCast plugin function mpEscapePost($key) { return $_POST[$key]; } function mpEscapeHTMLPost($key) { return htmlspecialchars($_POST[$key]); }