Forums

[resolved] Login section mess up with my Mootools scripts (2 posts)

  1. jeeremie
    Member
    Posted 3 years ago #

    Hi,

    I have placed a login form on top of my front pages with a simple navigation to access dashboard, write a new post, go to Profile... I use the script of Small Potatoe: http://www.wpdesigner.com/2007/07/09/how-to-place-a-login-form-in-the-sidebar/

    My code looks like this (I have removed some lines to keep the code simple):

    <?php global $user_ID, $user_identity, $user_level ?>
    <?php if ( $user_ID ) {  ?>
    <!-- If users logged in, display the top navigation: -->
    <ul class="login">
    <li><a href="<?php bloginfo('url') ?>/wp-admin/profile.php">My Profile</a></li>
    <li><a href="<?php bloginfo('url') ?>/wp-admin/">Dashboard</a></li>
    <?php if ( $user_level >= 1 ) : ?>
    <li><a href="<?php bloginfo('url') ?>/wp-admin/post-new.php">Write an article</a></li><?php endif // $user_level >= 1 ?>
    <?php if ( $user_level >= 1 ) : ?>
    <li><a href="<?php bloginfo('url') ?>/wp-admin/edit.php">Manage Posts</a></li><?php endif // $user_level >= 1 ?>
    <?php if ( $user_level >= 1 ) : ?>
    <li><a href="<?php bloginfo('url') ?>/wp-admin/plugins.php">Manage Plugins</a></li><?php endif // $user_level >= 1 ?>
    <li><a href="<?php bloginfo('url') ?>/wp-login.php?action=logout&amp;redirect_to=<?php echo urlencode($_SERVER['REQUEST_URI']) ?>">Log Out</a></li>
    </ul> 
    
    <?php } elseif (get_option('users_can_register')) { ?>
    <!-- ... else, display top navigation below: -->
    <!-- login -->
    <ul class="login">
    <li><a id="open" href="#">Log In</a></li>
    </ul> <!-- / login -->
    <?php } ?>

    The problem is when I log in. I can go to the dashboard and so on but all my scripts using Mootools 1.2 aren't working anymore (I use Milkbox for my portfolio page, Fx.Slide, Fx.Scroll...).

    I can't figure out why. Does anyone have an idea?

    Thanks

  2. jeeremie
    Member
    Posted 3 years ago #

    It has been few days I tried to fix this issue without success, and today, when I finally decide to ask for help on this forum, I found out what was my problem.

    I had to call my Mootools script inside the code above and not in the header, like this:

    [...]
    
    <?php } elseif (get_option('users_can_register')) { ?>
    <!--Toggle effect (show/hide login section) -->
    <script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/fx.slide.js"></script>
    
    <!-- ... else, display top navigation below: -->
    <!-- login -->
    <ul class="login">
    <li><a id="open" href="#">Log In</a></li>
    </ul> <!-- / login -->
    <?php } ?>

    I can't believe that was that easy. Thanks anyway.

Topic Closed

This topic has been closed to new replies.

About this Topic