Gossamer Forum
Quote Reply
Priority Links
Has any one thought about making priority Links a plugin? I have only started the plugin editor. I really have no idea how to make a plugin. I am sure just like everything else it is real easy if you understand.

Any help would be appreciated.

Dan Oakeson
http://www.AssociateCash.com
Quote Reply
Re: Priority Links In reply to
Priority links is so easy to make, it doesn't even need to be made a plug in.

Just wack a new column in the links table called priority that is an integer one.

Then sort by priority in the SQL query. I don't have a version of Links SQL 2.0 installed so I can't post better instructions, but what I have said would be easy to do even if you don't know Perl. Just read some tutorials and figure it out. Better in the long run.

Discuss webhosting at
The Webhost Area Forums!
http://www.webhostarea.com/forums/
Quote Reply
Re: Priority Links In reply to
I think, you should do something like this:

Make a new field in the links table Priority,
for example something like this:

Priority => { pos => 18, type => 'INT', 'default' => '0', 'form_type' => 'TEXT', 'form_size' => '5'},


and then go to globals and add something like this:

sub {
my $vals = shift;
my $link_db = $DB->table ('Links');
$link_db->select_options ('ORDER BY Priority DESC', 'LIMIT 10');
my $sth = $link_db->select;
my $output = '';
while (my $link = $sth->fetchrow_hashref) {
$output .= Links::SiteHTML::display('link', $link);
}
return $output;
}

and call this priority

I think this should work.
(you can change DESC in ASC if you wish to sort ascending)

And you can add <%priority%> in your templates
Quote Reply
Re: Priority Links In reply to
In Reply To:
Priority => { pos => 18, type => 'INT', 'default' => '0', 'form_type' => 'TEXT', 'form_size' => '5'},
Shouldn't you have the Priority field as a SELECT field not TEXT.

Paul Wilson.
new - http://www.wiredon.net
Quote Reply
Re: Priority Links In reply to
Thank You everyone for your rapid response. I had priority links installed on 1.13 . I overlooked resetting the sort order. Once I reset the sort order it work just as it did before.Blush

Thank You again. Smile

Dan Oakeson
http://www.AssociateCash.com