Difference between revisions of "DPL talk:Manual"
(→Using Thousands of DPL invocations on high traffic pages) |
(→Using Thousands of DPL invocations on high traffic pages) |
||
Line 130: | Line 130: | ||
EmuWikiAdmin1, July 18th 2008 | EmuWikiAdmin1, July 18th 2008 | ||
− | + | ===Reply=== | |
* This might help: [[DPL:Manual_-_DPL_parameters:_Other_parameters#allowcachedresults|allow cached results]] | * This might help: [[DPL:Manual_-_DPL_parameters:_Other_parameters#allowcachedresults|allow cached results]] | ||
My best, --[[User:Gollum2|Gollum2]] 20:56, 28 August 2008 (UTC) | My best, --[[User:Gollum2|Gollum2]] 20:56, 28 August 2008 (UTC) |
Revision as of 21:57, 28 August 2008
Contents
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 (not really)
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='author' 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. It blows up when I put in a ordermethod criteria.
I got it this time
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 `page` WHERE 1=1 AND `page`.page_is_redirect=0 AND 'PGauthor'=(select ug_group from `user_groups`, `revision` where `user_groups`.ug_user=`revision`.rev_user AND `revision`.rev_page=page_id order by `revision`.rev_timestamp ASC limit 1) ORDER BY sortkey ASC LIMIT 0, 500
I'm not sure 100% it's bug free but it looks like it's working.
Reply
Fine, that´s the first step. Now you must teach DPL to generate this query statement depending on your new parameter. Once you have a running version installed in a publicly available wiki, please let me know. Gero 01:43, 11 May 2008 (CEST)
Reply to the Reply
Yeah, I have it running dynamically. No bugs so far although the listseparators tables are blowing up, like listseparators={|,%PAGE%,,|}.. I think it has trouble parsing the wiki text.. Not sure what I did to have anything to do with the formatting.
Sorry, the wiki is not a public wiki... I'll install a public wiki for you when I get a chance.
Working version up
[[1]]
Is it possible to create a USER list?
Finally a new topic.. I want to create a user list like in SPECIAL:Listusers and maybe how many articles they've written.. All the parameters seems to revolve around the articles. Do I have to write this function too?
thanks..
Reply
Indeed the functionality of DPL centers around articles. But user homepages have their own namespace. So you can at least easily catch those users with DPL who have their own homepage. If you really want a list of all users you would have to add that function. There is a parameter named goal which currently has only the function to produce results of categories. You might want to add goal=users.
Sometimes I ask users to insert a small template on their homepage gifing data about their name, interest etc. This works best in non-publich wikis where you have people who know and trust each other in the wiki. Then you can extract temaplte values from these pages and create a meaningful user list. We even use templates on the users´ homepages to automaticall create TODO-lists for them (which come from othetr articles that contain the minutes of meetings where tasks were assigned to different people...
If you are interested in that kind of stuff I could upload a copy of those templates.
Gero 17:41, 12 May 2008 (CEST)
Cool
Thanks for the hints.. Yes upload those templates. I think everybody would be interested in that.
Using Thousands of DPL invocations on high traffic pages
Hi, I'm starting to realise that for my website to be where I want it to be, I will need thousands of DPL invocations on my different pages. These pages will probably get very high traffic eventually, and some pages may contain up to 20-30 DPL invocations. I was wondering if you think this will put a big load on the CPU of a dedicated server - I mean I know loading any page in mediawiki with high traffic and lots of content will in fact put a certain load on the CPU but I was wondering : does DPL cache its output or does it refreshes it every time a users goes to a page ? Does it search the whole mediawiki database every time a new user comes to a given page ? Basically, will the load be abnormally high compared to regular, mysql-database-only queried pages ?
EmuWikiAdmin1, July 18th 2008
Reply
- This might help: allow cached results
My best, --Gollum2 20:56, 28 August 2008 (UTC)
question
I'm not sure if this is possible but I want to make a page doing it the long way would be the equivalent of:
{{some template|1st page in category}}
{{some template|2nd page in category}}
{{some template|3rd page in category}}
...
...
...
Is this possible using dlp? thanks Redekopmark 09:17, 24 August 2008 (CEST)
decimal separators
Is it possible to change the decimal separator from "." to ","? In Germany and other European countries we use the comma for decimal separation. However in DPL, values which have "," do not get sorted correctly. Is there a workaround? Thanks and Greetings, --Gollum2 10:20, 28 August 2008 (UTC)