Problem with Xenforo + Amember Plugin

Discussion in 'Customization & add-ons' started by invictum594, Nov 10, 2014.

  1. invictum594

    invictum594 New Member

    Joined:
    Mar 25, 2014
    Messages:
    22
    The plugin installed ok on Xenforo, but the redirect is getting a 404 error for my users. I think it is because I never did the bold part below, but I can't seem to find the code in the PAGE_CONTAINER. I appreciate the help, no one can log in to the forums on the site.

    install aMember plugin to XenForo (plugin will do redirect for login/logout links)
    - copy folder Amember from xenforo_plugin to folder library of your XenForo installation
    - go to XenForo Admin Interface -> Home -> Install Add-ons
    and install from file addon-Amember.xml
    - to disable Xenforo sliding login form and make redirect working
    please edit template PAGE_CONTAINER
    and remove the next code
    <xen:elseif is="!{$visitor.user_id} && !{$hideLoginBar}" />
    <xen:include template="login_bar" />


    However the code I have for PAGE_CONTAINER is:
    <?php
    class_exists('XenForo_Application', false) || die('Invalid');

    $contents = strval($contents);
    $hasInstallSidebar = (strpos($contents, 'id="sideNav"') !== false);
    ?>
    <!DOCTYPE html>
    <html id="XenForo" class="Install">
    <head>
    <meta charset="utf-8" />
    <title><?php echo ($title ? htmlspecialchars($title) . ' | ' : ''); ?>XenForo</title>

    <link rel="stylesheet" type="text/css" href="install.css" />

    <script src="../js/jquery/jquery-1.11.0.min.js"></script>
    <script src="../js/jquery/jquery.xenforo.rollup.js"></script>
    <script src="../js/xenforo/xenforo.js"></script>

    <script>
    jQuery.extend(true, XenForo, {
    <?php if (!empty($visitor['csrf_token_page'])) { echo "_csrfToken: '$visitor[csrf_token_page]'"; } ?>
    });
    </script>
    </head>
    <body>

    <div id="header">

    <div id="logoLine">
    <div class="pageWidth">
    <a href="http://xenforo.com" target="XenForo"><img src="../styles/default/xenforo/XenForo-small.png" id="logo" /></a>
    <h2 id="version"><a href="http://xenforo.com" target="XenForo">XenForo</a> <?php echo XenForo_Application::$version; ?></h2>
    </div>
    </div>

    <div id="tabsNav">
    <div class="pad"></div>
    </div>

    </div>

    <div id="body" class="pageWidth">
    <?php if ($hasInstallSidebar) { ?>
    <?php echo $contents; ?>
    <?php } else { ?>
    <div id="contentContainer" class="noSideBar">
    <div id="content">
    <div class="titleBar">
    <?php if (!empty($title)) { ?>
    <h1><?php echo htmlspecialchars($title); ?></h1>
    <?php } ?>
    </div>

    <?php echo $contents; ?>
    </div>

    <div id="footer">
    <div id="copyright"><?php echo XenForo_Template_Helper_Core::callHelper('copyright', array()); ?></div>
    </div>
    </div>
    <?php } ?>
    </div>

    </body>
    </html>

    I don't see anything in the page_container file that resembles that code. Is there something i'm not seeing?
  2. caesar

    caesar aMember Pro Developer Staff Member

    Joined:
    Oct 16, 2009
    Messages:
    2,295
    I believe you installed aMember to non standard folder. Please edit plugin file Amember/Redirect.php and replace /amember with your actual installation url.
  3. invictum594

    invictum594 New Member

    Joined:
    Mar 25, 2014
    Messages:
    22
    Forgive my ignorance as I am not very good with coding.

    What do you mean by "actual installation url"

    in other words in the Redirect.php file I see the code:

    header("Location: /amember$url" . ($add_back_url ? '?' . http_build_query(array(
    '_amember_redirect_url' => base64_encode(XenForo_Application::get('options')->boardUrl)
    ), '', '&') : ''));

    what would my actual installation url look like?
  4. caesar

    caesar aMember Pro Developer Staff Member

    Joined:
    Oct 16, 2009
    Messages:
    2,295
    What is url of your aMember signup page? For example on our site it is http://www.amember.com/amember/signup/ and installation url is /amember. You can see this string in code. I believe you have something different and you need to update this string with actual value for your installation.
  5. invictum594

    invictum594 New Member

    Joined:
    Mar 25, 2014
    Messages:
    22
    You are correct, it was a non-standard url. Mine was in /member, which I changed in the redirect .php file. Now instead of getting a 404 error, every time I try to log in, it flashes to the same page but it is still saying "log in" on the top right.
  6. invictum594

    invictum594 New Member

    Joined:
    Mar 25, 2014
    Messages:
    22
    Now the string looks like this:

    header("Location: /member$url" . ($add_back_url ? '?' . http_build_query(array(
    '_amember_redirect_url' => base64_encode(XenForo_Application::get('options')->boardUrl)
    ), '', '&') : ''));
    exit;

    Should it just be /member? or /member$url"
  7. invictum594

    invictum594 New Member

    Joined:
    Mar 25, 2014
    Messages:
    22
    Also, I am not opposed to paying money for some help on this plugin install. The installation itself was super difficult as the instructions listed under the program didn't install the plugin, so I had to come up with workarounds just to get the add-on to be accepted by Xenforo.

    I am super lost with this problem, any help is greatly appreciated.
  8. caesar

    caesar aMember Pro Developer Staff Member

    Joined:
    Oct 16, 2009
    Messages:
    2,295
  9. invictum594

    invictum594 New Member

    Joined:
    Mar 25, 2014
    Messages:
    22
    I have a prior ticket do you want me to create a new ticket?
  10. caesar

    caesar aMember Pro Developer Staff Member

    Joined:
    Oct 16, 2009
    Messages:
    2,295
    just respond to ticket that you already have.
  11. invictum594

    invictum594 New Member

    Joined:
    Mar 25, 2014
    Messages:
    22
    Ok, this is the ticket.
    Reference: EJJ-27317-797 Updated: 12 hours ago
  12. mdarras

    mdarras New Member

    Joined:
    Dec 6, 2015
    Messages:
    20

Share This Page