Plugin "Simple User Rank Comments" - Bearbeiten

  • Hallo leute,
    ich habe mich drangesetzt und mir gesagt das ich nicht nur für kommentare 1 Punkt geben will sondern auch für Beiträge 2 Punkte. Außerdem habe ich die ganzen Strings auf Deutsch übersetzt.
    Und Jetzt frage ich mir was an diesem Code Schnipel falsch ist :

    Code
    // Start this plugin once all other plugins are fully loadedglobal $Simple_User_Rank_Comments; $Simple_User_Rank_Comments = new Simple_User_Rank_Comments();
    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,8) );        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()                                                                                                              )                                             );                        $add = $wpdb->get_var( $wpdb->prepare( 'SELECT COUNT(post_ID)                                                       FROM ' . $wpdb->posts. '                                                       WHERE post_author_email = %s                                                          AND post_approved = 1'                                                          ,                                                           get_post_author_email()                                                                                                              )                                             );                                                                        set_transient( 'user_rank_comments_' . substr(md5( strtolower(get_comment_author_email( $comment_id )) ),0,8), $count );        }                 set_transient( 'user_rank_comments_' . substr(md5( strtolower(get_comment_author_email( $comment_id )) ),0,8), $add );        $toadd = get_transient( 'user_rank_comments_' . substr(md5( strtolower(get_comment_author_email( $comment_id )) ),0,8) );        $toadd = $toadd * 2;        $count += $toadd;                foreach( $ranks as $row ) {            if( $count >= (int)$row['count'] )                $rank = $row['name'];            else break;        }        return $rank;    }

    Ach ja das ganze ist nur ein ausschnitt : Z.157 - Z.406
    Für euch das ganze könnte ein bisschen verschoben sein also gebe ich die Datei zum Download !
    Danke an alle Antworten !
    Grüße Transformator

    Sorry aber der hat den code einfach so zusammen gerückt :(
    is nich meine schuld :(
    simple-user-commets-plugin.zip

    • Anzeige

    Hallo!

    Wenn du gerade an deiner Website arbeitest oder dein aktuelles Hosting überdenkst: Wir betreiben mit NetzLiving eine Hosting-Plattform, die speziell auf Performance, Sicherheit und einfache Verwaltung ausgelegt ist.

    • ✔️ Schnelle Ladezeiten (optimiert für WordPress & Co.)
    • ✔️ Deutsche Server & DSGVO-konform
    • ✔️ Persönlicher Support (kein 0815-Ticket-System)

    Mehr erfahren

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!