Welcome, Guest
Username Password: Remember me

Hide plugin on content pages
(1 viewing) (1) Guest
  • Page:
  • 1
  • 2

TOPIC: Hide plugin on content pages

Hide plugin on content pages 14 years ago #2541

  • dryabov
  • OFFLINE
  • Administrator
  • Denis Ryabov, Lead Developer
  • Posts: 4867
  • Karma: 105
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;

Hide plugin on content pages 14 years ago #2542

  • Barnabas
  • OFFLINE
  • Moderator
  • Posts: 329
  • Karma: 6
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.

Hide plugin on content pages 14 years ago #2546

  • gavner
  • OFFLINE
  • Fresh Boarder
  • Posts: 12
  • Karma: 0
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

Hide plugin on content pages 14 years ago #2548

  • Barnabas
  • OFFLINE
  • Moderator
  • Posts: 329
  • Karma: 6
Glad we could help. Thanks for posting the result. I'll take your word for it.
  • Page:
  • 1
  • 2
Time to create page: 0.23 seconds

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.