Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8728365
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:37:28+00:00 2026-06-13T08:37:28+00:00

I create some custom user profile fields, I just create a edit user profile

  • 0

I create some custom user profile fields, I just create a edit user profile plugin (adding the fields in profile.xml etc). Now when I create a user or edit it, I have classic profile fields(city, addres etc..) and my own fields.
I create user profile page that display all the fields, but I’d like to edit this page. I’d like display only my fields or add some css class etc..

How can I edit it? Where can i found it?

In another way I create another page, with a php plugin I can add some code. How can I access to my custom fields?
I tryed with
http://docs.joomla.org/Accessing_the_current_user_object
but I can only access to the default fields.

Does anyone know how to access these variables?

ps this is what I write in my article with php:


    $user =& JFactory::getUser();

    $userId = $user->id;

    $db = &JFactory::getDbo();
        $db->setQuery(
            'SELECT * FROM phs_user_profiles WHERE user_id = '.$userId.' AND profile_key      LIKE \'myfilevalue1.%\''
        );
    $results = $db->loadAssocList();
    if($results) echo $results[0]['profile_value'];
    else echo "dont work";

it display “dont work” 🙁

what’s wrong with this code?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T08:37:29+00:00Added an answer on June 13, 2026 at 8:37 am

    A simple way you need to edit com_users view (profile) and in the profile view you can access user on this by :-

    $user =& JFactory::getUser();
    
     //firstly check you got this.  
    echo  $userId = $user->id;
    // then you can access all fields using userid.
        $db = &JFactory::getDbo();
        $query = "SELECT * FROM phs_user_profiles WHERE user_id = ".$userId;
            $db->setQuery($query);
        $results = $db->loadAssocList();
    // print result using print_r($results); if you get
        if($results) echo $results[0]['profile_value'];
        else echo "dont work";
    

    also check the link http://docs.joomla.org/Accessing_the_database_using_JDatabase

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I extended JDialog to create a custom dialog where the user must fill some
I am using the WordPress theme Studio8 and I have create some custom forms
I have authored some custom classes that I would like to create using XAML:
EDIT It appears the user has to enter some data for his profile, otherwise
I have decided that I wanted to create some custom dialog classes that could
I'd like to create some custom data types, but I don't think I'm asking
I'm trying to create a MIME filter to do some custom processing of resources
Is there some way to create a custom (WoW64) shared registry key? By default
I'm trying to create a custom form input that utilizes some images, it should
I'm having some trouble finding out how to create a custom transformer that can

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.