Gossamer Forum
Home : Products : Gossamer Links : Discussions :

image problems

Quote Reply
image problems
Hi all,

Hoping someone can help me my images not appearing, i am allowing pictures to be uploaded with listings and am using the following code:

Code:

<%if albumpicture%><img src="/uploads/<%albumpicture%>" width="100" height="100"><%endif%>


When i upload an image it is saving the image with a number at the begining for example: 4-mypic.gif

Yet on my detail page it is showing the image as: mypic.gif without the number so in return the image does not show up.

Can someone help please.

Kirk


--------------------------------------------------

Life isn't like a box of chocolates ... it's more like a jar of jalapenos. What you do today might burn your ass tomorrow.
Quote Reply
Re: [mekro] image problems In reply to
I am confused, you appear to be suggesting that the field <%albumpicture%> has the contents within the database of 4-mypic.gif, however, when the build creates the detailed page, it outputs the field contents as only mypic.gif.

Are you certain that the contents of <%albumpicture%> is 4-mypic.gif?

Rod

-----------------------------------------------
Yoga teachers forum / Ringtones for Australia, UK
Quote Reply
Re: [mekro] image problems In reply to
You need a global. Have a search for 'FileRelative', and there are plenty that I have posted. Alternativly, you could purchase my Thumb_Images plugin, which gives you a simple call;

<%Plugins::Thumb_Images::ThumbURL($ID,'FieldnName')%>

You cannot simply use the name tag, especially if you are using the HASHED saving method.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] image problems In reply to
Hey Andy,

I done the searches and nothing is coming up regarding filerelative. I know you have a plugin, but for now I need to find that global that I mentioned earlier to get my images showing up. I'd appreciate a lead on this. Thanks.

Royce
Quote Reply
Re: [Royce] image problems In reply to
How about this thread?

http://www.gossamer-threads.com/...i?post=251257#251257

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] image problems In reply to
there are several threads for this issue, but it seems I´m too stupid for adding an image.

What I need to have:
I want to add an image to one of my many categories. Every category should have another image, but not every category should have an image.


I did the following:

1) I have managed to add a "column" in my "category-properties" table-editor with the following data:
- column name: image
- column type: CHAR
- column size: 255
- form display: image
-form type: file
- file save location: /home/au000040/www/home/pages/images/default
- file save method: HASHED

2) In one of my categories I added an image via the new box which helps me to add an image.
- this image is called "star1.gif"
- when I then go via FTP to my server, I can see that my image is in a "new" folder called: "1"
- which means: the path for this image is a different one than expected: /home/au000040/www/home/pages/images/default/1
- to my surprise, the image has got a different name now: its name has changed from "star1.gif" to "1-star1.gif"

3) From reading different threads here, I understand that this is a normal thing and that we can solve this with a so called "global".
If think a "global" is a code in the "global template"-section like for example <table border="0" width="745" cellpadding="0" cellspacing="0"> is the code for "body_table"

4) I understand that I have to create such a "global".
- what is the code for this global in order to get an image to my category ?
- where do I put this "global" ? Somewhere in between the HTML-code ?

5)
the standard code in the template "subcategory.html" is:

<%if Image%>
<td width=30 align=center valign=top>
<img src="<%build_images_url%>/default/<%image%>" border=0></td>
<%else%>
<td width=25>&nbsp;</td>
<%endif%>


do I have to alter this ?

6)
I understand that I have to do a "Build Changed" in the "Build menu" to make everything work.
Right ?



I have no idea of PERL. Sorry. PLEASE HELP !

Last edited by:

erichcyber: Jul 24, 2004, 8:35 PM
Quote Reply
Re: [erichcyber] image problems In reply to

What I need to have: I want to add an image to one of my many categories. Every category should have another image, but not every category should have an image.
Links has this built in, go to Admin > Database > Modify Category > Select the Cat you want to add an image to and at the bottom of the Modify form you will see “Image”. Just put in “category.gif” and you should be done. Note: That the image will show on all subcats of the main cat unless you make changes to them also. In Subcategory template you will find something like this.
-- This is only useful if you have added an Image column to your category table --

Regards

minesite

Last edited by:

minesite: Jul 24, 2004, 10:01 PM
Quote Reply
Re: [minesite] image problems In reply to
I know this.
I can see this box where I can put in the image called for example "category.gif". If I click on "view" in the Admin, a pop-up-window is coming up and I can even see this image. But the image does NOT show on the user-side.
Do I need a "global" or not ?
Quote Reply
Re: [erichcyber] image problems In reply to
No, you don't need a global.
Just check the path / URL is correct in Subcategory template relative to where you uploaded the image.
i.e. /default/ is this where your image is.?
<img src="<%build_images_url%>/default/<%image%>" border=0>

Regards

minesite
Quote Reply
Re: [minesite] image problems In reply to
I have set the code in the "subcategory.html" as you wrote. It is not working !
Why ? Is this because Links-SQL is putting the image in another folder ? see:


quote:
______________________________________________________________________________________

2) In one of my categories I added an image via the new box which helps me to add an image.
- this image is called "star1.gif"
- when I then go via FTP to my server, I can see that my image is in a "new" folder called: "1"
- which means: the path for this image is a different one than expected: /home/au000040/www/home/pages/images/default/1
- to my surprise, the image has got a different name now: its name has changed from "star1.gif" to "1-star1.gif"


______________________________________________________________________________________
Quote Reply
Re: [erichcyber] image problems In reply to
Hi erichcyber

Let’s start again.
Here’s what you need to do to add images for your category.

Select a category; modify it as before with "star1.gif" where the image box is.
FTP; don’t use the upload feature, "star1.gif" to /home/au000040/www/home/pages/images/default/
I presume the above path points to the build_images_url under Admin > Setup > Paths and URLs
i.e.http://www.yoursite.com/home/pages/images/

Add this to your subcategory template if its not there already.
Standard template has this there by default.
<%-- This is only useful if you have added an Image column to your category table --%>
<%if Image%>
<td width=30 align=center valign=top>
<img src="<%build_images_url%>/default/<%Image%>" border=0></td>
<%else%>
<td width=25>&nbsp;</td>
<%endif%>

Open up the category chosen above in dynamic mode and you should see an image or broken image.

Let us know how you get on.

Regards

minesite
Quote Reply
Re: [minesite] image problems In reply to
Hi erichcyber

I just noticed


1) I have managed to add a "column" in my "category-properties" table-editor with the following data:
- column name: image
- column type: CHAR
- column size: 255
- form display: image
-form type: file
- file save location: /home/au000040/www/home/pages/images/default
- file save method: HASHED



There was no need to do this as the category table already has an Image column.
This may be where the problem is, make sure you use the Image not image column.

Regards

minesite
Quote Reply
Re: [minesite] image problems In reply to
minesite, thanks for your patience !


1)
the column "Image" did not exist by default in the "category column".

previously I had created a column called "image" (letter i set small) and I also created <img src="<%build_images_url%>/default/<%image%>" border=0>
in my "subcategory.html" template (image also with small letter i ).
nothing has worked and the image did not show up on the user-sied of my website.

2)
now I did it with "Image" using a "I" as a big letter. But the problem is that when the image is uploaded via admin, then the image is automatically put into a new folder called "1" and the image-name is automatically being re-named from "star1.gif" to "1-star1.gif". So the path for the "File Save Location" which I had to define by creating the category-column "Image" is a different one.

path defined:
/home/au000040/www/home/pages/images/default/star1.gif

path where Links-SQL puts the image by uploading the image via admin:
/home/au000040/www/home/pages/images/default/1/1-star1.gif


3)
If I put my image "star1.gif" via FTP to the server in my folder "default", then the image appears on my website. So this is a small success: the image now appears on my website. But I´m not totally satisfied as the "upload" via admin is not working as it should and I do not want to FTP the images.



Any help on this is very appreciated.
Quote Reply
Re: [erichcyber] image problems In reply to
OK, small success’s are good.


If I put my image "star1.gif" via FTP to the server in my folder "default", then the image appears on my website. So this is a small success: the image now appears on my website.
But I’m not totally satisfied as the "upload" via admin is not working as it should and I do not want to FTP the images.


The upload feature is working correctly.
If you want to upload via admin you will need to disregard everything above and start with a global and now things get real complicated.

[Ad for commission Tongue]
I use Andy’s Thumb_Images Plugin as I also need to have these resized when I’m uploading, so if you need to do this now or in the near future I’d strongly recommend outlaying the $50.00 to buy it.
Price: $50 - << BUY >> Links SQL Version Required: 2.1.2
Requirements; Links SQL 2.1.2+ Image::Magick.[/Ad]

If you’re happy with trying to setup the global do as Andy suggested earlier and try the post he linked and do a search for “relative path” “image upload” “hashed” etc and see how you get on.

Post back here if you have problems.

PS : GT has documentation for links in PDF format which may give some clues.

Regards

minesite

Last edited by:

minesite: Jul 25, 2004, 8:11 AM
Quote Reply
Re: [minesite] image problems In reply to
that´s what I thought......you need a so called "global".
As I´m not a PERL-guy Crazy .....I will definately buy a "plugin". I will contact GT for this as their support is absolutely great ! They should install this for me.


Which plugin is better ? what are the differences in the plugins you suggested "Andy’s Thumb_Images Plugin" and the other one called "Attachment-plugin" from "Yogi" ?

http://www.gossamer-threads.com/...orum.cgi?post=219660;



Many thanks,

Erich
Quote Reply
Re: [erichcyber] image problems In reply to
that’s what I thought......you need a so called "global"


I want to add an image to one of my many categories. Every category should have another image, but not every category should have an image.
If I put my image "star1.gif" via FTP to the server in my folder "default", then the image appears.
No global required.Tongue


I do not want to FTP the images.
Global required.Pirate



I use Andy’s Thumb_Images Plugin and it should do what you want, Andy may also install this for you.
I also use "EyeCatcher Plugin" but have not tried Yogi's "Attachment-plugin"

They may come into this thread soon to explain the benefits of each the plugins.

EDIT : These plugins are mainly for link images, logo's, screenshots etc.
Check with the makers to see if they will work for Categories.

Regards

minesite

Last edited by:

minesite: Jul 25, 2004, 9:59 AM
Quote Reply
Re: [erichcyber] image problems In reply to
I am having the same Image problem as many users have posted about.

Why does it have to be so damn complicated?

Prepending images and files with an auto-incremented ID is just plain insane.
What on earth is the purpose of renaming the files and then storing the wrong filename in the database field for the name? Oh and on top of it, lets put it in a folder that you can barely create a URL to.

Paying $50 for a plugin to fix this is not fair.

Here's what I would like to see:

Go ahead and create a folder to put the image (or file) in, but make the folder the same ID as the link ID. After all, link id is already unique. Then when uploading any file for a particular link, put it in it's cooresponding folder. This approach at least makes some sense. It would group all files for each link in 1 folder. The way it is now, If I have an image and an MP3 file for each link, I get a separate folder for each; doubling the number of folders.

Am I missing something here.

What I really need is to be able to create a URL for a file without going through page.cgi or jump.cgi. Can anyone offer a solution?

Just complete this 1 line of code where <%ID%> is the folder that was auto-created when the file was uploaded

theFile=../../files/<%ID%>/<%ID%>-<%MP3_File%>

Thanks
RGB World, Inc. - Software &amp; Web Development.
rgbworld.com
Quote Reply
Re: [rgbworld] image problems In reply to
My own solution (found somewhere else in these forums):

create a global named "relative_image"

sub {
my ($rec) = @_;
my $id = $rec->{ID};
if ($rec->{Image})
{
my $links_db = $DB->table('Links');
my $fh = $links_db->file_info( 'Image', $id );
my $location = $fh->File_RelativePath;
return qq~../../files$location~;
}
else
{
return "";
}
}

Then use it link.html template like this:
<a href="<%db_cgi_url%>/jump.cgi?ID=<%ID%>" target="_blank"><img src="<%relative_path%>" height="120" width="150" border="0"></a>

Works fine.

There are still problems with the way file uploading works out-of-the-box.
Like if you delete the file, the folder remains on the server, so it is very likely that my directory will eventually contain hundreds or thousands of empty folders.

When I have time, I guess I will have to fix the uploading to just put files in a folder name that matches the link id of the link.

Thanks for any input
Chris
RGB World, Inc. - Software &amp; Web Development.
rgbworld.com
Quote Reply
Re: [rgbworld] image problems In reply to
Sorry, use it in template like this...

Then use it link.html template like this:
<a href="<%db_cgi_url%>/jump.cgi?ID=<%ID%>" target="_blank"><img src="<%relative_image%>" height="120" width="150" border="0"></a>

RGB World, Inc. - Software &amp; Web Development.
rgbworld.com