Forums

use chronoforms for users to place advertisements.

Fishhead 12 Nov, 2008
Dear all,

I have the following case, looking for tips whether a) I can build this in Chronoforms / Chronoconnectivity b) how to do so.

I want to build a website where users can post advertisements that are displayed in a table layout. This was easy to do with Chronoform / Chronoconnectivity using an underlaying Joomla table to store the data.

However, I want to add something extra: The user has to be able to modify / delete his own advertisements. For this, I need to:
- Create a page in the frontpage where a certain advertisement can be edited / deleted.
- Take care that only the 'owner' of a certain advertisement can edit / delete his own advertisement.

The first part seems to be possible in Chronoforms / ChronoConnectivity, but how to do this?

For the second part, I need to 'link' a certain user to his own advertisements. This can possibly be done in 2 ways:
1) Send him a dedicated email with a link to the page where he can delete / edit his own advertisement or
2) Take care that the user is registered, and give him an option to look-up the advertisements posted under his own account.

I am not sure whether option 1 is possible. Regarding option 2, this seems to be possible, but I have to find out how. Again - any tips & tricks are welcome.

Again thanks for these fine tools you've created, Hopefully I find the way how to use them well!

Kind regards, Fishhead
Max_admin 12 Nov, 2008
Hi Fishhead,

I like #2, only registered users can edit/delete their ads, do you have a field in your table to store the ad submitter id ? you need one, and then on Connectivity, you need to check per row if the current logged in user has the same id as this row and if so show the edit/delete link, Connectivity will take care that if no edit/delete link is show per some row then the logged in user will have permission to edit/delete this row!

you can show me your body code and I can show some code example!

Regards
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Fishhead 13 Nov, 2008
Dear Max,

Again thanks for your offer to help, I now know in what direction to look for, i will try to find out how to continue myself first.

I will at least show my result when I am ready!

Gr. Fishhead

Ps. Do you consider it wise / unwise to use the user's email as reference?
Max_admin 13 Nov, 2008
Of course an account and a secure login is the best way to achieve this, even if the email solution looks easier or quicker but its very limited and may show more problems later!

Regards
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
purple knight 09 May, 2009
Hallo Max,

I also have a similar situation like Fishhead. There's a section where guest user can post their information/pictures in a chronoform (some input fields are email/phone number/name...). And I hope they can come back to edit it, should there be any changes/update to the info.

Q1. How do I make this chronform exclusive to this group of guest users? So they can only post after being registered users.
Q2. How to edit my chronoform/chronoconnectivity such that these users can come back to check what they posted & edits? (Pretty much like phpbb forums, where u can check your posts & edits).

Thank you very much. 😀
GreyHead 09 May, 2009
Hi Purple Knight,

At the beginning of the form html do a check on the user id and use that either to display user specific info or to redirect unwanted users. If the user->id is 0 then they are a guest and you can redirect them somewhere else. If they are a registered user then call up their data from the database table and use that to set the values on your form.

Bob
purple knight 10 May, 2009
Hi Bob,

Wow! I learnt something new. So I see a difference between posting articles as a guest or as registered member. When I post as a guest, the cf_user_id=0. And when I post as a member, the cf_user_id=63. 😀

At the beginning of the form html do a check on the user id and use that either to display user specific info or to redirect unwanted users

So how do I execute this? Is there any code for checking of the user id?

Thanks a lot! 🤣
Max_admin 10 May, 2009
Hi purple knight,

you can check the user id for the current use using :

$user =& JFactory::getUser();
$userid = $user->id;

then you need PHP to compare this userid value to the cf_user_id in the record!

to manage viewing/editing of records you better use ChronoConnectivity which is built to do this, you may play with it for now but I'm preparing a new release soon and will have a nice tutorial too!

Regards
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
purple knight 11 May, 2009
Hi Max,

That sounds exciting with more new releases! Getting better and better! 😀

For your advise, I may not quite understand. Oops. Where do I put this code under? Like under Chronoform or Chronoconnectivity? And which portion should it go under?

you can check the user id for the current use using :

$user =& JFactory::getUser();
$userid = $user->id;

then you need PHP to compare this userid value to the cf_user_id in the record!


😀
GreyHead 11 May, 2009
Hi Purple Knight,

Wherever you want to control the user access. This sub-thread started talking about a ChronoForm that you wanted to control. But you can use similar code in ChronoConnectivity for exanple to hide some records or columns from some user groups.

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