• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
  • This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

ragtek Todays Birthdays

R

ragtek

Guest
#1
This add-on adds an sidebar block which shows the users, who have today birthday.
(Attention, ATM it doesn't include the timezone offset! It's using the servertime)

If nobody have birthday, the block won't be shown!
This add-on also respects the privacy settings.

(Attention, as all my sidebar blocks, this add-on requires my add-on helper framework)

After the installation, go into your acp => options => sidebar blocks and configure the position of the block

0 template edits required
0 new queries added

ATTENTION
If you're getting this error:

Invalid id or tag 'xftest_data_ragtek.today_birthdays' : must use only [a-zA-Z0-9_]
you have to change
file: Ragtek_TBSBB_Model
search for
Code:
ragtek.today_birthdays
replace with
Code:
ragtek_today_birthdays
 

Attachments

Brogan

XenForo moderator
Staff member
#2
Any screenshots?
Is it just user name or also avatar displayed?

Does the block display if there are no birthdays?

What about profile privacy? Is that catered for?

How many queries does it add to the page load and/or increased MB?
 
R

ragtek

Guest
#3
RC2 adds 1?? Query to the indexpage.

My plan is, to run the birthday query only once per day, to grab the users and to store them in the xenforo cache, so it won't add any query to the standard pageloads....
 
R

ragtek

Guest
#4
*UPDATE*

1.0.0 Gold available
Changehistory:
This add-on runs an cronjob at midnight, collects the todays birthdays and saves them to the xenforo cache.
So it doesn't require any additional query anymore;)

The cache is also being rebuild if somebody changes:
  • His birthday
  • the birthday privacy setting
And if a user account gets deleted.
 

Brogan

XenForo moderator
Staff member
#6
Just to let you know there's a /dev folder included in the .zip

Just testing it out and I think it would benefit with some changes on the layout, etc.
This is how it currently looks:
birthday.PNG

So you end up with a lot of dead space to the right of each avatar and there is no tooltip or overlay on hover.

Perhaps it would be better to display them as the followed member avatars are?

members.PNG
 

Brogan

XenForo moderator
Staff member
#10
Check the sidebar_online_users template.

Code:
<xen:if is="{$visitor.user_id}">
    <xen:if hascontent="true">
    <h4 class="minorHeading"><a href="{xen:link account/following}">{xen:phrase people_you_follow}:</a></h4>
    <ul class="followedOnline">
        <xen:contentcheck>
            <xen:foreach loop="$onlineUsers.records" value="$user">
                <xen:if is="{$user.followed}">
                    <li title="{$user.username}" class="Tooltip"><xen:avatar user="$user" size="s" img="true" class="_plainImage" /></li>
                </xen:if>
            </xen:foreach>
        </xen:contentcheck>
    </ul>
    <h4 class="minorHeading"><a href="{xen:link members}">{xen:phrase members}:</a></h4>
    </xen:if>
</xen:if>
 
R

ragtek

Guest
#11
My idea for this was to make it in the next version like the staff online box (avatar and name and title) OR only the name because i hate the "only avatar" idea.
I don't know the avatars of all the users... and i don't want to move the mouse too see the toolbox...

my 0.02$ ^^
But as usual, i'm open for suggestions:)
 

Brogan

XenForo moderator
Staff member
#14
Personally speaking, I think the vertical stacked one will take up too much space as there is a lot of unused horizontal space.

My preference would just be the avatar with information on hover such as name and age, etc.

It's your add-on though ;)
 

Veer

Well-known member
#16
Personally speaking, I think the vertical stacked one will take up too much space as there is a lot of unused horizontal space.

My preference would just be the avatar with information on hover such as name and age, etc.

It's your add-on though ;)
Yeah, mine too.. just avatars idea would be nice, Plus on hover display Name + Age (something like 19th b'day).
 
R

ragtek

Guest
#18
OK first line isn't the problem
second line (people celebrating ... ) is a problem because of my non existing css knowledge:D
i should really start learning this stuff:(
 

Brogan

XenForo moderator
Staff member
#19
I can help you work on it if you like?

You can literally re-use the "following avatar" code and just change the phrases.

For example:
Code:
<div class="secondaryContent">
    <h3>{xen:phrase todays_birthdays}</h3>

    <xen:if is="{$onlineUsers.records}">

        <xen:if is="{$visitor.user_id}">
            <xen:if hascontent="true">
            <h4 class="minorHeading">{xen:phrase people_celebrating_their_birthday}:</a></h4>
            <ul class="todaysBirthdays">
                <xen:contentcheck>
                    <xen:foreach loop="$onlineUsers.records" value="$user">
                        <xen:if is="{$user.followed}">
                            <li title="{$user.username}, {$user.age} {xen:phrase today}" class="Tooltip"><xen:avatar user="$user" size="s" img="true" class="_plainImage" /></li>
                        </xen:if>
                    </xen:foreach>
                </xen:contentcheck>
            </ul>
            </xen:if>
        </xen:if>
    </xen:if>
</div>
I haven't changed the corresponding code, just the phrases and removed some of the a href links.
 
R

ragtek

Guest
#20
That's what i have now:
Code:
<div class="section avatarList">
    <div class="secondaryContent">
        <h3>{xen:phrase ragtek_todays_birthdays}: {xen:count $users}</h3>
 <h4 class="minorHeading">People celebrating their Birthday</h4>
       <ul class="followedOnline">
            <xen:foreach loop="$users" value="$user">
                  <li title="{$user.username}" class="Tooltip"><xen:avatar user="$user" size="s" img="true" class="_plainImage" /></li>
            </xen:foreach>
        </ul>
    </div>
</div>
Only the age calculating is missing, then it's finished^^
 

Attachments