If this is your first visit, check our documentation. To post, register or login.
Forums / Zen Cart Code Suggestions / ZC new version upgrade alert in admin

ZC new version upgrade alert in admin

Started by frank18 on 25 Feb 2016, 4:02 AM · Views: 90

Results 1 to 3 of 3
25 Feb 2016, 4:02 AM
#1
frank18 avatar

frank18

Deceased

Join Date:
Nov 2007
Location:
Sunny Coast, Australia
Posts:
3,427
Plugin Contributions:
2

ZC new version upgrade alert in admin

Over the past months I have upgraded numerous sites for clients to the latest ZC version. Some of these sites had not been updated even going back to ZC 1.3.8a. That ofc makes an upgrade tedious and expensive for the client, let alone security issues.

So, to alert my clients of future new versions and prompt them to upgrade without long delays, I implemented a few small changes in 3 admin files which produce the results shown in the attached images.

Attachment 16065
Attachment 16066
Attachment 16067

To arrive at this effect I added to the admin/includes/stylesheet.css (anywhere)

.versionCurrent{ 
color:green; 
font-size:12px; 
font-weight:bold; 
} 
.alertVersionNew{ 
color:#ff0000; 
font-size:16px; 
font-weight:bold; 
}

Then in admin/includes/languages/english.php I amended // Version Check notices to this:

// Version Check notices
  define('TEXT_VERSION_CHECK_NEW_VER','<span class="alertVersionNew">ALERT! New Version Available:</span> v');
  define('TEXT_VERSION_CHECK_NEW_PATCH','<span class="alertVersionNew">New PATCH Available:</span> v');
  define('TEXT_VERSION_CHECK_PATCH','patch');
  define('TEXT_VERSION_CHECK_DOWNLOAD','Download Here');
  define('TEXT_VERSION_CHECK_CURRENT','<span class="versionCurrent">Your version of Zen Cart® appears to be current.</span>');

Lastly in admin/includes/header.php around line 208 I changed

    <td align="right" class="[B]main[/B]" valign="top"><?php echo $new_version; ?><br /><?php echo '(' . TEXT_CURRENT_VER_IS . ' v' . PROJECT_VERSION_MAJOR . '.' . PROJECT_VERSION_MINOR . (PROJECT_VERSION_PATCH1 != '' ? 'p' . PROJECT_VERSION_PATCH1 : '') . ')'; ?></td>

to this

    <td align="right" class="[B]versionCurrent[/B]" valign="top"><?php echo $new_version; ?><br /><?php echo '(' . TEXT_CURRENT_VER_IS . ' v' . PROJECT_VERSION_MAJOR . '.' . PROJECT_VERSION_MINOR . (PROJECT_VERSION_PATCH1 != '' ? 'p' . PROJECT_VERSION_PATCH1 : '') . ')'; ?></td>

May be food for thought to incorporate these minor changes in future ZC upgrades - would prevent a few headaches for store operators and forum volunteers.

NOTE: We are sorry that Frank is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

26 Feb 2016, 5:09 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Re: ZC new version upgrade alert in admin

Thanks. Some of this will be in the upcoming v155 release.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

27 Feb 2016, 1:12 AM
#3
frank18 avatar

frank18

Deceased

Join Date:
Nov 2007
Location:
Sunny Coast, Australia
Posts:
3,427
Plugin Contributions:
2

Re: ZC new version upgrade alert in admin

DrByte:

Thanks. Some of this will be in the upcoming v155 release.

Thanks DrByte, much appreciated.

Made another 2 changes

In admin/includes/languages/english.php added

define('IMAGE_VERSION_DOWNLOAD', 'Download Here');

Then in admin/includes/header.php changed (around line

    // display download link 
    if ($new_version != '' && $new_version != TEXT_VERSION_CHECK_CURRENT) $new_version .= '<br /><a href="' . $lines[6] . '" target="_blank">'. TEXT_VERSION_CHECK_DOWNLOAD .'</a>';

to this

    // display download link 
    if ($new_version != '' && $new_version != TEXT_VERSION_CHECK_CURRENT) $new_version .= '<br /><a href="' . $lines[6] . '" target="_blank">' . zen_image_button('button_download_now.gif',IMAGE_VERSION_DOWNLOAD) .'</a>';

This way the button 'Download Here' is displayed if a new version is available, looks a bit more professional :smile:

NOTE: We are sorry that Frank is no longer with us.
We are grateful for all his contributions to the Zen Cart community.