Jamroom Logo Jamroom 5 Core
is now Open Source!
User Support Forum Archive (Read Only)
Jamroom Developers:
If no results are returned from custom ranking script?

Joined: 20 Jun 2009
Posts: 344
Location: Portland Oregon

Posted: 10/11/09 23:20 
Is there a way to determine if there are 0 results returned by a custom ranking script? I noticed that, if there are no results found, that the template_header and template_footer are displayed but the template_row isn't even processed. Since that is the case, I figure the best solution would be to add an if clause at the bottom of my header_template to display a notice, if there are no results returned. The trouble is, I cant seem to find a template variable that returns a count of items returned by the ranking script. Anybody have a solution?

Back to top

Joined: 30 Aug 2005
Posts: 8792
Location: Ultrabubble

Posted: 10/12/09 02:03 
You can use assign= as a parameter in your ranking. This will put the output of the ranking call into a variable, so you can check that there is output there, and then display it or a "no results" message accordingly.

{jr_ranking mode="song" category="Instrumental" assign="results"}
{if isset($results) && strlen($results) > 1}
There are no songs in the Instrumental category

Kulshi Mezian!

"Stranger from another planet, welcome to our hole. Just strap on your guitar and we'll play some rock and roll"

Ultrabubble create things.
Back to top
Display posts from previous:   
User Support Forum Archive (Read Only)
Jamroom Developers

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