e107help.org Q&A
0 like 0 dislike

Does anyone know how I can display shortcodes & user data on a page?

lets say I am using a custom page

 

<?php 
require_once("class2.php");
require_once(HEADERF);
$ns->tablerender("Welcome", "This is a Blank Template,");
echo ('') .SITENAME."\n";
require_once(FOOTERF);
exit;
?>

the above simply displays the sitename, but how can I display the users "username" and the extended field that I already created?

I have tried a few times with no success, I think I need an example as Im doing something wrong, if  someone could please help how I show the current users data plus shortcodes {user}, they seem even harder and fail me everytime it seems

thank you
Teesha

e107 version 2.18
asked in Core by (15 points) 3

1 Answer

0 like 0 dislike
answered by (1.4k points) 10 52 63
There are 2 types of extended fields.  For example birthday is core extended field. And there are custom extended fields.

If you need example how to use core extended field, you can see at birthday plugin on my site.

Sorry, I don't use custom extended field anywhere.   But if it works at user profile page (standard), you have something wrong.  If not, create issue on github.

print_a(USERID);

$qry = "
SELECT u.*, ue.* FROM #user AS u
LEFT JOIN #user_extended AS ue ON ue.user_extended_id = u.user_id
WHERE u.user_id=".intval(USERID);
$sql->gen($qry);
$udata=$sql->fetch();

print_a($udata);
print_a($udata['user_type']); 

 

It was at that link I gave you in first answer. I tried it on contact page.

Result:

 

I did look at the link you gave me, and didnt quite understand it...

I am using a custom field... I should have noted that,

 

Waht I said was I tried to scalp the user_ page (template) since it did display the field fine, but wont show in my version without all the extra stuff...

I guess my understanding is that user data is floating around somewhere in a variable, just how to properly display the field, I can do name & email, and all the standard ones fine, this is only my first year in school so im struggling with a few things and teacher is busy with kids that are more lost, i study all the time but this is hard

anyways thanks, I try working with what you sent

 

thanks
Tasha
Maybe there is other way, but I don't know it.
Welcome to e107 Q&A, where you can ask questions and receive answers from other members of the e107 community.
768 questions
1,177 answers
2,005 comments
1,525 users