Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Possible BUG with Flags (Update, Popular, New)

Quote Reply
Possible BUG with Flags (Update, Popular, New)
I am having problems with Flags in dynamic mode (Update, Popular, New)... When doing a modify, all flags are displayed even when they are set to "No" in the database... For my link.html, I have:

Code:
<%if isNew%>
&nbsp;<small><sup class="new">new</sup></small>
<%endif%>

<%if isChanged%>
&nbsp;<small><sup class="new">update</sup></small>
<%endif%>

<%if isPopular%>
&nbsp;<small><sup class="pop">pop</sup></small>
<%endif%>

Flags are NEVER displayed on subcategories... For my subcategory.html, I have:

Code:
<%if Has_New_Links eq 'Yes'%><small><sup class="new">new</sup></small><%endif%>

<%if Has_Changed_Links eq 'Yes'%><small><sup class="new">update</sup></small><%endif%>

For subcategories, if I put "eq 'Yes'" in the if statement, the flag is never displayed, yet if I take it away, it is always displayed.
For links, it works everywhere except for when doing a modify, and all flags are displayed (even when set to "No" in the database). If I changed the code to add "eq 'Yes'", the flags are never displayed anywhere.

This is a strange problem, and is a little hard to explain. I hope my explanation is clear enough to understand.

Sean
Quote Reply
Re: [SeanP] Possible BUG with Flags (Update, Popular, New) In reply to
Are you using the standard links?

You might want to add <%GT::Template::dump%> to the end of your link.html file and check to see what values are in isPopular, etc. Is it "Yes" or "1"

If you are not going through the standard Site_HTML_display('link') format, then your fields contain either 'Yes' or 'No', which on a simple "if" test, will always be true -- both cases.

You need to make sure the values are 1/0.

You could probably cover both eventualities, <%if isPopular eq 'Yes' or isPopular == 1%>

Also, if you are running in pure dynamic mode, you need to "repair" tables on a daily basis to update all the flags the way "build" would do on a static database.


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] Possible BUG with Flags (Update, Popular, New) In reply to
You da man! That got it working for me... Thanks!

Sean

Last edited by:

SeanP: Mar 18, 2002, 5:11 PM
Quote Reply
Re: [pugdog] Possible BUG with Flags (Update, Popular, New) In reply to
How does the repair/build determine which links are changed, popular, new? Is it by the timestamp and the hits? I have recently imported the Computers category of the DMOZ rdf. I have my cool links set to display the top 20. When running a repair/rebuild, it flags the first 20 in the database as popular even though they don't have any hits, votes, etc. Is this normal? I guess I don't understand how it works...

Sean
Quote Reply
Re: [SeanP] Possible BUG with Flags (Update, Popular, New) In reply to
Well, that's a quirk, I guess.

What happens when you set the build_pop_cutoff to '0' and repair the tables to reset the flags?


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] Possible BUG with Flags (Update, Popular, New) In reply to
Strange...
I get the first link in the database (http://www.attrition.org) flaged as popular.

Sean
Quote Reply
Re: [SeanP] Possible BUG with Flags (Update, Popular, New) In reply to
Hi,

Quote:
How does the repair/build determine which links are changed, popular, new?


New is determined if Add_Date is > Today - New Cutoff. Changed is determined if Mod_Date is > Today - New Cutoff.

Popular is determined in one of two ways:

1. Get the top N links ordered by Hits descending, and mark all of them as popular.

2. Get the top N percent of links ordered by Hits descending, and mark all of them as popular.

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Possible BUG with Flags (Update, Popular, New) In reply to
Alex,

It's a quirk -- it needs a "test" to make sure the link has actually received a vote and/or the rating is not '0'.


Otherwise, it yanks the first "x" links or "x%" of links, or if you set it to '0', it yanks the first link only.

Not much help on new directories.


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.

Last edited by:

pugdog: Mar 20, 2002, 11:37 PM