Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Jack_mcs

Version Checker

Recommended Posts

This addon provides a quick and easy way to check and show the version of a contribution from within admin. It can be used by anyone but may be of more interest to developers that want to provide an easy way to add version numbers to their contributions. Edited by Jack_mcs

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Share this post


Link to post
Share on other sites

LOL! Yeeees! Thanks a lot! You are the best one, very good idea! :thumbsup:

 

I made a hungarian language file for it. Could you pack in?

 

<?php
/*
$Id: version checker, v 1.0 2009/12/01 
Originally Created by: Jack_mcs - http://www.oscommerce-solution.com
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com

Copyright (c) 2003 osCommerce
Portions Copyright 2009 oscommerce-solution.com

Released under the GNU General Public License
*/
define('ERROR_NO_VERSION_MATCH_FOUND', 9999);

define('TEXT_VERSION_CHECK_UPDATES', 'Frissítések keresése');
define('TEXT_VERSION_LATEST', '%s a legfrissebb verzió szám');
define('TEXT_VERSION_NO_MATCH_FOUND', 'Nem található ez a bővítmény.');
define('TEXT_VERSION_FOUND_UPDATE', 'A bővítményhez elérhető verziószám %s');

?>

 

Do you mind if I make an adaptation for osC3?


:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Share this post


Link to post
Share on other sites

Hi, again!

 

I examined this language code, but I didn find TEXT_VERSION_CHECK_UPDATES and ERROR_NO_VERSION_MATCH_FOUND variables in version_checker.php. Are there any functions?


:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Share this post


Link to post
Share on other sites

Hi, again!

 

I examined this language code, but I didn find TEXT_VERSION_CHECK_UPDATES and ERROR_NO_VERSION_MATCH_FOUND variables in version_checker.php. Are there any functions?

Those are defined in the includes/languages/english/check_version.php file. You wiill need to copy that file to the other language directories you want it to work with.


Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Share this post


Link to post
Share on other sites

Those are defined in the includes/languages/english/check_version.php file. You wiill need to copy that file to the other language directories you want it to work with.

 

Hi Jack_mcs,

 

Look at this is in osC3 function. Works!

 

I think that, when 100.000 osC user work online not will be good of http://addons.oscommerce.com. :rolleyes: A version check button would be better. ;)

 

Thanks!


:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Share this post


Link to post
Share on other sites

The code just returns the result. How you handle that result, or call the function in the first place. What I've done in my contributions that use this is add an admin option to turn automatic checking off and on. Then in the code, if that option is off I place a radio button that calls the code when checked and displays the result. Having it automatically check is probably not a good idea because of the contribution server is down or slow, that section in admin that uses this option won't load.

 

As for the OSC3 version, that's probably a good idea. I haven't looked at that shops code in a long time but a version option would be useful, I think.


Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Share this post


Link to post
Share on other sites

A new version has been uploaded. The text returned by the checker was changed to make it more flexible. Just upload the included files to upgrade.


Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Share this post


Link to post
Share on other sites

Hi Jack,

 

Just putting this in as you suggested for Site Monitor, but I am stumped right at the start. You say in the contribution file that you want to keep track of, add the following near the top of the file, after the require('includes/application_top.php'); statement.

 

Do you mean each and every .php file in a contribution?

 

And also then place the other code anywhere in that same file where you want the version string to appear.

 

Confused. Sorry.

Share this post


Link to post
Share on other sites

It only needs to go into one file, usually the one you view most often but it doesn't matter. For SiteMonitor, that would be sitemonitor_admin.php or sitemonitor_config_setup.php. The next version of Sitemonitor has it installed in sitemonitor_admin.php.


Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Share this post


Link to post
Share on other sites

It only needs to go into one file, usually the one you view most often but it doesn't matter. For SiteMonitor, that would be sitemonitor_admin.php or sitemonitor_config_setup.php. The next version of Sitemonitor has it installed in sitemonitor_admin.php.

 

I understand now. Thanks. I have just put it in the SiteMonitor/admin section and all seems to be fine as it is telling me the version number. Is it supposed to have a "bullet" to check for updates like on your Google Base add-on?

Share this post


Link to post
Share on other sites

No, it won't appear the same. When I add it to my contributions, I use different code, as you see in the google feeder page. I may add that as instructions to this contribution but I was trying to keep it as generic and simple as possible.


Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Share this post


Link to post
Share on other sites

No, it won't appear the same. When I add it to my contributions, I use different code, as you see in the google feeder page. I may add that as instructions to this contribution but I was trying to keep it as generic and simple as possible.

 

Ah cool. Does it auto-check then? It just looks like it will sit there static that's all.

Share this post


Link to post
Share on other sites

In most of my contributions, for it to check automatically I use a database setting so it can be turned on and off. If on, it will automatically check the version when the page in admin is entered. The problem with that is that if the addons section of oscommerce is busy, it will cause your admin to wait until a response is received. I didn't add that database option in the googlefeeder since that would complicate the installation. If you look in the admin/feeders.php file though, you will see this line:

if (false) { //requires database change so skip 

Changing the false to true will cause an automatic check when you go to admin->Tools Google Base.


Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Share this post


Link to post
Share on other sites

In most of my contributions, for it to check automatically I use a database setting so it can be turned on and off. If on, it will automatically check the version when the page in admin is entered. The problem with that is that if the addons section of oscommerce is busy, it will cause your admin to wait until a response is received. I didn't add that database option in the googlefeeder since that would complicate the installation. If you look in the admin/feeders.php file though, you will see this line:

if (false) { //requires database change so skip 

Changing the false to true will cause an automatic check when you go to admin->Tools Google Base.

 

Good stuff Jack. The others are already set like that right?

Edited by Whiskers

Share this post


Link to post
Share on other sites

I don't understand what you mean by "the others" but if you are referring to my contributions, any that have been released/updated since this one was uses it and has a database setting to turn checking on and off, except for the google feeder, I think. It will be worked into more and more contributions as I upload new versions.


Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Share this post


Link to post
Share on other sites

I don't understand what you mean by "the others" but if you are referring to my contributions, any that have been released/updated since this one was uses it and has a database setting to turn checking on and off, except for the google feeder, I think. It will be worked into more and more contributions as I upload new versions.

 

Sorry I meant any that I put that code into. They are just set to automatic.

Share this post


Link to post
Share on other sites

If you install Version Checker per the instructions included in it, then, yes, the checking is automatic.

 

Great. That's what I need to know.

Share this post


Link to post
Share on other sites

Jack

 

This is a great script and i hope more developers start to adopt this

 

I am wondering however if this mod can be used to check any other site for a version of a file

 

Am i right in assuming its just searching for the contributions name and version as per the strings defined?

 

and presumably it finds Expand All in the age first and then starts looking?

Share this post


Link to post
Share on other sites

Jack

 

This is a great script and i hope more developers start to adopt this

 

I am wondering however if this mod can be used to check any other site for a version of a file

 

Am i right in assuming its just searching for the contributions name and version as per the strings defined?

 

and presumably it finds Expand All in the age first and then starts looking?

It just loads the whole page and reads through the file a line at a time. It's not checking files, but the contents of a file. The basic code could be altered to do what you want though.


Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Share this post


Link to post
Share on other sites

Jack

 

Thanks for the advice

 

I actually tried adding it to the osCAffiliate affiliate_summray.php page and i have an old version so added:

 

  $contribPath = 'http://addons.oscommerce.com/info/158';
 $currentVersion = 'osCAffiliate v2.02';
 $contribName = 'osCAffiliate'; 
 $versionStatus = '';

 

and i had assumed this would work but it simply returned that the osCAffiliate v2.02 was the latest version

 

Is this simply because the versioning everyone has used is all over the place in this mod?

Share this post


Link to post
Share on other sites

actually nevermind i had realised my mistake...

 

amazing what a missing decimal in a version number can do !

Share this post


Link to post
Share on other sites

Im wondering if anyone has successfully added this to a payment or shipping module yet?

 

Ive had a few attempts and havent really gotten anywhere with it, as i had assumed i could tie it into the module description function but ive had no luck..

 

the only luck i have had is with the $this->signature function that was introduced into rc2.2a but even it doesnt actually take you to the specific page of the addon, it goes to sig.oscommerce.com which seems to just redirect to the home page of the site

Share this post


Link to post
Share on other sites

Im wondering if anyone has successfully added this to a payment or shipping module yet?

 

Ive had a few attempts and havent really gotten anywhere with it, as i had assumed i could tie it into the module description function but ive had no luck..

 

the only luck i have had is with the $this->signature function that was introduced into rc2.2a but even it doesnt actually take you to the specific page of the addon, it goes to sig.oscommerce.com which seems to just redirect to the home page of the site

I haven't tried but it can definitely be done. When you click on a module in admin, the title is displayed at the top of the right column under the Remove and Edit buttons. That text can be changed to whatever you like. You just need to work out the code to display the link and version information properly.


Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Share this post


Link to post
Share on other sites

I haven't tried but it can definitely be done. When you click on a module in admin, the title is displayed at the top of the right column under the Remove and Edit buttons. That text can be changed to whatever you like. You just need to work out the code to display the link and version information properly.

 

hrmm this may be difficult because the definition is a Language define, thats converted and displayed as $this-> description

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×