Thread: ez page off/on?

Page 1 of 4 123 ... LastLast
Results 1 to 10 of 36
  1. #1
    Join Date
    Jun 2011
    Posts
    14
    Plugin Contributions
    0

    Default ez page off/on?

    hi all,

    i was wondering whether it is possible to have the "login" link on the ez page header and have this changed to "logoff" if the customer has logged in?

    what files would need to be edited or process needed to do this? also, can this be done with an image? i.e. have an image change from "login" to "logoff" button if user is signed in?

    any help appreciated!

  2. #2
    Join Date
    Feb 2005
    Location
    Lansing, Michigan USA
    Posts
    20,024
    Plugin Contributions
    3

    Default Re: ez page off/on?

    Not sure what you're asking. That would be the title of an EZ page, which you can change in Admin - Tools - EZ Pages.
    Last edited by stevesh; 20 Jul 2011 at 11:13 AM.

  3. #3
    Join Date
    Jun 2011
    Posts
    14
    Plugin Contributions
    0

    Default Re: ez page off/on?

    sorry, its www.teenybooks.co.uk

    as you can see, there is a login nav link at the top right and also i recently added a logoff link on ez page which is there permenantly atm as well as a login image on the right.

    im trying to understand which would be best, either changing the ez page link to not appear if it is a guest visitor viewing and to appear if customer is logged in or to change the login image to show another image when customer is logged in.

    would any of these options be possible?

  4. #4
    Join Date
    Jun 2011
    Posts
    14
    Plugin Contributions
    0

    Default Re: ez page off/on?

    Quote Originally Posted by stevesh View Post
    Not sure what you're asking. That would be the title of an EZ page, which you can change in Admin - Tools - EZ Pages.
    i understand that that is the way to create an ez page...but is there a way to create a log off easy page that ONLY shows on the ez page header when the customer is logged in?

  5. #5
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: ez page off/on?

    You would need to add some custom code to /includes/templates/your_template/templates/tpl_ezpages_bar_header.php.
    PHP Code:
    <?php if (sizeof($var_linksList) >= 1) { ?>
    <div id="navEZPagesTop">
    <?php for ($i=1$n=sizeof($var_linksList); $i<=$n$i++) {  ?>
      <a href="<?php echo $var_linksList[$i]['link']; ?>"><?php echo $var_linksList[$i]['name']; ?></a><?php echo ($i $n EZPAGES_SEPARATOR_HEADER '') . "\n"?>
    <?php 
    // end FOR loop ?>
    </div>
    <?php ?>
    Wrap a test around the <a href=" line to check for the ez-page being processed and display the login link only if not logged in and the logoff link only if logged in.
    Replace the above code with this:
    PHP Code:
    <?php if (sizeof($var_linksList) >= 1) { ?>
    <div id="navEZPagesTop">
    <?php for ($i=1$n=sizeof($var_linksList); $i<=$n$i++) { 
      if (!(
    $var_linksList[$i]['name'] == 'Login' and $_SESSION['customer_id']) or !($var_linksList[$i]['name'] == 'Logoff' and !$_SESSION['customer_id'])) { ?>
        <a href="<?php echo $var_linksList[$i]['link']; ?>"><?php echo $var_linksList[$i]['name']; ?></a><?php echo ($i $n EZPAGES_SEPARATOR_HEADER '') . "\n"?>
    <?php  
    //end if 
    // end FOR loop ?>
    </div>
    <?php ?>
    Be sure the names are spelled and capitalized the same in the code and the page title.
    Last edited by gjh42; 20 Jul 2011 at 02:05 PM.

  6. #6
    Join Date
    Jun 2011
    Posts
    14
    Plugin Contributions
    0

    Default Re: ez page off/on?

    thanks gjh for your efforts in helping me to resolve this issue. i will do as you say when i get home and update on the progress!

  7. #7
    Join Date
    Jun 2011
    Posts
    14
    Plugin Contributions
    0

    Default Re: ez page off/on?

    Quote Originally Posted by gjh42 View Post
    You would need to add some custom code to /includes/templates/your_template/templates/tpl_ezpages_bar_header.php.
    PHP Code:
    <?php if (sizeof($var_linksList) >= 1) { ?>
    <div id="navEZPagesTop">
    <?php for ($i=1$n=sizeof($var_linksList); $i<=$n$i++) {  ?>
      <a href="<?php echo $var_linksList[$i]['link']; ?>"><?php echo $var_linksList[$i]['name']; ?></a><?php echo ($i $n EZPAGES_SEPARATOR_HEADER '') . "\n"?>
    <?php 
    // end FOR loop ?>
    </div>
    <?php ?>
    Wrap a test around the <a href=" line to check for the ez-page being processed and display the login link only if not logged in and the logoff link only if logged in.
    Replace the above code with this:
    PHP Code:
    <?php if (sizeof($var_linksList) >= 1) { ?>
    <div id="navEZPagesTop">
    <?php for ($i=1$n=sizeof($var_linksList); $i<=$n$i++) { 
      if (!(
    $var_linksList[$i]['name'] == 'Login' and $_SESSION['customer_id']) or !($var_linksList[$i]['name'] == 'Logoff' and !$_SESSION['customer_id'])) { ?>
        <a href="<?php echo $var_linksList[$i]['link']; ?>"><?php echo $var_linksList[$i]['name']; ?></a><?php echo ($i $n EZPAGES_SEPARATOR_HEADER '') . "\n"?>
    <?php  
    //end if 
    // end FOR loop ?>
    </div>
    <?php ?>
    Be sure the names are spelled and capitalized the same in the code and the page title.
    hi,

    i have jus replaced the code but nothing appears to have changed? would it be possible to clarify the last line "Be sure the names are spelled and capitalized the same in the code and the page title"?

    i literally replaced the code above as instructed and the "logoff" ez page still shows regardless of whether im logged in or not...am i suppose to change something? or add a "login" ez page too?

  8. #8
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: ez page off/on?

    What are the precise titles of the login and logoff ez-pages? The code needs to use those exactly in order to work.

    Looking at your site, the login button is not related to ez-pages at all, so you could either scrap that button and make an ez-page internal link pointing to the login page, or keep the button and remove the code that tests for it in ez-pages.

    My advice would be to keep login/logoff functions in one place (showing alternately depending on status), either as links in the ez-pages menu or as buttons where your Login button is. You could use code similar to the above to switch buttons.

  9. #9
    Join Date
    Jun 2011
    Posts
    14
    Plugin Contributions
    0

    Default Re: ez page off/on?

    Quote Originally Posted by gjh42 View Post
    What are the precise titles of the login and logoff ez-pages? The code needs to use those exactly in order to work.

    Looking at your site, the login button is not related to ez-pages at all, so you could either scrap that button and make an ez-page internal link pointing to the login page, or keep the button and remove the code that tests for it in ez-pages.

    My advice would be to keep login/logoff functions in one place (showing alternately depending on status), either as links in the ez-pages menu or as buttons where your Login button is. You could use code similar to the above to switch buttons.
    many thanks for your quick reply gjh42. i would prefer that the buttons switch from login to logoff but where would i place the code to enable the switch or the button images depending on whether customer is login/logoff? at the moment the image is hardcoded within the tpl_header.php i think and not implemented using css. the code above doesnt make much sense to me as my php knowledge is fairly limited.

    thanks for the help in advance.

  10. #10
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: ez page off/on?

    Post the area of tpl_header.php where the login button is coded, and I can show you how to implement the switch. There is no CSS involved in any case here, unless you wanted to tweak the position of the button(s).

 

 
Page 1 of 4 123 ... LastLast

Similar Threads

  1. Checkout page goes off page
    By stephy in forum General Questions
    Replies: 4
    Last Post: 28 Feb 2011, 08:12 PM
  2. Help Remove catagories off main page, but list subcatagories of main page
    By MadPricerSales in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 26 Mar 2010, 04:14 AM
  3. Catagories go off page?
    By LoriW. in forum Templates, Stylesheets, Page Layout
    Replies: 10
    Last Post: 13 Jan 2008, 12:22 AM
  4. Main Page(Define Pages Editor) throws page width off
    By audradh in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 30 Jun 2006, 02:36 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR