Web design software and server change problem!

2 posts by 2 authors in: Forums > CMS Builder
Last Post: April 4   (RSS)

By Dave - April 4

Hi John, 

By default the code generator should create a block of code like this at the top that is portable between servers:

// load viewer library
$libraryPath = 'cmsAdmin/lib/viewer_functions.php';
$dirsToCheck = ['','../','../../','../../../','../../../../']; // add if needed: '/home/sites/theatremusicshop.com/public_html/cmsAdmin/lib/viewer_functions.php'
foreach ($dirsToCheck as $dir) { if (@include_once("$dir$libraryPath")) { break; }}
if (!function_exists('getRecords')) { die("Couldn't load viewer library, check filepath in sourcecode."); }

So that's one option. Another option would be to have the files all load a single init.php file and put your server-specific code in that file.

But if your software allows you to replace 100 files at a time you could do that in a few iterations, or download another editor or ide that lets you replace many files.  

Either way, be sure to backup everything first.  

Hope that helps!

Dave Edis - Senior Developer
interactivetools.com