File size: 2.2Kb
<?php
/////////////////////////////////////////////////////////////////////////////////////////////////
// //
// GscorpySmilieGenerator //
// Current Version : 1.0.0 //
// Author : Gscorpy //
// You you can redistribute it and/or modify this script but please always put author's name //
// Copyright (c) 2008 Gscorpy. All rights reserved. //
// Additional scripts can be found at http://gscorpy.net //
// 24.03.2008 //
/////////////////////////////////////////////////////////////////////////////////////////////////
function option($dir){
$conf["items_per_page"] = 99;
if(!($dp = opendir("./".$dir))) die ("Cannot open ./".$dir);
$file_array = array();
while ($file = readdir ($dp))
{
if(substr($file,0,1) != '.' and $file != '..' and $file != 'index.php')
{
$file_array[] = $file;
}
}
$file_count = count ($file_array);
sort ($file_array);
if ($file_count > 0)
{
$first_record = $page * $conf["items_per_page"];
$last_record = $first_record + $conf["items_per_page"];
while (list($fileIndexValue, $file_name) = each ($file_array))
{
if (($fileIndexValue >= $first_record) AND ($fileIndexValue < $last_record))
{
$real_file_name = explode ('.', $file_name);
echo '<option value="'.$real_file_name[0].'">'.$real_file_name[0].'</option>';
}
}
}
closedir($dp);
}
?>