MyBB Hacks

Full Version: [split] XThreads
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
I'm really sorry. But I think it is better to split this post? Biggrin
Yes, was just thinking that - was not my intention to spam the X-Threads thread. Maybe we should rename the thread to Plugin Fail AGAIN by LeeFish?
a new a groovier error was the result of the single quotes:

SQL Code
MyBB has experienced an internal SQL error and cannot continue.
SQL Error:
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''.TABLE_PREFIX.'threads t LEFT JOIN '.TABLE_PREFIX.'xtattachments a ON (a.tid' at line 2
Query:
SELECT t.*, f.name, a.updatetime, a.md5hash, a.uploadtime, a.aid, a.attachname, a.filename FROM '.TABLE_PREFIX.'threads t LEFT JOIN '.TABLE_PREFIX.'xtattachments a ON (a.tid=t.tid) WHERE t.visible=1 AND t.closed NOT LIKE 'moved|%' AND a.thumbs!='' AND t.fid IN ('7','14','29') GROUP BY a.tid ORDER BY a.aid DESC LIMIT 4

Try this:

PHP Code:
			$query = $db->query("
			SELECT t.*, f.name, a.updatetime, a.md5hash, a.uploadtime, a.aid, a.attachname, a.filename
			FROM ".TABLE_PREFIX."threads t
			LEFT JOIN ".TABLE_PREFIX."xtattachments a ON (a.tid=t.tid)
			WHERE t.visible=1 AND t.closed NOT LIKE 'moved|%' AND a.thumbs!='' AND t.fid IN ('".implode("','", $mbhattatgal_tid_array)."')
			GROUP BY a.tid
			ORDER BY a.aid DESC
			LIMIT $mbhattatgal_num
		");

Hi RateU, I have tried this - I got a MYSQL error for the fname on line 2, so I removed it. I now have a gallery BUT I now have a header error on my index page.

Code:
Warning [2] Cannot modify header information - headers already sent by (output started at /customers/leefish.nl/leefish.nl/httpd.www/mybb/inc/plugins/mbhattatgal.php:1) - Line: 51 - File: admin/index.php PHP 5.3.3 (Linux)


And - the actual problem of the missing thumbs is not solved. I looked at the profile images plug in you made and I see that that plugin has a cache, while this one does not. Maybe that is the real issue rather than the query.

Ah, yes. I didn't see that f.name there. I'm sorry.
Could you upload the modified file here again, Lee?
yes, here it is.
Could you activate the plugin just for some seconds, so I can see the error?
You mean the one I have now ? Its activated - you see the problem randomly ATM.

I have a shoutbox - just tell me when you are on site.

If it helps, this post has the problem

http://www.leefish.nl/mybb/showthread.php?tid=360

and this one not

http://www.leefish.nl/mybb/showthread.php?tid=214

But its not about thread age as far as I can see.

I can reproduce it if you like.
Try to change the thumb to 160x120 in the plugin first:

PHP Code:
$mbhatt_att_thumb = xthreads_get_xta_url($mbhatt).'/thumb160x120';

Ok, I did that - it has fixed some of them... but not all.
This is the full code of the function as it is now.

PHP Code:
function mbhattatgal_run()
{
    global $mybb, $db, $collapsed, $collapsedimg, $templates, $theme, $mbhattachment_gallery;
	if($mybb->settings['mbhattatgal_ed'] != 0)
	{
		$mbhattatgal_num = intval($mybb->settings['mbhattatgal_num']);
		if(is_array(explode(',', $mybb->settings['mbhattatgal_fid'])))
		{
			foreach(explode(',', $mybb->settings['mbhattatgal_fid']) as $mbhattatgal_tid)
			{
				$mbhattatgal_tid_array[] = intval($mbhattatgal_tid);
			}
		}
			$query = $db->query("
			SELECT a.updatetime, a.md5hash, a.uploadtime, a.aid, a.attachname, a.filename, t.*
			FROM ".TABLE_PREFIX."xtattachments a
			LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=a.tid)
			WHERE t.visible=1 AND t.fid IN ('".implode("','", $mbhattatgal_tid_array)."')
			GROUP BY a.tid
			ORDER BY RAND()
			LIMIT $mbhattatgal_num
		");
		
		while($mbhatt = $db->fetch_array($query))
		{
			$mbhatt_username = htmlspecialchars_uni($mbhatt['username']);
			$mbhatt_title = htmlspecialchars_uni($mbhatt['subject']);
			$mbhatt_postlink = get_thread_link(intval($mbhatt['tid']));
			$mbhatt_datetime = my_date($mybb->settings['dateformat'], $mbhatt['uploadtime']).' '.my_date($mybb->settings['timeformat'], $mbhatt['uploadtime']);
$mbhatt_att_thumb = xthreads_get_xta_url($mbhatt).'/thumb160x120';
			eval("\$mbhatt_gallery_gallery .= \"".$templates->get("mbhatt_gallery_gallery")."\";");
		}
		eval("\$mbhattachment_gallery = \"".$templates->get("mbhatt_gallery")."\";");
	}
}
?>


Lee boggles in horror as site collapses
Pages: 1 2 3
Reference URL's