<?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(); ?> <iframe width="640" height="360" src="http://www.youtube.com/embed/<?php echo get_post_meta($post->ID, "filmik", true); ?>?rel=0" frameborder="0" allowfullscreen></iframe> <div class="postTags"><?php the_tags(); ?></div> </article> <?php comments_template(); ?> <?php endwhile; else: ?> <p><?php _e("Post jest pusty", "site5framework"); ?></p> <?php endif; ?> </section> <!-- End section --> <?php get_sidebar(); ?> <?php get_footer(); ?>
Tą pogrubioną linijkę chcę zablokować kupionym skryptem. Umożliwia on zablokowanie danej treści, pojawi się ona dopiero wtedy, gdy ktoś zaloguje się przez facebooka.
Poniżej kod odpowiadający za to:
<?php $f1 = new Fb_ypbox(); $user_data = $f1->getUserData(); $fb_user_id = $user_data['id']; if($fb_user_id!='') { $force_connect =1; } } } echo '<img src="'.$GLOBALS['fb_ypbox_path'].'/include/graph/icons/facebook32.png" style="vertical-align:middle; margin-right:10px; padding-bottom:8px;">'; } 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'] = str_replace('{name}', $user_data['name'], $settings['locked_content']); //Here comes your content that only can be seen by users who have connected //you can comment out the next section //echo '<fb:like href="http://xxx.com/products/facebook_viral/" send="true" width="450" show_faces="true"></fb:like>'; //echo $fb_image; } $f1 = new Fb_ypbox(); $f1->load_js_functions(); $f1->loadJsSDK(); ?> <?php ?>
Niestety nie mam pomysłu jak najlepiej połączyć obra skrypty i nie wiem jak zamiast 'locked content' (pobiera z bazy danych) wstawić treść z poprzedniego kodu (pogrubioną).