Forums

Integrate with QuickFaq

OHmichelle 14 Jan, 2010
I hope this isn't inappropriate to ask here, but my website currently is using QuickFAQ. A couple of admins copy/paste in the questions our site receives (NOT via ChronoForms) as well as the answers into the QuickFAQ front end.

This is a much too manual process.

I would like to incorporate ChronoForms into the QuickFAQ tables. I was able to connect my ChronoForm to jos_quickfaq_items just fine, and the form saves the contents appropriately. So, now I have the "question" part of my FAQ. One of the fields in jos_quickfaq_items is "id" which is an auto_increment field. The "alias" field is a concatenation of the word "faq-item" and the id. This is how QuickFAQ retrieves the Q&A later - how can I populate that field when the data is being written to the table?

I also need to assign a default category of "12" to each question that comes in via ChronoForms. That is in the table jos_quickfaq_cats_item_relations. In that table, I need 'itemid' to be equal to 'id' from jos_quickfaq_items. How can I update the itemid when I write my data? I can add the "12" easy enough - I just need help with the id's.

I know one solution would be to redo the whole thing in ChronoConnectivity, but my admins are already very comfortable with the QuickFAQ front end, so I want to be able to keep that for them.

If I could add in the ChronoForms functionality, there would be no more manual copy/pasting for my admins.

Like I said, don't want to make anyone mad by asking about integrating Chrono with QuickFAQ, so if this is inappropriate - apologies in advance.

Would love to hear how I can get these last couple of things worked out.

Thanks!
Michelle
GreyHead 15 Jan, 2010
Hi Michelle,

It sounds as though you either have to 'hand-code' the MySQL or do some pre-processing (or both). You can get the last id back by using $db = $db->insertid(); immediately after an INSERT query; for the DB Connection saves ChronoForms does this for you and includes it in the data object that it creates.

I've not followed your post in fine detail so do ask again if I'm off the mark.

Bob
OHmichelle 15 Jan, 2010
Does it matter in what order ChronoForms saves data to the 2 tables?

The save to the "items" table has to occur before the save to the "category" table. I am able to save the desired category value (catid) to the category table, but I haven't been able to update the "itemid" to = "id" from "items". When I look at the 'autogenerated code' in Chrono, the save to the "category" table is before the save to the "items" table.

Is it reasonable to think I should remove the DB connection to the "category" table, let Chrono save the info to the "items" table and I hand code what I need for the "category" table?

The very last piece I need for this is the ability to update the 'itemid' in the 'category" table to the "id" (auto increment) from the "items" table.

I tried the code you provided, but once I saw the category table being accessed before the items table, I was thinking the code to grab the id wouldn't be from the items table - it would be from the category table ?
GreyHead 16 Jan, 2010
Hi Michelle,

I think the sequence only matters becasue you want to cross-link the tables. Looking at the Admin code ChronoForms does the saves in the order they appear in the drop-down - there is no way to change this without hacking the core code (or re-naming the tables to change the order). So it looks as though the best solution is to manually code the database saves.

To do this copy and paste the Autogenerated code into the OnSubmit After box, disable the DB Connection and then edit the code to do exactly what you need.

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