473,503 Members | 5,495 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Simple script for doing a simple photo album and journal?

I'm looking to quickly get a photo album online. Very simple, thumbnails,
a few pages, maybe a description, but hopefully a small script that's easy
to edit and work into my existing site. I know about hot scripts, etc. but
I was wondering if any one could recommend one?

Secondly, I also want to setup a journal. It's not really a "blog"
although I guess blog software may work. But it isn't going to be a
message board or anything like that. Just a place to put out random bits
of news. Once again, same premise, I'm trying to find the most simple
script possible that could basically traverse a directory of simple
textfiles and produce a list.

I know all about Blosxom and stuff like that, but I'd like a script that
just did the above and didn't overtake my site like PHPNuke or something
like that. I'll probably roll my own, but I thought I'd check first.

Preston
Jul 17 '05 #1
1 3226
Preston Crawford wrote:
I'm looking to quickly get a photo album online. Very simple, thumbnails,
a few pages, maybe a description, but hopefully a small script that's easy
to edit and work into my existing site. I know about hot scripts, etc. but
I was wondering if any one could recommend one?

Secondly, I also want to setup a journal. It's not really a "blog"
although I guess blog software may work. But it isn't going to be a
message board or anything like that. Just a place to put out random bits
of news. Once again, same premise, I'm trying to find the most simple
script possible that could basically traverse a directory of simple
textfiles and produce a list.

I know all about Blosxom and stuff like that, but I'd like a script that
just did the above and didn't overtake my site like PHPNuke or something
like that. I'll probably roll my own, but I thought I'd check first.

Preston

here is one I have used in the past.. not sure how well I liked it as it has
been a while since I have seen it and it has not been updated to PHP 4.x.x
_GET,_POST so YMMV. Also some of the lines may have wrapped and you will need
to fix those before it will work.

I found it using google... You can find almost anything (code wise) using google.

<?php
////////////////////////////////////////////////////////////////////////////////
////////////////////////
// NAME:
// imagebrowser.php
//
// VERSION:
// Version 1.0 - 18/07/01
//
// Version 1.2 - 05/10/01 (Je**********@UnderGrid.net)
// - Cleaned up HTML code so it works on both Netscape and IE cleanly
// as it appeared to only work under IE as written. Stylesheets still
// need work for Netscape but work under IE
//
// AUTHOR:
// Jo Demol (de*********@yahoo.com)
//
// DESCRIPTION:
// Drop this file in any directory that you want and it automaticaly generates
// an easy to use browsable interface for your images
//
// RETURNED VARIABLES:
// no variables are returned
//
// Configuration Variables
// ======================
//
// imgperpage : the number of thumbnail images displayed
// its best to give this a value that is a multiple of imgperrow
// imgperrow : the number of thumbnail images per row
// typelist : array that contains the imagetypes shown by the browser
// currentdir : default the directory where this php file resides,
// can be replaced by any directory of your choice
// title : enter the title of your page here
// home : enter path to your home directory or any other desired direct
ory
// stylesheet : enter the path to your stylesheet here
// the stylesheet should have these classe:
//
// .imag { border-style : solid;
// border-color: blue;
// border-width : 1px;}
// .thumb { border-style : solid;
// border-color: #999999;
// border-width : 2px;}
// A:link { color: #999999;
// text-decoration : none; }
// A:visited { color: #999999;
// text-decoration : none; }
// A:hover { color:blue; }
// any of these classses can be adjusted to your needs
//
// USAGE:
// to browse through the images use the back and forward images
// click on one of the thumbnails
// or use one of the pagelinks to go directly to another set of images
// clicking on the large image will give you the full image
////////////////////////////////////////////////////////////////////////////////
/////////////////////////
//---Variables---

$imgperpage = 8;
$imgperrow = 4;
$currentdir = getcwd ();
$typelist = array("jpg","jpeg","gif","png");
$imagelist = array();
$title = "the showroom";
$stylesheet = "" ;
$home = "https://www.spacelots.com/litschauphotos/imagebrowser.php";

//--- ind is put to zero when the script is first called uppon---

if(!isset($_GET['ind']))
$ind = 0;
$index = $_GET['ind'];

//---the following code iterates through the directory
//---and puts any image found in the imagelist array---

$dp=opendir($currentdir);
while ( false != ( $file=readdir($dp) ) ) {
if (is_file($file) && $file!="." && $file!=".."){

$extention = explode(".",$file);
$extention = $extention['1'];

if( in_array($extention,$typelist) ){
array_push ($imagelist,$file);
}
}
}
?>
<html>
<head>
<title><?php echo $title ?></title>
<LINK REL="STYLESHEET" HREF="<?php echo $stylesheet?>">
</head>
<body bgcolor="#eCeC0F">

<table align="center" border=0>
<tr>
<td>
<? if($index-1 >= 0) {?>
<a href='imagebrowser.php?ind=<? echo $index-1 ?>'>[ prev ]</a>
<? }
else
{
echo "&nbsp;";
} ?>
</td>
<td>
<a href='<? echo $imagelist[$index] ?>' target='_blank'><image src='<? echo $i
magelist[$index] ?>' class='imag'></a>
</td>
<td>
<? if($index+1 < count($imagelist) ) {?>
<a href='imagebrowser.php?ind=<? echo $index+1 ?>'>[ next ]</a>
<? } ?>
</td>
</tr>
</table>

<br>

<table align="center">
<tr>
<?
//---this code generates the thumbnails based on the configuration settings---

$nrpages = ceil( count($imagelist)/$imgperpage );

for($j=0;$j<$nrpages;$j++)
{
if( $index >= ($j*$imgperpage) && $index < (($j+1) * $imgperpage) ) {
for($i=($j*$imgperpage);$i<(($j+1) * $imgperpage);$i++) {
if(($i%$imgperrow == 0) && ($i > 0)) { ?>
</tr>
<tr>
<? } if($i <count($imagelist) ) {
$path = "imagebrowser.php?ind=".$i; ?>
<td>
<a href='<? echo $path ?>'><img src='<? echo $imagelist[$i] ?>' width='50' he
ight='50' class='thumb'></a>
</td>
<? }
}
}
}
?>
</tr>
</table>
<br>
<center>
<?
//---this code generates links based on the configuration settings---

for($j=0;$j<$nrpages;$j++)
{
echo "<a href='imagebrowser.php?ind=".($j*$imgperpage)."'>" ;
echo "[page ".($j+1)."]";
echo "</a>";
}
?>
</center>
<center> <a href="<? echo $home ?>">[ home ]</a></center>
</body>
</html>

--
Michael Austin.
Consultant - Available.
Donations welcomed. Http://www.firstdbasource.com/donations.html
:)
Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2976
by: Nick | last post by:
I am building a photo album webpage and am not sure exactly how I should organize the database. Here's where Im at so far... I have one table called 'images' which contains the columns 'albumID',...
3
2130
by: frizzle | last post by:
Hi there, I've posted the following question elsewhere, but got no response, and there seems to be no special htaccess-group, so i took the liberty to post it here. Hope y'all dont mind. I...
5
6517
by: Joseph Ellis | last post by:
Hello all. I have a family website that I have been maintaining for the past year and a half or so. It includes a photo album that has grown quite large. So far I've displayed the photo album...
5
4182
by: fraser | last post by:
Hi, I have a photo gallery with cat photos here http://mouserspage.cjb.net From the beginning, I have been making each page of thumbnails, with a separate page for each photo, entirely in...
3
2614
by: Ben Cartwright | last post by:
I'd like to create an ASP.NET-based photo album. Rather than creating a bunch of HTML pages as in a typical photo album, I'd like to leverage the dynamic capabilities of ASP.NET. Any suggestions...
6
1109
by: Brian | last post by:
Hello, I was having a problem saveing images that I edited with a vb.net program. Every time I would save the image I would receive a GDI+ error. I tried everything that I could think of...
8
1652
by: Axelar | last post by:
Hi :) i've found a usefull script : http://www.editeurjavascript.com/scripts/scripts_formulaires_3_786.php but if i do the same with my form inserted in a table then it doesn't work anymore. ...
10
1773
by: DavidSeck.com | last post by:
Hi, I am working with the Facebook API right now, an I have kind of a problem, but I don't know what I am doing wrong. So I have a few arrays, f.ex.: User albums: array(2) {
0
7093
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7357
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7012
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7468
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5598
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5023
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4690
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3171
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
748
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.