File: //opt/Newsmag/resumeusers.php
<?php
/*
Template Name: Resoconto Utenti
*/
$uri = $_SERVER['REQUEST_URI'];
//$totalPosts = str_replace("/","",str_replace("/ultime-news-","",$uri));
$totalPosts = $_GET['num'];
$current_user = wp_get_current_user();
$bannerLaterale = $wpdb->get_var( "SELECT immagine FROM wp_plugin_atalantini_banner where tipo = 'QUADRATO'" );
?>
<?php get_header(); ?>
<div class="td-main-content-wrap">
<div class="td-container">
<div class="td-container-border">
<div class="td-pb-row">
<div class="td-pb-span12 td-main-content">
<img src="/wp-content/themes/atalantini/images/adagurdam.jpg" width="100%">
<?php
$team1 = "";
$team2 = "";
$img1 = "";
$img2 = "";
$game = "";
$ids = "";
$rs1 = "";
$rs2 = "";
$ruoli = array();
$ruoli[] = "PORTIERE";
$ruoli[] = "DIFENSORE";
$ruoli[] = "CENTROCAMPISTA";
$ruoli[] = "ATTACCANTE";
$ruoli[] = "ALLENATORE";
$sql = "select id, sq1, sq2, immagine1, immagine2,resultsq1, resultsq2,players from wp_plugin_atalantini_team where attivo = 'SI' or attivo = 'CHIUSO';";
$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";
}
?>
<br>
<div class="td-pb-row">
<div class="td-pb-span6 td-main-content">
<center>
<h1><?= $team1 ?></h1>
<img width="201" src="/wp-content/themes/atalantini/squadre/<?= $img1 ?>">
<div class="iis-caption-game">
<center>
<h2><?= $rs1 ?></h2>
</center>
</div>
</center>
</div>
<div class="td-pb-span6 td-main-content">
<center>
<h1><?= $team2 ?></h1>
<img width="201" src="/wp-content/themes/atalantini/squadre/<?= $img2 ?>">
<div class="iis-caption-game">
<center>
<h2><?= $rs2 ?></h2>
</center>
</div>
</center>
</div>
</div>
<?php
$sql = "select distinct(username), wp_users.id as user_id, (select avatar from wp_plugin_atalantini_avatar where user_id = wp_users.id) as avatar from wp_plugin_votazioni, wp_users where comment != '' and game = " . $game . " and wp_users.user_login = username;";
$players = $wpdb->get_results($sql);
?>
<div class="td-pb-row">
<div class="td-pb-span4 td-main-content">
<h1>Utenti votanti: </h1>
</div>
</div><!-- /post day -->
<div class="row clearfix">
<?php
foreach ( $players as $player ) {
?>
<div class="td-pb-span4 td-main-content">
<div class="title_bucomment" style="height:51px;">
<?php
if ($player->avatar != "") {
?>
<!--
<img style="float:left" src="/wp-content/uploads/avatar/<?= $player->user_id ?>/<?= $player->avatar ?>" height="51">
-->
<?php
}
?>
<b><div style="float:left;margin-left:10px; margin-top:10px; font-size:23px;"><a href="/resoconto-utenti-partita/?user_id=<?= $player->user_id ?>"><span class="authorcomment"><?= $player->username ?></span></a></div></b> <br>
</div>
</div>
<?php
}
?>
</div><!-- /post day -->
</div><!-- /grid11 -->
</div>
</div><!-- /grid12 -->
</div><!-- /row -->
</div><!-- /end page content -->
<?php get_footer(); ?>
<script>
function seePlayer(id) {
<?= $javascript ?>
jQuery('#player_' + id).css('display','block');
location.href = "#player_" + id;
}
</script>