Extension talk:PCR GUI Inserts

From mediawiki.org
Latest comment: 4 months ago by WikiForMen in topic Incompatibility

Incompatibility[edit]

This extention in version 2.x use hook SkinBuildSidebar to inject HTML into the sidebar.

"As of MediaWiki 1.39, injecting HTML is no longer supported with this hook. If you are looking to inject HTML, such as to put an ad in the sidebar, you must use Manual:Hooks/SkinAfterPortlet or similar."

The extension is therefore partially incompatible with REL1_39+ and must be rewritten to support actual versions of mediawiki.--WikiForMen (talk) 21:46, 22 December 2023 (UTC)Reply

Duplicates[edit]

Hi! Thanks for this great extension first of all. I'm sure I'll find many ways to utilize it. I just instaled on http://en.wikiarquitectura.com and it works almost fine. The only issue is that any text I include is printed 5 times on the site... any clue what might be going on? Thanks! (guillermo@wikiarquitectura.com) --216.83.98.130 17:26, 30 November 2010 (UTC)Reply

That sure is weird... could you post the relevant parts of your configuration file? Patheticcockroach 19:40, 30 November 2010 (UTC)Reply
Hey thanks for getting back to me so fast. Actually I also thought it was weird… so I tried reinstalling and everything seems to works fine now.By the way. Is there any way to add a couple more parameters to include some piece of code at the beginning and end of each article? I’ve been looking to something like that for a long time in order to be able to better control my ads. The site is http://en.wikiarquitectura.com, I’ve you check any random article I’m sure you’ll understand what I mean. Thanks again for getting back to me. I really appreciate it, and congratulations for the extension, it’s one of the coolest things I’ve seen lately, simple but INCREDIBLY USEFULL!--216.83.98.130 23:01, 30 November 2010 (UTC)Reply
You mean, like adding your Template:AdsenseHead and AdsenseFoot? Sorry, I don't know how to add wiki code before or after an article. But you could replace AdsenseFoot with something set in $wgPCRguii_Inserts['BeforePageDisplay']. I don't know for AdsenseHead, there might be a hook there but I didn't find it yet. Patheticcockroach 07:01, 1 December 2010 (UTC)Reply
I was thinking in including some kind of javascript code to show where AdesenseHead and AdsenseFoot show right now, not wiki code. Anyway, the extension is very useful as it is, I’m using it to include the Quantcast code on my site. Thanks a lot!--207.38.155.69 18:23, 1 December 2010 (UTC)Reply
Well, as I said $wgPCRguii_Inserts['BeforePageDisplay'] should place your stuff just where your AdsenseFoot is (you can put JavaScript and such in there). Patheticcockroach 18:48, 1 December 2010 (UTC)Reply

German I18N[edit]

Hi, perhaps you would like to introduce the German description into pcr_guii.i18n.php:

/* *** Deutsch *** */

$messages['de'] = array( 
 	'pcr_guii' => 'PCR GUI Inserts',
 	'pcr_guii-desc' => 'ErmÜglicht das Einfßgen von HTML-Quelltext in die grafische Benutzeroberfläche',

Cheers --kgh 19:01, 11 November 2010 (UTC)Reply

Thanks, now at least I'll have something to modify in the 1.0 final version ;) (b1 is stable enough to be final already ) Patheticcockroach 19:04, 11 November 2010 (UTC)Reply
That was fast :-) Cool! I am just giving it a try. This extension is a good idea and should work alike. Thank you --kgh 19:06, 11 November 2010 (UTC)Reply
Well, spending a few whole days working on the computer for some university projects, so as long as notifications arrive fast (this wasn't the case some weeks ago), I can reply fast too :) Not sure when I'll be able to release the updated version though, crazy schedule and I don't like to release stuff in a hurry, that's the best way to make silly mistakes... Patheticcockroach 19:17, 11 November 2010 (UTC)Reply
Yeah, notifications a quite unpredictable sometimes. Just recently I received a bunch of thirty-something of them and I instantly knew why it was nice and quiet the days before :) Take your time with the next release. --kgh 19:27, 11 November 2010 (UTC) PS What does PCR stand for?Reply
It took a while. Finally I realised what PCR stands for. :) --kgh 22:24, 20 November 2010 (UTC)Reply
Haha, yeah it's not polymerase chain reaction ;) And once again a notification got lost which is why I'm replying so late... Patheticcockroach 23:47, 26 November 2010 (UTC)Reply
And this even though polymerase chain reaction is the mother of all articles on German wikipedia. That's a kind of sad. ;) No worries. Cheers --kgh 23:51, 26 November 2010 (UTC)Reply

rename and move this extension[edit]

Acronyms always should be avoided. This extension has so much promise and is so incredible, but it is advertised poorly. I attempted to rewrite some of the text, making it more understandable about what this awesome extension does. Adamtheclown 08:03, 25 December 2010 (UTC)Reply

Yeah, nice rewrite (except maybe you shouldn't try to get what's within source tags inside nowiki tags ;)) but how do you suggest I rename it? GUI isn't really an unusual acronym I think, but I agree that it's not really the proper term to describe what the extension does... Yet it's the only word that came to my mind to summarize all the places where the extension can write stuff. Patheticcockroach 08:30, 25 December 2010 (UTC)Reply

Insert Google Translator[edit]

Hello, I have MediaWiki 1.19.0, PHP 5.3.10 (apache2handler) MySQL 5.1.49. skin vector on a personal NAS Synology DS 212 http://78.246.232.150/MediaWiki/index.php/Main_Page Please how insert Google Translator in the left sidebar ? Have you the code that i must use ? Thank you for your answer. Norbert (France)

Hi, I don't know much about Google Translator. What code do they tell you to insert on your page? Patheticcockroach (talk) 11:33, 19 December 2012 (UTC)Reply

Hello, Google Translator : https://translate.google.com/manager/website/suggestions Google Analytics is installed on my wiki with PCR GUI Inserts - no problem To install on my wiki Google Translator the code is in two part

Part I Paste this code onto your website Copy and paste the following code snippets onto every page you want to translate Place this meta tag before the closing </head>

<meta name="google-translate-customization" content="ddd1b51b68f8337b-524a5e84173c7e7d-g184ec49b87a2c056-29"></meta>

Part II Place this snippet where you'd like to display the Website Translator plugin on your page

<script type="text/javascript">

function googleTranslateElementInit() {

 new google.translate.TranslateElement({pageLanguage: 'en', layout: google.translate.TranslateElement.InlineLayout.SIMPLE, autoDisplay: false}, 'google_translate_element');

} </script><script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>


Thank you for your help Norbert (France)

Then, if I recall correctly, you'll have to set it like:
$wgPCRguii_Inserts['addHeadItem']['on'] = true;
$wgPCRguii_Inserts['addHeadItem']['content'] = array
    (
    '<meta name="google-translate-customization" content="ddd1b51b68f8337b-524a5e84173c7e7d-g184ec49b87a2c056-29"></meta>'
    );
$wgPCRguii_Inserts['SkinBuildSidebar']['on'] = true;
$wgPCRguii_Inserts['SkinBuildSidebar']['content'] = array
    (
    array('Google Translator','<div id="google_translate_element"></div><script type="text/javascript">
function googleTranslateElementInit() {
  new google.translate.TranslateElement({pageLanguage: 'en', layout: google.translate.TranslateElement.InlineLayout.SIMPLE, autoDisplay: false}, 'google_translate_element');
}
</script><script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>')
    );
(if you already have stuff in addHeadItem or SkinBuildSidebar, of course make sure you combine them an not override them) Patheticcockroach (talk) 20:21, 19 December 2012 (UTC)Reply

AdSense in the sidebar[edit]

Hi, I inserted the code for AdSense in the sidebar, but I wish it was always visible ... is it possible?

What's up? Doesn't AdSense show up at all or just occasionally? If the latter is your issue when there is a worry with AdSense and you probably ask at their end. Cheers --[[kgh]] (talk) 22:30, 27 March 2015 (UTC)Reply

Help with TradeDoubler[edit]

Hi, could someone help me to insert the banners of TradeDoubler through this extension? I tried to insert the javascript code provided by the site, but I always get an error

why you are not posting the error? --Metathom (talk) 13:55, 27 March 2015 (UTC)Reply
Indeed, what's up? What would a typical TradeDouble code look like and where should it be placed? Sidebar, etc.? Cheers --[[kgh]] (talk) 22:28, 27 March 2015 (UTC)Reply

Warning: require_once + Fatal error: require_once()[edit]

Hello, my system:

  • MediaWiki 1.24.1
  • PHP 5.3.28-nmm2 (fpm-fcgi)
  • MySQL 5.5.40-nmm1-log
  • Extension installed: /wiki.domain.org/extensions/PCR GUI Inserts 1.0 (all three files: pcr_guii.i18n.php, pcr_guii.php, pcr_guii_body.php)
  • LocalSettings.php: require_once "$IP/extensions/PCR GUI Inserts/pcr_guii.php";

But I receive this errors:

  • Warning: require_once(/www/htdocs/user/wiki.domain.org/extensions/PCR GUI Inserts/pcr_guii.php) [function.require-once]: failed to open stream: No such file or directory in /www/htdocs/user/wiki.domain.org/LocalSettings.php on line 160
  • Fatal error: require_once() [function.require]: Failed opening required '/www/htdocs/user/wiki.domain.org/extensions/PCR GUI Inserts/pcr_guii.php' (include_path='.:/usr/share/php:..') in /www/htdocs/user/wiki.domain.org/LocalSettings.php on line 160

I read several answer in the web about joomla to typo3 and so on, but didn't get what is the problem. Thank you. --Metathom (talk) 13:54, 27 March 2015 (UTC)Reply

EDIT: For example I got the extension CustomSidebar successfully installed in my wiki. --Metathom (talk) 14:04, 27 March 2015 (UTC)Reply

I believe it will make your life easier if you rename the folder "PCR GUI Inserts 1.0" to "PCRGUIInserts" and call the extension with require_once "$IP/extensions/PCRGUIInserts/pcr_guii.php"; Cheers --[[kgh]] (talk) 22:26, 27 March 2015 (UTC)Reply
Thanks!!! Of course! My different paths will not work ;))
  • /wiki.domain.org/extensions/PCR GUI Inserts 1.0/
  • require_once "$IP/extensions/PCR GUI Inserts/
@Patheticcockroach, could you edit the install description line 2? https://www.mediawiki.org/wiki/Extension:PCR_GUI_Inserts#Installation it says:
2. Move the PCR GUI Inserts 1.0 folder to your /extensions/ folder. That does not work! ;) Anyway thanks a lot for the script! --Metathom (talk) 10:28, 28 March 2015 (UTC)Reply
Well, never looked at this section. I have fluffed it up for others. It is a bit different due to restrictions imposed by the template used, but it will work as well. Cheers --[[kgh]] (talk) 10:49, 28 March 2015 (UTC)Reply

Extension error on sidebar[edit]

MediaWiki 1.25.1 PHP 5.4.39 (cgi-fcgi) MySQL 5.5.42-cll

Hi, I have this error in my error_log, PCR don't show anything in sidebar.

PHP Warning: Invalid argument supplied for foreach() in /w/extensions/PCR_GUI/pcr_guii_body.php on line 67 --PediarS (talk) 17:30, 27 May 2015 (UTC)Reply

I got the same error with MW 1.25.2 :(
-- Nicolas NALLET (talk) 09:31, 20 September 2015 (UTC)Reply
This PHP Warning was already there in MW 1.24.x, probably earlier. I accomplished to get rid of this waring however in MW 1.25.x still nothing gets rendered in the sidebar. So this warning is not directly connected to the extension not working. :( --[[kgh]] (talk) 01:05, 28 November 2015 (UTC)Reply
Keeping fingers crossed for a fix. --[[kgh]] (talk) 17:06, 21 September 2015 (UTC)Reply
@User:PediarS, User:Nicolas NALLET, User:Kghbln - please try the version at https://github.com/dennisroczek/PCR_GUI_Inserts - maybe this simple fix already did the trick. I have no 1.25 installed as our php version is too low, but we plan to migrate and i have to fix this extension first then... Dennisroczek (talk) 05:57, 16 October 2015 (UTC)Reply
If you are just talking about changing the I18n then this will not help I'm afraid. The issues start with 1.25x and and in a line unrelated to I18n. Another issue that I realize now is that the current license does not permit changing the source code of the extension. We need a completely new extension. :( --[[kgh]] (talk) 08:27, 16 October 2015 (UTC)Reply
Hi Kghbln,
yeah, I misread your comments and I still haven't any wiki on 1.25. We really should ask if Patheticcockroach is willing to relicense his work. The license allows me to modify the code for the Document Foundation (and actually we do use this git)... CC licenses are really not ideally to license source code. :-(
Regards,
Dennisroczek (talk) 17:18, 17 November 2015 (UTC)Reply
I'm not sure if this is really possible because of the ND. However, asking PCR will be the best solution. Yeah, either GPL, BSD, ISC or MIT, is by far a better solution. Probably sending an e-mail will be better since he does no longer seem to react to talk. Will you take the lead? Cheers --[[kgh]] (talk) 17:25, 17 November 2015 (UTC)Reply
Hi Kghbln,
I have send him an email. Wasn't that easy but at the end I found his mail address at his homepage. Let's see if he will respond...
Regards,
Dennisroczek 23:09, 22 November 2015 (UTC)Reply
Hi Dennis, thank you so much for doing this. Touching wood that he is into it. Otherwise we need to do a rewrite. :( This would be pretty sad. Cheers --[[kgh]] (talk) 23:21, 22 November 2015 (UTC)Reply
Hi,
Thanks for contacting me, for some reason I'm not getting notification for my watched pages. I don't have time to maintain the extension anymore, so I just relicensed it to CC BY-SA, that should be pretty FLOSS.
Regards, Patheticcockroach (talk) 10:28, 23 November 2015 (UTC)Reply
Thanks! :-) 213.160.30.226 12:06, 23 November 2015 (UTC)Reply
Thanks a bunch! Cheers --[[kgh]] (talk) 15:05, 23 November 2015 (UTC)Reply

WMF repo[edit]

Hi Dennisroczek, what about having a WMF repo for this extension? The advantage will be the translation support and the most striking changes get done by other programmers en passant. I'd take the lead for this. Cheers --[[kgh]] (talk) 15:07, 23 November 2015 (UTC)Reply

Hi Kghbln,
David already replied me per mail exactly on that topic (I already asked him after the license change). --> we should do it. ;-)
Go on and take the lead. Mention that my edits on my github account should be imported as they actually contain the license change and I do want to have as many extensions as possible on the official WMF servers. (especially because of the CI tests for REL1_26+)
Dennisroczek (talk) 16:28, 23 November 2015 (UTC)Reply
That's cool! Same thoughts, I guess. :) Repo just requested. If you do not have commit access it's about time to get it. :) Cheers --[[kgh]] (talk) 16:47, 23 November 2015 (UTC)Reply
The repo was created in the meantime and today I did a cleanup of the main file and standardized the extension. However I have not found a fix for the issue noted in the thread above. If you happen to know some people at the document foundation who will probably be able to fix right away will be a cool thing. --[[kgh]] (talk) 01:09, 28 November 2015 (UTC)Reply

New version does not work for me[edit]

First of all: Cool to see work on this extension. I am excited. However, the new beta version documented on the page breaks my wiki. I updated to master to get the latest code. What to do? 2003:F1:C71E:E700:F075:F5BD:6E8B:1BFC 11:24, 15 November 2023 (UTC)Reply

The original has a complex global variable $wgPCRguii_Inserts (array) and as I understood this is not posible this way in the Extension registration (manifest version 2). I guess the original global variable $wgPCRguii_Inserts has to be split into a set of global variables, so the hole documentation has to be rewritten, but I will not do this until the new version is fully tested. But first I liked to know, if there is any interest or should we let this extension die.--WikiForMen (talk) 00:50, 16 November 2023 (UTC)Reply
I was under the impression that rewriting the extension would be easier, but the global variable thing makes it quite complex.
I still have my own collection of extensions that do more or less the same thing:
Maybe you'd like to give them a try?--WikiForMen (talk) 01:15, 16 November 2023 (UTC)Reply
I think you still used the official repo instead of the forked one. Try to use the forked repo to get a preview of what is coming. [[kgh]] (talk) 18:20, 23 November 2023 (UTC)Reply
That's the link: https://github.com/WikiMANNia/mediawiki-extensions-PCRGUIInserts [[kgh]] (talk) 18:21, 23 November 2023 (UTC)Reply
Now it is tested and documented. WikiForMen (talk) 16:55, 24 November 2023 (UTC)Reply

Documentation mixing as a road to mess?[edit]

@WikiForMen I think you are creating a mess here. If I am not mistaken your are starting to document your fork on the page which is linking to the official repository which does not come with the code and features your are documenting. I think this is exactly the reason why this person in the post above was not able to set up the extension properly and failed. I believe we can only document one extension per page to avoid this. Anyhow, did you already create a pull request on Gerrit to get the new code in? In this case there would just be a time misalignment. [[kgh]] (talk) 18:16, 23 November 2023 (UTC)Reply

It is a question of time. There is a reason for giving it "beta" status. I haven't yet found the time to fully test the new version. The realization that the complex array structure of the global configuration variables cannot be used in this way has made things more complicated, resulting in a higher, unplanned time requirement.
If you do not have this time either, you will first have to find another solution. I have pointed out alternatives in the article above.
Rewriting the documentation only makes sense once the new version has been sufficiently tested and works as expected.
Until then, I would like to point out that a look at the extension.json is helpful to see how the extension is to be parameterized.
And no, I don't work with Gerrit. I only see this as a non-binding suggestion to continue to maintain this extension. But it could well be that there is no longer any need for it. WikiForMen (talk) 20:47, 23 November 2023 (UTC)Reply
So you documented the fork? [[kgh]] (talk) 09:08, 24 November 2023 (UTC)Reply
I wrote "it is a question of time" to do so and I would do it after testing it properly. Are you illiterate? WikiForMen (talk) 16:32, 24 November 2023 (UTC)Reply
Beware, you are walking on thin ice. I asked you a simple question I believe. [[kgh]] (talk) 20:07, 24 November 2023 (UTC)Reply
You unjustifiably accused me of causing a mess, when you acted like a Canadian lumberjack with your chaotic reverts. WikiForMen (talk) 20:27, 24 November 2023 (UTC)Reply

Version 3.0.0[edit]

I did a fork with

  • Refactoring for REL1_35+
  • Add $wgPcrGuiMetaItems

Documentation is given.

Note:

Add below the side bar will not work due to changes in REL1_39 injecting HTML with the onSkinBuildSidebar hook is no longer supported. (See Extension:WimaAdvertising)

WikiForMen (talk) 16:35, 24 November 2023 (UTC)Reply