Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Detailed pages and image upload questions

Quote Reply
Detailed pages and image upload questions
Hello,

Okay, I just got the linksSQL installed today, and have a few questions. It is an awesome program and I am very impressed so far.

1. Detailed pages won't work. Even though the detailed selection is checked in the admin options, it wants to go straight to the link instead of the detailed page. Is there something else I need to change? Tags to add?

2. Image Upload- I added a new table column for image upload. The images will upload to the server fine, but I haven't added any tags to other pages. What tags need to be added on what pages? I can't see if this is working because there are no detailed pages, but I do know I haven't added tags to any of the pages yet.

thanks in advance, chris
Quote Reply
Re: [Chris1] Detailed pages and image upload questions In reply to
I did do what it said though, and insterted the <%build_detail_url%> tag in the detailed.html file, but still no go. I got a HUGE feeling I am leaving something out here :)
Quote Reply
Re: [Chris1] Detailed pages and image upload questions In reply to
Hi,

1. If when viewing a list of links, you want the link to go to the detailed page, rather then the actual URL, you need to edit link.html and change:

href="<%db_cgi_url%>/jump.cgi?ID=<%ID%>"

to:

href="<%detailed_url%>"

Make sure to rebuild the pages after doing this.

2. To display the images, you need to put:

<img src="<%db_cgi_url%>/jump.cgi?view=COLUMN&ID=<%ID%>">

where COLUMN = the name of the column you added.

Hope this helps,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Detailed pages and image upload questions In reply to
Hi Alex,

Yes, that helps. I am getting somewhere now....I now have detailed pages, but the images are not showing up. The path is incorrect on the image source. The image source is: domain.com/cgi-bin/jump.cgi?view=Images1&ID=1

Thanks for your time, chris
Quote Reply
Re: [Chris1] Detailed pages and image upload questions In reply to
Hi,

Try putting that URL into the browser and see what happens. It should display an image, but if it prints an error, let me know what it says.

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Detailed pages and image upload questions In reply to
Thanks again Alex...

It says:

Oops, we had the following problem:
Unknown File requested.
Quote Reply
Re: [Alex] Detailed pages and image upload questions In reply to
Hi.

In Reply To:
2. To display the images, you need to put:
<img src="<%db_cgi_url%>/jump.cgi?view=COLUMN&ID=<%ID%>">

Yeah, it's worked, but can i change this url to static in templates?

(somthing like http://path.to/images/<%img_id%>)

MySQL is very slow in my server, and i think, this would be faster...

Quote Reply
Re: [Alex] Detailed pages and image upload questions In reply to
yeah, I'd be interested in NOT pulling the images dynamically, too.
Quote Reply
Re: [Spawn] Detailed pages and image upload questions In reply to
Hi,

Currently no, not easily. We will add a tag for this in the next update.

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Detailed pages and image upload questions In reply to
Is there a way now to get a static link to an image file that has been uploaded to the database?
Quote Reply
Re: [JonathanKincaid] Detailed pages and image upload questions In reply to
Hi,

Try this =)

<%global_name($ID,'FieldName','Table')%> (last part is optional)

Code:
sub {
# -------------------------------------------------------------------
# Call with <%global_name($ID,'FieldName')%>
# NOTE: This is for the CATEGORY images...

my ($ID,$field,$table) = @_;

$table ||= 'Links';

# make sure a fieldname and ID are provided...
if (!$ID || !$field) { return "You need to define the ID and fieldname."; }

# get the actual path to where the file is/will be saved...
my $schema = $DB->table($table)->cols;
my $path = $schema->{$field}->{'file_save_url'};
$path =~ s,/$,,; # get rid of trailing / at end of $path

my $image_details = $DB->table($table."_Files")->select( { ForeignColName => $field, ForeignColKey => $ID } )->fetchrow_hashref;

my $id = $image_details->{ID};
my $filename = $image_details->{File_Name};
my $file_url = $image_details->{File_URL}; # this is only the URL/folder

my @cut = split //, $id;
my $folderid = $cut[$#cut];

my $url = "$file_url/$folderid/$id-$filename";


$url =~ s|([^\/]+)$|GT::CGI->escape( $1 )|e;

return $url;

}

Hope that helps.

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!