Jump to content

Topic on Extension talk:RecentPages/Flow

Is it possible to make a list of recent added by some author?

2
Fokebox (talkcontribs)

Could you please tell me if it is possible! Thx

Leucosticte (talkcontribs)

It would require that the extension code be modified to implement a new parameter to the tag. The page table doesn't have a field for author (aka user), but the recentchanges table does. People have been complaining for awhile that this extension should use recentchanges instead of page; I considered it but there were some complications that would have been involved. For example, if you were to import stuff, you'd need to rebuild recentchanges to make it work.

I think the easiest way to do what you're talking about, without rewriting that part of the code and having a lot of unintended consequences that would need to be addressed, would be to do a JOIN with recentchanges. The structure of the query would be something like:

SELECT page_namespace, page_title from page JOIN recentchanges ON recentchanges.rc_cur_id = page_id WHERE (rc_user = '0' and rc_new = '1');

You'd want to change that query to substitute for the 0 in rc_user = '0' the user.user_id of the user. I guess to get that, you'd use User::newFromName() and then User::getId(). Alternatively, you could just use recentchanges.rc_user_text instead of recentchanges.rc_user, but then I think you run into issues if the user has been renamed.

The only problem is, I've had a lot of trouble figuring out how to use the join parameter of DatabaseBase::select(); despite many attempts, I've only been able to do JOINs using DatabaseBase::query() (see my work at Extension:Chat#WikiChat.php), which is not recommended and would be a step backward from the code we currently have. I could probably figure it out if I did more research (grepping the codebase for other uses of JOIN and following those examples), and undoubtedly I do need to eventually learn how to do that.

Anyway, your options now, as I see them, are (1) pay me .075 bitcoins to bump this work to the top of my list of priorities in which case I'd probably get it done within a day or two; (2) wait until I figure out, in the course of other projects, how to do this JOIN, and then return to implement the feature you're requesting; (3) do it yourself; or (4) get someone else to do it. If you're not already a MediaWiki hacker, gaining the knowledge and skill needed for option #3 might not be such a bad idea, if you plan on doing a lot of work with wikis. Good luck.

Reply to "Is it possible to make a list of recent added by some author?"