Resource icon

Add Username Style to Last Post 1.1

No permission to download
Is there a way to add the usergroup CSS changes to the users profile and pop-up card as well?
That doesn't need the addon, just template edits:

In member_card search for:
Code:
<xen:username user="$user" class="NoOverlay" />
And change like this:
Code:
<xen:username user="$user" class="NoOverlay" rich="true" />

In member_view search for:
Code:
<h1 itemprop="name"><xen:username user="$user" /></h1>
And change like this:
Code:
<h1 itemprop="name"><xen:username user="$user" rich="true" /></h1>

If you also want profile posts to have CSS in usernames:

In message_simple search for:
Code:
<xen:username user="$message" class="poster" />
And change like this:
Code:
<xen:username user="$message" class="poster" rich="true" />

In profile_post_comment search for:
Code:
<xen:username user="$comment" class="poster" />
And change like this:
Code:
<xen:username user="$comment" class="poster" rich="true" />
 
Excellent resource and thanks for submitting this one. :)

On the offchance others wanted to apply the markup on sideblock boardstats to do this. Go to the forum_list template

find:
Code:
                        <xen:username user="$boardTotals.latestUser"  />


Replace with:
Code:
                     <xen:username user="$boardTotals.latestUser" rich="true" />

boardstats-rich-username.webp
 
This is where it would be useful to be able to override XenForo_Template_Compiler_Tag_Username, so that we can make the xen:username default to rich="true".

Nice add-on!
 
Anyone know if it's possible to get the usernames styled on the recent activity / news feed?

And any chance this can be extended to include the conversations list? I tried enabling rich usernames in that section but no luck.
 
Fix for broken Watched Forums page in XF 1.2:

Replace relevant function in RichUsernameEverywhere_Node with:
Code:
	public function getNodeDataForListDisplay($parentNode, $displayDepth, array $nodePermissions = null)
	{
		$nodeData = parent::getNodeDataForListDisplay($parentNode, $displayDepth, $nodePermissions);

		if (!empty($nodeData['nodesGrouped']))
			$nodeData['nodesGrouped'] = $this->_addDisplayStyleGroupdId($nodeData['nodesGrouped']);							
			
		return $nodeData;
	}

The exact stack trace for anyone searching is as follows:
An exception occurred: Undefined index: nodeParents in /home/nginx/www/gamingmasters.org/library/XenForo/ViewPublic/Watched/Forums.php on line 13

  1. XenForo_Application::handlePhpError() in XenForo/ViewPublic/Watched/Forums.php at line 13
  2. XenForo_ViewPublic_Watched_Forums->renderHtml() in XenForo/ViewRenderer/Abstract.php at line 220
  3. XenForo_ViewRenderer_Abstract->renderViewObject() in XenForo/ViewRenderer/HtmlPublic.php at line 67
  4. XenForo_ViewRenderer_HtmlPublic->renderView() in XenForo/FrontController.php at line 569
  5. XenForo_FrontController->renderView() in XenForo/FrontController.php at line 156
  6. XenForo_FrontController->run() in /home/nginx/www/gamingmasters.org/index.php at line 13
 
Last edited:
Fix for broken Watched Forums page in XF 1.2:

Replace relevant function in RichUsernameEverywhere_Node with:
Code:
public function getNodeDataForListDisplay($parentNode, $displayDepth, array $nodePermissions = null)
{
$nodeData = parent::getNodeDataForListDisplay($parentNode, $displayDepth, $nodePermissions);

if (!empty($nodeData['nodesGrouped']))
$nodeData['nodesGrouped'] = $this->_addDisplayStyleGroupdId($nodeData['nodesGrouped']);

return $nodeData;
}

The exact stack trace for anyone searching is as follows:



Thanks Luke :)
 
Is there a way to add the usergroup CSS changes to the LikeText?
PHP:
<xen:if is="{$message.likes}">
    <xen:require css="likes_summary.css" />
    <div class="likesSummary secondaryContent">
        <span class="LikeText">
            <xen:likes number="$message.likes" users="$message.likeUsers" url="$likesUrl" liked="$message.like_date" />
        </span>
    </div>
</xen:if>
@EsKuel thanks for addon.
 
Fix for broken Watched Forums page in XF 1.2:

Replace relevant function in RichUsernameEverywhere_Node with:
Code:
public function getNodeDataForListDisplay($parentNode, $displayDepth, array $nodePermissions = null)
{
$nodeData = parent::getNodeDataForListDisplay($parentNode, $displayDepth, $nodePermissions);

if (!empty($nodeData['nodesGrouped']))
$nodeData['nodesGrouped'] = $this->_addDisplayStyleGroupdId($nodeData['nodesGrouped']);

return $nodeData;
}

The exact stack trace for anyone searching is as follows:

Hi Luke. Is RichUsernameEverywhere_Node the template because i don't seem to have it on my style to fix this.

edit: It's the node.php file we need to change? If so which part of the code do I specifically replace? Thanks again :)

edit: Got it fixed Luke. Thanks alot for the fix. :thumbsup:
 
Last edited:
Would someone mind repacking this for 1.2? From what I can see in the above posts it works but something needs editing and I can't work out what. :)
 
Would someone mind repacking this for 1.2? From what I can see in the above posts it works but something needs editing and I can't work out what. :)
That's up to the author to do that but it would be useful if they did.

In the meantime, here's the edit that @Luke Foreman posted and where it should be put.

Locate and open the node.php file from the add-on in an editor e.g. NotePad++

Find

PHP:
    public function getNodeDataForListDisplay($parentNode, $displayDepth, array $nodePermissions = null)
    {
        $nodeData = parent::getNodeDataForListDisplay($parentNode, $displayDepth, $nodePermissions);

        if (!empty($nodeData))
        {           
            $groupedNodes = $this->_addDisplayStyleGroupdId($nodeData['nodesGrouped']);
                           
            return array(
                    'nodesGrouped' => $groupedNodes,
                    'parentNodeId' => $nodeData['parentNodeId'],
                    'nodeHandlers' => $nodeData['nodeHandlers'],
                    'nodePermissions' => $nodeData['nodePermissions']
            );
        }
        else
        {
            return array();
        }
    }

Replace with

PHP:
    public function getNodeDataForListDisplay($parentNode, $displayDepth, array $nodePermissions = null)
    {
        $nodeData = parent::getNodeDataForListDisplay($parentNode, $displayDepth, $nodePermissions);

        if (!empty($nodeData['nodesGrouped']))
            $nodeData['nodesGrouped'] = $this->_addDisplayStyleGroupdId($nodeData['nodesGrouped']);                           
           
        return $nodeData;
    }

Save the file. Then upload it to /library/RichUsernameEverywhere/ where it should overwrite the original node.php file
 
That's up to the author to do that but it would be useful if they did.

In the meantime, here's the edit that @Luke Foreman posted and where it should be put.

Locate and open the node.php file from the add-on in an editor e.g. NotePad++

Find

PHP:
    public function getNodeDataForListDisplay($parentNode, $displayDepth, array $nodePermissions = null)
    {
        $nodeData = parent::getNodeDataForListDisplay($parentNode, $displayDepth, $nodePermissions);

        if (!empty($nodeData))
        {          
            $groupedNodes = $this->_addDisplayStyleGroupdId($nodeData['nodesGrouped']);
                          
            return array(
                    'nodesGrouped' => $groupedNodes,
                    'parentNodeId' => $nodeData['parentNodeId'],
                    'nodeHandlers' => $nodeData['nodeHandlers'],
                    'nodePermissions' => $nodeData['nodePermissions']
            );
        }
        else
        {
            return array();
        }
    }

Replace with

PHP:
    public function getNodeDataForListDisplay($parentNode, $displayDepth, array $nodePermissions = null)
    {
        $nodeData = parent::getNodeDataForListDisplay($parentNode, $displayDepth, $nodePermissions);

        if (!empty($nodeData['nodesGrouped']))
            $nodeData['nodesGrouped'] = $this->_addDisplayStyleGroupdId($nodeData['nodesGrouped']);                          
          
        return $nodeData;
    }

Save the file. Then upload it to /library/RichUsernameEverywhere/ where it should overwrite the original node.php file


Thank you very much!
 
Top Bottom