Post by bai on May 9, 2018 7:13:22 GMT -8
Forum URL: kordeination.boards.net
Hello! So I have written a simple code myself to display a member's avatar in one of the boxes on board lists. I noticed that when I view my forum as a logged out guest, the board number displays instead on boards that are not accessible to guests. Here is a picture of what it looks like while viewing as a guest..
What SHOULD happen is that board number should not display at all, of course. I tried {else} and {elseif} code but it just jacked things up. I'm certain I did it wrong though. I always have trouble doing {elseif} codes.
Here's the code I currently have for the board lists
EDIT: So I messed around with the code and got the board ID numbers to stop showing up BUTTTTTT........Now even on boards where the info SHOULD be displayed to guests, it's not...Compare the following screenshot with the first one for the "latest news" board.
Now I really don't know what's going on. Here's the board list code revised:
Here's the code I currently have for the board lists
EDIT: So I messed around with the code and got the board ID numbers to stop showing up BUTTTTTT........Now even on boards where the info SHOULD be displayed to guests, it's not...Compare the following screenshot with the first one for the "latest news" board.
Now I really don't know what's going on. Here's the board list code revised:
{foreach $[board]}
{if !$[board.is_redirect]}
<div id="$[board.content_id]" class="container $[board.content_class] dividedBoard">
<div class="divided-title-bar bbcode">
<div class="title_wrapper main">
<span class="link" style="text-transform:uppercase;">$[board]</span> {if $[board.num_viewing]}<span class="viewing"> - $[board.num_viewing] Viewing</span>{/if}
</div>
</div>
<div class="content cap-bottom">
<table class="list">
<tbody>
<tr id="$[board.content_id]" class="$[board.content_class]">
<td class="icon">$[board.icon]</td>
<td class="main">
<p class="description">$[board.description]</p>
<!---{if $[board.num_mods]}
<p class="moderators">
Moderator{if $[board.num_mods] != 1}s{/if}:
{foreach $[board.moderator_group]}$[board.moderator_group.comma_before] $[board.moderator_group]{/foreach}{if $[board.moderator]}{if $[board.moderator_group]}, {/if}{/if}
{foreach $[board.moderator]}$[board.moderator]$[board.moderator.comma] {/foreach}
</p>
{/if}--->
{if $[board.sub_board]}
<p class="sub-boards">
Sub-board{if $[board.sub_board] != 1}s{/if}:
{foreach $[board.sub_board]}<a href="$[board.sub_board.href]">$[board.sub_board.name]</a>$[board.sub_board.comma] {/foreach}
</p>
{/if}
</td>
<td class="threads">{if $[board.posts] == -1}N/A{else}$[board.posts] Posts{/if}
<br>{if $[board.threads] == -1}N/A{else}$[board.threads] Threads{/if}</td>
<td class="posts">{if $[current_user.is_guest]||$[current_user.is_member]}<center>{if $[board.posts] == 0}{else}<a href="$[board.last_thread.last_post.created_by.link.href]">$[board.last_thread.last_post.created_by.avatar_small]</a>{/if}</center>{/if}</td>
<td class="latest last" style="text-align:left;">
{if $[board.posts] > 0}
{if $[board.last_thread]}
$[board.last_thread.recent_link]<br />
by $[board.last_thread.last_post.created_by]<br>
<span class="date" style="color:#8f8f8f;">($[board.last_thread.last_post.created_on])</span>
{/if}
{else}
{/if}
</td>
</tr>
</tbody>
</table>
</div>
</div>
{else}
<div id="$[board.content_id]" class="container $[board.content_class] dividedBoard">
<div class="divided-title-bar bbcode">
<div class="title_wrapper main">
<span class="link">$[board]</span> {if $[board.num_viewing]}<span class="viewing"> - $[board.num_viewing] Viewing</span>{/if}
</div>
</div>
<div class="content cap-bottom">
<table class="list">
<tbody>
<tr id="$[board.content_id]" class="$[board.content_class]">
<td class="icon">$[board.icon]</td>
<td class="main clickable redirect last" style="width: 100%;">
<p class="description">$[board.description]</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
{/if}
{/foreach}
{if !$[board]}
<div class="last"><div class="last center" colspan="5">No boards were found.</div></div>
{/if}