Showing old field content until updated content is approved?

4 posts by 2 authors in: Forums > CMS Builder
Last Post: July 1, 2015   (RSS)

By gkornbluth - June 22, 2015

Hi all,

Just thinking.

Has anyone worked out an easy way to show the original content of a database field on a site until updated content for that field has been approved by the section admin (some time later)?

I already send an email to the section admin informing each time there's an update, but it might be a while before the update can be approved..

Don't know, maybe I'm just not thinking clearly today, but if I toggle the hidden check box, after the update, (as I would with entirely new record) the entire record will be hidden until the update is approved, and that's not the result I'm looking for..

Updates are accomplished by a front end form, and I thought of creating a temp field for each changeable field and switching back and forth somehow, but that felt like it would get really complicated, really quickly.

Maybe not though, and I thought I'd throw it out to the experts before I started down a garden path that might lead me over a cliff.

Thanks for looking,

Jerry Kornbluth

The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

By gkornbluth - July 1, 2015

Hi Dave,

Thanks for looking at this.

I kind of thought that a front end form and duplicate fields might be the way to go, but I don't have a cllue how to copy them into the approved fields at the click of an approved button.

Were you thinking of a front end form fort that also?

Any pointers?

Best,

Jerry Kornbluth

The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

By Dave - July 1, 2015

Hi Jerry, 

Well it's definitely going to need you to do some custom programming, but what I do what I have a complicated problem is just break it down into steps:

  1. Create CMS section with two fields, city and pending_city
  2. Create a front end form that updates the value of pending_city when you save it
  3. Create another form with a button that copies the pending value to the current value
  4. Expand fields that are needed
  5. Figure out how to make it user specific
  6. Integrate all the code together and ensure it does what you need

Here's some sample code for updating the field: 

$tableName    = "about";
$recordNum    = 1;
$colsToValues = array(
  'city=' => 'pending_city',
);
mysql_update($tableName, $recordNum, null, $colsToValues);

Good luck!

Dave Edis - Senior Developer
interactivetools.com