Gossamer Forum
Quote Reply
editors
Has anybody made an implementation to display the editors in each category linked to their e-mail address (just like dmoz)?

Quote Reply
Re: editors In reply to
I don't think it would be too hard. Of course, you would have to use the dynamic mode via page.cgi to show the editors.

Here is the logic you could use to do this:

1) Within the sub generate_category_page, you would have to use the SELECT function to select the CategoryID from the Editors table and also select the corresponding UserID from the Users table.

2) Then you would have to define a variable for the Editor information, something like $OUT{editorinfo}.

3) Then in your category.html file, add the following tag:

Code:

<%editorinfo%>


Just a matter of hacking (trial and error) the page.cgi script and template file.

Regards,

Eliot Lee

Quote Reply
Re: editors In reply to
Eliot...

Why would it have to be dynamic?

It could be added to the nph-build.cgi file, so that each time a category is built, the editors database is querried right at the time the Links database is queried, and you just put/format the editors into a new variable <%Editors%> to be used in the templates.

This is a really cool idea, and I may implement it! I'm working on a site for someone that wants to make use of editors, so enabling this functionality (by a flag in the Links.pm file) should not be hard. The reason for that, is if you don't want to enable editors, you'll save the cpu cycles, sort of like the Days_Old variables.

Code:
if ($LINKS{enable_editors} {
## do the sql stuff to get the editors
## do the format stuff to create the %OUT{Editors} variable
}
Then, you could put a field in the category record to "enable editors", which would allow you to turn off (or on) this display for specific categories. (There are multiple reasons to want to do this.)

This would work even in the absence of category-specific templates, so that you could put a line in the category.html template:

Code:
<%if enable_editors%>
<%if Editors%>
<%Editors%>
<%endif%>
<%endif%>
Sounds like something I could do in short order....

(Of course with a site with purely category-specific templates, you wouldn't need that, but most sites are _not_ done this way, so for those who were wondering, yes, you could, but the two flags above are probably more portable and widely useful.)




http://www.postcards.com
FAQ: http://www.postcards.com/FAQ/LinkSQL/

Quote Reply
Re: editors In reply to
The reason that I recommended it be hacked for the dynamic mode is that let's say you add an editor before the build process, using the dynamic would ensure that the most current editors are listed. That was my point...accuracy.

Regards,

Eliot Lee