473,765 Members | 2,010 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 3256
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.ph p
//
// VERSION:
// Version 1.0 - 18/07/01
//
// Version 1.2 - 05/10/01 (Je**********@U nderGrid.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*********@ya hoo.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","jp eg","gif","png" );
$imagelist = array();
$title = "the showroom";
$stylesheet = "" ;
$home = "https://www.spacelots.c om/litschauphotos/imagebrowser.ph p";

//--- 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($cu rrentdir);
while ( false != ( $file=readdir($ dp) ) ) {
if (is_file($file) && $file!="." && $file!=".."){

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

if( in_array($exten tion,$typelist) ){
array_push ($imagelist,$fi le);
}
}
}
?>
<html>
<head>
<title><?php echo $title ?></title>
<LINK REL="STYLESHEET " HREF="<?php echo $stylesheet?>">
</head>
<body bgcolor="#eCeC0 F">

<table align="center" border=0>
<tr>
<td>
<? if($index-1 >= 0) {?>
<a href='imagebrow ser.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($imagelis t) ) {?>
<a href='imagebrow ser.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($imagelis t)/$imgperpage );

for($j=0;$j<$nr pages;$j++)
{
if( $index >= ($j*$imgperpage ) && $index < (($j+1) * $imgperpage) ) {
for($i=($j*$img perpage);$i<(($ j+1) * $imgperpage);$i ++) {
if(($i%$imgperr ow == 0) && ($i > 0)) { ?>
</tr>
<tr>
<? } if($i <count($imageli st) ) {
$path = "imagebrowser.p hp?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<$nr pages;$j++)
{
echo "<a href='imagebrow ser.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
3007
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', 'url', 'title', and 'description'. Then another table called 'albums' which contains the column 'name'. The part where I am having the most trouble is the 'images.albumID' column. Some photos should be placed in mutliple albums, so should the...
3
2144
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 have a site with a photo album on it. Albums are stored in a MySQL db. I use a site with a standard layout, with
5
6581
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 using frames, with thumbnails on the left side of the screen and full-size images displayed on the right. But now I'm sick of frames and I'd like to use javascript to make the whole shebang cleaner and tighter. I'd like to use a table,...
5
4314
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 plain html. Since the number of photos I have has increased greatly, it becomes a long and tedious process to go through all the pages to edit the links (to newly added pages) and add in the new pages etc...
3
2651
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 for getting started, samples, or articles would be greatly apprecated... I'm particularly interested in knowing which controls to use to display the thumbnails and full-sized graphics, and how to display the full-sized graphic when a thumbnail is...
6
1121
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 including copying the photo album to my local drive and I still kept getting the errors. Finally I tried copying out only the folder that contained the images that I wanted to update and everyting worked great. Here is the question. How man levels...
8
1670
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. i don't understand why as my javascript knowledge is poor :( is there a solution to make this script work even when the form is in
10
1799
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
10164
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10007
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9959
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9835
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7379
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5277
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5423
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3926
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2806
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.