Starred Review 0.1

published on May 13, 2006 » filed under Tech, Web, WordPress

THIS PAGE IS DEPRECIATED -
SEE: metacomment.com/starred-review/

This post is going to be less “5 Star”, more whine; I just discovered that half the work I was about to begin today on my (first) Wordpress Plugin Consumer.us has already been put into action as Starred Review by the very worthwhile and talented Marc Hodges. Problem is, it doesn’t really work for me (take your eyes for a wander top-right stylee). Yes, my images are missing, the stars that is. And it appears Marc is in India or something, all very nice… not for wanna-be-motivated programmers like myself. I say wanna-be and that’s been proved again today. I can’t figure out how to replace this very clever bit of php code, with a static address… ussualy the options pannel is used to configure the location / variation of the star image. That doesn’t work for me.

  • Integrating with normal posts
  • Different Styles for TV / Movies / Radio
  • Automatic Link to Amazon / Search on IMDb
  • Back-end improvements or a del.icio.us style pop-up at least
  • I can’t do anything with my Movie Rating Plugin (which will come out of all of this), until I get that above code fixed. If you want to check out Marc’s plugin, he’s over here!


    —————————————————

    Update:

    I worked out a quick fix / hack. Go into classes.php and you’ll have to do some manual work,

    old code:

    $img = '';
    $img_path = get_option('siteurl').'/wp-content/plugins/starred-review/images/'.$dir;
    $decimal = abs($rating - ((int) $rating));

    for($i=1;$i< =((int) $rating);$i++)
    $img .= "\"1.0";

    if ($decimal > 0)
    $img .= "\"$decimal";

    for($i=ceil($rating)+1;$i< =$options['rating_scale'];$i++)
    $img .= "\"no";

    return $img;

    replacement code

    $img = '';
    $img_path = get_option('siteurl').'/wp-content/plugins/starred-review/images/stars-red-gif'.$dir;
    $decimal = abs($rating - ((int) $rating));

    for($i=1;$i< =((int) $rating);$i++)
    $img .= "\"1.0";

    if ($decimal > 0)
    $img .= "\"$decimal";

    for($i=ceil($rating)+1;$i< =$options['rating_scale'];$i++)
    $img .= "\"no";

    return $img;

    Update 2:

    I made a patched version of Marc’s code. Hope he doesn’t mind :D Its Here.

    this is an old post - the formatting may be jumbled
    it may simply make no sense... i was young!


    9 Comments »

    1. I really appreciate you trying the fix this glitch. I tried replacing the old code with the one you gave but I get a “Parse error: syntax error, unexpected ‘=’ in my-path-to-starred-review/classes.php on line 559″ when I naviagte to my review page.

      I deleted the space between the

      Comment by Amos — May 14, 2006 @ 2:28 am
    2. hello,

      i get the same error too :(

      Parse error: syntax error, unexpected ‘=’ in xxx/public_html/wp-content/plugins/starred-review/classes.php on line 559

      Comment by alper — May 14, 2006 @ 10:35 am
    3. by the way, i have PHP version 4.4.2, if that’s of any help…

      Comment by alper — May 14, 2006 @ 10:36 am
    4. hi,

      sorry for the “comment flood,” but i thought this might be helpful: my nonworking review page is at http://www.radiognome.com/kritik/

      Comment by alper — May 14, 2006 @ 10:47 am
    5. hey everyone, patch will be on its way in the next 5 mins. explore the archives, we’ll be back in business in no time!

      Comment by Callum — May 14, 2006 @ 10:51 am
    6. i really feel bad now. 4th comment in the last twenty minutes :)

      altough you are working on a fix now, i thought this might be helpful:

      i checked the browser-side source, and because we can’t choose a directory, it defaults to the first directory, which is stars-black-gif. so i changed .$ext to .gif and it was working again: images viewing! however, no css, so it looks pretty bad.

      how do i get the css to work? no files in the zip file has css code. i guess i can steal it from sevennine :P

      Comment by alper — May 14, 2006 @ 11:02 am
    7. here’s the patch for Starred Review 2.0b

      hey, alper; i thought my changed code was all about changing .$ext to .gif

      :/ which .$ext are you talking about! in classes.php ? right.

      for CSS:


      .sr-menu {text-align:right;color:#BBB;}
      .sr-menu-selected {font-weight:bold;}

      .reviews a {
      color:#bf4ebd;
      text-decoration:none;
      }

      .sr-title-link a {color:#111111; position:absolute;}

      .sr-title-link a:hover {color:#efefef;}

      oh, its all explained Here!

      Comment by Callum — May 14, 2006 @ 11:14 am
    8. well…

      css is messy this time…

      can you help me with this? i’m an html/php/css noob :) i can understand what certain codes mean and can change them to suit my needs, but i can’t start it over…

      http://www.radiognome.com/kritik/ check it out here. i integrated it to my layout.css

      i replaced all .reviews ?¢‚Ǩ‚Ñ¢s to .sr-review?¢‚Ǩ‚Ñ¢s (it’s not like this now, changed again)
      after doing this, onmouseover thing worked. however, the reviews did not show up in tables.

      i’ll appreciate any help!

      Comment by alper — May 14, 2006 @ 11:59 am
    9. yeah, i see you’ve started customising. me too, I’m just looking into it- so as soon as i’ve worked it out, I’ll post an update.

      maybe later today.

      Comment by Callum — May 14, 2006 @ 12:22 pm

    RSS feed for comments on this post. TrackBack URI

    Leave a comment

    © Callum Alden
    design by callum