• Hi Detective,
    thx so much so far… your support is really extraordinary…
    Next Step:
    I need the following contents on the users.php:
    – Comments (44)
    – Posts (44)
    – Contacts (44)
    – Joined date (04. September 2008)
    – Add Contact
    – Picture upload on click at the picture
    – City, Country

    The number of comments, posts, contacts, should be automatically taken from the system.

Viewing 10 replies - 1 through 10 (of 10 total)
  • Some of your needs are not possible yet: number of comments and number of posts.

    – To display the join date you could do something like: <?php aleph_the_user_registration_date(); ?> in the user loop.
    – To display the location, you need a custom field per user named ‘from’. Currently, bbPress includes this custom field. It can be printed per user using the function <?php aleph_the_user_location(); ?>.
    – To display the “Add Contact” link, use the following: <?php aleph_the_taxonomy_link('author-contacts'); ?>.
    – To display the picture, you can use: <?php aleph_the_user_avatar(); ?>. If you want to link the picture to the upload form you need to place a link to the profile in the dashboard. It could be something like <a href="LINK_TO_YOUR_DASHBOARD"><?php aleph_the_user_avatar(); ?></a>.

    Hope it helps ??

    Thread Starter Chris Andersen

    (@chris1)

    Hi Detective,
    thanks so much for your help.
    If you look at it: users.php
    … there is still sth. to do for me.

    1. Full name: How can I make a link to the profile?
    2. User city, User country: I read the WP manual for creating custom fields and didn’t understand it. I have The extra fields: City and Country and would like to include them here. but how?
    3. The photo should be clickable and should link to the profile
    4. Comments and Contacts should link to the profile page with anchors… meaning they should jump to the headers Comments or Contacts at the profile page.

    This is my code:

    <ul>
    <li class="user-fullname"><?php aleph_the_user_complete_name('<strong class="user-name">', '</strong>'); ?></li>
    <li class="user-name" id="user-<?php aleph_the_user_ID(); ?>"><?php aleph_the_user_profile_link(); ?></li>
    <li>User City, User Country<?php aleph_the_user_location(); ?></li>
    <li><?php aleph_the_user_avatar('<li class="user-avatar">', '</li>'); ?>
    <li><a href="https://www.c-salsa.com/wp-login.php?">Upload photo</a></li>
    <li>Contacts (xx)<?php aleph_the_taxonomy_link('author-contacts'); ?></li>
    <li class="user-comments-link"><?php aleph_the_user_posts_link('Comments'); ?> (xx)</li>
    </ul>

    1. To link the full name to the profile you need to use the following code:
    <a href="<?php echo aleph_get_user_profile_url(); ?>"><?php aleph_the_user_complete_name(); ?></a>

    If you have those meta values in a user, you can access them through the following code:

    global $user;
    printf("<li>City: %s</li>', $user->city);
    printf("<li>Country: %s</li>', $user->country);

    That would work in case your custom values are stored as ‘city’ and ‘country’ in the WordPress user_meta table.

    3. Do something like 1.

    4. Sorry, don’t understand your question ??

    Thread Starter Chris Andersen

    (@chris1)

    Hi Detective,

    thx for your answer. Some things worked… great! … others are not so far.
    I have new numbers after the structure of my users.php. Click to see how it is looking like now.

    1. Name and user’s name:
    Done

    2. City / Country:
    Doesn’t work with your code.
    Background: I’m using Cimy User Extra Fields and made two new fields:
    – CITY
    – COUNTRY
    How should the code look like?

    3. Comments (xx) / Contacts(xx):
    To display the number of comments and contacts is not possible yet, you said.

    Ahh, but you didn’t tell me you were using Cimy Extra Fields :p It’s different. Try:

    City: <?php echo aleph_get_user_cimy_field('CITY'); ?>

    Thread Starter Chris Andersen

    (@chris1)

    thx 4 the answer.
    Something is happening but it is not perfect yet.
    My code looks like this:
    <li><?php echo aleph_get_user_cimy_field('CITY'); ?> | <?php echo aleph_get_user_cimy_field('COUNTRY'); ?></li>
    …and it looks like that on the site:
    users.php

    In cimy-extra-user-fields I unchecked the “Disable get_cimyfieldvalue function” because I had this error on the users.php:
    “Function disabled! Enable it via options page.”
    So there is a reaction.
    How should I change the code now?

    Are you sure your users have filled those fields ?

    Thread Starter Chris Andersen

    (@chris1)

    thx for your answer.

    You are right… some others have it.
    So this is working.

    You could do something like:

    <?php
    $city = aleph_get_user_cimy_field('CITY');
    $country = aleph_get_user_cimy_field('COUNTRY');
    if (!empty($city) || !empty($country))
    printf('<li>%s|%s</li>', $city, $country);
    ?>
    Thread Starter Chris Andersen

    (@chris1)

    That’s great! Thanks so much.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘[Plugin: Aleph] Content design: user.php’ is closed to new replies.