DPL:Catlist

From FollowTheScore
Jump to: navigation, search
Jump to DPL GUI ...
 Template:Catlist will only run if you
     installed latest DPL version (at least 1.2.8)
     installed 'Call extension' (contained in the download)
     installed 'SimpleForms extension'.

This is an effort to bring the power of DPL to the average user who is probably not willing to write complex scripts.

It is based on mw:Extension:Simple_Forms as was suggested by Nad. At the moment the layout doesn´t look very nice -- mainly because Simple Forms has trouble with table formatting using wikitext syntax. It doesn't seem to be possible to use wikitext table syntax to organise layout within the #form extension body, however html table syntax does still work.

Anyway, the good message is: The GUI is NOT hard-coded within PHP but it is contained in a 'normal' wiki article (Template:Catlist). So it is open for your improvements. Therefore the old DPL special page was removed.

Template Catlist contains a completely parameterized DPL query and a form definition with an action which again calls the very same template. To make this possible, a nice little tricky extension called Call was added. This extension allows to call a MediaWiki article and pass parameters via the command line. The called page appears as a special page and has the name of the called template.

With Call you can invoke a mediawiki article and pass parameters to the article:

  1. via the URL by using the classical notation with ampersand (&) separators
  2. via wiki link notation by using a comma separated list of arguments

For example you can write something like

[[Special:Call/Catlist|some text]]
     This 'calls' Template:Catlist
     note the difference to {{Catlist}} which would include the template
     The called template page appears as a special page to the user,
     but normally he will not notice this as we implicitly change the 
     page title of that special page to the template´s name.

[[Special:Call/Catlist,category=something|some text]]
     This 'calls' Template:Catlist with parameter 'category' set to 'something'
     The output equals {{Catlist|category=something}} but it appears as a special page

[http://myhost/mywiki/index.php?title=Special:Call/Catlist,category=something some text]
     This can be used within another wiki or from the command line and it
     shows how the comma separators alos work within an URL.

From the browsers command line you can use also 
     http://myhost/mywiki/index.php/Special:Call/Catlist&category=something

Try the following links:

Features included in old DPL special page that are not implemented (yet?)

  • Multiple categories/namespaces/templates/users/etc are not supported as in the original DPL special page. -Eep² 14:17, 9 September 2007 (CEST)

Bugs

  • "created by" selectbox does not display (only?) the users but (also?) pages from userspace. If users have subpages this is strange. Tobias Conradi 19:01, 8 September 2007 (CEST)

Fixed

Using the 'titleregexp' it was easy to exclude pages which have a '/' in their name. Gero 21:02, 8 September 2007 (CEST)

thank you. Tobias Conradi 13:28, 9 September 2007 (CEST)

DB error

   *  MediaWiki: 1.9.1
   * PHP: 5.1.2-Debian-0.1~sarge1 (apache2handler)
   * MySQL: 5.0.20-Debian_1-log 

when selecting a user and a category the error occurs. http://wiki.tango.info/w/mul/index.php?title=Special%3ACall%2FCatlist&namespace=all&notnamespace=-&category=%3F&notcategory=%3F&uses=%3F&notuses=%3F&linksto=&notlinksto=&createdby=%3F&modifiedby=Tobiasco&lastrevisionbefore=YYYY-MM-DD&firstrevisionsince=YYYY-MM-DD&allrevisionsbefore=YYYY-MM-DD&allrevisionssince=YYYY-MM-DD&shownamespace=yes&addcategories=yes&addpagecounter=no&addpagesize=no&adduser=no&addeditdate=no&addpagetoucheddate=no&ordermethod=-&order=ascending&escapelinks=true&randomcount=-&export=no&columns=3

The DPL extension produced a SQL statement which lead to a Database error.
The reason may be an internal error of DPL or an error which you made,
especially when using DPL options like titleregexp.
Query text is:

SELECT DISTINCT `mul_page`.page_namespace as page_namespace, `mul_page`.page_title as page_title, REPLACE(REPLACE(CONCAT( IF(`mul_page`.page_namespace=0, , CONCAT(CASE `mul_page`.page_namespace WHEN 1 THEN 'Talk' WHEN 2 THEN 'User' WHEN 3 THEN 'User_talk' WHEN 4 THEN 'wiki-tango-info' WHEN 5 THEN 'wiki-tango-info_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' END, ':')), `mul_page`.page_title), '_', ' '),'♣','⣣') as sortkey, GROUP_CONCAT(DISTINCT cl_gc.cl_to ORDER BY cl_gc.cl_to ASC SEPARATOR ' | ') AS cats FROM `mul_page` LEFT OUTER JOIN (`mul_categorylinks` AS cl_gc) ON (page_id=cl_gc.cl_from) WHERE 1=1 AND `mul_page`.page_is_redirect=0 AND 'Tobiasco' in (select rev_user_text from `mul_revision` where `mul_revision`.rev_page=page_id) GROUP BY page.page_id ORDER BY sortkey ASC LIMIT 500

Error message is:
Unknown column 'page.page_id' in 'group statement' (localhost) 

Tobias Conradi 02:45, 10 September 2007 (CEST)

Reply

Your wiki is configured with a SQL table prefix. The reason for the error is that DPL uses the fixed table name 'page' in the group by clause instead of the prefixed name. This will be corrected with the next DPL version (1.4.2). --Gero 08:23, 16 September 2007 (CEST)

thank you :-) Tobias Conradi 20:49, 27 September 2007 (CEST)