I have finally got around to upgrading my version of the gallery software. After a few teething problems (the admin control panel adding blank lines into the config.php) I have it mostly working now. One problem I'm having though is linking to thumbnails from outside the gallery.
The id is still the id of the full size image, but now there's an extra field, attachid. This looks completely unrelated to the image number. This just adds work for me when I want to show thumbnails. Is there a way around it?
An image entry can have any number of images attached to it -- there could be 20, so specifying only the image id doesn't suggest which image you want. Thus you need to create the attachments area. It's confusing since "submit image" these days really means "submit x associated images" depending on how the admin configures things.
{IMAGETHUMBURL} is a quick shortcut to use inside the gallery, but of course it doesn't help with outside links from places that don't understand template variables. There's no way around the full url from outside.
Paul wrote: It's confusing since "submit image" these days really means "submit x associated images" depending on how the admin configures things.
This comment interested me, so I thought I'd look at exactly what happens when you upload a new image. It appears you can't. I get to set the category, add a title, description, alias, type and ad an email for notifications. There is however no "select an image to upload". Am I missing something?
Also, what is the reason behind having an image id which is not unique? I've probably missed some useful feature that it allows now. Either way, I can't see any reason I'd ever want to upload more than one image under a particular image ID. Is there any way to check if there is only one, and then allow it to work with the ID alone?
I'm asking because I've used the older thumbnail format on many websites, some of which I no longer have access to change. As it is, none of them will work any more.
Alternatively, is there any way to back out the changes made in the upgrade and go back to v2.15 which worked for me?
You probably didn't update your usergroup permissions when upgrading, that's in the upgrade instructions if you read them. You have to set the number of attachments you want to allow.
Also, what is the reason behind having an image id which is not unique?
Attachment ids are unique, and I believe it does work if you specify only the attachment id and not the image id. The image id isn't restricted to 1 attachment because some people find it useful to have many.
Anyhow, replace
if ($_GET['attachid'] > 0)
with
if (!$_GET['attachid']) { $_GET['attachid'] = $db->selectitem('id', 'attachmentstable', 'objectid='. $_GET['id'], 'ORDER BY id ASC', 'LIMIT 0,1'); $attachid = $_GET['attachid']; }
if ($_GET['attachid'] > 0)
in thumbnail.php and your old code should work if you keep it at one attachment per image.
OK, I've been having a play. I have changed things around a bit. If I use the following;
if (!$_GET['attachid']) { $_GET['attachid'] = $db->select('id', 'attachmentstable', 'objectid='. $_GET['id'], 'ORDER BY id ASC', 'LIMIT 0,1'); $attachid = $_GET['attachid']; }
I get the error
<b>Warning</b>: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in <b>/homepages/..../gallery/classes/database.php</b> on line <b>94</b>
However, if I swap this to
if (!$_GET['attachid']) { $_GET['attachid'] = 1822; $attachid = $_GET['attachid']; }
Then I get a thumbnail, but obviously the same one for all values of the image ID. I tried running the SQL directly on the database and it returned the correct row and entry.
That's two of the things I like about WSN - the personal support (not just replying with around "that feature is not available") and the almost infinite possibilities to make it do what you want with miniman changes.
0/5
1
2
3
4
5
This thread is closed, so you cannot post a reply.
Comments on Thumbnail problem
Member
Usergroup: Member
Joined: Dec 19, 2003
Location: Stoke, UK
Total Topics: 7
Total Comments: 20
I have finally got around to upgrading my version of the gallery software. After a few teething problems (the admin control panel adding blank lines into the config.php) I have it mostly working now. One problem I'm having though is linking to thumbnails from outside the gallery.
Previously I just used the format:
urbanlines.net/gallery/thum...bheight=150&thumbwidth=150
where the id is the id of the image to be thumbnailed. However, this no longer works. It seems I need to find 2 numbers now, as in this format:
urbanlines.net/gallery/thum...bwidth=200&thumbheight=200
The id is still the id of the full size image, but now there's an extra field, attachid. This looks completely unrelated to the image number. This just adds work for me when I want to show thumbnails. Is there a way around it?
Cheers
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
An image entry can have any number of images attached to it -- there could be 20, so specifying only the image id doesn't suggest which image you want. Thus you need to create the attachments area. It's confusing since "submit image" these days really means "submit x associated images" depending on how the admin configures things.
{IMAGETHUMBURL} is a quick shortcut to use inside the gallery, but of course it doesn't help with outside links from places that don't understand template variables. There's no way around the full url from outside.
Member
Usergroup: Member
Joined: Dec 19, 2003
Location: Stoke, UK
Total Topics: 7
Total Comments: 20
It's confusing since "submit image" these days really means "submit x associated images" depending on how the admin configures things.
This comment interested me, so I thought I'd look at exactly what happens when you upload a new image. It appears you can't. I get to set the category, add a title, description, alias, type and ad an email for notifications. There is however no "select an image to upload". Am I missing something?
Also, what is the reason behind having an image id which is not unique? I've probably missed some useful feature that it allows now. Either way, I can't see any reason I'd ever want to upload more than one image under a particular image ID. Is there any way to check if there is only one, and then allow it to work with the ID alone?
I'm asking because I've used the older thumbnail format on many websites, some of which I no longer have access to change. As it is, none of them will work any more.
Alternatively, is there any way to back out the changes made in the upgrade and go back to v2.15 which worked for me?
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
You probably didn't update your usergroup permissions when upgrading, that's in the upgrade instructions if you read them. You have to set the number of attachments you want to allow.
Also, what is the reason behind having an image id which is not unique?
Attachment ids are unique, and I believe it does work if you specify only the attachment id and not the image id. The image id isn't restricted to 1 attachment because some people find it useful to have many.
Anyhow, replace with
in thumbnail.php and your old code should work if you keep it at one attachment per image.
Member
Usergroup: Member
Joined: Dec 19, 2003
Location: Stoke, UK
Total Topics: 7
Total Comments: 20
Must have missed the usergroup permissions changes. Done that now and happily uploading. However, the thumbnail change resukts in
I'll keep looking at it, and working on an updated template for my site, as the old one needs changes to get it working anyway...
Cheers
Member
Usergroup: Member
Joined: Dec 19, 2003
Location: Stoke, UK
Total Topics: 7
Total Comments: 20
OK, I've been having a play. I have changed things around a bit. If I use the following;
I get the error
However, if I swap this to
Then I get a thumbnail, but obviously the same one for all values of the image ID. I tried running the SQL directly on the database and it returned the correct row and entry.
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
I should've written
Member
Usergroup: Member
Joined: Dec 19, 2003
Location: Stoke, UK
Total Topics: 7
Total Comments: 20
That's sorted that one for me as well. Cheers.
That's two of the things I like about WSN - the personal support (not just replying with around "that feature is not available") and the almost infinite possibilities to make it do what you want with miniman changes.