I have hacked it from other snippets and the existing SMF code. It is probably quite rough and open to improvement, but at least I didn't get a syntax error ;D .
echo'
<div class="smalltext">';
$result = ssi_todaysHolidays('array');
if (!empty($result))
echo '
<span class="smalltext"><b>', $txt['calendar5'], ' ', implode(', ', $context['calendar_holidays']), '</b></span><br /><br />';
else
echo '';
echo'
<span><b>', $txt['calendar3'], '</b></span><br />';
$result = ssi_todaysBirthdays('array');
if (!empty($result))
{
foreach ($result as $member)
echo '
<span class="smalltext"><a href="', $scripturl, '?action=profile;u=', $member['id'], '">', $member['is_today'] ? '<b>' : '', $member['name'], $member['is_today'] ? '</b>' : '', isset($member['age']) ? ' (' . $member['age'] . ')' : '', '</a>', $member['is_last'] ? '</span><br /><br />' : ', ';
}
else
echo 'There are no birthdays today. <br /><br />';
echo'
<span><b>', $txt['calendar4'], '</b></span><br />';
$result = ssi_todaysEvents('array');
if (!empty($result))
{
foreach ($result as $event)
echo '<span class="smalltext"><a href="' . '?action=calendar;' . '">' . $event['title'] . '</a></span><br />';
}
else
echo 'There are no events today. <br />
</div>';
I have updated the code, I found that the events link could be a little 'strange' so clicking on an event will now open the Calendar page.
cool :) Thanks 8)
Nice one. Added it to my portal.
Yup, very cool 8)
There is already a event ssi funtion for TP, that shows events holidays and birthdays.
I am aware of that, but it doesn't differentiate between today and other days, all are upcoming and it just leaves a blank if there are none as opposed to saying that there are none. They are the reasons I put this block together.
Thank you :)
nokonium,
How would one add a date prior to each event in this format MM/DD? so it would look like this: 2/14 Happy Hour
and remove Birthdays from it, just leave events list.
I like this snippet, I changed it a bit and it crashed. I am such a rookie...hahaha
jake
This would be good if you just wanted those info to show up but I would rather use another code that shows a calendar and then the birthdays/events/etc :)
Brianjw
Parse error: syntax error, unexpected T_STRING in /home/gmlong/public_html/stackedconnectors/forum/Themes/default/TPortalBlocks.template.php(35) : eval()'d code on line 10
The script seems to have been messed up.. likely caused when tinyPortal recently moved servers..
If you actually look at the script..
Ã, Ã, Ã, echo '';Ã, Ã, Ã, Ã, Ã,
for example.. it's clearly wrong.. it will never work until it has been corrected.
Should be fixed now.
Parse error: syntax error, unexpected T_FOREACH in /home/minasc/public_html/forumv3/Sources/Load.php(1834) : eval()'d code(35) : eval()'d code on line 17
Looks like there's still an artifact from the move on line 17. Change it so it's
foreach ($result as $member)
I've corrected it :)
works great now ! two requests :
1) could it show the date (just the date , like october 29 , 2007 , without the time) just before every birthday and event ? i guess that would mean that every birthday/event should be in its own line .
2) could it show the birthdays/events of the present month even if they are of a past day of the month ? (the concept is that i want to let my members know of a birthday that has passed 2 days ago - for example - so that they can wish even a bit late).
thnx a lot in advance !
This is a Excelent script, thankyou!!
:up: :up: :up: :up: :up: 5 Thumbs up!! :D
Quote from: MinasC on October 29, 2007, 11:13:16 AM
works great now ! two requests :
1) could it show the date (just the date , like october 29 , 2007 , without the time) just before every birthday and event ? i guess that would mean that every birthday/event should be in its own line .
2) could it show the birthdays/events of the present month even if they are of a past day of the month ? (the concept is that i want to let my members know of a birthday that has passed 2 days ago - for example - so that they can wish even a bit late).
thnx a lot in advance !
isn't there any way to do those ?
thnx
All I have done is utilised two SMF SSI's.
The settings that control the SSI's are the SMF Features and Options 'Default time format' or the Profile 'Time Format:' and Calendar Settings 'Max days in advance on board index:'
eeehm , sorry but i didn't understand a thing ! not a coder you see ! most of all i care about the block showing birthdays , events and holidays of the present month instead of the current day's . is that possible ?
(sorry for me not understanding , but i couldn't possibly "play" with the ssi , seems like a foreign language to me !)
thnx a lot !
Basically what I get that he's telling you is that he isn't a coder either. He understands the basics from what I can tell, but he appears to be saying you're on your own if you want something more to be output from it, unless someone else is willing to look at it.
Check to see if this block would suit -
http://www.tinyportal.net/index.php?topic=700.msg160852#msg160852
Quote from: J.A.Cortina on November 23, 2007, 04:32:13 PM
Check to see if this block would suit -
http://www.tinyportal.net/index.php?topic=700.msg160852#msg160852
wow , that is great mate , used it already and works fine , except from the language thing , but i will post that in that thread , not here ! thnx !
I would love to have this, but where do I put the code?
In a phpbox block type or article.
When I do that, I get a: Parse error: syntax error, unexpected $end in /home/steph71/public_html/flourishbaby/flourish/Sources/Load.php(1751) : eval()'d code(35) : eval()'d code on
Then you probably didn't copy/paste the code. Or something is missing. The code worked for me.
Nevermind, I am retarded. :) I figured it out. Thanks so much for helping a sort of newbie.
Ok so may I verify the code needed to simply show the current months birthdays? Not just that days .. But all the birthdays in the current month please.
Block could be This Months Birthdays
with the day - member ie:
10- Niagra
25 - Peter Pan
Thanks for your help. As always.
http://www.tinyportal.net/index.php?topic=11943.msg164912#msg164912