Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
  #1  
Old 03-17-2005, 10:59 AM
mkdevo mkdevo is offline
 
Join Date: May 2004
Location: CT, USA
Posts: 269
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Calendar: Add event to Outlook Calendar?

i saw this here and was wondering if something similar could be done in VB for adding a VB calendar event to your MS Outlook calendar.. it would be extremely useful..

anyone have any idea of how easy/difficult this would be?
Reply With Quote
  #2  
Old 03-17-2005, 11:42 AM
Colin F's Avatar
Colin F Colin F is offline
 
Join Date: Jul 2004
Location: Switzerland
Posts: 1,551
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Your example is coded in ASP, but it's an interesting idea.

I think I'll have a look at that...

It seems they're using a vcs file.
Here is the format:

Code:
BEGIN:VCALENDAR
VERSION:1.0
BEGIN: VEVENT
DTStart:20050317T000000
DTEnd:20050318T000000
Location;ENCODING=QUOTED-PRINTABLE:River Street Jazz Cafe | Plains, PA
UID:20050317T00000020050318T000000
DESCRIPTION;ENCODING=QUOTED-PRINTABLE:=0D=0A=0D=0ANote: Start and endtimes of Outlook appointment above may differ from official event starttime=0D=0A=0D=0AMore Info:http://www.jambase.com/search.asp?eventID=3D283585=0D=0A=0D=0AGo SeeLive Music!=0Dhttp://www.jambase.com
SUMMARY;ENCODING=QUOTED-PRINTABLE:The Breakfast
PRIORITY:3
End:VEVENT
End:VCALENDAR
What would need to be done is code a page which outputs this data, given the eventid. Not that hard actually...
Reply With Quote
  #3  
Old 03-17-2005, 12:25 PM
Colin F's Avatar
Colin F Colin F is offline
 
Join Date: Jul 2004
Location: Switzerland
Posts: 1,551
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Here's some code you can use:

PHP Code:
if ($_REQUEST['do'] == 'outlookevent')
{
    if (!
$eventinfo['eventid'])
    {
        eval(
print_standard_error('error_invalidid'));
    }
    
    
$noheader 1;

    
$fromdate_1 date('Ymd'$eventinfo['dateline_from']);
    
$fromdate_2 date('His'$eventinfo['dateline_from']);
    
$fromdate $fromdate_1 'T' $fromdate_2;

    if (
$eventinfo['dateline_to'] != 0)
    {
        
$todate_1 date('Ymd'$eventinfo['dateline_to']);
        
$todate_2 date('His'$eventinfo['dateline_to']);
    }
    else
    {
        
$todate_1 date('Ymd'$eventinfo['dateline_to'] + 86400);
        
$todate_2 date('His'$eventinfo['dateline_to']);
    }
    
$todate $todate_1 'T' $todate_2;
    
    
$vcsoutput 'BEGIN:VCALENDAR
VERSION:1.0
BEGIN: VEVENT
DTStart:' 
$fromdate '
DTEnd:' 
$todate_1 '
UID:' 
$fromdate $todate_1 '
DESCRIPTION;ENCODING=QUOTED-PRINTABLE:=0D=0A=0D=0A' 
.  $eventinfo[event] . '
PRIORITY:3
End:VEVENT
End:VCALENDAR'
;

    
header('Content-type: application/download');
    
header('Content-Disposition: attachment; filename=event.vcs');
    echo 
$vcsoutput;
    exit;




Add this to your calendar.php, before this:

PHP Code:
eval(print_standard_error('error_invalidid'));

/*======================================================================*\
|| #################################################################### 
Then, add a link and link to calendar.php?do=outlookevent&e=$eventid
Reply With Quote
  #4  
Old 03-17-2005, 02:41 PM
mkdevo mkdevo is offline
 
Join Date: May 2004
Location: CT, USA
Posts: 269
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

colin -

wow. thanks. i have a couple of issues though.

first is probably something simple - when i added the link to my template, i altered the following in calendar_showeventsbit:
Code:
<tr>
	<td width="50%" class="tcat">$eventinfo[title]</td>
	<td width="50%" class="tcat"><p align="right"><a href="http://www.thebreakfast.info/forum/calendar.php?do=outlookevent&e=$eventid">Add to Outlook <img border="0" src="http://www.thebreakfast.info/images/outlook_logo.gif" width="30" height="30"></a></td>
</tr>
that messed up my main cell (see pic below).. can you tell what i did wrong there?


now, when i click on the link, i get:

Invalid Event specified. If you followed a valid link, please notify the webmaster

i'm guessing i messed something up with the link (see code above), because when i hover over it, it shows ...calendar.php?do=outlookevent&e=0

just wondering if you could help me get this going. thanks again!

dave
Attached Images
File Type: jpg outlook.jpg (166.6 KB, 0 views)
Reply With Quote
  #5  
Old 03-17-2005, 07:49 PM
Colin F's Avatar
Colin F Colin F is offline
 
Join Date: Jul 2004
Location: Switzerland
Posts: 1,551
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

use $eventinfo[eventid] instead of $eventid

Also, you might have to change the colspan for the table cells below...
Reply With Quote
  #6  
Old 05-25-2005, 04:26 PM
zylstra zylstra is offline
 
Join Date: Aug 2004
Posts: 144
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Don't forget to add
PHP Code:
SUMMARY' .  $eventinfo[title] . ' 
before the DESCRIPTION: part.

Also, the dates aren't correct for ranged events. I'll have to fix this later.
Reply With Quote
  #7  
Old 10-10-2006, 05:04 PM
zennifer zennifer is offline
 
Join Date: Jan 2004
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is anyone working on this? I have it almost working but the timezones are causing an issue with the times not being correct.

Here's what I have:

PHP Code:
// ##############################  add to outlook ############################
if ($_REQUEST['do'] == 'outlookevent')
{
    if (!
$eventinfo['eventid'])
    {
      eval(
standard_error(fetch_error('invalidid')));
    }
    
    
$noheader 1;

    if (
date('Ymd'$eventinfo['dateline_to']) >= date('Ymd'$eventinfo['dateline_from']))
    {
        
$todate_1 date('Ymd'$eventinfo['dateline_to']);
        
$todate_2 date('His'$eventinfo['dateline_to']-3600);
        
$fromdate_1 date('Ymd'$eventinfo['dateline_from']);
        
$fromdate_2 date('His'$eventinfo['dateline_from']-3600);
        
$fromdate ':'.$fromdate_1 'T' $fromdate_2;
        
$todate ':'.$todate_1 'T' $todate_2;
    }
    else 
    if (
$eventinfo['dateline_to'] = $eventinfo['dateline_from'])
    {
        
$todate_1 date('Ymd'$eventinfo['dateline_from']);
        
$todate_2 date('His'$eventinfo['dateline_from']-3600);
           
$fromdate_1 date('Ymd'$eventinfo['dateline_from']);
        
$fromdate_2 date('His'$eventinfo['dateline_from']-3600);
        
$fromdate ';VALUE=DATE:'.$fromdate_1;
        
$todate ';VALUE=DATE:'.$todate_1;
    }
    else
    {
        
$fromdate_1 date('Ymd'$eventinfo['dateline_from']);
        
$fromdate_2 date('His'$eventinfo['dateline_from']-3600);
        
$fromdate ':'.$fromdate_1 'T' $fromdate_2;
        
$todate ':'.fromdate;
    }
        
    
    
$event_char = array("<br>""<\br>""\n""\r");    
    
$description_rep str_replace($event_char"\\n "$eventinfo['event']);
    
$title_rep str_replace($event_char" "$eventinfo['title']);
    
    
$vcdatestamp_1 date('Ymd');
    
$vcdatestamp_2 date('His');
    
$vcdatestamp $vcdatestamp_1 'T' $vcdatestamp_2;
    
    
    
$vcsoutput 'BEGIN:VCALENDAR
VERSION:2.0
PRODID:fnlct_calendar
METHOD:PUBLISH
BEGIN:VEVENT
DTSTART' 
$fromdate '
DTEND' 
$todate '
LOCATION:
TRANSP:OPAQUE
SEQUENCE:0
UID:' 
.$eventinfo[eventid].'FNLP' .$fromdate'
DTSTAMP:'
.$vcdatestamp.'
DESCRIPTION:\\n'
.$description_rep.'
SUMMARY:'
.$title_rep.'
URL:http://sitename.org/discussions/calendar.php?do=getinfo&e='
.$eventinfo[eventid].'
PRIORITY:1
X-MICROSOFT-CDO-IMPORTANCE:2
CLASS:PUBLIC
BEGIN:VALARM
TRIGGER:-PT60M
ACTION:DISPLAY
DESCRIPTION:Reminder
END:VALARM
END:VEVENT
END:VCALENDAR'
;

 
header('Content-type: application/download');
 
header('Content-Disposition: attachment; filename=FNLCT_Event_'$eventinfo[eventid].'.ics');
 echo(
$vcsoutput);
 exit;


}  

// ############################# end add to outlook ########################## 
Like I said it creates the file fine and imports great but the times are wrong and no amount of fennegaling I do changes that.
Reply With Quote
  #8  
Old 01-18-2007, 04:06 AM
zennifer zennifer is offline
 
Join Date: Jan 2004
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Lots of views but no input. No one out there can figure this out?
Reply With Quote
  #9  
Old 01-22-2007, 06:19 PM
marlita marlita is offline
 
Join Date: Aug 2006
Posts: 53
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

maybe this could be switched to a different forum, like a mod forum or something, since you've already got it almost figured out. that way, more people are likely to see it and maybe have the answer to fix that last little bit. i'd love to add this to my board once it's fixed re:time zones & ranged events. thanks
Reply With Quote
  #10  
Old 05-16-2007, 01:20 AM
glowinggal glowinggal is offline
 
Join Date: Jan 2003
Posts: 96
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ditto; I've found Icalendar and LOVE IT but would love to have the forum integration feature of course...
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:01 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05579 seconds
  • Memory Usage 2,320KB
  • Queries Executed 14 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (4)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (1)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • postbit_attachment
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete