WordPress.org

Forums

Business Directory Plugin
[resolved] Item details only for registered users (4 posts)

  1. andrenalin
    Member
    Posted 2 years ago #

    Hey,

    thank you very much for this really great Plugin!
    (i try to register in your forum, without success)

    i would like to hide the item details for visitors, you need to register and
    login to see the details.

    is it possible with a small trick or is it a big problem?

    i found a solution for posts but i donĀ“t know if i can use it for plugin output.
    http://www.tipps.1st-tec.de/wordpress/39-wordpress/121-text-in-wordpress-artikel-nur-fuer-angemeldete-user-sichtbar-machen.html

    thanks for helping me!

    http://wordpress.org/extend/plugins/business-directory-plugin/

  2. andrenalin
    Member
    Posted 2 years ago #

    Hey,

    i found the solution for me...

    edit in plugins/"bdp"/templates/businessdirectory-listing.tpl.php

    edit first lines

    <?php if ($is_sticky): ?>
        <?php echo $sticky_tag; ?>
    <?php endif;
    if (is_user_logged_in()) {
    ?>

    line 32 (end of doc)
    } else { echo 'Login text!';}?>

  3. andrenalin
    Member
    Posted 2 years ago #

    hey, i would like to give you my new and clean edition:
    this is the whole site
    plugins/"bdp"/templates/businessdirectory-listing.tpl.php

    <?php if ($is_sticky): ?>
        <?php echo $sticky_tag; ?>
    <?php endif;
    //check login
    //if logged in
    //show details
    if (is_user_logged_in()) {
    ?>
    
    <div class="listing-title">
        <h2><?php echo $title; ?></h2>
    </div>
    
    <?php if ($actions): ?>
        <?php echo $actions; ?>
    <?php endif; ?>
    
    <?php if ($main_image): ?>
        <div class="main-image"><?php echo $main_image; ?></div>
    <?php endif; ?>
    
    <div class="listing-details cf <?php if ($main_image): ?>with-image<?php endif; ?>">
        <?php echo $listing_fields; ?>
    </div>
    
    <?php if ($extra_images): ?>
    <div class="extra-images">
        <ul>
        <?php foreach ($extra_images as $image): ?>
            <li><?php echo $image; ?></li>
        <?php endforeach; ?>
        </ul>
    </div>
    <?php endif;
    
    } else {
    //wenn nicht eingelogt dann anmeldung zeigen
    //teil kopiert aus parts/login-required.tpl.php
    ?>
    <?php echo wpbdp_render_msg(_x("You are not currently logged in. Please login or register first. When registering, you will receive an activation email. Be sure to check your spam if you don't see it in your email within 60 minutes.", 'templates', 'WPBDM')); ?>
    
    <p></p>
    
    <h2><?php _ex('Login', 'templates', 'WPBDM'); ?></h2>
    <?php wp_login_form(); ?>
    
    <?php if (get_option('users_can_register')): ?>
    <a href="<?php echo site_url('wp-login.php?action=register', 'login'); ?>"><?php _ex('Not yet registered?', 'templates', 'WPBDM'); ?></a>
    <?php endif; ?>
    
    <?php }?>
  4. businessdirectoryplugin
    Member
    Plugin Author

    Posted 2 years ago #

    Thanks for the tip!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Business Directory Plugin
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic