CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 When To Modify CCS Standard Code

Print topic Send  topic

Author Message
jjrjr1


Posts: 942
Posted: 07/06/2008, 5:56 PM

Hi

This is a contoversial subject and I highly recommend not making changed to CCS standard code. I avoid it as much as possible. However, there are some cases that I have found it necessary. If anyone knows how to accomplich these things without modifying standard code, let me know. If not, here are some examples where I changed standard code and will share the details if you would like.

First a couple of notes. Again try to avoid modifying standard code if possible. Explore the many event handeling capabilites offered to do what you need. If you do make changes to standard code try and make them in the white space if possible. This will prevent CCS from losing it's mind when you modify code. If you do make changes in the grey code areas, and CCS turns that block of code to white, be sure to keep backup copies of working pages before editing them through the IDE or when cuting and pasting objects since CCS will sometimes remove your modififations or not ba able to make changes to the page. You just have to keep an eye on this. One example is if you change the standard code for a page form, if you add a control or such, CCS will fail. This can all be worked around if you keep an eye on it.

Times when I have needed to change standard code:

in PHP Pages:

1. To modify how reports print and display to cause pagination when desired based on the result of a condition.

2. Static Menus using the menu buiilder to fix a bug in how relative path is used in that case.

3. To add special functions that will be used in a script not wanting to use an include control. You can place a function in the white space after the includes. or in the event file in the white space after the <? (I prefer the event file)

4. If you want to retrieve the value for a variable and you want that variable to be global. Add the global directive in the white space wihin the event function.

5. Cause page to be used based on login. Modify the login event function.

6. Use more than one table for login. Call to a different login function in the login event.

In Common PHP files.

1. To use multiple tables for login. Clone login function pointing to different tables and fields in Common.php. Renaming it and having your login call this function instead of the standard one.

2. To cause a PHP version 5 check change the check function in Common.PHP

3. To add parameters to the CCSConnectionSettings Array in Common.PHP. Needed to do this to define some default tables at initialization.

4. Fix a problem with MySql Database graceful failure errors in db-mysql.PHP

5. Fix a problem with the file upload component creating files on a linux/unix server with spaces and reserved characters needed to change Classes.php.

6. Changed Classes.php to cause mulit-list boxes and multi check boxes to re populate the multi choices saved in the database so the form would display the same multi selections that were saved.

7. Modified Common.php to set additional values from the login table in addition to login, id, and password.

In HTML

1. Modify the FCKeditor function to fix a problem with FCKeditor and hidden forms.

2. AJAX auto fill functions to fix a problem when trying to autofill a field the has the FCKeditor attached.

3. To implement layers, Document Object Properties and Documet Objects that are the targets of HTML replacements. eg innerHTML.

This is all I can remember at the moment. If anyone has done this without changing standard code, let me know. Also, share your reasons as well.

Again. be careful making changes to standard code.

Have fun.

_________________
John Real - More CodeCharge Studio Support at - http://CCSElite.com
View profile  Send private message
jjrjr1


Posts: 942
Posted: 07/07/2008, 8:26 AM

Just thought of another reason I have needed to modify standard code.

The convert to PDF function in the before output event to get dompdf to work properly.


_________________
John Real - More CodeCharge Studio Support at - http://CCSElite.com
View profile  Send private message
jjrjr1


Posts: 942
Posted: 07/13/2008, 1:13 PM

Hi Again

Just came across another reason to modify standard code.

This time in the db_mysql.php again.

The example was if you set up a user table for logins... etc.

Usually you will want to set the login field to UNIQUE so as not to have multiple users with the same login id.

The problem is of a new member trying to sign up selects an ID already in use you get a very ugly error on the screen for the user to see. It is somthing like this:

Database Error: Duplicate Entry for 'userid' in Key 2

Now that is pretty ugly for a production web site.

The way to fix this is done in the db_mysql.php file and you can even provide language support for the error messages.

I anyone know another way, Let me know. If you want details on this, again let me know.

Have Fun

_________________
John Real - More CodeCharge Studio Support at - http://CCSElite.com
View profile  Send private message
jjrjr1


Posts: 942
Posted: 07/16/2008, 1:31 PM

Hi Again

I started this post so possibly we all could share instances we have found it necessary to modify standard CCS code and or possibly share alternatives to do the same thing without doing so.

Someone asked about how to retrieve multi checked checkboxlists with all the original items checked. Here is a reply and it is one of the cases I put in this post.

This post discusses the CCS modifications necessary to do that.

http://forums.yessoftware.com/posts.php?post_id=98742


_________________
John Real - More CodeCharge Studio Support at - http://CCSElite.com
View profile  Send private message
glerma

Posts: 56
Posted: 01/02/2009, 8:56 PM

Regarding the comment: "2. AJAX auto fill functions to fix a problem when trying to autofill a field the has the FCKeditor attached."

I am curious how you did this because i am having a problem with the CCS Ajax Autofill feature that is not populating data into a textarea form object with FckEditor attached to it. I know its related to FCK Editor because if i remote the FCKEditor from the text area, the autofill works as inteded on the textarea.

Regards,
George
View profile  Send private message
Rick

Posts: 52
Posted: 01/05/2009, 7:49 PM

Regarding:

"5. Fix a problem with the file upload component creating files on a linux/unix server with spaces and reserved characters needed to change Classes.php."

To solve this without changing Classes.php enter:
'$str=eregi_replace("([^a-z0-9])","_",$string);'
in Error Control of File Upload Control.

I believe I originally got this solution from this forum:
http://forums.yessoftware.com/posts.php?post_id=90490

Rick
View profile  Send private message
maxhugen

Posts: 272
Posted: 01/06/2009, 5:34 PM

@glerma and John

Not sure if this applies to problem "2. AJAX auto fill functions to fix a problem when trying to autofill a field the has the FCKeditor attached."... but just in case:

If I use the Google Maps API javascript library, together with anything AJAX that adds the prototype.js library, some functions in Google maps won't work. Remove AJAX, and Map works AOK.

I haven't had the time to thoroughly check the cause of this, but no doubt there is a conflict between the Google API and prototype... perhaps a duplicated function or something.

Cheers
_________________
Max
www.gardenloco.com | www.eipdna.com | www.chrisarminson.com
View profile  Send private message
damian

Posts: 838
Posted: 01/07/2009, 12:51 AM

have you tried changing the order in which you load them?

also check
http://code.google.com/p/gmaps-api-issues/issues/detail...Internal&id=795

issue may be fixed in newest google api...

_________________
if you found this post useful take the time to help someone else.... :)
View profile  Send private message
maxhugen

Posts: 272
Posted: 01/08/2009, 7:40 PM

Many thanks, Damian!

The link you provided explained the problem... I was using v=2.133d, but as per the posts, I've changed it to v=2. Only run one test so far, but it looks like that fixed the problem!

Cheers!
_________________
Max
www.gardenloco.com | www.eipdna.com | www.chrisarminson.com
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.