View Single Post
  #1 (permalink)  
Old 07-14-2008, 02:42 PM
ddluk ddluk is offline
Casual Pligger
 
Join Date: Feb 2008
Posts: 33
Thanks: 3
Thanked 13 Times in 6 Posts
Talking Maintence mode - new modifiaction for free

That's my first modification so there could be some bugs, maybe someone who know php better than me should check it

Maintenance mode is modification which give as the possibility to put our site in maintenance mode. For example we need to close site for few minutes, we click on the button On an now people only see your web site logo and text "This site is currently under construction."

So let's start:

Files used in that modification:
smm.php (included in package)
admin_maintenance (included in package)
maintenance_main_center.tpl (included in package)

Files modified in that modification:
index.php
languages/lang_english.conf
templates/your_template_name/admin_templates/admin_main_center.tpl

Other:
Database query

Instruction:

1) Database query:

Code:
CREATE TABLE `pligg_maintenance` (
`id` INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY,
`name` VARCHAR( 20 ) NOT NULL ,
`valuemm` VARCHAR( 50 ) NOT NULL
) ENGINE = MYISAM

INSERT INTO `pligg_maintenance` (
`id` ,
`name` ,
`valuemm`
)
VALUES (
'1', 'state', '0'
);
2) Put files from package into your Pligg directory:
smm.php to your root directory
admin_maintenance.php to your root directory
maintenance_main_center.tpl to templates/your_template_name/admin_templates/

3) Edit files:

Open index.php from root directory:

before
Code:
include_once('Smarty.class.php');
add
Code:
include('smm.php');
Open lang_english.conf from languages directory:

add this at the end:
Code:
//<SECTION>Pligg Maintenance</SECTION><ADDED>0.1</ADDED>
PLIGG_Visual_Header_AdminPanel_Maintenance="Site under maintence"
PLIGG_Visual_Header_AdminPanel_Maintenance_Display="Maintenance"
Open admin_main_center.tpl from templates/your_template_name/admin_templates/

after
Code:
<img src="{$my_pligg_base}/templates/{$the_template}/images/paypal.gif" align="absmiddle"/> <a href="http://forums.pligg.com/donate.php" target="_blank">{#PLIGG_Visual_Header_AdminPanel_Donate#}</a>
add
Code:
<br/>
<img src="{$my_pligg_base}/templates/{$the_template}/images/manage_config.png" align="absmiddle"/> <a href="{$my_pligg_base}/admin_maintenance.php">{#PLIGG_Visual_Header_AdminPanel_Maintenance#}</a>
Open maintence_main_center.tpl from templates/your_template_name/

Add your website name:
Code:
<input type="submit" name="On" id="On" value="On" onClick="parent.location='http://your_web_address/admin_maintenance.php?action=on'" />
Code:
<input type="submit" name="Off" id="Off" value="Off" onClick="parent.location='http://your_web_address/admin_maintenance.php?action=off'" />
4) Customization:

To change the logo and text displayed when site is under maintenance you need edit smm.php file.

You can change:

title:
Code:
<title>Site maintenance</title>
logo:
Code:
<img src="http://your_web_address/logo.png" alt="logo">
text:
Code:
<h2>This site is currently under construction.</h2>
5) Using:

To use modification go to the admin pane, the you find on the end of list modification mode. Then you can click On and Off. Actually the status is not displayed. I will change that in future version.


TODO list:
-add display status (maintenance On/Off)

Version 0.1

If you don't understand something please write questions here

Modification is free but if you like you can send me some cash to my paypal account: admin.ddluk@gmail.com

Edited:
Small bug in smm.php. New version uploaded.
Attached Files
File Type: rar maintenance_mode.rar (2.1 KB, 3 views)

Last edited by ddluk; 07-14-2008 at 04:55 PM..
Reply With Quote
The Following 2 Users Say Thank You to ddluk For This Useful Post: