4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: Fugaziman on May 14, 2003, 05:49:38 AM

Title: [Mod] Maintenance Page - Set from Admin Control panel
Post by: Fugaziman on May 14, 2003, 05:49:38 AM
This Mod allows you to redirect you site to a "Closed for Maintenance" page from your Admin Control panel.

Database Row value added:
Settings Table

Pages changed:
- admin/settings.php
- lang/your_language/admin.php
- Index.php

New files:
 - templates/your_template/maintenance.html

Time to complete:
15-20 minutes

 :arrow: Database update:
Download this file
http://www.1024x768wallpapers.com/Code_help_files/install_MainP.zip

UnZip it and copy it into your root directory then run it through your browser
Quote
http://www.yoursite.com/install_MainP.php
This install_MainP file just inserts another row to your settings table the name "maintenance" and a value of "0". It does not change the table in any way.

 :arrow: Edit admin/settings.php
Find
  show_setting_row("gz_compress_level");

Add after
Code: [Select]
 show_setting_row("maintenance", "radio"); //Mod of maintenance page  
 :arrow: Edit lang/your_langage/admin.php
Find:
$setting['gz_compress_level'] = "GZip level of compression<br /><span class=\"smalltext\">0-9, 0=none, 9=max</span>";

Add After
Code: [Select]
$setting['maintenance'] = "Turn maintenance page ON"; //Mod of maintenance page
 :arrow: Now you have a choice....
If you want this to work when someone first comes to your site then
Edit Index.php
Find
$user_access = get_permission();

Add After
Code: [Select]
//-----------------------------------------------------
//--- Maintenance      --------------------------------
//-----------------------------------------------------
$maintenance = $config['maintenance'];
$redirect_url = TEMPLATE_PATH."/maintenance.html";
if ($maintenance){
  header("Location: ".$site_sess->url($redirect_url, "&"));
  exit;
}

//-----------------------------------------------------
//--- End of Maintenance      -------------------------
//-----------------------------------------------------

or if you want it to work for every page then ..
Edit page_header.php
Find
Code: [Select]
if (!defined('ROOT_PATH')) {
  die("Security violation");
}
and insert the code above just below it.

 :arrow: Create new file in your templates/Your_template/maintenance.html folder.

Add this html...
Code: [Select]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Site closed for Maintenance</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#FFFFFF">

<table width="100%" border="0" cellspacing="0" cellpadding="0" class="tablebgcolor">

<tr>
<td align="center">  
<!-- add your maintenance page content here -->
Sorry but the site is closed for maintenance
<!-- End of maintenance page content here   -->
</td>
</tr>
</table>
<br>

</body>
</html>
:arrow: Change the content of this HTML page to suite your sites needs.

 :arrow: Now you can test the Mod.
- Log into your Admin Panel
- Click on the "Settings" Link on the left side menu
- At the bottom of the General section you will see an extra Radio Button field "Turn maintenance page ON"
- Select Yes to turn Maintenance page on
- Try going to your home page

That's it. Nothing to fancy but it's a lot better than nothing

Fugaziman 8)
Title: [Mod] Maintenance Page - Set from Admin Control panel
Post by: lakeside on May 14, 2003, 06:26:53 AM
I get the following error when I try this:
Warning: Cannot add header information - headers already sent by (output started at /home/xx/xxxxx/gallery/includes/stats.php:83) in /home/xx/xxxxx/gallery/index.php on line 41

Also Im wondering if we can't beef it up a bit, and say put it in the pageheader.php so that it can be used no matter what page a person is on.  That way it wont just block new users, but any user on the site.
Title: [Mod] Maintenance Page - Set from Admin Control panel
Post by: V@no on May 14, 2003, 12:32:39 PM
very nice!
didnt try it myself yet, but here what I can see and suggest:
1. the code that u insert into /index.php u might want insert into /includes/page_header.php because this will redirect to the mainteinance page if u try open any pages at your 4images site, not only indes.php.
2. the code
Code: [Select]
$redirect_url = TEMPLATE_PATH."/".$template."maintenance.html";should be without $template because TEMPLATE_PATH already has full path to your current template ;) so it should be like this:
Code: [Select]
$redirect_url = TEMPLATE_PATH."/maintenance.html";

Quote from: lakeside
Also Im wondering if we can't beef it up a bit, and say put it in the pageheader.php so that it can be used no matter what page a person is on. That way it wont just block new users, but any user on the site.
this sounds just what PHP SAFE MODE does...it let u work, but hit u in the head when u dont expect it...;) I understand the "closed for mainteince" as prevent visitors see error messages that could accur while u edit your code...and it can prevent fatal database damage (yes, this could happend...)

P.S. If this feature was included into original 4images, my site probably would be in the "maintence" status 24/7 ....hehe :lol:
Title: [Mod] Maintenance Page - Set from Admin Control panel
Post by: HelpMeNow on May 14, 2003, 03:36:00 PM
Fugaziman,

Great MOD.

What are the changes made to the database when you run the content of the zipped file with this mod?

...and if you have more than one 4images installed on your server, will this only effect the database tables for that particular 4images instant that you are working on?

Thanks
Title: [Mod] Maintenance Page - Set from Admin Control panel
Post by: Fugaziman on May 14, 2003, 03:52:09 PM
Quote from: HelpMeNow
Fugaziman,

Great MOD.

What are the changes made to the database when you run the content of the zipped file with this mod?

...and if you have more than one 4images installed on your server, will this only effect the database tables for that particular 4images instant that you are working on?

Thanks


HelpMeNow:
Have amended my first post to include information about what gets updated in the database. Basically the tables do not get altered just another row inserted into the settings table.
As far as multiple installs of 4 images it will only effect the installation that you set the Maintenance flag on from that installations Admin Control Panel.

Vano:
Quote
should be without $template because TEMPLATE_PATH already has full path to your current template  so it should be like this:


Thanks V@no I have amended by original post. I think I'm slowly getting the idea of this PHP stuff  :lol:

Fugaziman
Title: [Mod] Maintenance Page - Set from Admin Control panel
Post by: Fugaziman on May 14, 2003, 03:57:30 PM
Quote from: lakeside
I get the following error when I try this:
Warning: Cannot add header information - headers already sent by (output started at /home/xx/xxxxx/gallery/includes/stats.php:83) in /home/xx/xxxxx/gallery/index.php on line 41


Looks like you have another mod in your stats page that's effecting this one. Try editing the index.php file again and moving the Maintenance mod further up the page.
Add it somewhere between...
Code: [Select]
include(ROOT_PATH.'global.php');
and
Code: [Select]
include(ROOT_PATH.'includes/stats.php');


Quote from: lakeside
Also Im wondering if we can't beef it up a bit, and say put it in the pageheader.php so that it can be used no matter what page a person is on. That way it wont just block new users, but any user on the site.


Yes this is just as easy.
Add the
Code: [Select]
//-----------------------------------------------------
//--- Maintenance      --------------------------------
//-----------------------------------------------------
$maintenance = $config['maintenance'];
$redirect_url = TEMPLATE_PATH."/".$template."maintenance.html";
echo redirect_url;
if ($maintenance){
 echo $maintenance;
  header("Location: ".$site_sess->url($redirect_url, "&"));
  exit;
}

//-----------------------------------------------------
//--- End of Maintenance      -------------------------
//-----------------------------------------------------

to your the page_header.php
just after
 
Code: [Select]
(!defined('ROOT_PATH')) {
  die("Security violation");
}


Instead of your index.php


Hope that helps  :wink:
Fugaziman
Title: Allow Admin Access
Post by: Fugaziman on May 14, 2003, 04:26:18 PM
Just had a quick thought....

If you still want to test your changes with the Maintenance flag set then you can use this code in your page_header.php or Index.php files instead...

Code: [Select]
//-----------------------------------------------------
//--- Maintenance      --------------------------------
//-----------------------------------------------------

$maintenance = $config['maintenance'];
$redirect_url = TEMPLATE_PATH."/maintenance.html";
if ($maintenance && $user_info['user_level'] != ADMIN){
  header("Location: ".$site_sess->url($redirect_url, "&"));
  exit;
}
//-----------------------------------------------------
//--- End of Maintenance      -------------------------
//-----------------------------------------------------


So if you are logged in as Admin you can still get to your pages to make sure every thing is working okay but all others get the maintenance page.

That makes it a little bit more useful  :lol:
Title: [Mod] Maintenance Page - Set from Admin Control panel
Post by: lakeside on May 14, 2003, 05:57:35 PM
Very nice, works perfectly now.  Just what I needed with all the tweaking I like to do, and with how slow our ftp server is.

Thanks,
Title: [Mod] Maintenance Page - Set from Admin Control panel
Post by: lutz on June 12, 2003, 10:35:42 AM
hi,
i see, the link is down, or rather redirected to the main page... :cry:
any reasons for that?
Title: [Mod] Maintenance Page - Set from Admin Control panel
Post by: Fugaziman on June 12, 2003, 03:04:06 PM
Quote from: lutz
hi,
i see, the link is down, or rather redirected to the main page... :cry:
any reasons for that?


Not sure what you mean  :?:
Fugaziman  :oops:
Title: [Mod] Maintenance Page - Set from Admin Control panel
Post by: V@no on June 12, 2003, 03:11:11 PM
Quote from: lutz
hi,
i see, the link is down, or rather redirected to the main page... :cry:
any reasons for that?
try now. Fugaziman has new domain, that's all.
Title: Re: [Mod] Maintenance Page - Set from Admin Control panel
Post by: Nasser on March 24, 2005, 03:32:06 AM

 :arrow: Database update:
Download this file
http://www.1024x768wallpapers.com/Code_help_files/install_MainP.zip


I need this mod , but the link of Database update file download is not working, can anyone help please?
regards,
Nasser
Title: Re: [Mod] Maintenance Page - Set from Admin Control panel
Post by: Nasser on March 30, 2005, 03:53:24 PM
can any one help in that please?
Title: Re: [Mod] Maintenance Page - Set from Admin Control panel
Post by: JensF on March 30, 2005, 04:39:48 PM
Hi,

open

install_MainP.php

and find

Code: [Select]
<form action="install_mainp.php" name="form" method="post">
replace it with

Code: [Select]
<form action="install_MainP.php" name="form" method="post">

Save, Upload and Test It.....
Title: Re: [Mod] Maintenance Page - Set from Admin Control panel
Post by: Nasser on March 30, 2005, 07:00:04 PM
the downloading link is not working dear  :(
Title: Re: [Mod] Maintenance Page - Set from Admin Control panel
Post by: JensF on March 30, 2005, 07:05:25 PM
Ups,

do this

**KLICK** (http://www.terraristik-galerie.de/sonstiges/install_MainP.zip)
Title: Re: [Mod] Maintenance Page - Set from Admin Control panel
Post by: Nasser on March 31, 2005, 09:38:26 AM
Ups,

do this

**KLICK** (http://www.terraristik-galerie.de/sonstiges/install_MainP.zip)

thank you very much that was helpful realy

Hi,

open

install_MainP.php

and find

Code: [Select]
<form action="install_mainp.php" name="form" method="post">
replace it with

Code: [Select]
<form action="install_MainP.php" name="form" method="post">

Save, Upload and Test It.....

you've helped me so much here also
thanks alot
Title: Re: [Mod] Maintenance Page - Set from Admin Control panel
Post by: blitzy on March 31, 2005, 11:45:23 PM
Has anyone tested this mod with 1.7.1?
Title: Re: [Mod] Maintenance Page - Set from Admin Control panel
Post by: Josef Florian on May 17, 2005, 09:24:38 PM
Has anyone tested this mod with 1.7.1?

This Mod works perfectly with Version 1.7.1!  :wink:
Title: Re: [Mod] Maintenance Page - Set from Admin Control panel
Post by: ascanio on June 04, 2005, 07:38:47 PM
I got this error Warning: Cannot modify header information - headers already sent by (output started at /home/bhfqyruw/public_html/encuestas.php:166) in /home/bhfqyruw/public_html/includes/page_header.php on line 33
Title: Re: [Mod] Maintenance Page - Set from Admin Control panel
Post by: V@no on June 04, 2005, 09:16:43 PM
I got this error Warning: Cannot modify header information - headers already sent by (output started at /home/bhfqyruw/public_html/encuestas.php:166) in /home/bhfqyruw/public_html/includes/page_header.php on line 33
as far as I recall u've asked about this type of message several times already :P ;)
http://www.4homepages.de/forum/index.php?topic=3378.0
Title: Re: [Mod] Maintenance Page - Set from Admin Control panel
Post by: ch€ri{Bi}² on June 05, 2005, 09:11:31 PM
There is a modification which would be interesting for this mod:

 :?: on the page, could we have a form where the users can ask to receive a mail when the site will open?

 :arrow:  :arrow: The user can leave his login (registered users) or his address mail (others) and as soon as the site will pass in maintenance OFF, the user will receive a mail which says:
You receive this mail because you asked to be warned : The site "what-ever-u-want.com" is on-line...

Thank you in advance for your answers.
Title: Re: [Mod] Maintenance Page - Set from Admin Control panel
Post by: kief24 on October 15, 2005, 05:51:07 PM
i installed the mod and nothing happens.
I checked the steps, no mistake is made.

I can see the option in ACP. When i put the button on "yes"  ( "put the maintenance page on" ), and save the settings, after the saving the button is put to "no" again.
And when i go to the site nothing happens, even if i log out as administrator.

strange
Title: Re: [Mod] Maintenance Page - Set from Admin Control panel
Post by: V@no on October 15, 2005, 08:41:27 PM
Seems like you didnt do the first step: database update.
Title: Re: [Mod] Maintenance Page - Set from Admin Control panel
Post by: kief24 on October 20, 2005, 12:27:55 PM

Hi,

open

install_MainP.php

and find

Code: [Select]
<form action="install_mainp.php" name="form" method="post">
replace it with

Code: [Select]
<form action="install_MainP.php" name="form" method="post">

Save, Upload and Test It.....

now it works....
Title: Re: [Mod] Maintenance Page - Set from Admin Control panel
Post by: Nasser on October 27, 2005, 11:36:00 AM
wonderful MOD ... thanks alot
Title: Re: [Mod] Maintenance Page - Set from Admin Control panel
Post by: marius26 on November 06, 2005, 02:23:32 AM
use notepad for this

Code: [Select]
<?php

define
('ROOT_PATH''./');
include(
ROOT_PATH.'config.php');
include(
ROOT_PATH.'global.php');
include(
ROOT_PATH.'includes/constants.php');
require(
ROOT_PATH.'includes/sessions.php');

$error_log = array();
$error_msg "";

if (
$action == "modinstall") {

?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
  <meta content="text/html; charset=windows-1252" http-equiv="Content-Type">
  <link rel="stylesheet" href="admin/cpstyle.css">
  <title>4images Installer</title>
</head>
<body leftmargin="20" topmargin="20" marginwidth="20" marginheight="20" bgcolor="#FFFFFF">
  <table cellpadding="0" cellspacing="0" border="0" width="500" align="center">
    <tr><td class="tableborder"><img src="admin/images/logo_installer.gif" width="500" height="45"><br />
        <table cellpadding="3" cellspacing="1" border="0" width="100%">
          <tr class="tablerow2"><td><b>MOD Maintenance Page</b>&nbsp;&nbsp;&nbsp;&nbsp;(by Fugaziman)</td></tr>
          <tr class="tablefooter"><td align="center">&nbsp;</td></tr>
  </table>
<table cellpadding="3" cellspacing="1" border="0" width="100%">
  <tr class="tablerow"><td colspan="2" align="right"></td></tr>
  <tr class="tablerow2"><td colspan="2"><br /><blockquote>
<?php
$date 
time();
$sql "INSERT INTO ".SETTINGS_TABLE." (setting_name, setting_value)
VALUES ('maintenance', '0')"
;
if (!
$site_db->query($sql)) {
  
$error_log[] = $sql;
}
if (empty(
$error_log)) { echo "<h4>Database update success!</h4>"; }
?>


  </blockquote></td></tr>
 <tr class="tablefooter"><td colspan="2">&nbsp;</td></tr>
        </table>
      </td>
    </tr>
  </table>
</table>
<p align="center"> Powered by <b>4images</b> <?php echo SCRIPT_VERSION ?><br />Copyright &copy; 2002 <a href="http://www.4homepages.de" target="_blank">4homepages.de</a>
</body>
</html>
<?php
exit;
}
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
  <meta content="text/html; charset=windows-1252" http-equiv="Content-Type">
  <link rel="stylesheet" href="admin/cpstyle.css">
  <title>4images Installer</title>
</head>
<body leftmargin="20" topmargin="20" marginwidth="20" marginheight="20" bgcolor="#FFFFFF">
<form action="install_mainp.php" name="form" method="post">

  <table cellpadding="0" cellspacing="0" border="0" width="500" align="center">
    <tr><td class="tableborder"><img src="admin/images/logo_installer.gif" width="500" height="45"><br />
        <table cellpadding="3" cellspacing="1" border="0" width="100%">
          <tr class="tablerow2"><td><b>MOD Maintenance Page</b>&nbsp;&nbsp;&nbsp;&nbsp;(by Fugaziman)</td></tr>
          <tr class="tablefooter"><td align="center">&nbsp;</td></tr>
  </table>
<table cellpadding="3" cellspacing="1" border="0" width="100%">
  <tr class="tablerow"><td colspan="2" align="right"></td></tr>
  <tr class="tablerow2"><td colspan="2"><center>
  This script will modify your 4images database, so please<br><b>
  <font color="#FF0000">ALWAYS BACKUP YOUR DATABASE BEFORE RUNNING THIS MOD!</b></font><br><br>
  Please check out all fields shown below.<br>
  If they do not correspond to your settings, please<br><b>DO NOT START INSTALLER</b>!
  </center></td></tr>
  <tr class="tableheader"><td colspan="2"><b><span class="tableheader">Database configuration</span></b></td></tr>
  <tr class="tablerow"><td>Database server type</td><td><?php echo $db_servertype?></td></tr>
  <tr class="tablerow2"><td>Database server hostname</td><td><?php echo stripslashes($db_host); ?></td></tr>
  <tr class="tablerow"><td>Database name</td><td><?php echo stripslashes($db_name); ?></td></tr>
  <tr class="tablerow2"><td>Prefix for tables in database</td><td><?php echo stripslashes($table_prefix); ?></td></tr>
  <tr class="tablefooter"><td colspan="2"><center><input type="hidden" name="action" value="modinstall"><input type="submit" value="Start modify database" class="button" name="submit"></center></td></tr>
        </table>
      </td>
    </tr>
  </table>
</form>
<p align="center"> Powered by <b>4images</b> <?php echo SCRIPT_VERSION ?><br />Copyright &copy; 2002 <a href="http://www.4homepages.de" target="_blank">4homepages.de</a>
</body>
</html>

save it as "install_mainp.php" make sure "Save as type" says "All Files
then upload it to your 4images root and run it, then follow instructions made by the author, of this script.
Title: Re: [Mod] Maintenance Page - Set from Admin Control panel
Post by: JensF on November 13, 2005, 06:27:43 PM
Hello,

i have a little Problem with this Mod. I have install it for a few weeks and now it works but today it doesn´t.

I have put the code into the page_header.php to have the effect at all sites. But when i go to the index.php i become a blank page. When i go to another page (details.php) it works and say me that the site is closed...

Have anyone an idea???
Title: Re: [Mod] Maintenance Page - Set from Admin Control panel
Post by: ch€ri{Bi}² on November 13, 2005, 11:42:22 PM
i have a little Problem with this Mod. I have install it for a few weeks and now it works but today it doesn´t.

 :?: did you follow these original instructions exactly?

:arrow: Now you have a choice....
If you want this to work when someone first comes to your site then
Edit Index.php
Find
$user_access = get_permission();

Add After
Code: [Select]
//-----------------------------------------------------
//--- Maintenance      --------------------------------
//-----------------------------------------------------
$maintenance = $config['maintenance'];
$redirect_url = TEMPLATE_PATH."/maintenance.html";
if ($maintenance){
  header("Location: ".$site_sess->url($redirect_url, "&"));
  exit;
}

//-----------------------------------------------------
//--- End of Maintenance      -------------------------
//-----------------------------------------------------

or if you want it to work for every page then ..
Edit page_header.php
Find
Code: [Select]
if (!defined('ROOT_PATH')) {
  die("Security violation");
}
and insert the code above just below it.

 :?: since this first installation, did you install some other MOD?
Title: Re: [Mod] Maintenance Page - Set from Admin Control panel
Post by: JensF on November 14, 2005, 09:48:36 AM
Quote
since this first installation, did you install some other MOD?

Yes, i have but i don´t now which :( i have installed many mods since i installed this mod...

And i have put the code into the page_header.php that it wirks on all pages. And now it work on all pages but not on the index.php
Title: Re: [Mod] Maintenance Page - Set from Admin Control panel
Post by: ch€ri{Bi}² 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:)
Title: Re: [Mod] Maintenance Page - Set from Admin Control panel
Post by: JensF on November 14, 2005, 03:19:52 PM
Hi,

i have do it in both files but no effect....
Title: Re: [Mod] Maintenance Page - Set from Admin Control panel
Post by: ivan on November 15, 2005, 10:56:21 PM
hello,
if I revise, function index.php with the code standing down these mod perfectly.

(change through ROOT PATH)
file maintenance.html = ROOT PATH

what can I do, so that the file maintenance.html is read from that template files?




Code: [Select]
//-----------------------------------------------------
//--- Maintenance      --------------------------------
//-----------------------------------------------------
$maintenance = $config['maintenance'];
$redirect_url = ROOT_PATH."maintenance.html";
if ($maintenance){
 header("Location: ".$site_sess->url($redirect_url, "&"));
 exit;
}

//-----------------------------------------------------
//--- End of Maintenance      -------------------------
//-----------------------------------------------------
Title: Re: [Mod] Maintenance Page - Set from Admin Control panel
Post by: Flo2005 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  :?:
Title: Re: [Mod] Maintenance Page - Set from Admin Control panel
Post by: TheOracle 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. ;)
Title: Re: [Mod] Maintenance Page - Set from Admin Control panel
Post by: Flo2005 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...
Title: Re: [Mod] Maintenance Page - Set from Admin Control panel
Post by: TheOracle 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). ;)
Title: Re: [Mod] Maintenance Page - Set from Admin Control panel
Post by: TheOracle on December 26, 2005, 06:26:54 PM
Update: I have just modified my post above due to a slight mistake.
Title: Re: [Mod] Maintenance Page - Set from Admin Control panel
Post by: Flo2005 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.
Title: Re: [Mod] Maintenance Page - Set from Admin Control panel
Post by: TheOracle 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'


? ;)
Title: Re: [Mod] Maintenance Page - Set from Admin Control panel
Post by: Flo2005 on December 26, 2005, 08:40:20 PM
 8O oops - You´ve got it! :)

I´ve corrected my post above...
Title: Re: [Mod] Maintenance Page - Set from Admin Control panel
Post by: TheOracle on December 26, 2005, 08:47:31 PM
Excellent. Now, it's clear. Thanks for your inputs. 8)
Title: Re: [Mod] Maintenance Page - Set from Admin Control panel
Post by: graficalicus 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 -
Title: Re: [Mod] Maintenance Page - Set from Admin Control panel
Post by: scubaj 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?
Title: Re: [Mod] Maintenance Page - Set from Admin Control panel
Post by: piyda on June 04, 2007, 11:14:54 AM
Download links is not working...

Please help! I really need this mod!

Thanks!
Title: Re: [Mod] Maintenance Page - Set from Admin Control panel
Post by: manurom on June 04, 2007, 01:21:25 PM
Hello;
the file seems to be here: install_MainP.zip (http://www.4homepages.de/forum/index.php?action=dlattach;topic=5638.0;attach=17)
Title: Re: [Mod] Maintenance Page - Set from Admin Control panel
Post by: piyda on June 04, 2007, 01:32:39 PM
Thanks!

You're a life saver :-D
Title: Re: [Mod] Maintenance Page - Set from Admin Control panel
Post by: apearce on January 27, 2009, 05:30:48 PM
Hey, my first ever post so please bare with me :). Just an update if anybody's interested. If you want to be able to log in and still use the site as an administrator, here's a code I thought I'd share:
-----
Hey, meine erste Post, so wenden Sie sich bitte mit nackten mich:). Nur ein Update, wenn jemand interessiert. Wenn Sie möchten, können sich anmelden, und nach wie vor nutzen die Site als Administrator an, hier ist ein Code Ich dachte, ich würde Aktie:

FIND/FINDE (includes/page_header.php):
Code: [Select]
if ($maintenance){
  header("Location: ".$site_sess->url($redirect_url, "&"));
  exit;
}

REPLACE WITH/ERSETSEN DURCH:
Code: [Select]
if ($user_info['user_level'] != ADMIN && $maintenance) {
  header("Location: " . $site_sess->url($redirect_url, "&"));
  exit;
}

Sorry für die schlechte Deutsch, ich habe Google Translator.

Login into your Admin CP by visiting gallery/admin/, once in the Admin CP you can return to your gallery with maintenance mode on.
Title: Re: [Mod] Maintenance Page - Set from Admin Control panel
Post by: sanko86 on January 27, 2009, 06:08:24 PM
ý thanks good mod.
Title: Re: [Mod] Maintenance Page - Set from Admin Control panel
Post by: Bommel on January 31, 2010, 05:35:14 PM
Hallo allerseits,

habe diese MOD installiert und funktioniert bestens. :thumbup:

Mir ist aber aufgefallen, dass der Redirect nur über die Indexseite erfolgt. Wenn jetzt jemand z.B. die Top10 als Favorit abgelegt hat, dann kann er auf diese Seite trotzdem noch zugreifen.

Um das zu unterbinden - reicht es aus, wenn ich folgenden Code in jede php-Seite einfüge?

//-----------------------------------------------------
//--- Maintenance      --------------------------------
//-----------------------------------------------------
$maintenance = $config['maintenance'];
$redirect_url = TEMPLATE_PATH."/maintenance.html";
if ($maintenance){
  header("Location: ".$site_sess->url($redirect_url, "&"));
  exit;
}

//-----------------------------------------------------
//--- End of Maintenance      -------------------------
//-----------------------------------------------------

Freundliche Grüße, Bommel
Title: Re: [Mod] Maintenance Page - Set from Admin Control panel
Post by: Bommel on February 02, 2010, 02:32:57 PM
Hallo allerseits,

wer diese MOD hier verwendet: http://www.4homepages.de/forum/index.php?topic=17155.msg91450#msg91450 kann für die Moderatoren auch die Zugriffsberechtigung während dem Wartungsmodus setzen, in dem er diese Zeile:

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

mit folgender ersetzt:

if ($maintenance && $user_info['user_level'] != ADMIN && $user_info['user_level'] != MODERADOR){

Ich liebe diese MOD... :D

Freundliche Grüße, Bommel
Title: Re: [Mod] Maintenance Page - Set from Admin Control panel
Post by: zakaria666 on August 29, 2010, 04:03:00 AM
I miss Vanos help and advice. He was so nice before