Jump to content
Sign in to follow this  
Farrukh

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

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


no bugs in my stuff,,, just random features ;)

Share this post


Link to post
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.

Share this post


Link to post
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


no bugs in my stuff,,, just random features ;)

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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,


RojanUK

Share this post


Link to post
Share on other sites

Bump.

 

Does anybody know a solution for this problem?

 

Thanks,


RojanUK

Share this post


Link to post
Share on other sites

This is aparently a difficult problem, but I'm still hoping that somebody might have a solution for me.


RojanUK

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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 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

Share this post


Link to post
Share on other sites

SQL query:

 

# NEW RECORDS FOR: DOWN FOR MAINTENANCE v1.1

# Created by: fram mattioli@free.fr

# 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

Share this post


Link to post
Share on other sites

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?

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
Sign in to follow this  

×