TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

May 05, 2024, 10:36:04 AM

Login with username, password and session length
Members
  • Total Members: 3,885
  • Latest: Growner
Stats
  • Total Posts: 195,178
  • Total Topics: 21,220
  • Online today: 182
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 1
  • Guests: 172
  • Total: 173
  • @rjen

Simple image gallery

Started by JPDeni, September 18, 2006, 04:28:55 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

evilicy

Quote from: JPDeni on November 11, 2006, 04:30:13 AM
QuoteSo I then just tried to manually upload the images to my album folder and rename them to t_a_1.jpg etc....
Actually, the script renames the files to a_1.jpg and then it creates a thumbnail named t_a_1.jpg. If you're going to do it by hand, then you'll have to create your own thumbnails in addition to uploading the files. Which pretty much negates the point of the script. I got tired of creating thumnails. :)

Quotepretty much everything you said.
It's gotta be all or nothing. "Pretty much" won't work.

Well now that I know t_a_...jpg is the thumbnails I'm guessing it is just the images not uploading for me, hense why the thumbnails don't display ;p ... and yes I did check the permissions xD So I dunno.... Doesn't really matter to me I found another script anyways, just mentioned it incase it wasn't just me being dumb doing something wrong ;p

marzi

JPDeni,
Although the image (a_1.jpg) and thumbnail (t_a_1.jpg) are in the correct image directory and all fields were filled in before uploading, the image itself will not display. All that displays is the category name (Test). http://www.marscafe.com/moxforum/index.php?page=8

Below is the code for the 2 mysql tables. They are both populated with the one record that corresponds to the 'Test Image'.
Quote
CREATE TABLE `gallery` (
  `gallery_id` int(6) unsigned zerofill NOT NULL auto_increment,
  `gallery_cat_id` int(11) default NULL,
  `title` varchar(255) default NULL,
  `description` text,
  `file` text,
  `date` int(10) default NULL,
  PRIMARY KEY  (`gallery_id`)
);

CREATE TABLE `gallery_cats` (
  `gallery_cat_id` int(11) unsigned zerofill NOT NULL auto_increment,
  `gallery_cat` varchar(255) default NULL,
  `sort_order` int(4) default NULL,
  `father` int(10) default NULL,
  PRIMARY KEY  (`gallery_cat_id`)
);

Any idea what is wrong?

With thanks.


JPDeni

My fault. I should have had a variable for the URL for the picture. Since there wasn't much interest in this before, I didn't worry much about it. :)

Go through the script and find the references to /album/ in the img src tags. Change that to the directory where your images are.

If more people seem to want this, I'll go back and change it to a variable to be set at the beginning of the script.

marzi

#13
JP,
Made the change as you suggested and that solved the problem.
QuoteIf more people seem to want this, I'll go back and change it to a variable to be set at the beginning of the script.

I am surprised that interest is not keen. Your gallery is very easy to use and straightforward while being flexible if you want to "get inside" and make some simple modifications.
Thank you for sharing your code.

PS// a useful first upgrade would be if you would allow users to post (with a limit) images and also be able to delete them.

marzi
aka chef mars

JPDeni

I've thought about adding an image upload thing for users, but just haven't done it yet. Actually, for my purposes, I've got some very specific things in mind to make it specific to my site. I just haven't done it yet. :) After I wrote mine, I found out that Bloc is planning to make a TP gallery, so I'm sorta waiting to see what it looks like and how I can tweak it to do my will. ;D

I think part of the reason that most folks aren't interested in this is that they like the galleries that count the number of views and allow for comments and ratings and that sort of thing. I don't like those, so I'd just have to remove them from any script that I use.

Glad it's been of use to you, marzi. :)

peeper

$directory = '/path/to/your/image/directory';
this  URL or Physical path?

JPDeni

Quotethis  URL or Physical path
It's the physical path. Not URL. This is where the script writes the files.

peeper

Thanks for the answer!

I create tables in my DB
Create php article with your code
replace page=7 to match whatever the page number is that I use
replace /path/to/your/image/directory to my path
And that does not work.... see attache
Where I am mistaken?  :-\ :'(

PS Sorry for my english...

JPDeni

Your english is fine. It's much better than my Russian! ;D

I really don't know what the problem is. You have uploaded images, right? :)

peeper

yes I upload pictures through FTP in album folder.
I should see something, upload menu or images?
:-\
I shall wait tinyportal v.1.0... I hope TP 1.0 will released very soon. :)