Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php get_header(); ?>
- <!-- Begin #colleft -->
- <section>
- <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
- <article>
- <header>
- <h1><?php the_title(); ?></h1>
- <div class="meta">
- <?php the_time('M j, Y') ?> przez <?php the_author_posts_link()?> <img src="<?php bloginfo('template_directory'); ?>/images/ico_post_comments.png" alt="" /> <?php comments_popup_link(__("Brak komentarzy", "site5framework"),__("1 Komentarz", "site5framework"),__("% Komentarzy", "site5framework") ); ?> <img src="<?php bloginfo('template_directory'); ?>/images/ico_post_date.png" alt="" /> <?php _e("Kategoria", "site5framework"); ?>: <?php the_category(', ') ?>
- </div>
- </header>
- <?php the_content(); ?>
- <!--SKRYPT--->
- <div class="container">
- <img src="/wp-content/themes/journalcrunch/include/graph/facebook-viral-mini.png" style="float:left; margin-right:20px; margin-bottom:10px;">
- <div>
- <h1 style="margin-bottom:5px;">Facebook Viral App</h1>
- <h2 style="margin-bottom:8px;" class="alt">Let your users unlock your content after connecting with their account.
- </h2>
- </div>
- <hr>
- <?php
- $f1 = new Fb_ypbox();
- $user_data = $f1->getUserData();
- $fb_user_id = $user_data['id'];
- if($fb_user_id!='') {
- $user_db = get_users(array('fb_user_id'=>$fb_user_id));
- if(count($user_db)>0) {
- if($user_db[0]['fb_token_expires']!=0 && time()>$user_db[0]['fb_token_expires']) {
- $force_connect =1;
- }
- }
- }
- if($fb_user_id=='' || count($user_db)==0 || $force_connect==1) {
- echo '<br><br>';
- echo '<center>';
- echo '<h1>Click on the link bellow to unlock your content</h1>';
- echo 'You will also be able to check and try out the backend !<br><br>';
- echo '<img src="'.$GLOBALS['fb_ypbox_path'].'/include/graph/icons/facebook32.png" style="vertical-align:middle; margin-right:10px; padding-bottom:8px;">';
- echo '<a href="#" id="fb_box_fb_login_btn" style="font-size:20px;">Facebook connect</a>';
- echo '</center>';
- }
- else {
- $user_data = $f1->getUserData();
- $fb_image = '<img src="'.$user_data['picture'].'" style="vertical-align:middle; width:50px; margin-right:10px;">';
- $result = get_settings();
- for($i=0; $i<count($result); $i++) {
- $settings[$result[$i]['meta_key']] = $result[$i]['meta_value'];
- }
- $settings['locked_content'] = stripslashes($settings['locked_content']);
- $settings['locked_content'] = str_replace('{picture}', $fb_image, $settings['locked_content']);
- $settings['locked_content'] = str_replace('{name}', $user_data['name'], $settings['locked_content']);
- //Here comes your content that only can be seen by users who have connected
- echo '<div style="margin-top:40px;">'.$settings['locked_content'].'</div>';
- //you can comment out the next section
- echo '<br>';
- //echo '<fb:like href="http://yougapi.com/products/facebook_viral/" send="true" width="450" show_faces="true"></fb:like>';
- echo '<br><hr style="margin-bottom:3px;">';
- //echo $fb_image;
- echo '<div class="span-12">';
- echo '<small>You are connected as ';
- echo ' <a href="'.$user_data['link'].'">'.$user_data['name'].'</a></small>';
- echo ' <small>(<a href="#" id="fb_box_fb_logout_btn">Logout</a>)</small>';
- echo '</div>';
- echo '<div class="span-12 last" style="text-align:right;">';
- 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>';
- echo '</div>';
- }
- $f1 = new Fb_ypbox();
- $f1->load_js_functions();
- $f1->loadJsSDK();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement