ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Custom Profile Data Tag problems

October 07, 2008 5:31am

Subscribe [2]
  • #1 / Oct 07, 2008 5:31am

    brad8

    5 posts

    The Custom Profile Data Tag does not seem to respond.  My code is:

    {exp:member:custom_profile_data member_id="2"}
    
    <div>{screen_name}</div>
    <div>{url}</div>
    <div>{location}</div>
    <div>{email}</div>
    
    {/exp:member:custom_profile_data}

    It does not seem to work with or without the member_id attribute.  “{screen_name}” and “{email}” do output but apparently as global variables hinted by the fact they always take on the form of the currently logged in user not the member specified in the “member_id” attribute.  Plus “{url}” and “{location}” output as code. ie. with the brackets as follows:

    <div>brad</div>
    <div>{url}</div>
    <div>{location}</div>
    <div>my_email</div>

    using “my_email” because I don’t want to post actual email on this board due to spam bots.

    A couple of notes:

    I am using version 1.6.4

    This is used in a template accessed via the TEMPLATES tab in the Control Panel, not in member profile or forum templates.

    The Custom Profile Data Tag is not used inside another tag like a weblog entries tag

    I do have url and location data in the profiles tested

    Member management module is installed

    Its probabley something stupid I’m missing.  Thank in advance for the help!

    Brad

  • #2 / Oct 07, 2008 10:39am

    Robin Sowell

    13255 posts

    Hm, don’t see where you’re missing anything.  I did a copy/paste and it worked fine on mine, so something seems odd.  Keep the member_id in there- make it for some member who is not you, so you’re sure whether it’s globals parsing.  And make sure that member has data!

    Then create a test template- put JUST the example you gave above on it.  Get anything useful?  If not- flip ‘template debugging’ on in ‘Admin- System Prefs- Output and Debug’.  Compare to my example, testing the same way- note, I’m just pasting the relevant snippet:

    0.156850) Parsing Tags in Template
    (0.156943) Tag: {exp:member:custom_profile_data member_id="2"}
    (0.157186) Closing Tag Found
    (0.157328) Processing Tags
    (0.157382) Module Tag: Member/custom_profile_data
    (0.157428) Including Files for Tag and Modules
    (0.185333) Beginning Final Tag Data Processing
    (0.185401) Calling Class/Method: Member/custom_profile_data
    (0.185731) -> Class Called: Member
    (0.191206) -> Method Called: custom_profile_data
    (0.263453) -> Data Returned
    (0.263592) - End Tag Processing -

    Does it look like the tag is processing ok?  See anything odd?

  • #3 / Oct 08, 2008 1:05am

    brad8

    5 posts

    I did as you instructed putting the code in a test template with no other code except the most basic html (html tag, head tag, body tag).  Same problem, but oddly enough the {location} is now outputting, in both the test template and in the original template too???  {url} still does not output and appears with the brackets.  Of course the output is based on who is logged in NOT on who is specified in the “member_id” attributed.  The debugging code that gets outputted is exactly the same as you posted, word for word.  So maybe the custom profile data tag is processing as it at least says it is in the debugging code, but it is sure not outputting right.  By the way, if it makes any difference, I am using your EE hosting.

    Thanks for your continued help with this Robin.

    Brad

  • #4 / Oct 08, 2008 12:05pm

    Robin Sowell

    13255 posts

    Hm- let’s see if anything is odd with the data.  Try this in the query form- ‘Admin- Utitlities- SQL Manager’:

    SELECT m.*, d.* FROM exp_members m, exp_member_data d WHERE m.member_id = d.member_id AND m.member_id = 2

    Make sure the m.member_id specified is the same one you’re using to test the tag.

    Then we’ll probably flip ‘show queries’ on and make sure the query’s right on test page.

  • #5 / Oct 08, 2008 1:07pm

    brad8

    5 posts

    Using your select statement you gave me I got a table with the correct information, that is information from the member where member_id=“2” and I was logged on as someone else.  username, location, url, email data where all present and correct (as well as other data)
    Here is the outputed SQL debuging info:

    SQL QUERIES
    1
    SELECT es.* FROM exp_sites AS es WHERE es.site_id = '1'
    2
    SELECT member_id, admin_sess, last_activity FROM exp_sessions WHERE session_id = 'd7e07aa3b2ffc225fe15f3292bb56c21eb2f56cb' AND ip_address = '76.88.17.95' AND user_agent = 'Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en'
    3
    SELECT m.weblog_id, m.tmpl_group_id, m.username, m.screen_name, m.member_id, m.email, m.url, m.location, m.join_date, m.last_visit, m.last_activity, m.total_entries, m.total_comments, m.total_forum_posts, m.total_forum_topics, m.last_forum_post_date, m.language, m.timezone, m.daylight_savings, m.time_format, m.profile_theme, m.forum_theme, m.private_messages, m.accept_messages, m.last_view_bulletins, m.last_bulletin_date, m.display_signatures, m.display_avatars, m.last_email_date, m.notify_by_default, m.ignore_list, m.upload_id, m.cp_theme, m.quick_links, m.quick_tabs, m.template_size, g.* FROM exp_members AS m, exp_member_groups AS g WHERE g.site_id = '1' AND unique_id = '8bde4986fbb8ddd5840a8056d7d4ebbe9ef09415' AND password = '2dd8743f41c23ce85131c402a259fb4b530e1098' AND m.group_id = g.group_id
    4
    SELECT weblog_id, blog_title FROM exp_weblogs WHERE site_id = '1' AND is_user_blog = 'n' ORDER BY blog_title
    5
    SELECT module_id FROM exp_module_member_groups WHERE group_id = '1'
    6
    SELECT template_group_id FROM exp_template_member_groups WHERE group_id = '1'
    7
    SELECT site_id, site_label FROM exp_sites ORDER BY site_label
    8
    UPDATE `exp_sessions` SET `session_id` = 'd7e07aa3b2ffc225fe15f3292bb56c21eb2f56cb', `member_id` = '1', `admin_sess` = '1', `ip_address` = '76.88.17.95', `user_agent` = 'Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en', `last_activity` = '1223498769' WHERE session_id ='d7e07aa3b2ffc225fe15f3292bb56c21eb2f56cb'
    9
    SELECT COUNT(*) AS count FROM exp_security_hashes WHERE hash = '40b66501d1de3ec660b81240a7918c1f25dcddc5' AND ip_address = '76.88.17.95' AND date > UNIX_TIMESTAMP()-14400
    10
    DELETE FROM exp_security_hashes WHERE date < UNIX_TIMESTAMP()-14400 AND ip_address = '76.88.17.95'
    11
    SELECT SQL_CALC_FOUND_ROWS m.*, d.* FROM exp_members m, exp_member_data d WHERE m.member_id = d.member_id AND m.member_id = 2 LIMIT 0, 100
    12
    SELECT FOUND_ROWS() AS total_rows
  • #6 / Oct 08, 2008 1:08pm

    brad8

    5 posts

    Too much data for one post, had to split it…


    After turning on sql debugging and testing my test template it gave me the following sql statements:

    SQL QUERIES
    1
    SELECT es.* FROM exp_sites AS es WHERE es.site_id = '1'
    2
    SELECT member_id, admin_sess, last_activity FROM exp_sessions WHERE session_id = 'd7e07aa3b2ffc225fe15f3292bb56c21eb2f56cb' AND ip_address = '76.88.17.95' AND user_agent = 'Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en' AND site_id = '1'
    3
    SELECT m.weblog_id, m.tmpl_group_id, m.username, m.screen_name, m.member_id, m.email, m.url, m.location, m.join_date, m.last_visit, m.last_activity, m.total_entries, m.total_comments, m.total_forum_posts, m.total_forum_topics, m.last_forum_post_date, m.language, m.timezone, m.daylight_savings, m.time_format, m.profile_theme, m.forum_theme, m.private_messages, m.accept_messages, m.last_view_bulletins, m.last_bulletin_date, m.display_signatures, m.display_avatars, m.last_email_date, m.notify_by_default, m.ignore_list, g.* FROM exp_members AS m, exp_member_groups AS g WHERE g.site_id = '1' AND unique_id = '8bde4986fbb8ddd5840a8056d7d4ebbe9ef09415' AND password = '2dd8743f41c23ce85131c402a259fb4b530e1098' AND m.group_id = g.group_id
    4
    UPDATE exp_members set last_activity = '1223498718' WHERE member_id = '1'
    5
    UPDATE `exp_sessions` SET `session_id` = 'd7e07aa3b2ffc225fe15f3292bb56c21eb2f56cb', `member_id` = '1', `admin_sess` = '1', `ip_address` = '76.88.17.95', `user_agent` = 'Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en', `last_activity` = '1223498718' WHERE session_id ='d7e07aa3b2ffc225fe15f3292bb56c21eb2f56cb'
    6
    SELECT * FROM exp_online_users WHERE site_id = '1' AND date > 1223497818 AND weblog_id = '0' ORDER BY name
    7
    UPDATE `exp_online_users` SET `weblog_id` = '0', `member_id` = '1', `name` = 'brad', `ip_address` = '76.88.17.95', `date` = '1223498718', `anon` = 'y', `site_id` = '1' WHERE site_id = '1' AND ip_address = '76.88.17.95' AND member_id = '1'
    8
    SELECT * FROM exp_stats WHERE site_id = '1' AND weblog_id = '0'
    9
    UPDATE exp_stats SET last_visitor_date = '1223498718' WHERE site_id = '1' AND weblog_id = '0'
    10
    SELECT group_id FROM exp_template_groups WHERE group_name = 'dealer_listings' AND site_id = '1'
    11
    SELECT COUNT(*) AS count FROM exp_templates WHERE group_id = '6' AND template_name = 'dealer_list_test'
    12
    SELECT exp_templates.template_name, exp_templates.template_id, exp_templates.template_data, exp_templates.template_type, exp_templates.edit_date, exp_templates.save_template_file, exp_templates.cache, exp_templates.refresh, exp_templates.no_auth_bounce, exp_templates.enable_http_auth, exp_templates.allow_php, exp_templates.php_parse_location, exp_templates.hits, exp_template_groups.group_name FROM exp_template_groups, exp_templates WHERE exp_template_groups.group_id = exp_templates.group_id AND exp_template_groups.site_id = '1' AND exp_templates.template_name = 'dealer_list_test' AND exp_template_groups.group_name = 'dealer_listings'
    13
    UPDATE exp_templates SET hits = '18' WHERE template_id = '74'
    14
    SELECT module_version, module_name FROM exp_modules
    15
    SELECT m_field_id, m_field_name, m_field_fmt FROM exp_member_fields
    16
    SELECT * FROM exp_member_data WHERE member_id = '2'
    17
    SELECT id, url FROM exp_upload_prefs
    18
    SELECT variable_name, variable_data FROM exp_global_variables WHERE site_id = '1' AND user_blog_id = '0'

    I can see from line 16 that it is grabbing member_id=“2” but the output is still from the the currently logged in user.  Hopefully this info will help you help me sort this out.

    Thanks as always,

    Brad

  • #7 / Oct 08, 2008 2:28pm

    brad8

    5 posts

    I figured out what the issue was, it’s working now.  I recently upgraded from 1.6.0 to 1.6.4 and when this change occurred the system directory went from /eesys/ to /system/  I didn’t make this change in path.php :grrr: so no wonder things where behaving weird!  Can you think of anything I should change or check that might be influenced by using a new systems directory?

  • #8 / Oct 08, 2008 3:05pm

    Sue Crocker

    26054 posts

    Brad, have you seen this KB article?

    How Do I Move EE to another server

    It has information on where to check for pathing.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases