diff --git a/index.php b/index.php new file mode 100644 index 0000000..8e41390 --- /dev/null +++ b/index.php @@ -0,0 +1,144 @@ + + +
++createQuery( [ + 'action' => 'query', + 'list' => 'categorymembers', + 'cmtitle' => 'Category:' . $_POST['catname'], + ] ); + + $options = []; + + array_push($options, 'mode=' . $_POST['mode']); + + if ($_POST['caption'] != "") { + array_push($options, 'caption="' . $_POST['caption'] . '"'); + } + + if ($_POST['widths'] != "") { + array_push($options, 'widths=' . $_POST['widths'] . 'px'); + } + + if ($_POST['heights'] != "") { + array_push($options, 'heights=' . $_POST['heights'] . 'px'); + } + + if ($_POST['perrow'] != "") { + array_push($options, 'perrow=' . $_POST['perrow']); + } + + if (isset($_POST['showfilename'])) { + array_push($options, 'showfilename=yes'); + } + + if (isset($_POST['showthumbnails'])) { + array_push($options, 'showthumbnails'); + } + + echo('<gallery ' . implode(' ', $options) . "> \n"); + + foreach( $queries as $query ) { + + + + if (sizeof($query->query->categorymembers) > 0) { + + $files = $query->query->categorymembers; + + + + foreach ($files as $file) { + if($file->ns == 6) { + echo($file->title . "\n"); + } + } + + } else { + echo('WARNING! The category you want to generate a gallery from is empty.'); + } + } + echo('<gallery/>'); + + } + + ?> ++
Created by Ferdinando Traversa - Contact him at wiki@traversa.me - Source: on Github - v 1.0+ + + \ No newline at end of file