Gossamer Forum
Home : Products : Links 2.0 : Customization :

MOD for Links

Quote Reply
MOD for Links
I had a thought of a new MOD for Links 1.1, but I didnt know how to do it. I don't think it would be that hard. All I want is someone to write a CGI script where when you supply it with an ID number, it will list all of the information in the database about that ID in a nice design. I know someone can do this and I would appreciate it if you would try. Thank you,

------------------
Quote Reply
Re: MOD for Links In reply to
How about:

#!/usr/local/bin/perl

require "links.cfg";
require "$db_lib_path/db.pl";

&html_print_headers;

my %in = &parse_form;
my %link = &get_record ($in{$db_key});

if (%link) {
print qq|

print your link information here!

|;
}
else {

print qq|
no link found!
|;
}


That should work (not tested though).

Cheers,

Alex
Quote Reply
Re: MOD for Links In reply to
I'm not sure how this works.

Under:
print qq|

print your link information here!

|;

What should put for the link info? What format? Should it be like $rec{Title} ?

And second, how would you call and ID? Say I called he script info, would it be info.cgi?ID=23

?

Thanks,

Nicholas Clark

------------------
Quote Reply
Re: MOD for Links In reply to
Alex,

I got it to where I no longer get a 500 error, but the $rec{'Title'} and all of those commands will not work. nothing shows up. Any ideas?

------------------
Quote Reply
Re: MOD for Links In reply to
 
Quote:
my %link = &get_record ($in{$db_key});

I got tricky and stored the link in %link instead of %rec. Try $link{'Title'}, or change the above line to say my %rec = ..

And you are right about the rest, call the script info.cgi?ID=123

Hope that helps,

Alex
Quote Reply
Re: MOD for Links In reply to
Thanks Alex. Works great!

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