Extension talk:DynamicPageList (Wikimedia)/Archive 01

From mediawiki.org
Jump to navigation Jump to search
The following discussion has been transferred from Meta-Wiki.
Any user names refer to users of that site, who are not necessarily users of MediaWiki.org (even if they share the same username).

Bug report - Lbirn

Really a very powerful extension. Congratulations!

When using the extension, I got the following notice:

Notice: Undefined variable: output in c:\programme\easyphp1-8\www\devwikitest\extensions\intersection\DynamicPageList.php on line 358

Any ideas what the problem could be?

The page however is rendered correctly.

--Lbirn 12:12, 20 July 2005 (UTC)

I think you must be using some different version of PHP than what I am using, or PHP with different options enabled. Insert the following in the extension before line 358:
$output = '';
This should solve your problem. -- IlyaHaykinson 04:55, 26 July 2005 (UTC)

Checked it with beta 4. Now everything looks fine.

--Lbirn 15:19, 2 August 2005 (UTC)

Feature request - anon

How can I order them alphabetic?

Add these lines after #196:

case 'alphabetical':
   $sOrderMethod = 'alphabetical';

Add these lines after #341:

else if ('alphabetical' == $sOrderMethod)
   $sSqlWhere .= ' ORDER BY page_title ';

Rob.desbois 13:06, 5 July 2006 (UTC)

Does not seem to work for me. Anyone got an idea why? --Democritus

Bug report - anon

I'm getting this error:

A database query syntax error has occurred. This may indicate a bug in the software. The last attempted database query was:
SELECT page_namespace, page_title, c1.cl_timestamp FROM `page` INNER JOIN `categorylinks` AS c1 ON page_id = c1.cl_from AND c1.cl_to='Rumors' WHERE 1=1 AND page_is_redirect = 0 ORDER BY c1.cl_timestamp DESC LIMIT 5
from within function "". MySQL returned error "1146: Table 'wiki.page' doesn't exist (localhost)".

The table "page" does not exist as the error suggests. I've download the .php file and placed it in /extensions/intersection and I've included it in LocalSettings. I am running MediaWiki 1.4.7 -EOM

The bug is gone in the latest version of DynamicPageList for MediaWiki 1.4.6. The version is not linked to on the main page I believe but can be downloaded from the user page of the author.

User:Amgine/DynamicPageList 1.5 for MW 1.4.6 is a cheap hack to get most of the functionality of DPL with the 1.4x versions of Mediawiki. It has not been thoroughly tested, so it may perform erratically. I will try to respond to bug reports for that here, but you should preface your report by saying which version you are using. (IlyaHaykinson is the primary developer of the DPL, and I'm just a dabbler trying to use it on an older installation...) - Amgine 18:34, 9 August 2005 (UTC)

Categoryadd problem

I have a problem with the categoryadd parameter. The problem is, sorting by categoryadd makes no difference to sorting by lastedit. This is because every edit to a page causes the categorytimestamp to be updated as well. Is this a bug in MediaWiki?

I'm not entirely sure that Categoryadd is supported in Mediawiki 1.4.x. I'm checking this now. - Amgine 18:36, 9 August 2005 (UTC)
As well as I am able to test, it appears the 1.4.x version is now able to support the ordermethod feature. Hope this solves your issue! - Amgine 21:57, 9 August 2005 (UTC)
I discoverd the the SQL Query doesn't select page_touched at all, so it shouldn't be possible at all to use lastedit as sort parameter. Or am I wrong here? fabian PS: I've fixed that in my hack above!

Request: ordermethod

Basically the reverse of the existing methods.. add in two new methods:

  • categoryadd2 — outputs list based on most distant addition to the first category
  • lastedit2 — outputs list based on most distant edit to the pages

Say I want to display a list of "older" entries, this is how I would do it.

-- Sy / (talk) 22:43, 25 August 2005 (UTC)

This basically the reverse of these two order methods. This should be an easy update - let me give it a shot. - Amgine 23:25, 14 September 2005 (UTC)


Is it possible to list pages from a certain category that only links to a certain page? For example page A belongs to catgeory AA. It also links to page B. Page C is also in category AA, but it does not link to page B. I want to have a page D that displays all pages that link to B and is also in category AA. Sorry if this sounds a little confusing.

This possible, but is probably outside the scope of this extension. You might try to tinker with it yourself, and see if you can come up with a solution. If you do, please post here! - Amgine 23:30, 14 September 2005 (UTC)

question (Feature request)

can we make a feature, that article are also list, who are in a kind-category . Maybe with the Category-Name in the front or so...--Cyper 13:43, 5 September 2005 (UTC)

Cyper: I'm not sure what you're requesting here... Can you explain what you're looking for a bit more? - Amgine 23:22, 14 September 2005 (UTC)
I think he would like to have an option, which includes also articles that are in a sub-category of the specified one; for example if you specify the category parameter Category:Communication, that it also outputs pages from the Category:Telephone book. -- mIstA 09:20, 20 October 2005 (UTC)
This level category recursion is probably beyond the scope of DynamicPageList. It might be possible to code this, but the number of database queries could grow exponentially and cause the extension to be very costly on the server as well as (potentially) running longer than 30-second default script timeout in PHP. - Amgine / talk meta 18:31, 19 January 2006 (UTC)

Feature request -- 23:03, 14 September 2005 (UTC)

How bout options to allow you to include the date the article was created or the date the article was modified? Having a date for only 'date article was added to category' seems a bit limiting...

-- 23:03, 14 September 2005 (UTC)

Currently the extension allows for sorting by the date the article was added to the first category, or by the last modification. I will look into what would be involved in adding sort by date the article was created. - Amgine / talk meta 18:33, 19 January 2006 (UTC)

Agreed with the above request; I'd love to be able to display the time at which each page was last edited (this would allow for a forum-like display in Village Pump-style sections). Thanks for the great script! --Algorithm 11:06, 12 February 2006 (UTC)

Feature request: relative date category filter (for wikinews)

something like:



date=0,-1,-2 (today, yesterday, the day before) 20:39, 10 October 2005 (UTC) (this is Kevin Baas, not logged in. sorry)

Kevin, each site may use a different date category system. On en.Wikinews date categories are Monthname DD, YYYY but another site might use DD Monthname YY and a third use YYYY-MM-DD. The complexity of creating and enforcing a date system is probably beyond the scope of DynamicPageList. - Amgine / talk meta 18:27, 19 January 2006 (UTC)

Topics language

I work in Russian [WikiNews]. I tried for DynamicPageList a category in Russian to specify - so notcategory=Спорт. It does not work. Must to be all topics - a category, a namespace and other only in English? Thank. 15:37, 20 November 2005 (UTC) Ygrek

It definitely works: see n:ru:Участник:IlyaHaykinson/Test -- IlyaHaykinson 06:47, 21 December 2005 (UTC)
OK. Thanks. Ygrek 18:54, 4 January 2006 (UTC)

patch for adding first paragraph of article

At User:Svamberg/DynamicPageList_with_first_paragraph is a small patch that is adding first paragraph of an article to printed headline. For example you can visit at this main page.

Actually, we could stand to have a version of this which just includes the whole article (up to a limited size), as it would help in autoagregating briefs on wikinews. Nyarlathotep 18:11, 17 January 2006 (UTC)

I'm working on a related script, personally. On the example site, most of the articles being found using this patch version of DynamicPageList follow simple text format, with no leading templates, tables, or images. This works well on this specific site, but might cause problems for sites such as Wikinews which do generally use mediawiki syntax in the leading paragraphs, and usually have a blank line following a leading date template.
The model I'm working on is similar to this, with a number_of_paragraphs parameter to allow some sites to use the first two or more paragraphs. The text will be processed through the parser to generate the appropriate html output (to deal with templates and, for example, wiki links.) I will announce here when I get a working model. - Amgine / talk meta 18:46, 19 January 2006 (UTC)
Note: it is pretty easy to modify this hack to include and part of the article by manipulating the regular expression. I have several articles for example that follow a similar format. JT 03:23, 24 September 2006 (UTC)

Can DPL's category name be a parameter?

How can make the following work?



I'm a little confuse that why variables {{CURRENTDAY}} can but {{{param}}} can't. Thanks!

-- Chientai

Extensions operate outside the main parser and generally can't access circumstantial variables. {{CURRENTDAY}} is a global property, so it can be accessed from anywhere. --Algorithm 22:07, 23 July 2006 (UTC)
  • I was able to use named parameters in my category filter on wikia:scratchpad. It even let me create a combination filter of constant text, PAGENAME and a parameter.
category=in {{PAGENAME}}
category=in {{{place}}}
 — MrDolomite | Talk 03:28, 1 September 2006 (UTC)

--Petersec 04:35, 22 December 2006 (UTC)

I'd really like to use parameters with the DPL. Anyone know what the status on this is?

Feature Request: CategoryOnly

Add a parameter that limits the results to pages in the specified category (or categories) and no others for example Catonly=stub would show pages in Category:Stub, but not in any other category. 20:36, 21 April 2006 (UTC)

Feature request - ordermethod

ordermethod option is an interesting one, but unfortunately, its current shape makes it completely useless for Wikinews. It would be much more convenient to have firstedit value, which would sort news by time of first edit of an article. Generally, you want to know when the news story was written, not what time somebody corrected last spelling error in it. --Derbeth 21:45, 3 July 2006 (UTC)

  • any further developments on this topic? this would be a nice and useful feature for intranet wikis (news sections etc.)!

Feature request - alphabetical

I'm abusing the DPL to dynamically list articles from certain categories. I would prefer If I could sort the resulting list alphabetically. --Democritus

This is pretty easy to impliment just add this at line 197:
case 'alpha':
	$sOrderMethod = 'alpha';
Then add this at line 344:
elseif ('alpha' == $sOrderMethod)
      $sSqlWhere .= ' ORDER BY page_title ';
Make sure you sort ascending also. Sorry, I'm not setup on SVN yet, or I'd check this in.
I have seen that hack mentioned ab it further up. I got it imeplemented, yet it still doesn't work. And if I add ascending, it gives me SQL errors... any idea? --Democritus

Here is a small patch to make the alphabetical odering work with svn from 2007-02-24 (similar to the patch above).

  • to apply just save the lines below as DynamicPageList.patch
  • # cd /path/to/DynamicPageList.php && patch -p1 -i /path/to/DynamicPageList.patch
  • set "ordermethod = alphabetical" in your article
--- DynamicPageList.php 2007-02-24 12:23:14.000000000 +0100
+++ DynamicPageList.php.alphabetical      2007-02-24 12:23:43.000000000 +0100
@@ -194,6 +194,9 @@
        case 'lastedit':
          $sOrderMethod = 'lastedit';
+       case 'alphabetical':
+         $sOrderMethod = 'alphabetical';
+         break;
        case 'categoryadd':
          $sOrderMethod = 'categoryadd';
@@ -338,6 +341,8 @@
     if ('lastedit' == $sOrderMethod)
       $sSqlWhere .= ' ORDER BY page_touched ';
+    else if ('alphabetical' == $sOrderMethod)
+      $sSqlWhere .= ' ORDER BY page_title ';
       $sSqlWhere .= ' ORDER BY c1.cl_timestamp ';

Installation question

Hmm, I knew these install steps were too good to be true, at least with my luck :)

The DPL neither functions, nor shows up on my Special:Version page (I don't think editing includes\SpecialVersion.php is needed)

    • MediaWiki: 1.7.1
    • PHP: 5.1.4 (isapi)
    • MySQL: 5.0.22-community-nt

on IIS in WinXPPro (no jokes, please ;) The MediaWiki software works fine, just no dice on DPL. If there is a better forum for this kind of question, please let me know. Thx. — MrDolomite | Talk 07:15, 11 September 2006 (UTC)

Nevermind, found a clue over on Extension:DynamicPageList2#Source and Installation. I had Read & Write permissions to the extensions directory, but not to the DynamicPageList.php file itself. Once I set those, everything worked great, including automatically appearing on Special:Version. — MrDolomite | Talk 02:25, 12 September 2006 (UTC)


I would create other languages sections, using the language links (i.e. es: / fr: and so on).

"addfirstcategorydate" problems?

Hi. Use of this feature leads to strange results. A date that should have been "2006-10-12" showed up as "2006--1-0-" yesterday and, without other changes, as "0 <> 2006" today. See here [1]. NOTE: This is using DPLForum, but the author of that extension told me that he is just piping the result of DPL unchanged here. Any idea? Thanks. -- 10:09, 13 October 2006 (UTC)

  • I think it's a wikia problem more than a DPL problem. See the note I left here which has examples that work on meta but don't on scratchpad. — MrDolomite | Talk 16:39, 13 October 2006 (UTC)

Need help with project

I'm trying to do a Template, but having issues. I'm sure someone here will have some ideas that will help.

the current template code for testing is:

namespace = Main
{{#if:{{{1|}}}|category = {{{1}}}| }}
{{#if:{{{2|}}}|category = {{{2}}}| }}

using the Template like this:


gives me:

DynamicPageList: Too few categories!

Any ideas? --Tildar 17:56, 15 January 2007 (UTC)

OK. re-reading this page again shows I've duplicated the "Can DPL's category name be a parameter?" question. Is there any more news/information on this? -- 20:13, 15 January 2007 (UTC)

Use {{#tag:}} Bawolff 06:49, 9 September 2008 (UTC)