CMS Builder v2.53 Released (Apr 4)

6 posts by 4 authors in: Forums > CMS Builder
Last Post: May 31, 2013   (RSS)

  • Archived  

By Dave - April 4, 2013

Hi everyone, 

We've just released CMSB v2.53.

The major new features are easier server moves and a sample cron plugin.   Here's some details: 

Development Servers

This update is mostly about development servers (also called staging servers) and making it easier to move files between development and live servers.  If you're not already using a development server you should set one up, you'll save a lot of time not having to upload files after every change to see the result, and you will avoid breaking your clients live sites while developing features. We use the free package from http://www.wampserver.com/ on a Windows PC.  It's a combo Apache, MySQL, PHP package that installs in one click.  Mac users can google for "MAMP" and if you're running Linux, you probably don't need any tips setting up a web server. ;) 

Domain-based Settings Files

You've probably already found that sometimes you'll have to maintain files on a few servers while developing a site.  You might develop on your internal server: http://yourBigClient.yourWebCo.com/,then have to upload to the clients beta site:  http://beta.yourBigClient.com/, then finally upload to their live site when you're done: http://www.yourBigClient.com/.  Normally you can just copy files from one server to another and everything will just work.  But if these sites have different MySQL details (as they often do), and you copy a settings file from one site to another you'll take down the whole site with an "Invalid MySQL Password" error.

The fix?  We've added support for domain-based settings files so you can create a custom settings file that specifies the domain name like this: /data/settings.yourbigclient.yourwebco.com.php and it will automatically use that settings file for that domain only.  This ensures you never overwrite live-server settings with dev-server settings (since they are stored in a separate file) and you can copy files from server to server without fear.  We actually added this feature over 3 years ago in v2.02 but many people still don't use it (even some who work at interactivetools!) so for this version we added a checkbox to the install screen for development servers.  It looks like this: 

Use Custom Settings File [X] For this domain name only (localhost) use this setting file: /data/settings.localhost.php.
Using a separate settings file for development servers ensures you never accidentally overwrite your live server settings when uploading CMS /data/ files. Always use custom settings files for development servers only, not your live servers.

So if you're running on a non-live server (development, staging, beta, etc) make sure to check that box and you'll be much safer.

Website Prefix URL

Next up, the other thing we see a lot of is development servers that host websites under existing sub-folders.  This could look like any of the following: 

If you've ever had to work with a site like this, you might have found yourself hardcoding /~bigclie/ or a similar folder prefix into the HTML, only to have to go back later and remove it when you moved the files to the live server that didn't need that prefix.

Our fix in 2.53 for this is a new field available on both the install page and under: Admin > General.  It looks like this: 

Website Prefix URL [________________________________________________] eg: /~username or /development/client-name
If your development server uses a different URL prefix than your live server you can specify it here. This prefix can be changed in the Admin Menu and will be automatically added to Viewer URLs and can be displayed with <?php echo PREFIX_URL ?>. This will allow you to easily move files between a development and live server, even if they have different URL prefixes.

So if you've ever been stuck search and replacing URL prefixes before, now you can just use the above feature.  

Example Cron Plugin (for programmers)

For the programmers, we've included a sample plugin in /plugins/cron-example.php that shows how to run a background task at a set interval such as once a day or once an minute.  This is really useful if you need to build a custom site that sends out email updates once a night, expires auctions, imports or backs up data, sends out reminders or marketing emails once a month, etc.

We've built cron support into CMS Builder now, so it's way easier and more powerful then the standard cron/scheduled task features you get with hosting accounts.  CMSB automatically shows you when all the scheduled tasks last run, when they're scheduled to run next, keeps a log of every task, and even records errors (even if your script/plugin dies or crashes) and emails you to tell you when there is a problem.  And all you need to do to set it up is add a single line of code to your plugin telling it what function you want to run and how often.  Like this: addCronJob('emailSubscribers', "Send daily email updates", "how often to run");  

Try setting up cron and enabling the example plugin.  You can find the Background Tasks menu here with instructions: admin.php?menu=admin&action=general#background-tasks

And that's it! 

To see the full list of changes, please visit the CMS Builder changelog: 
http://www.interactivetools.com/tour/changelog.php

CMS Builder users can upgrade by donation at this page: 
http://www.interactivetools.com/upgrade/

Please feel free to post your feedback and questions! We're always eager to get your feature requests and bug reports, every single release is full of user requested fixes and features. Post in the forum or email Dave at dave@interactivetools.com.

Dave Edis - Senior Developer
interactivetools.com
  • Archived  

By gkornbluth - April 11, 2013

Hi Dave,

I just upgraded to 2.53 on a number of sites and when click on save details in a single record editor’s field list, (on at least the 3 sites I checked) I get the following error (with different path info of course) in both FireFox 20 and IE9:

Notice: Undefined index:  _listPage in /hsphere/local/home/a878277/strykinggourds.com/cmsAdmin/lib/menus/database/editTable_functions.php on line 218

Just thought you’d like to know.

Jerry Kornbluth

The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php
  • Archived  

By Dave - April 16, 2013

Thanks Jerry, 

I've fixed that for the next version.  If you want to try and apply the fix yourself just follow these steps:

- Open lib/menus/database/editTable_functions.php
- Search for: startsWithHttpOrSlash
- Add a @ before $_REQUEST[$name] (shown in red in the following code):

    $startsWithHttpOrSlash = preg_match("|^(\w+:/)?/|", @$_REQUEST[$name]);
    if (@$_REQUEST[$name] && !$startsWithHttpOrSlash) { $errors .= t("$label must start with /") . "<br/>\n"; }

Let me know if that works for you.  Thanks!

Dave Edis - Senior Developer
interactivetools.com
  • Archived  

By gkornbluth - April 17, 2013 - edited: April 17, 2013

Thanks Dave,

Doesn't look like it breaks anything so I'll wait for 2.54

Jerry

The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php
  • Archived  

By Jason - May 31, 2013

Hi,

Here is a patch to resolve this issue.

Open up cmsAdmin/lib/menus/database/editTable_functions.php

On line 218, you should see this line:

$startsWithHttpOrSlash = preg_match("|^(\w+:/)?/|", $_REQUEST[$name]);

Add an "@" to the $_REQUEST variable like this:

$startsWithHttpOrSlash = preg_match("|^(\w+:/)?/|", @$_REQUEST[$name]);

This should take care of the error for you.  This fix will be available in the next release.

Hope this helps

---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/