Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Search this Thread Display Modes
  11 November 2003
Talking selectMenuGallery

Hye CGtalker,
I recently coded a php script that you can use to generate a simple image viewer diplaying the pictures (jpg and gif) from the folder where this script is located. It makes all for you automaticaly. How? simply copy this code and paste it in a text file calling "index.php".
That's better than a plain server folder sort! Use it, it's a gift !
An example here.

<table border=0>
		<select onChange="document.images['imageSelectMenu'].src=this.options[this.selectedIndex].value" >
		<option value="" selected> Selection </option>

// selectMenuGallery by Nicolas d'Haussy
// generate a navigation with select menu to display the picture from the folder where this script is located

// Lists the images of this directory and build the select menu.
while ($file=readdir($session)) {

	if (is_file($file)) {

		// Check if the file is an image
		$extension = strtolower(substr(strrchr($file,  "." ), 1 ));
		if ($extension == "jpg" || $extension == "jpeg" || $extension == "gif") {

			// Build the select menu
			$selectMenuItems .= ("		<option value=\"" . $file . "\">" . $file . "</option>\n");
// Then display the dynamic menu items
echo ($selectMenuItems);
			<IMG NAME="imageSelectMenu" src="" BORDER="0">
  01 January 2006
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
  share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 03:39 PM.

Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.