Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 XThread error!: SHOWTHREAD IN GALLERY
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #21
RE: XThread error!: SHOWTHREAD IN GALLERY
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:
    450
    451
    452
    453
    454
    	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.

My Blog
(This post was last modified: 11-18-2010 09:30 AM by ZiNgA BuRgA.)
11-18-2010 09:28 AM
Find all posts by this user Quote this message in a reply
Skiilz Offline
Member
***
Posts: 198
Joined: Nov 2010
Post: #22
RE: XThread error!: SHOWTHREAD IN GALLERY
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.

[Image: 468x602b.png]
11-19-2010 08:43 AM
Find all posts by this user Quote this message in a reply
Glas Offline
Member
***
Posts: 106
Joined: Jul 2010
Post: #23
RE: XThread error!: SHOWTHREAD IN GALLERY
Pirata Nervo made a patch for the plugin, and i send him your instructions as well
Now both plugins are working fine Biggrin
Thanks!
11-19-2010 08:49 AM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #24
RE: XThread error!: SHOWTHREAD IN GALLERY
Thanks for that Smile

My Blog
11-19-2010 09:01 AM
Find all posts by this user Quote this message in a reply
Glas Offline
Member
***
Posts: 106
Joined: Jul 2010
Post: #25
RE: XThread error!: SHOWTHREAD IN GALLERY
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
12-06-2010 03:38 AM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #26
RE: XThread error!: SHOWTHREAD IN GALLERY
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:
1
2
3
4
5
6
7
8
9
10
11
12
    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'];
    }


My Blog
(This post was last modified: 12-06-2010 04:21 PM by ZiNgA BuRgA.)
12-06-2010 08:23 AM
Find all posts by this user Quote this message in a reply
Glas Offline
Member
***
Posts: 106
Joined: Jul 2010
Post: #27
RE: XThread error!: SHOWTHREAD IN GALLERY
bumping to pn and zinga
http://forums.mybb-plugins.com/Thread-My...http://forums.mybb-plugins.com/Thread-My-Advertisements-not-compatible-with-XThreads-part-2?pid=4392
12-14-2010 10:15 AM
Find all posts by this user Quote this message in a reply
Pirata Nervo Offline
Member
***
Posts: 235
Joined: Jan 2008
Post: #28
RE: XThread error!: SHOWTHREAD IN GALLERY
(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:
1
2
3
4
5
6
7
8
9
10
11
12
    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.
12-15-2010 04:26 AM
Find all posts by this user Quote this message in a reply
Glas Offline
Member
***
Posts: 106
Joined: Jul 2010
Post: #29
RE: XThread error!: SHOWTHREAD IN GALLERY
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
Find all posts by this user Quote this message in a reply
Pirata Nervo Offline
Member
***
Posts: 235
Joined: Jan 2008
Post: #30
RE: XThread error!: SHOWTHREAD IN GALLERY
(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?
12-23-2010 08:41 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: