1)
It's actually BETTER to fetch both at once. :3
Notice the query line,
PHP Code:
$marital_status_threads_query = sprintf("SELECT thread.threadid, userfield.field17 AS maritalstatus FROM thread LEFT JOIN userfield ON(thread.postuserid=userfield.userid) WHERE thread.threadid IN (0%s)", $ids);
For you to have both fields fetched, try
PHP Code:
$my_query = sprintf("SELECT thread.threadid, userfield.field6 AS thisfield, userfield.field7 AS thatfield, FROM thread LEFT JOIN userfield ON(thread.postuserid=userfield.userid) WHERE thread.threadid IN (0%s)", $ids);
Now, to make those values USEABLE, try this code:
PHP Code:
$my_field6_threadids = array();
$my_field7_threadids = array();
$my_query = sprintf("SELECT thread.threadid, userfield.field6 AS thisfield, userfield.field7 AS thatfield FROM thread LEFT JOIN userfield ON(thread.postuserid=userfield.userid) WHERE thread.threadid IN (0%s)", $ids);
$my_result = $vbulletin->db->query_read($my_query);
while ($my_row = $vbulletin->db->fetch_array($my_result))
{
$my_field6_threadids[$my_row['threadid']] = $my_row['thisfield'];
$my_field7_threadids[$my_row['threadid']] = $my_row['thatfield'];
}
Now, to make the variable easy to access in the templates, use THIS instead for your plugin in "threadbit_display":
PHP Code:
$my_field6 = $my_field6_threadids[$thread['threadid']];
$my_field7 = $my_field7_threadids[$thread['threadid']];
2)
No worries! Using those values above, go into your "threadbit" template, and just plug in the values wherever the hell you want. :3
For example, this is USUALLY (without modifications) the part of the threadbit template that is the FIRST column:
HTML Code:
<td class="alt1" id="td_threadstatusicon_$thread[realthreadid]">
$thread[openclose_editable]
<img src="$stylevar[imgdir_statusicon]/thread$thread[statusicon].gif" id="thread_statusicon_$thread[realthreadid]" alt="<if condition="$show['threadcount']"><phrase 1="$thread[dot_count]" 2="$thread[dot_lastpost]">$vbphrase[have_x_posts_in_thread_last_y]</phrase></if>" border="" />
</td>
If I wanted to put your Field 6 in that column, I'd just do it as so:
HTML Code:
<td class="alt1" id="td_threadstatusicon_$thread[realthreadid]">
$thread[openclose_editable]
$my_field6
<img src="$stylevar[imgdir_statusicon]/thread$thread[statusicon].gif" id="thread_statusicon_$thread[realthreadid]" alt="<if condition="$show['threadcount']"><phrase 1="$thread[dot_count]" 2="$thread[dot_lastpost]">$vbphrase[have_x_posts_in_thread_last_y]</phrase></if>" border="" />
</td>
Bada bing, bada boom!
Now, I've never used this advanced threadbit thing, but it PROBABLY uses the threadbit template, so... yar. :3
The BEST way to go about it is to avoid editing your templates directly if you can avoid it. But if you can't... well, that's what the template editor is there for. :3