Jump to content
MakeWebGames

Recommended Posts

Posted (edited)

Some time ago i made a maintenance mod so you could close your site or a page for maintenance.

 

Ive been messing again with the script and had a bit of a rewrite so now you can close as many pages as you want and as staff still be able to work on the page which wasnt available on the old version you can close the entire site down by closing header.php and again staff can still enter the site and see whats happening..
 

if your interested in this upgrade i'll post the script

Edited by Uridium
  • Like 2
Posted
16 hours ago, Sim said:

 

His countdown code is wrong?

Sorry this is taking a while i had an issue with the countdown timer and when I fixed that I had another brainstorm which i'll list

1 = 1 click shut down closes down site immediately (admin still had access)

2= make sure that all closed pages are backed up before any edits are made..

      (This will create a backup file of the closed file before you edit anything the file will be renamed from example (inventory.php to inventory.backup).

3 = View all PHP files on your root this will let you view on the page all named php files and will allow you to click on any file to goto that page)

4 = edit any of the current closed file times incase your not quite finished you can increase the offline timer

5 = make sure NO pages can be closed down twice if page is already closed..

6 = closing header.php will close down entire site (you can set your own time limit here) on #1 the site is shut down for 24 hours

7 =  All pages can be open with one click from the OPEN ALL link.....

 

I'll post some pics im still working on the EDIT filename and close all function...... but the rest works fine


 


 

1.PNG

2.PNG

3.PNG

4.PNG

5.PNG

6.PNG

7.PNG

8.PNG

9.PNG

10.PNG

11.PNG

12.PNG

  • Like 2
Posted

Sorry still coding.. It dawned on me that displaying a time to come back to the game could put people off... So ive implemented a colour changer basically like a set of traffic lights 

Red, Amber Green as your work progresses  you can inform your members by changing the colour of the Time block even though your time says 72hours and 25 minutes your users can watch the colours change from red to amber to green to inform them that the work is nearing completion...

fixed a few bugs it didn't notice in the meantime

1red.PNG

1amber.PNG

1green.PNG

1lockdown.PNG

1lockdowndone.PNG

  • Like 2
Posted

Very good mod. Since this is a very in depth mod,

Maybe add 

If the user is logged in, add a button 'notify me when reopened' or something that will send out emails after maintenance.

Posted (edited)

maintenance_mod.rar

 

there is a readme.txt file included any issues post on here

 

Add this secition to your minute cron

 

$db->query("UPDATE `maintenance` SET hour=hour-1 WHERE minute = 0");
$db->query("UPDATE `maintenance` SET minute=minute+59 WHERE minute = 0");
$db->query("UPDATE `maintenance` SET minute=minute-1 WHERE minute > 0");
$db->query("DELETE FROM maintenance WHERE hour=0 AND minute=0");
$db->query("DELETE FROM maintenance WHERE hour=-1");

 

Edited by Uridium
added extra data
  • Thanks 2
Posted (edited)
14 hours ago, Sim said:

This be a great MOD for GL.

yes it would i do have something like this already running in my game, i may release it at some point works totally as a standalone with no editing of other files, also is hooked up to my bug tracking class so can see status and reports of each module that may need work also sends notifications when it has either detected an error or a user has issued a report on that module.

 

Capture.PNG

Edited by URBANZ
  • Like 3
Posted (edited)

Ive just stripped my version down so will post up the the way i do it, i havent included the ACP part as that is unique to my game but you could always build this part yourself. @Dayo this might save you some time. Just note i did it this way as wanted a banner displayed to the admin when page is in maintenance.

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

Edited by URBANZ
  • Like 2
  • Thanks 1
Posted
47 minutes ago, peterisgb said:

This looks mental. I will give it a try later, But from the images looks like you put your heart into it, Nice job.

 

It might not look to neat, but the hooks dont allow you to to change the defaultb loaded template to easily.

@URBANZ im sure you know you can return the maintenance mod tpl? Or load maintenance.

Posted

A page counter would be an advantage it would display all PHP files and the number people who visit each page that way if a page isnt doing so well you can maybe upgrade it or get rid of it

Posted (edited)
9 hours ago, Sim said:

 

It might not look to neat, but the hooks dont allow you to to change the defaultb loaded template to easily.

@URBANZ im sure you know you can return the maintenance mod tpl? Or load maintenance.

This is very true to alter the loaded template is a massive pain which is why i use this way as works very well.

yes i know you can return the tpl but decided it to make it an all in 1 for posting here and for loading the module page i didnt do this as it dont have its own page, for my game it is a hook for moduleManager so dont have to repeat a page i already have. 

instead it uses the current page the user is on and replaces the tpl and then if the admin is viewing it displays the page its meant to with a banner saying its in maintenance.

I find this way better instead of redirecting as users could refresh the page for example and would display the page it needs to when its out of maintenance.

Edited by URBANZ
Posted
On 3/24/2021 at 3:28 PM, Uridium said:

A page counter would be an advantage it would display all PHP files and the number people who visit each page that way if a page isnt doing so well you can maybe upgrade it or get rid of it

I love this idea. I did that with oRPG Creator many years ago.

Posted
4 hours ago, Sim said:

I love this idea. I did that with oRPG Creator many years ago.

personally this is a bad idea as you would then need to store the page views which then could become something that slows the game down.

This is why analytics exists.

Posted

Analytics would slow a site down even more IMO. Adding one additional query to every page load should not effect any performance at all. Update pageviews = pageviews +1 where page = thisPage

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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