Gossamer Forum
Home : Products : Gossamer Links : Discussions :

HOWTO: Using File Columns

(Page 2 of 2)
> >
Quote Reply
Removed In reply to
Removed
Quote Reply
Removed In reply to
Removed
Quote Reply
Re: [turischt] HOWTO: Using File Columns In reply to
Hi,

Send over GLinks admin access, and I'll have a look for you. Not sure what your problem is at the moment, so will just be easier to look into it.

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
Removed In reply to
Removed
Quote Reply
Re: [turischt] HOWTO: Using File Columns In reply to
Hi

I have just had a 'problem' trying to get file upload to work correctly, this is the problem that I've had.

Added the Gloabl 'filecol_url'
------------------------------------------------------

sub {
my ($col, $id) = @_;
my $finfo = $DB->table('Links')->file_info($col, $id);
return $finfo->File_URL if $finfo;
}

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

Then added the relevant code to the link.html & detailed.html templates:

<img src="<%filecol_url('Imagesmall', $ID)%>" alt="<%Title%> <%bbtype%> <%Address%>: <%Category%>" align="left" hspace="5" />

<img src="<%filecol_url('Image', $ID)%>" alt="<%Title%> <%bbtype%> <%Address%>: <%Category%>" align="left" hspace="10" />

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


Added 2 fields for images in the Links table: Image & Imagesmall

Links Table 'Image' properties (also used same settings for Imagesmall)

Column Name: Image
Column Type: VARCHAR
Column Size: 255
Form Type: FILE
File Save Location: /homepages/39/d216654623/htdocs/breakfastcom/bedandbreakfast
File Save Method: HASHED
Form Regex: (?i)^(?:|[\w-\. ]+\.(?:jpg|jpeg|jpe|gif|png))$

-------------------------------------------
I was able to upload the images, which were being stored in the designated 'File Save Location'

But when the 'link' and detailed pages were viewed, the 'image was missing'

Right click on where the missing image should have been showed a different url (different to the expected path)
----------------------------

Link ID 1 & 2

Image
Imagesmall

missing image (image file url properties)
http://www.******************.com/...leap_lodge_small.JPG
path: /breakfastcom/bedandbreakfast/2/2-byards_leap_lodge_small.JPG

http://www.******************.com/...yards_leap_lodge.JPG
path: /breakfastcom/bedandbreakfast/1/1-byards_leap_lodge.JPG
---------------------------

One point to notice is that I had the 'paths & url's' set to:

http://www.**************.com/list/

After checking all settings, the only way that I found to make this work was I changing the 'paths & url's' to www.**************.com and changing

File Save Location: /homepages/39/d216654623/htdocs/breakfastcom

Any ideas as what went 'wrong' also at present the images are being stored in folders named '0' to '9' at the root of the domain

Is this OK

What is / was the problem?

Any advice appreciated.

Thanks
Colin Thompson
Quote Reply
Re: [colintho] HOWTO: Using File Columns In reply to
Hi,

Mmm.. I'm not sure - but I do think you need to set your "file save URL" for the field (not just the "path")

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] HOWTO: Using File Columns In reply to
Andy

before I go and make a blunder!!

if I now set the "File Save URL" and "File Save Path" to use the folder that I originally wanted to use:

Path = /homepages/39/d216654623/htdocs/breakfastcom/bedandbreakfast

Url = http://www.*************.com/bedandbreakfast

Will I then need to 'move' the image files that are currently located at:

/homepages/39/d216654623/htdocs/breakfastcom/1
/homepages/39/d216654623/htdocs/breakfastcom/2
/homepages/39/d216654623/htdocs/breakfastcom//3 etc

Thanks.
Colin Thompson
Quote Reply
Re: [colintho] HOWTO: Using File Columns In reply to
Hi,

Its not quite as simple as just "moving" the images.

You need to update your glinks_Links_Files table, as the "paths" in there will be wrong otherwise (they will still be linking to the old place)

How many images do you have already? If its only a few, then the easiest way is to just re-upload them with the new settings - otherwise there is a more long winded way to do it, if you have hundreds of images.

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] HOWTO: Using File Columns In reply to
Andy

at present there are only 24 listings, each with Image & Imagesmall, so I guess that I should get this sorted asap.

Also, I'm hoping to use the Thumbnail Imame GD plugin, will this have any effect on this?

thanks.
Colin Thompson
Quote Reply
Re: [colintho] HOWTO: Using File Columns In reply to
Hi,

Yeah, definatly better to get sorted sooner rather than later :)

If you get the GD plugin, I don't mind helping you get it all working (without having to re-do all the images)

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] HOWTO: Using File Columns In reply to
Andy

you're a star.

Really appreciate your help.

regards

Colin
Colin Thompson
Quote Reply
Re: [Andy] HOWTO: Using File Columns In reply to
Andy wrote:
Hi, The attachment is there :) Here's a direct link to it. http://www.gossamer-threads.com/...ment;postatt_id=2060 Hope that helps. Cheers

Script functions well, however when I want to Delete an image appears an error: Logomarca cannot contain the value "


Quote:
<div class="row clear">
<label for="Logomarca" class="name">Logomarca:</label>
<div class="value wrappedtext">
<%~if page_id eq add%>
<input type="file" id="Logomarca" name="Logomarca" class="file" />
<%~else%>
<%~if Logomarca%>
<input type="radio" id="Logomarca_del_2" name="Logomarca_del" value="0" checked="checked" /> <label for="Logomarca_del_2"><%Logomarca%></label>
<%~endif%>
<div>
<%~if Logomarca%>
<input type="radio" id="Logomarca_del_0" name="Logomarca_del" value="1" /> <label for="Logomarca_del_0">Delete</label>
<input type="radio" id="Logomarca_del_1" name="Logomarca_del" value="0" /> <label for="Logomarca_del_1">Replace <input type="file" id="Logomarca" name="Logomarca" class="file" /></label>
<%~else%>
<input type="file" id="Logomarca" name="Logomarca" class="file" />
<%~endif%>
</div>
<%~endif%>
</div>
</div>
Quote Reply
Re: [colintho] HOWTO: Using File Columns In reply to
Quote:
Added 2 fields for images in the Links table: Image & Imagesmall

Links Table 'Image' properties (also used same settings for Imagesmall)

Column Name: Image
Column Type: VARCHAR
Column Size: 255
Form Type: FILE
File Save Location: /homepages/39/d216654623/htdocs/breakfastcom/bedandbreakfast
File Save Method: HASHED
Form Regex: (?i)^(?:|[\w-\. ]+\.(?:jpg|jpeg|jpe|gif|png))$

Quote:
# Allow no file to be attached or an image of type jpeg, gif, or png
(?i)^(?:|[\w-\. ]+\.(?:jpg|jpeg|jpe|gif|png))$
# A pdf must be attached
(?i)^[\w-\. ]+\.pdf$


USE:
(?i)^([\w-\. ]+\.(?:jpg|jpeg|jpe|gif|png))$
Quote Reply
Re: [Janio] HOWTO: Using File Columns In reply to
I'm assuming this means you managed to work it out?

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] HOWTO: Using File Columns In reply to
Yes, to work replace REGEXP
to: (?i)^([\w-\. ]+\.(?:jpg|jpeg|jpe|gif|png))$
Quote Reply
Re: [Janio] HOWTO: Using File Columns In reply to
Ok cool Cool

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: [Janio] HOWTO: Using File Columns In reply to
Andy some idea of as to resolve the problem of Delete in post #37?
Quote Reply
Re: [Andy] HOWTO: Using File Columns In reply to
Everything functions perfectly, only appears error when goes to delete the image using delete button in update form.
> >