I currently have this....

<p>
<?php
If ($v1=="1") { 
echo '<a href="#overlay1" rel="#overlay1"><img src="/modules/mod_test/img/'. $pic1 .'" alt="triggers overlay" /></a> '. $title1.'&nbsp;'. $des1 .'<br>
'; 
}
?>

<?php
If ($v2=="1") { 
echo '<a href="#overlay2" rel="#overlay2"><img src="/modules/mod_test/img/'. $pic2 .'" alt="triggers overlay" /></a> '. $title2.'&nbsp;'. $des2 .'<br>
'; 
}
?>


<?php
If ($v3=="1") { 
echo '<a href="#overlay3" rel="#overlay3"><img src="/modules/mod_test/img/'. $pic3 .'" alt="triggers overlay" /></a> '. $title3.'&nbsp;'. $des3 .'<br>
'; 
}
?>

</p>

I would like it to be able to read multiple files, currently limited to 10... so I'm guessing something that looks like this but... not sure

<?php
$lines = file('files.txt', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
foreach($lines as $line)
{
    list($vid, $title, $dec) = explode('-', $line);
    $n++;
    echo "<div class=\"overlay\" id=\"overlay$n\">";
    echo "'. $dec .'<a href=''. $url .'/clips/$vid'>";
    echo "</div>";
} 
?>

Suggestions? Many Thanks...you guys and gals are a REALLY huge help!!

🙂

    cowboysdude wrote:

    so I'm guessing something that looks like this but... not sure

    Have you tried it?

      Weedpacket;10926436 wrote:

      Have you tried it?

      Yes I have tried it... this is what I have..

      <?php
      $lines = file('modules/mod_test/files.txt', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
      foreach($lines as $line)
      {
          list($ol, $pic, $vid, $title) = explode('-', $line);
      	$n++;
      echo '<a href="#overlay" rel="#overlay'. $ol.'"><img src="/modules/mod_test/img/'. $pic .'" alt="picture here" /></a> '. $title.'&nbsp;<br />';
      }
      ?>
      
      
      
      <!-- overlays for videos -->
      
      <?php
      $lines = file('modules/mod_test/files.txt', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
      foreach($lines as $line)
      {
          list($ol, $pic, $vid, $title) = explode('-', $line);
      
      echo "<div class=\"overlay\" id=\"overlay$ol\">";
      echo "<a href='http://localhost/clips/$vid'>";
      echo "</div>";
      } 
       ?>

      It shows up fine and the output looks good but it won't fire... the video overlay pops up but no video and won't close the overlay when the X is clicked...

      I had it line by line like this...

      <?php
      If ($v1=="1") { 
      echo '<a href="#overlay1" rel="#overlay1"><img src="/modules/mod_test/img/'. $pic1 .'" alt="triggers overlay" /></a> '. $title1.'&nbsp;'. $des1 .'<br>
      '; 
      }
      ?>

      and the overlay fired and showed the video fine but it was limited to only 10.. I wanted unlimited... so I am trying to write to be able to show as many as I want..

      With $v1 being a variable to tell it whether is was on or off... won't need this if I write for unlimited as it will only show however many I put in the files.txt file.

      Any help would be great!! Thanks.

        You're changing a lot of the HTML there (adding a <div> element, removing the <img>, retargeting the <a> elements, etc.). That might have something to do with the change in client-side behaviour.

          Weedpacket;10926461 wrote:

          You're changing a lot of the HTML there (adding a <div> element, removing the <img>, retargeting the <a> elements, etc.). That might have something to do with the change in client-side behaviour.

          Yes I am.. LOL like I said it shows [when you view the Source of the page] correctly but won't fire.. It's loading all the js files correctly...so that's why I'm stumped here..

            Write a Reply...