What I am needing to create is a script were the admin user uploads an image from the backend.
The image path and name that is given will be sent to the Gallery Table in the database - imageName and imagePath from this a thumbnail will have to be automatically created and then displayed via the front end.
I am using a lightbox type feature hence why I am so confused on how to code this.
I have been trying to get this to work but then I clicked that I have a seprate thumbnail
I am only working on the front-end code at the momment, so far I have:
A Gallery Manager which will house the SQL query for the class.gallery.php
PHP Code:
class GalleryManager{
public function getAllImages(){
global $database;
$Query = 'SELECT id, imageName, imagePath FROM Gallery';
That works ok but it is only showing the first letter of the file name is this because I have not included the file type anywhere. I have manually imported the file name into the db but I am having no luck
That works ok but it is only showing the first letter of the file name is this because I have not included the file type anywhere. I have manually imported the file name into the db but I am having no luck
In your GalleryManager Class you are creating an array based on the Database ID, and image path
$aGallery[$aImage['id']] = $aImage['imagePath'];
In your Gallery Class you are looping that array, and then trying to access the 'imagePath' of the array which does not exists. Hence why it is giving the first letter in the filename.
Bookmarks