I was originally going to post some CSS on how one might style the Login Widget provided by XenWord, but I decided to post a suggestion before doing so. There were two methods I was going to post:
Since a lot of XenForo themes are highly based off of the default theme's markup (even those that use theme frameworks), using some of the same HTML would be good. But not necessarily needed as long as everything can be targeted via CSS.
To achieve this on the WordPress-side (which is styled the same on my XenForo installation, using the default theme as a base), I needed to add some additional stuff to the login-widget php.
Example of the edit I made in xenword-xf-login-widget.php. It's a bit sloppy but it gives an idea of what I'm trying to suggest.
So if a designer wants to remove, say: Joined, Last Activity, User email, and Messages; they could simply use the CSS:
The more time-consuming route would also be to allow these to be selected and turned on/off in the WordPress backend, similar to what you have in mind with the Community Statistics widget.
The suggestion probably reaches into the other widgets as well, but I personally haven't looked at them yet.
- Utilizing only CSS to style the login widget. This method is very CSS-hacky and I wasn't comfortable with some of the CSS involved to style the widget.
- Using a little CSS but editing xenword-xf-login-widget.php for easier class targeting. This is usually undesirable for an end-user since they'd have to maintain the file themselves during upgrades.
Since a lot of XenForo themes are highly based off of the default theme's markup (even those that use theme frameworks), using some of the same HTML would be good. But not necessarily needed as long as everything can be targeted via CSS.
To achieve this on the WordPress-side (which is styled the same on my XenForo installation, using the default theme as a base), I needed to add some additional stuff to the login-widget php.
Example of the edit I made in xenword-xf-login-widget.php. It's a bit sloppy but it gives an idea of what I'm trying to suggest.
Code:
$visitor = XenForo_Visitor::getInstance()->toArray();
echo '<h2 class="rounded">Your Profile</h2>';
echo '<a class="xenword_profile avatar" href="' . XenForo_Application::get('options')->boardUrl . '/account">';
echo get_avatar( get_current_user_id(), 100 ) . '</a>';
echo '' .$message_loggedIn. '';
echo '<p>'.$message_loggedIn.'</p>';
echo '<div class="xenword-login-profile">';
echo '<h4 class="visitorText"><a class="xenword_profile username" href="' . XenForo_Application::get('options')->boardUrl . '/account">';
echo '' . $visitor['username'] . '</a></h4>';
echo '<div class="stats">';
echo '<dl class="pairsJustified email"><dt>User email:</dt><dd>' . $visitor['email'] . '</dd></dl>';
echo '<dl class="pairsJustified joined"><dt>Joined:</dt><dd>' . XenForo_Locale::dateTime( $visitor['register_date'] ) . '</dd></dl>';
echo '<dl class="pairsJustified last-activity"><dt>Last Activity:</dt><dd>' . XenForo_Locale::dateTime( $visitor['last_activity'] ) . '</dd></dl>';
echo '<dl class="pairsJustified messages"><dt>Messages:</dt><dd>' . XenForo_Locale::numberFormat( $visitor['message_count'] ) . '</dd></dl>';
echo '<dl class="pairsJustified likes"><dt>Likes:</dt><dd>' . XenForo_Locale::numberFormat( $visitor['like_count'] ) . '</dd></dl>';
echo '<dl class="pairsJustified trophies"><dt>Points:</dt><dd>' . XenForo_Locale::numberFormat( $visitor['trophy_points'] ) . '</dd></dl>';
echo '</div>';
echo '</div>';
echo '<br />';
echo '<a class="xenword_profile edit" href="' . XenForo_Application::get('options')->boardUrl . '/account">Edit Profile</a>';
echo '<a class="xenword_logout logout" href="' . XenForo_Application::get('options')->boardUrl . '/logout">Logout</a>';
So if a designer wants to remove, say: Joined, Last Activity, User email, and Messages; they could simply use the CSS:
Code:
.pairsJustified.email,
.pairsJustified.joined,
.pairsJustified.last-activity,
.pairsJustified.messages {
display: none;
}
The more time-consuming route would also be to allow these to be selected and turned on/off in the WordPress backend, similar to what you have in mind with the Community Statistics widget.
The suggestion probably reaches into the other widgets as well, but I personally haven't looked at them yet.