Webmastersite.net
Register Log In

Thumbnail problem
Upgrade 2.15 -> 2.3.7 and changes to the thumbnail

Comments on Thumbnail problem

Ducnan Clarke
Member

Usergroup: Member
Joined: Dec 19, 2003
Location: Stoke, UK

Total Topics: 7
Total Comments: 20
Posted Sep 29, 2006 - 7:32 PM:

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
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Sep 30, 2006 - 12:27 PM:

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.
Ducnan Clarke
Member

Usergroup: Member
Joined: Dec 19, 2003
Location: Stoke, UK

Total Topics: 7
Total Comments: 20
Posted Sep 30, 2006 - 5:48 PM:

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?
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Oct 01, 2006 - 9:18 PM:

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.
Ducnan Clarke
Member

Usergroup: Member
Joined: Dec 19, 2003
Location: Stoke, UK

Total Topics: 7
Total Comments: 20
Posted Oct 02, 2006 - 1:02 AM:

Must have missed the usergroup permissions changes. Done that now and happily uploading. However, the thumbnail change resukts in
Fatal error: Call to undefined function: selectitem() in /homepages/21/d86207139/htdocs/urbanlines.net/gallery/thumbnail.php on line 30


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
Ducnan Clarke
Member

Usergroup: Member
Joined: Dec 19, 2003
Location: Stoke, UK

Total Topics: 7
Total Comments: 20
Posted Oct 02, 2006 - 7:41 PM:

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.
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Oct 03, 2006 - 10:46 AM:

I should've written
if (!$_GET['attachid']) { $_GET['attachid'] = $db->rowitem($db->select('id', 'attachmentstable', 'objectid='. $_GET['id'], 'ORDER BY id ASC', 'LIMIT 0,1')); $attachid = $_GET['attachid']; } 

if ($_GET['attachid'] > 0)
Ducnan Clarke
Member

Usergroup: Member
Joined: Dec 19, 2003
Location: Stoke, UK

Total Topics: 7
Total Comments: 20
Posted Oct 03, 2006 - 1:37 PM:

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.
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



This thread is closed, so you cannot post a reply.