WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] [Plugin: Aleph] Content design: user.php (11 posts)

  1. Chris Andersen
    Member
    Posted 5 years ago #

    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.

  2. Detective
    Member
    Posted 5 years ago #

    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 :)

  3. Chris Andersen
    Member
    Posted 5 years ago #

    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="http://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>
  4. Detective
    Member
    Posted 5 years ago #

    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 :(

  5. Chris Andersen
    Member
    Posted 5 years ago #

    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.

  6. Detective
    Member
    Posted 5 years ago #

    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'); ?>

  7. Chris Andersen
    Member
    Posted 5 years ago #

    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?

  8. Detective
    Member
    Posted 5 years ago #

    Are you sure your users have filled those fields ?

  9. Chris Andersen
    Member
    Posted 5 years ago #

    thx for your answer.

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

  10. Detective
    Member
    Posted 5 years ago #

    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);
    ?>
  11. Chris Andersen
    Member
    Posted 5 years ago #

    That's great! Thanks so much.

Topic Closed

This topic has been closed to new replies.

About this Topic