function listFolder($dir) { global $i; $ffs = scandir($dir); foreach ($ffs as $ff) { if ($ff != '.' && $ff != '..') { if (is_dir($dir . '/' . $ff)) { echo ' <tr>'; echo ' <td>' . $i++ . '</td>'; echo ' <td><a href="showPics.php?path=' . $dir . '/' . $ff . '" >' . $ff . '</a></td>'; echo ' </tr>'; listFolder($dir . '/' . $ff); } } } }
<?php $path = $_GET['path']; $value = $_COOKIE["stibium"]; $auth = json_decode($value, 1); $service = $auth["service"]; if ($service == "ubuntuone") { @(include "backend/ubuntuone/login.php"); $myoauth = loadAuth(); $mylist = listFolder($myoauth, $path); print $mylist; } if ($service == "dropbox") { print "Sorry, actually Stibium does not work with Dropbox. But our monkeys are working on it."; } if ($service == "owncloud") { print "Sorry, actually Stibium does not work with ownCloud. But our monkeys are working on it."; } if ($service == "googledocs") { print "Sorry, actually Stibium does not work with Google Docs. But our monkeys are working on it."; } ?>
* Image1 * */ include 'listFileFolder.php'; //$directory = '/home/hduser/Pictures'; $directory = 'gallery'; echo '<table style="width: 50%;">'; echo ' <thead>'; echo ' <tr>'; echo ' <td>#</td>'; echo ' <td>Album Name</td>'; echo ' </tr>'; echo ' <tr>'; echo ' <td> </td>'; echo ' <td> </td>'; echo ' </tr>'; echo ' </thead>'; echo ' <tbody>'; listFolder($directory); echo ' </tbody>'; echo '</table>'; ?> <div class="clear"></div> </div> <div id="footer"> <h2>Bhatnagar's Family Pictures</h2> </div> </div> </body> </html>