TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

May 21, 2024, 12:23:45 AM

Login with username, password and session length
Members
Stats
  • Total Posts: 195,197
  • Total Topics: 21,221
  • Online today: 363
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 266
  • Total: 266

SMF Calendar Block

Started by Lesmond, September 03, 2005, 11:30:42 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

MinasC

fool me , i had this set to 7 days , that's why it didn't show xmas , lol ! i don't have many events so 30 days in advance works fine ! i just want the months' events to show in that block !

thnx a lot !

MinasC

Quote from: MinasC on November 25, 2007, 05:50:56 PM
in the events could it show the member who created the event ? it would also be great if instead of the whole event title there was a linitation of the characters  to show so that large event titles don't take 3-4 lines !

thnx in advance !

what about that , is it possible ?

jacortina

Quote from: ZTN on December 01, 2007, 12:07:15 PM
How many events, and how long in advance is the calendar set?

No, actually, it doesn't. The snippet being used bypasses it and goes directly to the functions that the SSI would call.


Quote from: MinasC on November 25, 2007, 05:50:56 PM
would it be too much to ask for one more thing ?  :-\

in the events could it show the member who created the event ? it would also be great if instead of the whole event title there was a linitation of the characters  to show so that large event titles don't take 3-4 lines !

thnx in advance !

Limiting the output would should be trivial. Try this.

Find:
$link = $event['topic'] == 0 ? $event['title'] : '<a href="' . $scripturl . '?topic=' . $event['topic'] . '.0' . '">' . $event['title'] . '</a>';

Add a line before it to make it:
$event['title'] = (strlen($event['title']) > 50) : substr($event['title'],0,50).'...' : $event['title'];
$link = $event['topic'] == 0 ? $event['title'] : '<a href="' . $scripturl . '?topic=' . $event['topic'] . '.0' . '">' . $event['title'] . '</a>';


I use 50 as a length here, but I believe that will only yield an output of 25 characters (for YOU as you are using multi-byte characters). You can tweak the value (in both of the two places in that new line) and see what you like.


At this point, pulling the User Name isn't as easy. While the function that gets events DOES get their MEMBER_ID, That list of ID's would have to be collected and the query for their names included.

Zetan

Quote from: J.A.Cortina on December 01, 2007, 06:12:58 PM
Quote from: ZTN on December 01, 2007, 12:07:15 PM
How many events, and how long in advance is the calendar set?

No, actually, it doesn't. The snippet being used bypasses it and goes directly to the functions that the SSI would call.


My error..
And reducing the Days In Advance resolved the problem I was having.

MinasC

Quote from: ZTN on December 01, 2007, 06:23:27 PM
My error..
And reducing the Days In Advance resolved the problem I was having.

strange , but it resolved mine too !  ???

J.A.Cortina thnx for the support , i will do the change asap ! pitty for the members' names though ! it would look better if it would show who created the event , but one can't have it all , right ?  :-\

MinasC

well , before i applied your alteration i tried to create an event with a large title and i found out there is already a restriction of (only a few unfortunately) letters ! so , the good thing is that my fear of members creating events with enormous titles has now no basis , while the bad thing is that i would like more letters to be allowed in the titles of the events (by not allowing posting of the events the only thing a member has to describe the event is the title , and just 20 letters are not enough) ! is there any way to increase that limit ?

not to be misunderstood , your alteration for limiting the letters of the events titles showing in the block is still a go (what is showing in the block and what is the actual event title are two very different things) ! i have to tell you though , with just a few events created by members , one cannot tell who created which (it's not showing the creator's name in the calendar either) and it's a total chaos ! any luck we could give that a try ?

thnx a lot for the support !

Rus

I have a user with a birthday in January and its showing before the December birthdays.  Not a big deal, just an aesthetic thing if you wanted to look into it.

Xarcell

What you put the member's ame who created in into a "title" of the link? This way you see it on mouseover...

jacortina

Quote from: Rus on December 05, 2007, 11:43:33 PM
I have a user with a birthday in January and its showing before the December birthdays.  Not a big deal, just an aesthetic thing if you wanted to look into it.

I believe this comes down to a flaw in the underlying SMF function (which is corrected somewhere upstream for their own list of b-days on the boardindex).

The function calendarBirthdayArray() in Calendar.php has the test:
if ($year_low != $year_high)
$age_year = substr($row['birthdate'], 5) < substr($high_date, 5) ? $year_high : $year_low;
else
$age_year = $year_low;


I 'think' they may play some games with the low_date and/or high_date values fed in, but just using the 'real values for those (corresponding to the range of days selected), that test means that the last day of a range that crosses the year boundary will always be assigned the EARLIER year (a birthday on that last date won't be LESS THAN the last date, after all). So, of course it sorts in front of the other birthdays. Holidays (New Years Day, for example) are treated the same. Events, though, have specific year values attached, so they aren't effected the same.

I'm looking into it and I'll try to get to a fix (before the end of the month, when it won't matter again until this time NEXT year ;) ).

Rus

Hehe, no worries, it seems to have fixed itself somehow.