Adapt CMSMS for Flash front-end - Help needed!

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
tomgsd
Forum Members
Forum Members
Posts: 74
Joined: Tue Feb 12, 2008 10:00 am

Adapt CMSMS for Flash front-end - Help needed!

Post by tomgsd »

Hi all,

I'm currently in the process of experimenting with Flash and CMSMS to create a Flash front-end for the CMSMS admin.  My overall aim is to have page content display in flash whilst providing alternative content for SEO & Accessibility underneath.

I want to be able to use the different modules of CMSMS in more or less the same way as I would in a normal HTML site.  For example search, forms, front-end users, etc.

To do this I plan to use AMFPHP (www.amfphp.org) as it can communicate with PHP class files and return the data to flash.  However, PHP isn't really my strong point so I am looking for someone to help me adapt/write class files that return data as arrays or recordsets to flash instead of writing to HTML templates.

I've already got stuff like the menu and navigation working but need to move on to more advanced features.  I've decided my next challenge will be the search module as its quite a key feature.  If anyone fancies giving me a hand (or just some pointers as to how it could be done) it would be much appreciated.

Tom
Green Sheep Design Ltd. - www.greensheep.co.uk
viebig

Re: Adapt CMSMS for Flash front-end - Help needed!

Post by viebig »

contact me at viebig at gmail dot com give and overview or briefing, I´m in
Ziggywigged
Power Poster
Power Poster
Posts: 424
Joined: Sat Feb 02, 2008 12:42 am
Location: USA

Re: Adapt CMSMS for Flash front-end - Help needed!

Post by Ziggywigged »

viebig wrote: contact me at viebig at gmail dot com give and overview or briefing, I´m in
viebig, maybe you could share a general solution for everyone. I'd like to know how to do this as well and I've seen more requests for this popping up in the forum. thanks.
Take a penny, leave a penny.
viebig

Re: Adapt CMSMS for Flash front-end - Help needed!

Post by viebig »

ok mikein, let´s start with search then.

I´m sort of busy right now, but I´ll figure out something.

Let´s start with the search module then, but before that, we need the content, and a flash movie that understand it, plus the menu would be nice.

Maybe if you can prepare a FLA, and give some specs on how you want to receive data should be a good start to make it work.
madsny
Forum Members
Forum Members
Posts: 31
Joined: Mon Jul 14, 2008 2:46 pm

Re: Adapt CMSMS for Flash front-end - Help needed!

Post by madsny »

I would start with creating an XML output of the all the Content of the database, from there on begin so build a script that sort things into usable xml entries, but then again im not really going for an advanced CMS port just being able to set up some pages with content and have that content portet indo flash following the menu structure you dynamically create from your CMS.

i've made a big post about ideas in this direction and hope people would join in to create a nice XML export script.
until now i've just played around with the hole thing and got this as an outpyt.

http://emotionalobjects.com/cms5/hack/output02.php
(ps. this script will be romoved over time when i reset)(use view page source to see the structure)

but as you see, i figured out a ahemm clumsy way to ordering everything into a nice array, from there on it's just a matter of placing and converting the right data from the database into the array and then create a script that builds the XML output.
hmmmm or one could perhaps just load the array into flash via loadVars... donno.

Does it make anysense.
tomgsd
Forum Members
Forum Members
Posts: 74
Joined: Tue Feb 12, 2008 10:00 am

Re: Adapt CMSMS for Flash front-end - Help needed!

Post by tomgsd »

My idea for this is to create a flash website that will benefit from the great features and modules of CMSMS with as little modification to the CMSMS code as possible.  My idea is to have a series of actionscript classes that can be called from flash and return arrays, objects, etc, of data from the CMSMS system.  Users will be able to add content via the admin area and call upon modules in flash when they need them.  The current HTML output of CMSMS will then act as a SEO friendly version of the site that will still be customisable with templates.  I would also like to include support for SWF Address (http://www.asual.com/swfaddress/) deep linking should anyone require this.

The way I figure it is that this will benefit users who are familiar with the system, people who don't have a great deal of knowledge of php and provide a streamlined workflow for flash developers.

Since my original post I've been having a go at this and managed to build the menu, collect content and use the search module.  I'll prepare an example and post back here later today but basically, I made my own php class to read the database and return records via AMFPHP for the menu and content and used the loadvars class to perform a search and get the results.

The XML idea is an interesting one and was my first thought for how this could work.  From the tests I have done though it has not been necessary to convert the data as flash is able to have data returned as an object via the loadvars class.  For example, in my search test I simply outputted the result links to the page in a hidden div (so the site would look exactly the same for non-flash users) and had flash read them from there.

Anyway, my examples will show better than I can explain. I'll post back later.
Green Sheep Design Ltd. - www.greensheep.co.uk
madsny
Forum Members
Forum Members
Posts: 31
Joined: Mon Jul 14, 2008 2:46 pm

Re: Adapt CMSMS for Flash front-end - Help needed!

Post by madsny »

I think you are on the right track, the XML version im working on, demands that the user follows some rules in the backend, they are fairly easy ad intuitive since i want the ability to "just" set up a page which is then loaded into flash, from where the flash programme deals with the data the way he or she desire's.

one of my concerns building the port script is to make a system that is low key and easy to change or add functions to if you just have a little knowledge of php and mysql, but i must say, the mysql structure for CMS made simple is really nice and clean, very easy to find you way in and work with.

I recently made a portHack for wordpress, just for fun, but since it's not build as a webPage CMS but a blog, you would have to do a lot of workaround on the html content, which means more errors in the end, really was a nightmare. :D.
a nice example on this is, when you create a page only consisting of images, the htmlContent field in the Mysql only holds the <img src... tags and links, VERY easy to split thoes up :D.

It wold be very cool if we somehow, could make the community build a port function into their CMS modules for easy port to flash.
One thing that would be really cool is, to have a week workshops with develouppers, Modul makers, thinkes and flasher, to come up with some sort of standard porting ISO safe way to call for data from the CMS, so we don't end up with a lot of diffrent hack and tricks but build it so that we could call a module which would then return a loadvars with content.
from there on it's up to the flash programmer to build the pages as he want or you could go crazy and make components.

well this way out of range, but i would be glad to organize and do concept on what is neede if we find 10 people interrested in recoding all the modules hehe...

guess we are stuck with our hacks for now :D.

ahh, i was just about to forget, another reason i went with the XML version is, you can easily preload all the data you need and get and overview of all the data and prebuild all your pages if you desire.

//Mads
tomgsd
Forum Members
Forum Members
Posts: 74
Joined: Tue Feb 12, 2008 10:00 am

Re: Adapt CMSMS for Flash front-end - Help needed!

Post by tomgsd »

Ok, so here is my first example - http://www.greensheep.co.uk/cmsmadeflash/readmenu.html.

This uses AMFPHP to do an SQL query on the content table.  It is defined in a php class file that is called from flash.  The results are returned as an array and i've used them to build the menu.

As good as this example is though, I'm basically just using the CMSMS database.  This means I have two separate ways of accessing the data - one for flash, one for HTML.  I think that a better and more integrated way would be to use the existing functions.  For example, the search module has cool features like logging the number of times a keyword has been searched for.  We could maintain this by having a function that would call the correct url with the search terms appended to the query string and return the results to flash.

I've already done an example of how this could work (I'll post it up later) but it took me ages because I had to figure out what needed sending, modify the search module to return the content_id's (for the links in my example) and then display a results string flash could read in a hidden div.  All this with limited PHP knowledge!

I could really do with someone who knows how each module works and can help modify them to return data for flash alongside the HTML.  Also, anyone who has ideas about the best method to return the data to flash.
Green Sheep Design Ltd. - www.greensheep.co.uk
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: Adapt CMSMS for Flash front-end - Help needed!

Post by calguy1000 »

It's simple to get CMS to output xml data.

a) create a new page template with the xml header and schema
b) have the new template call menu manager like {menu template='myxmltemplate'} in the appropriate spot.

You can generate an xml file for page content in a similar way.

There should be no (or very little) programming required.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
viebig

Re: Adapt CMSMS for Flash front-end - Help needed!

Post by viebig »

I agree to calguy, but I know that there should be additional cases for other modules, and the ideal is have a HTML version too.

We need some schemas foreach module and additional options. So my conclusion points to an outside class that can be called in flash and returns the xml.
madsny
Forum Members
Forum Members
Posts: 31
Joined: Mon Jul 14, 2008 2:46 pm

Re: Adapt CMSMS for Flash front-end - Help needed!

Post by madsny »

Hey Tom good job. :D.. keep t rolling.  ::)

Yes you could just make a template that post the content data in an XML list, but the you get everything into flash.
i think it should be as easily to work with the data within flash as it is to create a page in the CMS (well more or less), therefor i find it important that the data have been processed byt the server before you need it in your project, that means less things and hacks to remember.

eks.
The html content generated by the CMS is not 100% portable with the dynamic textfield in flash, i haven't tested it yet, but the    textfields only support basic HTML functions, so here it would help ALOT if tag's were remover or changed to fith flash, no reason to do this in every flash project.

gallery eks.
I want to create an easy gallery, where you just through som photos in to a page in the CMS, and from within flash you get an clean and easy workable XML structure to workwith aster stripping links and text from PHP before porting to XML like so:

 
    img1.jpg
 
 
      This is text for the image
 


now that yummi Data for flash to work with, very clean and understandable, newbies cen work with it without bothering about understanding string manipulation within flash or having to add .as scripts all the time.

so therefor, XML porting by PHP with a template sorting/rule scheme :D
viebig

Re: Adapt CMSMS for Flash front-end - Help needed!

Post by viebig »

madsny wrote: Hey Tom good job. :D.. keep t rolling.  ::)

Yes you could just make a template that post the content data in an XML list, but the you get everything into flash.
i think it should be as easily to work with the data within flash as it is to create a page in the CMS (well more or less), therefor i find it important that the data have been processed byt the server before you need it in your project, that means less things and hacks to remember.

eks.
The html content generated by the CMS is not 100% portable with the dynamic textfield in flash, i haven't tested it yet, but the    textfields only support basic HTML functions, so here it would help ALOT if tag's were remover or changed to fith flash, no reason to do this in every flash project.

gallery eks.
I want to create an easy gallery, where you just through som photos in to a page in the CMS, and from within flash you get an clean and easy workable XML structure to workwith aster stripping links and text from PHP before porting to XML like so:

   
     img1.jpg
   
   
      This is text for the image
   


now that yummi Data for flash to work with, very clean and understandable, newbies cen work with it without bothering about understanding string manipulation within flash or having to add .as scripts all the time.

so therefor, XML porting by PHP with a template sorting/rule scheme :D

the problem with html tags is not related with cmsms, but with flash. Flash dont follow the w3c standards and support just a few tags, and ol html 4 tags not xhtml, elements like storng and em are not supported until now.

That´s why we need to create a flash only version of the page, removing tags,and try to keep it simple.
madsny
Forum Members
Forum Members
Posts: 31
Joined: Mon Jul 14, 2008 2:46 pm

Re: Adapt CMSMS for Flash front-end - Help needed!

Post by madsny »

Yep. thats my point, flash is old fashion on many areas, thoe AS3 can kick some ass if you like hehe.
this is my main reason to run the content through a cleaner php script to clean up and replace tags with a legal flashHtml tag list, also by doing this we dont mess with the CMS and can still view the pages as normal.

but. in the future it would be super cool if there would be a feature like "Add to Flash XML list" for each module/pages, so you just have to call that XML from flash and the CMS do all the magic :D.
that's what i dream about. but for now, but it's way to advanced for me, this is what i got now through a really clumsy php script, but hey, it does the job down to a level 3 menu structure, easy to add more.
http://emotionalobjects.com/cms5/hack/output05.php
(use view source)

you see the array is now also an XML output, im sooo proud :D. hehe i know it's nothing and using for all page data fields is plain stupied, but i really don't need them to be labled in flash as long as i, know the structure (which is the hard bit).
madsny
Forum Members
Forum Members
Posts: 31
Joined: Mon Jul 14, 2008 2:46 pm

Re: Adapt CMSMS for Flash front-end - Help needed!

Post by madsny »

:D
What a happy day it is. look
http://emotionalobjects.com/cms5/useflash.html
I made it, hehe well it's FAR from done or even close to stable, but, data goes in, and magic happens, well i was lazy so only 2 menu layers and no real gallery or anything, from now on, it's just work hehe. YES i have a port tool :D.
madsny
Forum Members
Forum Members
Posts: 31
Joined: Mon Jul 14, 2008 2:46 pm

Re: Adapt CMSMS for Flash front-end - Help needed!

Post by madsny »

Hey Tom, a few thoughts..

I got data into flash and now i want to post data back to the system since it's all about interaction, and this is where things starts to get tricky, i was planning on using the news module as a starter, it's no problem creating a costume script that add's your post, but safty is a question, therefor i was wondering if the action.addarticle.php could be used, do you have any experience with this.

I gave myself an easy flash assignment, a gallery where the visitors can change the x and y positions of the photos, pretty simple, the main idea here is, how would you create something like this (two way communication) with the modules you got already, you can do a costume php script, but this is just not an pratical solution.

What i found would be very useful, is if the page module (creating a normal page) had the ability to have another tab called data, this tab should contain alot for easy storage and access of data, you can have as many as you like, the admin just have to set up an instance or let's called it "a new page creation template".

in short im thinking of some sort of data grid modual that you can attach to a page.

also the admin should be able to on creation of a new "data grid" to hide and lock some fields for other users so they don't have access to edit vital information, but for-instance still have the ability to change the XY position of you elements.

do you see where im getting.

the big question is just:
- how to make it possible by an normal admin to attach a costume data grids to different page layout.

Well what i really think would be nice, is to make a module for CMS made simple called "flash layouts", where you can add photos, add data grids and all kind of crazy useful things to help manage your Flash data.

but for now, back to the problem on how to save or edit a post directly from within flash without creating an unsafe costume php script that access the sql database. :D
Post Reply

Return to “Developers Discussion”