Skip to content

Instantly share code, notes, and snippets.

@neamtua
Last active September 17, 2023 19:38
Show Gist options
  • Save neamtua/d2b37dbeb9130ad384ad to your computer and use it in GitHub Desktop.
Save neamtua/d2b37dbeb9130ad384ad to your computer and use it in GitHub Desktop.
Image gallery generator
@MaverickEsq
Copy link

MaverickEsq commented Sep 17, 2023

Is what I needed and was too lazy to write. Since you have requested feedback: this script assumes that it is saved as index.php so navigation uses links of ./ which break if you name it gallery.php because you have a different index doing a different thing.
I just did a find and replace for href="./ to href="<?=basename($_SERVER["SCRIPT_FILENAME"], ".php")?>.php which fixed it for this use case but you may want to check if it is indeed index.php or not.
Sorry to necro your old throwaway gallery but hey who doesn't like knowing someone is using their thing.

Also, here, have a free darkmode:

		body {
			background: #2e2e2e;
		}
		p {
			color: #797979
		}

		.thumbnail {
			background-color: #1d1d1d;
			opacity: 95%;
			border: 1px solid #1d1d1d;
		}
		strong {
			color: #e5b567;
		}

		h1>a {
			color: #e87d3e;
		}

		.pager li > a {
			color: #b05279;
			background-color: #1d1d1d !important;
			border: 1px solid #1d1d1d
		}

		.disabled li > a {
			color: #9e86c8;
		}

@neamtua
Copy link
Author

neamtua commented Sep 17, 2023

Is what I needed and was too lazy to write. Since you have requested feedback: this script assumes that it is saved as index.php so navigation uses links of ./ which break if you name it gallery.php because you have a different index doing a different thing. I just did a find and replace for href="./ to href="<?=basename($_SERVER["SCRIPT_FILENAME"], ".php")?>.php which fixed it for this use case but you may want to check if it is indeed index.php or not. Sorry to necro your old throwaway gallery but hey who doesn't like knowing someone is using their thing.

Also, here, have a free darkmode:

		body {
			background: #2e2e2e;
		}
		p {
			color: #797979
		}

		.thumbnail {
			background-color: #1d1d1d;
			opacity: 95%;
			border: 1px solid #1d1d1d;
		}
		strong {
			color: #e5b567;
		}

		h1>a {
			color: #e87d3e;
		}

		.pager li > a {
			color: #b05279;
			background-color: #1d1d1d !important;
			border: 1px solid #1d1d1d
		}

		.disabled li > a {
			color: #9e86c8;
		}

Hey, thanks for using this and i'm glad at least someone's used it. I've totally forgotten about it until today, i could totally make a better version now. Thanks for the additions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment