Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XML Image Gallery Management 2

Status
Not open for further replies.
Apr 27, 2006
126
GB
Hi,

Just looking for a point in the right direction as I can't seem to figure out/find the best way to get started.

I wish to create the facility for someone to upload images and descriptions associated to that image to the web server via a form. I wish to do this without a MySQL back end so I figure the best way to hold the information about the whereabouts of the images and their descriptions would be best held in an XML file.

I want this person to be able to add images+descriptions, delete images+descriptions and edit descriptions, possibly add tags.

Could someone please give my metaphorical boat a nudge in the right direction so I can get started with this? Is this the best solution or is there a better option which avoids using a database server?

Many thanks in advance.

p.s. I posted in this section as I guessed it would be the PHP which manages the XML file, but if it would be more suitable in a different section I will be happy to move there :)

________
clueless
 
i would run away from storing things in xml. why did you reach that conclusion?

better than xml would be csv, a serialised array, a serialised object and best of all a sqlite database (typically built into php).

happy to help with xml - but it is a far from optimal solution, imo.

when you post back, please let us see the form that you will be using and also explain what you will be doing with the data going forward (as this has an impact on how you structure the data store for searching and retrieving).
 
ah! I knew there was a better way I just had a mental block. CSV will do just fine, It's only going to be a form with an image upload and a couple of textboxes, if i add a timestamp and an incremental number at the point of upload the problem is sorted and I'll just dump the CSV into an array when it's required.

I'll get working, but just incase you have any other nuggets of wisdom, I'll answer your questions

Form isn't written yet but it will be a hard coded password protected page that the user can select a local image to be uploaded, write a description of the picture (she's a cake designer) and add a few tags for sorting and searching. She will also be able to remove and / or edit said images. This will be dynamically loaded on the gallery/portfolio page.

I did ponder using a 3rd party image hosting site but couldn't seem to find one that would just drop into a site so I decided to just host them on the server.

Thanks for the nudge jpadie, much appreciated

________
clueless
 
honestly, I'd use sqlite.

failing that, if there are under 5000 images or so, I'd go for a serialised array of objects, stored in a flat text file. that's the easiest I think. But like all text files it is subject to locking issues and race conditions etc etc, which is what makes it much better to use a database manager. something like this code should work OK as a standalone solution (health warning - I just wrote this up in ten minutes or so and i have not tested it at all. Also I have not provided all the routines that you would need (i.e. no 'new image' routine). Also the thumbnail provision is awful as I do not provide code to do the dynamic resizing and cacheing, so just send down the full sized file and prescribe html sizing constraints). Basically the point is to show you how something could be done in a very few lines of code.

Code:
[COLOR=#990000]<?php[/color]
[COLOR=#009900]$action[/color] [COLOR=#990000]=[/color] [b][COLOR=#0000FF]isset[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$_POST[/color][COLOR=#990000][[/color][COLOR=#FF0000]'action'[/color][COLOR=#990000]])[/color] 
[tab][tab][tab][COLOR=#990000]?[/color]   [b][COLOR=#000000]trim[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$_POST[/color][COLOR=#990000][[/color][COLOR=#FF0000]'action'[/color][COLOR=#990000]])[/color] 
[tab][tab][tab][COLOR=#990000]:[/color]   [b][COLOR=#0000FF]isset[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$_GET[/color][COLOR=#990000][[/color][COLOR=#FF0000]'action'[/color][COLOR=#990000]])[/color] 
[tab][tab][tab][tab][COLOR=#990000]?[/color] [b][COLOR=#000000]trim[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$_GET[/color][COLOR=#990000][[/color][COLOR=#FF0000]'action'[/color][COLOR=#990000]])[/color] 
[tab][tab][tab][tab][COLOR=#990000]:[/color] [COLOR=#FF0000]''[/color][COLOR=#990000];[/color]

[b][COLOR=#0000FF]switch[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$action[/color][COLOR=#990000]):[/color]
[tab][b][COLOR=#0000FF]case[/color][/b] [COLOR=#FF0000]''[/color][COLOR=#990000]:[/color]
[tab][tab][COLOR=#009900]$images[/color] [COLOR=#990000]=[/color] [b][COLOR=#0000FF]new[/color][/b] images[COLOR=#990000];[/color]
[tab][tab][COLOR=#009900]$images[/color][COLOR=#990000]->[/color][b][COLOR=#000000]listImages[/color][/b][COLOR=#990000]();[/color]
[tab][tab][b][COLOR=#0000FF]break[/color][/b][COLOR=#990000];[/color]
[tab][b][COLOR=#0000FF]case[/color][/b] [COLOR=#FF0000]'Delete'[/color][COLOR=#990000]:[/color]
[tab][tab][COLOR=#009900]$images[/color] [COLOR=#990000]=[/color] [b][COLOR=#0000FF]new[/color][/b] images[COLOR=#990000];[/color]
[tab][tab][COLOR=#009900]$images[/color][COLOR=#990000]->[/color][b][COLOR=#000000]delete[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$_POST[/color][COLOR=#990000][[/color][COLOR=#FF0000]'imageID'[/color][COLOR=#990000]]);[/color]
[tab][tab][COLOR=#009900]$images[/color][COLOR=#990000]->[/color][b][COLOR=#000000]listImages[/color][/b][COLOR=#990000]();[/color]
[tab][tab][b][COLOR=#0000FF]break[/color][/b][COLOR=#990000];[/color]
[tab][b][COLOR=#0000FF]case[/color][/b] [COLOR=#FF0000]'Edit'[/color][COLOR=#990000]:[/color]
[tab][tab][COLOR=#009900]$images[/color] [COLOR=#990000]=[/color] [b][COLOR=#0000FF]new[/color][/b] images[COLOR=#990000];[/color]
[tab][tab][COLOR=#009900]$images[/color][COLOR=#990000]->[/color][b][COLOR=#000000]edit[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$_POST[/color][COLOR=#990000][[/color][COLOR=#FF0000]'imageID'[/color][COLOR=#990000]]);[/color]
[tab][tab][b][COLOR=#0000FF]break[/color][/b][COLOR=#990000];[/color]
[tab][b][COLOR=#0000FF]case[/color][/b] [COLOR=#FF0000]'Save'[/color][COLOR=#990000]:[/color]
[tab][tab][COLOR=#009900]$images[/color] [COLOR=#990000]=[/color] [b][COLOR=#0000FF]new[/color][/b] images[COLOR=#990000];[/color]
[tab][tab][b][COLOR=#0000FF]if[/color][/b][COLOR=#990000]([/color][b][COLOR=#0000FF]isset[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$_POST[/color][COLOR=#990000][[/color][COLOR=#FF0000]'imageID'[/color][COLOR=#990000]])):[/color]
[tab][tab][tab][COLOR=#009900]$image[/color] [COLOR=#990000]=&[/color] [COLOR=#009900]$images[/color][COLOR=#990000]->[/color]images[COLOR=#990000][[/color][COLOR=#009900]$_POST[/color][COLOR=#990000][[/color][COLOR=#FF0000]'imageID'[/color][COLOR=#990000]]];[/color]
[tab][tab][tab][i][COLOR=#9A1900]//update the image data[/color][/i]
[tab][tab][tab][COLOR=#009900]$images[/color][COLOR=#990000]->[/color][b][COLOR=#000000]listImages[/color][/b][COLOR=#990000]();[/color]
[tab][tab][b][COLOR=#0000FF]else[/color][/b][COLOR=#990000]:[/color]
[tab][tab][tab][i][COLOR=#9A1900]//save the uploaded file somewhere and call the addImage method[/color][/i]
[tab][tab][tab][COLOR=#009900]$images[/color][COLOR=#990000]->[/color][b][COLOR=#000000]addImage[/color][/b] [COLOR=#990000]([/color][COLOR=#009900]$imageFileName[/color][COLOR=#990000],[/color][COLOR=#009900]$imageDescription[/color][COLOR=#990000]);[/color]
[tab][tab][tab][COLOR=#009900]$images[/color][COLOR=#990000]->[/color][b][COLOR=#000000]listImages[/color][/b][COLOR=#990000]();[/color]
[tab][tab][b][COLOR=#0000FF]endif[/color][/b][COLOR=#990000];[/color]
[tab][tab][b][COLOR=#0000FF]break[/color][/b][COLOR=#990000];[/color]
[tab][b][COLOR=#0000FF]case[/color][/b] [COLOR=#FF0000]'getImage'[/color][COLOR=#990000]:[/color]
[tab][tab][COLOR=#009900]$images[/color] [COLOR=#990000]=[/color] [b][COLOR=#0000FF]new[/color][/b] images[COLOR=#990000];[/color]
[tab][tab][COLOR=#009900]$images[/color][COLOR=#990000][[/color][COLOR=#009900]$_GET[/color][COLOR=#990000][[/color][COLOR=#FF0000]'imageID'[/color][COLOR=#990000]]]->[/color][b][COLOR=#000000]outputImage[/color][/b][COLOR=#990000]();[/color]
[tab][tab][b][COLOR=#0000FF]break[/color][/b][COLOR=#990000];[/color]
[b][COLOR=#0000FF]endswitch[/color][/b][COLOR=#990000];[/color]

[b][COLOR=#0000FF]class[/color][/b] images[COLOR=#FF0000]{[/color]
[tab]
[tab]public [COLOR=#009900]$images[/color] [COLOR=#990000]=[/color] [b][COLOR=#0000FF]array[/color][/b][COLOR=#990000]();[/color]
[tab]private [COLOR=#009900]$storageFile[/color] [COLOR=#990000]=[/color] [COLOR=#FF0000]''[/color][COLOR=#990000];[/color] [i][COLOR=#9A1900]//full absolute url to storage file[/color][/i]
[tab]
[tab]public [b][COLOR=#0000FF]function[/color][/b] [b][COLOR=#000000]construct[/color][/b][COLOR=#990000]()[/color][COLOR=#FF0000]{[/color]
[tab][tab][b][COLOR=#0000FF]if[/color][/b][COLOR=#990000]([/color][b][COLOR=#000000]file_exists[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]storageFile[COLOR=#990000])):[/color]
[tab][tab][tab][COLOR=#009900]$content[/color] [COLOR=#990000]=[/color] [b][COLOR=#000000]file_get_contents[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]storageFile[COLOR=#990000]);[/color]
[tab][tab][tab][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]images [COLOR=#990000]=[/color] [b][COLOR=#000000]unserialize[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$content[/color][COLOR=#990000]);[/color]
[tab][tab][tab][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]original [COLOR=#990000]=[/color] [COLOR=#009900]$this[/color][COLOR=#990000]->[/color]images[COLOR=#990000];[/color]
[tab][tab][b][COLOR=#0000FF]endif[/color][/b][COLOR=#990000];[/color]
[tab][COLOR=#FF0000]}[/color]
[tab]
[tab]public [b][COLOR=#0000FF]function[/color][/b] [b][COLOR=#000000]__destruct[/color][/b][COLOR=#990000]()[/color][COLOR=#FF0000]{[/color]
[tab][tab][b][COLOR=#0000FF]if[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]original [COLOR=#990000]!=[/color] [COLOR=#009900]$this[/color][COLOR=#990000]->[/color]images[COLOR=#990000]):[/color]
[tab][tab][tab][b][COLOR=#000000]copy[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]storageFile[COLOR=#990000],[/color] [b][COLOR=#000000]date[/color][/b][COLOR=#990000]([/color][COLOR=#FF0000]'Y-m-d_H-i-s'[/color][COLOR=#990000])[/color] [COLOR=#990000].[/color] [COLOR=#FF0000]'_'[/color] [COLOR=#990000].[/color] [COLOR=#009900]$this[/color][COLOR=#990000]->[/color]storageFile[COLOR=#990000]);[/color]
[tab][tab][tab][b][COLOR=#000000]file_put_contents[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]storageFile[COLOR=#990000],[/color] [b][COLOR=#000000]serialize[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]images[COLOR=#990000]));[/color]
[tab][tab][b][COLOR=#0000FF]endif[/color][/b][COLOR=#990000];[/color]
[tab][COLOR=#FF0000]}[/color]
[tab]
[tab]public [b][COLOR=#0000FF]function[/color][/b] [b][COLOR=#000000]delete[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$imageID[/color][COLOR=#990000])[/color][COLOR=#FF0000]{[/color]
[tab][tab][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]images[COLOR=#990000][[/color][COLOR=#009900]$imageID[/color][COLOR=#990000]]->[/color][b][COLOR=#000000]markDeleted[/color][/b][COLOR=#990000]();[/color]
[tab][COLOR=#FF0000]}[/color]
[tab]
[tab]public [b][COLOR=#0000FF]function[/color][/b] [b][COLOR=#000000]addImage[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$imageFileName[/color][COLOR=#990000],[/color] [COLOR=#009900]$imageDescription[/color][COLOR=#990000])[/color][COLOR=#FF0000]{[/color]
[tab][tab][COLOR=#009900]$image[/color] [COLOR=#990000]=[/color] [b][COLOR=#0000FF]new[/color][/b] image[COLOR=#990000];[/color]
[tab][tab][COLOR=#009900]$image[/color][COLOR=#990000]->[/color][b][COLOR=#000000]newImage[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$imageFileName[/color][COLOR=#990000],[/color] [COLOR=#009900]$imageDescription[/color][COLOR=#990000]);[/color]
[tab][tab][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]images[COLOR=#990000][[/color][COLOR=#009900]$image[/color][COLOR=#990000]->[/color]imageID[COLOR=#990000]][/color] [COLOR=#990000]=[/color] [COLOR=#009900]$image[/color][COLOR=#990000];[/color]
[tab][COLOR=#FF0000]}[/color]
[tab]
[tab]public [b][COLOR=#0000FF]function[/color][/b] [b][COLOR=#000000]editImage[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$imageID[/color][COLOR=#990000])[/color][COLOR=#FF0000]{[/color]
[tab][tab][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]images[COLOR=#990000][[/color][COLOR=#009900]$imageID[/color][COLOR=#990000]]->[/color][b][COLOR=#000000]outputEditable[/color][/b][COLOR=#990000]();[/color]
[tab][COLOR=#FF0000]}[/color]
[tab]
[tab]public [b][COLOR=#0000FF]function[/color][/b] [b][COLOR=#000000]listImages[/color][/b][COLOR=#990000]()[/color][COLOR=#FF0000]{[/color]
[tab][tab][COLOR=#990000]?>[/color]
[COLOR=#990000]<[/color]div id[COLOR=#990000]=[/color][COLOR=#FF0000]"imagesList"[/color][COLOR=#990000]>[/color]
[tab][COLOR=#990000]<[/color]table[COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]<[/color]thead[COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]<[/color]tr[COLOR=#990000]>[/color]
[tab][tab][tab][COLOR=#990000]<[/color]th[COLOR=#990000]>[/color]Image ID[COLOR=#990000]</[/color]th[COLOR=#990000]>[/color]
[tab][tab][tab][COLOR=#990000]<[/color]th[COLOR=#990000]>[/color]Image FileName[COLOR=#990000]</[/color]th[COLOR=#990000]>[/color]
[tab][tab][tab][COLOR=#990000]<[/color]th[COLOR=#990000]>[/color]Image Description[COLOR=#990000]</[/color]th[COLOR=#990000]>[/color]
[tab][tab][tab][COLOR=#990000]<[/color]th[COLOR=#990000]>[/color]Image Thumbnail[COLOR=#990000]</[/color]th[COLOR=#990000]>[/color]
[tab][tab][tab][COLOR=#990000]<[/color]th[COLOR=#990000]>&[/color]nbsp[COLOR=#990000];</[/color]th[COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]</[/color]tr[COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]</[/color]thead[COLOR=#990000]>[/color]
[COLOR=#990000]<?php[/color]   [b][COLOR=#0000FF]foreach[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]images [b][COLOR=#0000FF]as[/color][/b] [COLOR=#009900]$image[/color][COLOR=#990000]):[/color]
[tab][tab][tab][b][COLOR=#0000FF]if[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$image[/color][COLOR=#990000]->[/color]deleted [COLOR=#990000]==[/color] false[COLOR=#990000])[/color] [b][COLOR=#0000FF]echo[/color][/b] [COLOR=#009900]$image[/color][COLOR=#990000]->[/color][b][COLOR=#000000]showListData[/color][/b][COLOR=#990000]();[/color]
[tab][tab][b][COLOR=#0000FF]endforeach[/color][/b][COLOR=#990000];[/color] 
[COLOR=#990000]?>[/color]
[COLOR=#990000]</[/color]div[COLOR=#990000]>[/color]
[COLOR=#990000]<?php[/color]
[tab][COLOR=#FF0000]}[/color]
[COLOR=#FF0000]}[/color]
[b][COLOR=#0000FF]class[/color][/b] image [COLOR=#FF0000]{[/color]
[tab]public [COLOR=#009900]$imageFileName[/color][COLOR=#990000]=[/color][COLOR=#FF0000]''[/color][COLOR=#990000];[/color]
[tab]public [COLOR=#009900]$imageID[/color] [COLOR=#990000]=[/color] [COLOR=#FF0000]''[/color][COLOR=#990000];[/color]
[tab]public [COLOR=#009900]$imageDescription[/color][COLOR=#990000];[/color]
[tab]public [COLOR=#009900]$deleted[/color] [COLOR=#990000]=[/color] false[COLOR=#990000];[/color]
[tab]
[tab]public [b][COLOR=#0000FF]function[/color][/b] [b][COLOR=#000000]newImage[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$imageFileName[/color][COLOR=#990000],[/color] [COLOR=#009900]$imageDescription[/color][COLOR=#990000])[/color][COLOR=#FF0000]{[/color]
[tab][tab][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]imageFileName [COLOR=#990000]=[/color] [COLOR=#009900]$imageFileName[/color][COLOR=#990000];[/color]
[tab][tab][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]imageDescription [COLOR=#990000]=[/color] [COLOR=#009900]$imageDescription[/color][COLOR=#990000];[/color]
[tab][tab][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]imageID [COLOR=#990000]=[/color] [b][COLOR=#000000]md5[/color][/b][COLOR=#990000]([/color][b][COLOR=#000000]uniqid[/color][/b][COLOR=#990000]([/color][COLOR=#FF0000]''[/color][COLOR=#990000],[/color] true[COLOR=#990000]));[/color]
[tab][COLOR=#FF0000]}[/color]
[tab]
[tab]public [b][COLOR=#0000FF]function[/color][/b] [b][COLOR=#000000]markDeleted[/color][/b][COLOR=#990000]()[/color][COLOR=#FF0000]{[/color]
[tab][tab][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]deleted [COLOR=#990000]=[/color] true[COLOR=#990000];[/color]
[tab][COLOR=#FF0000]}[/color]
[tab]
[tab]public [b][COLOR=#0000FF]function[/color][/b] [b][COLOR=#000000]output[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$editable[/color][COLOR=#990000]=[/color]false[COLOR=#990000])[/color][COLOR=#FF0000]{[/color]
[tab][tab][b][COLOR=#0000FF]if[/color][/b] [COLOR=#990000]([/color][COLOR=#009900]$editable[/color][COLOR=#990000])[/color] [b][COLOR=#0000FF]return[/color][/b] [COLOR=#009900]$this[/color][COLOR=#990000]->[/color]outputEditable[COLOR=#990000];[/color]
[tab][tab][b][COLOR=#0000FF]return[/color][/b] [COLOR=#009900]$this[/color][COLOR=#990000]->[/color][b][COLOR=#000000]outputFixed[/color][/b][COLOR=#990000]();[/color]
[tab][COLOR=#FF0000]}[/color]
[tab]
[tab]public [b][COLOR=#0000FF]function[/color][/b] [b][COLOR=#000000]showListData[/color][/b][COLOR=#990000]()[/color][COLOR=#FF0000]{[/color]
[COLOR=#990000]?>[/color]
[tab][tab][COLOR=#990000]<[/color]tbody[COLOR=#990000]>[/color]
[tab][tab][tab][COLOR=#990000]<[/color]tr[COLOR=#990000]>[/color]
[tab][tab][tab][tab][COLOR=#990000]<[/color]td[COLOR=#990000]><?=[/color][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]imageID[COLOR=#990000];?></[/color]td[COLOR=#990000]>[/color]
[tab][tab][tab][tab][COLOR=#990000]<[/color]td[COLOR=#990000]><?=[/color][b][COLOR=#000000]htmlspecialchars[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]imageFileName[COLOR=#990000]);?></[/color]td[COLOR=#990000]>[/color]
[tab][tab][tab][tab][COLOR=#990000]<[/color]td[COLOR=#990000]><?=[/color][b][COLOR=#000000]htmlspecialchars[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]imageDescription[COLOR=#990000]);?></[/color]td[COLOR=#990000]>[/color]
[tab][tab][tab][tab][COLOR=#990000]<[/color]td[COLOR=#990000]><?=[/color][COLOR=#009900]$this[/color][COLOR=#990000]->[/color][b][COLOR=#000000]getIMGtag[/color][/b][COLOR=#990000]();?></[/color]td[COLOR=#990000]>[/color]
[tab][tab][tab][tab][COLOR=#990000]<[/color]td[COLOR=#990000]>[/color]
[tab][tab][tab][tab][tab][COLOR=#990000]<[/color]form action[COLOR=#990000]=[/color][COLOR=#FF0000]""[/color] method[COLOR=#990000]=[/color][COLOR=#FF0000]"post"[/color][COLOR=#990000]>[/color]
[tab][tab][tab][tab][tab][COLOR=#990000]<[/color]input type[COLOR=#990000]=[/color][COLOR=#FF0000]"hidden"[/color] name[COLOR=#990000]=[/color][COLOR=#FF0000]"imageID"[/color] value[COLOR=#990000]=[/color][COLOR=#FF0000]"<?=$this->imageID;?>"[/color][COLOR=#990000]>[/color]
[tab][tab][tab][tab][tab][COLOR=#990000]<[/color]input type[COLOR=#990000]=[/color][COLOR=#FF0000]"submit"[/color] name[COLOR=#990000]=[/color][COLOR=#FF0000]"action"[/color] value[COLOR=#990000]=[/color][COLOR=#FF0000]"Delete"[/color] [COLOR=#990000]/>[/color]
[tab][tab][tab][tab][tab][COLOR=#990000]<[/color]input type[COLOR=#990000]=[/color][COLOR=#FF0000]"submit"[/color] name[COLOR=#990000]=[/color][COLOR=#FF0000]"action"[/color] value[COLOR=#990000]=[/color][COLOR=#FF0000]"Edit"[/color] [COLOR=#990000]/>[/color]
[tab][tab][tab][tab][COLOR=#990000]</[/color]form[COLOR=#990000]>[/color]
[tab][tab][tab][tab][COLOR=#990000]</[/color]td[COLOR=#990000]>[/color]
[tab][tab][tab][COLOR=#990000]</[/color]tr[COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]</[/color]tbody[COLOR=#990000]>[/color]
[COLOR=#990000]<?php[/color]
[tab][COLOR=#FF0000]}[/color]
[tab]
[tab]public [b][COLOR=#0000FF]function[/color][/b] [b][COLOR=#000000]outputImage[/color][/b][COLOR=#990000]()[/color][COLOR=#FF0000]{[/color]
[tab][tab][b][COLOR=#0000FF]list[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$width[/color][COLOR=#990000],[/color] [COLOR=#009900]$height[/color][COLOR=#990000],[/color] [COLOR=#009900]$type[/color][COLOR=#990000],[/color] [COLOR=#009900]$attr[/color][COLOR=#990000])[/color] [COLOR=#990000]=[/color] [b][COLOR=#000000]getimagesize[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]imageFileName[COLOR=#990000]);[/color]
[tab][tab][COLOR=#009900]$fh[/color] [COLOR=#990000]=[/color] [b][COLOR=#000000]fopen[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]imageFileName[COLOR=#990000],[/color][COLOR=#FF0000]'rb'[/color][COLOR=#990000]);[/color]
[tab][tab][b][COLOR=#000000]header[/color][/b][COLOR=#990000]([/color][COLOR=#FF0000]'Content-type: '[/color] [COLOR=#990000].[/color] [COLOR=#009900]$type[/color][COLOR=#990000]);[/color]
[tab][tab][b][COLOR=#000000]fpassthru[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$fh[/color][COLOR=#990000]);[/color]
[tab][tab][b][COLOR=#000000]fclose[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$fh[/color][COLOR=#990000]);[/color]
[tab][tab][b][COLOR=#0000FF]exit[/color][/b][COLOR=#990000];[/color]
[tab][COLOR=#FF0000]}[/color]
[tab]
[tab]private [b][COLOR=#0000FF]function[/color][/b] [b][COLOR=#000000]getImgTag[/color][/b][COLOR=#990000]()[/color][COLOR=#FF0000]{[/color]
[tab][tab][b][COLOR=#0000FF]list[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$width[/color][COLOR=#990000],[/color] [COLOR=#009900]$height[/color][COLOR=#990000])[/color] [COLOR=#990000]=[/color] [b][COLOR=#000000]getimagesize[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]imageFileName[COLOR=#990000]);[/color]
[tab][tab][COLOR=#009900]$max[/color] [COLOR=#990000]=[/color] [COLOR=#993399]80[/color][COLOR=#990000];[/color]
[tab][tab][b][COLOR=#0000FF]if[/color][/b] [COLOR=#990000]([/color][COLOR=#009900]$height[/color] [COLOR=#990000]>[/color] [COLOR=#009900]$width[/color][COLOR=#990000]):[/color]
[tab][tab][tab][COLOR=#009900]$newHeight[/color] [COLOR=#990000]=[/color] [COLOR=#993399]80[/color][COLOR=#990000];[/color]
[tab][tab][tab][COLOR=#009900]$newWidth[/color] [COLOR=#990000]=[/color] [b][COLOR=#000000]round[/color][/b][COLOR=#990000](([/color][COLOR=#993399]80[/color][COLOR=#990000]/[/color][COLOR=#009900]$height[/color] [COLOR=#990000])[/color] [COLOR=#990000]*[/color] [COLOR=#009900]$width[/color][COLOR=#990000]);[/color]
[tab][tab][b][COLOR=#0000FF]endif[/color][/b][COLOR=#990000];[/color]
[tab][tab][b][COLOR=#0000FF]return[/color][/b] [COLOR=#990000]<<<[/color]HTML
[COLOR=#990000]<[/color]img height[COLOR=#990000]=[/color][COLOR=#FF0000]"{$newHeight}px"[/color] width[COLOR=#990000]=[/color][COLOR=#FF0000]"{$newWidth}px"[/color] src[COLOR=#990000]=[/color][COLOR=#FF0000]"?action=getImage&imageID={$this->imageID}"[/color] [COLOR=#990000]/>[/color]
HTML[COLOR=#990000];[/color]
[tab][COLOR=#FF0000]}[/color]
[tab]
[tab]private [b][COLOR=#0000FF]function[/color][/b] [b][COLOR=#000000]outputEditable[/color][/b][COLOR=#990000]()[/color][COLOR=#FF0000]{[/color]
[COLOR=#990000]?>[/color]
[COLOR=#990000]<[/color]form method[COLOR=#990000]=[/color][COLOR=#FF0000]"post"[/color] action[COLOR=#990000]=[/color][COLOR=#FF0000]""[/color][COLOR=#990000]>[/color]
[tab][COLOR=#990000]<[/color]div [b][COLOR=#0000FF]class[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"row"[/color][COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]<[/color]div [b][COLOR=#0000FF]class[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"label"[/color][COLOR=#990000]>[/color]
[tab][tab][tab]Image File Name
[tab][tab][COLOR=#990000]</[/color]div[COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]<[/color]div [b][COLOR=#0000FF]class[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"field"[/color][COLOR=#990000]>[/color]
[tab][tab][tab][COLOR=#990000]<?=[/color][b][COLOR=#000000]htmlspecialchars[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$image[/color][COLOR=#990000]->[/color]imageFileName[COLOR=#990000]);?>[/color]
[tab][tab][COLOR=#990000]</[/color]div[COLOR=#990000]>[/color]
[tab][COLOR=#990000]</[/color]div[COLOR=#990000]>[/color]
[tab][COLOR=#990000]<[/color]div [b][COLOR=#0000FF]class[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"row"[/color][COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]<[/color]div [b][COLOR=#0000FF]class[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"label"[/color][COLOR=#990000]>[/color]
[tab][tab][tab]Image Description
[tab][tab][COLOR=#990000]</[/color]div[COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]<[/color]div [b][COLOR=#0000FF]class[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"field"[/color][COLOR=#990000]>[/color]
[tab][tab][tab][COLOR=#990000]<[/color]textarea name[COLOR=#990000]=[/color][COLOR=#FF0000]"imageDescription"[/color][COLOR=#990000]><?=[/color][COLOR=#009900]$image[/color][COLOR=#990000]->[/color]imageDescription[COLOR=#990000];?></[/color]textarea[COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]</[/color]div[COLOR=#990000]>[/color]
[tab][COLOR=#990000]</[/color]div[COLOR=#990000]>[/color]
[tab][COLOR=#990000]<[/color]div [b][COLOR=#0000FF]class[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"buttons"[/color][COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]<[/color]input type[COLOR=#990000]=[/color][COLOR=#FF0000]"submit"[/color] name[COLOR=#990000]=[/color][COLOR=#FF0000]"action"[/color] value[COLOR=#990000]=[/color][COLOR=#FF0000]"Save"[/color][COLOR=#990000]/>[/color]
[tab][tab][COLOR=#990000]<[/color]input type[COLOR=#990000]=[/color][COLOR=#FF0000]"hidden"[/color] name[COLOR=#990000]=[/color][COLOR=#FF0000]"imageID"[/color] value[COLOR=#990000]=[/color][COLOR=#FF0000]"<?=$image->imageID;?>"[/color][COLOR=#990000]/>[/color]
[tab][COLOR=#990000]</[/color]div[COLOR=#990000]>[/color]
[COLOR=#990000]</[/color]form[COLOR=#990000]>[/color]
[COLOR=#990000]<?php[/color]
[tab][COLOR=#FF0000]}[/color]
[tab]
[tab]private [b][COLOR=#0000FF]function[/color][/b] [b][COLOR=#000000]outputFixed[/color][/b][COLOR=#990000]()[/color][COLOR=#FF0000]{[/color]
[tab][COLOR=#990000]?>[/color]
[tab][COLOR=#990000]<[/color]div [b][COLOR=#0000FF]class[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"row"[/color][COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]<[/color]div [b][COLOR=#0000FF]class[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"label"[/color][COLOR=#990000]>[/color]
[tab][tab][tab]Image File Name
[tab][tab][COLOR=#990000]</[/color]div[COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]<[/color]div [b][COLOR=#0000FF]class[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"field"[/color][COLOR=#990000]>[/color]
[tab][tab][tab][COLOR=#990000]<?=[/color][b][COLOR=#000000]htmlspecialchars[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$image[/color][COLOR=#990000]->[/color]imageFileName[COLOR=#990000]);?>[/color]
[tab][tab][COLOR=#990000]</[/color]div[COLOR=#990000]>[/color]
[tab][COLOR=#990000]</[/color]div[COLOR=#990000]>[/color]
[tab][COLOR=#990000]<[/color]div [b][COLOR=#0000FF]class[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"row"[/color][COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]<[/color]div [b][COLOR=#0000FF]class[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"label"[/color][COLOR=#990000]>[/color]
[tab][tab][tab]Image Description
[tab][tab][COLOR=#990000]</[/color]div[COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]<[/color]div [b][COLOR=#0000FF]class[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"field"[/color][COLOR=#990000]>[/color]
[tab][tab][tab][COLOR=#990000]<?=[/color][b][COLOR=#000000]nl2br[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$image[/color][COLOR=#990000]->[/color]imageDescription[COLOR=#990000]);?>[/color]
[tab][tab][COLOR=#990000]</[/color]div[COLOR=#990000]>[/color]
[tab][COLOR=#990000]</[/color]div[COLOR=#990000]>[/color]
[COLOR=#990000]</[/color]form[COLOR=#990000]>[/color]
[COLOR=#990000]<?php[/color]   
[tab][COLOR=#FF0000]}[/color]
[tab]
[COLOR=#FF0000]}[/color]
 
oops. the first method in the images class should have a double underscore before construct. I'm sure that there are other errors too.

Code:
public [b][COLOR=#0000FF]function[/color][/b] [b][COLOR=#000000]__construct[/color][/b][COLOR=#990000]()[/color][COLOR=#FF0000]{[/color]
 
i've fixed the bugs now, and tested it. make sure that the permissions are set ok on the storage file.

Code:
[COLOR=#990000]<?php[/color]
[COLOR=#009900]$req[/color] [COLOR=#990000]=[/color] [b][COLOR=#000000]array_merge[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$_GET[/color][COLOR=#990000],[/color] [COLOR=#009900]$_POST[/color][COLOR=#990000]);[/color]
[COLOR=#009900]$action[/color] [COLOR=#990000]=[/color] [b][COLOR=#0000FF]isset[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$req[/color][COLOR=#990000][[/color][COLOR=#FF0000]'action'[/color][COLOR=#990000]])[/color] [COLOR=#990000]?[/color] [COLOR=#009900]$req[/color][COLOR=#990000][[/color][COLOR=#FF0000]'action'[/color][COLOR=#990000]][/color] [COLOR=#990000]:[/color] [COLOR=#FF0000]'no action'[/color][COLOR=#990000];[/color]
[b][COLOR=#0000FF]switch[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$action[/color][COLOR=#990000]):[/color]
[tab][b][COLOR=#0000FF]case[/color][/b] [COLOR=#FF0000]'no action'[/color][COLOR=#990000]:[/color]
[tab][tab][COLOR=#009900]$images[/color] [COLOR=#990000]=[/color] [b][COLOR=#0000FF]new[/color][/b] images[COLOR=#990000];[/color]
[tab][tab][COLOR=#009900]$images[/color][COLOR=#990000]->[/color][b][COLOR=#000000]listImages[/color][/b][COLOR=#990000]();[/color]
[tab][tab][b][COLOR=#0000FF]break[/color][/b][COLOR=#990000];[/color]
[tab][b][COLOR=#0000FF]case[/color][/b] [COLOR=#FF0000]'Delete'[/color][COLOR=#990000]:[/color]
[tab][tab][COLOR=#009900]$images[/color] [COLOR=#990000]=[/color] [b][COLOR=#0000FF]new[/color][/b] images[COLOR=#990000];[/color]
[tab][tab][COLOR=#009900]$images[/color][COLOR=#990000]->[/color][b][COLOR=#000000]delete[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$_POST[/color][COLOR=#990000][[/color][COLOR=#FF0000]'imageID'[/color][COLOR=#990000]]);[/color]
[tab][tab][COLOR=#009900]$images[/color][COLOR=#990000]->[/color][b][COLOR=#000000]listImages[/color][/b][COLOR=#990000]();[/color]
[tab][tab][b][COLOR=#0000FF]break[/color][/b][COLOR=#990000];[/color]
[tab][b][COLOR=#0000FF]case[/color][/b] [COLOR=#FF0000]'Edit'[/color][COLOR=#990000]:[/color]
[tab][tab][COLOR=#009900]$images[/color] [COLOR=#990000]=[/color] [b][COLOR=#0000FF]new[/color][/b] images[COLOR=#990000];[/color]
[tab][tab][COLOR=#009900]$images[/color][COLOR=#990000]->[/color][b][COLOR=#000000]editImage[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$_POST[/color][COLOR=#990000][[/color][COLOR=#FF0000]'imageID'[/color][COLOR=#990000]]);[/color]
[tab][tab][b][COLOR=#0000FF]break[/color][/b][COLOR=#990000];[/color]
[tab][b][COLOR=#0000FF]case[/color][/b] [COLOR=#FF0000]'Save'[/color][COLOR=#990000]:[/color]
[tab][tab][COLOR=#009900]$images[/color] [COLOR=#990000]=[/color] [b][COLOR=#0000FF]new[/color][/b] images[COLOR=#990000];[/color]
[tab][tab][b][COLOR=#0000FF]if[/color][/b][COLOR=#990000]([/color][b][COLOR=#0000FF]isset[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$_POST[/color][COLOR=#990000][[/color][COLOR=#FF0000]'imageID'[/color][COLOR=#990000]])):[/color]
[tab][tab][tab][COLOR=#009900]$image[/color] [COLOR=#990000]=&[/color] [COLOR=#009900]$images[/color][COLOR=#990000]->[/color]images[COLOR=#990000][[/color][COLOR=#009900]$_POST[/color][COLOR=#990000][[/color][COLOR=#FF0000]'imageID'[/color][COLOR=#990000]]];[/color]
[tab][tab][tab][COLOR=#009900]$image[/color][COLOR=#990000]->[/color]imageDescription [COLOR=#990000]=[/color] [COLOR=#009900]$_POST[/color][COLOR=#990000][[/color][COLOR=#FF0000]'imageDescription'[/color][COLOR=#990000]];[/color]
[tab][tab][tab][COLOR=#009900]$images[/color][COLOR=#990000]->[/color][b][COLOR=#000000]listImages[/color][/b][COLOR=#990000]();[/color]
[tab][tab][b][COLOR=#0000FF]else[/color][/b][COLOR=#990000]:[/color]
[tab][tab][tab][i][COLOR=#9A1900]//save the uploaded file somewhere and call the addImage method[/color][/i]
[tab][tab][tab][COLOR=#009900]$images[/color][COLOR=#990000]->[/color][b][COLOR=#000000]addImage[/color][/b] [COLOR=#990000]([/color][COLOR=#009900]$_FILES[/color][COLOR=#990000][[/color][COLOR=#FF0000]'imageFile'[/color][COLOR=#990000]][[/color][COLOR=#FF0000]'tmp_name'[/color][COLOR=#990000]],[/color] [COLOR=#009900]$_POST[/color][COLOR=#990000][[/color][COLOR=#FF0000]'imageDescription'[/color][COLOR=#990000]]);[/color]
[tab][tab][tab][COLOR=#009900]$images[/color][COLOR=#990000]->[/color][b][COLOR=#000000]listImages[/color][/b][COLOR=#990000]();[/color]
[tab][tab][b][COLOR=#0000FF]endif[/color][/b][COLOR=#990000];[/color]
[tab][tab][b][COLOR=#0000FF]break[/color][/b][COLOR=#990000];[/color]
[tab][b][COLOR=#0000FF]case[/color][/b] [COLOR=#FF0000]'getImage'[/color][COLOR=#990000]:[/color]
[tab][tab][COLOR=#009900]$images[/color] [COLOR=#990000]=[/color] [b][COLOR=#0000FF]new[/color][/b] images[COLOR=#990000];[/color]
[tab][tab][COLOR=#009900]$images[/color][COLOR=#990000]->[/color]images[COLOR=#990000][[/color][COLOR=#009900]$_GET[/color][COLOR=#990000][[/color][COLOR=#FF0000]'imageID'[/color][COLOR=#990000]]]->[/color][b][COLOR=#000000]outputImage[/color][/b][COLOR=#990000]();[/color]
[tab][tab][b][COLOR=#0000FF]break[/color][/b][COLOR=#990000];[/color]
[tab][b][COLOR=#0000FF]case[/color][/b] [COLOR=#FF0000]'newImage'[/color][COLOR=#990000]:[/color]
[tab][tab][COLOR=#009900]$images[/color] [COLOR=#990000]=[/color] [b][COLOR=#0000FF]new[/color][/b] images[COLOR=#990000];[/color]
[tab][tab][COLOR=#009900]$images[/color][COLOR=#990000]->[/color][b][COLOR=#000000]newImage[/color][/b][COLOR=#990000]();[/color]
[tab][tab][b][COLOR=#0000FF]break[/color][/b][COLOR=#990000];[/color]
[b][COLOR=#0000FF]endswitch[/color][/b][COLOR=#990000];[/color]

[b][COLOR=#0000FF]class[/color][/b] images[COLOR=#FF0000]{[/color]
[tab]
[tab]public [COLOR=#009900]$images[/color] [COLOR=#990000]=[/color] [b][COLOR=#0000FF]array[/color][/b][COLOR=#990000]();[/color]
[tab]private [COLOR=#009900]$storageFile[/color] [COLOR=#990000]=[/color] [COLOR=#FF0000]''[/color][COLOR=#990000];[/color] 
[tab]private [COLOR=#009900]$original[/color] [COLOR=#990000]=[/color] [b][COLOR=#0000FF]array[/color][/b][COLOR=#990000]();[/color]
[tab]private [COLOR=#009900]$storageFileDirectory[/color] [COLOR=#990000]=[/color] [COLOR=#FF0000]'.'[/color][COLOR=#990000];[/color]
[tab]
[tab]public [b][COLOR=#0000FF]function[/color][/b] [b][COLOR=#000000]__construct[/color][/b][COLOR=#990000]()[/color][COLOR=#FF0000]{[/color]
[tab][tab][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]storageFile [COLOR=#990000]=[/color] [COLOR=#009900]$this[/color][COLOR=#990000]->[/color]storageFileDirectory [COLOR=#990000].[/color] DIRECTORY_SEPARATOR [COLOR=#990000].[/color] [COLOR=#FF0000]'testImageStore.txt'[/color][COLOR=#990000];[/color] 
[tab][tab][b][COLOR=#0000FF]if[/color][/b][COLOR=#990000]([/color][b][COLOR=#000000]file_exists[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]storageFile[COLOR=#990000])):[/color]
[tab][tab][tab][COLOR=#009900]$content[/color] [COLOR=#990000]=[/color] [b][COLOR=#000000]file_get_contents[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]storageFile[COLOR=#990000]);[/color]
[tab][tab][tab][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]images [COLOR=#990000]=[/color] [b][COLOR=#000000]unserialize[/color][/b][COLOR=#990000]([/color][b][COLOR=#000000]trim[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$content[/color][COLOR=#990000]));[/color]
[tab][tab][tab][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]original [COLOR=#990000]=[/color] [COLOR=#009900]$this[/color][COLOR=#990000]->[/color]images[COLOR=#990000];[/color]
[tab][tab][b][COLOR=#0000FF]else[/color][/b][COLOR=#990000]:[/color]
[tab][tab][tab][b][COLOR=#000000]file_put_contents[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]storageFile[COLOR=#990000],[/color] [b][COLOR=#000000]serialize[/color][/b][COLOR=#990000]([/color][b][COLOR=#0000FF]array[/color][/b][COLOR=#990000]()));[/color]
[tab][tab][b][COLOR=#0000FF]endif[/color][/b][COLOR=#990000];[/color]
[tab][COLOR=#FF0000]}[/color]
[tab]
[tab]public [b][COLOR=#0000FF]function[/color][/b] [b][COLOR=#000000]__destruct[/color][/b][COLOR=#990000]()[/color][COLOR=#FF0000]{[/color]
[tab][tab][b][COLOR=#000000]date_default_timezone_set[/color][/b][COLOR=#990000]([/color][COLOR=#FF0000]'utc'[/color][COLOR=#990000]);[/color]
[tab][tab][b][COLOR=#0000FF]if[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]original [COLOR=#990000]!=[/color] [COLOR=#009900]$this[/color][COLOR=#990000]->[/color]images[COLOR=#990000]):[/color]
[tab][tab][tab][COLOR=#009900]@copy[/color][COLOR=#990000]([/color]  [COLOR=#009900]$this[/color][COLOR=#990000]->[/color]storageFileDirectory [COLOR=#990000].[/color] DIRECTORY_SEPARATOR [COLOR=#990000].[/color] [COLOR=#009900]$this[/color][COLOR=#990000]->[/color]storageFile[COLOR=#990000],[/color] 
[tab][tab][tab][tab][tab][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]storageFileDirectory [COLOR=#990000].[/color] DIRECTORY_SEPARATOR [COLOR=#990000].[/color] [b][COLOR=#000000]date[/color][/b][COLOR=#990000]([/color][COLOR=#FF0000]'Y-m-d_H-i-s'[/color][COLOR=#990000])[/color] [COLOR=#990000].[/color] [COLOR=#FF0000]'_'[/color] [COLOR=#990000].[/color] [COLOR=#009900]$this[/color][COLOR=#990000]->[/color]storageFile[COLOR=#990000]);[/color]
[tab][tab][b][COLOR=#0000FF]endif[/color][/b][COLOR=#990000];[/color]
[tab][tab][b][COLOR=#000000]file_put_contents[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]storageFile[COLOR=#990000],[/color] [b][COLOR=#000000]serialize[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]images[COLOR=#990000]));[/color]
[tab][COLOR=#FF0000]}[/color]
[tab]
[tab]public [b][COLOR=#0000FF]function[/color][/b] [b][COLOR=#000000]delete[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$imageID[/color][COLOR=#990000])[/color][COLOR=#FF0000]{[/color]
[tab][tab][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]images[COLOR=#990000][[/color][COLOR=#009900]$imageID[/color][COLOR=#990000]]->[/color][b][COLOR=#000000]markDeleted[/color][/b][COLOR=#990000]();[/color]
[tab][COLOR=#FF0000]}[/color]
[tab]
[tab]public [b][COLOR=#0000FF]function[/color][/b] [b][COLOR=#000000]addImage[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$imageFileName[/color][COLOR=#990000],[/color] [COLOR=#009900]$imageDescription[/color][COLOR=#990000])[/color][COLOR=#FF0000]{[/color]
[tab][tab][COLOR=#009900]$image[/color] [COLOR=#990000]=[/color] [b][COLOR=#0000FF]new[/color][/b] image[COLOR=#990000];[/color]
[tab][tab][COLOR=#009900]$image[/color][COLOR=#990000]->[/color][b][COLOR=#000000]newImage[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$imageFileName[/color][COLOR=#990000],[/color] [COLOR=#009900]$imageDescription[/color][COLOR=#990000]);[/color]
[tab][tab][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]images[COLOR=#990000][[/color][COLOR=#009900]$image[/color][COLOR=#990000]->[/color]imageID[COLOR=#990000]][/color] [COLOR=#990000]=[/color] [COLOR=#009900]$image[/color][COLOR=#990000];[/color]
[tab][COLOR=#FF0000]}[/color]
[tab]
[tab]public [b][COLOR=#0000FF]function[/color][/b] [b][COLOR=#000000]editImage[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$imageID[/color][COLOR=#990000])[/color][COLOR=#FF0000]{[/color]
[tab][tab][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]images[COLOR=#990000][[/color][COLOR=#009900]$imageID[/color][COLOR=#990000]]->[/color][b][COLOR=#000000]output[/color][/b][COLOR=#990000]([/color]true[COLOR=#990000]);[/color]
[tab][COLOR=#FF0000]}[/color]
[tab]
[tab]public [b][COLOR=#0000FF]function[/color][/b] [b][COLOR=#000000]listImages[/color][/b][COLOR=#990000]()[/color][COLOR=#FF0000]{[/color]
[tab][tab][COLOR=#990000]?>[/color]
[COLOR=#990000]<[/color]div id[COLOR=#990000]=[/color][COLOR=#FF0000]"imagesList"[/color][COLOR=#990000]>[/color]
[tab][COLOR=#990000]<[/color]table[COLOR=#990000]>[/color]
[tab][tab]
[tab][tab][COLOR=#990000]<[/color]thead[COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]<[/color]tr[COLOR=#990000]>[/color]
[tab][tab][tab][COLOR=#990000]<[/color]th[COLOR=#990000]>[/color]Image ID[COLOR=#990000]</[/color]th[COLOR=#990000]>[/color]
[tab][tab][tab][COLOR=#990000]<[/color]th[COLOR=#990000]>[/color]Image FileName[COLOR=#990000]</[/color]th[COLOR=#990000]>[/color]
[tab][tab][tab][COLOR=#990000]<[/color]th[COLOR=#990000]>[/color]Image Description[COLOR=#990000]</[/color]th[COLOR=#990000]>[/color]
[tab][tab][tab][COLOR=#990000]<[/color]th[COLOR=#990000]>[/color]Image Thumbnail[COLOR=#990000]</[/color]th[COLOR=#990000]>[/color]
[tab][tab][tab][COLOR=#990000]<[/color]th[COLOR=#990000]><[/color]a href[COLOR=#990000]=[/color][COLOR=#FF0000]"?action=newImage"[/color][COLOR=#990000]>[/color]New Image[COLOR=#990000]</[/color]a[COLOR=#990000]></[/color]th[COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]</[/color]tr[COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]</[/color]thead[COLOR=#990000]>[/color]
[COLOR=#990000]<?php[/color]   [b][COLOR=#0000FF]foreach[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]images [b][COLOR=#0000FF]as[/color][/b] [COLOR=#009900]$image[/color][COLOR=#990000]):[/color]
[tab][tab][tab][b][COLOR=#0000FF]if[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$image[/color][COLOR=#990000]->[/color]deleted [COLOR=#990000]==[/color] false[COLOR=#990000])[/color] [b][COLOR=#0000FF]echo[/color][/b] [COLOR=#009900]$image[/color][COLOR=#990000]->[/color][b][COLOR=#000000]showListData[/color][/b][COLOR=#990000]();[/color]
[tab][tab][b][COLOR=#0000FF]endforeach[/color][/b][COLOR=#990000];[/color] 
[COLOR=#990000]?>[/color]
[COLOR=#990000]</[/color]div[COLOR=#990000]>[/color]
[COLOR=#990000]<?php[/color]
[tab][COLOR=#FF0000]}[/color]
[tab]
[tab]public [b][COLOR=#0000FF]function[/color][/b] [b][COLOR=#000000]newImage[/color][/b][COLOR=#990000]()[/color][COLOR=#FF0000]{[/color]
[tab][tab][COLOR=#009900]$image[/color] [COLOR=#990000]=[/color] [b][COLOR=#0000FF]new[/color][/b] image[COLOR=#990000];[/color]
[tab][tab][COLOR=#009900]$image[/color][COLOR=#990000]->[/color][b][COLOR=#000000]outputNew[/color][/b][COLOR=#990000]();[/color]
[tab][COLOR=#FF0000]}[/color]
[COLOR=#FF0000]}[/color]
[b][COLOR=#0000FF]class[/color][/b] image [COLOR=#FF0000]{[/color]
[tab]public [COLOR=#009900]$imageFileName[/color][COLOR=#990000]=[/color][COLOR=#FF0000]''[/color][COLOR=#990000];[/color]
[tab]public [COLOR=#009900]$imageID[/color] [COLOR=#990000]=[/color] [COLOR=#FF0000]''[/color][COLOR=#990000];[/color]
[tab]public [COLOR=#009900]$imageDescription[/color][COLOR=#990000];[/color]
[tab]public [COLOR=#009900]$deleted[/color] [COLOR=#990000]=[/color] false[COLOR=#990000];[/color]
[tab]public [COLOR=#009900]$imageStorageDirectory[/color] [COLOR=#990000]=[/color] [COLOR=#FF0000]'.'[/color][COLOR=#990000];[/color]
[tab]

[tab]public [b][COLOR=#0000FF]function[/color][/b] [b][COLOR=#000000]newImage[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$imageFileName[/color][COLOR=#990000],[/color] [COLOR=#009900]$imageDescription[/color][COLOR=#990000])[/color][COLOR=#FF0000]{[/color]
[tab][tab][COLOR=#009900]$fileName[/color] [COLOR=#990000]=[/color] [COLOR=#009900]$this[/color][COLOR=#990000]->[/color][b][COLOR=#000000]getUniqueFileName[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$imageFileName[/color][COLOR=#990000]);[/color]
[tab][tab][b][COLOR=#000000]move_uploaded_file[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$imageFileName[/color][COLOR=#990000],[/color] [COLOR=#009900]$this[/color][COLOR=#990000]->[/color]imageStorageDirectory [COLOR=#990000].[/color] DIRECTORY_SEPARATOR [COLOR=#990000].[/color] [COLOR=#009900]$fileName[/color][COLOR=#990000]);[/color]
[tab][tab][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]imageFileName [COLOR=#990000]=[/color] [COLOR=#009900]$fileName[/color][COLOR=#990000];[/color]
[tab][tab][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]imageDescription [COLOR=#990000]=[/color] [COLOR=#009900]$imageDescription[/color][COLOR=#990000];[/color]
[tab][tab][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]imageID [COLOR=#990000]=[/color] [b][COLOR=#000000]md5[/color][/b][COLOR=#990000]([/color][b][COLOR=#000000]uniqid[/color][/b][COLOR=#990000]([/color][COLOR=#FF0000]''[/color][COLOR=#990000],[/color] true[COLOR=#990000]));[/color]
[tab][COLOR=#FF0000]}[/color]
[tab]
[tab]public [b][COLOR=#0000FF]function[/color][/b] [b][COLOR=#000000]getUniqueFileName[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$imageFileName[/color][COLOR=#990000])[/color][COLOR=#FF0000]{[/color]
[tab][tab][b][COLOR=#0000FF]list[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$w[/color][COLOR=#990000],[/color][COLOR=#009900]$h[/color][COLOR=#990000],[/color][COLOR=#009900]$type[/color][COLOR=#990000])[/color] [COLOR=#990000]=[/color] [b][COLOR=#000000]getimagesize[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$imageFileName[/color][COLOR=#990000]);[/color]
[tab][tab][b][COLOR=#0000FF]return[/color][/b] [b][COLOR=#000000]uniqid[/color][/b][COLOR=#990000]([/color][COLOR=#FF0000]'Image_'[/color][COLOR=#990000],[/color] true[COLOR=#990000])[/color] [COLOR=#990000].[/color] [b][COLOR=#000000]image_type_to_extension[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$type[/color][COLOR=#990000]);[/color]
[tab][COLOR=#FF0000]}[/color]
[tab]public [b][COLOR=#0000FF]function[/color][/b] [b][COLOR=#000000]markDeleted[/color][/b][COLOR=#990000]()[/color][COLOR=#FF0000]{[/color]
[tab][tab][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]deleted [COLOR=#990000]=[/color] true[COLOR=#990000];[/color]
[tab][COLOR=#FF0000]}[/color]
[tab]
[tab]public [b][COLOR=#0000FF]function[/color][/b] [b][COLOR=#000000]output[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$editable[/color][COLOR=#990000]=[/color]false[COLOR=#990000])[/color][COLOR=#FF0000]{[/color]
[tab][tab][b][COLOR=#0000FF]if[/color][/b] [COLOR=#990000]([/color][COLOR=#009900]$editable[/color][COLOR=#990000])[/color] [b][COLOR=#0000FF]return[/color][/b] [COLOR=#009900]$this[/color][COLOR=#990000]->[/color][b][COLOR=#000000]outputEditable[/color][/b][COLOR=#990000]();[/color]
[tab][tab][b][COLOR=#0000FF]return[/color][/b] [COLOR=#009900]$this[/color][COLOR=#990000]->[/color][b][COLOR=#000000]outputFixed[/color][/b][COLOR=#990000]();[/color]
[tab][COLOR=#FF0000]}[/color]
[tab]
[tab]public [b][COLOR=#0000FF]function[/color][/b] [b][COLOR=#000000]showListData[/color][/b][COLOR=#990000]()[/color][COLOR=#FF0000]{[/color]
[COLOR=#990000]?>[/color]
[tab][tab][COLOR=#990000]<[/color]tbody[COLOR=#990000]>[/color]
[tab][tab][tab][COLOR=#990000]<[/color]tr[COLOR=#990000]>[/color]
[tab][tab][tab][tab][COLOR=#990000]<[/color]td[COLOR=#990000]><?=[/color][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]imageID[COLOR=#990000];?></[/color]td[COLOR=#990000]>[/color]
[tab][tab][tab][tab][COLOR=#990000]<[/color]td[COLOR=#990000]><?=[/color][b][COLOR=#000000]htmlspecialchars[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]imageFileName[COLOR=#990000]);?></[/color]td[COLOR=#990000]>[/color]
[tab][tab][tab][tab][COLOR=#990000]<[/color]td[COLOR=#990000]><?=[/color][b][COLOR=#000000]htmlspecialchars[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]imageDescription[COLOR=#990000]);?></[/color]td[COLOR=#990000]>[/color]
[tab][tab][tab][tab][COLOR=#990000]<[/color]td[COLOR=#990000]><?=[/color][COLOR=#009900]$this[/color][COLOR=#990000]->[/color][b][COLOR=#000000]getIMGtag[/color][/b][COLOR=#990000]();?></[/color]td[COLOR=#990000]>[/color]
[tab][tab][tab][tab][COLOR=#990000]<[/color]td[COLOR=#990000]>[/color]
[tab][tab][tab][tab][tab][COLOR=#990000]<[/color]form action[COLOR=#990000]=[/color][COLOR=#FF0000]""[/color] method[COLOR=#990000]=[/color][COLOR=#FF0000]"post"[/color][COLOR=#990000]>[/color]
[tab][tab][tab][tab][tab][COLOR=#990000]<[/color]input type[COLOR=#990000]=[/color][COLOR=#FF0000]"hidden"[/color] name[COLOR=#990000]=[/color][COLOR=#FF0000]"imageID"[/color] value[COLOR=#990000]=[/color][COLOR=#FF0000]"<?=$this->imageID;?>"[/color][COLOR=#990000]>[/color]
[tab][tab][tab][tab][tab][COLOR=#990000]<[/color]input type[COLOR=#990000]=[/color][COLOR=#FF0000]"submit"[/color] name[COLOR=#990000]=[/color][COLOR=#FF0000]"action"[/color] value[COLOR=#990000]=[/color][COLOR=#FF0000]"Delete"[/color] [COLOR=#990000]/>[/color]
[tab][tab][tab][tab][tab][COLOR=#990000]<[/color]input type[COLOR=#990000]=[/color][COLOR=#FF0000]"submit"[/color] name[COLOR=#990000]=[/color][COLOR=#FF0000]"action"[/color] value[COLOR=#990000]=[/color][COLOR=#FF0000]"Edit"[/color] [COLOR=#990000]/>[/color]
[tab][tab][tab][tab][COLOR=#990000]</[/color]form[COLOR=#990000]>[/color]
[tab][tab][tab][tab][COLOR=#990000]</[/color]td[COLOR=#990000]>[/color]
[tab][tab][tab][COLOR=#990000]</[/color]tr[COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]</[/color]tbody[COLOR=#990000]>[/color]
[COLOR=#990000]<?php[/color]
[tab][COLOR=#FF0000]}[/color]
[tab]
[tab]public [b][COLOR=#0000FF]function[/color][/b] [b][COLOR=#000000]outputImage[/color][/b][COLOR=#990000]()[/color][COLOR=#FF0000]{[/color]
[tab][tab][b][COLOR=#0000FF]list[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$width[/color][COLOR=#990000],[/color] [COLOR=#009900]$height[/color][COLOR=#990000],[/color] [COLOR=#009900]$type[/color][COLOR=#990000],[/color] [COLOR=#009900]$attr[/color][COLOR=#990000])[/color] [COLOR=#990000]=[/color] [b][COLOR=#000000]getimagesize[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]imageFileName[COLOR=#990000]);[/color]
[tab][tab][COLOR=#009900]$fh[/color] [COLOR=#990000]=[/color] [b][COLOR=#000000]fopen[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]imageStorageDirectory [COLOR=#990000].[/color] DIRECTORY_SEPARATOR [COLOR=#990000].[/color] [COLOR=#009900]$this[/color][COLOR=#990000]->[/color]imageFileName[COLOR=#990000],[/color][COLOR=#FF0000]'rb'[/color][COLOR=#990000]);[/color]
[tab][tab][b][COLOR=#0000FF]if[/color][/b][COLOR=#990000](![/color][COLOR=#009900]$fh[/color][COLOR=#990000])[/color] [b][COLOR=#0000FF]die[/color][/b][COLOR=#990000]([/color][COLOR=#FF0000]'cannot open image for reading'[/color][COLOR=#990000]);[/color]
[tab][tab][b][COLOR=#000000]header[/color][/b][COLOR=#990000]([/color][COLOR=#FF0000]'Content-type: '[/color] [COLOR=#990000].[/color] [COLOR=#009900]$type[/color][COLOR=#990000]);[/color]
[tab][tab][b][COLOR=#000000]fpassthru[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$fh[/color][COLOR=#990000]);[/color]
[tab][tab][b][COLOR=#000000]fclose[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$fh[/color][COLOR=#990000]);[/color]
[tab][tab][b][COLOR=#0000FF]exit[/color][/b][COLOR=#990000];[/color]
[tab][COLOR=#FF0000]}[/color]
[tab]
[tab]private [b][COLOR=#0000FF]function[/color][/b] [b][COLOR=#000000]getImgTag[/color][/b][COLOR=#990000]()[/color][COLOR=#FF0000]{[/color]
[tab][tab][b][COLOR=#0000FF]list[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$width[/color][COLOR=#990000],[/color] [COLOR=#009900]$height[/color][COLOR=#990000])[/color] [COLOR=#990000]=[/color] [b][COLOR=#000000]getimagesize[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]imageFileName[COLOR=#990000]);[/color]
[tab][tab][COLOR=#009900]$max[/color] [COLOR=#990000]=[/color] [COLOR=#993399]80[/color][COLOR=#990000];[/color]
[tab][tab][b][COLOR=#0000FF]if[/color][/b] [COLOR=#990000]([/color][COLOR=#009900]$height[/color] [COLOR=#990000]>[/color] [COLOR=#009900]$width[/color][COLOR=#990000]):[/color]
[tab][tab][tab][COLOR=#009900]$newHeight[/color] [COLOR=#990000]=[/color] [COLOR=#993399]80[/color][COLOR=#990000];[/color]
[tab][tab][tab][COLOR=#009900]$newWidth[/color] [COLOR=#990000]=[/color] [b][COLOR=#000000]round[/color][/b][COLOR=#990000](([/color][COLOR=#993399]80[/color][COLOR=#990000]/[/color][COLOR=#009900]$height[/color] [COLOR=#990000])[/color] [COLOR=#990000]*[/color] [COLOR=#009900]$width[/color][COLOR=#990000]);[/color]
[tab][tab][b][COLOR=#0000FF]else[/color][/b][COLOR=#990000]:[/color]
[tab][tab][tab][COLOR=#009900]$newWidth[/color] [COLOR=#990000]=[/color] [COLOR=#993399]80[/color][COLOR=#990000];[/color]
[tab][tab][tab][COLOR=#009900]$newHeight[/color] [COLOR=#990000]=[/color] [b][COLOR=#000000]round[/color][/b][COLOR=#990000](([/color][COLOR=#993399]80[/color][COLOR=#990000]/[/color][COLOR=#009900]$width[/color] [COLOR=#990000])[/color] [COLOR=#990000]*[/color] [COLOR=#009900]$height[/color][COLOR=#990000]);[/color]
[tab][tab][b][COLOR=#0000FF]endif[/color][/b][COLOR=#990000];[/color]
[tab][tab][b][COLOR=#0000FF]return[/color][/b] [COLOR=#990000]<<<[/color]HTML
[COLOR=#990000]<[/color]img height[COLOR=#990000]=[/color][COLOR=#FF0000]"{$newHeight}px"[/color] width[COLOR=#990000]=[/color][COLOR=#FF0000]"{$newWidth}px"[/color] src[COLOR=#990000]=[/color][COLOR=#FF0000]"?action=getImage&imageID={$this->imageID}"[/color] [COLOR=#990000]/>[/color]
HTML[COLOR=#990000];[/color]
[tab][COLOR=#FF0000]}[/color]
[tab]
[tab]private [b][COLOR=#0000FF]function[/color][/b] [b][COLOR=#000000]outputEditable[/color][/b][COLOR=#990000]()[/color][COLOR=#FF0000]{[/color]
[COLOR=#990000]?>[/color]
[COLOR=#990000]<[/color]form method[COLOR=#990000]=[/color][COLOR=#FF0000]"post"[/color] action[COLOR=#990000]=[/color][COLOR=#FF0000]"<?=$_SERVER['PHP_SELF'];?>"[/color][COLOR=#990000]>[/color]
[tab][COLOR=#990000]<[/color]div [b][COLOR=#0000FF]class[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"row"[/color][COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]<[/color]div [b][COLOR=#0000FF]class[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"label"[/color][COLOR=#990000]>[/color]
[tab][tab][tab]Image File Name
[tab][tab][COLOR=#990000]</[/color]div[COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]<[/color]div [b][COLOR=#0000FF]class[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"field"[/color][COLOR=#990000]>[/color]
[tab][tab][tab][COLOR=#990000]<?=[/color][b][COLOR=#000000]htmlspecialchars[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]imageFileName[COLOR=#990000]);?>[/color]
[tab][tab][COLOR=#990000]</[/color]div[COLOR=#990000]>[/color]
[tab][COLOR=#990000]</[/color]div[COLOR=#990000]>[/color]
[tab][COLOR=#990000]<[/color]div [b][COLOR=#0000FF]class[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"row"[/color][COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]<[/color]div [b][COLOR=#0000FF]class[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"label"[/color][COLOR=#990000]>[/color]
[tab][tab][tab]Image Description
[tab][tab][COLOR=#990000]</[/color]div[COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]<[/color]div [b][COLOR=#0000FF]class[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"field"[/color][COLOR=#990000]>[/color]
[tab][tab][tab][COLOR=#990000]<[/color]textarea name[COLOR=#990000]=[/color][COLOR=#FF0000]"imageDescription"[/color][COLOR=#990000]><?=[/color][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]imageDescription[COLOR=#990000];?></[/color]textarea[COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]</[/color]div[COLOR=#990000]>[/color]
[tab][COLOR=#990000]</[/color]div[COLOR=#990000]>[/color]
[tab][COLOR=#990000]<[/color]div [b][COLOR=#0000FF]class[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"buttons"[/color][COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]<[/color]input type[COLOR=#990000]=[/color][COLOR=#FF0000]"submit"[/color] name[COLOR=#990000]=[/color][COLOR=#FF0000]"action"[/color] value[COLOR=#990000]=[/color][COLOR=#FF0000]"Save"[/color][COLOR=#990000]/>[/color]
[tab][tab][COLOR=#990000]<[/color]input type[COLOR=#990000]=[/color][COLOR=#FF0000]"hidden"[/color] name[COLOR=#990000]=[/color][COLOR=#FF0000]"imageID"[/color] value[COLOR=#990000]=[/color][COLOR=#FF0000]"<?=$this->imageID;?>"[/color][COLOR=#990000]/>[/color]
[tab][COLOR=#990000]</[/color]div[COLOR=#990000]>[/color]
[COLOR=#990000]</[/color]form[COLOR=#990000]>[/color]
[COLOR=#990000]<?php[/color]
[tab][COLOR=#FF0000]}[/color]
[tab]
[tab]private [b][COLOR=#0000FF]function[/color][/b] [b][COLOR=#000000]outputFixed[/color][/b][COLOR=#990000]()[/color][COLOR=#FF0000]{[/color]
[tab][COLOR=#990000]?>[/color]
[tab][COLOR=#990000]<[/color]div [b][COLOR=#0000FF]class[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"row"[/color][COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]<[/color]div [b][COLOR=#0000FF]class[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"label"[/color][COLOR=#990000]>[/color]
[tab][tab][tab]Image File Name
[tab][tab][COLOR=#990000]</[/color]div[COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]<[/color]div [b][COLOR=#0000FF]class[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"field"[/color][COLOR=#990000]>[/color]
[tab][tab][tab][COLOR=#990000]<?=[/color][b][COLOR=#000000]htmlspecialchars[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]imageFileName[COLOR=#990000]);?>[/color]
[tab][tab][COLOR=#990000]</[/color]div[COLOR=#990000]>[/color]
[tab][COLOR=#990000]</[/color]div[COLOR=#990000]>[/color]
[tab][COLOR=#990000]<[/color]div [b][COLOR=#0000FF]class[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"row"[/color][COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]<[/color]div [b][COLOR=#0000FF]class[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"label"[/color][COLOR=#990000]>[/color]
[tab][tab][tab]Image Description
[tab][tab][COLOR=#990000]</[/color]div[COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]<[/color]div [b][COLOR=#0000FF]class[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"field"[/color][COLOR=#990000]>[/color]
[tab][tab][tab][COLOR=#990000]<?=[/color][b][COLOR=#000000]nl2br[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]imageDescription[COLOR=#990000]);?>[/color]
[tab][tab][COLOR=#990000]</[/color]div[COLOR=#990000]>[/color]
[tab][COLOR=#990000]</[/color]div[COLOR=#990000]>[/color]
[COLOR=#990000]<?php[/color]   
[tab][COLOR=#FF0000]}[/color]
[tab]
[tab]public [b][COLOR=#0000FF]function[/color][/b] [b][COLOR=#000000]outputNew[/color][/b][COLOR=#990000]()[/color][COLOR=#FF0000]{[/color]
[COLOR=#990000]?>[/color]
[COLOR=#990000]<[/color]form method[COLOR=#990000]=[/color][COLOR=#FF0000]"post"[/color] action[COLOR=#990000]=[/color][COLOR=#FF0000]"<?=$_SERVER['PHP_SELF'];?>  "[/color] enctype[COLOR=#990000]=[/color][COLOR=#FF0000]"multipart/form-data"[/color][COLOR=#990000]>[/color]
[tab][COLOR=#990000]<[/color]div [b][COLOR=#0000FF]class[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"row"[/color][COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]<[/color]div [b][COLOR=#0000FF]class[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"label"[/color][COLOR=#990000]>[/color]
[tab][tab][tab]Image File 
[tab][tab][COLOR=#990000]</[/color]div[COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]<[/color]div [b][COLOR=#0000FF]class[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"field"[/color][COLOR=#990000]>[/color]
[tab][tab][tab][COLOR=#990000]<[/color]input type[COLOR=#990000]=[/color][COLOR=#FF0000]"file"[/color] name[COLOR=#990000]=[/color][COLOR=#FF0000]"imageFile"[/color] [COLOR=#990000]/>[/color]
[tab][tab][COLOR=#990000]</[/color]div[COLOR=#990000]>[/color]
[tab][COLOR=#990000]</[/color]div[COLOR=#990000]>[/color]
[tab][COLOR=#990000]<[/color]div [b][COLOR=#0000FF]class[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"row"[/color][COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]<[/color]div [b][COLOR=#0000FF]class[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"label"[/color][COLOR=#990000]>[/color]
[tab][tab][tab]Image Description
[tab][tab][COLOR=#990000]</[/color]div[COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]<[/color]div [b][COLOR=#0000FF]class[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"field"[/color][COLOR=#990000]>[/color]
[tab][tab][tab][COLOR=#990000]<[/color]textarea name[COLOR=#990000]=[/color][COLOR=#FF0000]"imageDescription"[/color][COLOR=#990000]><?=[/color][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]imageDescription[COLOR=#990000];?></[/color]textarea[COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]</[/color]div[COLOR=#990000]>[/color]
[tab][COLOR=#990000]</[/color]div[COLOR=#990000]>[/color]
[tab][COLOR=#990000]<[/color]div [b][COLOR=#0000FF]class[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"buttons"[/color][COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]<[/color]input type[COLOR=#990000]=[/color][COLOR=#FF0000]"submit"[/color] name[COLOR=#990000]=[/color][COLOR=#FF0000]"action"[/color] value[COLOR=#990000]=[/color][COLOR=#FF0000]"Save"[/color][COLOR=#990000]/>[/color]
[tab][COLOR=#990000]</[/color]div[COLOR=#990000]>[/color]
[COLOR=#990000]</[/color]form[COLOR=#990000]>[/color]
[COLOR=#990000]<?php[/color]   
[tab][COLOR=#FF0000]}[/color]
[tab]
[COLOR=#FF0000]}[/color]
 
Wow, talk about above and beyond jpadie! Many thanks for taking the time, it is very much appreciated. I'll have a sit down within the next hour or so and have a play.

It's not going to be holding many images, it will be in the hundreds rather than the thousands and the site will get very little traffic, it's just a friend making some cakes in her spare time locally.

Thanks again, I'll have a good look at what you have posted and have a play :)

________
clueless
 
No worries. I was intrigued about using a serialise array of objects as a permanent data store.

If you get errors or unexpected behaviour almost certainly it is to do with permissions on the content store file or its container. I used the temp directory as a quick fix but this is not a good solution as scripts might zero the temp for at any time! Also advise regularly backing up the content store. Perhaps a cron job to zip it and upload to google drive or email or whatever. (the script creates a backup every time the store is changed)
 
another error (hang over from testing on my servers) ....

Code:
 public function __construct(){
        [s]$this->storageFile = $this->storageFileDirectory . DIRECTORY_SEPARATOR . 'testImageStore.txt';[/s] 
        if(file_exists($this->storageFile)):
            $content = file_get_contents($this->storageFileDirectory . DIRECTORY_SEPARATOR . $this->storageFile);
            $this->images = unserialize(trim($content));
            $this->original = $this->images;
        else:
            file_put_contents($this->storageFileDirectory . DIRECTORY_SEPARATOR . $this->storageFile, serialize(array()));
        endif;
    }

and

Code:
public function __destruct(){
        date_default_timezone_set('utc');
        if($this->original != $this->images):
            @copy(  $this->storageFileDirectory . DIRECTORY_SEPARATOR . $this->storageFile, 
                    $this->storageFileDirectory . DIRECTORY_SEPARATOR . date('Y-m-d_H-i-s') . '_' . $this->storageFile);
        endif;
        file_put_contents($this->storageFileDirectory . DIRECTORY_SEPARATOR . $this->storageFile, serialize($this->images));
}
 
hmm, can't seem to get it to process properly. it seems to have permissions to write new files ok as it creates the testImageStore.txt if I have that line in (which contains a:0:{} )

Form draws, submits, blank page loads.

Am I missing something simple which I should be amending here?

________
clueless
 
I got that error too. it was a permissions issue which seemed unique to my mac (didn't create a problem on a *nix) platform. I got around it by setting the storageFileDirectory variable to /tmp.

what OS are you using?
 
that is most weird. there seems to be something odd with my build (and yours) of php and relative urls. not something i have come across before, or I am just too tired to see the wood for the trees ...

this code works for me. the constructor sets the necessary directories to the current working directory. if you want another folder, hard code the absolute url and comment out the getcwd()

a version of the script is up at tgml.rathercurious.net/imageManagement.php

Code:
[COLOR=#990000]<?php[/color]
[b][COLOR=#000000]ini_set[/color][/b][COLOR=#990000]([/color][COLOR=#FF0000]'display_errors'[/color][COLOR=#990000],[/color] true[COLOR=#990000]);[/color] [b][COLOR=#000000]error_reporting[/color][/b][COLOR=#990000]([/color]E_ALL[COLOR=#990000]);[/color]
[COLOR=#009900]$req[/color] [COLOR=#990000]=[/color] [b][COLOR=#000000]array_merge[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$_GET[/color][COLOR=#990000],[/color] [COLOR=#009900]$_POST[/color][COLOR=#990000]);[/color]
[COLOR=#009900]$action[/color] [COLOR=#990000]=[/color] [b][COLOR=#0000FF]isset[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$req[/color][COLOR=#990000][[/color][COLOR=#FF0000]'action'[/color][COLOR=#990000]])[/color] [COLOR=#990000]?[/color] [COLOR=#009900]$req[/color][COLOR=#990000][[/color][COLOR=#FF0000]'action'[/color][COLOR=#990000]][/color] [COLOR=#990000]:[/color] [COLOR=#FF0000]'no action'[/color][COLOR=#990000];[/color]
[b][COLOR=#0000FF]switch[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$action[/color][COLOR=#990000]):[/color]
[tab][b][COLOR=#0000FF]case[/color][/b] [COLOR=#FF0000]'no action'[/color][COLOR=#990000]:[/color]
[tab][tab][COLOR=#009900]$images[/color] [COLOR=#990000]=[/color] [b][COLOR=#0000FF]new[/color][/b] images[COLOR=#990000];[/color]
[tab][tab][COLOR=#009900]$images[/color][COLOR=#990000]->[/color][b][COLOR=#000000]listImages[/color][/b][COLOR=#990000]();[/color]
[tab][tab][b][COLOR=#0000FF]break[/color][/b][COLOR=#990000];[/color]
[tab][b][COLOR=#0000FF]case[/color][/b] [COLOR=#FF0000]'Delete'[/color][COLOR=#990000]:[/color]
[tab][tab][COLOR=#009900]$images[/color] [COLOR=#990000]=[/color] [b][COLOR=#0000FF]new[/color][/b] images[COLOR=#990000];[/color]
[tab][tab][COLOR=#009900]$images[/color][COLOR=#990000]->[/color][b][COLOR=#000000]delete[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$_POST[/color][COLOR=#990000][[/color][COLOR=#FF0000]'imageID'[/color][COLOR=#990000]]);[/color]
[tab][tab][COLOR=#009900]$images[/color][COLOR=#990000]->[/color][b][COLOR=#000000]listImages[/color][/b][COLOR=#990000]();[/color]
[tab][tab][b][COLOR=#0000FF]break[/color][/b][COLOR=#990000];[/color]
[tab][b][COLOR=#0000FF]case[/color][/b] [COLOR=#FF0000]'Edit'[/color][COLOR=#990000]:[/color]
[tab][tab][COLOR=#009900]$images[/color] [COLOR=#990000]=[/color] [b][COLOR=#0000FF]new[/color][/b] images[COLOR=#990000];[/color]
[tab][tab][COLOR=#009900]$images[/color][COLOR=#990000]->[/color][b][COLOR=#000000]editImage[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$_POST[/color][COLOR=#990000][[/color][COLOR=#FF0000]'imageID'[/color][COLOR=#990000]]);[/color]
[tab][tab][b][COLOR=#0000FF]break[/color][/b][COLOR=#990000];[/color]
[tab][b][COLOR=#0000FF]case[/color][/b] [COLOR=#FF0000]'Save'[/color][COLOR=#990000]:[/color]
[tab][tab][COLOR=#009900]$images[/color] [COLOR=#990000]=[/color] [b][COLOR=#0000FF]new[/color][/b] images[COLOR=#990000];[/color]
[tab][tab][b][COLOR=#0000FF]if[/color][/b][COLOR=#990000]([/color][b][COLOR=#0000FF]isset[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$_POST[/color][COLOR=#990000][[/color][COLOR=#FF0000]'imageID'[/color][COLOR=#990000]])):[/color]
[tab][tab][tab][COLOR=#009900]$image[/color] [COLOR=#990000]=&[/color] [COLOR=#009900]$images[/color][COLOR=#990000]->[/color]images[COLOR=#990000][[/color][COLOR=#009900]$_POST[/color][COLOR=#990000][[/color][COLOR=#FF0000]'imageID'[/color][COLOR=#990000]]];[/color]
[tab][tab][tab][COLOR=#009900]$image[/color][COLOR=#990000]->[/color]imageDescription [COLOR=#990000]=[/color] [COLOR=#009900]$_POST[/color][COLOR=#990000][[/color][COLOR=#FF0000]'imageDescription'[/color][COLOR=#990000]];[/color]
[tab][tab][tab][COLOR=#009900]$images[/color][COLOR=#990000]->[/color][b][COLOR=#000000]listImages[/color][/b][COLOR=#990000]();[/color]
[tab][tab][b][COLOR=#0000FF]else[/color][/b][COLOR=#990000]:[/color]
[tab][tab][tab][i][COLOR=#9A1900]//save the uploaded file somewhere and call the addImage method[/color][/i]
[tab][tab][tab][COLOR=#009900]$images[/color][COLOR=#990000]->[/color][b][COLOR=#000000]addImage[/color][/b] [COLOR=#990000]([/color][COLOR=#009900]$_FILES[/color][COLOR=#990000][[/color][COLOR=#FF0000]'imageFile'[/color][COLOR=#990000]][[/color][COLOR=#FF0000]'tmp_name'[/color][COLOR=#990000]],[/color] [COLOR=#009900]$_POST[/color][COLOR=#990000][[/color][COLOR=#FF0000]'imageDescription'[/color][COLOR=#990000]]);[/color]
[tab][tab][tab][COLOR=#009900]$images[/color][COLOR=#990000]->[/color][b][COLOR=#000000]listImages[/color][/b][COLOR=#990000]();[/color]
[tab][tab][b][COLOR=#0000FF]endif[/color][/b][COLOR=#990000];[/color]
[tab][tab][b][COLOR=#0000FF]break[/color][/b][COLOR=#990000];[/color]
[tab][b][COLOR=#0000FF]case[/color][/b] [COLOR=#FF0000]'getImage'[/color][COLOR=#990000]:[/color]
[tab][tab][COLOR=#009900]$images[/color] [COLOR=#990000]=[/color] [b][COLOR=#0000FF]new[/color][/b] images[COLOR=#990000];[/color]
[tab][tab][COLOR=#009900]$images[/color][COLOR=#990000]->[/color]images[COLOR=#990000][[/color][COLOR=#009900]$_GET[/color][COLOR=#990000][[/color][COLOR=#FF0000]'imageID'[/color][COLOR=#990000]]]->[/color][b][COLOR=#000000]outputImage[/color][/b][COLOR=#990000]();[/color]
[tab][tab][b][COLOR=#0000FF]break[/color][/b][COLOR=#990000];[/color]
[tab][b][COLOR=#0000FF]case[/color][/b] [COLOR=#FF0000]'newImage'[/color][COLOR=#990000]:[/color]
[tab][tab][COLOR=#009900]$images[/color] [COLOR=#990000]=[/color] [b][COLOR=#0000FF]new[/color][/b] images[COLOR=#990000];[/color]
[tab][tab][COLOR=#009900]$images[/color][COLOR=#990000]->[/color][b][COLOR=#000000]newImage[/color][/b][COLOR=#990000]();[/color]
[tab][tab][b][COLOR=#0000FF]break[/color][/b][COLOR=#990000];[/color]
[b][COLOR=#0000FF]endswitch[/color][/b][COLOR=#990000];[/color]

[b][COLOR=#0000FF]class[/color][/b] images[COLOR=#FF0000]{[/color]
[tab]
[tab]public [COLOR=#009900]$images[/color] [COLOR=#990000]=[/color] [b][COLOR=#0000FF]array[/color][/b][COLOR=#990000]();[/color]
[tab]private [COLOR=#009900]$storageFile[/color] [COLOR=#990000]=[/color] [COLOR=#FF0000]'testImageStore24.txt'[/color][COLOR=#990000];[/color] 
[tab]private [COLOR=#009900]$original[/color] [COLOR=#990000]=[/color] [b][COLOR=#0000FF]array[/color][/b][COLOR=#990000]();[/color]
[tab]private [COLOR=#009900]$storageFileDirectory[/color] [COLOR=#990000]=[/color] [COLOR=#FF0000]''[/color][COLOR=#990000];[/color]
[tab]
[tab]public [b][COLOR=#0000FF]function[/color][/b] [b][COLOR=#000000]__construct[/color][/b][COLOR=#990000]()[/color][COLOR=#FF0000]{[/color]
[tab][tab][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]storageFileDirectory [COLOR=#990000]=[/color] [b][COLOR=#000000]getcwd[/color][/b][COLOR=#990000]();[/color]
[tab][tab][b][COLOR=#0000FF]if[/color][/b][COLOR=#990000]([/color] [b][COLOR=#000000]file_exists[/color][/b][COLOR=#990000]([/color][tab][b][COLOR=#000000]realpath[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]storageFileDirectory[COLOR=#990000])[/color] [COLOR=#990000].[/color] DIRECTORY_SEPARATOR [COLOR=#990000].[/color] [COLOR=#009900]$this[/color][COLOR=#990000]->[/color]storageFile[COLOR=#990000])):[/color]
[tab][tab][tab][COLOR=#009900]$content[/color] [COLOR=#990000]=[/color] [b][COLOR=#000000]file_get_contents[/color][/b][COLOR=#990000]([/color][b][COLOR=#000000]realpath[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]storageFileDirectory[COLOR=#990000])[/color] [COLOR=#990000].[/color] DIRECTORY_SEPARATOR [COLOR=#990000].[/color] [COLOR=#009900]$this[/color][COLOR=#990000]->[/color]storageFile[COLOR=#990000]);[/color]
[tab][tab][tab][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]images [COLOR=#990000]=[/color] [b][COLOR=#000000]unserialize[/color][/b][COLOR=#990000]([/color][b][COLOR=#000000]trim[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$content[/color][COLOR=#990000]));[/color]
[tab][tab][tab][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]original [COLOR=#990000]=[/color] [COLOR=#009900]$this[/color][COLOR=#990000]->[/color]images[COLOR=#990000];[/color]
[tab][tab][b][COLOR=#0000FF]else[/color][/b][COLOR=#990000]:[/color]
[tab][tab][tab][b][COLOR=#000000]file_put_contents[/color][/b][COLOR=#990000]([/color]  [b][COLOR=#000000]realpath[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]storageFileDirectory[COLOR=#990000])[/color] [COLOR=#990000].[/color] DIRECTORY_SEPARATOR [COLOR=#990000].[/color] [COLOR=#009900]$this[/color][COLOR=#990000]->[/color]storageFile[COLOR=#990000],[/color] 
[tab][tab][tab][tab][tab][tab][tab][tab][b][COLOR=#000000]serialize[/color][/b][COLOR=#990000]([/color][b][COLOR=#0000FF]array[/color][/b][COLOR=#990000]())[/color]
[tab][tab][tab][tab][tab][tab][tab][COLOR=#990000]);[/color]
[tab][tab][b][COLOR=#0000FF]endif[/color][/b][COLOR=#990000];[/color]
[tab][COLOR=#FF0000]}[/color]
[tab]
[tab]public [b][COLOR=#0000FF]function[/color][/b] [b][COLOR=#000000]__destruct[/color][/b][COLOR=#990000]()[/color][COLOR=#FF0000]{[/color]
[tab][tab][b][COLOR=#000000]date_default_timezone_set[/color][/b][COLOR=#990000]([/color][COLOR=#FF0000]'UTC'[/color][COLOR=#990000]);[/color]
[tab][tab][b][COLOR=#0000FF]if[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]original [COLOR=#990000]!=[/color] [COLOR=#009900]$this[/color][COLOR=#990000]->[/color]images[COLOR=#990000]):[/color]
[tab][tab][tab][b][COLOR=#000000]copy[/color][/b][COLOR=#990000]([/color]   [b][COLOR=#000000]realpath[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]storageFileDirectory[COLOR=#990000])[/color] [COLOR=#990000].[/color] DIRECTORY_SEPARATOR [COLOR=#990000].[/color] [COLOR=#009900]$this[/color][COLOR=#990000]->[/color]storageFile[COLOR=#990000],[/color] 
[tab][tab][tab][tab][tab][b][COLOR=#000000]realpath[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]storageFileDirectory[COLOR=#990000])[/color] [COLOR=#990000].[/color] DIRECTORY_SEPARATOR [COLOR=#990000].[/color] [b][COLOR=#000000]date[/color][/b][COLOR=#990000]([/color][COLOR=#FF0000]'Y-m-d_H-i-s'[/color][COLOR=#990000])[/color] [COLOR=#990000].[/color] [COLOR=#FF0000]'_'[/color] [COLOR=#990000].[/color] [COLOR=#009900]$this[/color][COLOR=#990000]->[/color]storageFile
[tab][tab][tab][tab][COLOR=#990000]);[/color]
[tab][tab][b][COLOR=#0000FF]endif[/color][/b][COLOR=#990000];[/color]
[tab][tab][b][COLOR=#000000]file_put_contents[/color][/b][COLOR=#990000]([/color]  [b][COLOR=#000000]realpath[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]storageFileDirectory [COLOR=#990000].[/color] DIRECTORY_SEPARATOR [COLOR=#990000].[/color] [COLOR=#009900]$this[/color][COLOR=#990000]->[/color]storageFile[COLOR=#990000]),[/color] 
[tab][tab][tab][tab][tab][tab][tab][b][COLOR=#000000]serialize[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]images[COLOR=#990000]));[/color]
[tab][COLOR=#FF0000]}[/color]
[tab]
[tab]public [b][COLOR=#0000FF]function[/color][/b] [b][COLOR=#000000]delete[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$imageID[/color][COLOR=#990000])[/color][COLOR=#FF0000]{[/color]
[tab][tab][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]images[COLOR=#990000][[/color][COLOR=#009900]$imageID[/color][COLOR=#990000]]->[/color][b][COLOR=#000000]markDeleted[/color][/b][COLOR=#990000]();[/color]
[tab][COLOR=#FF0000]}[/color]
[tab]
[tab]public [b][COLOR=#0000FF]function[/color][/b] [b][COLOR=#000000]addImage[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$imageFileName[/color][COLOR=#990000],[/color] [COLOR=#009900]$imageDescription[/color][COLOR=#990000])[/color][COLOR=#FF0000]{[/color]
[tab][tab][COLOR=#009900]$image[/color] [COLOR=#990000]=[/color] [b][COLOR=#0000FF]new[/color][/b] image[COLOR=#990000];[/color]
[tab][tab][COLOR=#009900]$image[/color][COLOR=#990000]->[/color][b][COLOR=#000000]newImage[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$imageFileName[/color][COLOR=#990000],[/color] [COLOR=#009900]$imageDescription[/color][COLOR=#990000]);[/color]
[tab][tab][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]images[COLOR=#990000][[/color][COLOR=#009900]$image[/color][COLOR=#990000]->[/color]imageID[COLOR=#990000]][/color] [COLOR=#990000]=[/color] [COLOR=#009900]$image[/color][COLOR=#990000];[/color]
[tab][COLOR=#FF0000]}[/color]
[tab]
[tab]public [b][COLOR=#0000FF]function[/color][/b] [b][COLOR=#000000]editImage[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$imageID[/color][COLOR=#990000])[/color][COLOR=#FF0000]{[/color]
[tab][tab][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]images[COLOR=#990000][[/color][COLOR=#009900]$imageID[/color][COLOR=#990000]]->[/color][b][COLOR=#000000]output[/color][/b][COLOR=#990000]([/color]true[COLOR=#990000]);[/color]
[tab][COLOR=#FF0000]}[/color]
[tab]
[tab]public [b][COLOR=#0000FF]function[/color][/b] [b][COLOR=#000000]listImages[/color][/b][COLOR=#990000]()[/color][COLOR=#FF0000]{[/color]
[tab][tab][COLOR=#990000]?>[/color]
[COLOR=#990000]<[/color]div id[COLOR=#990000]=[/color][COLOR=#FF0000]"imagesList"[/color][COLOR=#990000]>[/color]
[tab][COLOR=#990000]<[/color]table[COLOR=#990000]>[/color]
[tab][tab]
[tab][tab][COLOR=#990000]<[/color]thead[COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]<[/color]tr[COLOR=#990000]>[/color]
[tab][tab][tab][COLOR=#990000]<[/color]th[COLOR=#990000]>[/color]Image ID[COLOR=#990000]</[/color]th[COLOR=#990000]>[/color]
[tab][tab][tab][COLOR=#990000]<[/color]th[COLOR=#990000]>[/color]Image FileName[COLOR=#990000]</[/color]th[COLOR=#990000]>[/color]
[tab][tab][tab][COLOR=#990000]<[/color]th[COLOR=#990000]>[/color]Image Description[COLOR=#990000]</[/color]th[COLOR=#990000]>[/color]
[tab][tab][tab][COLOR=#990000]<[/color]th[COLOR=#990000]>[/color]Image Thumbnail[COLOR=#990000]</[/color]th[COLOR=#990000]>[/color]
[tab][tab][tab][COLOR=#990000]<[/color]th[COLOR=#990000]><[/color]a href[COLOR=#990000]=[/color][COLOR=#FF0000]"?action=newImage"[/color][COLOR=#990000]>[/color]New Image[COLOR=#990000]</[/color]a[COLOR=#990000]></[/color]th[COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]</[/color]tr[COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]</[/color]thead[COLOR=#990000]>[/color]
[COLOR=#990000]<?php[/color]   [b][COLOR=#0000FF]foreach[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]images [b][COLOR=#0000FF]as[/color][/b] [COLOR=#009900]$image[/color][COLOR=#990000]):[/color]
[tab][tab][tab][b][COLOR=#0000FF]if[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$image[/color][COLOR=#990000]->[/color]deleted [COLOR=#990000]==[/color] false[COLOR=#990000])[/color] [b][COLOR=#0000FF]echo[/color][/b] [COLOR=#009900]$image[/color][COLOR=#990000]->[/color][b][COLOR=#000000]showListData[/color][/b][COLOR=#990000]();[/color]
[tab][tab][b][COLOR=#0000FF]endforeach[/color][/b][COLOR=#990000];[/color] 
[COLOR=#990000]?>[/color]
[COLOR=#990000]</[/color]div[COLOR=#990000]>[/color]
[COLOR=#990000]<?php[/color]
[tab][COLOR=#FF0000]}[/color]
[tab]
[tab]public [b][COLOR=#0000FF]function[/color][/b] [b][COLOR=#000000]newImage[/color][/b][COLOR=#990000]()[/color][COLOR=#FF0000]{[/color]
[tab][tab][COLOR=#009900]$image[/color] [COLOR=#990000]=[/color] [b][COLOR=#0000FF]new[/color][/b] image[COLOR=#990000];[/color]
[tab][tab][COLOR=#009900]$image[/color][COLOR=#990000]->[/color][b][COLOR=#000000]outputNew[/color][/b][COLOR=#990000]();[/color]
[tab][COLOR=#FF0000]}[/color]
[COLOR=#FF0000]}[/color]
[b][COLOR=#0000FF]class[/color][/b] image [COLOR=#FF0000]{[/color]
[tab]public [COLOR=#009900]$imageFileName[/color][COLOR=#990000]=[/color][COLOR=#FF0000]''[/color][COLOR=#990000];[/color]
[tab]public [COLOR=#009900]$imageID[/color] [COLOR=#990000]=[/color] [COLOR=#FF0000]''[/color][COLOR=#990000];[/color]
[tab]public [COLOR=#009900]$imageDescription[/color][COLOR=#990000];[/color]
[tab]public [COLOR=#009900]$deleted[/color] [COLOR=#990000]=[/color] false[COLOR=#990000];[/color]
[tab]public [COLOR=#009900]$imageStorageDirectory[/color] [COLOR=#990000]=[/color] [COLOR=#FF0000]''[/color][COLOR=#990000];[/color]
[tab]
[tab]public [b][COLOR=#0000FF]function[/color][/b] [b][COLOR=#000000]__construct[/color][/b][COLOR=#990000]()[/color][COLOR=#FF0000]{[/color]
[tab][tab][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]imageStorageDirectory [COLOR=#990000]=[/color] [b][COLOR=#000000]getcwd[/color][/b][COLOR=#990000]();[/color]
[tab][COLOR=#FF0000]}[/color]
[tab]public [b][COLOR=#0000FF]function[/color][/b] [b][COLOR=#000000]newImage[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$imageFileName[/color][COLOR=#990000],[/color] [COLOR=#009900]$imageDescription[/color][COLOR=#990000])[/color][COLOR=#FF0000]{[/color]
[tab][tab][COLOR=#009900]$fileName[/color] [COLOR=#990000]=[/color] [COLOR=#009900]$this[/color][COLOR=#990000]->[/color][b][COLOR=#000000]getUniqueFileName[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$imageFileName[/color][COLOR=#990000]);[/color]
[tab][tab][b][COLOR=#000000]move_uploaded_file[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$imageFileName[/color][COLOR=#990000],[/color] [b][COLOR=#000000]realpath[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]imageStorageDirectory[COLOR=#990000])[/color] [COLOR=#990000].[/color] DIRECTORY_SEPARATOR [COLOR=#990000].[/color] [COLOR=#009900]$fileName[/color][COLOR=#990000]);[/color]
[tab][tab][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]imageFileName [COLOR=#990000]=[/color] [COLOR=#009900]$fileName[/color][COLOR=#990000];[/color]
[tab][tab][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]imageDescription [COLOR=#990000]=[/color] [COLOR=#009900]$imageDescription[/color][COLOR=#990000];[/color]
[tab][tab][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]imageID [COLOR=#990000]=[/color] [b][COLOR=#000000]md5[/color][/b][COLOR=#990000]([/color][b][COLOR=#000000]uniqid[/color][/b][COLOR=#990000]([/color][COLOR=#FF0000]''[/color][COLOR=#990000],[/color] true[COLOR=#990000]));[/color]
[tab][COLOR=#FF0000]}[/color]
[tab]
[tab]public [b][COLOR=#0000FF]function[/color][/b] [b][COLOR=#000000]getUniqueFileName[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$imageFileName[/color][COLOR=#990000])[/color][COLOR=#FF0000]{[/color]
[tab][tab][b][COLOR=#0000FF]list[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$w[/color][COLOR=#990000],[/color][COLOR=#009900]$h[/color][COLOR=#990000],[/color][COLOR=#009900]$type[/color][COLOR=#990000])[/color] [COLOR=#990000]=[/color] [b][COLOR=#000000]getimagesize[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$imageFileName[/color][COLOR=#990000]);[/color]
[tab][tab][b][COLOR=#0000FF]return[/color][/b] [b][COLOR=#000000]uniqid[/color][/b][COLOR=#990000]([/color][COLOR=#FF0000]'Image_'[/color][COLOR=#990000],[/color] true[COLOR=#990000])[/color] [COLOR=#990000].[/color] [b][COLOR=#000000]image_type_to_extension[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$type[/color][COLOR=#990000]);[/color]
[tab][COLOR=#FF0000]}[/color]
[tab]public [b][COLOR=#0000FF]function[/color][/b] [b][COLOR=#000000]markDeleted[/color][/b][COLOR=#990000]()[/color][COLOR=#FF0000]{[/color]
[tab][tab][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]deleted [COLOR=#990000]=[/color] true[COLOR=#990000];[/color]
[tab][COLOR=#FF0000]}[/color]
[tab]
[tab]public [b][COLOR=#0000FF]function[/color][/b] [b][COLOR=#000000]output[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$editable[/color][COLOR=#990000]=[/color]false[COLOR=#990000])[/color][COLOR=#FF0000]{[/color]
[tab][tab][b][COLOR=#0000FF]if[/color][/b] [COLOR=#990000]([/color][COLOR=#009900]$editable[/color][COLOR=#990000])[/color] [b][COLOR=#0000FF]return[/color][/b] [COLOR=#009900]$this[/color][COLOR=#990000]->[/color][b][COLOR=#000000]outputEditable[/color][/b][COLOR=#990000]();[/color]
[tab][tab][b][COLOR=#0000FF]return[/color][/b] [COLOR=#009900]$this[/color][COLOR=#990000]->[/color][b][COLOR=#000000]outputFixed[/color][/b][COLOR=#990000]();[/color]
[tab][COLOR=#FF0000]}[/color]
[tab]
[tab]public [b][COLOR=#0000FF]function[/color][/b] [b][COLOR=#000000]showListData[/color][/b][COLOR=#990000]()[/color][COLOR=#FF0000]{[/color]
[COLOR=#990000]?>[/color]
[tab][tab][COLOR=#990000]<[/color]tbody[COLOR=#990000]>[/color]
[tab][tab][tab][COLOR=#990000]<[/color]tr[COLOR=#990000]>[/color]
[tab][tab][tab][tab][COLOR=#990000]<[/color]td[COLOR=#990000]><?=[/color][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]imageID[COLOR=#990000];?></[/color]td[COLOR=#990000]>[/color]
[tab][tab][tab][tab][COLOR=#990000]<[/color]td[COLOR=#990000]><?=[/color][b][COLOR=#000000]htmlspecialchars[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]imageFileName[COLOR=#990000]);?></[/color]td[COLOR=#990000]>[/color]
[tab][tab][tab][tab][COLOR=#990000]<[/color]td[COLOR=#990000]><?=[/color][b][COLOR=#000000]htmlspecialchars[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]imageDescription[COLOR=#990000]);?></[/color]td[COLOR=#990000]>[/color]
[tab][tab][tab][tab][COLOR=#990000]<[/color]td[COLOR=#990000]><?=[/color][COLOR=#009900]$this[/color][COLOR=#990000]->[/color][b][COLOR=#000000]getIMGtag[/color][/b][COLOR=#990000]();?></[/color]td[COLOR=#990000]>[/color]
[tab][tab][tab][tab][COLOR=#990000]<[/color]td[COLOR=#990000]>[/color]
[tab][tab][tab][tab][tab][COLOR=#990000]<[/color]form action[COLOR=#990000]=[/color][COLOR=#FF0000]""[/color] method[COLOR=#990000]=[/color][COLOR=#FF0000]"post"[/color][COLOR=#990000]>[/color]
[tab][tab][tab][tab][tab][COLOR=#990000]<[/color]input type[COLOR=#990000]=[/color][COLOR=#FF0000]"hidden"[/color] name[COLOR=#990000]=[/color][COLOR=#FF0000]"imageID"[/color] value[COLOR=#990000]=[/color][COLOR=#FF0000]"<?=$this->imageID;?>"[/color][COLOR=#990000]>[/color]
[tab][tab][tab][tab][tab][COLOR=#990000]<[/color]input type[COLOR=#990000]=[/color][COLOR=#FF0000]"submit"[/color] name[COLOR=#990000]=[/color][COLOR=#FF0000]"action"[/color] value[COLOR=#990000]=[/color][COLOR=#FF0000]"Delete"[/color] [COLOR=#990000]/>[/color]
[tab][tab][tab][tab][tab][COLOR=#990000]<[/color]input type[COLOR=#990000]=[/color][COLOR=#FF0000]"submit"[/color] name[COLOR=#990000]=[/color][COLOR=#FF0000]"action"[/color] value[COLOR=#990000]=[/color][COLOR=#FF0000]"Edit"[/color] [COLOR=#990000]/>[/color]
[tab][tab][tab][tab][COLOR=#990000]</[/color]form[COLOR=#990000]>[/color]
[tab][tab][tab][tab][COLOR=#990000]</[/color]td[COLOR=#990000]>[/color]
[tab][tab][tab][COLOR=#990000]</[/color]tr[COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]</[/color]tbody[COLOR=#990000]>[/color]
[COLOR=#990000]<?php[/color]
[tab][COLOR=#FF0000]}[/color]
[tab]
[tab]public [b][COLOR=#0000FF]function[/color][/b] [b][COLOR=#000000]outputImage[/color][/b][COLOR=#990000]()[/color][COLOR=#FF0000]{[/color]
[tab][tab][b][COLOR=#0000FF]list[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$width[/color][COLOR=#990000],[/color] [COLOR=#009900]$height[/color][COLOR=#990000],[/color] [COLOR=#009900]$type[/color][COLOR=#990000],[/color] [COLOR=#009900]$attr[/color][COLOR=#990000])[/color] [COLOR=#990000]=[/color] [b][COLOR=#000000]getimagesize[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]imageFileName[COLOR=#990000]);[/color]
[tab][tab][COLOR=#009900]$fh[/color] [COLOR=#990000]=[/color] [b][COLOR=#000000]fopen[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]imageStorageDirectory [COLOR=#990000].[/color] DIRECTORY_SEPARATOR [COLOR=#990000].[/color] [COLOR=#009900]$this[/color][COLOR=#990000]->[/color]imageFileName[COLOR=#990000],[/color][COLOR=#FF0000]'rb'[/color][COLOR=#990000]);[/color]
[tab][tab][b][COLOR=#0000FF]if[/color][/b][COLOR=#990000](![/color][COLOR=#009900]$fh[/color][COLOR=#990000])[/color] [b][COLOR=#0000FF]die[/color][/b][COLOR=#990000]([/color][COLOR=#FF0000]'cannot open image for reading'[/color][COLOR=#990000]);[/color]
[tab][tab][b][COLOR=#000000]header[/color][/b][COLOR=#990000]([/color][COLOR=#FF0000]'Content-type: '[/color] [COLOR=#990000].[/color] [COLOR=#009900]$type[/color][COLOR=#990000]);[/color]
[tab][tab][b][COLOR=#000000]fpassthru[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$fh[/color][COLOR=#990000]);[/color]
[tab][tab][b][COLOR=#000000]fclose[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$fh[/color][COLOR=#990000]);[/color]
[tab][tab][b][COLOR=#0000FF]exit[/color][/b][COLOR=#990000];[/color]
[tab][COLOR=#FF0000]}[/color]
[tab]
[tab]private [b][COLOR=#0000FF]function[/color][/b] [b][COLOR=#000000]getImgTag[/color][/b][COLOR=#990000]()[/color][COLOR=#FF0000]{[/color]
[tab][tab][b][COLOR=#0000FF]list[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$width[/color][COLOR=#990000],[/color] [COLOR=#009900]$height[/color][COLOR=#990000])[/color] [COLOR=#990000]=[/color] [b][COLOR=#000000]getimagesize[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]imageFileName[COLOR=#990000]);[/color]
[tab][tab][COLOR=#009900]$max[/color] [COLOR=#990000]=[/color] [COLOR=#993399]80[/color][COLOR=#990000];[/color]
[tab][tab][b][COLOR=#0000FF]if[/color][/b] [COLOR=#990000]([/color][COLOR=#009900]$height[/color] [COLOR=#990000]>[/color] [COLOR=#009900]$width[/color][COLOR=#990000]):[/color]
[tab][tab][tab][COLOR=#009900]$newHeight[/color] [COLOR=#990000]=[/color] [COLOR=#993399]80[/color][COLOR=#990000];[/color]
[tab][tab][tab][COLOR=#009900]$newWidth[/color] [COLOR=#990000]=[/color] [b][COLOR=#000000]round[/color][/b][COLOR=#990000](([/color][COLOR=#993399]80[/color][COLOR=#990000]/[/color][COLOR=#009900]$height[/color] [COLOR=#990000])[/color] [COLOR=#990000]*[/color] [COLOR=#009900]$width[/color][COLOR=#990000]);[/color]
[tab][tab][b][COLOR=#0000FF]else[/color][/b][COLOR=#990000]:[/color]
[tab][tab][tab][COLOR=#009900]$newWidth[/color] [COLOR=#990000]=[/color] [COLOR=#993399]80[/color][COLOR=#990000];[/color]
[tab][tab][tab][COLOR=#009900]$newHeight[/color] [COLOR=#990000]=[/color] [b][COLOR=#000000]round[/color][/b][COLOR=#990000](([/color][COLOR=#993399]80[/color][COLOR=#990000]/[/color][COLOR=#009900]$width[/color] [COLOR=#990000])[/color] [COLOR=#990000]*[/color] [COLOR=#009900]$height[/color][COLOR=#990000]);[/color]
[tab][tab][b][COLOR=#0000FF]endif[/color][/b][COLOR=#990000];[/color]
[tab][tab][b][COLOR=#0000FF]return[/color][/b] [COLOR=#990000]<<<[/color]HTML
[COLOR=#990000]<[/color]img height[COLOR=#990000]=[/color][COLOR=#FF0000]"{$newHeight}px"[/color] width[COLOR=#990000]=[/color][COLOR=#FF0000]"{$newWidth}px"[/color] src[COLOR=#990000]=[/color][COLOR=#FF0000]"?action=getImage&imageID={$this->imageID}"[/color] [COLOR=#990000]/>[/color]
HTML[COLOR=#990000];[/color]
[tab][COLOR=#FF0000]}[/color]
[tab]
[tab]private [b][COLOR=#0000FF]function[/color][/b] [b][COLOR=#000000]outputEditable[/color][/b][COLOR=#990000]()[/color][COLOR=#FF0000]{[/color]
[COLOR=#990000]?>[/color]
[COLOR=#990000]<[/color]form method[COLOR=#990000]=[/color][COLOR=#FF0000]"post"[/color] action[COLOR=#990000]=[/color][COLOR=#FF0000]"<?=$_SERVER['PHP_SELF'];?>"[/color][COLOR=#990000]>[/color]
[tab][COLOR=#990000]<[/color]div [b][COLOR=#0000FF]class[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"row"[/color][COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]<[/color]div [b][COLOR=#0000FF]class[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"label"[/color][COLOR=#990000]>[/color]
[tab][tab][tab]Image File Name
[tab][tab][COLOR=#990000]</[/color]div[COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]<[/color]div [b][COLOR=#0000FF]class[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"field"[/color][COLOR=#990000]>[/color]
[tab][tab][tab][COLOR=#990000]<?=[/color][b][COLOR=#000000]htmlspecialchars[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]imageFileName[COLOR=#990000]);?>[/color]
[tab][tab][COLOR=#990000]</[/color]div[COLOR=#990000]>[/color]
[tab][COLOR=#990000]</[/color]div[COLOR=#990000]>[/color]
[tab][COLOR=#990000]<[/color]div [b][COLOR=#0000FF]class[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"row"[/color][COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]<[/color]div [b][COLOR=#0000FF]class[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"label"[/color][COLOR=#990000]>[/color]
[tab][tab][tab]Image Description
[tab][tab][COLOR=#990000]</[/color]div[COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]<[/color]div [b][COLOR=#0000FF]class[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"field"[/color][COLOR=#990000]>[/color]
[tab][tab][tab][COLOR=#990000]<[/color]textarea name[COLOR=#990000]=[/color][COLOR=#FF0000]"imageDescription"[/color][COLOR=#990000]><?=[/color][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]imageDescription[COLOR=#990000];?></[/color]textarea[COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]</[/color]div[COLOR=#990000]>[/color]
[tab][COLOR=#990000]</[/color]div[COLOR=#990000]>[/color]
[tab][COLOR=#990000]<[/color]div [b][COLOR=#0000FF]class[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"buttons"[/color][COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]<[/color]input type[COLOR=#990000]=[/color][COLOR=#FF0000]"submit"[/color] name[COLOR=#990000]=[/color][COLOR=#FF0000]"action"[/color] value[COLOR=#990000]=[/color][COLOR=#FF0000]"Save"[/color][COLOR=#990000]/>[/color]
[tab][tab][COLOR=#990000]<[/color]input type[COLOR=#990000]=[/color][COLOR=#FF0000]"hidden"[/color] name[COLOR=#990000]=[/color][COLOR=#FF0000]"imageID"[/color] value[COLOR=#990000]=[/color][COLOR=#FF0000]"<?=$this->imageID;?>"[/color][COLOR=#990000]/>[/color]
[tab][COLOR=#990000]</[/color]div[COLOR=#990000]>[/color]
[COLOR=#990000]</[/color]form[COLOR=#990000]>[/color]
[COLOR=#990000]<?php[/color]
[tab][COLOR=#FF0000]}[/color]
[tab]
[tab]private [b][COLOR=#0000FF]function[/color][/b] [b][COLOR=#000000]outputFixed[/color][/b][COLOR=#990000]()[/color][COLOR=#FF0000]{[/color]
[tab][COLOR=#990000]?>[/color]
[tab][COLOR=#990000]<[/color]div [b][COLOR=#0000FF]class[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"row"[/color][COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]<[/color]div [b][COLOR=#0000FF]class[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"label"[/color][COLOR=#990000]>[/color]
[tab][tab][tab]Image File Name
[tab][tab][COLOR=#990000]</[/color]div[COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]<[/color]div [b][COLOR=#0000FF]class[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"field"[/color][COLOR=#990000]>[/color]
[tab][tab][tab][COLOR=#990000]<?=[/color][b][COLOR=#000000]htmlspecialchars[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]imageFileName[COLOR=#990000]);?>[/color]
[tab][tab][COLOR=#990000]</[/color]div[COLOR=#990000]>[/color]
[tab][COLOR=#990000]</[/color]div[COLOR=#990000]>[/color]
[tab][COLOR=#990000]<[/color]div [b][COLOR=#0000FF]class[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"row"[/color][COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]<[/color]div [b][COLOR=#0000FF]class[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"label"[/color][COLOR=#990000]>[/color]
[tab][tab][tab]Image Description
[tab][tab][COLOR=#990000]</[/color]div[COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]<[/color]div [b][COLOR=#0000FF]class[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"field"[/color][COLOR=#990000]>[/color]
[tab][tab][tab][COLOR=#990000]<?=[/color][b][COLOR=#000000]nl2br[/color][/b][COLOR=#990000]([/color][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]imageDescription[COLOR=#990000]);?>[/color]
[tab][tab][COLOR=#990000]</[/color]div[COLOR=#990000]>[/color]
[tab][COLOR=#990000]</[/color]div[COLOR=#990000]>[/color]
[COLOR=#990000]<?php[/color]   
[tab][COLOR=#FF0000]}[/color]
[tab]
[tab]public [b][COLOR=#0000FF]function[/color][/b] [b][COLOR=#000000]outputNew[/color][/b][COLOR=#990000]()[/color][COLOR=#FF0000]{[/color]
[COLOR=#990000]?>[/color]
[COLOR=#990000]<[/color]form method[COLOR=#990000]=[/color][COLOR=#FF0000]"post"[/color] action[COLOR=#990000]=[/color][COLOR=#FF0000]"<?=$_SERVER['PHP_SELF'];?>  "[/color] enctype[COLOR=#990000]=[/color][COLOR=#FF0000]"multipart/form-data"[/color][COLOR=#990000]>[/color]
[tab][COLOR=#990000]<[/color]div [b][COLOR=#0000FF]class[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"row"[/color][COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]<[/color]div [b][COLOR=#0000FF]class[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"label"[/color][COLOR=#990000]>[/color]
[tab][tab][tab]Image File 
[tab][tab][COLOR=#990000]</[/color]div[COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]<[/color]div [b][COLOR=#0000FF]class[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"field"[/color][COLOR=#990000]>[/color]
[tab][tab][tab][COLOR=#990000]<[/color]input type[COLOR=#990000]=[/color][COLOR=#FF0000]"file"[/color] name[COLOR=#990000]=[/color][COLOR=#FF0000]"imageFile"[/color] [COLOR=#990000]/>[/color]
[tab][tab][COLOR=#990000]</[/color]div[COLOR=#990000]>[/color]
[tab][COLOR=#990000]</[/color]div[COLOR=#990000]>[/color]
[tab][COLOR=#990000]<[/color]div [b][COLOR=#0000FF]class[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"row"[/color][COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]<[/color]div [b][COLOR=#0000FF]class[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"label"[/color][COLOR=#990000]>[/color]
[tab][tab][tab]Image Description
[tab][tab][COLOR=#990000]</[/color]div[COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]<[/color]div [b][COLOR=#0000FF]class[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"field"[/color][COLOR=#990000]>[/color]
[tab][tab][tab][COLOR=#990000]<[/color]textarea name[COLOR=#990000]=[/color][COLOR=#FF0000]"imageDescription"[/color][COLOR=#990000]><?=[/color][COLOR=#009900]$this[/color][COLOR=#990000]->[/color]imageDescription[COLOR=#990000];?></[/color]textarea[COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]</[/color]div[COLOR=#990000]>[/color]
[tab][COLOR=#990000]</[/color]div[COLOR=#990000]>[/color]
[tab][COLOR=#990000]<[/color]div [b][COLOR=#0000FF]class[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"buttons"[/color][COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]<[/color]input type[COLOR=#990000]=[/color][COLOR=#FF0000]"submit"[/color] name[COLOR=#990000]=[/color][COLOR=#FF0000]"action"[/color] value[COLOR=#990000]=[/color][COLOR=#FF0000]"Save"[/color][COLOR=#990000]/>[/color]
[tab][COLOR=#990000]</[/color]div[COLOR=#990000]>[/color]
[COLOR=#990000]</[/color]form[COLOR=#990000]>[/color]
[COLOR=#990000]<?php[/color]   
[tab][COLOR=#FF0000]}[/color]
[tab]
[COLOR=#FF0000]}[/color]
 
by way of a test I just wrote a script to upload 1000 or so images to the test site. Seems to work fine and not too slow at all.

the image loading on the list display is a little slow but this could probably be ameliorated by adding some cacheing headers.
 
ooh, it really does work :)

well, using the latest snapshot of code i now get:

Fatal error: Call to undefined function image_type_to_extension() in /var/my/server/filepath/index.php on line 133


having a look at it now as I've never used image functions before but thought I'd update this here :)

________
clueless
 
I am most surprised that the function is not available to you. It should be available from php 5.0 upwards. are you using a very old version of php?
 
PHP Version 5.1.6 :/

guess I start mooching through config files then eh? lol

________
clueless
 
Have checked /etc/php.ini and nothing is listed in disable_functions

________
clueless
 
technically the function should not need GD installed. but just to make sure, do you have the GD library installed?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top