diff --git a/index.php b/index.php index a61ea1a..0db1351 100644 --- a/index.php +++ b/index.php @@ -1,144 +1,145 @@
createQuery( [
'action' => 'query',
'list' => 'categorymembers',
'cmtitle' => 'Category:' . $_POST['catname'],
] );
$options = [];
array_push($options, 'mode=' . $_POST['mode']);
if ($_POST['caption'] != "") {
array_push($options, 'caption="' . htmlentities($_POST['caption']) . '"');
}
if ($_POST['widths'] != "") {
array_push($options, 'widths=' . htmlentities($_POST['widths']) . 'px');
}
if ($_POST['heights'] != "") {
array_push($options, 'heights=' . htmlentities($_POST['heights']) . 'px');
}
if ($_POST['perrow'] != "") {
array_push($options, 'perrow=' . htmlentities($_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/>');
+ echo('</gallery>');
}
?>
Created by Ferdinando Traversa - Contact him at wiki[at]traversa.me - Source: on Github - v 1.1 - Thanks to Valerio Bozzolan, especially for his glorious MediaWiki framework for PHP.+
Created by Ferdinando Traversa - Contact him at wiki[at]traversa.me - Source: on Github - v 1.2 - Thanks to Valerio Bozzolan, especially for his glorious MediaWiki framework for PHP.\ No newline at end of file