Forums

Moderated submitted records

fulat2k 27 Jan, 2009
Hi folks,

I was wondering if it's possible to allow Joomla admins to moderate (approve/reject) the submitted form entry when backed by a database table. I've got a database backed form properly working. It's just missing this feature as I do not want all records to be processed by another script without being looked at by an admin.

Any help is greatly appreciated.


Thanks!
GreyHead 27 Jan, 2009
Hi fulat2k,

There is nothing like this built in to ChronoForms but it wouldn't be too hard to code. Add an approved code to the table and create a moderators form that lets them check this field.

Bob
fulat2k 28 Jan, 2009
Is there a way to create a form where only Joomla admins can access? Right now, the forms are accessible by everyone.

Thanks.
GreyHead 28 Jan, 2009
Hi fulat2k,

Yes, at the beginning of your form html check the user object and only display the form if the user is a SuperAdmin
<?php
$user =& JFactory::getUser();
if ( $user->gid == 25 ) {
 // show your form code here
}
?>

Bob

PS Code is for Joomla 1.5
fulat2k 28 Jan, 2009
If I read that PHP code correctly, that requires users to login via Joomla's administration module first and then access the CF forms URL?
GreyHead 28 Jan, 2009
Hi fulat2k,

No, logging in through the front-end gives the same user info.

Bob
fulat2k 28 Jan, 2009
Got it. Thanks for your help. By the way, one last question🙂

I have enabled file upload in the form to store an image. Is there an easy way I can redisplay the image?🙂
GreyHead 28 Jan, 2009
Hi fulat2k,

Yes, the image info is in the $attachments['field_name'] array you can get the url from this and create an <img . . . /> tag

Bob
fulat2k 28 Jan, 2009

Hi fulat2k,

Yes, the image info is in the $attachments['field_name'] array you can get the url from this and create an <img . . . /> tag

Bob



Hi Bob,

Does that work when I want to redisplay the records from the database?
GreyHead 28 Jan, 2009
Hi fulat2k,

No, that will only work immediately after the form is submitted. You'll need to make sure that the form path/url is saved in the database if you want to recall it later.

Bob
geeknet 29 Aug, 2009
HI Bob,

Im trying to use this code to moderate the records, but I cant let it work
is there something Im missing, do I have to put this in CF or CC.

<?php
$user =& JFactory::getUser();
if ( $user->gid == 25 ) {
// show your form code here
}
?>



Thanks

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

VPS & Email Hosting 20% discount
hostinger