• Hi,

    I updated the Aleph plugin to 0.8.1. It now works ok with WordPress 2.7.1.

    I’ll start working on new features (specially those listed in the FAQ, but if you need anything, just say it, perhaps I can do it ?? (of course regarding Aleph ?? ).

    Thank you.

Viewing 10 replies - 16 through 25 (of 25 total)
  • Thread Starter Detective

    (@detective)

    That’s because the code sorts by login. To sort by another field (those not in the table wp_users, like display name) it’s harder, but not impossible. It could be something like this:

    add_action('users_queried', 'my_custom_order');
    function my_custom_order() {
    global $aleph_query;
    if (!is_user_view()) return;
    $users &= $aleph_query->users;
    
    $sort_keys = array();
    foreach ($users as $key => &$user) {
    $sort_keys[$key] = $user->display_name;
    }
    asort($sort_keys);
    
    $new_users = array();
    foreach ($sort_keys as $key => $display_name) {
    $new_users[] = $users[$key];
    }
    $users = $new_users;
    $aleph_query->queried_object = $users[0];
    }

    This is not tested, but it’s how I would code a quick solution for your problem. (if you use this you can remove the previous code).

    Hmm. I looked in template-tags.php for any information on adding the E-Mail Address field to a user’s profile, but I couldn’t find one. What could I insert in profile.php to enable this? Thanks!

    BTW, the website I’m working on has been moved to: https://www.bbnto.com .

    Thread Starter Detective

    (@detective)

    What about the function aleph_the_user_email ? Try something like this (not tested):

    function display_user_email() {
    <dt>Email</dt>
    <dd><?php aleph_the_user_email(); ?></dd>
    <?php } ?>
    add_action('aleph_user_profile_fields', 'display_user_email');

    Hello everybody,

    Detective, your magnifying glass and wise brain please! I am trying to configure a search page which displays users based on their CIMY meta data. In the FAQ on the plugin homepage it says:

    After the plugin is loaded, you can add new lists/views using a special function called aleph_register_view:

    dd_action('init', 'my_aleph_views', 100);
    
    function my_aleph_views() {
        aleph_register_user_view('view_slug', 'My User List', 'user_key=some_meta_key');
    }

    …The third parameter is the “user query”, in this case, we are querying for users that have a custom user_meta of key some_meta_key.

    I’ve tried everything to make it reference the CIMY Extra Field (which is called “role”) but can’t work it out. Any ideas? Your help would be massively appreciated; I’m building a radio station website with DJ profiles… it should be cool! But there’s also local business profiles, so I’d like to separate them into two user lists using a search query. Any ideas?

    So far I’ve got:

    function my_aleph_views() {
        aleph_register_user_view('business', 'Business Users', 'user_cimy_field_role2=$role2');
    }

    in my template-tags file. It correctly outputs a search page, and a heading called “Business Users” in the widget, but I can’t for the life of me get the third bit working.

    Many thanks indeed,

    Ali

    p.s. awesome plugin by the way!!

    Thread Starter Detective

    (@detective)

    That won’t work because the meta_key refers to a key in the usermeta table, and CIMY uses another table for its data.

    However, I think it’s possible to do what you need.

    First, register a view with a dummy key, like wp_user_level or something like that. Then, create a plugin wich adds a filter on the SQL query for users. There you can create a JOIN with the CIMY table and look for the value you need.

    It’s not perfect, but at least it should work.

    I’m working on a new version of the plugin, more flexible and extensible, and easier to use, but I have other projects with higher priority, so I can’t offer a better version yet.

    Hi Detective,

    OK, that sounds simple enough. However, I’m not great at PHP and MySQL. I’ve never written a plugin before, and don’t really speak the lingo (am learning!). Below is my first attempt. Firstly though, this is what I’ve now got in my template-tags.php file:

    add_action('init', 'my_aleph_views', 100);
    
    function my_aleph_views() {
        aleph_register_user_view('Business', 'Business Users', 'wp_user_level=administrator');
    }

    The new plugin looks like this, and doesn’t work!

    <?php
    /*
    Plugin Name: CIMYUSERS
    Plugin URI: https://www.aliblackwell.com
    Description: Joins the CIMY and WordPress User Fields
    Version: 0.1
    Author: Ali Blackwell + Detective
    Author URI: https://www.aliblackwell.com
    */
    SELECT *
    FROM wp_user
    JOIN wp_cimy_uef_fields
    ON wp_user.id=wp_cimy_uef_fields.id
    ?>

    When I activate the plugin it says:

    Parse error: syntax error, unexpected T_STRING in /home/totallyt/public_html/shoreditchradio.co.uk/site/wp-content/plugins/cimyusers.php on line 11

    I’ve tried different syntax, but I can’t get it working. Any ideas? I appreciate you’re probably very busy, and you’ve already been amazing producing this wonderful plugin, but I’d be immensely grateful of your help!

    Many thanks,

    Ali

    I am trying to get all the Cimy fields to display on the profile page (all the Cimy extra fields) right now I have one extra field displaying on the profile page. Code is below tks. Your plugin is awesome!

    <?php get_header(); ?>

    <!–

    This is a example template for Aleph.
    The function aleph_user_profile() outputs a formatted profile. You need to put it between the adequate markup of your template.

    –>
    <div id=”content” class=”narrowcolumn”>

    <?php
    add_action(‘aleph_user_profile_fields’, ‘display_user_cimy_field’);

    function display_user_cimy_field() {
    $address = aleph_get_user_cimy_field(“address”);
    if ($address) {
    echo ‘<dt>Address</dt>’;
    echo ‘<dd>’ . $address . ‘</dd>’;
    }
    }
    aleph_user_profile(
    array(
    ‘before_title’ => ‘<h2 class=”center”>’,
    ‘after_title’ => ‘</h2>’,
    ‘before_section’ => ‘<div class=”entry”><h3>’,
    ‘after_section’ => ‘</h3>’,
    ‘before_avatar’ => ‘<div style=”float: right;”>’,
    ‘after_avatar’ => ‘</div></div>’
    )
    );
    ?>

    </div>

    <?php get_sidebar(); ?>

    <?php get_footer(); ?>

    Secondly, I cant get the user list to show up. I am also using member list, would that interfere?

    lcfcountryclub.com/blog

    Hi Arlieth Tralare,

    I have some questions regarding how you managed to edit your profile page. And how you were able to show the e-mail?

    Please respond to me here or to jakob[dot]wallsten[at]gmail[dot]com

    Take Care,

    Jakob

    Hi Jakob,

    The email is actually a custom field in CIMY. It worked out because some of the users had a private email and a business email that were separate anyways, but usually they would just input their email twice.

    As for editing the profile page, in truth some very messy cut and paste had to be done. Instead of calling the header/footer/etc for the profile page, I had to cut and paste the header/footer code in the order that they would be called. This gave me some additional flexibility in the end as the top advertisement banner was removed for the profile page. If you pull the source code for the profile page, by and large that is what it looks like in the back end. Hope this helps, but if you have more questions please email me at arlieth[at]gmail[dot]com.

    To Detective: As a feature, I am still waiting for custom member URL slugs! That’s probably the last major change I am looking for. A while back I bought some books for you through your Amazon Wish List, I never heard back so I hope they got to you okay!

Viewing 10 replies - 16 through 25 (of 25 total)
  • The topic ‘[Plugin: Aleph] Needed features?’ is closed to new replies.