Post: #1
Q: Can We Use MyBB Editor For Our XThreads Textarea?

A:
This is possible if we have one textarea only. So, if our XThreads applications only use one textarea only, and it doesn't use MyBB textarea, we can grab the MyBB editor and attach it to our textarea.
This is not XThreads limitation, but this is MyBB Editor limitation.
To do this:
  • Edit the custom thread field, and set the Use Custom Input HTML setting to Yes.
  • Inside the textarea of the Input Field HTML setting, by default, there is a code like this:

    HTML Code
    <textarea{NAME_PROP}{MAXLEN_PROP}{HEIGHT_PROP_ROWS}{WIDTH_PROP_COLS}{TABINDEX_PROP}>{VALUE}</textarea>

    Assign an ID for the textarea, and name it as message:

    HTML Code
    <textarea id="message"{NAME_PROP}{MAXLEN_PROP}{HEIGHT_PROP_ROWS}{WIDTH_PROP_COLS}{TABINDEX_PROP}>{VALUE}</textarea>

  • Open up template_prefix_newthread/template_prefix_editpost_first template, depends on what template prefix we use for the forum, and find the default MyBB message textarea there:

    HTML Code
    <textarea name="message" id="message" rows="20" cols="70" tabindex="2">{$message}</textarea>

    Remove or rename the ID's name, then hide it.
    The result is something like this:
    http://mybbhacks.zingaburga.com/newthread.php?fid=37

    If we have more than one textarea, we need an editor that supports more than one textarea in one page, like CKEditor, TinyMCE and etc.


RateU Offline
04-11-2012, 03:21 AM

Find all posts by this user
Quote this message in a reply

 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Can We Use MyBB Editor For Our XThreads Textarea?
Author Message
Sama34 Offline
Senior Member
****
Posts: 490
Joined: May 2011
Post: #2
RE: Can We Use MyBB Editor For Our XThreads Textarea?
Is this open to questions? If so, why no just use the MyBB message feature, I mean, instead of creating a custom field and do all this to use the editor, why no just skip the field and use the thread message area for the field´s purpose in the first place?

Support PM's will be ignored. Yipi
Plugins: Announcement Bars - Custom Reputation - Mark PM As Unread
(This post was last modified: 04-11-2012 01:42 PM by Sama34.)
04-11-2012 01:42 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: #3
RE: Can We Use MyBB Editor For Our XThreads Textarea?
I think that this will be especially handy for things like custom profile fields. I also have a couple of options on my board where on new thread there is an additional text box that does take BBCode - but the post also requires a message, so I cannot use the mybb editor. It's just a nicer experience for users if they can use BB codes from the editor.


[Image: leelink.gif]
MYBB1.6 & XThreads
04-11-2012 02:41 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: #4
RE: Can We Use MyBB Editor For Our XThreads Textarea?
I'd presume the main reason to do this is because XThreads' fields are a fair bit more flexible than MyBB fields.
For example, being able to pull them on the forumdisplay page, ability to apply custom display formattings, filters etc.

My Blog
04-11-2012 03:12 PM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #5
RE: Can We Use MyBB Editor For Our XThreads Textarea?
(04-11-2012 01:42 PM)Sama34 Wrote:  Is this open to questions?
Yep Smile
(04-11-2012 01:42 PM)Sama34 Wrote:  why no just use the MyBB message feature, I mean, instead of creating a custom field and do all this to use the editor, why no just skip the field and use the thread message area for the field´s purpose in the first place?
And how you load it to forumdisplay page?
If I can do that by using XThreads, why I need to install another plugin for that?
Actually, using XThreads textarea will give me a better controls.

04-12-2012 06:15 AM
Find all posts by this user Quote this message in a reply
Sama34 Offline
Senior Member
****
Posts: 490
Joined: May 2011
Post: #6
RE: Can We Use MyBB Editor For Our XThreads Textarea?
Oh yes, I forgot about the forumdisplay, you are right. But what about showthread?

When talking about data that is or at least we only want it to be visible from the showthread area. Would it be better to use the default message textarea?

Support PM's will be ignored. Yipi
Plugins: Announcement Bars - Custom Reputation - Mark PM As Unread
04-13-2012 11:33 AM
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: #7
RE: Can We Use MyBB Editor For Our XThreads Textarea?
Depends if you want to make use of the additional XThreads thread field settings.
If not, then you should probably use the stock message field.

My Blog
04-13-2012 01:16 PM
Find all posts by this user Quote this message in a reply
Adil S. Offline
Newbie
*
Posts: 0
Joined: Jan 2013
Post: #8
RE: Can We Use MyBB Editor For Our XThreads Textarea?
Thank .
01-12-2013 08:00 PM
Find all posts by this user Quote this message in a reply


Forum Jump: