RE: Script Requests 06-30-2011, 06:54 AM
#2
(06-30-2011, 12:30 AM)Floydfrass Wrote: I would like a script that would create a photo Gallery
I can't sleep... as usual. So I will get started working on it right now.
Update [20110630]:
I'm going to break it down into the abstract object classes. Then I will extend each class twice once for file support and once for PDO support.
From there I will make a simple templating interface in case you don't currently have one implemented. That will include the AJAX calls and jQuery stuff.
Update [20110630]:
ImageObject.class.php:
Spoiler:
PHP Code:
<?php
/**
* @package ImageGallery
* @author slbmeh <slbmeh@odesk.com>
* @license http://www.opensource.org/licenses/BSD-3-Clause BSD-3-Clause License
*/
/**
* @abstract
*/
abstract class ImageObject {
/**
* @var string holds the file contents.
*/
protected $_imageData;
/**
* @var string holds the filename.
*/
protected $_fileName;
/**
* Getters and setters.
*/
/**
* Getter for $_imageData
* @return string contains a string of the file contents
*/
protected function getImage() {
return $this->_imageData;
}
/**
* Getter for $_fileName
* @return string contains a string of the file name
*/
protected function getFileName() {
return $this->_fileName;
}
/**
* Setter for $_imageData
* @param string $data a string containing file contents
*/
protected function setImage($data) {
// Type hint to ensure we are being sent a string.
$data = (string) $data;
$this->_imageData = $data;
}
/**
* Setter for $_fileName
* @param string $filename a string containing the filename.
*/
protected function setFileName($filename) {
// Type hint to ensure we are being sent a string.
$filename = (string) $filename;
$this->_fileName = $filename;
}
}
?>Update [20110806]:
I had a few things I needed to take care of and will resume development as free time comes around.




![[+]](https://sinister.li/images/modern/collapse_collapsed.png)