Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-01-01 01:48:04

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

ras_author_list

Download: ras_author_list_v4.2.1

[ updated to 4.2.1 on 20/Oct/2009 ]

ras_author_list returns an href list of author links for initiating a search by author.

Authors are defined as all listed users for the site. TXP’s standard list attributes are supported including section and this_section, also a type attribute is available to discriminate amongst user privileges.
The type attribute’s options must match exactly the available choices as displayed in TXP’s user list options, as follows:

* Publisher (1) * Managing Editor (2) * Copy Editor (3) * Staff writer (4) * Freelancer (5) * Designer (6)

Also integer values matching these or custom values can currently be from 0 thru 9.

The type attribute will accept individual types or integers or a comma delimited list of either or both.

Any feedback would, of course, be welcome.

Much with this tag has been patterned after TXP’s category and section list tags with the same intended functionality, an example of that usage might go this way:

<txp:ras_author_list wraptag="ul" break="li">
        <txp:if_author name='<txp:ras_user />'> -> </txp:if_author>
		<txp:ras_if_first_author>Authors:<br /></txp:ras_if_first_author>
	<txp:ras_author link="1" />
		<txp:ras_if_last_author>End of List.</txp:ras_if_last_author>
	<txp:if_author name='<txp:ras_user />'>
	<txp:article_custom author='<txp:ras_user />' wraptag="ul" break="li">
		<txp:if_article_id>›</txp:if_article_id>
		<txp:permlink><txp:title /></txp:permlink>
	</txp:article_custom>
        </txp:if_author>
</txp:ras_author_list>

Last edited by rsilletti (2009-10-20 16:23:53)

Offline

#2 2009-01-01 11:11:38

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,279
Website GitHub

Re: ras_author_list

Nice idea for magazine-style multi-publisher sites! To date I’ve been doing this kind of thing manually, or with bos_author, so to have a plugin for it is gonna be very handy.

I’ve not tried the plugin yet (hopefully I’ll get a chance later this week) but I’d say yes the option to list roles as both names and numeric entities would be a welcome addition (given that I believe there are plugins out there that allow you to make your own levels).

I assume ras_author is like <txp:author >/ and ras_user outputs the login name instead of the real name? Or vice versa? Is it possible to use the built-in tags/conditionals instead of your versions, or do you not populate the global array for each author?

Oh, and should the plugin be named ras_author_list — in the singular — to fit with section_list, category_list, etc?

Top work. I’ll shout when I’ve had a chance to play with it.

Happy New Year to you and yours.

Last edited by Bloke (2009-01-01 11:12:02)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#3 2009-01-02 01:33:27

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

Re: ras_author_list

Thanks for the feedback Bloke,

I used authors_list because author_list already existed inside TXP, it would work without a problem given the prefix but I don’t use them when I’m writing the initial drafts. I’ll change that if only to provide some relief from the odd grammatical sense, now that it has been pointed out to me it seems to glare a little.

ras_author is populating a global called $thisauthor recursively, as does ras_user, and it will substitute for author being an altered clone thereof but not vice versa, and yes the need for ras_user arose from the need for the login name as an attribute.

The idea for multi author magazine sites having a need here was suggested by Mary when I first started toying with the idea, it does seem to lend itself to good purpose there.

Privs will always have a discreet number assigned to them that can be handed directly to the database query which may make better sense, it’s the logic for multiple privs selection from the attribute list that I haven’t looked at carefully yet – food for thought though.

Download: ras_author_list_v4.2.1

Not so complex as I thought, the updated tag will now take the default atts as described above or numerical representations from 0 to 9 – mix and match – text, numeric, or both.

Last edited by rsilletti (2009-10-20 16:26:10)

Offline

#4 2009-10-20 14:35:21

jens31
Plugin Author
From: munich / dtschermani
Registered: 2008-08-25
Posts: 183
Website

Re: ras_author_list

hi

nice plug-in, works fine for me.
but i got one little problem: i cant list authors with no rights.
i still want to link to those “ex-” authors. its a project for a school class. each semester the authors are changing
and i dont want “the old ones” to have access anymore, but still want to keep them in the list. cause they still do have articles.
it seems like the plug-in cant understand the type=“None” value (or call it 0,7,8,9…).
is it possible to insert this function? would donate 10pounds if you get this running for me ;)

Offline

#5 2009-10-20 16:20:44

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

Re: ras_author_list

jens31 As the code would have it, users without privs are written into the database as a “0”, it just hadn’t occured to me to look for it; I have added it so that using a 0 attribute value for “type” will return these users, it was a five minute fix.
Thanks for the tip, it’s possible others may be looking for that as well.
Download ras_author_list_v4.2.1

Last edited by rsilletti (2009-10-20 16:27:09)

Offline

#6 2009-10-20 16:32:35

jens31
Plugin Author
From: munich / dtschermani
Registered: 2008-08-25
Posts: 183
Website

Re: ras_author_list

yay. working fine, thanks a lot for this fast fixx.
like i said: donation is okay. where to put it..?
cheers
jens

Offline

#7 2009-10-20 16:41:08

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

Re: ras_author_list

I think the donate button out here still works, it hasn’t been used in ages. glad it’s working for you. I would be curious to see how you are using it, perhaps a link?

Offline

#8 2009-10-20 16:50:46

jens31
Plugin Author
From: munich / dtschermani
Registered: 2008-08-25
Posts: 183
Website

Re: ras_author_list

actually i cant provide a link right away, cause the whole project is a construction site of its own right now ;)
hope ill get this thing running one day, got some serious problems with linking and listing right now.
its a pain.
but ill let you know, when the system is running again.

Offline

#9 2009-10-20 21:17:40

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

Re: ras_author_list

Thanks, if you have TXP related questions feel free to ask, I’d love to help.

Offline

Board footer

Powered by FluxBB