Jamroom Logo Jamroom 5 Core
is now Open Source!
User Support Forum Archive (Read Only)
Jamroom Help:
Song Rating Average In Song Rating Template
rgnelson



Joined: 28 Feb 2005
Posts: 726

Posted: 03/21/06 12:20 
I am using this to pop a song rating window:
{$SONG_RATING_FORM}
I want to show the current average rating of the song to be rated:
Current Rating: {$SONG_RATE_AVG}
I also tried {$SONG_RATING_AVG}

I found this in the docs:
http://www.jamroom.net/Doc_Using_The_Jamroom_Rating_System

I am tring to do this in a template from /templates/rating
Is this available?
Thanks

Back to top
djmerlyn
Jamroom Ustad


Joined: 18 Dec 2003
Posts: 13497
Location: Behind You

Posted: 03/21/06 12:27 
It should be available, by looking at those docs you get a band and song rating option... So long as you are passing mode=song you should be able to use those...


_________________
Pro JR Hosting, now 50% off!
-100% Guaranteed

"more server and network power than any host, dedicated to your jamroom site"
Back to top
rgnelson



Joined: 28 Feb 2005
Posts: 726

Posted: 03/21/06 12:33 
I assume the {$SONG_RATING_FORM} would call the popup with mode=song.

Anyway, I can't make it work using the variables listed in the docs.

Thanks

Back to top
djmerlyn
Jamroom Ustad


Joined: 18 Dec 2003
Posts: 13497
Location: Behind You

Posted: 03/21/06 12:46 
That would be the variable you use within the artist themes to pop up a rating form (ie; in a song template for the theme)... I believe the rating_avg is allowed within the actual template used to set a rating by the visitor...but the docs are a little confusing Confused


_________________
Pro JR Hosting, now 50% off!
-100% Guaranteed

"more server and network power than any host, dedicated to your jamroom site"
Back to top
rgnelson



Joined: 28 Feb 2005
Posts: 726

Posted: 03/21/06 12:55 
The rating docs say:
mode=(rate_song/rate_band)
The following template variables can be used with the SONG mode templates:
{$SONG_RATE_AVG} - Average of ratings the song has received
It sounds like I should be able to do it.

But then again, I only see {$SONG_RATING_AVG} in theme.inc and I can't make it work either.

I bet I'm doing something wrong, I just can't figure out what it is? Embarassed

Back to top
Brian
Jamroom Team


Joined: 09 Jul 2003
Posts: 37583
Location: Seattle, WA

Posted: 03/21/06 12:57 

rgnelson:
The rating docs say:
mode=(rate_song/rate_band)
The following template variables can be used with the SONG mode templates:
{$SONG_RATE_AVG} - Average of ratings the song has received
It sounds like I should be able to do it.

But then again, I only see {$SONG_RATING_AVG} in theme.inc and I can't make it work either.

I bet I'm doing something wrong, I just can't figure out what it is? Embarassed


Let me check on the documentation for this - with Jamroom 2.60 the rating script was modified to allow ratings of all types, so it likely needs to be updated. I'll work on that here and get back to you.

Hope this helps!

- Brian


_________________
Make sure and check out:
* The Jamroom FAQ
* The Jamroom Documentation
Back to top
rgnelson



Joined: 28 Feb 2005
Posts: 726

Posted: 03/21/06 17:32 
Ok - Sounds Good.

Back to top
Brian
Jamroom Team


Joined: 09 Jul 2003
Posts: 37583
Location: Seattle, WA

Posted: 03/21/06 18:22 
I'll be working on getting this finished up by tomorrow - I didn't realize how out of date it was! It's going to need a rewriting, so I'll be working on that tonight/tomorrow and should be able to have it finished up by tomorrow.

Thanks!

- Brian


_________________
Make sure and check out:
* The Jamroom FAQ
* The Jamroom Documentation
Back to top
rgnelson



Joined: 28 Feb 2005
Posts: 726

Posted: 03/21/06 18:37 
Thank you.

EDIT:
Another thing about Rating:
{$ERROR_TEXT} parses to:
It appears you have already voted for this song!
and
{$SUCCESS_TEXT} parses to:
You have successfully rated the song with a rating of ""
Both of them being specific to Songs.
If I want to rate photos and handle success and errors waht would I use?
/EDIT




While you are here Brian, I think my JamRoom should be using media keys because I have Use Media Keys set to yes and my song directory protected. But my m3u file looks like this:
#EXTM3U
#EXTINF:170,Sample Artist - 75 Stripe Pants
http://ascmp3.com/stream.php?mode=song_hifi&band_id=1&song_id=13&ext=.mp3

Where is the best place to start looking for the answer to this?
If I need to start a new thread - I will Wink

Back to top
Brian
Jamroom Team


Joined: 09 Jul 2003
Posts: 37583
Location: Seattle, WA

Posted: 03/22/06 14:31 

rgnelson:
Thank you.

EDIT:
Another thing about Rating:
{$ERROR_TEXT} parses to:
It appears you have already voted for this song!
and
{$SUCCESS_TEXT} parses to:
You have successfully rated the song with a rating of ""
Both of them being specific to Songs.
If I want to rate photos and handle success and errors waht would I use?
/EDIT




While you are here Brian, I think my JamRoom should be using media keys because I have Use Media Keys set to yes and my song directory protected. But my m3u file looks like this:
#EXTM3U
#EXTINF:170,Sample Artist - 75 Stripe Pants
http://ascmp3.com/stream.php?mode=song_hifi&band_id=1&song_id=13&ext=.mp3

Where is the best place to start looking for the answer to this?
If I need to start a new thread - I will Wink


Still working on the rating documentaion - I've got some of it updated, but need to get the available template variables listed.

One reason why you may not be seeing the media key on your stream call is that if an artist has the "allow deeplinking" option turned on in their quota, the key is not used. Check that and let me know if that is the reason.

Hope this helps!

- Brian


_________________
Make sure and check out:
* The Jamroom FAQ
* The Jamroom Documentation
Back to top
rgnelson



Joined: 28 Feb 2005
Posts: 726

Posted: 03/22/06 15:02 
Thanks Brian.
Yes, deeplinking was allowed. Once I set it to "No" I am getting the key. Sorry about that.

I noticed some of the updated docs on rating last night.
I have the error and success templates showing the correct text for a rating of a photo.

I'm trying to use the star rating with photos like I have for songs. I haven't got it working yet. I tried {$PHOTO_RATE_AVG} but it's not working right.

I'll keep checking the docs!
Thanks

Back to top
Brian
Jamroom Team


Joined: 09 Jul 2003
Posts: 37583
Location: Seattle, WA

Posted: 03/22/06 15:13 

rgnelson:
Thanks Brian.
Yes, deeplinking was allowed. Once I set it to "No" I am getting the key. Sorry about that.

I noticed some of the updated docs on rating last night.
I have the error and success templates showing the correct text for a rating of a photo.

I'm trying to use the star rating with photos like I have for songs. I haven't got it working yet. I tried {$PHOTO_RATE_AVG} but it's not working right.

I'll keep checking the docs!
Thanks


I'll be working on that doc off and on as I work around some other issues. I'm glad to see the key is working for you as well.

Thanks!

- Brian


_________________
Make sure and check out:
* The Jamroom FAQ
* The Jamroom Documentation
Back to top
rgnelson



Joined: 28 Feb 2005
Posts: 726

Posted: 03/22/06 20:33 
I know you are not finished with the docs but I'm stuck on ratings right now.
I couldn't use this in an artist theme row:

Code

'{SONG_RATING_AVG}' => "<?php @include(\"{$use_url}/rating.php?mode=show_average&type=song&band_id={$band_id}&song_id={$_row['song_id']}\"); ?>",

to test the average for a star rating.
so I made this:

Code

'{SONG_MY_RATE_AVG}' => $_row['rating_average'],

It works for the test below:

Code

    {if "$SONG_MY_RATE_AVG" > "4.4"}
 &nbsp;&nbsp;Rating:&nbsp;<img src="/themes/ArtistProfile/images/5star.gif" alt="&quot;{$SONG_NAME}&quot; has a rating of {$SONG_RATING_AVG} based on {$SONG_RATING_NUMBER} vote(s)." width="44" height="10" title="&quot;{$SONG_NAME}&quot; has a rating of {$SONG_RATING_AVG} based on {$SONG_RATING_NUM} vote(s).">
 {elseif "$SONG_MY_RATE_AVG" > "3.4"}
 &nbsp;&nbsp;Rating:&nbsp;<img src="/themes/ArtistProfile/images/4star.gif" alt="&quot;{$SONG_NAME}&quot; has a rating of {$SONG_RATING_AVG} based on {$SONG_RATING_NUMBER} vote(s)." width="44" height="10" title="&quot;{$SONG_NAME}&quot; has a rating of {$SONG_RATING_AVG} based on {$SONG_RATING_NUM} vote(s).">
 {elseif "$SONG_MY_RATE_AVG" > "2.4"}
 &nbsp;&nbsp;Rating:&nbsp;<img src="/themes/ArtistProfile/images/3star.gif" alt="&quot;{$SONG_NAME}&quot; has a rating of {$SONG_RATING_AVG} based on {$SONG_RATING_NUMBER} vote(s)." width="44" height="10" title="&quot;{$SONG_NAME}&quot; has a rating of {$SONG_RATING_AVG} based on {$SONG_RATING_NUM} vote(s).">
 {elseif "$SONG_MY_RATE_AVG" > "1.4"}
 &nbsp;&nbsp;Rating:&nbsp;<img src="/themes/ArtistProfile/images/2star.gif" alt="&quot;{$SONG_NAME}&quot; has a rating of {$SONG_RATING_AVG} based on {$SONG_RATING_NUMBER} vote(s)." width="44" height="10" title="&quot;{$SONG_NAME}&quot; has a rating of {$SONG_RATING_AVG} based on {$SONG_RATING_NUM} vote(s).">
 {elseif "$SONG_MY_RATE_AVG" > "0"}
 &nbsp;&nbsp;Rating:&nbsp;<img src="/themes/ArtistProfile/images/1star.gif" alt="&quot;{$SONG_NAME}&quot; has a rating of {$SONG_RATING_AVG} based on {$SONG_RATING_NUMBER} vote(s)." width="44" height="10" title="&quot;{$SONG_NAME}&quot; has a rating of {$SONG_RATING_AVG} based on {$SONG_RATING_NUM} vote(s).">
 {elseif "$SONG_MY_RATE_AVG" < "1"}
&nbsp;&nbsp;Rating:&nbsp;No Rating
 {/if}

I bet there is a built in way to test this. What do you suggest?

Back to top
Brian
Jamroom Team


Joined: 09 Jul 2003
Posts: 37583
Location: Seattle, WA

Posted: 03/22/06 20:36 
That will work, the only problem is that it's not "dynamic" - i.e. you won't see a change unless the artist page is rebuilt. It shouldn't be much of an issue though since the artist page is rebuilt after a rating, you just want to be aware of that in case you are rating "outside" the rating form.

Hope this helps!

- Brian


_________________
Make sure and check out:
* The Jamroom FAQ
* The Jamroom Documentation
Back to top
djmerlyn
Jamroom Ustad


Joined: 18 Dec 2003
Posts: 13497
Location: Behind You

Posted: 03/22/06 20:42 

bigguy:
It shouldn't be much of an issue though since the artist page is rebuilt after a rating


Really? Is it always like that even if the auto regenerate is turned off? Or am I just catching a part of a conversation and missing something relevent Laughing?


_________________
Pro JR Hosting, now 50% off!
-100% Guaranteed

"more server and network power than any host, dedicated to your jamroom site"
Back to top
Display posts from previous:   
User Support Forum Archive (Read Only)
Jamroom Help

12Next >
 
Solutions
• Social Media Platform
• Social Networking Software
• Musician Website Manager
• Community Builder
Products
• Jamroom Core
• Jamroom Addons
• Jamroom Modules
• Jamroom Marketplace
Support
• Support Forum
• Documentation
• Support Center
• Contact Support
Community
• Community Forum
• Member Sites
• Developers
Company
• About Us
• Contact Us
• Privacy Policy
©2003 - 2010 Talldude Networks, LLC.