Site Integration

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

By jenolan - December 10, 2008

Just purchased CMS-B it looks quite interesting and still trying to work out whether it fits my needs. As background I have been using a cobbled together thingy using Wordpress, CuteNews and even some Joomla! (what a combo meal) but nothing will fit just doig what we need.

Having something look after the article creation looks pretty good but can I ask if a simpler retrieval method could be used. Rather than including 'functions' I would like to be able to include a class, something like...
$mystuff = new CMS_Access( "TableName" );
$mystuff->SetSomething = 21;
...
$myarray = $mystuff->GetArticles();

Doing it this way I could grab multiple things, with different tables, settings or whatever with no risk of conflicting with other functions I have in my system.

Thanks!
Larry
---
<?= "Jenolan(Larry) :: Coding Since 1973" ?>
Peace and Long Life

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
---
<?= "Jenolan(Larry) :: Coding Since 1973" ?>
Peace and Long Life

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
---
<?= "Jenolan(Larry) :: Coding Since 1973" ?>
Peace and Long Life