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. 15
      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

15
news.php

@ -30,10 +30,6 @@
echo "<div class=\"item pt-4 font-bold\">Allegati:</div>";
$qa = mysqli_query($conn, "SELECT * FROM files WHERE id IN(".$r['append'].")");
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=\"size\">".$ra['size']."</div>";
echo "</a></div>";
@ -46,12 +42,19 @@
</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()">
<button><i class="fa fa-angle-left"></i> Torna indietro</button>
</a>
</div>
<div class="col-6 mt-4 text-right">
<div class="col-6 p-3 text-right">
<a href="<?php echo $BASE_URL."/news";?>">
<button>Vai a tutte le news <i class="fa fa-angle-right"></i></button>
</a>

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