Starting with version 1.29 Interactive Tools has implemented a "Demo" mode for CMSB. This means that you can put together a demo for general marketing purposes, for a specific client to try out your interface design, to use in focus group testing, or for anything else that you can think of, and no matter what they do, the users can not break anything.
When someone logs in to the demo mode, a temporary copy of your existing database is automatically created, and the user makes their changes on that copy, not to the original. After an hour, the copy is erased, and although the user can log in to the demo again, they will be working on a fresh copy of your original database.
Setting up a demo site is easy.
Just two caveats...
1) You can't use one install (or one license) for both a demo and a standard installation simultaneously. The good news is that you can buy a "Demo Only" license for 75% off (~ $50 US). Just use promo code CMSDEMOCOPY and you're good to go.
2) I found that depending on which version of CMSB you're using, some or all of your plugins are disabled and won't work when you enter the demo mode and some or all of them may need to be manually re-enabled if you you return to the normal mode. If you make the plugins system plugins, they will not be disabled.
According to Jason Sauchuk at Interactive Tools:
The reasons plugins are disabled in demo mode is to restrict functionality. Demo mode is meant to provide a very basic implementation of the software. By making plugins system plugins, you're making that functionality available to people in demo mode. This isn't really a security flaw (they're not able to do anything with the plugin that they wouldn't be able to do normally), but could give you some unwanted results. For example, if you leave auto backup enable during demo mode, you'll end up backing up the temporary demo tables, which wouldn't be what you want.
That said...
To make a plugin into a system plugin, you only have to add one line of code to the plugin's header: "Required System Plugin: Yes" .
Here's and example of a system plugin header with the code added:
<?php
?>
SETTING UP A DEMO SITE In a new folder on your server, create a separate installation of CMS Builder.
You should also set up a separate MySQL database for the demo.
Then set up your demo site as you would any other site powered by CMS Builder.
The demo will not allow a user to login unless there's a valid user account for the username and password they enter. So, set up a new user account for the demo (I use the word demo for both the username and password) and assign which folders you want to be accessed for the demo user. (This way you can create a help section that can't be accessed)
CHANGING THE DEMO MESSAGES If you want to change the default messages that appear on the demo pages, you'll find them in the cmsAdmin>lib>common.php file and in the displayDemoNotice.php plugin that's included with CMS Builder (Remember, that you'll want to make this plugin into a "System" plugin so it will be activated in the demo mode.)
Here's an example of the ones I've used.
In the common.php file:
// otherwise, create new demo else { echo t("Your personal copy of the files required for this demonstration is being created...") . "<br /> \n"; _removeOldDemos(); $demoNum = _createNewDemo(); $_SESSION['demoCreatedTimeAsFloat'] = $demoNum; $refreshUrl = @$_REQUEST['resetDemo'] ? '?' : thisPageUrl(); printf(t("You'll be redirected to the login page as soon as the files have been created."), $refreshUrl); print "<br /> \n<meta http-equiv='refresh' content='1;$refreshUrl' />";
// showBuildInfo();
exit; } }
and In the Plugin:
// $html .= "<br /> <br /> <div style='font-size: 12px; color: #C00'><b>NOTE: For security reasons, some features are disabled in the demonstration mode .<br /> When you change any information, you are only affecting a personal copy of the demonstration database .<br /> **No one but you can see the changes you've made.** <br />The demonstration will reset and revert to the original data in $minutesRemaining minutes.</b></div>"; return $html; }
ADDING A "RESET" SWITCH If you want to add a reset "panic" button to your demo, you can add it as a new section editor with the type of advanced>text link. This will appear in your Section editor menu list and when clicked it will reset the demo to it's original status.
Note: I had to shorten the "Table Name" considerably or I got "couldn't create demo" errors, but I left the "Section Name" as noted below.
I called my "Panic" button: CLICK TO RESET THE DEMO TO ITS ORIGINAL CONDITION, with the link as:
http://www.yoursite/your_demo_folder/cmsAdmin/admin.php?resetDemo=1
CREATING INSTRUCTIONS THAT CAN'T BE MODIFIED Since a text field could be edited by the person using the demo, I used an HTML separator field.
Here's the code that I used for a multi-record editor as an example:
<tr> <td colspan='2'> <hr> <br /> <b><font color="red">INSTRUCTIONS:</font> <br /> <br /> Change or add information below, then click "Save". <br /> <br /> NOTE: To change the dates, use the pull down menus for Month, Day and Year. <br /> <br /> Your changes will appear on the live "Exhibitions" demonstration web page in your browser. <br /> (If the changes don’t appear, just “refresh” the page in your browser by pressing the F5 key) <br /> <br /> Or, you can click the "Preview" button, then click on the exhibition you've modified to see your changes.</b> <br /> <br /> <hr> <br /> <br /> </td> </tr>
TAKE THE DEMO SITE LIVE After your demo site is set up and functioning the way you'd like it to to make the demo site "live, just change the following value in /data/settings.dat.php: from "0" to "1".
demoMode = 1
In the demo mode, the data on your demonstration pages will be visible to the demo user. They'll be able to change that data (excluding uploads) and their changes will appear on your demo site. However, they are working on a temporary copy of the database, so your original content will be available for the next demo user.
DIFFERENCES BETWEEN THE NORMAL AND THE DEMO MODE Here's how the demo mode differs from a normal installation: - When a new demo user visits the viewers and admin program, a copy of the database tables get created just for them - This copy lasts 1 hour and then it's removed - All the admin features are locked down (not editable) - Uploads are disabled - All other parts of the software can be incorporated into the demo site
If you want to make changes to any section editors, you'll have to change the demoMode value back to "0" to unlock the admin features.
There's a pretty cool demo of the demo mode on-line at:
http://demo2.interactivetools.com/cmsbuilder/
And I've implemented a demo on my site, at:
http://www.JKWebDesigns.com/demo/
|