Chronoforms as front end content submission ?

HSN 08 May, 2010
Hi all,

its been a while, and a rocky ride for me (given family devastation).
Anyway, I have a question which on the surface may appear as very easy, but im sure there is more to it🙂 .

I have made use (or started making use of) a certain other component recently that was released. Now the component itself is awesome and very flexible, but it does lack a certain something (front end content submission). The component in question is z.0.0 2 (sorry use your imagination only im not going to offer free google search results😉 ).

Now my current way of thinking in how I will construct a certain section of the website would mean that it would be user submission driven (to list your business on here fill out this etc).
On the one hand I could keep this simple and have a standard forma nd then manually input this info into the component, but then if new sections are added or new fields I have to update the form, so it is potentially a very manual process.

So therefore what im wondering is is it possible too get chronoforms to look at the afore mentioned components db, pull down the list of categories and have them displayed in a select box, and when the user submits the form that this info is published int he relevant tables for the component only as "Not Published" pending an admins approval?

The component mentioned above is now available under the GPL if you wish to check it out before giving a definate answer lol.

Many thanks,
Tom.
GreyHead 08 May, 2010
Hi Tom,

The answer is almost certainly Yes. You can pull data from any database table to use in a form.

But I'm can't work out your cross-word clue so have no idea what the component is that you want to use.

Bob
HSN 09 May, 2010
Hi Bob,

Just sent a PM, ive since looked at the database and I am somewhat left questioning if this is at all possible given the apparent mess. I do know that a fair few people are, or were hoping for content submission/ adding fromt eh front end, yet the dev's didnt supply this on the basis that there is not enough flexibility until Joomla 1.6 ?

Anyway, as mentioned above, I reckon the best way forward would be to install it and take a look at the way the database stores info as it looks very strange...

Regards,

Tom.
HSN 17 May, 2010
Hi again Bob,

I was wondering if you have had a chance to look at ZOO (V2) and if there was any possible way in which to submit content using chronoforms?

I can see a lot of people going stir crazy at the fact that zoo looks so nice and works so well but lacks the ability for front end submission (even for registered users). I already have passed chronoforms on to a few people as a means of having easy forms and posting content into a db, but I would definately be up for making it widely known if we are able to get it to function with zoo (v2).

Any ideas?

Regards,
GreyHead 18 May, 2010
Hi Tom,

I haven't had time to download it let alone dig into the code to work out how to post to it. That would be a much simpler task for the Zoo folk.

Sorry,

Bob
HSN 18 May, 2010
And there in is the problem🙂

The yoo folk say its impossible and have flat out refused to consider it until te joomla 1.6 release.
What I will do though is create some images showing the table structure along with fields and how the data is stored.

In reality it is only 1 field in particular I am worried about as it stores the info as something like
<xml ........
instead of different fields.
GreyHead 18 May, 2010
Hi Tom,

That looks like the beginning of an xml file - you can handle those with the PHP XML libraries. There's a bit of a learning curve but it is possible.

Bob
HSN 18 May, 2010
Hi Bob,

Ok. Well just looking now, there are 8 tables as part of the zoo installation. Im guessing most of these are completely irrelavent and mostly for the component itself.

The 3 that jump out in what im trying to do are

jos_zoo_category
jos_zoo_category_item
jos_zoo_item

jos_zoo_category lists all the categories I have an gives each one a unique ID along with the application ID it uses.

jos_zoo_category_item I have no idea lol.

But jos_zoo_item is the main one. In here is all the info for each page made.
The fields in this table are

id - Unique Identifier
application_id - refers to the application required
type - type (the type of application eg article within blog)
name - this is the title
alias - alias of the title
created - obvious
modified - obvious
modified_by - obvious
publish_up - obvious
publish_down - obvious
priority
hits - obvious
state - obvious
access - obvious
created_by - obvious
created_by_alias
searchable - obvious
elements - this stores what appears to be the xml file template for the layout and data
params - Not Sure

Most of the fields above are easy to deal with as they are simple values to have placed in there.
The elements field though looks ackward, it calls what appears to be the xml.config file for layout and then places the data into the relevant areas.
<?xml version="1.0" encoding="utf-8"?>
<elements><relateditems identifier="fc5a6788-ffae-41d9-a812-3530331fef64">
  <item><![CDATA[8]]></item>
</relateditems><text identifier="08795744-c2dc-4a68-8252-4e21c4c4c774">
  <value><![CDATA[Too soon or not too soon...]]></value>
</text><textarea identifier="d8f00640-8eae-4652-810b-9fe424911267">
  <value><![CDATA[<p>Now that the salt had mixed into the water and that after having checked the salinity with a refractometer (very accurate in comparison to a hydrometer) and having achieved a 1.024 in the test I decided I would move on to the next stage.</p>]]></value>
</textarea><textarea identifier="2e3c9e69-1f9e-4647-8d13-4e88094d2790">
  <value><![CDATA[<p>Now something you will have to remember is that during this process I was being guided by someone who has been building, maintaining and creating marine setups for over 16 years and if I had not had this guidance I would not have proceeded for at least a month.</p>
<p>As it was I added the live rock not only as it was safe to do so, but also as it would help reduce a prolonged period of parameter spikes within the aquarium. This off course was being helped by the kind of filtration system my AquaReef 200 has got built in.</p>
<p>It took some work before I managed to get everything where I wanted it (and no doubt I wont be happy at that) but hey it is done now.</p>]]></value>
</textarea><image identifier="cdce6654-4e01-4a7f-9ed6-0407709d904c">
  <file><![CDATA[images/stories/blog/12mar10/teaser_img.jpg]]></file>
  <width><![CDATA[100]]></width>
  <height><![CDATA[75]]></height>
</image><image identifier="c26feca6-b2d4-47eb-a74d-b067aaae5b90">
  <file><![CDATA[images/stories/blog/12mar10/images/Ar200_LiveRock_Formation.jpg]]></file>
  <link/>
  <target/>
  <rel/>
  <width><![CDATA[525]]></width>
  <height><![CDATA[700]]></height>
</image><gallery identifier="76cd9078-fe4d-40eb-9e7f-bc1ae76ce916">
  <value><![CDATA[12mar10/images]]></value>
  <title/>
</gallery><video identifier="ff1ed5b5-4365-457e-98bb-026366028bd7">
  <file/>
  <url/>
  <format/>
  <width/>
  <height/>
  <autoplay/>
</video><socialbookmarks identifier="6af341e4-f0e9-4605-b2a5-60d7a3525a96">
  <value><![CDATA[1]]></value>
</socialbookmarks><relateditems identifier="65b7851d-199f-4ac6-95a7-409ad1bca488"/><link identifier="fdcbebaa-e61a-462d-963e-aff74ff95499">
  <text/>
  <value/>
  <target/>
  <rel/>
</link>
</elements>


This is the parameters field, which im not sure on...

{"config.enable_comments":"1","metadata.description":"","metadata.keywords":"","metadata.robots":"","metadata.author":""}


What are your thoughts Bob ?

Regards,
GreyHead 19 May, 2010
Hi Tom,

Starting with the easy bit the category_item table is probably just creating links between the items and categories and the records are probably just id, cat_id, item_id so that woudl be easy enough to update with a MySQL query.

Looking at the other fields, as you say most of them are obvious.

The params field looks like a Joomla params list possibly created from JRegister. But for the moment you could just re-use the default list you have there and save it as a string (there may be some important new-line charaters that need to be preserved).

The XML is more problematic. I've put a re-formatted version below.

There are three problems that I can see: (a) the identifiers are random strings that are prsumably used by ZOO for something but we have no idea what, nor any idea how to calculate them. (b) There is no DTD (a design spec) for the XML so we have no idea what elements are optional or required. (c) It's not clear to me how the elements relate back to a ZOO article.

Both of these make the exercise difficult. It woudl be fairly easy to write the XML to create something that looked like this - I suspect that it would be much harder to write the code that would actually work inside ZOO.

Bob

<?xml version="1.0" encoding="utf-8"?>
<elements>
  <relateditems identifier="fc5a6788-ffae-41d9-a812-3530331fef64">
    <item><![CDATA[8]]></item>
  </relateditems>
  <text identifier="08795744-c2dc-4a68-8252-4e21c4c4c774">
    <value><![CDATA[Too soon or not too soon...]]></value>
  </text>
  <textarea identifier="d8f00640-8eae-4652-810b-9fe424911267">
    <value><![CDATA[<p>Now that the salt had mixed into the water and that after having checked the salinity with a refractometer (very accurate in comparison to a hydrometer) and having achieved a 1.024 in the test I decided I would move on to the next stage.</p>]]></value>
  </textarea>
  <textarea identifier="2e3c9e69-1f9e-4647-8d13-4e88094d2790">
    <value><![CDATA[<p>Now something you will have to remember is that during this process I was being guided by someone who has been building, maintaining and creating marine setups for over 16 years and if I had not had this guidance I would not have proceeded for at least a month.</p>
<p>As it was I added the live rock not only as it was safe to do so, but also as it would help reduce a prolonged period of parameter spikes within the aquarium. This off course was being helped by the kind of filtration system my AquaReef 200 has got built in.</p>
<p>It took some work before I managed to get everything where I wanted it (and no doubt I wont be happy at that) but hey it is done now.</p>]]></value>
  </textarea>
  <image identifier="cdce6654-4e01-4a7f-9ed6-0407709d904c">
    <file><![CDATA[images/stories/blog/12mar10/teaser_img.jpg]]></file>
    <width><![CDATA[100]]></width>
    <height><![CDATA[75]]></height>
  </image>
  <image identifier="c26feca6-b2d4-47eb-a74d-b067aaae5b90">
    <file><![CDATA[images/stories/blog/12mar10/images/Ar200_LiveRock_Formation.jpg]]></file>
    <link/>
    <target/>
    <rel/>
    <width><![CDATA[525]]></width>
    <height><![CDATA[700]]></height>
  </image>
  <gallery identifier="76cd9078-fe4d-40eb-9e7f-bc1ae76ce916">
    <value><![CDATA[12mar10/images]]></value>
    <title/>
  </gallery>
  <video identifier="ff1ed5b5-4365-457e-98bb-026366028bd7">
    <file/>
    <url/>
    <format/>
    <width/>
    <height/>
    <autoplay/>
  </video>
  <socialbookmarks identifier="6af341e4-f0e9-4605-b2a5-60d7a3525a96">
    <value><![CDATA[1]]></value>
  </socialbookmarks>
  <relateditems identifier="65b7851d-199f-4ac6-95a7-409ad1bca488"/>
  <link identifier="fdcbebaa-e61a-462d-963e-aff74ff95499">
    <text/>
    <value/>
    <target/>
    <rel/>
  </link>
</elements>
HSN 19 May, 2010
Hi bob,

the identifiers do indeed look random, but are infact repeated. So in each article/page entry all fields of type (lets say related items) have the same identifier.
<relateditems identifier="fc5a6788-ffae-41d9-a812-3530331fef64">


Imnot sure if I completely understood your second point about the DTD. If however by a fluke assumption I understood it and you meant elements required in terms of like above relateditems, or say a text area requiring text, then very few (actually if any) are actuallyrequired, but pretty much just a case of the ones id like to make required via the form so im not receiving blank submissions.

The elements relate back (again im assuming here) using the identifiers.

So my guess is if we were able to to create a form thats capable of inserting a new entry into the zoo database, all the info into their respective fields, and the xml data formatted by say the template below, then I should imagine it should work a treat.

Obviously the problem for me is im not an experienced php programer and so wouldnt know where to begin. The benefits though are that people would be up forr usingthe solution if it works. Granted it wouldnt be the perfect solution as some manual modification tot he forms would be required, but I rekon the main point would be chronoforms would be achieving something the zoo(yoo)team said they could not do in joomla 1.5...

Regards,
This topic is locked and no more replies can be posted.