Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 [split] XThreads
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #11
RE: [split] XThreads
I'm really sorry. But I think it is better to split this post? Biggrin

10-14-2010 07:07 AM
Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #12
RE: [split] XThreads
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



[Image: leelink.gif]
MYBB1.6 & XThreads
(This post was last modified: 10-14-2010 07:21 AM by leefish.)
10-14-2010 07:19 AM
Visit this user's website Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #13
RE: [split] XThreads
Try this:

PHP Code:
1
2
3
4
5
6
7
8
9
			$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
		");


10-14-2010 07:26 AM
Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #14
RE: [split] XThreads
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.



[Image: leelink.gif]
MYBB1.6 & XThreads
10-14-2010 07:51 AM
Visit this user's website Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #15
RE: [split] XThreads
Ah, yes. I didn't see that f.name there. I'm sorry.
Could you upload the modified file here again, Lee?

(This post was last modified: 10-14-2010 09:01 AM by RateU.)
10-14-2010 09:01 AM
Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #16
RE: [split] XThreads
yes, here it is.


Attached File(s)
.php  mbhattatgalv2.php (Size: 6.98 KB / Downloads: 475)


[Image: leelink.gif]
MYBB1.6 & XThreads
10-14-2010 09:22 AM
Visit this user's website Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #17
RE: [split] XThreads
Could you activate the plugin just for some seconds, so I can see the error?

10-14-2010 09:51 AM
Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #18
RE: [split] XThreads
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.


[Image: leelink.gif]
MYBB1.6 & XThreads
(This post was last modified: 10-14-2010 10:21 AM by leefish.)
10-14-2010 10:07 AM
Visit this user's website Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #19
RE: [split] XThreads
Try to change the thumb to 160x120 in the plugin first:

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


10-14-2010 10:31 AM
Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #20
RE: [split] XThreads
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:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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


[Image: leelink.gif]
MYBB1.6 & XThreads
(This post was last modified: 10-14-2010 10:54 AM by leefish.)
10-14-2010 10:38 AM
Visit this user's website Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: