Skip to:
Content
Pages
Categories
Search
Top
Bottom

My custom component's loop causes an endless loop :( any advice?


  • buddypresser
    Participant

    @buddypresser

    Hey everyone,

    I’m making a custom component that allows users to upload videos…

    I’ve written the part where if you visit the URL of someones video (site.com/username/videos/my-cool-video/) it finds and loads it…

    I’m basing all this on the Groups component btw.

    But when I wrote the directory with the ‘while ( bp_has_site_videos())’ loop, the page wouldn’t load… so I suspected something was wrong, stuck an $i counter in the loop and said (if ( $i>20 ) { die(‘error!’); } ) – and guess what…

    The thing is, there are only four videos in the database… and all 20 results that it returned on the directory list are the first!

    Any advice from developers please? I’m really confused.

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)

  • buddypresser
    Participant

    @buddypresser

    Hold up, I think I’ve worked it out…

    I was using (shorthand): ‘if ( bp_has_site_videos) while (bp_has_site_videos)’

    When I wanted to be using: ‘while (bp_site_videos)’

    .. without the ‘_has’.

    I hope i got that right.

    Need to see all of the relevant code

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘My custom component's loop causes an endless loop :( any advice?’ is closed to new replies.
Skip to toolbar