Hi,
I would like to display a random page on the Main Page. I tried to use {{Special:Random}} and {{Special:Randompage}} which only displays the link to Special:Random[page] but not a page itself. Is it possible to embed Special:Random at all?
Thanks, Helmut
http://meta.wikimedia.org/wiki/Help:Embed_page#Embedded_Special_Pages
Cheers, Gu
Quoting Helmut Schneider jumper99@gmx.de:
Hi,
I would like to display a random page on the Main Page. I tried to use {{Special:Random}} and {{Special:Randompage}} which only displays the link to Special:Random[page] but not a page itself. Is it possible to embed Special:Random at all?
Thanks, Helmut
-- No Swen today, my love has gone away My mailbox stands for lorn, a symbol of the dawn
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
zehetner@molgen.mpg.de wrote:
I would like to display a random page on the Main Page. I tried to use {{Special:Random}} and {{Special:Randompage}} which only displays the link to Special:Random[page] but not a page itself. Is it possible to embed Special:Random at all?
http://meta.wikimedia.org/wiki/Help:Embed_page#Embedded_Special_Pages
Unfortunately the page is empty. I tried {{Special:Randompage}} {{Special:Random}} {{Special:Imagelist}} and can see the imagelist, but not a random page (yes, I reloaded many times).
I use 1.11, did I miss anything else?
Thanks, Helmut
Helmut Schneider jumper99@gmx.de wrote:
zehetner@molgen.mpg.de wrote:
I would like to display a random page on the Main Page. I tried to use {{Special:Random}} and {{Special:Randompage}} which only displays the link to Special:Random[page] but not a page itself. Is it possible to embed Special:Random at all?
http://meta.wikimedia.org/wiki/Help:Embed_page#Embedded_Special_Pages
Unfortunately the page is empty. I tried
What page is empty? The one at meta.wikimedia.org? It displays just fine for me.
As you seem to be having problems accessing the page, let me quote the content for you:
| Embedded Special Pages | | The default install of MediaWiki allows you to embed only selected | special pages. (See Help:Special_pages#Miscellaneous.) To include | an otherwise "unembedable" special page, you must edit the $mList | array in the file includes/SpecialPage.php. Each entry is in the | format | | 'Pagename' => array( 'PageType', 'Pagename') | | The possible values for PageType are SpecialPage, UnlistedSpecialPage, | and IncludableSpecialPage. | | Find the entry for the page you want to embed and change the PageType | to IncludableSpecialPage. You will now be able to include/embed the | special page using the include syntax: {{Special:Pagename}}. | | Note: changing an UnlistedSpecialPage will show it in | Special:Specialpages. (Can this array be changed to allow | multiple page types?)
Michael
I think he means that even after making the appropriate change in the file includes/SpecialPage.php the inclusion of {{Special:Random}} on a page doesn't embed the content of a random page but an 'empty page' resp. nothing at all.
At least that's the effect I see on my wiki (release 1.11.1). Other special pages work fine but Special:Random doesn't work. But I have no idea why.
Cheers, Gu
Quoting Michael Schmarck michael.schmarck@habmalnefrage.de:
Helmut Schneider jumper99@gmx.de wrote:
zehetner@molgen.mpg.de wrote:
I would like to display a random page on the Main Page. I tried to use {{Special:Random}} and {{Special:Randompage}} which only displays the link to Special:Random[page] but not a page itself. Is it possible to embed Special:Random at all?
http://meta.wikimedia.org/wiki/Help:Embed_page#Embedded_Special_Pages
Unfortunately the page is empty. I tried
What page is empty? The one at meta.wikimedia.org? It displays just fine for me.
As you seem to be having problems accessing the page, let me quote the content for you:
| Embedded Special Pages | | The default install of MediaWiki allows you to embed only selected | special pages. (See Help:Special_pages#Miscellaneous.) To include | an otherwise "unembedable" special page, you must edit the $mList | array in the file includes/SpecialPage.php. Each entry is in the | format | | 'Pagename' => array( 'PageType', 'Pagename') | | The possible values for PageType are SpecialPage, UnlistedSpecialPage, | and IncludableSpecialPage. | | Find the entry for the page you want to embed and change the PageType | to IncludableSpecialPage. You will now be able to include/embed the | special page using the include syntax: {{Special:Pagename}}. | | Note: changing an UnlistedSpecialPage will show it in | Special:Specialpages. (Can this array be changed to allow | multiple page types?)
Michael
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Michael Schmarck michael.schmarck@habmalnefrage.de wrote:
Helmut Schneider jumper99@gmx.de wrote:
zehetner@molgen.mpg.de wrote:
I would like to display a random page on the Main Page. I tried to use {{Special:Random}} and {{Special:Randompage}} which only displays the link to Special:Random[page] but not a page itself. Is it possible to embed Special:Random at all?
http://meta.wikimedia.org/wiki/Help:Embed_page#Embedded_Special_Pages
Unfortunately the page is empty. I tried
What page is empty?
According to the link above I changed includes/SpecialPage.php:
/* 'Randompage' => array( 'SpecialPage', 'Randompage' ), */ 'Randompage' => array( 'IncludableSpecialPage', 'Randompage' ),
Within my mediawiki distribution I created a page called 'Test' with the following content:
{{Special:Randompage}}Randompage {{Special:RandomPage}}RandomPage {{Special:Random}}Random
After saving the page the only content I can see is:
Randompage RandomPage Random
For further testing I made another change to includes/SpecialPage.php:
/* 'Imagelist' => array( 'SpecialPage', 'Imagelist' ), */ 'Imagelist' => array( 'IncludableSpecialPage', 'Imagelist' ),
Again I created a test page with the following content:
{{Special:Imagelist}}
The image map appears, so I assume that I changed SpecialPage.php correctly. What works for Special:Imagelist does not for Special:Random.
Apologies if (obviously) my english was not good enough to describe the actual situation. I hope this posting clears out the problem.
Any help is still appreciated.
It seems Special:Random just creates a full URL to a random page in the wiki and than redirects (and loads) that URL.
$wgOut->redirect( $title->getFullUrl() );
if one replaces in SpecialRandompage.php that line with
$article = new Article($title); $wgOut->addWikiText($article->getContent());
than it does exactly what you expect: it includes the content of a random page into another page. So maybe you should create a new special page 'Special:Randomcontent'?
Cheers, Gu
Quoting Helmut Schneider jumper99@gmx.de:
zehetner@molgen.mpg.de wrote:
I would like to display a random page on the Main Page. I tried to use {{Special:Random}} and {{Special:Randompage}} which only displays the link to Special:Random[page] but not a page itself. Is it possible to embed Special:Random at all?
http://meta.wikimedia.org/wiki/Help:Embed_page#Embedded_Special_Pages
Unfortunately the page is empty. I tried {{Special:Randompage}} {{Special:Random}} {{Special:Imagelist}} and can see the imagelist, but not a random page (yes, I reloaded many times).
I use 1.11, did I miss anything else?
Thanks, Helmut
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
zehetner@molgen.mpg.de wrote:
It seems Special:Random just creates a full URL to a random page in the wiki and than redirects (and loads) that URL.
$wgOut->redirect( $title->getFullUrl() );
if one replaces in SpecialRandompage.php that line with
$article = new Article($title); $wgOut->addWikiText($article->getContent());
than it does exactly what you expect: it includes the content of a random page into another page. So maybe you should create a new special page 'Special:Randomcontent'?
That seems the right direction, indeed, nice. Unfortunately it seems to impact some other functions/extensions, e.g. NewestPages (http://www.mediawiki.org/wiki/Extension:Newest_Pages). {{Special:NewestPages}} now produces something like:
UNIQ18de99db71f8b6d3-item7025fdcb3d145835
Here is what I did:
Copied SpecialRandompage.php to SpecialRandompageRedirect.php In SpecialRandompageRedirect.php I replaced function wfSpecialRandompage with function wfSpecialRandompageRedirect
and also $rnd = new RandomPage(); with $rnd = new RandomPageRedirect();
and also class RandomPage with class RandomPageRedirect
In Autoloader.php I added 'RandomPageRedirect' => 'includes/SpecialRandompageRedirect.php', and in SpecialPage.php 'RandompageRedirect' => array( 'IncludableSpecialPage', 'RandompageRedirect' ),
No idea why this should happen in this context (but I don't know newestpages). The UNIQ problem seems more related with extension incombatibility (e.g. double-call of the parse() function): https://bugzilla.wikimedia.org/show_bug.cgi?id=8820 http://meta.wikimedia.org/wiki/QINU_fix
Gu
Quoting Helmut Schneider jumper99@gmx.de:
zehetner@molgen.mpg.de wrote:
It seems Special:Random just creates a full URL to a random page in the wiki and than redirects (and loads) that URL.
$wgOut->redirect( $title->getFullUrl() );
if one replaces in SpecialRandompage.php that line with
$article = new Article($title); $wgOut->addWikiText($article->getContent());
than it does exactly what you expect: it includes the content of a random page into another page. So maybe you should create a new special page 'Special:Randomcontent'?
That seems the right direction, indeed, nice. Unfortunately it seems to impact some other functions/extensions, e.g. NewestPages (http://www.mediawiki.org/wiki/Extension:Newest_Pages). {{Special:NewestPages}} now produces something like:
UNIQ18de99db71f8b6d3-item7025fdcb3d145835
Here is what I did:
Copied SpecialRandompage.php to SpecialRandompageRedirect.php In SpecialRandompageRedirect.php I replaced function wfSpecialRandompage with function wfSpecialRandompageRedirect
and also $rnd = new RandomPage(); with $rnd = new RandomPageRedirect();
and also class RandomPage with class RandomPageRedirect
In Autoloader.php I added 'RandomPageRedirect' => 'includes/SpecialRandompageRedirect.php', and in SpecialPage.php 'RandompageRedirect' => array( 'IncludableSpecialPage', 'RandompageRedirect' ),
-- No Swen today, my love has gone away My mailbox stands for lorn, a symbol of the dawn
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
zehetner@molgen.mpg.de wrote:
No idea why this should happen in this context (but I don't know newestpages). The UNIQ problem seems more related with extension incombatibility (e.g. double-call of the parse() function): https://bugzilla.wikimedia.org/show_bug.cgi?id=8820 http://meta.wikimedia.org/wiki/QINU_fix
OK, due my lack of PHP knowledge this seems a dead end for me. I assume that the snippet
public function execute( $par ) { global $wgRequest, $wgOut, $wgContLang;
in NewestPages.page.php might cause the problem (according to http://meta.wikimedia.org/wiki/QINU_fix) but I have no idea how to fix.
As the problem only occures when {{Special:RandomPageRedirect}} and {{Special:NewestPages}} are on the same page (also when using templates for each) I'll rebuild the page.
Thanks anyway, Helmut
Some people seem to have solved the QINU problem by updating their MW. Don't know what version you are runing but if it is an older one it might be worth a try to upgrade.
Good luck, Gu
Quoting Helmut Schneider jumper99@gmx.de:
zehetner@molgen.mpg.de wrote:
No idea why this should happen in this context (but I don't know newestpages). The UNIQ problem seems more related with extension incombatibility (e.g. double-call of the parse() function): https://bugzilla.wikimedia.org/show_bug.cgi?id=8820 http://meta.wikimedia.org/wiki/QINU_fix
OK, due my lack of PHP knowledge this seems a dead end for me. I assume that
the snippet
public function execute( $par ) { global $wgRequest, $wgOut, $wgContLang;
in NewestPages.page.php might cause the problem (according to http://meta.wikimedia.org/wiki/QINU_fix) but I have no idea how to fix.
As the problem only occures when {{Special:RandomPageRedirect}} and {{Special:NewestPages}} are on the same page (also when using templates for each) I'll rebuild the page.
Thanks anyway, Helmut
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
From: zehetner@molgen.mpg.de
Some people seem to have solved the QINU problem by updating their MW. Don't know what version you are runing but if it is an older one it might be worth a try to upgrade.
1.11.2 :)
mediawiki-l@lists.wikimedia.org