Results 1 to 10 of 14

Hybrid View

  1. #1
    Join Date
    Mar 2008
    Location
    Brampton, Cumbria, United Kingdom, United Kingdom
    Posts
    816
    Plugin Contributions
    2

    Default Re: Admin Password Change Alert Message Display -- Support Thread

    Very good plug-in. I would like to change the order of date time: At the moment its says '2013-08-06 15:10:49' I would like to change it to something like '08-September-2013 @ 15:10'

    Thanks in advance

  2. #2
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,942
    Plugin Contributions
    96

    Default Re: Admin Password Change Alert Message Display -- Support Thread

    Look at the block of code added to /YOUR_ADMIN/includes/header.php, starting at line 211:
    Code:
    //-bof-lat9 Display last password change and login
      if (function_exists('zen_get_admin_name') && function_exists('zen_read_user')) {
        $adminInfo = zen_read_user(zen_get_admin_name($_SESSION['admin_id']));
    ?>
      </tr>
      <tr>
        <td align="right" class="main" valign="top"><?php echo TEXT_PASSWORD_LAST_CHANGE . $adminInfo['pwd_last_change_date']; ?></td>
      </tr>
      <tr>
        <td align="right" class="main" valign="top"><?php echo TEXT_LAST_LOGIN_INFO . $_SESSION['last_login_date'] . ' [' . $_SESSION['last_login_ip'] . ']'; ?></td>
    <?php
      }
    //-eof-lat9
    and change that to
    Code:
    //-bof-lat9 Display last password change and login
      if (function_exists('zen_get_admin_name') && function_exists('zen_read_user')) {
        $adminInfo = zen_read_user(zen_get_admin_name($_SESSION['admin_id']));
    ?>
      </tr>
      <tr>
        <td align="right" class="main" valign="top"><?php echo TEXT_PASSWORD_LAST_CHANGE . substr($adminInfo['pwd_last_change_date'], 0, 10) . ' @ ' . substr($adminInfo['pwd_last_change_date'], 11, 5); ?></td>
      </tr>
      <tr>
        <td align="right" class="main" valign="top"><?php echo TEXT_LAST_LOGIN_INFO . $_SESSION['last_login_date'] . ' [' . $_SESSION['last_login_ip'] . ']'; ?></td>
    <?php
      }
    //-eof-lat9

  3. #3
    Join Date
    Mar 2008
    Location
    Brampton, Cumbria, United Kingdom, United Kingdom
    Posts
    816
    Plugin Contributions
    2

    Default Re: Admin Password Change Alert Message Display -- Support Thread

    Quote Originally Posted by lat9 View Post
    Look at the block of code added to /YOUR_ADMIN/includes/header.php, starting at line 211:
    Code:
    //-bof-lat9 Display last password change and login
      if (function_exists('zen_get_admin_name') && function_exists('zen_read_user')) {
        $adminInfo = zen_read_user(zen_get_admin_name($_SESSION['admin_id']));
    ?>
      </tr>
      <tr>
        <td align="right" class="main" valign="top"><?php echo TEXT_PASSWORD_LAST_CHANGE . $adminInfo['pwd_last_change_date']; ?></td>
      </tr>
      <tr>
        <td align="right" class="main" valign="top"><?php echo TEXT_LAST_LOGIN_INFO . $_SESSION['last_login_date'] . ' [' . $_SESSION['last_login_ip'] . ']'; ?></td>
    <?php
      }
    //-eof-lat9
    and change that to
    Code:
    //-bof-lat9 Display last password change and login
      if (function_exists('zen_get_admin_name') && function_exists('zen_read_user')) {
        $adminInfo = zen_read_user(zen_get_admin_name($_SESSION['admin_id']));
    ?>
      </tr>
      <tr>
        <td align="right" class="main" valign="top"><?php echo TEXT_PASSWORD_LAST_CHANGE . substr($adminInfo['pwd_last_change_date'], 0, 10) . ' @ ' . substr($adminInfo['pwd_last_change_date'], 11, 5); ?></td>
      </tr>
      <tr>
        <td align="right" class="main" valign="top"><?php echo TEXT_LAST_LOGIN_INFO . $_SESSION['last_login_date'] . ' [' . $_SESSION['last_login_ip'] . ']'; ?></td>
    <?php
      }
    //-eof-lat9
    Thanks for the code.

    The date is still wrong way round.

    It is displayed: 2013-08-06
    I would like it 06-08-2013 however like 6 August 2013

  4. #4
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,942
    Plugin Contributions
    96

    Default Re: Admin Password Change Alert Message Display -- Support Thread

    OK, let's try like this:
    Code:
    //-bof-lat9 Display last password change and login
      if (function_exists('zen_get_admin_name') && function_exists('zen_read_user')) {
        $adminInfo = zen_read_user(zen_get_admin_name($_SESSION['admin_id']));
        $year = substr($adminInfo['pwd_last_change_date'], 0, 4);
        $month = substr($adminInfo['pwd_last_change_date', 5, 2);
        $day = substr($adminInfo['pwd_last_change_date', 8, 2);
        $hour = substr($adminInfo['pwd_last_change_date', 11, 2);
        $minute = substr($adminInfo['pwd_last_change_date', 14, 2);
        $second = substr($adminInfo['pwd_last_change_date, 17, 2);
        $timestamp = mktime($hour, $minute, $second, $month, $day, $year);
    ?>
      </tr>
      <tr>
        <td align="right" class="main" valign="top"><?php echo TEXT_PASSWORD_LAST_CHANGE . strftime('%d-%B-%Y @ %H:%M', $timestamp); ?></td>
      </tr>
      <tr>
        <td align="right" class="main" valign="top"><?php echo TEXT_LAST_LOGIN_INFO . $_SESSION['last_login_date'] . ' [' . $_SESSION['last_login_ip'] . ']'; ?></td>
    <?php
      }
    //-eof-lat9
    The format I chose for strftime will output something similar to '14-September-2013 @ 12:25'. There are many, many more formatting options available for the strftime function (http://us2.php.net/manual/en/function.strftime.php)!

  5. #5
    Join Date
    Mar 2008
    Location
    Brampton, Cumbria, United Kingdom, United Kingdom
    Posts
    816
    Plugin Contributions
    2

    Default Re: Admin Password Change Alert Message Display -- Support Thread

    Thanks for the link. A bit of light reading for bedtime. I will get back when I get the changes done and paste the code in here.

  6. #6
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,942
    Plugin Contributions
    96

    Default Re: Admin Password Change Alert Message Display -- Support Thread

    Thanks to mprough for submitting an updated version (v1.1.0) that includes the Zen Cart v1.5.3 changes.

    Please Note: Due to the password-related changes (and new functions introduced) in Zen Cart v1.5.3, this version will work only on Zen Cart v1.5.3 installations. Please continue to use v1.0.0 on Zen Cart v1.5.0 through v1.5.2 installations.

  7. #7
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,942
    Plugin Contributions
    96

    Default Re: Admin Password Change Alert Message Display -- Support Thread

    v1.1.2 is now available from the Plugins area. The update provides downwardly-compatible changes required for Zen Cart v1.5.4.

 

 

Similar Threads

  1. v151 Display Log Files [Support Thread] (v1.5.1-to-v1.5.6)
    By lat9 in forum Addon Admin Tools
    Replies: 94
    Last Post: 25 Dec 2021, 07:02 PM
  2. v151 Password Protect Categories by Ausgirl [Support Thread]
    By Ausgirl in forum All Other Contributions/Addons
    Replies: 4
    Last Post: 20 Feb 2016, 06:33 PM
  3. Password Protected Categories (PPC) - Support Thread
    By stevish in forum All Other Contributions/Addons
    Replies: 31
    Last Post: 29 Sep 2012, 09:23 PM
  4. Message/Alert back grounds - how do I change?
    By Tomjoolery in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 16 Oct 2008, 02:16 PM
  5. Change Alert Message text /box color
    By WebElements in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 12 Oct 2008, 07:13 PM

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