Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution Update] Down for Maintenance v1.1 for MS 2.2


Farrukh

Recommended Posts

Daniel,

 

yea,, thats the every thing I am looking for,, that way,, i dont have to keep updateing that area myself.

 

Would be most greatful if you get a chance to find the code, when you have a chance,,,

 

Regards

Tom

Link to comment
Share on other sites

Daniel,

 

yea,, thats the every thing I am looking for,, that way,, i dont have to keep updateing that area myself.

 

Would be most greatful if you get a chance to find the code, when you have a chance,,,

 

Regards

Tom

 

I know I got it from the old down for maint...link is here

http://www.oscommerce.com/community/contributions,1057

 

You may have to start searching through the code from one of the releases that state (exclued ip)..I will look through my code, but it has been about a year since I installed it... Let us know if you found the right code.

Link to comment
Share on other sites

Daniel,

1057, is the old one? that is the one I installed.

 

didnt realize there was more than one of them.

Whats the difference, if i may ask?

 

Regards

Tom

Link to comment
Share on other sites

  • 4 weeks later...

I am using an extremely popular (largest) ISP in the UK. This ISP forces the use of a proxy server.

 

Because the IP address that DFM uses, is actually the proxy's IP and not my real one, if I exluded myself from the down for maintenance page, I also excluded about 2 million other people as well.

 

If anyone else has the same problem, here is a little fix I came up with. I am not a PHP programmer by any means, so if there is a more elegent way of doing this - what the hell :D

 

in /includes/application_top.php:

 

find the line:

 

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

 

and replace with:

 

$proxy = getenv('HTTP_X_FORWARDED_FOR');
$real_ip = (isset($proxy) && $proxy != "")?getenv('HTTP_X_FORWARDED_FOR'):getenv('REMOTE_ADDR');
if (EXCLUDE_ADMIN_IP_FOR_MAINTENANCE != $real_ip){

 

Now you can set your real IP address in the control panel and tada - problem solved.

OSC Image Magic

On-the-fly thumbnails, watermarks and image processing

Link to comment
Share on other sites

  • 1 month later...

I've just tried to install this contrib. Putting all the manual changes in the file was obviously not a big problem, but when I tried to load the down_for_maintenance_v1.1_english.sql file via phpMyAdmin, I get the following error:

Error

SQL-query :  

INSERT INTO configuration_group( configuration_group_id, configuration_group_title, configuration_group_description, sort_order, visible ) 
VALUES (
'16', 'Site Maintenance', 'Site Maintenance Options', '16', '1'
) 

MySQL said: 


#1062 - Duplicate entry '16' for key 1

 

I'm open for any suggestion how to solve this.

 

Thanks,

RojanUK

Link to comment
Share on other sites

I've just tried to install this contrib. Putting all the manual changes in the file was obviously not a big problem, but when I tried to load the down_for_maintenance_v1.1_english.sql file via phpMyAdmin, I get the following error:

Error

SQL-query :  

INSERT INTO configuration_group( configuration_group_id, configuration_group_title, configuration_group_description, sort_order, visible ) 
VALUES (
'16', 'Site Maintenance', 'Site Maintenance Options', '16', '1'
) 

MySQL said: 
#1062 - Duplicate entry '16' for key 1

 

I'm open for any suggestion how to solve this.

 

Thanks,

 

 

It may be because you already have someting in your configuration table with "16" change the "16" to something else like "55" or just look in your config table and see which is the next available number

Link to comment
Share on other sites

It may be because you already have someting in your configuration table with "16" change the "16" to something else like "55" or just look in your config table and see which is the next available number

I didn't know how to change it either, but I just took a chance on my test site and it worked like a charm. Thanks!

RojanUK

Link to comment
Share on other sites

  • 6 months later...

I installed Down for Maintenance v2.1 . everything shows up in the admin control panel. I turn everything to true and set my ip to what my ip is but when I turn on maintenance it does not display that the site is down for maintenance at all? I have no idea if this is because my IP address is one that changes all the time and not static or if it is a problem with code some where. I've had others test it that are not on the same ISP and the site comes up normally for them when i have maintenance turned on. Anyone who could help me with this I would greatly appreciate it.

 

Andy

Link to comment
Share on other sites

  • 1 month later...
Right, very useful idea! Thanks!

but... ;-)

> Oh one more thing: in header.php it says tep_output_warning( twice, this gives me an error message on 2.2 ms2. I think it should say tep_output_string( ,

> at least it works for me that way

Okay, I notice this think me too (replace tep_output_warning with tep_output_string) but tep_output_string returns nothing at all!

This will return null chain:

tep_output_string(TEXT_BEFORE_DOWN_FOR_MAINTENANCE . PERIOD_BEFORE_DOWN_FOR_MAINTENANCE);

and this will work well:

echo TEXT_BEFORE_DOWN_FOR_MAINTENANCE . PERIOD_BEFORE_DOWN_FOR_MAINTENANCE;

I think it's not very "osCommerce's way" to do thinks, but I don't understand why tep_output_string doesn't work with me ?

The strings are :

TEXT_BEFORE_DOWN_FOR_MAINTENANCE = "AVERTISSEMENT : Le site sera ferm? pour maintenance dans la p?riode du "

PERIOD_BEFORE_DOWN_FOR_MAINTENANCE = "28/07/2003 01h -> 02h"

If anybody have any explication, it'll be appreciated :-)

(sorry for my bad english...)

 

The reason it seems is that the code was altered from tep_output_warning to another format. I have the solution for MS2 and it works with all contribs installed. Use the code below and it should solve your issues and get the warning working as they were meant to. Works flawlessly on my site........:)

 

 

// give the visitors a message that the website will be down at ... time
 if ( (WARN_BEFORE_DOWN_FOR_MAINTENANCE == 'true') && (DOWN_FOR_MAINTENANCE == 'false') ) {
   $messageStack->add('header', TEXT_BEFORE_DOWN_FOR_MAINTENANCE . PERIOD_BEFORE_DOWN_FOR_MAINTENANCE, 'warning');
 }


// 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')) ) {
   $messageStack->add('header', TEXT_ADMIN_DOWN_FOR_MAINTENANCE, 'warning');
 }


// check session.auto_start is disabled

 

Greets

 

Chris

Link to comment
Share on other sites

  • 1 month later...

i get this error after install down for maintenance.. anyone can help..?? plz

 

Fatal error: Cannot redeclare tep_db_connect() (previously declared in C:\Inetpub\wwwroot\shop\includes\functions\database.php:13) in C:\Inetpub\wwwroot\shop\includes\functions\database.php on line 25

Link to comment
Share on other sites

  • 2 months later...
It may be because you already have someting in your configuration table with "16" change the "16" to something else like "55" or just look in your config table and see which is the next available number

I was experiencing the same problem.

Found a solution to this as 16 was already being used on my site.

 

Change 16 to 17 or 18 on the entire SQL file and then run the querry and all should work just fine.

 

Good Luck.

 

Kunal

Link to comment
Share on other sites

  • 2 weeks later...

SQL query:

 

# NEW RECORDS FOR: DOWN FOR MAINTENANCE v1.1

# Created by: fram [email protected]

# Updated by Farrukh

# Donald Harriman

# Change the value of Site Maintenance to 16 or anything greater than 15. I have already set it to 16

INSERT INTO configuration_group( configuration_group_id, configuration_group_title, configuration_group_description, sort_order, visible )

VALUES (

'16', 'Site Maintenance', 'Site Maintenance Options', '16', '1'

);

 

MySQL said: Documentation

#1062 - Duplicate entry '16' for key 1

 

i got this MySQL error than i tried to update my datebase

 

maybe someone can help me with this ?

thank you

Link to comment
Share on other sites

  • 6 months later...

Try to put my question in the right fora:

 

Hi

I runs perfect, except when I choose

NOTICE PUBLIC Before going Down for Maintenance ON/OFF

 

The minut it's ON - the index page is blank?? All other things works well.

 

The page is also blank if I fill in my IP address. (tried an earlier solution from this fora - nope did not work in my case)

 

The only thing left in the browser is the hostname/down_for_maintenance.php link with a blamk page!!!

 

Has anybody a solution?? Please

Something MUST be missing in the files?

 

 

Helle :-)

 

Very happy for this contrib, just need to figure this out?

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...