• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Follow me (postbit) [Deleted]

Adam Howard

Well-known member
#1
Adam Howard submitted a new resource:

Follow me (postbit) - add a follow me button above avatar

View attachment 44456

This simple template edit will add a nice follow me button above your user's avatars.

Template: message_user_info

Search for

PHP:
    <xen:hook name="message_user_info_avatar" params="{xen:array 'user={$user}', 'isQuickReply={$isQuickReply}'}">
        <div class="avatarHolder">
            <span class="helper"></span>
            <xen:avatar user="$user" size="m" />
            <!-- slot: message_user_info_avatar -->
        </div>...
Read more about this resource...
 

kankan

Active member
#3
Thank you
I tried on my Flexile theme, but nothing is displayed.

Code:
<xen:require css="message_user_info.css" />
 
<div class="messageUserInfo" itemscope="itemscope" itemtype="http://data-vocabulary.org/Person">
<div class="messageUserBlock">
    <xen:hook name="message_user_info_avatar" params="{xen:array 'user={$user}', 'isQuickReply={$isQuickReply}'}">
        <div class="avatarHolder">
            <span class="helper"></span>
            <xen:avatar user="$user" size="m" />
            <!-- slot: message_user_info_avatar -->
        </div>
    </xen:hook>
 
<xen:follow user="$user" class="Tooltip" style="background: url('styles/followme.png') no-repeat 8px center; padding:5px; text-align:center; display:block; font-weight:bold;" />
<xen:if is="{xen:helper isIgnored, $user.user_id}"><a href="{xen:link members/unignore, $user}" class="FollowLink">{xen:phrase unignore}</a><xen:elseif is="{$canIgnore}" /><a href="{xen:link members/ignore, $user}" class="FollowLink">{xen:phrase ignore}</a></xen:if>
 
<xen:if is="!{$isQuickReply}">
    <xen:hook name="message_user_info_text" params="{xen:array 'user={$user}', 'isQuickReply={$isQuickReply}'}">
        <h3 class="userText">
            <xen:username user="$user" itemprop="name" rich="true" />
            <xen:if hascontent="true"><em class="userTitle" itemprop="title"><xen:contentcheck>{xen:helper userTitle, $user}</xen:contentcheck></em></xen:if>
            <!-- slot: message_user_info_text -->
        </h3>
    </xen:hook>
index.png
 

Adam Howard

Well-known member
#5
Thank you
I tried on my Flexile theme, but nothing is displayed.

Code:
<xen:require css="message_user_info.css" />
 
<div class="messageUserInfo" itemscope="itemscope" itemtype="http://data-vocabulary.org/Person">
<div class="messageUserBlock">
    <xen:hook name="message_user_info_avatar" params="{xen:array 'user={$user}', 'isQuickReply={$isQuickReply}'}">
        <div class="avatarHolder">
            <span class="helper"></span>
            <xen:avatar user="$user" size="m" />
            <!-- slot: message_user_info_avatar -->
        </div>
    </xen:hook>
 
<xen:follow user="$user" class="Tooltip" style="background: url('styles/followme.png') no-repeat 8px center; padding:5px; text-align:center; display:block; font-weight:bold;" />
<xen:if is="{xen:helper isIgnored, $user.user_id}"><a href="{xen:link members/unignore, $user}" class="FollowLink">{xen:phrase unignore}</a><xen:elseif is="{$canIgnore}" /><a href="{xen:link members/ignore, $user}" class="FollowLink">{xen:phrase ignore}</a></xen:if>
 
<xen:if is="!{$isQuickReply}">
    <xen:hook name="message_user_info_text" params="{xen:array 'user={$user}', 'isQuickReply={$isQuickReply}'}">
        <h3 class="userText">
            <xen:username user="$user" itemprop="name" rich="true" />
            <xen:if hascontent="true"><em class="userTitle" itemprop="title"><xen:contentcheck>{xen:helper userTitle, $user}</xen:contentcheck></em></xen:if>
            <!-- slot: message_user_info_text -->
        </h3>
    </xen:hook>
View attachment 44500
That's because you added it below it.... The instructions said, above.
 

kankan

Active member
#6
OOps
Well even after adding above, still no display.
I removed the
style="background: url('styles/followme.png')
But system returns a Syntax error on saving
 

Adam Howard

Well-known member
#7
OOps
Well even after adding above, still the same error.
I tried removing the
style="background: url('styles/followme.png')
But system returns a Syntax error on saving
If you're doing this in TMS... Do you have any other add-ons which seem to change message_user_info and involve this code

PHP:
    <xen:hook name="message_user_info_avatar" params="{xen:array 'user={$user}', 'isQuickReply={$isQuickReply}'}">
        <div class="avatarHolder">
            <span class="helper"></span>
            <xen:avatar user="$user" size="m" />
            <!-- slot: message_user_info_avatar -->
        </div>
    </xen:hook>
If so, that could be a conflict
 

Shelley

Well-known member
#8
I must say an excellent resource Adam. Excellent work with it. (y)

I personally prefer it at the bottom (rather than the top) but I'm going to play with it some more and add an icon into the spritesheet and see what I can come up with. Nice submission indeed.

follow-adammod.png
 

Shelley

Well-known member
#10
what would be the code to put it at the bottom ?

Thanks!
:)
All of the code Adam posted. :)

This is how mine is looking. I inserted it before the spans

Code:
<xen:follow user="$user" class="Tooltip" style="background: url('styles/followme.png') no-repeat 8px center; padding:5px; text-align:center; display:block; font-weight:bold;" />
<xen:if is="{xen:helper isIgnored, $user.user_id}"><a href="{xen:link members/unignore, $user}" class="FollowLink">{xen:phrase unignore}</a><xen:elseif is="{$canIgnore}" /><a href="{xen:link members/ignore, $user}" class="FollowLink">{xen:phrase ignore}</a></xen:if>
   
 
<span class="arrow"><span></span></span>
 

Adam Howard

Well-known member
#11

Shelley

Well-known member
#12
Thanks Shelley for sharing that modification.

I personally find the list of thing slowly adding to the postbit below the avatar has been growing.

View attachment 44511

Adding it above kept the "message post body" from getting bigger (because as the postbit grows, so does the the empty space to the right of it)

example http://www.sociallyuncensored.eu/forums/threads/word-association-game.11971/page-377#post-220123
I think either if it's top or at the bottom the modification as it's uses for each location. I agree with you that when someone has alot of info at the bottom it could get crowded and the top location would suit better but my messageuserinfo is less crowded and suits perfectly imo at the bottom.

Eitherway I'm liking the resource so I'll say again, nice job. :)
 

kankan

Active member
#14
If you're doing this in TMS... Do you have any other add-ons which seem to change message_user_info and involve this code

PHP:
    <xen:hook name="message_user_info_avatar" params="{xen:array 'user={$user}', 'isQuickReply={$isQuickReply}'}">
        <div class="avatarHolder">
            <span class="helper"></span>
            <xen:avatar user="$user" size="m" />
            <!-- slot: message_user_info_avatar -->
        </div>
    </xen:hook>
If so, that could be a conflict
Adam,

My fault, i was applying code to my Master theme instead of Flexile....
 

Adam Howard

Well-known member
#15
Adam,

My fault, i was applying code to my Master theme instead of Flexile....
No worries. :)
Glad you got it working.

Some free advise.....

I always tell people never to add anything to the master theme.

Of course I always use xenforo's default theme as a parent theme for everything else (when possible). This makes editing easier and recovery more possible.

Although Flexile I don't think works well as a child theme for xenforo default.
 

Adam Howard

Well-known member
#16
Question:

Do you mind if I add this to another add-on or share it?

Answer:

The code used to make this template is code commonly found within XenForo its self. It is also uses some code from css universal standards (again commonly used). In short there is no exclusive code within this template except for the code which is exclusive only to XenForo, which is open for personal usage to XenForo customer.

As such I claim no ownership to the code used. And you're welcome to freely add it to any add-on or share it among any customer of XenForo Ltd.

Note: Please do not send me PM's for support. Thanks.
 

zooki

Active member
#17
lol so the message space will grow above !

I was thinking of putting "start a conversation" there too.. although, i think call to action should be one word, like "message".
 

Adam Howard

Well-known member
#18
lol so the message space will grow above !

I was thinking of putting "start a conversation" there too.. although, i think call to action should be one word, like "message".
Results will vary depending on your layout and what you have already.... Like with any template modification it is customizable to fit your needs and is optional in that if you don't need it or want it, you don't have to add it :)