XMB Forum Software
Not logged in [Login - Register]
Go To Bottom

Printable Version  
Author: Subject: [Resolved] Mysterious <br> tags
Belle
New Poster
**


Avatar


Posts: 2
Registered: 5-25-2024
Member Is Offline


[*] posted on 7-29-2024 at 12:15 PM
[Resolved] Mysterious <br> tags


Full Board URL: https://mb.salvaged.nu/
XMB Version: 1.9.12

Hello - I am trying to relocate the list of Forum Moderators next to the name of each forum, however there seems to be a <br> tag that I can't remove. I have searched through the templates and cannot find what I'm looking for.
I've attached a screenshot of what I mean.

Here is what my index_forum template looks like:

Code:
<tr> <td bgcolor="{$THEME['altbg1']}" class="ctrtablerow" width="4%">$folder</td> <td bgcolor="{$THEME['altbg2']}" class="tablerow" width="54%" style="cursor:pointer;" onclick="location.href='./forumdisplay.php?fid=$forum[fid]'"> <a href="./forumdisplay.php?fid=$forum[fid]"> <font class="mediumtxt"> <strong>$forum[name]</strong></font> <font class="smalltxt">({$forum['moderator']}) </font> </a> <br /> <a href="./forumdisplay.php?fid=$forum[fid]"> <font class="smalltxt">{$forum['description']}</font> </a> <font class="smalltxt">$subforums</font> </td> <td bgcolor="{$THEME['altbg1']}" class="ctrtablerow" width="6%"><font class="mediumtxt">$forum[threads]</font></td> <td bgcolor="{$THEME['altbg2']}" class="ctrtablerow" width="6%"><font class="mediumtxt">$forum[posts]</font></td> <td bgcolor="{$THEME['altbg1']}" class="lastpostcell" width="19%">$lastpostrow</td> </tr>


and this is what it produces:

Code:
<tr> <td bgcolor="#f0e8e3" class="ctrtablerow" width="4%"><img src="images/laundrydayv2/folder.gif" alt="Folder" border="0"></td> <td bgcolor="#f2f7f0" class="tablerow" width="54%" style="cursor:pointer;" onclick="location.href='./forumdisplay.php?fid=1'"> <a href="./forumdisplay.php?fid=1"> <font class="mediumtxt"> <strong>Forum name</strong></font> <font class="smalltxt">(<br>Forum Moderators: </font></a><font class="smalltxt"><a href="member.php?action=viewpro&amp;member=Belle">Belle</a>) </font> <br> <a href="./forumdisplay.php?fid=1"> <font class="smalltxt">This is the default forum created during installation To create or modify forums go to the forum section of the administration panel</font> </a> <font class="smalltxt"><br>Sub-Forums: <span class="plainlinks"><a href="forumdisplay.php?fid=4">Subforum</a></span></font> </td> <td bgcolor="#f0e8e3" class="ctrtablerow" width="6%"><font class="mediumtxt">7</font></td> <td bgcolor="#f2f7f0" class="ctrtablerow" width="6%"><font class="mediumtxt">9</font></td> <td bgcolor="#f0e8e3" class="lastpostcell" width="19%"><table cellpadding="0" cellspacing="0" border="0" width="100%"> <tbody><tr class="rghttablerow"> <td bgcolor="#f0e8e3" nowrap="nowrap"><a href="./viewthread.php?goto=lastpost&amp;fid=1" title="Go to last post" class="smalltxt">19-6-2024 at 05:58 PM<br>by Belle</a></td> <td bgcolor="#f0e8e3" nowrap="nowrap"><a href="./viewthread.php?goto=lastpost&amp;fid=1" title="Go to last post"><img src="images/laundrydayv2/lastpost.gif" border="0" alt="Go to last post"></a></td> </tr> </tbody></table> </td> </tr>


I would like to remove the <br> tag before the 'Forum Moderators:' text, so ideally the final result would look like "Forum Name (Forum Moderators: Belle)"

Thank you in advance :)


Screenshot 2024-06-22 at 20.41.39.png - 38kB
View user's profile View All Posts By User
lottos
Administrator
********




Posts: 479
Registered: 6-3-2002
Member Is Offline

Mood: pass me a TimTam

[*] posted on 7-29-2024 at 12:43 PM


I'd be bringing it back to the simple original template with just moving the mod snippet to just after the forum name, test it, then slowly add in the changes such as style="cursor:pointer;" onclick="location.href and test again to see if that's what's breaking it.
View user's profile View All Posts By User
Belle
New Poster
**


Avatar


Posts: 2
Registered: 5-25-2024
Member Is Offline


[*] posted on 8-5-2024 at 11:40 AM


@lottos - Thank you for your suggestion! Stripping back to the original template and removing the additional style changes didn't work, but I did fix it another way! :)
Here's a little step by step, just incase anyone else has a similar issue.

In the file functions.inc.php (inside the folder 'includes'), find this code:

Quote:
if ( ! empty( $forum['moderator'] ) ) {
$list = [];
$moderators = explode(', ', $forum['moderator']);
foreach ( $moderators as $moderator ) {
$list[] = '<a href="member.php?action=viewpro&amp;member='.recodeOut( $moderator ).'">'.$moderator.'</a>';
}
$moderators = implode( ', ', $list );
$forum['moderator'] = "{$lang['textmodby']} $moderators";
if ( '' !== $forum['description'] ) {
$forum['moderator'] = '<br />' . $forum['moderator'];
}
}


The <br /> code is the one that we need to remove. :)

I've changed mine to this, so that the forum moderators are in brackets:

Quote:
if ( ! empty( $forum['moderator'] ) ) {
$list = [];
$moderators = explode(', ', $forum['moderator']);
foreach ( $moderators as $moderator ) {
$list[] = '<a href="member.php?action=viewpro&amp;member='.recodeOut( $moderator ).'">'.$moderator.'</a>';
}
$moderators = implode( ', ', $list );
$forum['moderator'] = "{$lang['textmodby']} $moderators";
if ( '' !== $forum['description'] ) {
$forum['moderator'] = '(' . $forum['moderator'] . ')';
}
}



I hope this helps!

Screenshot 2024-08-05 at 12.38.28.png - 39kB
View user's profile View All Posts By User

  Go To Top

Powered by XMB 1.9.12 (Debug Mode)
XMB Forum Software © 2001-2025 The XMB Group
[Queries: 16] [PHP: 85.2% - SQL: 14.8%]