Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
- Index
- » MetaMod
- » MetaMod General Support
- » [SOLVED]Module Happy birthday
[SOLVED]Module Happy birthday
Re: [SOLVED]Module Happy birthday
Hi sniper_rio,
How about this:
Code:
if ($user->id > 0) {
$sql = 'select * from #__comprofiler where user_id = ' . (int)$user->id;
$db->setQuery( $sql, 0, 1 );
$row = $db->loadObject();
if ($row && substr( $row->cb_birthday, 5) == sprintf("%02d-%02d", MM_MONTH, MM_DAY_OF_MONTH) ) {
return "101"; /* happy birthday module! */
}
}
You just need to customise 2 things here:
1 - make sure that "$row->cb_birthday" in the recipe above matches the name of the birthday parameter in CommunityBuilder. e.g. if you have named the parameter "cb_birthdate" then you have to change that here to match.
2 - replace "101" with the module id of the module you want to display on their birthday.
Also, you might want to think about what time zone you set up in MetaMod -- use the drop-down list for the timezone to find the most appropriate one for your viewers. The default one is usually ok (it defaults to the time zone Joomla is set up with), but the default Joomla timezone system does not respect daylight savings time. If you use the timezone settings in MetaMod, then these ones DO respect daylight savings times.
Hope that helps,
Stephen
- Index
- » MetaMod
- » MetaMod General Support
- » [SOLVED]Module Happy birthday
Board Info
- Board Stats:
- Total Topics:
- 1700
- Total Polls:
- 6
- Total Posts:
- 5967
- Posts this week:
- 3
- User Info:
- Total Users:
- 8056
- Newest User:
- no21an
- Members Online:
- 0
- Guests Online:
- 226
- Online:
- There are no members online
Forum Legend:
Topic
New
Locked
Sticky
Active
New/Active
New/Locked
New Sticky
Locked/Active
Active/Sticky
Sticky/Locked
Sticky/Active/Locked