Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Down for Maintenance v1.0


Ajeh

Recommended Posts

ok been mucking with the down for maintence

 

followed the instructions for version 1.1

 

for the /admin/configuration.php for mine its on line 15-30

 $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');



 if (tep_not_null($action)) {

  switch ($HTTP_GET_VARS['action']) {

     case 'save':

       $configuration_value = tep_db_prepare_input($HTTP_POST_VARS['configuration_value']);

       $cID = tep_db_prepare_input($HTTP_GET_VARS['cID']);



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

       // set the WARN_BEFORE_DOWN_FOR_MAINTENANCE to false if DOWN_FOR_MAINTENANCE = true

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

       tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = 'false', last_modified = '" . NOW . "' where configuration_key = 'WARN_BEFORE_DOWN_FOR_MAINTENANCE'"); }

       tep_redirect(tep_href_link(FILENAME_CONFIGURATION, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $cID));

       break;

   }

 }

 

I have not got the notice to public to work yet getting error on line 40 but will work on that tommorow

 

you can see here http://www.myweb-host2.com/catalog/down_fo...maintenance.php

Link to comment
Share on other sites

  • Replies 72
  • Created
  • Last Reply

Top Posters In This Topic

ok been mucking with the down for maintence

 

followed the instructions for version 1.1...

 

That fixed it, thanks. What was the code that was preventing changes from being saved?

 

Cheers,

Stretchr

"It's a small world...

But I wouldn't want to paint it!"

Stephen Wright

Link to comment
Share on other sites

the original code for the /admin/configuration

 

$action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');



 if (tep_not_null($action)) {

   switch ($action) {

     case 'save':

       $configuration_value = tep_db_prepare_input($HTTP_POST_VARS['configuration_value']);

       $cID = tep_db_prepare_input($HTTP_GET_VARS['cID']);



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



       tep_redirect(tep_href_link(FILENAME_CONFIGURATION, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $cID));

       break;

   }

 }

 

which is different from ms1 i use the code from that i posted before if copied the code directly for the readme then it will not work

 

***NOTE*** i have not got the notice to public to work on mine i get the error in the header.php on line 40 wihci is a database connection not sure why its not pulling the data from the database

Link to comment
Share on other sites

the original code for the /admin/configuration

 

$action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');



 if (tep_not_null($action)) {

   switch ($action) {

     case 'save':

       $configuration_value = tep_db_prepare_input($HTTP_POST_VARS['configuration_value']);

       $cID = tep_db_prepare_input($HTTP_GET_VARS['cID']);



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



       tep_redirect(tep_href_link(FILENAME_CONFIGURATION, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $cID));

       break;

   }

 }

 

which is different from ms1  i use the code from that i posted before if copied the code directly for the readme then it will not work  

 

***NOTE*** i have not got the notice to public to work on mine i get the error in the header.php on line 40 wihci is a database connection not sure why its not pulling the data from the database

 

I get the same error and also get one if I put an IP address into the Admin IP field.

 

Cheers,

Stretchr

"It's a small world...

But I wouldn't want to paint it!"

Stephen Wright

Link to comment
Share on other sites

Trying to install 1.0 (or 1.1) on MS1, and already having an issue. In my

'includes/header.php' file, i cannot locate this line:

 

// check session.auto_start is disabled

 

I checked my original install, and still can't find it, so i don't think I have modified that file yet.

 

Can anyone else point me in the right direction? Thanks.

 

t.

Link to comment
Share on other sites

Trying to install 1.0 (or 1.1) on MS1, and already having an issue. In my

'includes/header.php' file, i cannot locate this line:

 

// check session.auto_start is disabled

 

I checked my original install, and still can't find it, so i don't think I have modified that file yet.

 

Can anyone else point me in the right direction? Thanks.

 

t.

Link to comment
Share on other sites

  • 1 month later...

I installed this version rather than the updated one, as I have MS1, not MS2.

 

I've only installed it in my test store but everything seems to be working OK except I haven't tried the admin IP thing yet as I have a dynamic IP, not a static one.

 

The only thing that stays the same are the first two sets of numbers eg it could be 12.345.67.890 or 12.345.42.35

 

I don't want to just put in 12.345 as everyone with those numbera t the beginning could get in.

 

Any ideas?

Link to comment
Share on other sites

  • 4 months later...

I am installing v1.2 on ms2 and getting the error

 

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

 

 

This has been previously posted and the solution was to change the 16 's to 700's.

 

I tried this but it does not work.

 

Could anyone throw some light on this, before I end up with grey hair.

Link to comment
Share on other sites

@laurie

 

Ich had the same problem.

 

You must change "all" value 16 to the new value (i did set 18 )

 

Just load the sql in your editor , i use homesite, and do a

 

search for value 16

 

and replace with value 18

 

 

It did work for me

 

sincerely

 

roberto

Link to comment
Share on other sites

  • 1 year later...
  • 3 months later...

I've installed Down for Maintenance v2.1

 

It has code in the catalog/down_for_maintenance.php file that refers to the contribution Header Tag Controller that I don't have installed. My stylesheet design is not showing up though all else works fine with it. Can anyone post the code I need t ochange to make it refer to my stylesheet and not the header tag controller con?

 

I tried just taking out the other con. info but that didn't work.

Here's the code just up to the body.

 

<?php
/*
 Created by: Linda McGrath [email protected]

 Update by: fram 05-05-2003

 down_for_maintenance.php v1.1

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 require('includes/application_top.php');

 require(DIR_WS_LANGUAGES . $language . '/' . DOWN_FOR_MAINTENANCE_FILENAME);

 $breadcrumb->add(NAVBAR_TITLE, tep_href_link(DOWN_FOR_MAINTENANCE_FILENAME));
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<?php
// BOF: WebMakers.com Changed: Header Tag Controller v1.0
// Replaced by header_tags.php
if ( file_exists(DIR_WS_INCLUDES . 'header_tags.php') ) {
 require(DIR_WS_INCLUDES . 'header_tags.php');
} else {
?> 
 <title><?php echo TITLE ?></title>
<?php
}
// EOF: WebMakers.com Changed: Header Tag Controller v1.0
?>
<base href="<?php echo (getenv('HTTPS') == 'on' ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="<? echo THEMA_STYLE;?>">
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">

<?php
// WebMakers.com Added: Down for Maintenance
// Hide header if not to show
if (DOWN_FOR_MAINTENANCE_HEADER_OFF =='false') {
?>
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->
<?php
}
?>
<!-- body //-->

 

Thank you,

Karen

Link to comment
Share on other sites

Okay I played around with the code and fixed it.

This is what I did in case anyone else has the same problem of your stylesheet design not showing up with version 2.1

 

I changed this

<?php
// BOF: WebMakers.com Changed: Header Tag Controller v1.0
// Replaced by header_tags.php
if ( file_exists(DIR_WS_INCLUDES . 'header_tags.php') ) {
require(DIR_WS_INCLUDES . 'header_tags.php');
} else {
?>
<title><?php echo TITLE ?></title>
<?php
}
// EOF: WebMakers.com Changed: Header Tag Controller v1.0
?>

 

To just this

<title><?php echo TITLE ?></title>

 

And changed this

href="<? echo THEMA_STYLE;?>">

 

to this

href="stylesheet.css">

 

Karen

Link to comment
Share on other sites

  • 2 weeks later...

I've installed this, and all the options work except when I change the NOTICE option is used.

 

Fatal error: Call to undefined function: tep_output_warning() in /homepages/2/d134230169/htdocs/GForce/shopping/includes/header.php on line 42

 

 

// 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);
 }

 

 

I have the TEXT_BEFORE_DOWN_FOR_MAINTENANCE . PERIOD_BEFORE_DOWN_FOR_MAINTENANCE defines in the language file so I'm not sure why it is call it an undefined function

 

Any ideas? .......heavily modified shop ms2

 

Chris

Link to comment
Share on other sites

I've installed this, and all the options work except when I change the NOTICE option is used.

 

Fatal error: Call to undefined function: tep_output_warning() in /homepages/2/d134230169/htdocs/GForce/shopping/includes/header.php on line 42

// 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);
 }

I have the TEXT_BEFORE_DOWN_FOR_MAINTENANCE . PERIOD_BEFORE_DOWN_FOR_MAINTENANCE defines in the language file so I'm not sure why it is call it an undefined function

 

Any ideas? .......heavily modified shop ms2

 

Chris

 

 

:-"

 

Can't get past this error......

Link to comment
Share on other sites

:-"

 

Can't get past this error......

 

I am now past this error by doing the following fix

 

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

 

Enjoy and Greets

 

Chris

Link to comment
Share on other sites

  • 1 month later...

Hi,

 

The IP address thing still doesnt work for me, I can't get in to my site when I swhich this on, it stays on the Down for Maintenance page, when I already logged in to the admin panel, and when I swhich it back to off, the front page is back to the norm.

 

Michael

Michael

Link to comment
Share on other sites

  • 1 year later...

I know this is a old contrib, but i is still the only one i have found, and it works fine for me..

 

But... :blush:

 

Can some one please tell me how to make the "Down For Maintenance (exclude this IP-Address)"

work whit ip listet whit a comma like in the "Send Extra Order Emails To" from the standart osc options..

 

I havent got the skills to do it...

 

BlackCap...

(ps.. sorry for my bad spelling.. if it is any consolation i cant spell in my own language) :-"

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