Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Down for Maintenance v1.0


Ajeh

Recommended Posts

good reason .....

 

 

but other like myself surley have lans like myself

with more than one pc and use more than one pc....

 

 

guess ill release my mod on the site with its original self intact

so others that find it usefull can use it without having to search ......

its really usefull to me since i use different pcs on our lan at different times .

 

i may include the option to make it a single ip or range like i have

by setting a true false in the admin ....

 

keep up the good work

 

 

later

Link to comment
Share on other sites

  • Replies 72
  • Created
  • Last Reply

Top Posters In This Topic

Thanks! I never know if I am just overlooking something as I end up working with osC at all hours. I just realized that my server is on a different time zone as well so I will probably have to do the same hack or just use GMT. Thanks again.

 

David

Link to comment
Share on other sites

for users on a LAN ( special request from teksign ;) )

 

update 1.0.1b

 

insert in your database with your favorite tool like phpmyadmin or whatever you like...

INSERT INTO configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('', 'Down For Maintenance - Allowed IP Range', 'EXCLUDE_IP_RANGE_FROM_MAINTENANCE', '192.168.0', 'IP address Range (first 9) Allowed to access site during Down For Maintenance.<br>Only usefull for working on a LAN.', 1, 500, '2003-03-23 15:07:52', '0000-00-00 00:00:00', NULL, NULL);

==========================================================

 

Changes to /catalog/includes/application_top.php

 

Locate the lines:

// BOF: Down for Maintenance except for admin ip

if (EXCLUDE_ADMIN_IP_FOR_MAINTENANCE != getenv('REMOTE_ADDR')){ 

if (DOWN_FOR_MAINTENANCE=='true' and !strstr($PHP_SELF,DOWN_FOR_MAINTENANCE_FILENAME)) 

 { tep_redirect(tep_href_link(DOWN_FOR_MAINTENANCE_FILENAME)); }

}

 

Replace it with:

// BOF: Down for Maintenance except for admin ip

if (!defined("EXCLUDE_IP_RANGE_FROM_MAINTENANCE")) define('EXCLUDE_IP_RANGE_FROM_MAINTENANCE', substr($EXCLUDE_ADMIN_IP_FOR_MAINTENANCE,0,9));

if (EXCLUDE_ADMIN_IP_FOR_MAINTENANCE != getenv('REMOTE_ADDR') || EXCLUDE_IP_RANGE_FROM_MAINTENANCE != substr($REMOTE_ADDR,0,9)){

if (DOWN_FOR_MAINTENANCE=='true' and !strstr($PHP_SELF,DOWN_FOR_MAINTENANCE_FILENAME)) { tep_redirect(tep_href_link(DOWN_FOR_MAINTENANCE_FILENAME)); }

}

 

 

Changes to /catalog/includes/header.php

 

Locate the lines:

// this will let the admin know that the website is DOWN FOR MAINTENANCE to the public

 if ( (DOWN_FOR_MAINTENANCE == 'true') && (EXCLUDE_ADMIN_IP_FOR_MAINTENANCE == getenv('REMOTE_ADDR')) ) {

      tep_output_warning('NOTICE: the website is currently Down For Maintenance to the public');

 }

Replace it with:

 

// this will let the admin know that the website is DOWN FOR MAINTENANCE to the public

 if ( (DOWN_FOR_MAINTENANCE == 'true') && (EXCLUDE_ADMIN_IP_FOR_MAINTENANCE == getenv('REMOTE_ADDR')) || ( EXCLUDE_IP_RANGE_FROM_MAINTENANCE == substr($REMOTE_ADDR,0,9)) ) {

      tep_output_warning('NOTICE: the website is currently Down For Maintenance to the public');

 }

Robert

 

We all need to learn it once, how hard it may seem when you look at it, also you will master it someday ;)

Link to comment
Share on other sites

new version with email options will be launched soon....

 

Read Linda's reply for the new options a few post back

 

Admin Area is ready, just need to make the code osC style and some lay-out adjusting

Robert

 

We all need to learn it once, how hard it may seem when you look at it, also you will master it someday ;)

Link to comment
Share on other sites

new version with email options will be launched soon....

 

Read Linda's reply for the new options a few post back

 

Admin Area is ready, just need to make the code osC style and some lay-out adjusting

 

Yes - This would be great! I cant wait!!

 

Thanks,

Warren

 

PS When will it be ready?

Link to comment
Share on other sites

  • 1 month later...

Hello,

 

I have got an error with the latest v1.1 - If I change to the maintenance modus, the stylesheets file won?t be loaded. The result of them is that the page is totally unformated.

 

What I have done wrong ?

 

 

Thanks

 

Andreas

Link to comment
Share on other sites

Having trouble loading the database

 

getting this....

 

MySQL said: You have an error in your SQL syntax near '; INSERT INTO configuration (configuration_id, configuration_title, configuratio' at line 1

Link to comment
Share on other sites

  • 3 weeks later...

Ho people,

 

Im having a strange problem with this contribution. All is installed correctly on an MS1 release.

 

The strange thing is that sometimes it does nog load my site at all. It says page not found. Now after a night working on this problem i have narrowed it to this contribibution.

 

The lines that give these odd trouble are in application_top:

 

// BOF: WebMakers.com Added: Down for Maintenance

if (DOWN_FOR_MAINTENANCE=='true' {

tep_redirect(tep_href_link(DOWN_FOR_MAINTENANCE_FILENAME));

}

// do not let people get to down for maintenance page if not turned on

if (DOWN_FOR_MAINTENANCE=='false' {

tep_redirect(tep_href_link(FILENAME_DEFAULT));

}

// EOF: WebMakers.com Added: Down for Maintenance

 

// BOF: Down for Maintenance except for admin ip

if (EXCLUDE_ADMIN_IP_FOR_MAINTENANCE != getenv('REMOTE_ADDR')){

if (DOWN_FOR_MAINTENANCE=='true' { tep_redirect(tep_href_link(DOWN_FOR_MAINTENANCE_FILENAME)); }

}

// do not let people get to down for maintenance page if not turned on

if (DOWN_FOR_MAINTENANCE=='false' {

tep_redirect(tep_href_link(FILENAME_DEFAULT));

}

// EOF: WebMakers.com Added: Down for Maintenance

 

 

 

 

I was having this problem with all version of this conrtibution.

 

Its really weird because sometimes it does load and sometimes it does not :roll:

 

Im thinking of a redirection problem :?:

 

Any help would be appreciated :)

Link to comment
Share on other sites

I mean these lines, disrecard the lines above.

 

// BOF: WebMakers.com Added: Down for Maintenance

if (DOWN_FOR_MAINTENANCE=='true' and !strstr($PHP_SELF,DOWN_FOR_MAINTENANCE_FILENAME)) {

tep_redirect(tep_href_link(DOWN_FOR_MAINTENANCE_FILENAME));

}

// do not let people get to down for maintenance page if not turned on

if (DOWN_FOR_MAINTENANCE=='false' and strstr($PHP_SELF,DOWN_FOR_MAINTENANCE_FILENAME)) {

tep_redirect(tep_href_link(FILENAME_DEFAULT));

}

// EOF: WebMakers.com Added: Down for Maintenance

 

// BOF: Down for Maintenance except for admin ip

if (EXCLUDE_ADMIN_IP_FOR_MAINTENANCE != getenv('REMOTE_ADDR')){

if (DOWN_FOR_MAINTENANCE=='true' and !strstr($PHP_SELF,DOWN_FOR_MAINTENANCE_FILENAME)) { tep_redirect(tep_href_link(DOWN_FOR_MAINTENANCE_FILENAME)); }

}

// do not let people get to down for maintenance page if not turned on

if (DOWN_FOR_MAINTENANCE=='false' and strstr($PHP_SELF,DOWN_FOR_MAINTENANCE_FILENAME)) {

tep_redirect(tep_href_link(FILENAME_DEFAULT));

}

// EOF: WebMakers.com Added: Down for Maintenance

Link to comment
Share on other sites

I too had this problem. It loads consistantly now but I FTP'd the file again.

Ho people,

 

Im having a strange problem with this contribution. All is installed correctly on an MS1 release.

 

The strange thing is that sometimes it does nog load my site at all. It says page not found. Now after a night working on this problem i have narrowed it to this contribibution.

 

The lines that give these odd trouble are in application_top:

 

// BOF: WebMakers.com Added: Down for Maintenance

if (DOWN_FOR_MAINTENANCE=='true' {

tep_redirect(tep_href_link(DOWN_FOR_MAINTENANCE_FILENAME));

}

// do not let people get to down for maintenance page if not turned on

if (DOWN_FOR_MAINTENANCE=='false' {

tep_redirect(tep_href_link(FILENAME_DEFAULT));

}

// EOF: WebMakers.com Added: Down for Maintenance

 

// BOF: Down for Maintenance except for admin ip

if (EXCLUDE_ADMIN_IP_FOR_MAINTENANCE != getenv('REMOTE_ADDR')){

if (DOWN_FOR_MAINTENANCE=='true' { tep_redirect(tep_href_link(DOWN_FOR_MAINTENANCE_FILENAME)); }

}

// do not let people get to down for maintenance page if not turned on

if (DOWN_FOR_MAINTENANCE=='false' {

tep_redirect(tep_href_link(FILENAME_DEFAULT));

}

// EOF: WebMakers.com Added: Down for Maintenance

 

 

 

 

I was having this problem with all version of this conrtibution.

 

Its really weird because sometimes it does load and sometimes it does not :roll:

 

Im thinking of a redirection problem :?:

 

Any help would be appreciated :)

"It's a small world...

But I wouldn't want to paint it!"

Stephen Wright

Link to comment
Share on other sites

If you haven't already figured out this problem, it's happening because the stylesheet is referencing 'Thema". Just change the line in down_for_maintenance.php for the stylesheet to the correct path and it should work.

Hello,

 

I have got an error with the latest v1.1 - If I change to the maintenance modus, the stylesheets file won?t be loaded. The result of them is that the page is totally unformated.

 

What I have done wrong ?

 

 

Thanks

 

Andreas

"It's a small world...

But I wouldn't want to paint it!"

Stephen Wright

Link to comment
Share on other sites

I was wondering if it would be possible to allow 2 different IP addresses, not on the same LAN to have access. We have a unique situation that this would be very valuable to have this capability. Thanks! This is really a handy mod to have. Your efforts are greatly appreciated.

for users on a LAN ( special request from teksign ;) )

 

update 1.0.1b

 

insert in your database with your favorite tool like phpmyadmin or whatever you like...

INSERT INTO configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('', 'Down For Maintenance - Allowed IP Range', 'EXCLUDE_IP_RANGE_FROM_MAINTENANCE', '192.168.0', 'IP address Range (first 9) Allowed to access site during Down For Maintenance.<br>Only usefull for working on a LAN.', 1, 500, '2003-03-23 15:07:52', '0000-00-00 00:00:00', NULL, NULL);

==========================================================

 

Changes to /catalog/includes/application_top.php

 

Locate the lines:

// BOF: Down for Maintenance except for admin ip

if (EXCLUDE_ADMIN_IP_FOR_MAINTENANCE != getenv('REMOTE_ADDR')){ 

if (DOWN_FOR_MAINTENANCE=='true' and !strstr($PHP_SELF,DOWN_FOR_MAINTENANCE_FILENAME)) 

 { tep_redirect(tep_href_link(DOWN_FOR_MAINTENANCE_FILENAME)); }

}

 

Replace it with:

// BOF: Down for Maintenance except for admin ip

if (!defined("EXCLUDE_IP_RANGE_FROM_MAINTENANCE")) define('EXCLUDE_IP_RANGE_FROM_MAINTENANCE', substr($EXCLUDE_ADMIN_IP_FOR_MAINTENANCE,0,9));

if (EXCLUDE_ADMIN_IP_FOR_MAINTENANCE != getenv('REMOTE_ADDR') || EXCLUDE_IP_RANGE_FROM_MAINTENANCE != substr($REMOTE_ADDR,0,9)){

if (DOWN_FOR_MAINTENANCE=='true' and !strstr($PHP_SELF,DOWN_FOR_MAINTENANCE_FILENAME)) { tep_redirect(tep_href_link(DOWN_FOR_MAINTENANCE_FILENAME)); }

}

 

 

Changes to /catalog/includes/header.php

 

Locate the lines:

// this will let the admin know that the website is DOWN FOR MAINTENANCE to the public

 if ( (DOWN_FOR_MAINTENANCE == 'true') && (EXCLUDE_ADMIN_IP_FOR_MAINTENANCE == getenv('REMOTE_ADDR')) ) {

      tep_output_warning('NOTICE: the website is currently Down For Maintenance to the public');

 }

Replace it with:

 

// this will let the admin know that the website is DOWN FOR MAINTENANCE to the public

 if ( (DOWN_FOR_MAINTENANCE == 'true') && (EXCLUDE_ADMIN_IP_FOR_MAINTENANCE == getenv('REMOTE_ADDR')) || ( EXCLUDE_IP_RANGE_FROM_MAINTENANCE == substr($REMOTE_ADDR,0,9)) ) {

      tep_output_warning('NOTICE: the website is currently Down For Maintenance to the public');

 }

"It's a small world...

But I wouldn't want to paint it!"

Stephen Wright

Link to comment
Share on other sites

I changed from "' NOW '" to now() but isn't the time supposed to decriment on that last line on the Down for Maintenance? I set the duration in admin to 03:30 but it just stays at that. I hope I'm not missing something obvious but I could use a pointer here. Thanks.

I installed this on MS1 and it works fine except that the time doesn't show on the down page. I checked and the problem seems to be here:

 

tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . tep_db_input($configuration_value) . "', last_modified = '" . NOW . "' where configuration_id = '" . tep_db_input($cID) . "'");

 

I know I am going to feel stupid, but can someone tell me where the value of "NOW" is coming from? I can't find a function anywhere to match it. I thought I saw a thread on this but the crazy forum search won't let me search on any variation of "NOW" :(. Thanks.

 

David

 

Oppssss....

 

Sorry for that one

 

I got a different servertime then my timezone so i hacked it.

 

change

 

'" . NOW . "'

 

to

now()

 

without all quotes left & right

"It's a small world...

But I wouldn't want to paint it!"

Stephen Wright

Link to comment
Share on other sites

using 2.2 ms1 and installed down for mainteinece 1.1 and get the following error

 

TEXT_BEFORE_DOWN_FOR_MAINTENANCEWeb Site Will Be Down For Maintenance on June 17, 2003 from 1600 to 1800

and the code for the header is

 

// give the visitors a message that the website will be down at ... time

 if ( (WARN_BEFORE_DOWN_FOR_MAINTENANCE == 'true') && (DOWN_FOR_MAINTENANCE == 'false') ) {

      tep_output_warning(TEXT_BEFORE_DOWN_FOR_MAINTENANCE . PERIOD_BEFORE_DOWN_FOR_MAINTENANCE);

 }

// this will let the admin know that the website is DOWN FOR MAINTENANCE to the public

 if ( (DOWN_FOR_MAINTENANCE == 'true') && (EXCLUDE_ADMIN_IP_FOR_MAINTENANCE == getenv('REMOTE_ADDR')) ) {

      tep_output_warning(TEXT_ADMIN_DOWN_FOR_MAINTENANCE);

 }

// check session.auto_start is disabled

Link to comment
Share on other sites

I had the same problem then I looked and found I had left the last line of the .sql statement out when I copied it to do the query. This code (I think) derives from MYSQL.

HTH

Cheers!

 

using 2.2 ms1 and installed down for mainteinece 1.1 and get the following error

 

TEXT_BEFORE_DOWN_FOR_MAINTENANCEWeb Site Will Be Down For Maintenance on June 17, 2003 from 1600 to 1800

and the code for the header is

 

// give the visitors a message that the website will be down at ... time

 if ( (WARN_BEFORE_DOWN_FOR_MAINTENANCE == 'true') && (DOWN_FOR_MAINTENANCE == 'false') ) {

      tep_output_warning(TEXT_BEFORE_DOWN_FOR_MAINTENANCE . PERIOD_BEFORE_DOWN_FOR_MAINTENANCE);

 }

// this will let the admin know that the website is DOWN FOR MAINTENANCE to the public

 if ( (DOWN_FOR_MAINTENANCE == 'true') && (EXCLUDE_ADMIN_IP_FOR_MAINTENANCE == getenv('REMOTE_ADDR')) ) {

      tep_output_warning(TEXT_ADMIN_DOWN_FOR_MAINTENANCE);

 }

// check session.auto_start is disabled

"It's a small world...

But I wouldn't want to paint it!"

Stephen Wright

Link to comment
Share on other sites

ah found the problem what i did was change the TEXT_DOWN_FOR_MAINTENCE to PERIOD_DOWN_FOR_MAINTENCE

so now it reads as

 

// give the visitors a message that the website will be down at ... time 

 if ( (WARN_BEFORE_DOWN_FOR_MAINTENANCE == 'true') && (DOWN_FOR_MAINTENANCE == 'false') ) { 

      tep_output_warning(PERIOD_BEFORE_DOWN_FOR_MAINTENANCE . PERIOD_BEFORE_DOWN_FOR_MAINTENANCE); 

 } 

// this will let the admin know that the website is DOWN FOR MAINTENANCE to the public 

 if ( (DOWN_FOR_MAINTENANCE == 'true') && (EXCLUDE_ADMIN_IP_FOR_MAINTENANCE == getenv('REMOTE_ADDR')) ) { 

      tep_output_warning(TEXT_ADMIN_DOWN_FOR_MAINTENANCE); 

 } 

// check session.auto_start is disabled

 

 

using 2.2 ms1 and installed down for mainteinece 1.1 and get the following error

 

TEXT_BEFORE_DOWN_FOR_MAINTENANCEWeb Site Will Be Down For Maintenance on June 17, 2003 from 1600 to 1800

and the code for the header is  

 

// give the visitors a message that the website will be down at ... time

 if ( (WARN_BEFORE_DOWN_FOR_MAINTENANCE == 'true') && (DOWN_FOR_MAINTENANCE == 'false') ) {

      tep_output_warning(TEXT_BEFORE_DOWN_FOR_MAINTENANCE . PERIOD_BEFORE_DOWN_FOR_MAINTENANCE);

 }

// this will let the admin know that the website is DOWN FOR MAINTENANCE to the public

 if ( (DOWN_FOR_MAINTENANCE == 'true') && (EXCLUDE_ADMIN_IP_FOR_MAINTENANCE == getenv('REMOTE_ADDR')) ) {

      tep_output_warning(TEXT_ADMIN_DOWN_FOR_MAINTENANCE);

 }

// check session.auto_start is disabled

Link to comment
Share on other sites

disregard previous post

 

hmm seem to be missing some thing i uninstalled and reinstalled still same problem wondering if something missing from the sql file

Link to comment
Share on other sites

Well that define is the last line of the statement, for what that's worth. Good luck!

disregard previous post  

 

hmm seem to be missing some thing i uninstalled and reinstalled still same problem wondering if something missing from the sql file

"It's a small world...

But I wouldn't want to paint it!"

Stephen Wright

Link to comment
Share on other sites

i think i finally got it figured out was missing part of the sql file added the following to the database and seems to work

INSERT INTO `configuration` VALUES (2124, 'Display Text Down for Maintenance', 'TEXT_BEFORE_DOWN_FOR_MAINTENANCE', 'Web Site Will Be Down For Maintenance On-', 'Display Text Down For Maintenance', 16, 12, '2003-06-16 11:36:23', '0000-00-00 00:00:00', NULL, NULL);

 

not sure if this right but now displays correctly

Link to comment
Share on other sites

  • 1 month later...

:?

Got this mod installed in MS2 and everything is showing up but for some reason, I am unable to change any of the values in the Admin Config panel. All 14 of the settings show up (I added that last set of code by asiabound) but I can't change any of them. Hmmmm.

 

Anyone have any ideas?

 

Cheers,

Stretchr

"It's a small world...

But I wouldn't want to paint it!"

Stephen Wright

Link to comment
Share on other sites

MS2 sure has got people polishing up those coding skills again. Besides being an excellent project it is just great for getting those brain cells out of vacation mode. :D

ElLeonBlanco

 

"The man of genius makes no mistakes. His errors are volitional and are the portals of discovery." James Joyce (1882?1941)

Link to comment
Share on other sites

stretchr i havn't installed the down for maintenice mod yet for ms2 working on a few other things first before i try it but i do i post for what i did to get it to work

Link to comment
Share on other sites

stretchr i havn't installed the down for maintenice mod yet for ms2 working on a few other things first before i try it but i do i post for what i did to get it to work

 

Thanks. I get no errors at all. Probably something incredibly obvious but I just don't see it.

 

Cheers,

Stretchr

"It's a small world...

But I wouldn't want to paint it!"

Stephen Wright

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...