Do you mean user_real_name? (General)
Hi Wagner,
[…] Getting the post, date, topic ID etc. from mlf_entries turned out easy, but getting the author was more challenging since the username is stored in mlf_userdata.
Hhm, why don’t you just use the field user_name
from mlf_entries
? Note: If you run a forum where users without registration can post, this is all you have.
I suppose I have to use JOIN to map the specific posting in mlf_entries to te correct user_id from mlf_userdata?
IMHO, this would only makes sense if
- you run a forum with registered users only and
- you mandate them to state their “real name” in their profile.
If yes, I would suggest to create a new VIEW in phpMySQL which collects the required fields from mlf_entries
and mlf_userdata
(JOIN user_id
which exists in both) in order to display user_real_name
. In PHP simply query this view. Much easier – and avoids the loop (which can take ages to complete).
I have done similar stuff there. I was interested in displaying the category a post belongs to. My view is based on mlf_entries
and mlf_categories
joined by mlf_entries.category = mlf_categories.id
.
--
Cheers,
Alfie (Helmut Schütz)
BEBA-Forum (v1.8β)