Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2011-06-05 20:56:05

pompilos
Member
From: Spain
Registered: 2005-06-07
Posts: 114
Website

A list of authors sorted by publishing frequency

Hello.

I manage a site with many authors, articles and files. I would like to show, in the credits page, a list of contributors with these features:

  1. Only authors who have published any article or file. If they haven’t, they wouldn’t be listed. It would be nice the choice between only articles, only files or both articles and files. Something like …items="0"… (both articles and files), …items="1" (articles), …items="2" (files)
  2. In order to satisfy human vanity, the list has to be sorted by number of articles and/or files each author has published.
  3. After the author’s name, may appear between brackets the number of articles and/or files published by him. Again a choice: account="0" (no), account="1" (yes).
  4. Although it isn’t neccesary at the moment, it would be nice to choose whether to make a link to the page of the author or not.

As I am not a magician of the code at all, could yo give me some ideas? Thanks in advance.

Last edited by pompilos (2011-06-14 21:37:09)

Offline

#2 2011-06-06 02:16:01

rsilletti
Moderator
From: Spokane WA
Registered: 2004-04-28
Posts: 704

Re: A list of authors sorted by publishing frequency

I’ve written something that comes pretty close to being what you need here: ras_authors_list .

To adapt it to your needs is fairly straight forward if you write code, if not, perhaps someone on the forum might help. I’m very tight on time at present, but if no one else comes forward I’ll do what I can as I can.

The plugin is available here: ras_authors_list

As clear a specification as possible will help.

Last edited by rsilletti (2011-06-06 06:14:50)

Offline

#3 2011-06-06 15:44:18

pompilos
Member
From: Spain
Registered: 2005-06-07
Posts: 114
Website

Re: A list of authors sorted by publishing frequency

Hello, Rick.

I found your plugin and tested it before posting my question. But, as much as I can understand, ras_authors_list includes ALL the people that are listed as authors in the admin interface, without considering if they haven’t posted any article or file or not. For my purposes, it lacks also the 2# and 3# features listed below, and I wolud like to not include a link to the authors pages.

I would appreciate very much your help, if you finally have the time, and your plugin would increase its usefulness. At the meanwhile, I’ll use it with a little hack (without links to the authors pages) as you can see here.

Thank you.

Last edited by pompilos (2011-06-06 16:01:05)

Offline

#4 2011-06-06 19:00:15

rsilletti
Moderator
From: Spokane WA
Registered: 2004-04-28
Posts: 704

Re: A list of authors sorted by publishing frequency

I believe I can see what you are aiming at, and it will take some time to sort out something that will behave that way. I will do what I can as time permits.

Offline

#5 2011-06-06 19:54:09

Els
Admin
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: A list of authors sorted by publishing frequency

Hi José, I think you can achieve nrs 1, 3 and 4 with Rick’s plugin and rah_function (for the counting) and probably some variable/if_variable tags.
The only problem would be the sorting, because the number of articles would need to be stored in the database to allow Txp to use it as a sort order. But you might be able to solve that using a client-side jQuery table sort plugin (and then disable the client-side sort options). Looks to me like this could be doable.

I wouldn’t mind giving it a go, but not if Rick is rewriting his plugin for you in the meantime ;)

Offline

#6 2011-06-06 20:57:35

pompilos
Member
From: Spain
Registered: 2005-06-07
Posts: 114
Website

Re: A list of authors sorted by publishing frequency

Hi, Rick and Els. I am impressed by your kind attention.

Although I am actually a teacher of Ancient Greek, programming languages as JQuery, PHP and even some variable tags of Textpattern, sound Greek to me. So I better will wait if Rick has the chance to improve his plugin. Thanks again!

Offline

#7 2011-06-07 05:25:57

rsilletti
Moderator
From: Spokane WA
Registered: 2004-04-28
Posts: 704

Re: A list of authors sorted by publishing frequency

The inability to not link in the self closing tag is something that I didn’t notice originally, that’s fixed. The counts are easy enough, and I’ve already coded those and the filter for displaying only active posters. So far I think I have preserved count integrity for both if_first and if_last tags, those recursions are counted internally and tag counting functions that can’t see that count may not behave as expected on that basis – I am unsure of this. That leaves vanity issues (priority by post count), I’m assuming this will be on an article count basis only; and the differences between self closing and wraptag processing. This is something that I am doing, and it may not take as much time as I originally thought, but it is complex and will take some vigorous testing before it will be considered reliable enough to release in the the wild. If you don’t mind I would like to keep it inside tight testing availability until I am sure anything glaring or disruptive as been resolved. This would require that I email the completed plugin code to whoever would care to test it rather than place a public link here for now. Anyone is welcome to test if they would like, just let me know in this thread.

Offline

#8 2011-06-07 08:15:13

pompilos
Member
From: Spain
Registered: 2005-06-07
Posts: 114
Website

Re: A list of authors sorted by publishing frequency

Hi, Rick. Obviously I am glad to be your first beta tester. My email is here, in my profile.

Last edited by pompilos (2011-06-07 08:15:36)

Offline

#9 2011-06-19 03:28:02

rsilletti
Moderator
From: Spokane WA
Registered: 2004-04-28
Posts: 704

Re: A list of authors sorted by publishing frequency

ras_author_credits | Download: ras_author_credits_v1.0 | Source Code .

More than just an improved ras_author_list tag.

It is a better plugin in all respects with the exception of if_first_author and if_last_author functionality, which went by the wayside in favor of two deep sorting of the returned list of authors and stats.

The new plugin adds new attributes called active_only, which toggles filtering, select_by which restricts the returned list to a complex criteria set against an author’s activity in terms of contribution on a site, and rank_by which sorts, to two levels, numerical ranking of author’s contributions by media type.

@pompilos Unlike version 4.4.09 , this plugin cannot be be run concurrently with ras_author_list. It will, however, replace Ver 4.4.09 upon installation. Some of the function names have been revised somewhat in the final copy for beta test, so tag names will need to be edited a little. It does have the capability to sort to two levels now, as desired, and the help file is more accurate and readable. Thank you very much for testing and your suggestions for improvements.

Last edited by rsilletti (2011-08-28 21:42:18)

Offline

#10 2011-08-28 18:08:44

laptophobo
Member
Registered: 2010-03-01
Posts: 216
Website

Re: A list of authors sorted by publishing frequency

Rick. Great job with the ras_author_credits. I was in the process of activating your other plugin (ras_author_list) but this one does much more! GREAT WORK!

One thing I have noticed, however, is that even though the author credits will list all of an author’s articles, it will ONLY show the articles that have been set as “On front page” within the Section options.

Is there a work-around for that? I’d like to have non “On front page” Articles to be included in the final results.

And, one more item please—which is more important to me. The results always land on the Home page, which does not work for me. How would I direct that to a Section page of my choosing? (I’ve already tried adding: section=“results” but it didn’t work.)

Last edited by laptophobo (2011-08-28 18:41:53)


Living the Location-Independent Life: www.NuNomad.com

Offline

Board footer

Powered by FluxBB