Like Chris said, you can use the {user:user_login}
fields anywhere in the form definition.
I have a similar situation where I included that in the form submission itself:
- created a hidden field in the form
- set its default value to
{user:user_login}
So, for logged in users, that hidden field will contain his username. For guest users, that field will be empty, so it won't even exist in the lead details db table.
Your db query would therefore be something like this (with example filter.*
values):
select entry.id, entry.lead_id, entry.field_number, entry.value
from wp_rg_lead_detail entry
left join wp_rg_lead_detail filter on filter.lead_id = entry.lead_id
where filter.form_id = 1
and filter.field_number = 1
and filter.value like '%username%'
order by entry.lead_id, entry.field_number;
Posted 13 years ago on Friday July 15, 2011 |
Permalink