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

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,917
  • Total Topics: 21,308
  • Online today: 728
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 1
  • Guests: 477
  • Total: 478
  • @rjen

SMF Calendar Block

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

Previous topic - Next topic

0 Members and 4 Guests are viewing this topic.

thoraxe

the way the calendar works right now you would need to create the raids in the calendar and then modify your website to pull the raid forum for the list.

otherwise you'd need to write some kind of hook that would enable your utility to write to the calendar database.

I'm not sure if theres a way to have an event without a thread... it would be like a holiday then.

myndcraft

Quote from: thoraxe on May 04, 2006, 04:54:46 PM
the way the calendar works right now you would need to create the raids in the calendar and then modify your website to pull the raid forum for the list.

otherwise you'd need to write some kind of hook that would enable your utility to write to the calendar database.

I'm not sure if theres a way to have an event without a thread... it would be like a holiday then.

And thus I will wait for someone with far greater knowledge then me and the same desire to do it LOL =)

thoraxe

I wish it was that easy... I have such an awesome idea for an events module for SOME portal or CMS, but no one seems to be motivated to do it, even though they all have greater knowledge =)  I wish that I had the time to implement it myself.  My PHP skills are OK, but limited, and everything takes me far longer than it would take someone else who knew what they were doing.

Oh well... the curse of open source I suppose.  If only I had money!

rbh

i get these 2 different views of the block from ie and firefox. the first picture is the view from ie, and the second is from firefox. the firefox view is fine other then the little square the circles the date runs out of the block on saturdays, but it doesn't even show in ie. the ie view also doesn't size to match my other blocks. any suggestions to get this block to look the same with ie and ff?


Blue Steel

always specify all attributes in each tag.. eg:cellpadding,borderwidth,image size, borders, colours.. each browser makes its own assumptions about what the defaults should be.. and of course they are different in some cases..(no i'm not going to say which is right and which isn't ;P )

I believe once you get in a habbit on never assuming anything then your better off in everything..

Xarcell

Ok, noob here...

I tried to place that following code into a php file by itself, to show my calendar & events on my blog site via iframe.

I got this error:

Fatal error: Call to undefined function: ssi_todaysbirthdays() in /home/.abigaildryer/xarcell/xarcell-studios.com/TagWorld/frames/calendar/calendar.php on line 68

Any solutions?

RoarinRow

Not sure which code you use, but this one works for me.

global $scripturl, $modSettings, $sourcedir;

$now = mktime() + $modSettings['time_offset'] * 3600;
         $today = date('j',$now);
         $year = date("Y",$now);
         $month = date("n",$now);
         $days = array($today=>array(NULL,NULL,'<a class="smalltext" style="color: steelblue; font-weight: bold; border: solid 1px black; background-color: white; padding: 0px 4px 0px 4px;" href="'.$scripturl.'?action=calendar;sa=post;month='.$month.';year='.$year.';day='.$today.'" target="_self">'.$today.'</a>'));

         $day_name_length = 2;
         $month_href = $scripturl . '?action=calendar';
         $first_day = 0;
         $pn = array();

$first_of_month = gmmktime(0,0,0,$month,1,$year);
#remember that mktime will automatically correct if invalid dates are entered
# for instance, mktime(0,0,0,12,32,1997) will be the date for Jan 1, 1998
# this provides a built in "rounding" feature to generate_calendar()

$day_names = array(); #generate all the day names according to the current locale
for($n=0,$t=(3+$first_day)*86400; $n<7; $n++,$t+=86400) #January 4, 1970 was a Sunday
$day_names[$n] = ucfirst(gmstrftime('%A',$t)); #%A means full textual day name

list($month, $year, $month_name, $weekday) = explode(',',gmstrftime('%m,%Y,%B,%w',$first_of_month));
$weekday = ($weekday + 7 - $first_day) % 7; #adjust for $first_day
$title   = htmlentities(ucfirst($month_name)).' '.$year;  #note that some locales don't capitalize month and day names

#Begin calendar. Uses a real <caption>. See http://diveintomark.org/archives/2002/07/03
@list($p, $pl) = each($pn); @list($n, $nl) = each($pn); #previous and next links, if applicable
if($p) $p = '<span class="smalltext">'.($pl ? '<a href="'.htmlspecialchars($pl).'">'.$p.'</a>' : $p).'</span> ';
if($n) $n = ' <span class="smalltext">'.($nl ? '<a href="'.htmlspecialchars($nl).'">'.$n.'</a>' : $n).'</span>';
$calendar = '<table align="center" valign="top">'."\n".
'<caption >'.$p.($month_href ? '<a href="'.htmlspecialchars($month_href).'">'.$title.'</a>' : $title).$n."</caption>\n<tr>";

if($day_name_length){ #if the day names should be shown ($day_name_length > 0)
#if day_name_length is >3, the full name of the day will be printed
foreach($day_names as $d)
$calendar .= '<th class="smalltext" abbr="'.htmlentities($d).'">'.htmlentities($day_name_length < 4 ? substr($d,0,$day_name_length) : $d).'</th>';
$calendar .= "</tr>\n<tr style=\"text-align:right;\">";
}

if($weekday > 0) $calendar .= '<td class="smalltext" colspan="'.$weekday.'"> </td>'; #initial 'empty' days
for($day=1,$days_in_month=gmdate('t',$first_of_month); $day<=$days_in_month; $day++,$weekday++){
if($weekday == 7){
$weekday   = 0; #start a new week
$calendar .= "</tr>\n<tr style=\"text-align:right;\">";
}
if(isset($days[$day]) and is_array($days[$day])){
@list($link, $classes, $content) = $days[$day];
if(is_null($content))  $content  = $day;
$calendar .= '<td "'.($classes ? ' class="'.htmlspecialchars($classes).'">' : '>').
($link ? '<a href="'.htmlspecialchars($link).'">'.$content.'</a>' : $content).'</td>';
}
else
{
$calendar .= "<td class=\"smalltext\" style=\"padding-right:4px;\"><a";
if(((($weekday+$first_day) % 7)==0)||((($weekday+$first_day) % 7)==6))
{
$calendar .= ' style="color:#C00000;"';
}
$calendar .= " href=\"".$scripturl."?action=calendar;sa=post;month=".$month.";year=".$year.";day=".$day."\" target=\"_self\">$day</a></td>";
}
}
if($weekday != 7) $calendar .= '<td class="smalltext" colspan="'.(7-$weekday).'"> </td>'; #remaining "empty" days

echo $calendar.'</tr>';

if (ssi_todaysBirthdays('')) {
  echo '<tr><td><hr></td><td colspan="5" class="smalltext" align="center">Birthdays</td><td><hr></td></tr><td colspan="7" class="smalltext">';
  ssi_todaysBirthdays();
  echo '</td></tr>';
}

if (ssi_todaysCalendar('')) {
  echo '<tr><td><hr></td><td colspan="5" class="smalltext" align="center">Upcoming Events</td><td><hr></td></tr><td colspan="7" class="smalltext">';
  ssi_todaysCalendar();
  echo '</td></tr>';
}

echo '</table>';

SMF 2.0 RC3
TP 1.0 beta 5-1
Wordpress 3.0


RoarinRow

Quote from: Xarcell on May 15, 2006, 06:34:21 AM
http://xarcell-studios.com/TagWorld/frames/calendar/calendar.php

Got this when I click on your link:


Fatal error: Call to undefined function: ssi_todaysbirthdays() in /home/.abigaildryer/xarcell/xarcell-studios.com/TagWorld/frames/calendar/calendar.php on line 70

SMF 2.0 RC3
TP 1.0 beta 5-1
Wordpress 3.0

jpark

I get birthdays shown twice in both "Birthdays" and "Upcoming Events".. how do I correct this?  Thanks in advance :D

This website is proudly hosted on Crocweb Cloud Website Hosting.