File: //opt/plugins/atalantini/data/adagurdam_crea_richiesta.php
<?php
/**
* Atom Publishing Protocol support for WordPress
*
* @version 1.0.5-dc
*/
/**
* WordPress is handling an Atom Publishing Protocol request.
*
* @var bool
*/
define('APP_REQUEST', true);
/** Set up WordPress environment */
require_once('../../../../wp-load.php');
/** Atom Publishing Protocol Class */
require_once(ABSPATH . WPINC . '/atomlib.php');
/** Admin Image API for metadata updating */
require_once(ABSPATH . '/wp-admin/includes/image.php');
$_SERVER['PATH_INFO'] = preg_replace( '/.*\/wp-app\.php/', '', $_SERVER['REQUEST_URI'] );
/**
* Whether to enable Atom Publishing Protocol Logging.
*
* @name app_logging
* @var int|bool
*/
$app_logging = 0;
/**
* Whether to always authenticate user. Permanently set to true.
*
* @name always_authenticate
* @var int|bool
* @todo Should be an option somewhere
*/
$always_authenticate = 1;
/**
* Writes logging info to a file.
*
* @since 2.2.0
* @uses $app_logging
* @package WordPress
* @subpackage Logging
*
* @param string $label Type of logging
* @param string $msg Information describing logging reason.
*/
function log_app($label,$msg) {
global $app_logging;
if ($app_logging) {
$fp = fopen( 'wp-app.log', 'a+');
$date = gmdate( 'Y-m-d H:i:s' );
fwrite($fp, "\n\n$date - $label\n$msg\n");
fclose($fp);
}
}
global $wpdb;
$html = "";
$sql = "select id, sq1, sq2, immagine1, immagine2,resultsq1, resultsq2,players from wp_plugin_atalantini_team where id = " . $_GET['id'] . ";";
$teams = $wpdb->get_results($sql);
foreach ( $teams as $team ) {
$game = $team->id;
$team1 = $team->sq1;
$img1 = $team->immagine1;
$rs1 = $team->resultsq1;
$team2 = $team->sq2;
$img2 = $team->immagine2;
$ids = $team->players;
$rs2 = $team->resultsq2;
}
if ($img2 == "palermo.jpg") {
$img2 = "palermo.png";
}
$html .= "<img src=\"/wp-content/themes/atalantini/images/adagurdam.jpg\" width=\"100%\">";
$html .= " <br>";
$html .= " <div class=\"td-pb-row\">";
$html .= " <div class=\"td-pb-span6 td-main-content\">";
$html .= " <center>";
$html .= " <center><h1>" . $team1 . "</h1>";
$html .= " <div style=\"margin-left:30%; text-align:center !important\"><center><img width=\"201\" src=\"/wp-content/themes/atalantini/squadre/" . $img1 ."\"></center></div>";
$html .= " <div class=\"iis-caption-game\">";
$html .= " <center>";
$html .= " <h2>" . $rs1 . "</h2>";
$html .= " </center>";
$html .= " </div>";
$html .= " </center>";
$html .= " </div>";
$html .= " <div class=\"td-pb-span6 td-main-content\">";
$html .= " <center>";
$html .= " <center><h1>" . $team2 . "</h1>";
$html .= " <div style=\"margin-left:30%; text-align:center !important\"><center><img width=\"201\" src=\"/wp-content/themes/atalantini/squadre/" . $img2 . "\"></center></div>";
$html .= " <div class=\"iis-caption-game\">";
$html .= " <center>";
$html .= " <h2>" . $rs2 . "</h2>";
$html .= " </center>";
$html .= " </div>";
$html .= " </center>";
$html .= " </div>";
$html .= " </div>";
$html .= "<p> </p>";
$html .= "<p> </p>";
$html .= "<p>Ormai dovreste saperlo per votare le Adagurdam si va lassù.. lassù fisicamente non nel senso della classifica! Per dare un voto e un commento agli 11 eroi che hanno giocato oggi, cliccare in alto nel menu' principale su PAGELLE e ancora su PAGELLE:</p>";
$html .= "<p><img class=\" wp-image-20366 alignleft\" src=\"http://www.atalantini.online/wp-content/uploads/2017/04/Screen-Shot-2017-04-07-at-10.06.42-PM.png\" alt=\"Screen Shot 2017-04-07 at 10.06.42 PM\" width=\"243\" height=\"225\" /></p>";
$html .= "<p> </p>";
$html .= "<p> </p>";
$html .= "<p> </p>";
$html .= "<p> </p>";
$html .= "<p> </p>";
$html .= "<p> </p>";
$html .= "<p> </p>";
$html .= "<p>Se volete invece vedere l' andamento delle votazioni, cliccate su CLASSIFICA:</p>";
$html .= "<p><img class=\" wp-image-20364 alignleft\" src=\"http://www.atalantini.online/wp-content/uploads/2017/04/Screen-Shot-2017-04-07-at-10.07.11-PM.png\" alt=\"Screen Shot 2017-04-07 at 10.07.11 PM\" width=\"239\" height=\"42\" /></p>";
$html .= "<p> </p>";
$html .= "<p> </p>";
$html .= "<p>I \"Migliori in campo\" mostra la classifica dei migliori giocatori nerazzurri nelle partite di quest'anno:</p>";
$html .= "<p><img class=\" wp-image-20363 alignleft\" src=\"http://www.atalantini.online/wp-content/uploads/2017/04/Screen-Shot-2017-04-07-at-10.07.18-PM.png\" alt=\"Screen Shot 2017-04-07 at 10.07.18 PM\" width=\"244\" height=\"43\" /></p>";
$html .= "<p> </p>";
$html .= "<p> </p>";
$html .= "<p>Vuoi invece vedere come hanno commentato gli utenti della community? Clicca sulla voce \"Tutti i commenti\"</p>";
$html .= "<p><img class=\" wp-image-20362 alignleft\" src=\"http://www.atalantini.online/wp-content/uploads/2017/04/Screen-Shot-2017-04-07-at-10.07.28-PM.png\" alt=\"Screen Shot 2017-04-07 at 10.07.28 PM\" width=\"249\" height=\"35\" /></p>";
$html .= "<p> </p>";
$html .= "<p> </p>";
$html .= "<p>Infine, guarda i voti degli utenti della community cliccando su:</p>";
$html .= "<p><img class=\" wp-image-20361 alignleft\" src=\"http://www.atalantini.online/wp-content/uploads/2017/04/Screen-Shot-2017-04-07-at-10.07.34-PM.png\" alt=\"Screen Shot 2017-04-07 at 10.07.34 PM\" width=\"249\" height=\"41\" /></p>";
$title = $team1 . " - " . $team2 . ". Pagelle Adagurdam";
$my_post = array(
'post_title' => $title,
'post_content' => $html,
'post_status' => 'draft',
'post_author' => 44413,
'post_category' => array( 1 )
);
// Insert the post into the database.
wp_insert_post( $my_post );
?>
{"response":"ok"}