close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

cms 102 upgrade tutorial

Thread began 9/16/2011 6:02 pm by gruant2000381341 | Last modified 9/16/2011 6:04 pm by gruant2000381341 | 1151 views | 1 replies |

gruant2000381341

cms 102 upgrade tutorial

This is part 1.. I had to break this into chunks to get it into the forum.
I also attached a txt doc to this thread with all the directions.

How to update cms 102 to use the newer ckeditor, step by step.
(There is also another seperate fix at the very bottom for non collapsing tabs on the admin index page)
You must have html editor 3.02 installed.
Security Assist is not needed if you follow this*.
(*I am 99% sure of this, I looked all over the code and only found one thing that needed to be edited...it seems to work just fine, but I haven't looked into the mysql tables to see if anything is different there or not...so hopefully this will help those of you without security assist)

Define your site root in Dreamweaver with the folder that contains your cms files as your root.
My folder that contains all my cms102 files is named myContent...so that's what I set the root to.
When defining your site, Dreamweaver requires you to declare an images folder...just create a junk folder for this, and delete that folder after we are done....or even use an existing folder, it doesn't really matter.

Step 1. Set Site Settings
-------------------------
Go ahead and open admin->contents_insert.php
(in design view)
click WebAssist->Forms->HTML Editor->Site Settings
in the popup File Manager tab set Upload Directory to "files"
in connection choose localhost(if you have that option)
if you don't have that option, click define
click new
Connection name: localhost
I used generic values next as you can edit these later in the Connections/localhost.php file
MySQL server: localhost
User name: root
Password: pasword
Database: database name
Click OK
Highlight the new localhost, click done
Now on the connection dropdown, choose localhost
Now click the security tab
(If you don't have security assist installed....Skip this step)
Allow access to - Administrator
set Failed Redirect to users_login.php (not -> admin/users_login.php...that builds the link wrong in the kfm/confg file)
Click OK at the bottom


Step 2. Replace the insert editor
-------------------------------------
Now go into code view for the contents_insert.php
Go down to this code in code view (line 363 - 366 in my copy)

<?php
// WebAssist iRite: Rich Text Editor for Dreamweaver
$WARichTextEditor_1 = CreateRichTextEditor ("ContentValue", "../HTMLEditor/", "713px", "400px", "Custom", "../custom/contents_insert_ContentValue1.js", "".((isset($_POST["ContentValue"]))?$_POST["ContentValue"]:"") ."");
?>

Delete those lines, leave your cursor where you deleted that and click "Design view" in toolbar.
Now click WebAssist->Forms->HTML Editor->Insert Editor to bring up the html editor wizard.
Here are the settings to enter in the wizard.

--Editor preset(click pencil)
---- In the general tab
---- Documemt type - XHTML 1.0 Strict
---- Language - your choice, and your choice on the 2 tickboxes
---- File Upload - Tick Allow file upload - your choice for the other tickbox, and I left the sub-directory field blank.
---- I didn't edit anything in the other tabs
click ok
save as preset if you like, not necessary though.

Now the wizard should have something like Blank(custom) in the Editor preset field.
---- Skin: I left at default.
---- Width: 713 px
---- Height: 400 px
---- Interface color: your personal preference
---- Editor name: ContentValue (make sure you use a capital C & V on ContentValue)
---- Initial value: leave blank
---- Styles list preset: I left that at it's default (if you want to import styles...that's for you to figure out on your own.)
click OK

Now go to the very top of the code and find this line.
(Mine was on line 4 after I added the new editor)
<?php require_once("../HTMLEditor/WARichEditorPHP.php"); ?>
Delete that line, it calls the old editor.
make sure not to leave any white spaces when deleting code so we don't get header errors later.
You can now save that page, but keep it open as we will need some details from it.


Step 3. Replace the update editor
-------------------------------------
Open admin->contents_update.php

In the contents_insert.php (that we edited a minute ago) go to the code we just placed in there.
(my copy it is lines 364-401..it will start with <?php and end with ?>)
Highlight all that new code...then hit ctrl+C to copy it.

Now go into contents_update.php down to this code.
(line 383-386 in my copy)

<?php
// WebAssist iRite: Rich Text Editor for Dreamweaver
$WARichTextEditor_1 = CreateRichTextEditor ("ContentValue", "../HTMLEditor/", "713px", "400px", "Custom", "../custom/contents_update_ContentValue1.js", "".($totalRows_HistoryUpdate > 0)?$row_HistoryUpdate['HistoryValue']:$row_WADAContents['ContentValue'] ."");
?>

Delete those lines, and in it's place...hit ctrl+V to paste in the code from the other page that we copied.
Now that you pasted in the new code in contents_update.php, we need to edit it a little.
Find this in the new code....

// The initial value to be displayed in the editor.
$CKEditor_initialValue = "";

And replace it with this code...
(all the code that starts with $CKEditor is all 1 line in case this forum breaks it up)

// The initial value to be displayed in the editor.
$CKEditor_initialValue = "".(($totalRows_HistoryUpdate > 0)?((isset($_POST['ContentValue']) && $row_HistoryUpdate['HistoryValue'] != $_POST['ContentValue'])?$row_WADAContents['ContentValue']:$row_HistoryUpdate['HistoryValue']):$row_WADAContents['ContentValue']) ."";

Now go to the very top of the code to this line.
(It was line 3 on mine)

<?php require_once("../HTMLEditor/WARichEditorPHP.php"); ?>

And replace that line with this.

<?php require_once("../webassist/ckeditor/ckeditor.php"); ?>

Now save that contents_update.php.
You can now close this file and and the contents_insert.php.

Attached Files
cms102upgrade.txt
Sign in to reply to this post

gruant2000381341

This is part 2
there is a txt attachment to part 1 if the code does not display properly

Step 4. Edit the configuration file (For people WITH Security Assist installed)
-------------------------------------
***********************************************************
** Skip this step if you do NOT have security assist **
** We will fix this manually for you in a bit **
***********************************************************
Now you need to open webassist->kfm->configuration.php
(The webassist folder is created after you run the above steps to add in the new editor.)

Find these lines
(line 7-8 on my copy)
<?php require_once( "../../Connections/localhost.php" ); ?>
<?php require_once( "../../WA_SecurityAssist/Helper_PHP.php" ); ?>

Replace those 2 lines with these 3 lines.

<?php require_once( "../../Connections/localhost.php" ); ?>
<?php require_once("../../WA_Globals/WA_Globals.php"); ?>
<?php require_once( "../../WA_SecurityAssist/Helper_PHP.php" ); ?>

Make sure that when you paste in those 3 lines that there are no spaces after the ending ?>'s or you will get header already sent errors.
You can save this file now and close it.


Step 5. Edit the configuration file (For people WITHOUT Security Assist installed)
-------------------------------------
*****************************************************************
** This step is for people who do NOT have security Assist **
*****************************************************************
Now you need to open webassist->kfm->configuration.php
(The webassist folder is created after you run the above steps to add in the new editor.)

Find these lines
(first 9 lines on my copy)

<?php
@session_start();
$startKFMDir = getcwd();
chdir(dirname(__FILE__));
require_once( "library.php" );
?>
<?php require_once( "../../Connections/localhost.php" ); ?>
<?php //Security ?>
<?php chdir($startKFMDir); ?>

Replace those lines with these.

<?php
@session_start();
$startKFMDir = getcwd();
chdir(dirname(__FILE__));
require_once( "library.php" );
?>
<?php require_once( "../../Connections/localhost.php" ); ?>
<?php require_once("../../WA_Globals/WA_Globals.php"); ?>
<?php require_once( "../../WA_SecurityAssist/Helper_PHP.php" ); ?>
<?php chdir($startKFMDir); ?>
<?php
if (!WA_Auth_RulePasses("Administrator")){
WA_Auth_RestrictAccess("../../admin/users_login.php");
}
?>
<?php chdir($startKFMDir); ?>


Make sure that when you paste in those lines that there are NO SPACES anywhere at the end of the lines or you will get header already sent errors.
You can save this file now and close it.


Step 6. Finishing touches
-------------------------------------
Even though we specified earlier that our files folder should be under our root, the html editor actually puts it inside of your admin folder.(bug?? maybe)
So when you upload, you will probably need to set permissions for that folder to 755.
It is in your admin folder, named files...set file permissions to 755 for that folder.

You can now delete the old original HTMLEditor folder.
You can also delete the junk folder that we made for images for Dreamweaver (if you did that).
Remember to update Connections->localhost.php with correct mysql info, and WA_Globals->WA_Globals.php with correct info.
The original sql file that came with cms 102 is fine...new tables will be created first time you upload an image.
once you upload this, try to upload an image...as the first time you do, it will need refreshed so it can build the needed new tables for the images.

If you run into the browse server getting hung up, you may need to edit this line.
webassist->kfm->index.php page
Find this..

<script type="text/javascript" src="j/all.php/can-minify"></script>

And replace it with this...

<script type="text/javascript" src="j/all.php"></script>

That's everything.


***************************************************************************
***************************************************************************
Below is a fix for the tabs not collapsing properly on the admin index page
***************************************************************************
***************************************************************************

***** You need to Google around to find this js file
***** mootools-more-1.3.2.1.js
***** Maybe WA will post a link to this file for easy downloading
***** Find that file and download it, save it to your desktop.
***** Create a new folder named js in your cms folder.
***** Save that mootools-more-1.3.2.1.js file to the newly created js folder


Go to admin->index.php

scroll down to the code where the doctype is....

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo($WAGLOBAL_Site_Name); ?> - Admin Home</title>
<script type="text/javascript" src="../css/mootools.js"></script>

Replace that code with this......

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo($WAGLOBAL_Site_Name); ?> - Admin Home</title>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/mootools/1.3.2/mootools-yui-compressed.js"></script>
<script type="text/javascript" src="../js/mootools-more-1.3.2.1.js"></script>

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...