MyBB Hacks

Full Version: Thread Descriptions
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8
This is a simple thing to do, and this example should give you a general idea of the basics of XThreads.

Alrighty, after installing and activating XThreads, follow these steps on how to add thread description functionality for your threads:
  1. Go to your AdminCP -> Configuration -> Custom Thread Fields section
  2. Choose to Add Thread Field
  3. On this page, enter in the following:
    Title: Thread Description
    Key: desc
    Description: Further describe your thread here
    Display Format: <div>{VALUE}</div>
    (leave other fields on their defaults)
  4. Now scroll down to the bottom of the page and Add Thread Field
  5. If you go to your forum and try to make a new thread, you should notice that there's a "Thread Description" text box below the "Thread Subject" text box, however this doesn't actually do anything right now.  We'll need to add the description into MyBB's templates for it to be of any use.
  6. Go to your AdminCP -> Templates & Style -> Templates
  7. Select the template set you're using (if you have multiple template sets, you need to repeat the following steps with all template sets; alternatively, if you know how, you can also use the Global Templateset)
  8. Now, expand "Forum Display Templates"
  9. Click on the forumdisplay_thread template to edit it
  10. Find the following line of code:

    HTML Code
    <div class="author smalltext">{$thread['profilelink']}</div>

    and add the following before it:

    HTML Code

  11. Save the template
  12. Back at the templates list page, expand "Search Templates", and select the search_results_threads_thread template to edit
  13. Perform the same edit as you did for the forumdisplay_thread template, and save this edited template
  14. Now, go make a new thread and confirm that thread descriptions appear properly on the forumdisplay and search pages.

If you got to the end without troubles, congratulations! you have managed to use XThreads to create a thread description.
This may seem like a bit of a convoluted method of doing such, but it does give you a lot of flexibility with various things.

As alluded to earlier, this is a very basic example and shows the basics of XThreads.
Hopefully this wasn't too difficult.  Maybe you can go on and try one of the more complicated examples. Tongue
Hello ppl.

I want to set {$threadfields['desc']} in Thread not in front of.

I atache a pictures

Not in forumdisplay_thread if you understand me. I want to put in showthread
Unfortunately, I'm having a bit of trouble understanding you.  I'm guessing you're trying to put the description in showthread somewhere (postbit template?) but having trouble with it?
Yes i want to put this mod not in front of my thread. I want to put in showthread after post. I think is postbit template. Can you tell me exactly where please

This is my postbit template

<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" style="{$post_extra_style} {$post_visibility}" id="post_{$post['pid']}">
<td class="tcat" colspan="2">
<span style="float: right;">
{$post['postdate']} {$post['posttime']}

<td class="postbit" rowspan="2" width="200px" valign="top" style="white-space: nowrap; text-align: center;"><a name="pid{$post['pid']}" id="pid{$post['pid']}"></a>
<div class="postbit_name">{$post['onlinestatus']}{$post['profilelink']}<br />
<span style="float: right;">{$post['userstars']}</span><span class="postbit_usertitle">{$post['usertitle']}</span></div>
<span class="smalltext">
<td class="trow1" valign="top">
<table width="100%">
<tr><td><span class="smalltext"><strong>{$post['icon']}{$post['subject']} {$post['subject_extra']}</strong></span>
<br />
<div id="pid_{$post['pid']}" style="padding: 5px 0 5px 0;">
<div style="text-align: right; vertical-align: bottom;" id="post_meta_{$post['pid']}">
<div id="edited_by_{$post['pid']}">{$post['editedmsg']}</div>
<td class="trow2" style="vertical-align: middle; height: 10px;">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr valign="bottom">
<td align="left" ><span class="smalltext">{$post['button_email']}{$post['button_pm']}{$post['button_www']}{$post['button_find']}{$post['button_rep']}</span></td>
<td align="right">{$post['button_spam']}{$post['button_edit']}{$post['button_quickdelete']}{$post['button_quote']}{$post['button_multiquote']}{$post['button_report']}{$post['button_warn']}{$post['button_reply_pm']}{$post['button_replyall_pm']}{$post['button_forward_pm']}{$post['button_delete_pm']}</td>
After {$post['message']} ?
I don't know.

Learn HTML, it's not hard.
Pffff ... Thanks Smile not in here ...
This modification is nice. Well, having a description with same font-size as thread subject doesnt seems cool?? Right?
How can we decrease the size of the thread description? Can we use <span style="">{$threadfields['desc']}</span>?
is anyone using this example?  I'd like to see it before I try it!  Biggrin
Yes, I am using it on THIS forum

Site is SUPER slow at the moment - have complained to host but meh.
Pages: 1 2 3 4 5 6 7 8
Reference URL's