Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author J.D. Grimes

    (@jdgrimes)

    Is there a way to show the rank of the blog site admin on a multisite network?

    Where, specifically, do you want to display the rank? You can use a shortcode to display it in a post.

    Thread Starter kirkward

    (@kirkward)

    I would like to show it on the blog home page. Most likely have to use the php do_shortcode thing.

    I woulde like to embed it in the template and have it automatically id the site admin. Again, probably a php to get_site_admin (if there is such a function) and insert the id.

    I was just wondering if this ability already existed. Mostly so visitors to a network could compare site activity to see who the most active admins or sites were, and encourage the admins to be more active by embedding it where they cannot remove it.

    Plugin Author J.D. Grimes

    (@jdgrimes)

    Yep, I think a custom template is what you need.

    Thread Starter kirkward

    (@kirkward)

    See any problems with using the do_shortcode with your plugin?

    Plugin Author J.D. Grimes

    (@jdgrimes)

    No, that should work. However, it is better to avoid do_shortcode() when possible. You can use this instead:

    WordPoints_Shortcodes::do_shortcode( $atts, $content, 'wordpoints_user_rank' );

    That would be the best way to do it. $atts is the attributes, as an array (like array( 'attr' => 'value' )). $content is any content you’d want the shortcode to have (which in this case would just be empty).

    This will work for all of WordPoints’s shortcodes, you just need to change the third parameter to be the name of the shortcode you wan to use.

    Thread Starter kirkward

    (@kirkward)

    How would I specify the user in that code? Would it be like this?

    , 'wordpoints_user_rank user_id="5"' );

    (Assuming the site_admin user id = 5)

    Thread Starter kirkward

    (@kirkward)

    P.S. – I have a feeling this will be a very popular plugin.

    Thread Starter kirkward

    (@kirkward)

    I just tried the code and am getting this error

    Shortcode error: The “rank_group” attribute of the [wordpoints_user_rank] shortcode must be a rank group slug.

    I want to show the rank for a particular author (the site admin) and for a particular rank group, “activity.”

    I am not a coder, so how would I put them into $atts?

    Thanks,
    Kirk

    Thread Starter kirkward

    (@kirkward)

    Just noticed this had been marked as resolved, but my lack of coding skills prompted me to ask the above couple of questions, so I re-opened it for the previous two questions.

    Thanks,
    Kirk

    Plugin Author J.D. Grimes

    (@jdgrimes)

    Hi Kirk,

    Here is the code you would use:

    WordPoints_Shortcodes::do_shortcode(
       array( 'user_id' => 5, 'rank_group' => 'points_type-' . wordpoints_get_default_points_type() ),
       '',
       'wordpoints_user_rank'
    );

    Sorry I didn’t reply right away, I was taking a lunch break. ??

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Show Rank By Blog Admin’ is closed to new replies.