Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: [WIP] Site offline mod  (Read 1462 times)

centered

  • Guest
[WIP] Site offline mod
« on: January 15, 2008, 06:49:14 pm »

WIP as usual.. Ideas are appreciated since I may be going about this wrong....

0. Backup
1. New db setting:
Code: [Select]
INSERT INTO settings VALUES (30, 'offline', '');
2. New language variables:
Code: [Select]
// offline mod
$l['offline'] = 'Site Offline';
$l['off_mess'] = 'Welcome. '.s('website_title').' is offline. Please <a mailto:"'.s('website_email').'">contact</a> the administrator for inquiries';
3. function center... find and add the offline mod line
Code: [Select]
// CENTER
function center() {
// offline mod
if (s('offline') == 'on' && !$_SESSION[db('website').'Logged_In'] == token()) { echo l('off_mess'); } else {
3a - Add a } to the end of center
4. In settings(), find the first line, then add the new lines afterwards
Code: [Select]
echo html_input('text', 'website_keywords', 'wkey', s('website_keywords'), l('a_keywords'), '', '', '', '', '', '', '', '', '', '');
// offline mod
echo html_input('checkbox', 'offline', 'offline', '', l('offline'), '', '', '', '', (s('offline') == 'on' ? 'ok' : ''), '', '', '', '', '');
5.  In processing find the top line and replace the big array mass with the commented
Code: [Select]
$word_filter_change = $_POST['word_filter_change'];
// offline mod - 2 lines
$offline = $_POST['offline'];
$ufield = array('website_title' => $website_title,'home_sef' => $home_sef,'website_description' => $website_description,'website_keywords' => $website_keywords,'website_email' => $website_email,'contact_subject' => $contact_subject,'language' => $language,'charset' => $charset,'date_format' => $date_format,'article_limit' => $article_limit,'rss_limit' => $rss_limit,'display_page' => $display_page,'comments_order' => $comments_order,'comment_limit' => $comment_limit,'word_filter_file' => $word_filter_file,'word_filter_change' => $word_filter_change,'display_new_on_home' => $display_new_on_home,'display_pagination' => $display_pagination,'num_categories' => $num_categories,'approve_comments' => $approve_comments,'word_filter_enable' => $word_filter_enable,'offline' => $offline,);

This should put the whole site offline, but sNews does not have an seperate admin area, so one can't knock the whole site offline... more ideas are needed...
« Last Edit: January 15, 2008, 11:41:38 pm by equilni »
Logged

centered

  • Guest
Re: [WIP] Site offline mod
« Reply #1 on: January 15, 2008, 07:51:27 pm »

http://www.modxcms.com/doc-offline.html

I think I will take a few pointers from this idea....

Pointers only of course....
Logged

jared351

  • Sr. Member
  • ****
  • Karma: 4
  • Posts: 276
Re: [WIP] Site offline mod
« Reply #2 on: January 16, 2008, 02:53:39 am »

That would be really useful and I like the ideal EQ.
Logged

Joost

  • Guest
Re: [WIP] Site offline mod
« Reply #3 on: January 16, 2008, 04:30:28 am »

This should put the whole site offline, but sNews does not have an seperate admin area, so one can't knock the whole site offline... more ideas are needed...

I thought you've already managed that. The site should only be offline when not logged in.
Logged

centered

  • Guest
Re: [WIP] Site offline mod
« Reply #4 on: January 16, 2008, 04:54:03 pm »

Correct, but I am still trying to get it to hide everything but the heading and bottom section showing login....


Done:
http://snewscms.com/forum/index.php?topic=6676.msg45528#msg45528
« Last Edit: January 17, 2008, 01:38:55 am by equilni »
Logged