Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Using XThreads Custom Thread Field to Hold Additional Data
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #11
RE: Using XThreads Custom Thread Field to Hold Additional Data
(03-29-2011 10:11 AM)ZiNgA BuRgA Wrote:  Here's a bit more of a technical explanation.
xthreads_attach.php was somewhat designed to handle two extreme cases which the MyBB attachments.php doesn't do well (as well as a number of other things, but that's irrelevant here):
- very large (i.e. multi-gigabyte) downloads
- many requests (i.e. an image gallery displaying a lot of thumbnails on a page)....
....
For the latter case, imagine a gallery 18 thumbnails per page.  Loading the core effectively means that a user visiting forumdisplay will cause the MyBB core to be loaded 19 times, instead of just once.  Quite a bit more load obviously, but if your host isn't complaining, then this shouldn't be much of an issue.  If you're not using something like this, then you don't need to worry either.

Indeed, and that of course is why I like XThreads so much - I DO have those kinds of galleries - and my site is not exactly a speeding bullet as is, so I would be reluctant to slow it further.

(03-29-2011 10:11 AM)ZiNgA BuRgA Wrote:  There may be a fix for this issue on XThreads' end by directly linking thumbnails rather than serving through xthreads_attach.php - I don't know why I didn't think of it a long time ago.  It might be a bit too late to change now (breaks template edits) though there may be a bit of a workaround.

that would be very neat, but yes, there are a lot of users out there and it would blow up the templates for sure - and I think that not many MYBB  forums are that image intensive, so it would be a lot of trouble for those XThrteads users with not a great deal of gain.

(03-29-2011 10:11 AM)ZiNgA BuRgA Wrote:  But there's another thing you could do - just simply conditionally define LOAD_SESSION based on whether the user is trying to view a thumbnail or not.  May require a fair bit of editing though.

I think that would be seriously beyond my programming skills at the moment.

But, thanks for the explanation - I did not realise that the Core MYBB loaded like that.


[Image: leelink.gif]
MYBB1.6 & XThreads
03-30-2011 03:39 PM
Visit this user's website Find all posts by this user Quote this message in a reply
techu Offline
Member
***
Posts: 154
Joined: Sep 2010
Post: #12
RE: Using XThreads Custom Thread Field to Hold Additional Data
(03-30-2011 03:39 PM)leefish Wrote:  
(03-29-2011 10:11 AM)ZiNgA BuRgA Wrote:  But there's another thing you could do - just simply conditionally define LOAD_SESSION based on whether the user is trying to view a thumbnail or not.  May require a fair bit of editing though.

I think that would be seriously beyond my programming skills at the moment.

But, thanks for the explanation - I did not realise that the Core MYBB loaded like that.

you can take a look at xmlhttp.php, it loads a lite version of the core. You can get a idea from that..



hey yumi I was wondering why did you include this piece of code in xthreads_attach.php

Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
define('LOAD_SESSION', false);
// need session class, mybb class, db class
// OR, just check cookie for session & load DB to verify session + check perms
// if using error_no_permission, must load entire global core



if(LOAD_SESSION) {
	// we'll be lazy and just load the full MyBB core
	define('IN_MYBB', 1);
	define('THIS_SCRIPT', 'xthreads_attach.php');
	define('NO_ONLINE', 1); // TODO: check
	
	require './global.php';
	
	// TODO: disable calling send_page_headers()
	
	// TODO: user perms
	// TODO: maybe do online for WOL
}


[Image: banner.png]
03-31-2011 12:39 AM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #13
RE: Using XThreads Custom Thread Field to Hold Additional Data
(03-31-2011 12:39 AM)techu Wrote:  hey yumi I was wondering why did you include this piece of code in xthreads_attach.php
I mentioned the reason above the code you pasted.  Originally had planned to perform permissions checking on there, but I've decided to scrap the idea.  It's now "useless code", but could be useful for something like what leefish wants to do.

My Blog
03-31-2011 09:49 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: