01.
if
(
$_REQUEST
[
'action'
]==
'frame'
){
02.
$return
=
""
;
03.
if
(
$handle
= opendir(
"images"
)) {
04.
while
(false !== (
$file
= readdir(
$handle
))) {
05.
if
(
$file
!=
"."
&&
$file
!=
".."
) {
06.
if
(
is_dir
(
"images/$file"
)) {}
07.
else
{
08.
list(
$filename
,
$fileext1
,
$fileext2
) =
explode
(
"."
,
$file
);
09.
if
(
$fileext1
!=
"png"
){}
10.
else
{
11.
if
(
strstr
(
$filename
,
$site_name
)){
12.
$images
[] =
$file
;
13.
}
14.
}
15.
}
16.
}
17.
}
18.
closedir
(
$handle
);
19.
}
20.
rsort(
$images
, SORT_STRING);
21.
22.
foreach
(
$images
as
$image
){
23.
$showname
=
substr
(
$image
,10,-4);
24.
25.
$return
.=
"<option value='$image'>"
.
$showname
.
"</option>"
;
26.
}
27.
echo
(
$return
);
28.
}
29.
30.
function
sorter(
$a
,
$b
){
31.
return
(
$a
[1]<
$b
[1]) ? -1 : 1;
32.
}