Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Search Global - exclude link if field has a specific value

Quote Reply
Search Global - exclude link if field has a specific value
Hi,

Can anyone tell me how I would go about excluding a link from the search results if the field 'Public' eq 'No'?

I assume I would need a global but sadly I am no good with PERL.

Many Thanks



Indigo Clothing is a t-shirt printing company based in the UK.
Indigo Clothing | Promotional Clothing | T-Shirt Printing | Embroidery

Last edited by:

IndigoClothing: Oct 26, 2008, 3:20 AM
Quote Reply
Re: [IndigoClothing] Search Global - exclude link if field has a specific value In reply to
Hi,

you really have 2 options.

1) Just to put a "wrapper" around the link.html template. For example:

Code:
<%if Public eq "Yes"%>
...show link as normal
<%endif%>

However, this will give you odd numbers on the page counts (as all its doing it not showing the link, even though its counter)

2) Really, you need something in search.cgi - i.e:

search.cgi?query=xxxx;Public=Yes

That would probably be the best solution :) (just add that extra field as a "hidden" field in the <form section Smile)

Hope that helps.

Cheers

Andy (mod)
andy@ultranerds.co.uk


IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
Quote Reply
Re: [Andy] Search Global - exclude link if field has a specific value In reply to
Thanks Andy - for a number of reasons too long to go into I don't want to use option 1.

Option 2 works but all a user has to do is edit the string in the URL and they can see the hidden items so it isn't the ideal solution...



Indigo Clothing is a t-shirt printing company based in the UK.
Indigo Clothing | Promotional Clothing | T-Shirt Printing | Embroidery
Quote Reply
Re: [IndigoClothing] Search Global - exclude link if field has a specific value In reply to
Hi,

Ok well, the other option is to just edit search.cgi, so that paramater is always passed in :)

In search.cgi, find:

Code:
Links::init_user();

..and add this just below it:

Code:
$IN->param( 'Public' => 'Yes' );

...that should do the trick :)

Cheers

Andy (mod)
andy@ultranerds.co.uk


IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
Quote Reply
Re: [Andy] Search Global - exclude link if field has a specific value In reply to
Thanks Andy - appreciate the help - internal server error 500 though when I do that.



Indigo Clothing is a t-shirt printing company based in the UK.
Indigo Clothing | Promotional Clothing | T-Shirt Printing | Embroidery
Quote Reply
Re: [IndigoClothing] Search Global - exclude link if field has a specific value In reply to
Hi,

Sorry, my mistake. Please change:

Code:
use Links qw/$PLG/;

..to:

Code:
use Links qw/$PLG $IN/;

Hopefully that'll sort it =)

Cheers

Andy (mod)
andy@ultranerds.co.uk


IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
Quote Reply
Re: [Andy] Search Global - exclude link if field has a specific value In reply to
Thanks Andy - that did the trick!



Indigo Clothing is a t-shirt printing company based in the UK.
Indigo Clothing | Promotional Clothing | T-Shirt Printing | Embroidery