Hide plugin on content pages

dryabov
14 years ago
I've looked at this plugin. The problem here is that it adds javascripts and styles in its constructor, that is before any event. I don't know how to solve the problem without patching of the plugin. Correct solution should be something like replacing
            parent::__construct( $subject );

by
            parent::__construct( $subject );
}
function onAfterRoute()
{
if(defined('_MJ')) return;

and
	function onPrepareContent( &$article, &$params ){

by
	function onPrepareContent( &$article, &$params ){
if(defined('_MJ')) return;
Barnabas
14 years ago
I put that code into my copy of scrollingsharebutton.php and it did hide the share buttons in the mobile version, but it also affected the non mobile version by making the buttons appear above the text instead of beside it.
I'm sorry but I can't spend any more time on this. The solution I gave above seemed to work. I'm not sure of the circumstances when it would fail. Thanks for your analysis, it was helpful.
gavner
14 years ago
yes i have been watching you guys work hard to solve this, thanks alot for that. I tried everything, BUT i only added

function onPrepareContent( &$article, &$params ){

if(defined('_MJ')) return;

to the file and it worked both on the site properly and hides it on the phone. check it for yourself and let me know
Barnabas
14 years ago
Glad we could help. Thanks for posting the result. I'll take your word for it.
2

By continuing to use this site you consent to the use of cookies on your device as described in our cookie policy unless you have disabled them. This site will not function correctly without cookies.

I accept cookies from this site.