XThreads
Author Message
My Spiel
XThreads is one of my larger plugins which I have been working on for a while.  Originally planned to release it inline with MyBB 1.6, but who knows when that'll be out.  It perhaps doesn't include everything I wanted it to, but does have most of the things (plus I want to move onto other projects).

What does it do?
Take a look at RateU's forum for some nice ideas of what it can do.  I also have some more basic examples here of what can be done with XThreads.  I'm pretty sure there are many other applications of this plugin, but those examples just give you some simple ideas.

The basic idea is giving you the ability to define custom fields for your threads, and providing methods to give you a lot of flexibility with customising forums.

Warning: I'm not going to bother with "beta" labels and so on.  I've done some testing on this myself, but it's by no means extensive.  Use this at your own risk.

Installation Instructions: standard installation procedures apply - you can find them in the announcement here.
You may need to CHMOD the uploads/xthreads_ul/ folder to 0777 after uploading the files (probably won't though).

Upgrade Instructions: unless stated otherwise, the general procedure for upgrades is to simply upload the new files, then visit your AdminCP.  In there, you'll be presented with a notice to run the upgrade - just follow what it says from there on.

Usage Instructions: this is a complex plugin, and unfortunately, you're probably going to have to figure this out yourself, depending on what you want to achieve with this plugin.  HTML and CSS knowledge is strongly recommended; you should also be familiar with MyBB's template system.  Some demonstrations can be found here - hopefully these will give you a good idea of how things work.  I suggest looking at the thread descriptions example, as this is fairly easy to understand (IMO).  If you can understand how everything works, there, perhaps try out the gallery example.

Known conflicting plugins
- MyPlaza Turbo -
If you are using MyPlaza Turbo, note that the author decided to use a particularly odd method to implement certain functionality, practically destroying compatibility with any plugin which hooks into the forum add/edit routines.  I've included a patch to address this issue - you need to replace inc/myplaza/myplaza_admin_plugin.php with the following file (it's unlikely that this will be committed as the author has decided to discontinue development)

.php  myplaza_admin_plugin.php (Size: 56.27 KB / Downloads: 2417)

- PL9 Forum Icons -
Affects certain functionality.  See here for a solution.

- PHP in Templates, v1.4 or older -
Similar to PL9 Forum Icons - solution is just to update to the latest version.

- MyAdvertisements - (update: older versions only, later versions may not conflict)
Affects some thread functionality, see here for a solution.

- Group Post CSS -
See here http://mybbhacks.zingaburga.com/showthre...http://mybbhacks.zingaburga.com/showthread.php?tid=378&pid=59

All bug reports, suggestions, criticisms are appreciated (though I may not always implement suggestions) so please feel free to post them.
If you find this plugin useful, I would be grateful if you could give some token of appreciation for the work that has gone into this, and perhaps post some example usages you've come up with in the XThreads forum to help others get an idea of what can be achieve with this plugin (and for my own interest's sake Tongue).


Github: https://github.com/zingaburga/XThreads-MyBB-Plugin
Note: do NOT use the Github version, unless you know what you're doing
Changelogs: v1.10, v1.20, v1.21, v1.22, v1.23, v1.24, v1.25, v1.26, v1.27, v1.30, v1.31, v1.32, v1.337, v1.40, v1.41, v1.42, v1.43, v1.44, v1.45, v1.46, v1.47, v1.50, v1.51, v1.52, v1.53, v1.60, v1.61, v1.62, v1.63, v1.64, v1.65, v1.66, v1.67, v1.68
(This post was last modified: 12-25-2015 12:46 PM by ZiNgA BuRgA.)
Find all posts by this user
Quote this message in a reply
Download: xthreads-1.68.7z (114.53 KB)
Plugin Version: 1.68
Last Updated: 12-25-2015, 12:46 PM

Downloads: 8,437
MyBB Compatibility: 1.4.x, 1.6.x, 1.8.x
Plugin License: GPLv3
Uploader: ZiNgA BuRgA
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #641
RE: XThreads
Great upgrade to the images functionality, I am using the new cropped thumbnail feature on my new site and I am very pleased with it - thank you very much.

What I did notice is that the images are taking longer to upload - that is there is a longer wait than before for the image to be processed at upload. (I think I see why - it is because the thumbnails etc need to be built at upload?) I have a lot of new users who are prone to panic and they are abandoning threads and reposting rather than waiting for the image to upload.

Is there anyway I can add an "image loading please wait" message or something like that so these noobs stop panicking and abandoning their posts??


[Image: leelink.gif]
MYBB1.6 & XThreads
12-18-2012 09:47 PM
Visit this user's website Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #642
RE: XThreads
(12-18-2012 09:47 PM)leefish Wrote:  Is there anyway I can add an "image loading please wait" message or something like that so these noobs stop panicking and abandoning their posts??
Only via Javascript.

Is there seriously a longer load time than not doing a crop?  I'd be surprised if there was a noticeable difference to be honest...

My Blog
12-19-2012 11:55 AM
Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #643
RE: XThreads
Well, if you like you can try it on my board - I am not sure WHAT it is - but it does seem slower than a test image field I have without a crop.

This is a new server though (I am on hawkhost) and I am trying not to run several million plugins - it does feel MUCH slower than on leefish, but that is a VPS, and maybe I am just spoiled. I will continue to monitor it.

Also, I don't know if you are interested, but I made an image gallery using the new crop thumbnails if you would like to see it - it is here:

http://blackcanvas.net/Forum-Abstract-Art-Gallery

I used floated images rather than a set of TDs as I wanted it to be flexible across many screen widths - unfortunately, that does cause a problem at the bottom of the gallery, as sometimes the images don't fill the row.


[Image: leelink.gif]
MYBB1.6 & XThreads
12-19-2012 12:34 PM
Visit this user's website Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #644
RE: XThreads
(12-19-2012 12:34 PM)leefish Wrote:  Well, if you like you can try it on my board - I am not sure WHAT it is - but it does seem slower than a test image field I have without a crop.

This is a new server though (I am on hawkhost) and I am trying not to run several million plugins - it does feel MUCH slower than on leefish, but that is a VPS, and maybe I am just spoiled. I will continue to monitor it.
Let's see if we can be less subjective.
Try running htop through the VPS's SSH and monitor CPU usage over a while, then try posting an image and see if it spikes for a while until the page loads.
Also, how big are the images being processed, and what's the server's CPU + RAM + bandwidth?

My Blog
(This post was last modified: 12-19-2012 04:26 PM by ZiNgA BuRgA.)
12-19-2012 04:26 PM
Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #645
RE: XThreads
Hello ZingaBurga, I don't know how to do that on the VPS Frown

I did get the data from the Hawkhost resource usage panel:

Code:
1
2
3
4
5
6
7
8
9
10
From	To	aCPU	mCpu	aEP	mEP	lEP	aMEM	mMEM	lMEM	MemF	MepF
12-19 22:34	12-19 22:35	0	100	1	2	20	16.4M	28.0M	1.0G	0	0
12-19 22:30	12-19 22:35	0	100	1	7	20	22.6M	62.4M	1.0G	0	0
12-19 22:25	12-19 22:30	0	33	1	7	20	20.6M	96.7M	1.0G	0	0
12-19 22:20	12-19 22:25	0	16	0	6	20	5.6M	51.1M	1.0G	0	0
12-19 22:15	12-19 22:20	0	0	0	1	20	4.1M	13.9M	1.0G	0	0
12-19 22:10	12-19 22:15	0	0	0	3	20	11.1M	28.9M	1.0G	0	0
12-19 22:05	12-19 22:10	0	16	0	6	20	11.4M	48.9M	1.0G	0	0
12-19 22:00	12-19 22:05	0	0	0	3	20	5.2M	28.4M	1.0G	0	0
12-19 21:00	12-19 22:00	0	100	0	6	20	8.6M	88.3M	1.0G	0	0


Images were being uploaded in that snapshot where the mEP was 100 (22:30 - 22:34). That results in resources being limited.

I am not sure what the CPU is, but on all Hawkhost shared hosting memory is at 128mb (in cPanel it says 1048576 KB) and the bandwidth per month is 45 GB.  

There were 5 images uploaded in that time frame

Image sizes:

226 kb 392x504 (all image dimensions wxh)
210 kb 504x648
81 kb 504x648
61kb 750x475
223kb 504x648

These are my image field settings:
See image attached

mythumb=scale_min(200, 200)->crop(200,200) |160x120|240x180|304x228|640x480

Multiple values - no.

What I did find was that the cropped image (the thumb) was being made but the actual IMAGE (the full attachment that all the thumbnails are made from) was not there (it was not in the showthread where I show the 640x480 image) and nor were the other thumbnails from the above list. However, I am unsure if that was because the resources for the site were limited.

The users also uploaded all those 5 images in about a 5 minute time frame, so it was very POW POW POW.

I also wanted to add - I checked my plugins and I am using MyBB publisher to publish my new threads (with  xthreads images) to tumblr and facebook. Link to plugin below.

http://www.communityplugins.com/forum/fo...http://www.communityplugins.com/forum/forumdisplay



Attached File(s) Thumbnail(s)
       


[Image: leelink.gif]
MYBB1.6 & XThreads
(This post was last modified: 12-20-2012 04:48 PM by leefish.)
12-20-2012 02:53 PM
Visit this user's website Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #646
RE: XThreads
Thanks for the info.
I presume you're on the basic plan here?  If so, the CPU is mentioned below, but those plans don't look like VPS ones :/

I don't understand the info from the resource usage - it probably has its own meaning anyway.  There's a CPU spike in your graph, however I can't see the times (you've cut that off).

I've done a quick timing test on localhost - with five 2560x1600 images at once, it takes around 2.1 seconds to generate the thumbnails.  My CPU is probably better than that of your server, though I think the size of the images more than compensates for that.  Replacing your mythumb entry above with "200x200" doesn't seem to have any impact on thumbnail generation time, so I don't take the theory that cropping is slowing things down.
2.1 seconds is slow, but it shouldn't be anywhere in the league of minutes.  Do note that the more thumbnails you generate, the slower the generation is going to be, although I honestly don't think that's the problem here.

I don't know about the plugin or what it exactly does.  Sending external requests is potentially slow, although one would think that if it's just to Facebook, it shouldn't really be too much of an issue.

Some things to try:
- make a clean board on the server with only XThreads generating thumbnails and see if it's slow
- try having only one thumbnail being generated and see the speed

(12-20-2012 02:53 PM)leefish Wrote:  What I did find was that the cropped image (the thumb) was being made but the actual IMAGE (the full attachment that all the thumbnails are made from) was not there (it was not in the showthread where I show the 640x480 image) and nor were the other thumbnails from the above list. However, I am unsure if that was because the resources for the site were limited.
Sounds very bizarre to me.  Do you see the thumbnail files actually being generated under uploads/xthreads_ul/ts_<something> ?

My Blog
12-20-2012 09:19 PM
Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #647
RE: XThreads
Thank you for replying - I have two sites (one is on a VPS - a friend gave me a corner of his dedi and set it up for me, but really for what I know what to do it is like being on a very fast shared host re managing the server at all) and the other is on Hawkhost basic plan. It is the Hawkhost one with the "issue". I am sorry the data was incomplete but it is quite hard to get the data from a shared host reports. I think.

I have done a couple of things: I have set up post flooding so they are not hammering at my server uploading an image every minute.  I will go through the thumbnail generation and make sure that we make ONLY what we need (the cropped thumb and the showthread image).

I will set up a test board with only XThreads and test with images of only one thumb and see if that affects it (that will take a little time as I am slow).

The plugin is by Pavemen (I think he is a good plugin maker) and it posts the images from the thread to tumblr and facebook at time of upload.

The thumbnail thing WAS bizarre - I have never seen it before and was baffled by it. I will see if I can reproduce it on this test board (I did not want to have a lot of broken images on the live site as that looks bad and the site is quite new) so I did delete those threads.


[Image: leelink.gif]
MYBB1.6 & XThreads
12-20-2012 10:16 PM
Visit this user's website Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #648
RE: XThreads
Update on this - it is the combination of XThreads and MyBB Publisher all happening at the time of upload that is causing the spikes. I will set up another forum as a staging area and MOVE posts across once uploaded. I needed to do that anyway for spam.

Running the two apart did not cause any problems - that is - upload the image - topic is posted - post to publisher.


[Image: leelink.gif]
MYBB1.6 & XThreads
(This post was last modified: 12-22-2012 01:10 PM by leefish.)
12-22-2012 01:08 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Firefox Wins Offline
Member
***
Posts: 164
Joined: Mar 2008
Post: #649
RE: XThreads
(12-20-2012 02:53 PM)leefish Wrote:  ... I don't know how to do that on the VPS Frown

FYI:
Quote:If you want to install ‘htop’ (a very good Linux process viewer) onto a server running CentOS, you may run into some errors.

Firstly, you need to make sure you have the DAG RPM Repository installed.

Create a new file:

    vi /etc/yum.repos.d/dag.repo


containing:

    [dag]
    name=Dag RPM Repository for Red Hat Enterprise Linux
    baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag
    gpgcheck=1
    enabled=1


Then you need to add the GPG key for the repository. Run the following command:

    rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt

Finally, install htop:

    yum install htop

It should update the repository, download the software and install it. Once it’s done, you can run ‘htop’ via the command line. If you’re installing on multiple servers and don’t want to manually reconfigure it every time, you can upload a default settings file.

Create/edit the file /root/.htoprc

    vi /root/.htoprc


Add/replace it with the following (this is an example htop configuration):

    # Beware! This file is rewritten every time htop exits.
    # The parser is also very primitive, and not human-friendly.
    fields=0 48 17 2 46 47 49 1
    sort_key=46
    sort_direction=1
    hide_threads=0
    hide_kernel_threads=1
    hide_userland_threads=0
    shadow_other_users=0
    highlight_base_name=1
    highlight_megabytes=1
    highlight_threads=0
    tree_view=0
    header_margin=0
    detailed_cpu_time=0
    color_scheme=0
    delay=15
    left_meters=CPU Memory Swap
    left_meter_modes=1 1 1
    right_meters=Tasks LoadAverage Uptime Hostname
    right_meter_modes=2 2 2 2

Save the file and run htop again (it may delete this file, but it will import the settings).
~Installing htop on a CentOS VPS

ps.
htop is nice, but you can also watch for spikes with regular 'top' command.
(This post was last modified: 12-26-2012 06:10 PM by Firefox Wins.)
12-26-2012 06:08 PM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #650
RE: XThreads
I should point out that it's unknown whether leefish is running CentOS, or even what version - it's possible that it could be a Debian based distro, where the instructions would be quite different.
But the plan doesn't seem to indicate that root access is given, so it doesn't matter anyway.

My Blog
12-26-2012 09:51 PM
Find all posts by this user Quote this message in a reply


Forum Jump: