* * Permission is hereby granted, to any person obtaining a copy of this software * and associated documentation files (the "Software"), to deal in the Software * without restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies of the * Software, and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ // Change following variables when copying file !! $title = "hgbhome.net - Various scripts"; $description = "$title - Some scripts from which I think they could be useful enough to be kept"; $explanation = "If not stated otherwise, any scripts downloaded from here are free software licensed under GPL version 2 only, see under license"; echo " $title

$title

$explanation

"; function ReadFolder( $pfile ) { global $extension; global $rows_per_col; global $rows; global $foldername; // if(substr( $pfile,strlen($extension)*(-1)) == $extension && is_numeric(substr( $pfile,(strlen($extension)+1)*(-1),1)) ) { if( !is_dir( $pfile ) && substr( $pfile,strlen($extension)*(-1)) == $extension ) { // BEGIN: Use filename to get link // $pfile_arr = explode( $extension , $pfile ); // $filetitle = $pfile_arr[0]; $filetitle = basename( $pfile , $extension ); $file_path = dirname( $pfile ) . "/" . basename( $pfile , $extension ); $sfile = file( $pfile ); $sname_arr = explode( "||", $sfile[0] ); if( strlen( $sname_arr[1] ) > 0 ): $slink = rtrim( $sname_arr[1] ); else: $slink = rtrim( $sname_arr[0] ); endif; $sname = rtrim( $sname_arr[0] ); // END: Use filename to get link echo " "; $rows++; if( ($rows % $rows_per_col) == 0 ) { echo "

\n \n \n

\n"; } } if( is_dir( $pfile ) && ! file_exists( $pfile . $extension ) ) { // if( is_dir( $pfile ) ) { $filetitle = basename( $pfile ); echo "

"; // $filetitle $rows++; if( ($rows % $rows_per_col) == 0 ) { echo "

\n \n \n

\n"; } } } $files = array(); $i = 0; $whereweare = substr( $foldername , 1 ); // echo "\n"; echo "
\n"; echo " \n"; echo " \n"; echo " \n"; echo "
\n"; echo "

$whereweare\n"; $folder = dir($foldername); while($fn = $folder->read()) { if( "$fn" == "atos" ): continue; endif; $filename = "$foldername/$fn"; // if( !is_dir( $filename ) && substr( $filename , -1 ) != "." ) { if( substr( $filename , -1 ) != "." ) { if( is_dir( $filename ) ) { $files[$i] = "*$filename"; } else { $files[$i] = $filename; } $i++; } } $folder->close(); // Sort filenames to have newest first sort( $files ); foreach( $files as $key => $filename ) { if( $filename[0] == "*" ) { ReadFolder( substr( $filename , 1 ) ); } else { ReadFolder( $filename ); } } echo "

\n"; echo "
\n";