Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Under-construction plugin (ongoing development)
#1
Hi all !

I try to develop a plugin to make a site under construction.

For this, I wish to add a checkbox in the settings tab in the admin panel. I know how to add this in the theme tab but not in the settings tab.

Is there a specific way to do that ? Specific variable when registering the plugin with register_plugin function ?

I will create a specific template in the plugin folder when the site is under construction, I don't know how the plugin can interact with the 'core' to show that the site is under construction or not. I would like some advice on this specific point.

Thanks for your help. I will have many questions later, but I really want to develop it alone. I just need some informations and advices.
Reply
#2
didou038 Wrote:Hi all !

I try to develop a plugin to make a site under construction.

For this, I wish to add a checkbox in the settings tab in the admin panel. I know how to add this in the theme tab but not in the settings tab.

Is there a specific way to do that ? Specific variable when registering the plugin with register_plugin function ?

You can add a menu item the same way as on other tabs - action settings-sidebar.

didou038 Wrote:I will create a specific template in the plugin folder when the site is under construction, I don't know how the plugin can interact with the 'core' to show that the site is under construction or not. I would like some advice on this specific point.

The easiest way would be to output the "Under construction" content in index-pretemplate and then die to prevent GS from continuing with outputting the page.

You could also check if a component under-construction exists and output it instead of the default content.

Another way would be to let the user specify a page in the settings and then changing the global variables $url, $content, etc. to this page, if "under construction" is checked (similar to what the I18N plugin does. This page should use a template without menu, etc.

Or combine those approaches to have a plugin that works instantly, but can be customized to display whatever the user wants to display when the site is under construction.

P.S. maybe you should also think about "under maintenance" ;-)
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#3
It's ok !

My first try with index-pretemplate is ok.

I search for how to use a particular template file and it will be good !

Thanks for your help mvlcek !
Reply
#4
Ok !
here the first version (0.5a).

Test only with GS3.1. French and US language files include.

To change this plugin in version 1, it remains to:
- Include the WYSIWYG editor (to lay out the text personally)
- Use a template for the message (I really don't know how to do)
- Permit to the admin to see the website even when it's unavailable

I would put the plugin in sharing once the addition of the WYSIWYG editor is done.

Thanks for your reply if you test it.

Installation :
copy all files in your plugins directory

How To Use :
Connect yourself to the admin panel
go to settings and Maintenance settings (on the right menu)
Select if you wish to disable your website and create your own message (html is allowed)
This message is required !
To put online your website, just check 'available' ... Nothing is easier
Reply
#5
Is it possible to make the site available only for admin when the site is offline?
I think I have to use cookies but this is something I have not mastered.
I was thinking whether the visitor is the admin, if this isn't the case, I think adding a link at the bottom of the page to connect to the admin, is it wise?

Thanks for your advice again ^^
Reply
#6
If a user logs in to the admin panel, a cookie is being set.
Leave login to administration panel in peace, and just check for the cookie, allowing admin to browse the website after he logs in.
There are couple plugins making use of cookie. Afair plugin allowing to edit page's content from frontend has the code you'd need to solve the problem.
Addons: blue business theme, Online Visitors, Notepad
Reply
#7
yojoe Wrote:If a user logs in to the admin panel, a cookie is being set.
Leave login to administration panel in peace, and just check for the cookie, allowing admin to browse the website after he logs in.
There are couple plugins making use of cookie. Afair plugin allowing to edit page's content from frontend has the code you'd need to solve the problem.

thanks yojoe !
Reply




Users browsing this thread: 1 Guest(s)