MyBB Hacks

Full Version: XThread error!: SHOWTHREAD IN GALLERY
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
I'm not sure as I haven't checked, but a quick scan of the plugin, and I suspect these lines (appears in multiple locations):

PHP Code:
				$templates->cache('postbit');
				$templates->cache('postbit_classic');

This probably conflicts with XThreads first post handling, but the above code is incorrect, for a number of reasons:

  1. It's already cached by earlier bits of the code:

    PHP Code:
    	if(!$templates->cache['postbit'])
    		$templates->cache('postbit');
    		
    	if(!$templates->cache['postbit_classic'])
    		$templates->cache('postbit_classic');

  2. The two calls really should be one, so that it doesn't double query
  3. It doesn't check for any previously cached variable, effectively adding two queries for nothing most of the time
  4. It overwrites any previously cached variable (effectively destroying any modification applied to it before)


You can safely delete all 12 instances of the code above in the first code box.
ZiNgA BuRgA I had this issues reported here (http://mybbhacks.zingaburga.com/showthre...http://mybbhacks.zingaburga.com/showthread.php?tid=577&pid=461 and solved by doing the code edits above.
Thank you. Just reporting to let people know that this works.
NO NEED TO DEACTIVATE THE PLUGIN JUST EDIT AND REUPLOAD. REFRESH PAGE.
Pirata Nervo made a patch for the plugin, and i send him your instructions as well
Now both plugins are working fine Biggrin
Thanks!
Thanks for that Smile
Sadly PNervo made a new patch and MyAdvertisements and XThread will not work together

Could someone enter here
and help me a little explaining him the situation?
http://forums.mybb-plugins.com/Thread-My...http://forums.mybb-plugins.com/Thread-My-Advertisements-not-compatible-with-XThre

Thanks in advance
Quickly scanning the code it looks like this will be a tricky one to do.
I'll have a bit of a think.

EDIT: I can't seem to access the thread whilst logged in.
Anyway, maybe suggest to him this:

I don't really like this solution, but it may work (untested).  Maybe he's already done something like this:

PHP Code:
    if (empty($postbit_backup))
    {
        $postbit_backup = $templates->cache['postbit'];
        $postbit_classic_backup = $templates->cache['postbit_classic'];
    }

Maybe change to:

PHP Code:
    static $restore_postbit = null;
    if (empty($postbit_backup) || $restore_postbit)
    {
        $viewmode = ($mybb->settings['postlayout'] == 'classic' ? '_classic':'');
        $restore_postbit = (
            !isset($restore_postbit)
            && isset($templates->cache['postbit_first'.$viewmode])
            && $templates->cache['postbit_first'.$viewmode] == $templates->cache['postbit'.$viewmode]
        );
        $postbit_backup = $templates->cache['postbit'];
        $postbit_classic_backup = $templates->cache['postbit_classic'];
    }

(12-06-2010 08:23 AM)ZiNgA BuRgA Wrote: [ -> ]Quickly scanning the code it looks like this will be a tricky one to do.
I'll have a bit of a think.

EDIT: I can't seem to access the thread whilst logged in.
Anyway, maybe suggest to him this:

I don't really like this solution, but it may work (untested).  Maybe he's already done something like this:

PHP Code:
    if (empty($postbit_backup))
    {
        $postbit_backup = $templates->cache['postbit'];
        $postbit_classic_backup = $templates->cache['postbit_classic'];
    }

Maybe change to:

PHP Code:
    static $restore_postbit = null;
    if (empty($postbit_backup) || $restore_postbit)
    {
        $viewmode = ($mybb->settings['postlayout'] == 'classic' ? '_classic':'');
        $restore_postbit = (
            !isset($restore_postbit)
            && isset($templates->cache['postbit_first'.$viewmode])
            && $templates->cache['postbit_first'.$viewmode] == $templates->cache['postbit'.$viewmode]
        );
        $postbit_backup = $templates->cache['postbit'];
        $postbit_classic_backup = $templates->cache['postbit_classic'];
    }


I may try that. Glas, could you please replace those lines with what Zinga has suggested? Let me know if it works please.
using 1.9 + the fix it stills the same
i've noticed that gallery is now fixed
with your fix
i've noticed that MyAchievements and Newpoints items do not appear

But i don't care about that one
(12-23-2010 08:37 AM)glas Wrote: [ -> ]using 1.9 + the fix it stills the same
i've noticed that gallery is now fixed
with your fix
i've noticed that MyAchievements and Newpoints items do not appear

But i don't care about that one

I'm lost, what's working and what's not working?
Pages: 1 2 3
Reference URL's