<?php
include("include/config.php");
if(isset($_GET['id']) && ereg("^[0-9]+$",$_GET['id']) == true) {
$meta = 1;
$news = 1;
$id = mysql_escape_string($_GET['id']);
$query = "SELECT id,titolo,testo,gallery,date,idclub FROM news WHERE id = $id";
$risultato = mysql_query($query) or die(mysql_error());
$array = mysql_fetch_array($risultato, MYSQL_BOTH);
$titolo = stripslashes($array['titolo']);
$testo = stripslashes($array['testo']);
$testo = str_replace("class=\"lightbox\"","rel=\"lytebox\"", $testo);
$testo = str_replace("class=\"lytebox\"","rel=\"lytebox\"", $testo);
}
?>
<?php include('head.php'); ?>
<body>
<!-- wrap starts here -->
<div id="wrap">
<?php include('header.php'); ?>
<div id="sidebar" >
<?php include('tabellasx.php'); ?>
</div>
<div id="mainFull">
<a name="TemplateInfo"></a>
<h1> </h1>
<?php
echo '<div class="news">';
echo '<h2>'.$titolo.'</h2>';
echo ''.$testo.'';
if($array['gallery'] != '') {
echo '<h2>Galleria Fotografica</h2>';
echo '<div id="gallery-news">
<ul id="griglia">';
$arrayfile=array();
$arrayfile=elencafiles("/web/htdocs/www.entinoprofit.org/home/gallery/foto/".$array['gallery']."/");
for($i=0;$i<count($arrayfile);$i++) {
echo '<li class="foto">
<a rel="lytebox[villaferri]" href="http://www.entinoprofit.org/gallery/foto/'.$array['gallery'].'/'.$arrayfile[$i].'">
<img src="http://www.entinoprofit.org/gallery/foto/'.$array['gallery'].'/tn/'.$arrayfile[$i].'"></a>
</li>';
}
echo '</ul>
</div>';
echo '<p> </p>';
}
echo '<div class="clear"></div>';
echo '<div class="social"><div class="fb"><a href="https://www.facebook.com/sharer.php?u='.curPageURL().'" target="_blank"><img src="images/fb-share.png"></a></div>
<div class="twitter"><a href="https://twitter.com/share" class="twitter-share-button" data-lang="it">Tweet</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script></div></div>
';
echo '<div class="fb-comments" data-href="http://www.entinoprofit.org/news.php?id='.$array['id'].'" data-num-posts="10" data-width="500px" data-colorscheme="light" style="margin-left:20px;"></div> ';
echo "<p align=\"right\">";
if ($array['idclub'] != 0) {
$idclub = $array['idclub'];
$query2 = 'SELECT id,nome,alias FROM club_list WHERE id = '.$idclub.'';
$risultato2 = mysql_query($query2) or die(mysql_error());
$array2 = mysql_fetch_array($risultato2, MYSQL_BOTH);
echo '<a href="/club/'.$array2['alias'].'">» Vai alla scheda di '.$array2['nome'].'</a> | ';
}
echo "<a href=\"/\">» Torna alla Home</a></p></div>";
?>
<?php include('infoacsi.php'); ?>
</div>
<!-- content-wrap ends here -->
</div>
<!-- footer starts here -->
<?php include('footer.php'); ?>
<!-- footer ends here -->
<!-- wrap ends here -->
</div>
</body>
</html>