Jamroom Logo Jamroom 5 Core
is now Open Source!
User Support Forum Archive (Read Only)
User Site Design, Integration and Customization:
If statement to check if there is a lofi song in ranking
cmaguire



Joined: 22 Apr 2004
Posts: 705

Posted: 03/22/05 10:27 
Hey Brian,

Similar to that if statement you just gave me for the next pages is there a way to check if there is a lofi version of a song to be used in ranking?? I have custom playall buttons and right now they always show up whether there is a hifi song or a lofi song or not, the images are always there.

I would like it so that ranking.php checks an if statement to see if there is a hifi song in the database. If not it will not show the images.

Let me know

Thanks Brian!!

Chris

Back to top
dustin



Joined: 11 Apr 2004
Posts: 301

Posted: 03/22/05 10:49 
Try this it should work pretty good... you can also use it for hifi...


Code
{if $SONG_LOFI_SIZE > 0}
        <a href="{$SONG_LOFI_PLAY_URL}"><img src="{$JAMROOM_URL}/templates/newchart/images/play_lofi.gif" alt="play lofi" border="0"></a>
        {else}
        -
        {/if}




Dustin

Back to top
cmaguire



Joined: 22 Apr 2004
Posts: 705

Posted: 03/22/05 11:03 
Yeah cheers Dustin but that didn't work. Left everything with "-". I feel thats probably because the if statement was not checking to see if a hifi file was present but instead checking the size. I want to check to see if there is at least one hifi or one lofi song and if so to show the playall image. If not have a blank space.

Let me know your thoughts.

Back to top
dustin



Joined: 11 Apr 2004
Posts: 301

Posted: 03/22/05 11:11 
Oh.. play all.. my bad next time i will read it Wink

Maybe this will work..


Quote:
{if $SONG_LOFI_SIZE > 0}
<a href="{$PLAYALL_LOFI_MP3_URL}"><img src="{$JAMROOM_URL}/templates/newchart/images/play_lofi.gif" alt="play lofi" border="0"></a>
{else}

{/if}



EDIT.. nevermind... looks like this $SONG_LOFI_SIZE has to change.. to what though.. i will try to see if I can find it.. maybe $PLAYALL_LOFI_MP3_SIZE..???

Back to top
cmaguire



Joined: 22 Apr 2004
Posts: 705

Posted: 03/22/05 11:16 
Dustin I think you mistook what didn't work. It was not what was after the if statement but the if statement itself - {if $SONG_LOFI_SIZE > 0} .

This if causes all of the current play all lofi links I have to disappear which shouldn't be the case with many of the bands as I know they do have lofi songs.

Any more ideas?

Back to top
cmaguire



Joined: 22 Apr 2004
Posts: 705

Posted: 03/22/05 11:17 
Oh wait!!

Maybe I should have said that I am trying to do this in the artists protion of ranking and not song.

What you gave me works on my "song" parts of ranking but I want these playall links on the artists pages.

Any ideas??

Back to top
cmaguire



Joined: 22 Apr 2004
Posts: 705

Posted: 03/22/05 20:40 
Brian or DJ?

Back to top
djmerlyn
Jamroom Ustad


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

Posted: 03/22/05 20:44 
I'm confused, the title of this thread says you want to do this in the ranking system. The code to do it is posted already.

But now you are saying you actually want this for your artist pages?

Question


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

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



Joined: 22 Apr 2004
Posts: 705

Posted: 03/22/05 21:40 
No you are confused. I want to do it for the artist portion of the ranking system. The code given works fine for my songs ranking but does not work for my artists ranking.

I need an if statement that will work in the artist portion of the ranking system as right now the play all buttons just show up whether or not there is a hifi song or a lofi song present.

The if statement needs to check if there is a hifi or lofi song available for that band and if so to show my button, if not it will be blank.

As I said the code given earlier works well for the song portion of the ranking system but not for the artist section of the ranking system and yes I am using ranking.php.

Back to top
djmerlyn
Jamroom Ustad


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

Posted: 03/22/05 22:12 
Its the same code for both. The code given here will work for any ranking.php sorting that shows songs (hifi/lofi). It will work for songs, spotlight, artist, etc...

You just need to find the template you are using, and add the code already given here.

For the play all option, if there is a hifi/lofi song missing in the list, Jamroom will automatically skip over it...so there is no need to worry about making the play all link dependent upon all of the files being there.

Thats it.

Cheers!


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

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



Joined: 22 Apr 2004
Posts: 705

Posted: 03/22/05 22:28 
Tried the code mentioned here and it makes everything go blank and no images show in THIS particular instance (artists portion of the ranking template). This code works in my songs portion of the ranking.

Thats why I was asking for other ideas because it doens't work.

Back to top
djmerlyn
Jamroom Ustad


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

Posted: 03/22/05 22:34 
Well, if you are sorting by artist, I don't know how you are able to show any songs...there are no variables to do that. So I would imagin the song list you are getting is invalid anyways?
http://jamroom.net/docs/doku.php?id=guides:jr_artist_variables

I guess the only other thing I could suggest is to post the URL you are using to call the templates, then post the contents of your row template. Then we can tell you how to procede. But based on what you said, I'm not sure how it could ever work?

Cheers!


_________________
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/23/05 06:37 

cmaguire:
Tried the code mentioned here and it makes everything go blank and no images show in THIS particular instance (artists portion of the ranking template). This code works in my songs portion of the ranking.

Thats why I was asking for other ideas because it doens't work.


Chris -

when ranking by artist there are no "song" variables available for you to test on - you'll need to use the "song" mode to list by songs.

Hope this helps!

- Brian


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



Joined: 22 Apr 2004
Posts: 705

Posted: 03/23/05 07:29 
Not really no. But if thats the way it is, thats the way it is. Is there any way we can include a way to check this if statement in the artist portion of the ranking script in the newest release that comes out??

Would be helpful.

Thanks

Chris

Back to top
Brian
Jamroom Team


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

Posted: 03/23/05 07:46 

cmaguire:
Not really no. But if thats the way it is, thats the way it is. Is there any way we can include a way to check this if statement in the artist portion of the ranking script in the newest release that comes out??

Would be helpful.

Thanks

Chris


Chris -

I'm not sure what you mean by:


Quote:

Is there any way we can include a way to check this if statement in the artist portion of the ranking script


You can use a Smarty "{if}" statement any where you want. When doing an "artist" listing via the ranking.php script however, no song information if returned, so there's no way to "test" for a song, etc. by using an if statement.

If you want to list by songs however, then of course you can do a test (like shown above). Note that in the song mode you also have access to the "band" variables, so you may want to think about using the "song" mode instead of the "band" mode for your list.

Hope this helps!

- 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)
User Site Design, Integration and Customization

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.