Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Links sorting

Quote Reply
Links sorting
I want setup priority listing on category (at the top)for some links (colums)
How I can setup ???
Thanks in advance


Thanks in Advance
Bye From Italy
Quote Reply
Re: [fabio] Links sorting In reply to
Hi Fabio

What you need to do is:
Setup a new column in links >
Go to Admin - Database - and select Links - Properties - Add Column
Column Name > Priority
Column Type > Char
Not Null > No
Form Type > Select
Size > 1
Form Names > Yes
Form Values > Yes

Make sure you Resync the database after the new column is added.

This select option will automatically come up on your admin add link form but not the user admin form.

Go to admin and modify the links you want as priority by selecting "Yes"
Default should be blank.

Make up a new links template and call it something like link_priority.html, format this to how you want the priority link to be displayed.
Upload it to your local directory with the changed category template.

Then in your category template replace <%links%> with :
<%if Priority eq 'Yes'%>
<%include link_priority.html%>
<%else%>
<%include link.html%>
<%endif%>

Then go to Admin - Setup - Build Options and set the build_sort_order_category to Priority DESC,score etc.
Then the Priority links should come up first.
You can do the same for search etc with the same mod in the search results template.

And you should be good to go.

If you want several type priority listing set up form names to 1,2,3 and form values to Priority1, Priority2 etc.
You can then select the order in which to display the Priority links.

If you do a search on on this forum for Premium, Priority and IsPriority it will give you everything you need to know to fine tune it.


Regards

minesite
Quote Reply
Re: [minesite] Links sorting In reply to
thanks minesite ,
I've already a column in links database
it have a column name links_type
on this column I've setup this Form Values:
1
2
3

How I can sort on the category and search listing first the form values 1 ???
How I must setup : build_sort_order_search and build_sort_order_category ??? so the links with value 1 have prioryty listing over all ???

Thanks


Thanks in Advance
Bye From Italy
Quote Reply
Re: [fabio] Links sorting In reply to
links_type ASC, Other fields ...

Last edited by:

Payooo: Mar 12, 2004, 7:01 AM
Quote Reply
Re: [Payooo] Links sorting In reply to
ok I've tryied but the link_tipe value 1 it's not placed at the top of category, other suggest?


Thanks in Advance
Bye From Italy
Quote Reply
Re: [fabio] Links sorting In reply to
  
Does it work on the search results?

Last edited by:

Payooo: Mar 12, 2004, 7:15 AM
Quote Reply
Re: [fabio] Links sorting In reply to
Just put in links_type ASC, other not links_type1 ASC, other.

If you can post the setup here and we can have a look at it.

Regards

minesite
Quote Reply
Re: [fabio] Links sorting In reply to
You've modified the links you want to display first ?
and tried viewing them viewing them via dynamic mode ?

Regards

minesite
Quote Reply
Re: [minesite] Links sorting In reply to
On Search Options I've setup
build_sort_order_search : Links_type ASC, Add_Date DESC
but It do not lising on the top of search page


Thanks in Advance
Bye From Italy
Quote Reply
Re: [fabio] Links sorting In reply to
Fabio

If you can post the details here we can have another look.
Were do the priority links show up ? Bottom, Top any where ?
Just go back and double check that you have every thing in place, its usually a typo or something that throws it out.

PS: Love the ponytail, not sure about the teethShocked.

Regards

minesite
Quote Reply
Re: [minesite] Links sorting In reply to
ok,
this is my links database dump:
CREATE TABLE Links (
ID int(10) unsigned NOT NULL auto_increment,
Title varchar(100) NOT NULL default '',
LinkOwner varchar(50) NOT NULL default 'admin',
Add_Date date NOT NULL default '0000-00-00',
Mod_Date date NOT NULL default '0000-00-00',
Description text,
Hits int(11) NOT NULL default '0',
isNew enum('No','Yes') NOT NULL default 'No',
isChanged enum('No','Yes') NOT NULL default 'No',
isPopular enum('No','Yes') NOT NULL default 'No',
isValidated enum('No','Yes') NOT NULL default 'Yes',
Rating float(12,2) NOT NULL default '0.00',
Votes smallint(5) unsigned NOT NULL default '0',
Status smallint(6) NOT NULL default '0',
Date_Checked datetime default '0000-00-00 00:00:00',
Timestmp timestamp(14) NOT NULL,
URL varchar(255) NOT NULL default 'http://',
Contact_Name varchar(255) default NULL,
Contact_Email varchar(255) default NULL,
Icon varchar(255) default NULL,
SendLinkOwner int(11) default '0',
Recommended int(11) default NULL,
Link_Status int(11) default '0',
Detailed_Hits int(11) default '0',
AlertMessage varchar(255) default 'NotSent',
Expired_Flag varchar(255) default '0',
Links_type varchar(255) default NULL,
Logo varchar(255) default NULL,
link_has_attachments tinyint(4) default '0',
Top_Order int(11) default '0',
Hits_Bak int(11) default '0',
Screenshot varchar(255) default '',
PRIMARY KEY (ID),
KEY userndx (LinkOwner),
KEY popndx (isPopular),
KEY stndx (Status),
KEY newndx (isNew),
KEY valndx (isValidated),
KEY URL_idx (URL)
) TYPE=MyISAM;

The Links_type column have 3 values for every link:
value_1
value_2
value_3

On the search page and category page how I can set all links with value_1 at the top ?????
what I must change on build_sort_order_search and on build_sort_order_category ??
Have Understand ???

Thanks


Thanks in Advance
Bye From Italy
Quote Reply
Re: [fabio] Links sorting In reply to
"Have Understand ???"

I think so.

Not sure why its not working, I see you have linkType set to value_1 etc but do you have
Form Names set to 1,2 and 3 ?.
This is what the database sorts on, not the Form Values.
Not Null should be No.
Default should be blank.

Regards

minesite
Quote Reply
Re: Setting up Priority Links In reply to
I'm trying my hand at setting up a priority field, but there are many more fields on the form that you indicate. How do I answer these other ones:

Links: Table Editor
Links: Table Editor

Add a New Field to Links
For information on what each column means, click here
Database Information Column Name Column Type INTCHARTEXTDATEENUM Column Index NoneRegularUniquePrimary Key Column Size
(Only for CHAR types)
Column Values
(Only for ENUM types)
Not Null Yes No Default Form Information Form Display Form Type HIDDEN SELECT MULTI-SELECT CHECKBOX RADIO TEXT TEXTAREA PASSWORD FILE Form Size Form Names
(Stored in Database)
Only for checkbox, multi-select or radio forms.
Yes Form Values
(Displayed on Form)
Only for checkbox, multi-select or radio forms.
Yes File Save Location
(Only for FILE types. Stored on disk)
File Save URL
(Only for FILE types)
File Save Method
(Only for FILE types)
HASHED SIMPLE File Maximum Size
(Only for FILE types.)
Form Regex Search Weight

~~~~~~~~~~~~~~~~~~~~~~~~~~~
Shannon Anderson
Babies Online.com

Last edited by:

BabiesOnline: Aug 4, 2004, 12:05 PM
Quote Reply
Re: [BabiesOnline] Setting up Priority Links In reply to
Detailed instructions for creating a column.

http://www.gossamer-threads.com/scripts/resources/Links_SQL/FAQ/Version_2_x/index.html

Regards

minesite