Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2005-09-03 06:54:54

jonhicks
Member
From: Oxfordshire UK
Registered: 2004-03-22
Posts: 256
Website

Re: EE style 'turn off site' function

Oooh! That was fast! I hope the devs decide to pick up the patch


Cheers,
Jon VC#9

Offline

#14 2005-09-04 15:10:09

KurtRaschke
Plugin Author
Registered: 2004-05-16
Posts: 275

Re: EE style 'turn off site' function

The patch has been updated to a new revision which makes use of the txp_die() function and sets the cookie path more appropriately.

-Kurt


kurt@kurtraschke.com

Offline

#15 2005-09-04 15:20:09

KurtRaschke
Plugin Author
Registered: 2004-05-16
Posts: 275

Re: EE style 'turn off site' function

Also, is there a need for the site owner to be able to provide a free-text message to be displayed when the site is closed, or is a generic message sufficient? Right now, the code in the patch just calls <code>gTxt(‘site_closed’)</code>, which would just display a generic internationalized message.

Last edited by KurtRaschke (2005-09-04 15:20:27)


kurt@kurtraschke.com

Offline

#16 2005-09-05 08:28:13

jonhicks
Member
From: Oxfordshire UK
Registered: 2004-03-22
Posts: 256
Website

Re: EE style 'turn off site' function

What I’d love is to define a template for a closed site, rather than just a text message. I’m thinking specifically for when I’m updating the design of my site, I’d like to provide an attractive holding page, letting people know that it will be back up soon/in x days/when I can be arsed.


Cheers,
Jon VC#9

Offline

#17 2005-09-06 03:33:54

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: EE style 'turn off site' function

What I’d love is to define a template for a closed site, rather than just a text message. I’m thinking specifically for when I’m updating the design of my site, I’d like to provide an attractive holding page, letting people know that it will be back up soon/in x days/when I can be arsed.

Later on we’ll look at making error pages customizable. Perhaps we can do that in a generic way (say, an enhancement to txp_die()) so that it covers all (or most) error situations – 404’s, site down for maintenance, etc.


Alex

Offline

#18 2005-09-06 04:57:31

Jeremie
Member
From: Provence, France
Registered: 2004-08-11
Posts: 1,578
Website

Re: EE style 'turn off site' function

zem wrote:
Perhaps we can do that in a generic way (say, an enhancement to txp_die()) so that it covers all (or most) error situations – 404’s, site down for maintenance, etc.

I doubt you can achieve that; these are quite different from each other.

By the way, why not use the existing mechanism of the web servers to handle errors ?

Offline

#19 2005-09-06 05:23:32

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: EE style 'turn off site' function

I doubt you can achieve that; these are quite different from each other.

How so? Both require a (mostly) hard-coded xhtml page with space for a message to the user; and a HTTP status code. (I’m talking about the display, not the trigger, which is unique to each type)

By the way, why not use the existing mechanism of the web servers to handle errors ?

Are you talking about the Apache ErrorDoc mechanism?

Because once Apache has handed control to a PHP script, there’s no way for the PHP script to return control to Apache and say “please handle this as an error”. We have to generate our own error pages.


Alex

Offline

#20 2005-09-06 06:28:00

creativesplash
Member
From: Coimbatore, India
Registered: 2005-01-19
Posts: 283
Website

Re: EE style 'turn off site' function

I dont know if you have thought of this idea. (and I am not sure if this is feasable or not)

Can we have something like a Close for maintenance option in the back-end. The moment you do that, the back-end starts publishing to a php file maintenance.php instead of index.php and all calls to index.php are forwarded to maintenance.php which sets the cookie for only admins to view the website.

Another idea..

we can have some conditional tags like …

<code><txp:if_maintenance></code>
Maintenance content here..
<code></txp:if_maintenance></code>
<code><txp:else /></code>
Other content here

This way we can allow partcular parts of the website to be viewed by the public.

I am just a rookie when it comes to PHP. So please take it slow on me.


“Take a point, stretch it into a line, curl it into a circle, twist it into a sphere, and punch through the sphere.”

— Albert Einstein

Offline

#21 2005-09-06 21:29:45

Jeremie
Member
From: Provence, France
Registered: 2004-08-11
Posts: 1,578
Website

Re: EE style 'turn off site' function

zem wrote:
How so? Both require a (mostly) hard-coded xhtml page with space for a message to the user; and a HTTP status code. (I’m talking about the display, not the trigger, which is unique to each type)

Ouch… yes on the http code, nope on the webpage.

The maintenance mode require a page (in the TXP paradigm), a css file, and some content customizable server by server. Thats the easy part.

But the error page require a dedicated webpage (as the maintenance one) including a big search tool and a lot of explanation on how to handle the error (hardly any visitor know how to respond to these, and a significant portion are frightnen by it and quit surfing the website inflicting the error on them). And I think it should include a pre-automated-search based on the strings used in the false (or true for some errors, like a false password for a password protection) URI.

Are you talking about the Apache ErrorDoc mechanism?
Because once Apache has handed control to a PHP script, there’s no way for the PHP script to return control to Apache and say “please handle this as an error”. We have to generate our own error pages.

My bad, I didn’t knew that.

Last edited by Jeremie (2005-09-06 21:30:06)

Offline

#22 2005-09-06 21:31:40

Jeremie
Member
From: Provence, France
Registered: 2004-08-11
Posts: 1,578
Website

Re: EE style 'turn off site' function

creativesplash wrote:
we can have some conditional tags like …
<code><txp:if_maintenance></code>

I disagree on both, espacially this one. Too clumsy imho. The easiest way may be to call for a specific section, or page, with a hardcoded name.

Offline

#23 2005-09-06 21:37:54

jonhicks
Member
From: Oxfordshire UK
Registered: 2004-03-22
Posts: 256
Website

Re: EE style 'turn off site' function

I’m with Jeremie. The ideal would be the ability to specify a template for 404/maintainence in the same way that we have can define a template for a section, or have A template, like comments or comments-form forms.


Cheers,
Jon VC#9

Offline

#24 2005-09-06 21:57:04

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: EE style 'turn off site' function

As mentioned by Alex, if you don’t include or echo any content after setting a 404 header, your visitor gets a completely blank page. You add a 404 error page preference under advanced preferences, to set which page to show when Textpatterrn returns the 404 header. Those interested could add a search or whatever they want to it (remember searching is very customizable now), but by default you get a basic page explaining what the problem is. I do that for my site. Simple and effective. Would work well for a maintenance mode too, though obviously it needs more actual coding to determine when to show it.

Last edited by Mary (2013-01-24 17:33:54)

Offline

Board footer

Powered by FluxBB