Sterne (UPDATE) https://www.puls200.de/wp-content/plugins/Sterne/img/icon-rating-star_f.gifhttps://www.puls200.de/wp-content/plugins/Sterne/img/icon-rating-star_f.gifhttps://www.puls200.de/wp-content/plugins/Sterne/img/icon-rating-star_f.gifhttps://www.puls200.de/wp-content/plugins/Sterne/img/icon-rating-star_f.gifhttps://www.puls200.de/wp-content/plugins/Sterne/img/icon-rating-star_f.gif

Es hat mir keine Ruhe gelassen, drum gibt es jetzt die Sterne in beliebiger Farbe (gd sei Dank). Außerdem ist man jetzt nicht mehr auf 5 Sterne bzw. 10 Punkte beschränkt.

Der alte Aufruf funktioniert wie gehabt, der neue geht so:

Stern(punkte,gesamtpunkte,rot,grün,blau). Also

Stern(13,20,200,150,50) ergibt SternSternSternSternSternSternSternSternSternStern (13 von 20 irgendwie komisch braunen Sternen (pfui!))
oder
Stern(3,6,50,250,100) ergibt SternSternStern (3 von 6 ziemlich grünen)

Die erzeugten Files werden gecacht, es ist also kein großes Performance-Problem.

7 thoughts on “Sterne (UPDATE) https://www.puls200.de/wp-content/plugins/Sterne/img/icon-rating-star_f.gifhttps://www.puls200.de/wp-content/plugins/Sterne/img/icon-rating-star_f.gifhttps://www.puls200.de/wp-content/plugins/Sterne/img/icon-rating-star_f.gifhttps://www.puls200.de/wp-content/plugins/Sterne/img/icon-rating-star_f.gifhttps://www.puls200.de/wp-content/plugins/Sterne/img/icon-rating-star_f.gif

  1. Hi,

    Thanks for the plugin!

    I’m using WordPress 2.0.1.

    If set a review as:
    sterne(13,3,255,255,0)

    I get 1 and a half stars displayed, but none of the remaining 11 stars are displayed.

    Odd?
    _________________________________________________

    Hallo,

    Dank für das steckbare!

    Ich verwende WordPress 2.0.1.

    Wenn Sie einem Bericht wie eingestellt werden:

    sterne (13.3.255.255.0)

    Ich erhalte 1 und eine Hälfte Sterne angezeigt, aber keine der restlichen 11 Sterne werden angezeigt.

    Ungerade?

  2. Hi,
    you should exchange your first two numbers. First is your rating, second one is total Points. Since 2 points make up a star, this should be an even number.
    Try: sterne(3,13,255,255,0)

  3. Hi
    I like your plugin.
    How would I go about getting WordPress to recognise your plugin if I type Stern(6,g) in another field – for example a new metafield, or in post_title?
    Thanks
    Philip

  4. Hi Philip,

    That’s actually quite easy, but you will have to edit the plugin file. At the very end you will see the line:


    add_filter('the_content', 'CheckForStar');
    add_filter('the_content', 'CheckForStarXL');

    The first argument ist the type of field you want to replace, in this case the main post content. To add Sterne to the title (like in this post) for example, add the following lines:

    add_filter('the_title', 'CheckForStar');
    add_filter('the_title', 'CheckForStarXL');

    Here you can find (a little down the page, section “Current hooks for filters” all possible replacements.
    Cheers,
    Daniel

  5. Thanks Daniel
    I’m learning all the time!
    I started off thinking that I need the Sterne rating in a separate field entirely (I’ve been experimenting, without success, with new custom fields), but maybe it works just fine just putting it in the_title.
    Philip

  6. Yep, must be the CSS, since this doesnt happen here. Check definitions for post-title and the ‘a’ tag.

Leave a Reply