vingstaf
Forum Replies Created
-
Forum: Plugins
In reply to: [Contact Form DB] Show db values in user profilesAlrighty! I think this would be a smoother solution to one of my previous issues aswell, regarding viewing database entries for specific entries seemingly untied to one’s user account. Would this sort of code work for example?
// My form filter function myFilter($formData){ $formName = 'testform'; // change this to your form's name // Can I set up alot of what-ifs like this? if ($formData->posted_data['group']->group-a) { $formData->posted_data['leader'] = //Sorry for the following brutal make-belief line. Regards, non-techy. I want the following line to print a registered user with a user profile field named user_leader_of that reads exactly the same as the submission in ['group'], in this case group-a. (%user_leader_of% == group-a) return $formData; } add_filter('cfdb_form_data', 'myFilter');Like, is there an action that can fetch a line from a user profile, checking whether a submitted field in the cf7 form corresponds to a field in a user profile. If doable, this would make it so much cleaner for me, if the form could automatically create this field in the background, so that a user with user_leader_of set to group-a can then navigate the db with correct rights.
Alright, that clears up confusion. I’d however suggest rephrasing, to something along the lines of “Select which profile fields users can fill in/modify”, as “see” would imply that you can chose which ones the users also can not see, which would be a hidden field.
Great plugin either way, and thanks for support 🙂
Regards,
ErikForum: Plugins
In reply to: [Contact Form DB] Showing different parts of database to different peoplefilter="dropdown-of-group-leaders=$user_login"I added this thing to my code, and it actually worked! As someone who knows little about PHP, this saves me some headache. Thanks a bunch again Michael, for this plugin and for your helping efforts.
Forum: Plugins
In reply to: [Contact Form DB] Showing different parts of database to different peopleHm, how about I add an extra field in the form requiring them to select the name of the leader of the group?
The leader, John Doe, of Group A, is signed up as John Doe.
10 people sign up and choose Group A from a drop-down for the name of the group, and they choose John Doe from a (manually text-filled) drop-down for the name of the leader.Would something like %user_thingy% (however the format is) be able to find and understand that extra column and identify the drop-down “John Doe” as the leader user’s login name?
I hope my thinking’s made clear here haha. My thinking is that John Doe then should be able to view all entries in the database where he’s been chosen as the group leader upon signup.