Talk about Capitals hockey & more! > General Discusion Anything But Hockey

Tech Issues/Suggestions

<< < (16/17) > >>

OurLadyOfPatience:
Curious if we can allow the “Upcoming Calendar” events to tie into saveable/add-able iCal/Gmail saveable events that could link to the thread slated for the event? 

ArJunaZ:

--- Quote from: OurLadyOfPatience on Thursday April 12, 2018, 08:06:24 PM Eastern ---Curious if we can allow the “Upcoming Calendar” events to tie into saveable/add-able iCal/Gmail saveable events that could link to the thread slated for the event?

--- End quote ---

I'm not familiar with iCal/Gmail.  I've read that iCal import has limited functionality on this site and no export capability, but that was for a slightly older version (2.0.0) of the software. I don't know what if any differences there are in this version (2.0.15) I can't find any documentation on how to use it. I read that the next major release of the forum software is supposed to have enhanced import and export iCal functionality.

I've not slept since Wed morning and my brain is not fully functioning right now. I'll have a look when I'm fresh and see if I can figure it out how to import and possibly export. You may need to know the calendar event ID to import to it. Not understanding the Google iCal is not helping me.

If I were to guess I think the URL to access a calendar event, if it works, would be something like this

    https://washingtoncapitalsfanforum.com/index.php?action=calendar;sa=ical;eventid=102

where the event id must match the event id of the calendar event. You can see it in the URL if you edit the calendar event. It looks like "eventid=102", the one for tonight's calendar event.

I'll attach the "Calendar.php" and "Subs-Calendar.php" and "Post.php" files to this post and you can have a look and see if you can see how it lines up with what you need. We can edit these too and test when the site is not too busy.

If we use any google API's in the code we'll probably have to install a couple of PHP modules to the site. I believe CURL & JSON might be needed. I think I have these available to install.

We should probably talk on the phone about this in the future.


I just found someone that wrote a tweak for the 2.0.0 version of SMF Forum, again ours is version 2.0.15.. Claims it works for both Apple and Google iCal exports.

Here is the modified function: (would go in Calendar.php)
--------------------

function iCalDownload()
{
   global $smcFunc, $sourcedir, $forum_version, $context, $modSettings, $mbname;

   // Goes without saying that this is required.
   if (!isset($_REQUEST['eventid']))
      fatal_lang_error('no_access', false);

   // This is kinda wanted.
   require_once($sourcedir . '/Subs-Calendar.php');

   // Load up the event in question and check it exists.
   $event = getEventProperties($_REQUEST['eventid']);

   if ($event === false)
      fatal_lang_error('no_access', false);

   // Check the title isn't too long - iCal requires some formatting if so.
   $title = str_split($event['title'], 30);
   foreach ($title as $id => $line)
   {
      if ($id != 0)
         $title[$id] = ' ' . $title[$id];
      $title[$id] .= "\n";
   }

   // Format the date. Note: No separator characters are to be used! jre -2011-06-26
   $date = $event['year'] . ($event['month'] < 10 ? '0' . $event['month'] : $event['month']) . ($event['day'] < 10 ? '0' . $event['day'] : $event['day']);
//   $date .= '120000Z'; Since there is no time associated with SMF events this is not required.

   // This is what we will be sending later.
   $filecontents = '';
   $filecontents .= 'BEGIN:VCALENDAR' . "\n";
   $filecontents .= 'VERSION:2.0' . "\n";
   $filecontents .= 'CALSCALE:GREGORIAN' . "\n";  //jre  2011-06-26
   $filecontents .= 'METHOD:PUBLISH' . "\n"; //jre  2011-06-26
   $filecontents .= 'PRODID:-//SimpleMachines//SMF ' . (empty($forum_version) ? 1.0 : strtr($forum_version, array('SMF ' => ''))) . '//EN' . "\n";
   $filecontents .= 'X-WR-CALNAME:'. $mbname. "\n"; //jre  2011-06-26
//   $filecontents .= 'X-WR-TIMEZONE:'. date_default_timezone_get() . "\n"; //not required as there is no time associated with the events. jre  2011-06-26
   $filecontents .= 'BEGIN:VEVENT' . "\n";
        $filecontents .= 'DTSTART;VALUE=DATE:' .$date. "\n"; //jre  2011-06-30
//   $filecontents .= 'DTSTART:' .$date. "\n"; //jre  2011-06-26
//   $filecontents .= 'DTEND:' .$date. "\n"; //jre  2011-06-30

   $filecontents .= 'SUMMARY:' . implode('', $title);
        $filecontents .= 'UID:'.$event['id_event']."@".str_replace(" ","-",$mbname)."\n";//jre 2011-06-30
   $filecontents .= 'END:VEVENT' . "\n";
   $filecontents .= 'END:VCALENDAR';

   // Send some standard headers.

   ob_end_clean();

   if (!empty($modSettings['enableCompressedOutput']))
      @ob_start('ob_gzhandler');
   else
      ob_start();

   // Send the file headers
   header('Pragma: ');
   header('Cache-Control: no-cache');
   if (!$context['browser']['is_gecko'])
      header('Content-Transfer-Encoding: binary');
   header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 525600 * 60) . ' GMT');
   header('Last-Modified: ' . gmdate('D, d M Y H:i:s', time()) . 'GMT');
   header('Accept-Ranges: bytes');
   header('Connection: close');
   header('Content-Disposition: attachment; filename=' . $event['title'] . '.ics');

   // How big is it?
   if (empty($modSettings['enableCompressedOutput']))
      header('Content-Length: ' . $smcFunc['strlen']($filecontents));

   // This is a calendar item!
   header('Content-Type: text/calendar');

   // Chuck out the card.
   echo $filecontents;

   // Off we pop - lovely!
   obExit(false);
}
-------------------------




Now I have about 2 hours or so to sleep before the game. I hope I hear the alarm.
Cheers,

ArJunaZ:

--- Quote from: OldHat on Saturday February 17, 2018, 05:38:07 PM Eastern ---I would like to respectfully ask for some confused/ huh/ raised eyebrow type emojis...

--- End quote ---

I plan on adding/changing some emojis. I'll try to find one for you.

ArJunaZ:
Some people are having issues with the font formatting code. I'm guessing they may be formatting text (changing size, color, etc) and then editing, copying, pasting, or otherwise moving the text around. This can maybe split the code due to grabbing (unseen) formatting code and moving it, which can cause it to be divided and placed out of sequence. The best thing is to type your message and then the very last thing you do is format the text. If you follow this procedure I can't imagine having any problems.  Look at my OP on the GDT's. I have tons of formatting and no issues.


OK, here's what I did to figure this out.

I had a hard time replicating this.  I found that the site  is really good at dealing with cutting and pasting mixed format text. I still do not know how to replicate the problem consistently. I think this may simply be a  random bug, but I did seem to figure out how to clear it up easily if it happens.
I just saw the issue where the code fragments came up after some crazy editing and pasting. It happened when I clicked on the toggle view button twice.  I  imagine if I had posted it at that point it  would have displayed the code fragments, but what I did was simply click on the toggle view button   two more times and it cleared everything up . So maybe those that are having this issue can simply click toggle view button twice and then post after the code get's  properly organized.

BOTTOM LINE:  If you see your post is screwed up then simply "Modify" your post by clicking on "Modify", then click the toggle view button twice.  This should clear up the funky code fragments.  It did for me. Then "Save" your post again.  I have reproduced this (still not sure how) a few times and each time it is resolved by following this procedure.


I would love to hear feedback from those who have this issue and try this solution.  It doesn't usually happen to me, so any help would be appreciated.

Caps17201:
The only symbols that I see to click on, to give a “like” are the same that evidently everyone has under their avatar. If it is the little guy with his hand stuck out, when I hit it, it takes me to the individuals profile page. I see no little green “thumbs up” as in the list of likes given. And mine never show up there. Thanks

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version