Advertisement:

Author Topic: Moderators of the board  (Read 338 times)

Offline Михаило

  • Semi-Newbie
  • *
  • Posts: 11
  • Gender: Male
    • michaelwb on GitHub
Moderators of the board
« on: February 19, 2018, 10:05:12 AM »
Hi,

is it possible to add a new 'section' here https://i.imgur.com/HngPHvI.png [nofollow] ?
After the box where it says 'Last post' I would like to add a special section where it can show a list of moderators for that board. Is it possible?

This is from vBulletin 3.x. https://prnt.sc/igvubu [nofollow]


Thanks in advance.

Offline Virginiaz

  • Semi-Newbie
  • *
  • Posts: 26
Re: Moderators of the board
« Reply #1 on: March 01, 2018, 09:38:16 PM »
Sure

I assume you want this for the default theme: Open Themes/default/BoardIndex.php


1. You need to adjust the board list table's colspan from 4 to 5, since we are adding a new column.

Find (around line 103):

Code: [Select]
<td colspan="4">
Replace with:

Code: [Select]
<td colspan="5">

2. Add the new column

Find (around line 184):

Code: [Select]
/* The board's and children's 'last_post's have:
time, timestamp (a number that represents the time.), id (of the post), topic (topic id.),
link, href, subject, start (where they should go for the first unread post.),
and member. (which has id, name, link, href, username in it.) */
if (!empty($board['last_post']['id']))
echo '
<p><strong>', $txt['last_post'], '</strong>  ', $txt['by'], ' ', $board['last_post']['member']['link'] , '<br />
', $txt['in'], ' ', $board['last_post']['link'], '<br />
', $txt['on'], ' ', $board['last_post']['time'],'
</p>';
echo '
</td>
</tr>';

Replace with:

Code: [Select]
/* The board's and children's 'last_post's have:
time, timestamp (a number that represents the time.), id (of the post), topic (topic id.),
link, href, subject, start (where they should go for the first unread post.),
and member. (which has id, name, link, href, username in it.) */
if (!empty($board['last_post']['id']))
echo '
<p><strong>', $txt['last_post'], '</strong>  ', $txt['by'], ' ', $board['last_post']['member']['link'] , '<br />
', $txt['in'], ' ', $board['last_post']['link'], '<br />
', $txt['on'], ' ', $board['last_post']['time'],'
</p>';
echo '
</td>';

// Moderator box at the end
if (!empty($board['moderators'])) {
echo '
<td class="windowbg">
<p><strong>Moderators</strong><br />
', (count($board['moderators']) ? implode(', ', $board['link_moderators']) : 'None'), '
</p>';
echo '
</td>';
}

// End table
echo '</tr>';


Result: I attached a screenshot of what the result looks like (ModBox_SMF2.png)


Note: Keep in mind that it already lists the Moderators below each board. The code for that is around line 169