Jump to content

darkapec

New Members
  • Posts

    3
  • Joined

  • Last visited

Posts posted by darkapec

  1. I just posted a topic on here about sorting php array alphabetically, the solution was posted so quick I decided to post this as well and maybe save some of my time. So I have this javascript

     

    <html>

    <head><title>Darkapec Movie Player</title>

    <script type="text/javascript" src="ss1.js">

    </script>

    </head>

    <body>

    <h1>Darkapec Movie Player</h1>

    <b>Video location  :</b> :wtf:<input type="text" id="id4"/> :wtf:

    <input type="button" onclick='ld()' value="Load" /><br/>

    <div id="id1"></div>

    <div id="nowt"></div>

        <script type="text/javascript">

        function ld(){

        document.write("<html><!DOCTYPE HTML PUBLIC \"-\/\/W3C\/\/DTD HTML 4.01 Transitional\/\/EN\"http\:\/\/www.w3.org\/TR\/html4\/loose.dtd><html xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\" xml:lang=\"en\" lang=\"en\"><head><title>Darkapec Movie Player</title><script type=\"text\/javascript\" src=\"ss1.js\"><\/script><script type=\"text\/javascript\" src=\"fun1.js\"><\/script><\/head><body><h1>Darkapec Movie Player<\/h1><br/><embed type=\"application/x-vlc-plugin\" name=\"video1\" id=\"vlc\"  autoplay=\"yes\"  loop=\"no\"  width=\"640\"  height=\"480\"  target=\""+document.getElementById("id4").value+"\"/><div id=\"nowt\"></div><div id=\"id1\"></div><div id=\"id2\"></div><script type=\"text\/javascript\" src=\"fun1.js\"><\/script><br/><input type=\"button\" onclick='pl()' value=\"Play\" /><input type=\"button\" onclick=\'ps()\' value=\"Pause\" /><input type=\"button\" onclick=\'st()\' value=\"Stop\" /><input type=\"button\" onclick=\'vlc.audio.toggleMute()\' value=\"Mute\" /><br/><b>width  :</b><input type=\"text\" id=\"i1\"/><br/><b>height :</b><input type=\"text\" id=\"i2\"/><br/><input type=\"button\" onclick=\'aspectRatio()\' value=\"Adjust Screen\" />");

        }

        </script>

    <br/>

    </body>

    </html>

     

    I have put 2  :wtf: enclosing the code where I would like to implement the following PHP script

     

    <?php

    $dir="/backup/Movies";

    $files = array();

    if ($handle = opendir($dir)) {

    while (false !== ($file = readdir($handle)))

    {

    if ($file != "." && $file != ".." && $file != "index.php" && $file != "New Movies" && $file != "Icons" && $file != "Tv Shows")

    {

    $files[] = $file;

    }

    }

    closedir($handle);

    }

    sort($files)

    ?>

    <form action="listen.php" method="post" name="table">

    <select name="Movie">

    <p>

    <?php

    $tmp = array();

    foreach ($files as $file) {

    $tmp[] = "<option value='$file'>$file</option>";

    }

    echo implode("\n",$tmp) . "\n";

    ?>

    </p>

    </select>

    </form>

     

    Thanks again for the help

    Jake

  2. Thank you much for your help, as for using multiple scripts for each folder... that is exactly what I was thinking, after I posted of course.

     

    Thanks again for your fast response time. I found a lot of info on sorting alphabetically on the forums but they all seemed so code specific and because I am so new to .php I really needed the help.

     

    Jake

  3. I am a php newb. I have 2 somewhat simple problems. First I have a huge list of movies that I would like sorted in a drop down list alphabetically. I already have the drop down list made and the movies show up correctly. But I cannot figure out how to sort the list. Here is the code

     

    <?php

    $dir="/backup/Movies";

    if ($handle = opendir($dir)) {

      while (false !== ($file = readdir($handle)))

          {

              if ($file != "." && $file != ".." && $file != "index.php")

      {

              $thelist .= '<option>'.$file.'</option>';

              }

          }

      closedir($handle);

      }

    ?>

    <form action="listen.php" method="post" name="table">

    <select name="Movie">

    <P><?=$thelist?></p>'

    </select>

    </form>

     

    Second problem is inside this directory there are a few other directories is it possible to make the directories show at the top instead of them being sorted alphabetically with the movies.

     

    Thanks in advance

    Jake

×
×
  • 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.