Advertisement
Guest User

Untitled

a guest
Oct 16th, 2012
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.67 KB | None | 0 0
  1. <?php get_header(); ?>
  2.  
  3. <!-- Begin #colleft -->
  4. <section>
  5. <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
  6. <article>
  7. <header>
  8. <h1><?php the_title(); ?></h1>
  9. <div class="meta">
  10. <?php the_time('M j, Y') ?> przez <?php the_author_posts_link()?>&nbsp;&nbsp;&nbsp;<img src="<?php bloginfo('template_directory'); ?>/images/ico_post_comments.png" alt="" /> <?php comments_popup_link(__("Brak komentarzy", "site5framework"),__("1 Komentarz", "site5framework"),__("% Komentarzy", "site5framework") ); ?>&nbsp;&nbsp;&nbsp;<img src="<?php bloginfo('template_directory'); ?>/images/ico_post_date.png" alt="" /> <?php _e("Kategoria", "site5framework"); ?>: <?php the_category(', ') ?>
  11. </div>
  12. </header>
  13. <?php the_content(); ?>
  14.  
  15.  
  16. <!--SKRYPT--->
  17. <div class="container">
  18. <img src="/wp-content/themes/journalcrunch/include/graph/facebook-viral-mini.png" style="float:left; margin-right:20px; margin-bottom:10px;">
  19. <div>
  20. <h1 style="margin-bottom:5px;">Facebook Viral App</h1>
  21. <h2 style="margin-bottom:8px;" class="alt">Let your users unlock your content after connecting with their account.
  22. </h2>
  23. </div>
  24.  
  25. <hr>
  26. <?php
  27.  
  28. $f1 = new Fb_ypbox();
  29. $user_data = $f1->getUserData();
  30. $fb_user_id = $user_data['id'];
  31.  
  32. if($fb_user_id!='') {
  33. $user_db = get_users(array('fb_user_id'=>$fb_user_id));
  34. if(count($user_db)>0) {
  35. if($user_db[0]['fb_token_expires']!=0 && time()>$user_db[0]['fb_token_expires']) {
  36. $force_connect =1;
  37. }
  38. }
  39. }
  40.  
  41. if($fb_user_id=='' || count($user_db)==0 || $force_connect==1) {
  42. echo '<br><br>';
  43. echo '<center>';
  44. echo '<h1>Click on the link bellow to unlock your content</h1>';
  45. echo 'You will also be able to check and try out the backend !<br><br>';
  46. echo '<img src="'.$GLOBALS['fb_ypbox_path'].'/include/graph/icons/facebook32.png" style="vertical-align:middle; margin-right:10px; padding-bottom:8px;">';
  47. echo '<a href="#" id="fb_box_fb_login_btn" style="font-size:20px;">Facebook connect</a>';
  48. echo '</center>';
  49. }
  50.  
  51. else {
  52. $user_data = $f1->getUserData();
  53. $fb_image = '<img src="'.$user_data['picture'].'" style="vertical-align:middle; width:50px; margin-right:10px;">';
  54.  
  55. $result = get_settings();
  56. for($i=0; $i<count($result); $i++) {
  57. $settings[$result[$i]['meta_key']] = $result[$i]['meta_value'];
  58. }
  59.  
  60. $settings['locked_content'] = stripslashes($settings['locked_content']);
  61.  
  62. $settings['locked_content'] = str_replace('{picture}', $fb_image, $settings['locked_content']);
  63. $settings['locked_content'] = str_replace('{name}', $user_data['name'], $settings['locked_content']);
  64.  
  65. //Here comes your content that only can be seen by users who have connected
  66. echo '<div style="margin-top:40px;">'.$settings['locked_content'].'</div>';
  67.  
  68. //you can comment out the next section
  69. echo '<br>';
  70. //echo '<fb:like href="http://yougapi.com/products/facebook_viral/" send="true" width="450" show_faces="true"></fb:like>';
  71. echo '<br><hr style="margin-bottom:3px;">';
  72. //echo $fb_image;
  73. echo '<div class="span-12">';
  74. echo '<small>You are connected as ';
  75. echo ' <a href="'.$user_data['link'].'">'.$user_data['name'].'</a></small>';
  76. echo ' <small>(<a href="#" id="fb_box_fb_logout_btn">Logout</a>)</small>';
  77. echo '</div>';
  78. echo '<div class="span-12 last" style="text-align:right;">';
  79. echo '<small><a href="./admin/">Backend demo</a> - Get this app exclusively on <a href="http://codecanyon.net/item/facebook-viral-and-marketing-social-app/717030?ref=yougapi">CodeCanyon</a></small>';
  80. echo '</div>';
  81.  
  82. }
  83.  
  84. $f1 = new Fb_ypbox();
  85. $f1->load_js_functions();
  86. $f1->loadJsSDK();
  87.  
  88. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement