Difference between revisions of "DPL:Catlist"

From FollowTheScore
Jump to: navigation, search
(DB error: :thank you :-) ~~~~)
 
(24 intermediate revisions by 5 users not shown)
Line 1: Line 1:
 
<center><big>[[:Template:Catlist|Jump to DPL GUI ...]]</big></center>
 
<center><big>[[:Template:Catlist|Jump to DPL GUI ...]]</big></center>
  
   ''This page will only run if you use the [[Download|latest (1.2.8) DPL version]]. You also need ''SimpleForms'. ''
+
   ''[[Template:Catlist]] will only run if you
 +
    '' installed [[Download|latest DPL version]] (at least 1.2.8)''
 +
    '' installed '[[Call extension]]' (contained in the download)''
 +
    '' installed '[[mw:Extension:Simple_Forms|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.
 
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 [[User:Nad]]. The layout doesn´t look nice -- mainly because SimpleForms has trouble with table formatting. At the moment it doesn´t seem to be possible to use table layout within the #form extension body ..
+
It is based on [[mw:Extension:Simple_Forms]] as was suggested by [[User:Nad|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 hardcoded within php but it is contained in a 'normal' wiki article ([[Template:Catlist]]). So it is open for your improvements. Therefore the current DPL special page will die sooner or later.
+
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:Manual - DPL Special Page with Parameters|DPL special page]] was removed.'''
  
Template Catlist contains a form definition with an action which again calls the very same template. To make this possible, a nice little tricky extension called [[Call extension]] 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 page.
+
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 extension|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.
  
Thus you can call a mediawiki article and pass parameters to the article ..
+
'''With ''Call'' you can invoke a mediawiki article and pass parameters to the article:'''
# via the URL by using the classical notation with ampercent separators
+
# via the URL by using the classical notation with ampersand (&) separators
 
# via wiki link notation by using a comma separated list of arguments
 
# via wiki link notation by using a comma separated list of arguments
  
 
For example you can write something like
 
For example you can write something like
<nowiki><pre>
+
<pre><nowiki>
 
[[Special:Call/Catlist|some text]]
 
[[Special:Call/Catlist|some text]]
 
     This 'calls' Template:Catlist
 
     This 'calls' Template:Catlist
 
     note the difference to {{Catlist}} which would include the template
 
     note the difference to {{Catlist}} which would include the template
 
     The called template page appears as a special page to the user,
 
     The called template page appears as a special page to the user,
     but normally he will not notice that as we implicitly change the  
+
     but normally he will not notice this as we implicitly change the  
 
     page title of that special page to the template´s name.
 
     page title of that special page to the template´s name.
  
Line 27: Line 31:
 
     The output equals {{Catlist|category=something}} but it appears as a special page
 
     The output equals {{Catlist|category=something}} but it appears as a special page
  
[http://myhost/mywiki/index.php/Special:Call/Catlist,category=something some text]
+
[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
 
     This can be used within another wiki or from the command line and it
 
     shows how the comma separators alos work within an URL.
 
     shows how the comma separators alos work within an URL.
Line 33: Line 37:
 
From the browsers command line you can use also  
 
From the browsers command line you can use also  
 
     http://myhost/mywiki/index.php/Special:Call/Catlist&category=something
 
     http://myhost/mywiki/index.php/Special:Call/Catlist&category=something
</pre></nowiki>
+
</nowiki></pre>
  
 
Try the following links:
 
Try the following links:
 
* [[:Special:Call/Catlist,name=Five random articles ..,namespace=main,randomcount=5|Five random articles in the main namespace ..]]
 
* [[:Special:Call/Catlist,name=Five random articles ..,namespace=main,randomcount=5|Five random articles in the main namespace ..]]
 
* Gero: [[Special:Call/Catlist,name=The latest 10 edits of user Gero,modifiedby=Gero,count=10,ordermethod=lastedit,order=descending,addeditdate=true|latest 10 edits]]
 
* Gero: [[Special:Call/Catlist,name=The latest 10 edits of user Gero,modifiedby=Gero,count=10,ordermethod=lastedit,order=descending,addeditdate=true|latest 10 edits]]
 +
* a remote call to this wiki:[http://semeb.com/dpldemo/index.php?title=Special:Call/Catlist,category=Belgium looking for articles in category 'Belgium']
 +
 +
===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. -[[User:Eep²|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. [[User:Tobias Conradi|Tobias Conradi]] 19:01, 8 September 2007 (CEST)
 +
====Fixed====
 +
Using the 'titleregexp' it was easy to exclude pages which have a '/' in their name. [[User:Gero|Gero]] 21:02, 8 September 2007 (CEST)
 +
:thank you. [[User:Tobias Conradi|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)
 +
[[User:Tobias Conradi|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). --[[User:Gero|Gero]] 08:23, 16 September 2007 (CEST)
 +
:thank you :-) [[User:Tobias Conradi|Tobias Conradi]] 20:49, 27 September 2007 (CEST)

Latest revision as of 19:49, 27 September 2007

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)