Jump to content

DanMat

Members
  • Posts

    9
  • Joined

  • Last visited

DanMat's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. If you arent logged in you can't view the website. Its a private community. and I know exactly what current_user means i think its pretty straight forward. About what I am trying to do : You have a status of "guru" yeS ? If you were also an admin I would want to display that your status of admin. To all users. If you'd have a moderator status I want to display Moderator for all user not just for the user in cause. If you dont understand what I mean please don't bother to post just to add more posts to the count and get a status of guru. And I can say whatever I want so stop it.
  2. displays rank for admin users -> newbie or rookie. or whatever rank is set.
  3. It doesnt change anything. I've tried in n ways but no luck.
  4. Yes that's it. I've tried it like this <?php if (current_user_can( 'manage_options' )) { echo 'admin' } elseif (current_user_can( 'moderate_comments' )) { echo 'moderator' } else ( function_exists('get_user_rank') ) echo get_user_rank(); ?> but no luck so far.
  5. it doesn't do the trick otherwise I wont be here asking for help. either I don't implement it where I should or I am missing something. Overrall no problem
  6. So. I am using a plugin called "simple user rank" which counts the number of comments and displays a different rank. All good. But I don't want my admins/moderators to be displayed as newbies/rookies or any other rank just because they don't comment that much. This is how the plugin works and displays the rank if( !function_exists('get_user_rank') ) { function get_user_rank() { if( !$ranks = get_option('_user_rank_comments_fields') ) return false; $count = get_transient( 'user_rank_comments_' . substr(md5( strtolower(get_comment_author_email( $comment_id )) ),0, ); if ( false === $count ) { global $wpdb; $count = $wpdb->get_var( $wpdb->prepare( 'SELECT COUNT(comment_ID) FROM ' . $wpdb->comments. ' WHERE comment_author_email = %s AND comment_approved = 1' , get_comment_author_email() ) ); set_transient( 'user_rank_comments_' . substr(md5( strtolower(get_comment_author_email( $comment_id )) ),0,, $count ); } foreach( $ranks as $row ) { if( $count >= (int)$row['count'] ) $rank = $row['name']; else break; } return $rank; I want to override the rank displayed for admin and/or moderator like this: if (current_user_can( 'manage_options' )) { echo 'admin' } elseif (current_user_can( 'moderate_comments' )) { echo 'moderator' } endif return $rank Any help is appreciated! Thanks!
  7. so just wanted to share that I did em both.. with localStorage. if someone's interested take a look at this fiddle ( hope it helps ) http://jsfiddle.net/melbourne/NmfTf/2/ Thanks for thanking the time to reply guys.
  8. If it is checked to remember a js function action. Ok so what do I mean by that.. I'll make a short fiddle without my css. http://jsfiddle.net/melbourne/s5AXZ/ I can make the box stay checked with some html like value="forever" checked="checked" but it is pointless cause it doesnt remember about the js. Also this is on my comments page so would be nice to remember the after the user either submits a comment or refreshes the page. I saw this could accomplish what I need on posting <input type="checkbox" name="check" value="checked" <?php if($_POST['check'] == 'checked'): ?>checked="checked"<?php endif; ?> /> but still.. doesn't trigger the js function with checkbox checked. Any way of doing that? Hope I am clear enough. I am kinda tired after a long day and Im poppin words without thinking about too much on the sentence. My other options would be to submit comments via ajax and aswell showing new comments via ajax ( like twitter ) but.. there's some work there too. Hoping to fix this first. Thanks a bunch.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.