GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   how difficult would this script be in php to write? (https://gfy.com/showthread.php?t=859794)

d-null 10-05-2008 09:02 PM

how difficult would this script be in php to write?
 
I am thinking of a standalone php script that would put up a neat column and row page of images that don't change, out of a folder of images that could be added too.... for example, if there are 9 images in the folder, it will display three rows of three columns, but if I later add more images to the folder, it will automatically display more rows so that all the pictures are displayed on the single page....

the script would have nothing to do with the adding of pictures, it would only need to look in that folder and work with what it finds there

how long would it take an average php programmer to script something like that?

jimbona 10-05-2008 09:13 PM

Heres a simple way to do it

PHP Code:

<?php
$i
=1;
$mid=3;
foreach (
glob("{*.jpg,*.JPG,*.gif,*.GIF}",GLOB_BRACE) as $file
{
   echo 
'<a href="./'.$file.'"><img src="./thumbs/'.$file.'" border="0" width="100" hspace="5" vspace="5"></a>';
   if(
$i == $mid)
   {
        echo 
"<br />";
       
$i=0;
   }
   
$i++;
}
?>

Drop the file into the same dir as you images in the structure of

/index.php
/thumbs/

for example.

All your images and thumbs need to have the same name.
Change $mid to the number of images you want per row.

Libertine 10-05-2008 09:15 PM

An hour. That includes turning on the computer, getting coffee, getting distracted by a porn flick, and having two cigarette breaks.

I suppose it could be done in 5 minutes, but then the programmer would miss out on a cup of coffee, two cigarettes and a decent porn scene.

d-null 10-05-2008 09:58 PM

thanks jimbona, I'll give that a try and let you know how I make out :thumbsup


All times are GMT -7. The time now is 02:17 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123