• [Mod] Maintenance Page - Set from Admin Control panel 5 0 5 1
Currently:  

Author Topic: [Mod] Maintenance Page - Set from Admin Control panel  (Read 96953 times)

0 Members and 1 Guest are viewing this topic.

Offline ch€ri{Bi}²

  • Sr. Member
  • ****
  • Posts: 315
  • A PRoBLeM wIthOUt SoLuTioN Is NoT rEAllY a PRoBLeM
    • View Profile
    • Pat's Gallery
Re: [Mod] Maintenance Page - Set from Admin Control panel
« Reply #30 on: November 14, 2005, 10:48:39 AM »
it work on all pages but not on the index.php

 :?: what happens if you make the modification on the two files? ( :arrow: you can try to write the same code on index.php and page_header.php  :wink:)
ch€ri{Bi}²


Offline JensF

  • Addicted member
  • ******
  • Posts: 1.028
    • View Profile
    • http://www.terraristik-galerie.de
Re: [Mod] Maintenance Page - Set from Admin Control panel
« Reply #31 on: November 14, 2005, 03:19:52 PM »
Hi,

i have do it in both files but no effect....
Mit freundlichem Gruß
Jens Funk



-> Sorry for my bad English <-

Offline Flo2005

  • Full Member
  • ***
  • Posts: 237
  • Copy & Paste Profi :)
    • View Profile
    • snuup.de! - Bilder - Sounds - Videos - fun4FREE!
Re: [Mod] Maintenance Page - Set from Admin Control panel
« Reply #32 on: December 26, 2005, 03:26:03 PM »
When I´ll use this MOD with my backup-tool (MySqlDumper), the site should close automatically.

What SQL command I have to use to switch the site on/off  :?:

Project offline

Offline TheOracle

  • Hero Member
  • *****
  • Posts: 875
    • View Profile
Re: [Mod] Maintenance Page - Set from Admin Control panel
« Reply #33 on: December 26, 2005, 05:18:57 PM »
Quote

What SQL command I have to use to switch the site on/off


In your SQL's settings table, you can manually switch the value to the previous / next one to put your site under maintenance if you do not see it under your ACP - > Settings page. ;)

Offline Flo2005

  • Full Member
  • ***
  • Posts: 237
  • Copy & Paste Profi :)
    • View Profile
    • snuup.de! - Bilder - Sounds - Videos - fun4FREE!
Re: [Mod] Maintenance Page - Set from Admin Control panel
« Reply #34 on: December 26, 2005, 05:46:47 PM »
THX I know this one.

This part should work automatic:

Before database-backup runs, the script should set maintenance page on (command before dump).
When backup is complete, the script should set maintenance page off (command after dump).

Now I search for the SQL command which I have to add to the script.

Like PphBB -> disable board
Code: [Select]
UPDATE `phpbb_config` set config_value=1 where config_name='board_disable'
Something like this...

Project offline

Offline TheOracle

  • Hero Member
  • *****
  • Posts: 875
    • View Profile
Re: [Mod] Maintenance Page - Set from Admin Control panel
« Reply #35 on: December 26, 2005, 06:23:35 PM »
Ah ! now I know what you're looking for to do.

Very well, create a PHP filename called : maintenance_update.php

and add this little content in :

Code: [Select]

<?php

define
('GET_CACHES'1);
define('ROOT_PATH''./');
include(
ROOT_PATH.'global.php');
require(
ROOT_PATH.'includes/sessions.php');
$user_access get_permission();

if (
$user_info['user_level'] == ADMIN) {

$sql "

UPDATE "
.SETTINGS_TABLE."
SET setting_value = '1'
WHERE setting_name = 'maintenance'

"
;

$result $site_db->query($sql);

if (
$result) {
echo 
"Field Updated Successfully.";
} else {
echo 
"Failed to update field.";
###### End of if statement.
} else {
show_error_page($lang['no_permission']);
###### End of if statement.
?>



Then, upload the PHP file to your 4images's root folder and execute the file.

Note: Make sure you login as ADMIN from your album before executing this file (for security reasons). ;)

Offline TheOracle

  • Hero Member
  • *****
  • Posts: 875
    • View Profile
Re: [Mod] Maintenance Page - Set from Admin Control panel
« Reply #36 on: December 26, 2005, 06:26:54 PM »
Update: I have just modified my post above due to a slight mistake.

Offline Flo2005

  • Full Member
  • ***
  • Posts: 237
  • Copy & Paste Profi :)
    • View Profile
    • snuup.de! - Bilder - Sounds - Videos - fun4FREE!
Re: [Mod] Maintenance Page - Set from Admin Control panel
« Reply #37 on: December 26, 2005, 06:34:46 PM »
I think that´s more than I need :wink: I´ll try it!

Thanks!

Edit: It works :!:

I´ve changed the code above

To turn maintenance on
Code: [Select]
UPDATE `4images_settings` set setting_value=1 where setting_name='maintenance'
To turn maintenance off
Code: [Select]
UPDATE `4images_settings` set setting_value=0 where setting_name='maintenance'
Now, my site is during the backup under construction and after the backup it´s available.

Project offline

Offline TheOracle

  • Hero Member
  • *****
  • Posts: 875
    • View Profile
Re: [Mod] Maintenance Page - Set from Admin Control panel
« Reply #38 on: December 26, 2005, 08:08:19 PM »
To turn off, don't you mean :

Code: [Select]

UPDATE `4images_settings` set setting_value=0 where setting_name='maintenance'


? ;)

Offline Flo2005

  • Full Member
  • ***
  • Posts: 237
  • Copy & Paste Profi :)
    • View Profile
    • snuup.de! - Bilder - Sounds - Videos - fun4FREE!
Re: [Mod] Maintenance Page - Set from Admin Control panel
« Reply #39 on: December 26, 2005, 08:40:20 PM »
 8O oops - You´ve got it! :)

I´ve corrected my post above...

Project offline

Offline TheOracle

  • Hero Member
  • *****
  • Posts: 875
    • View Profile
Re: [Mod] Maintenance Page - Set from Admin Control panel
« Reply #40 on: December 26, 2005, 08:47:31 PM »
Excellent. Now, it's clear. Thanks for your inputs. 8)

Offline graficalicus

  • Full Member
  • ***
  • Posts: 235
    • View Profile
Re: [Mod] Maintenance Page - Set from Admin Control panel
« Reply #41 on: June 19, 2006, 05:27:22 PM »
works well in IE, but opens a local page in Firefox -

does anyone know why?

thanks in advance -

Offline scubaj

  • Pre-Newbie
  • Posts: 4
    • View Profile
Re: [Mod] Maintenance Page - Set from Admin Control panel
« Reply #42 on: February 02, 2007, 07:12:39 AM »
Great MOD.  Only one potential problem.....  If I logout as admin or close the browser by mistake without turning the maintenance page back off I'm stuck!  Would be great if there was an admin login box that could be inserted on the "Closed for Maintenance" page so I can get back in. Anyone have any ideas on this?

Offline piyda

  • Pre-Newbie
  • Posts: 9
    • View Profile
Re: [Mod] Maintenance Page - Set from Admin Control panel
« Reply #43 on: June 04, 2007, 11:14:54 AM »
Download links is not working...

Please help! I really need this mod!

Thanks!
« Last Edit: June 04, 2007, 11:59:59 AM by piyda »

manurom

  • Guest
Re: [Mod] Maintenance Page - Set from Admin Control panel
« Reply #44 on: June 04, 2007, 01:21:25 PM »
Hello;
the file seems to be here: install_MainP.zip