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/22/06 20:44 
Can you think of a way to do this without me hacking this in for songs, videos, photos, store . . .
Next time I upgrade I'll have to redo these.
What is the Dynamic way of doing this?
I would rather leave the core files alone!
Thanks

Back to top
Brian
Jamroom Team


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

Posted: 03/22/06 20:55 
I'd recommend not even doing it that way - try "capturing" the output from the rating.php script then use it in your theme for your stars - i.e.:


Code

<?php ob_start(); ?>
{BAND_RATING_AVERAGE}
<?php
$rating = (int) ob_get_contents();
ob_end_clean();
if ($rating > 4) {
    echo '<img src="5stars.png">';
}
elseif ($rating > 3) {
    echo '<img src="4stars.png">';
}
elseif ($rating > 2) {
    echo '<img src="3stars.png">';
}
elseif ($rating > 1) {
    echo '<img src="3stars.png">';
}
else {
    echo '<img src="1stars.png">';
}
?>


I think that will do what you are looking to do.

Hope this helps!

- Brian


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


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

Posted: 03/22/06 20:59 
ooppps.. just realized you may be using Smarty (looking at the thread I'm not 100% positive which template you need this in) - if you are using Smarty, just use a "fetch" with a variable assignment instead of the PHP include call:

http://smarty.php.net/manual/en/language.function.fetch.php

and the proper {if} syntax.

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 21:17 
Yes, I converted this theme to a Smarty theme last week.
I'll look at the Smarty docs and give it a shot.

I tried throwing the code you posted inside of {literal}tags{/literal}. I didn't get any errors on build but I only got a 1 star for all songs even if they had a higher rating.

I'll take what you have shown me and see what I can come up with.
Again, thanks for you help!
RGNelson

Back to top
rgnelson



Joined: 28 Feb 2005
Posts: 726

Posted: 03/25/06 14:48 
I'm getting this error:
Unable to retrieve database information for item_id 3 - verify connectivity.

With this URL:
rating.php?mode=rating_form&type=item&band_id=1&item_id=3&template=profile_rate_item.tpl

Any ideas where to look for this one? Question

Back to top
djmerlyn
Jamroom Ustad


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

Posted: 03/25/06 15:14 
Are you absolutely sure that Band ID 1 has an Item ID of 3?

It seems rather unlikely...but you can look in the artist menu at the items, and you should see the item ID at the top of the screen of each item...looks like this:

Modify Item modify the information about this item

Item ID 1
Item Name
etc..etc...

Find the item you are trying to display and look at the top to verify the item ID you are using~


_________________
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/25/06 15:48 
Yes, for sure item_id=3 and band_id=1
Is anyone using rating for items, photos, videos, etc...
I'm thinking maybe I should leave it alone?
Thanks

Back to top
djmerlyn
Jamroom Ustad


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

Posted: 03/25/06 15:53 
It has to be a bug, I see the same thing here now that I gave it a go...

Moving this to the bugs area~


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

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


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

Posted: 03/25/06 17:07 
Let me check this out and get it loaded into the Tracker...

Thanks!!

- Brian


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


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

Posted: 03/26/06 09:19 
I've found the cause of this bug and have it fixed for Jamroom 2.67.

http://www.jamroom.net/index.php?m=td_tracker&o=view&id=25

Thanks for letting me know!

- Brian


_________________
Make sure and check out:
* The Jamroom FAQ
* The Jamroom Documentation
Back to top
Display posts from previous:   
User Support Forum Archive (Read Only)
Jamroom Help

< Previous12
 
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.