Jump to content

Don't print results if php call is in given number bracket


David Nelson

Recommended Posts

Hey guys,

 

I'm working on a project that uses the YouTube API. It takes advantage of php, html, xml, etc.. but I'm looking to make a php modification to filter through some results.

 

Basically the way it prints each entry is it has a set template like this

 

{section loop=$videos name=i}

<a href="http://www.youtube.com/watch?v={$videos.id}" target="I1">{$videos.title}</a> {$videos.duration}

{sectionelse}

 

---

 

So as you can see it's making calls that gets data from the API.

 

You can see "{$videos.duration}" above. This prints the duration of the video in seconds. What I want to do is make it check {$videos.duration} to see if its <30 or >600 seconds - if {$videos.duration} is less/greater than those numbers, It should NOT print it on the page.

 

I'm pretty novice with php so I was wondering what the best way for me to do this is.

 

This may be confusing as to what I'm trying to do here, so if you need clarification please ask. :-)

 

Thanks!

 

David

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.