DPL talk:Manual

From FollowTheScore
Revision as of 07:55, 10 May 2008 by Peptobismol (talk | contribs) (Can you help me out?)
Jump to: navigation, search

Counting Results

So which parameter(s) will give me a count of the number of pages that fit the criteria instead of the pages themselves? —Sledged (talk) 04:49, 29 November 2007 (CET)

I don´t understand your question. Give an example. Gero 08:47, 29 November 2007 (CET)

Let's take the search criteria in the example on the Main Page:
category=African Union member states
nottitlematch=Sudan
There are three pages that match this criteria, so I want the output:
3
instead of getting a list of those pages. I just want to count the number of pages that match the criteria. I thought I'd be able to specify that with the mode parameter, but that doesn't seem to be an option. —Sledged (talk) 15:40, 29 November 2007 (CET)


o.k. : use The %PAGES% parameter in the resultsheader. It will contain the correct value even if you use regular expression to filter template calls by the parameter values they use.
Gero 17:13, 29 November 2007 (CET)


Top Most Visited Pages ?

Is there a way with DPL to get the N "Top Visited Pages" during a specified period ? Ex: get the 10 most visited page since the begining of the week ?

Reply

I don´t think so. The page counter in the wiki database is not attached to the history. Using DPL you could make a snapshot of (say) the 200 pages with the highest usage rank plus those pages that were modified recently (although they may have low usage rates). If you do that regularly you could then use ploticus to generate a graph of incremental usages. Gero 19:09, 14 December 2007 (CET)

Add UserGroup criteria function?

Can you add a page list criteria by a User's user group? It would be a nice addition for groups to share files and communication. thanks.

Could you be more precise, please?

  • how should the command be named?
  • what exactly should it do?
  • what do you mean by 'user group'?
  • can you gove an example?
Gero 22:26, 6 May 2008 (CEST)

Hi, I'll be more clear..

Each user belongs to a user group like sysop, user, bureaucrat, or a custom named group like 'author'. Right now, you can list articles written by a user or by namespace like:

<DPL> createdby=Joe </DPL>

<DPL> namespace=something </DPL>


It would be useful to list articles by usergroup like; <DPL> byusergroup=sysop </DPL>


thanks.

Reply

Well, that is not too complicated and I think it is a useful feature. In the last time I try to motivate people to do such minor changes to DPL themselves. I always offer to test, document and integate the solution into the next release. The idea is that DPL is only then real open source if more than one person (i.e. me) is in contact with the sources. Are you capable of doing it or do you know somebody who could do it? Gero 19:12, 8 May 2008 (CEST)

reply reply

I'm good at hacking. Is there a manual for variables, classes, codes for DPL anywhere?

reply³

There is no technical documentation regarding the code so far. But there are useful inline comments. It is only the larger source file that you would need to change. The smaller one only deals with transclusion of contents. The larger source has three or four classes - some of which are rather huge but very straight forward. Parsing the input (i.e. checking parameters) takes a lot of lines .. I inherited the code and never found time to break those classes into smaller pieces. Maybe I should put that on my agenda. Gero 08:07, 9 May 2008 (CEST)

reply x 4

Ugh... I'm looking the variables for the mysql query right now and it's giving me a headache.

I think I got it

Here's the working query

SELECT DISTINCT `page`.page_namespace as page_namespace,`page`.page_title as page_title, REPLACE(REPLACE(CONCAT( IF(`page`.page_namespace=0, , CONCAT(CASE `page`.page_namespace WHEN 1 THEN 'Talk' WHEN 2 THEN 'User' WHEN 3 THEN 'User_talk' WHEN 4 THEN 'LwcWiki' WHEN 5 THEN 'LwcWiki_talk' WHEN 6 THEN 'Image' WHEN 7 THEN 'Image_talk' WHEN 8 THEN 'MediaWiki' WHEN 9 THEN 'MediaWiki_talk' WHEN 10 THEN 'Template' WHEN 11 THEN 'Template_talk' WHEN 12 THEN 'Help' WHEN 13 THEN 'Help_talk' WHEN 14 THEN 'Category' WHEN 15 THEN 'Category_talk' WHEN 100 THEN 'Calendar' WHEN 101 THEN 'Relation_talk' WHEN 102 THEN 'CommonCalendar' WHEN 103 THEN 'Property_talk' WHEN 104 THEN 'Type' WHEN 105 THEN 'Type_talk' WHEN 106 THEN 'Form' WHEN 107 THEN 'Form_talk' END, ':')), `page`.page_title), '_', ' '),'♣','⣣') as sortkey FROM `user_groups`, `revision`, `page` WHERE 1=1 AND `page`.page_is_redirect=0 AND `revision`.rev_user=`user_groups`.ug_user AND `user_groups`.ug_group='PGauthor' AND `revision`.rev_page=page_id ORDER BY sortkey ASC LIMIT 0, 500

Although sysop gets to see all the articles I've noticed, I guess that's how it is.. Now I need to find a way to sort this by date/time.