PM Popup won't show
#32
I know this is an old thread but I found a better fix that could / should be extended to other plugins that need to change things like the body tag. I post this as more of an fyi if other people cruise on in.

What is different about this one is that if there are other onload() events that they will still get added to the modified onload handler.

In any case here is my version of the imageresizer fix:

Origional:
function imageresizer_page($page)
{
    global $mybb;
    // var_dump($mybb);
    if ($mybb->settings['image_resizer_active'] == "yes")
    {
        $page = str_replace('</head>', imageresizer_javascript().'</head>', $page);
        $page = preg_replace('#<body(.*?)>#', '<body onload="resize_images()"$1>', $page);
    }
    
    return $page;
} 

New Version:
function imageresizer_page($page)
{
global $mybb;
// var_dump($mybb);
if ($mybb->settings['image_resizer_active'] == "yes")
{
$page = str_replace('</head>', imageresizer_javascript().'</head>', $page);
$page = preg_replace('/<body((.*?)(onload="(.*?)"))?(.*?)>/i', '<body onload="resize_images(); $4"$2$5>', $page);
}

return $page;
}


Messages In This Thread
PM Popup won't show - by Paul124897 - 2006-12-07, 03:34 PM
RE: PM Popup won't show - by talisman - 2006-12-07, 03:51 PM
RE: PM Popup won't show - by Paul124897 - 2006-12-07, 03:55 PM
RE: PM Popup won't show - by Ryan Gordon - 2006-12-07, 03:56 PM
RE: PM Popup won't show - by Paul124897 - 2006-12-07, 04:01 PM
RE: PM Popup won't show - by Christian - 2006-12-08, 05:03 AM
RE: PM Popup won't show - by Paul124897 - 2006-12-09, 12:21 PM
RE: PM Popup won't show - by arashpour - 2006-12-09, 03:22 PM
RE: PM Popup won't show - by Justin - 2006-12-09, 03:30 PM
RE: PM Popup won't show - by Martin M. - 2006-12-09, 03:34 PM
RE: PM Popup won't show - by Paul124897 - 2006-12-09, 05:58 PM
RE: PM Popup won't show - by arashpour - 2006-12-09, 05:21 PM
RE: PM Popup won't show - by Christian - 2006-12-10, 11:44 PM
RE: PM Popup won't show - by Ryan Loos - 2006-12-10, 11:47 PM
RE: PM Popup won't show - by Paul124897 - 2006-12-11, 10:44 AM
RE: PM Popup won't show - by Christian - 2006-12-10, 11:57 PM
RE: PM Popup won't show - by Christian - 2006-12-12, 09:24 PM
RE: PM Popup won't show - by Paul124897 - 2006-12-13, 03:57 PM
RE: PM Popup won't show - by Martin M. - 2006-12-13, 04:34 PM
RE: PM Popup won't show - by Paul124897 - 2006-12-13, 05:11 PM
RE: PM Popup won't show - by Ryan Gordon - 2006-12-13, 09:28 PM
RE: PM Popup won't show - by Paul124897 - 2006-12-13, 10:56 PM
RE: PM Popup won't show - by Christian - 2006-12-14, 12:26 AM
RE: PM Popup won't show - by Paul124897 - 2006-12-14, 06:11 PM
RE: PM Popup won't show - by Christian - 2006-12-15, 01:25 AM
RE: PM Popup won't show - by Paul124897 - 2006-12-15, 01:51 AM
RE: PM Popup won't show - by Christian - 2006-12-15, 02:07 AM
RE: PM Popup won't show - by Ryan Gordon - 2006-12-15, 02:21 AM
RE: PM Popup won't show - by Christian - 2006-12-15, 04:02 AM
RE: PM Popup won't show - by Paul124897 - 2006-12-15, 02:54 PM
RE: PM Popup won't show - by pepotiger - 2007-02-01, 06:45 PM
RE: PM Popup won't show - by nobleclem - 2007-09-09, 07:10 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)