Browse Source

add social in news

develop
Carmine De Rosa 7 years ago
parent
commit
d5f5ee6090
  1. 14
      fb_comments.php
  2. 10
      fb_like.php
  3. BIN
      images/social/facebook_c.png
  4. BIN
      images/social/facebook_s.png
  5. BIN
      images/social/in_c.png
  6. BIN
      images/social/in_s.png
  7. BIN
      images/social/plus_c.png
  8. BIN
      images/social/plus_s.png
  9. BIN
      images/social/twitter_c.png
  10. BIN
      images/social/twitter_s.png
  11. 49
      news.php
  12. 16
      social.php

14
fb_comments.php

@ -0,0 +1,14 @@
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/it_IT/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div class="fb-comments" data-href="http://<?php echo $_SERVER['HTTP_HOST']."".$_SERVER['REQUEST_URI'];?>" data-numposts="5" data-width="100%"></div>

10
fb_like.php

@ -0,0 +1,10 @@
<br><vr>
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/it_IT/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

BIN
images/social/facebook_c.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
images/social/facebook_s.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 529 B

BIN
images/social/in_c.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
images/social/in_s.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 683 B

BIN
images/social/plus_c.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
images/social/plus_s.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
images/social/twitter_c.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
images/social/twitter_s.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 803 B

49
news.php

@ -1,70 +1,73 @@
<?php <?php
$q = mysqli_query($conn, "SELECT COUNT(id) FROM news"); $q = mysqli_query($conn, "SELECT COUNT(id) FROM news");
$r = mysqli_fetch_array($q); $r = mysqli_fetch_array($q);
$totNews = $r[0]; $totNews = $r[0];
$itemsPage = 5; $itemsPage = 5;
$currentPage = $getQ[1]; $currentPage = $getQ[1];
$totPages = $totNews/$itemsPage; $totPages = $totNews/$itemsPage;
$pageStart = $currentPage * $itemsPage; $pageStart = $currentPage * $itemsPage;
if($getQ[2]){ if($getQ[2]){
$q = mysqli_query($conn, "SELECT * FROM news WHERE id=".$getQ[2]); $q = mysqli_query($conn, "SELECT * FROM news WHERE id=".$getQ[2]);
$r = mysqli_fetch_array($q); $r = mysqli_fetch_array($q);
?> ?>
<div class="row news"> <div class="row news">
<div class="col-12"> <div class="col-12">
<div class="section-title">Notizie dall'Ordine</div> <div class="section-title">Notizie dall'Ordine</div>
<div class="section-text"> <div class="section-text">
<p class="item py-3 h6"><span class="date"><?php echo conv_date($r['date']);?></span> - <?php echo $r['title'];?></p> <p class="item py-3 h6"><span class="date"><?php echo conv_date($r['date']);?></span> - <?php echo $r['title'];?></p>
<p class="p-2"><?php echo $r['text'];?></p> <p class="p-2"><?php echo $r['text'];?></p>
<?php <?php
if($r['append']){ if($r['append']){
echo "<div class=\"append\">"; echo "<div class=\"append\">";
echo "<div class=\"item pt-4 font-bold\">Allegati:</div>"; echo "<div class=\"item pt-4 font-bold\">Allegati:</div>";
$qa = mysqli_query($conn, "SELECT * FROM files WHERE id IN(".$r['append'].")"); $qa = mysqli_query($conn, "SELECT * FROM files WHERE id IN(".$r['append'].")");
while($ra = mysqli_fetch_array($qa)){ while($ra = mysqli_fetch_array($qa)){
/*
$size = get_filesize($ra['path']."/".$ra['filename']);
if($size > 1000){$size = ($size/1000)."Mb";}else{$size = $size."Kb";}
*/
echo "<div class=\"item\"><a href=\"$BASE_URL".$ra['path']."/".$ra['filename']."\" target=\"_blank\">".$ra['title'].""; echo "<div class=\"item\"><a href=\"$BASE_URL".$ra['path']."/".$ra['filename']."\" target=\"_blank\">".$ra['title']."";
echo "<div class=\"size\">".$ra['size']."</div>"; echo "<div class=\"size\">".$ra['size']."</div>";
echo "</a></div>"; echo "</a></div>";
} }
echo "</div>"; echo "</div>";
} }
?> ?>
</div> </div>
</div> </div>
<div class="col-6 mt-4">
<div class="col-12 p-4">
<?php
@include 'social.php';
@include 'fb_comments.php';
?>
</div>
<div class="col-6 p-3">
<a onClick="javascript:history.back()"> <a onClick="javascript:history.back()">
<button><i class="fa fa-angle-left"></i> Torna indietro</button> <button><i class="fa fa-angle-left"></i> Torna indietro</button>
</a> </a>
</div>
<div class="col-6 mt-4 text-right">
</div>
<div class="col-6 p-3 text-right">
<a href="<?php echo $BASE_URL."/news";?>"> <a href="<?php echo $BASE_URL."/news";?>">
<button>Vai a tutte le news <i class="fa fa-angle-right"></i></button> <button>Vai a tutte le news <i class="fa fa-angle-right"></i></button>
</a> </a>
</div> </div>
</div> </div>
<?php <?php
}else{ }else{
?> ?>
<div class="row news"> <div class="row news">
<div class="col-12"> <div class="col-12">
<div class="section-title">Notizie dall'Ordine</div> <div class="section-title">Notizie dall'Ordine</div>
<?php <?php
@ -74,9 +77,9 @@
} }
?> ?>
</div> </div>
<div class="col-12 my-2 pages"> <div class="col-12 my-2 pages">
<?php <?php
for($i=0;$i<$totPages;$i++){ for($i=0;$i<$totPages;$i++){
echo "<a class=\"font-12 "; echo "<a class=\"font-12 ";
@ -85,7 +88,7 @@
} }
?> ?>
</div> </div>
</div> </div>
<?php <?php

16
social.php

@ -0,0 +1,16 @@
<a href="#" onclick="window.open('https://www.facebook.com/sharer/sharer.php?u='+encodeURIComponent(location.href+'&amp;U=<?php echo date("U");?>'), 'facebook-share-dialog', 'width=626,height=436'); return false;">
<img src="<?= $BASE_URL;?>/images/social/facebook_s.png" border="0" class="social" width="30">
</a>
<a href="https://plus.google.com/share?url=http%3A%2F%2F<?php echo $_SERVER['HTTP_HOST']."".$_SERVER['REQUEST_URI'];?>" target="_blank">
<img src="<?= $BASE_URL;?>/images/social/plus_s.png" border="0" class="social" width="30">
</a>
<a href="http://twitter.com/intent/tweet?source=sharethiscom&amp;url=http%3A%2F%2F<?php echo $_SERVER['HTTP_HOST']."".$_SERVER['REQUEST_URI'];?>" target="_blank">
<img src="<?= $BASE_URL;?>/images/social/twitter_s.png" border="0" class="social" width="30">
</a>
<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2F<?php echo $_SERVER['HTTP_HOST']."".$_SERVER['REQUEST_URI'];?>" target="_blank">
<img src="<?= $BASE_URL;?>/images/social/in_s.png" border="0" class="social" width="30">
</a>
Loading…
Cancel
Save