Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Add-ons

Reply
 
Thread Tools
Widget - Today's Birthdays Details »»
Widget - Today's Birthdays
Version: 1.00, by ZexTasy ZexTasy is offline
Developer Last Online: Feb 2011 Show Printable Version Email this Page

Category: vBulletin CMS Widgets - Version: 4.0.8 Rating:
Released: 12-09-2010 Last Update: 12-09-2010 Installs: 49
Uses Plugins Template Edits
Translations  
No support by the author.

First I want to thank Lynne for giving me a good startup for both code and this post from her Widget - Online Users mod.

This is a widget for your CMS pages to show Today's Birthdays.



You will need to Create a new Template (vbcms_widget_execphp_birthdays), Cache the template, Create a new Widget (Today's Birthdays), Configure the Widget, and then finally add the Widget to your Layout (I am not including instructions for that, you should know how to add Widgets to Layouts).

1.0 2010-12-10: First version (4.0.8)

INSTALL INSTRUCTIONS:

1) Create a new Template
Styles & Templates > select style (I like to do this in the MASTER STYLE, but you will need to reinput it after every upgrade) > Add Template
Title - vbcms_widget_execphp_birthdays
Template code -
HTML Code:
<vb:if condition="$show['birthdays']">
<div class="cms_widget category_widget">
    <div class="block">
        <div class="cms_widget_header">
	    <h3><img src="{vb:stylevar imgdir_misc}/birthday.png" alt="{vb:rawphrase todays_birthdays}" /> {vb:rawphrase todays_birthdays}</h3>
        </div>
        <div class="cms_widget_content widget_content">
            <div>
                <ol class="commalist">
			{vb:raw birthdays}
		</ol>
            </div>
        </div>
    </div>
</div>
</vb:if>

2) Create a new Plugin
Plugins & Products > Add New Plugin > leave everything default except:
Hook Location - cache_templates
Title - Cache template for Today's Birthdays Widget
Plugin PHP code -
PHP Code:
if (THIS_SCRIPT == 'vbcms')
{
    
$cache[] = 'forumhome_birthdaybit';

Plugin is Active - Yes

3) Create a new Widget
vBulletin CMS > Widgets > Create New Widget
Widget Type - PHP Direct Execution
Title - Today's Birthdays
SAVE

4) Configure the Widget
Now go to vBulletin CMS > Widgets > Today's Birthdays > Configure
Change the Template Name to -
vbcms_widget_execphp_birthdays
Add the following code -
PHP Code:
$today vbdate('Y-m-d'TIMENOWfalsefalse);

// ### TODAY'S BIRTHDAYS #################################################
if (vB::$vbulletin->options['showbirthdays'])
{
    if (!
is_array(vB::$vbulletin->birthdaycache)
        OR (
$today != vB::$vbulletin->birthdaycache['day1'] AND $today != vB::$vbulletin->birthdaycache['day2'])
        OR !
is_array(vB::$vbulletin->birthdaycache['users1'])
    )
    {
        
// Need to update!
        
require_once(DIR '/includes/functions_databuild.php');
        
$birthdaystore build_birthdays();
        
DEVDEBUG('Updated Birthdays');
    }
    else
    {
        
$birthdaystore $vbulletin->birthdaycache;
    }
    switch (
$today)
    {
        case 
$birthdaystore['day1']:
            
$birthdaysarray $birthdaystore['users1'];
            break;

        case 
$birthdaystore['day2']:
            
$birthdaysarray $birthdaystore['users2'];
            break;

        default:
            
$birthdaysarray = array();
    }
    
// memory saving
    
unset($birthdaystore);

    
$birthdaybits = array();

    foreach (
$birthdaysarray AS $birthday)
    {
        
$templater vB_Template::create('forumhome_birthdaybit');
            
$templater->register('birthday'$birthday);
        
$birthdaybits[] = $templater->render();
    }

    
$birthdays implode(''$birthdaybits);
    

    
$show['birthdays'] = iif ($birthdaystruefalse);
}
else
{
    
$show['birthdays'] = false;
}

$birthdaysarray = array('birthdays' => $birthdays,
    
'show' => $show,
    );
vB_Template::preRegister('vbcms_widget_execphp_birthdays'$birthdaysarray); 
After install clear the CMS cache

Download Now

File Type: txt widget-birthdays 1.0.txt (3.2 KB, 188 views)

Screenshots

File Type: jpg todays_birthdays_widget.jpg (6.6 KB, 0 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #22  
Old 08-23-2011, 05:15 AM
Scitz0 Scitz0 is offline
 
Join Date: Jun 2009
Posts: 60
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm on 4.1.5 and I cant get this widget to display. Even before when I was on 4.1.2 it didn't work.
I have followed the instructions to the letter, even removed it and reinstalled several times to be sure I didn't miss anything.

I can see some post here that people only see it after clearing CMS cache but not even that helps in my case.

What can I do to help you help me?

I have checked that birthdays are activated in the settings as well, both under general settings and under usergroup settings.
Reply With Quote
  #23  
Old 04-11-2012, 12:27 PM
dang3rzon3 dang3rzon3 is offline
 
Join Date: Sep 2009
Location: Milano (Italy)
Posts: 73
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hello,
how to use in the sidebar forum?
Reply With Quote
  #24  
Old 04-17-2012, 08:27 AM
Tri@de's Avatar
Tri@de Tri@de is offline
 
Join Date: Sep 2003
Posts: 168
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

vb 4.1.12 don't work.
Reply With Quote
Благодарность от:
JustAskJulie
  #25  
Old 05-10-2012, 06:47 PM
JustAskJulie JustAskJulie is offline
 
Join Date: Nov 2002
Posts: 197
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

4.1.12 and the widget shows up but it's empty - despite a birthday showing on the "What's going on" list on forumhome.
Reply With Quote
  #26  
Old 11-14-2012, 10:30 AM
s_cocis s_cocis is offline
 
Join Date: Nov 2011
Posts: 49
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

for 4.2 ?
Reply With Quote
  #27  
Old 12-05-2012, 01:59 AM
080208 080208 is offline
 
Join Date: Dec 2012
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I do not work in 4.2 (
Reply With Quote
  #28  
Old 06-18-2013, 12:21 AM
petersweb petersweb is offline
 
Join Date: Feb 2005
Location: Australia
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I am using VB 4.2.1. I cannot get the widget to show on the CMS when there are birthdays listed in the "What's Going On" section.
Reply With Quote
  #29  
Old 02-16-2014, 05:18 PM
BGObsession's Avatar
BGObsession BGObsession is offline
 
Join Date: Apr 2009
Posts: 199
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Uninstalled on 4.2.1 (widget block shows but does not display birthday despite test user birthday. It's not a cache clearing issue. The mod simply doesn't work.
Reply With Quote
  #30  
Old 03-04-2014, 07:11 AM
AndroidXDA AndroidXDA is offline
 
Join Date: Mar 2014
Location: UK
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Interesting, Will try this out on my 4.2.2 and get back to you.
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:57 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05093 seconds
  • Memory Usage 2,341KB
  • Queries Executed 27 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_html
  • (2)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (1)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (2)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete