Forum Replies Created

Viewing 15 replies - 1 through 15 (of 16 total)
  • Example of the loop with the vote button in it:

    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    
     <!-- If the post is in the category we want to exclude, we simply pass to the next post. -->
     <?php if (in_category('3')) continue; ?>
    
     <div class="post">
    
      <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
    
      <small><?php the_time('F jS, Y'); ?></small>
    
      <div class="entry">
        <?php the_content(); ?>
        <?php DisplayVotes(get_the_ID()); ?>
      </div>
    
      <p class="postmetadata">Posted in <?php the_category(', '); ?></p>
     </div> <!-- closes the first div box -->
    
     <?php endwhile; else: ?>
     <p>Sorry, no posts matched your criteria.</p>
     <?php endif; ?>

    That I Like It feature appears to be custom made and integrated to the site (judging from the file paths used), so it’s unlikely that it is publicly available.

    If you’d like, you can use a similar plugin which I made (Vote It Up).

    You can adjust the bar size by editing the CSS style sheet. You may need to experiment with the widths and heights to get the desired size.

    Add <?php MostVotedAllTime(); ?> to the sidebar.

    You may need to tweak the styles in the votestyles.css file.

    I would have renamed the folder if I could. Technical limitation at WordPress.

    Forum: Plugins
    In reply to: balatarin

    I may add it, if I managed to translate the page and find the submission link…

    I guess it is then. Well, at least I’ll know who actually reads the readme before installing the plugin. :p

    I may change the installation path in due time.

    The unusual thing is that www.remarpro.com automatically names the folder as such (i.e. “vote-it-up” instead of intended “voteitup”, which is unexpected.

    I’m currently experimenting a method to allow the plugin to be installed in other directories.

    For the time-being, the plugin has been modified to remind people to read the readme.

    The plugin should be installed in the “voteitup” directory.
    This issue only affects one plugin and a fix is pending.

    Thanks for your suggestion, I’ll consider it in the next update.

    Using the above code I’ve mentioned, it can be modified to a function:

    function GetUserLevel($user) {
    global $wpdb;
    //$user is the display name
    if ($user != '') {
    $userdata = $wpdb->get_results("SELECT ID, user_email, user_url, user_registered FROM $wpdb->users WHERE display_name = '".$user."'", ARRAY_N);
    $user_ID = $userdata[0][0]; //Get the ID of the user
    $userwpleveldata = $wpdb->get_results("SELECT meta_value FROM $wpdb->usermeta WHERE meta_key = 'wp_user_level' AND user_id = '".$user_ID."'", ARRAY_N);
    return $userwpleveldata[0][0];
    } else {
    return '';
    }
    }

    Then, you call out to that function whenever you want the user level. In your case, it can be made to:

    //Assuming comment_wpusername() gives the user display name
    $wpuserlevel = GetUserLevel(comment_wpusername());
    if ($wpuserlevel != '') {
    //User is registered
    $wpuserlevel = (int) $wpuserlevel; //convert to number
    if ($wpuserlevel > 7) {
    //User in question is administrator
    echo "<img src='https://www.jenn.nu/wp-content/themes/nov07/images/admin.png' height='16' width='16' alt='Registered member' title='Registered member' class='commentsbyadmin' />";
    } else {
    //User in question is not an administrator but is a registered member
    echo "<img src='https://www.jenn.nu/wp-content/themes/nov07/images/member.gif' height='16' width='16' alt='Registered member' title='Registered member' class='commentsbyadmin' />";
    }
    }

    The following code might be of use to you. It retrieves the user level of a user when you supply the user’s display name.

    global $wpdb;
    $user = 'admin'; //The name of the user as in display name
    
    $userdata = $wpdb->get_results("SELECT ID, user_email, user_url, user_registered FROM $wpdb->users WHERE display_name = '".$user."'", ARRAY_N);
    $user_ID = $userdata[0][0]; //Get the ID of the user
    $userwpleveldata = $wpdb->get_results("SELECT meta_value FROM $wpdb->usermeta WHERE meta_key = 'wp_user_level' AND user_id = '".$user_ID."'", ARRAY_N);
    $userwplevel = $userwpleveldata[0][0];

    $userwplevel will be the user level. If it contains a number (i.e. not empty text), it means that the user is registered. If it is more than 7, it means that the user is an administrator.

    You may need to wait for your feed to update (it updates every once in a while).

    Your feed now shows the full-text version.

    The problem has been fixed [1.4.7], hopefully. Apparently I didn’t test the plugin hard enough (on Linux). This problem affect Linux servers.

    If you want to edit the plugin file manually, you can replace the GetDropPluginPath() function with

    function GetDropPluginPath() {
    $cleanabs = str_replace(“/”,”\\”, ABSPATH);
    return str_replace($cleanabs, ”, str_replace(“/”,”\\”, dirname(__FILE__)));
    }

    For a start, you can upload the most recent revisions of the themes and plugins to your WordPress installation (if you know which theme or plugins you used in the previous install).
    Most security breaches rarely make use of specific plugins nor themes, so updating the main WordPress install should keep out breahes.

    WordPress 2.0.1 is the latest version of WordPress on February 2006.

Viewing 15 replies - 1 through 15 (of 16 total)