/    Sign up×
Community /Pin to ProfileBookmark

Could I recreate this with PHP?

I need to know if there’s a way to recreate the Flash program on this site: [URL=http://www.curbingcolorado.com/photos.htm]http://www.curbingcolorado.com/photos.htm[/URL] using PHP and HTML and whatnot. Doesn’t have to have all the effects, just needs to have the thumbnails, the description and of course the main photo.

Could someone point me in the right direction on how I could do this kind of project? ?

to post a comment
PHP

7 Comments(s)

Copy linkTweet thisAlerts:
@NogDogOct 09.2005 — You could to it by making a link for each thumbnail with a URL variable assignment:
[code=html]
<a href="thispage.php?img=photo1"><img src="thumbnail1.jpg" alt="Photo One"></a>
[/code]

Then where you want to display the large image:
[code=php]
<?php
$img = (isset($_GET['img']) and file_exists("images/{$_GET['img']}.jpg")) ?
$_GET['img']."jpg" : "default_image.jpg";
echo "<img src='images/$img' alt='photo'>";
?>
[/code]

The disadvantage is that the page will have to reload each time, but if the graphics are reasonably sized and web-optimized and you use decent HTML markup with an external CSS style sheet, this should not be too big a deal. It does have the advantage of not depending on the user having any client side plug-in or JavaScript being enabled.
Copy linkTweet thisAlerts:
@cyber1Oct 09.2005 — You would need Javascript and CSS:

Heres a similar effect:

[URL=http://www.dynamicdrive.com/dynamicindex4/highlightgrad.htm]http://www.dynamicdrive.com/dynamicindex4/highlightgrad.htm[/URL]

The rest is pretty simlpy JS.

-bill
Copy linkTweet thisAlerts:
@juicemousezeroauthorOct 09.2005 — I gotcha... and I'm glad I won't need to rely on a database, too. Very good news. Thanks a ton to you both. Let's see what I can do..
Copy linkTweet thisAlerts:
@juicemousezeroauthorOct 09.2005 — Oh wait, what about the description? I forgot all about it. Could I use some similar file-based method for the description?
Copy linkTweet thisAlerts:
@NogDogOct 09.2005 — You could create a small text file for each photo. Then, if you used the method I described above, you could name each text file the same as the image name but with a ".txt" suffix (or whatever other suffix works for you). Then where you want that text to appear, it would be similar, but using the PHP include() function:
[code=php]
<?php
$text = (isset($_GET['img']) and file_exists("images/{$_GET['img']}.txt")) ?
$_GET['img']."txt" : "default_text.txt";
include($text);
?>
[/code]
Copy linkTweet thisAlerts:
@cyber1Oct 09.2005 — I have worked up an example using the Dynamic Drive JS function and some of my own to handle the image swaps and description.


-Bill

[upl-file uuid=857336d4-d38c-4010-a525-b84690936fcf size=67kB]test_images.zip[/upl-file]
Copy linkTweet thisAlerts:
@juicemousezeroauthorOct 10.2005 — Thanks a lot, guys. ?
×

Success!

Help @juicemousezero spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.6,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...