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

Editing build_sort_order_category

Quote Reply
Editing build_sort_order_category
Is there any way, in a Plugin, to automatically add more fields to this field option? At the moment, the user has to manually add the extra fields...but I want to make it easier, and have it automatically add the new sort order Smile

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!
Quote Reply
Re: [Andy] Editing build_sort_order_category In reply to
$CFG->{build_sort_order_category} .= q|, new_field ASC|;
$CFG->save();

Last edited by:

Paul: Sep 17, 2002, 6:23 AM
Quote Reply
Re: [Paul] Editing build_sort_order_category In reply to
Thanks...worked a charm Smile

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!
Quote Reply
Re: [Paul] Editing build_sort_order_category In reply to
Mmmm...now I have a problem. I am trying to sort by;

IsLive DESC, Bid DESC, other fields

However, I DON'T want the 'Bid' to be shown though if IsLive is not set to True (or 1)....anyone know a work around this?

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!
Quote Reply
Re: [Andy] Editing build_sort_order_category In reply to
I think, this would require a condition right in the SQL query in core code.
You could do it with a plugin, by replacing the build_category hook function with a duplicated one in Buld.pm, but I think it would not be the best solution for a such very small change. Pre or Post hook will not help in this situation.
Possible solution would be to write a global to display all links through it, but this would be a waste of resources, since the job would be done twice.

There could be a template solution, using an IF statement in link.html template file, to examine if IsLive is true or false.
<%if IsLive%>
link content here
<%endif%>

If this feature is not urgent, then this will probably help you: I plan to implement a hook within build_category function, to change SQL queries. build_category is a replaced & improved function in my XLD (Xtended Link Display) plugin. So using that new hook from XLD plugin, you would be able to replace or change the SQL query easily.

Hope you got something helpful.

Best regards,
Webmaster33


Paid Support
from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...
Quote Reply
Re: [Andy] Editing build_sort_order_category In reply to
Quote:
Mmmm...now I have a problem. I am trying to sort by;

IsLive DESC, Bid DESC, other fields

However, I DON'T want the 'Bid' to be shown though if IsLive is not set to True (or 1)....anyone know a work around this?


Am I missing something, or wouldn't that just be a template issue?

<%if IsLive%>
Bid: <%Bid%>
<%endif%>


PUGDOG´┐Ż Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] Editing build_sort_order_category In reply to
Its ok...I got another way around it....:) Thanks for the replys though.

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!
Quote Reply
Re: [pugdog] Editing build_sort_order_category In reply to
I suggested the same thing in my previous post.

Best regards,
Webmaster33


Paid Support
from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...