I'm trying to determine if this will do what I'm looking for. I have a webserver running in a different place than the one hosting my mediawiki install (only accessible internally). I want to embed content from that other web server based on a variable that is sent within the URL. Example ([URL]/scriptname?sname=hh7750) - where that hh7750 is a dynamic value. I want to put the html that you get back from that query into the cell of a table or something along those lines in one of my mediawiki pages. Is this mechanism entirely static (i.e. you can't pass a variable)? If so, do you know of any other extension that I might be able to do that with safely? Thank you for your time - I'm a noob at the deeper workings of mediawiki.
Extension talk:HTMLets
Thanks for your good program
There are some styles that change wiki pages:
For example: https://wikicod.ir/wiki/Test
What method should I use that does not affect another VIC code css?
<htmlet>test1</htmlet>
Thanks
Currently, when a user tries to edit a page which contains a page rendered with HTMLets using VisualEditor, the HTML page included disappears as it is parsed as a div by VE. Thus, if user saves its changes to the page, the HTML page content is no longer included.
Would it be possible to make HTMLets compatible with VisualEditor or is it inherently impossible? Addind such compatibility would be great, as editing a page by manipulating the source can be difficult for non-experienced users...
Thank you in advance for your responses,
Not sure if this is proper, but here is how I fixed it:
diff HTMLets.php HTMLets.php.org
133,137c133,135
< $text = preg_replace_callback(
< '//sm',
< function ($m) {
< return base64_decode("$m[1]");
< },
---
> $text = preg_replace(
> '//esm',
> 'base64_decode("$1")',
If anyone has a better solution, please post it.
Thank you!
Reverse Corruption
how to set $v = preg_replace("/'/", "'", $v); to preg_replace_callback
hi guys,
thanks for the great functionality this extension brings to Wiki.. really helpful ! got one question - i keep trying to have it parse PHP files as well - as far as i can see, when htmlet requests the file, the web server will return the results as HTML, so i don't see why it won't work...however it does not work...for me at least :) any help / hint is highly appreciated
This post was posted by Peachey88 (Flood), but signed as 86.121.11.216.
ahh...figured it out myself... all you need to do is specify "http://" and the complete path to the php file, and the resulting HTML output will be rendered, rather than the PHP source ;)
This post was posted by Peachey88 (Flood), but signed as 86.121.9.48.
Exactly what I needed. Many thanks!
Change lines 93-100 from
if ( !preg_match('!^\w+://!', $dir ) && !file_exists( $f ) ) {
$output = Html::rawElement( 'div', array( 'class' => 'error' ), wfMsgForContent( 'htmlets-filenotfound', htmlspecialchars( $name ) ) );
} else {
$output = file_get_contents( $f );
if ( $output === false ) {
$output = Html::rawElement( 'div', array( 'class' => 'error' ), wfMsgForContent( 'htmlets-loadfailed', htmlspecialchars( $name ) ) );
}
}
TO
if ( !preg_match('!^\w+://!', $dir ) && !file_exists( $f ) ) {
$output = Html::rawElement( 'div', array( 'class' => 'error' ), wfMessage( 'htmlets-filenotfound', htmlspecialchars( $name ) )->inContentLanguage()->text() );
} else {
$output = file_get_contents( $f );
if ( $output === false ) {
$output = Html::rawElement( 'div', array( 'class' => 'error' ), wfMessage( 'htmlets-loadfailed', htmlspecialchars( $name ) )->inContentLanguage()->text() );
}
}
Are you sure that you upgraded to REL1_27? The code does not show the transgressing code for the version meant to be used with MW 1.27.x
Hello:
I'm getting the following error message on my wiki:
Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in HTMLets.php on line 139.
I'm running:
MediaWiki 1.25.3
PHP 5.6.19 (apache2handler)
MySQL 5.1.56-log
Thank you!
This was reported with T68706 and fixed with this commit in June 2015. Use the REL1_26 tag or the MW 1.26 tarball and the issue should go away. Cheers
It would be nice to add wiki code inside HTML pages, for example, autofill username in a form field.
HTMLets are for static HTML only. Extension:RawMsg might allow something like this, not sure.
In any case: pre-filling form fields with user-specific information has to be done with JavaScript anyway. Remember that the generated HTML for pages gets cached. This means that there can be no user-specific content there.
This post was posted by Peachey88 (Flood), but signed as Duesentrieb.
Is there any way to split HTMLet files into subfolders within the main htmlets directory?
I've got a lot of these and it would be nice to separate them, rather than having them all in one megafolder.
I tried
<htmlet>subfolder/filename</htmlet>
but that didn't work.
No biggie if this is impossible.
This post was posted by Peachey88 (Flood), but signed as DoubleSuitedChris.
When trying to use this extension with PHP 5.3.0, the following error occurs:
Warning: Parameter 3 to wfRenderHTMLet() expected to be a reference, value given in /.../w/includes/parser/Parser.php on line 3243
Any help would be appreciated. Thx
This post was posted by Peachey88 (Flood), but signed as Tommy us Kölle.
I can confirm that, I have exactly the same problem (line 3243) under PHP 5.3.1 now! So I have put away the Probably from the title. ;-)
This post was posted by Peachey88 (Flood), but signed as Master on EN.
I can confirm too. Can someone please take a look at this?
This post was posted by Peachey88 (Flood), but signed as ToreN.
PHP 5.3 seems to be quite picky here. Should be fixed in 1.17 67215.
This post was posted by Peachey88 (Flood), but signed as Duesentrieb.
Hello Daniel, with 1.17 you mean the next release of MediaWiki, correct?
After updating to XAMPP 1.7.7 with PHP 5.3.8 and MediaWiki 1.17.0 I again got the same problem, just on another line:
Warning: Parameter 3 to wfRenderHTMLet() expected to be a reference, value given in ...\includes\parser\Parser.php on line 3470
Then I downloaded the last version of the extension and replaced the previous version and added the necessary line ($wgHTMLetsDirectory = "$IP/htmlets";) to the LocalSettings.php and now it works fine again, at least for me!
This post was posted by Peachey88 (Flood), but signed as WikipediaMaster.
Affirmative. After upgrade to PHP 5.3.8 this extension stopped working (same error message). (MW 1.17.0) I guess I will file a bug. Cheers
Edit: Done with bug 32714
Shame on me. I moved the freshly downloaded extension to the wrong wiki. :( This is actually working with PHP 5.3.8. Case closed since r67215 did the job. Thank you for the fix and Cheers