Advertisement
Guest User

Untitled

a guest
Jul 30th, 2016
578
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.08 KB | None | 0 0
  1. <meta property="og:image"content="http://example.com/images/loginPageCarausel/unnamed.png" />
  2. <meta property="og:title" content="Some Title" />
  3. <meta property="og:url" content="http://example.com" />
  4. <meta property="og:description" content="No Description" />
  5. <meta property="og:image:type" content="image/jpeg" />
  6. <meta property="og:image:width" content="400" />
  7. <meta property="og:image:height" content="300" />
  8.  
  9. <?php
  10. include_once 'includes/functions.php';
  11. $pg = getPageName('pages.php');
  12. if($pg) {
  13. if(isset($_GET['poll'])) {
  14. $i = $_GET['poll'];
  15. if(class_exists('Polls') && class_exists('FilesUpload')) {
  16. $vip_poll = Polls::getPollDataById(POST_TBL, $i);
  17. $title = $vip_poll->question;
  18. $gen = $vip_poll->poll_genre;
  19. $vip_pollOwnersId = $vip_poll->user_id;
  20. $media_files = FilesUpload::getMediaFiles(MED_TBL, $i, $vip_pollOwnersId);
  21. $f_type = $media_files->file_type;
  22. $f = $media_files->file_name;
  23. $img_ext_array = array('jpg', 'gif', 'jpeg', 'png');
  24. if (in_array($f_type, $img_ext_array)) {
  25. $analysis = Polls::select_all_from_graph_page_data(GP_DATA_TBL, $vip_pollOwnersId, $i);
  26. if($analysis != false) {
  27. if (!empty($analysis)) {
  28. $analysis_data = $analysis->data;
  29. if (strlen($analysis_data) > 300) {
  30. $analysis_data = substr($analysis_data, 0, 300) . "...";
  31. }
  32. $analysis = $analysis_data; ?>
  33. <meta property="fb:app_id" content="1775**************">
  34. <meta property="og:image" content="http://www.example.com/<?=$f?>" />
  35. <meta property="og:title" content="<?=$title?>" />
  36. <meta property="og:url" content="http://example.com/pages.php?vip_poll=<?=$i?>&genre=<?=$gen?>" />
  37. <meta property="og:description" content="<?=$analysis_data?>" />
  38. <meta property="og:image:type" content="image/jpeg" />
  39. <meta property="og:image:width" content="400" />
  40. <meta property="og:image:height" content="300" />
  41.  
  42. <?php }
  43. }
  44. }
  45.  
  46. }
  47. }
  48. }
  49.  
  50. ?>
  51.  
  52. https://developers.facebook.com/docs/sharing/webmasters/crawler
  53.  
  54. RewriteCond %{HTTP_USER_AGENT} ^facebookexternalhit
  55. RewriteRule ^(.*)$ ogtags.php?$1 [L,QSA]
  56.  
  57. RewriteCond %{HTTP_USER_AGENT} facebookexternalhit [NC,OR]
  58.  
  59. <div class="fb-share-button" data-href="http://www.example.com/pages.php?vip_poll='+app_id+'" data-layout="button_count" data-mobile-iframe="true"><a class="fb-xfbml-parse-ignore" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u='+url_enc+'&src=sdkpreparse"><span id="fb_span"><i class="fa fa-facebook-official" aria-hidden="true" style="color: white"></i> Share </span></a></div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement