Site Integration

7 posts by 3 authors in: Forums > CMS Builder
Last Post: December 12, 2008   (RSS)

Re: [jenolan] Site Integration

By ross - December 10, 2008

Hi Larry

Thanks for posting!

If you go through the Code Generator in CMS Builder, it will give you all the code you need to get data appearing on your page. It sounds as if you've already seen this but I figured I would mention it anyway just in case.

Technically speaking, you can connect to your data anyway you like because it's all just sitting in a MySQL database. If you wanted to write up your own code base with database connections and classes, that should be something you can do. We probably won't be able to help out all that much as we like to stay focused on the way CMS Builder handles things.

It's definitely possible here though that I am not quite understanding what your question is so let me know what you think and we'll narrow it all down from there.

Thanks!
-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com

Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/

Re: [ross] Site Integration

By jenolan - December 10, 2008

Mainly I am asking that the functions be encapsulated into a class. The viewfunctions.php has a lot of functions and variables which I would prefer to see abstracted away for safety.

I realise I could write this myself but I want to try and have you guys do it instead to save me work!

Cheers!!
Larry
---

Re: [jenolan] Site Integration

By ross - December 11, 2008 - edited: December 11, 2008

Hi Larry

I actually thought it was quite encapsulated already :).

We encapsulated everything into viewerfunctions.php so that when you are working on the page where you want data to appear, you just need to include viewerfunctions.php.

All the work you are doing is basically echoing out specific fields with some for loops.

I am not sure exactly what you are aiming for here. I'll see if our developers have some more ideas though.
-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com

Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/

Re: [jenolan] Site Integration

By Dave - December 11, 2008

Hi Larry,

Safety wise, are you worried about function name or variable collisions, or something else?

We've tried to keep global variables to a minimum, and could look at abstracting some of those if there was a collision with something.

If you want to do something more advanced than what viewer_functions.php offers you're probably best to write your own code for it. CMS Builder still offers a great backend to make managing the data in the database easy.

The built in viewer functions let you do a lot, but even we revert back to writing direct mysql when we need to do complicated queries or joins, etc.

Also there's the issue of making it work in PHP4 and PHP5... :) (We're currently supporting PHP 4.3).
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Site Integration

By jenolan - December 11, 2008

The class approach would do a couple of things for me.

One possible conflict avoidance (always nice)
Two (and mainly) that I could use multiple callouts eg

1. Grab some news for the main bit,
2. Grab a testimonial for the side
3. whatever else I can think of... [cool]

I realise I could write one myself but as I mentioned much easier if I can get you guys to make it an official widget!

Cheers,
Larry
---

Re: [jenolan] Site Integration

By Dave - December 12, 2008

Interesting. Yea I'd love to actually namespaces but of course PHP doesn't have them yet.

You can do multiple callouts with the existing code generator code too.

Classes is an interesting idea for a pseudo-namespace. Don't plan on it but I think I'll experiment with it next time I'm in the code. If we did add it it would be next time I re-write viewer_functions.php (I've done that once already).

Thanks for the suggestion.
Dave Edis - Senior Developer
interactivetools.com