Jump to content

Extension talk:PhpTags Functions

Add topic
From mediawiki.org
Latest comment: 4 years ago by TimoKausK in topic Read Messages


strange results with str_word_count

[edit]

The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.


{{PAGENAME}}<br /> {{#phptag:echo str_word_count("{{PAGENAME}}");}}

sometimes it gives strange results:

častá procházka
3

ĹĄumĂ­cĂ­ les
3

(The page name has two words but the function gives out 3?) Auvajs (talk) 01:38, 6 August 2015 (UTC)Reply

The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

Transclude Example?

[edit]

Can anyone offer a transclude example? -thx Johnywhy (talk) 01:57, 29 April 2018 (UTC)Reply

http://test.foxway.org/wiki/PhpTags/Transclude Pastakhov (talk) 03:11, 30 April 2018 (UTC)Reply
thx. Seems the purpose of `transclude` is to output whatever you want to output to the host page. I guess transclude code would live in a template, correct?
I'm looking for the opposite: a php way to pull in a rendered page.
cheers Johnywhy (talk) 03:54, 30 April 2018 (UTC)Reply
Do you mean https://www.mediawiki.org/wiki/Manual:Parameters_to_index.php#render ? Pastakhov (talk) 05:33, 30 April 2018 (UTC)Reply
Or maybe https://www.mediawiki.org/wiki/API:Parsing_wikitext#parse Pastakhov (talk) 05:35, 30 April 2018 (UTC)Reply
thx, i'll be reading those! Johnywhy (talk) 06:00, 30 April 2018 (UTC)Reply

Read Messages

[edit]

It would be a very nice thing, to make it possible to read/import a message/page/article and be able to parse this.


Example:

$json=read('Mediakwiki:TextBasedDataInJsonFormat');

$array=json_decode($json,true);

foreach($array as $item){

// do very nice things

} TimoKausK (talk) 14:56, 23 April 2021 (UTC)Reply