Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
  #1  
Old 11-14-2007, 08:55 AM
Joshva Joshva is offline
 
Join Date: Nov 2005
Posts: 58
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Please help: Adding events programatically

I am trying to add events programaticaly from my custom CMS.

I have added the following 2 events

event id 178 was added via my CMS and does NOT show up in the vbulletin calendar.
event id 179 was added via vbulletin and does show up in the vbulletin calendar.

details....

178 1 <strong>The Chemical Brothers</strong><p><br/>
<im... The Chemical Brothers 1 0 1 a:0:{} 1 1195034917 0 1204887600 0 0

179 1 test Chemical bros 1 0 1 a:0:{} 1 1195036164 0 1204848000 0 0

Why does event id 179 no appear in the calendar?

Is their a cache i need to refresh?

Thanks,
Josh
Reply With Quote
  #2  
Old 11-14-2007, 01:35 PM
Analogpoint's Avatar
Analogpoint Analogpoint is offline
 
Join Date: Feb 2007
Posts: 656
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Copy the 'add event' code in calendar.php starting on line 1613, and it should work.
Reply With Quote
  #3  
Old 11-14-2007, 08:42 PM
Joshva Joshva is offline
 
Join Date: Nov 2005
Posts: 58
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Awesome. Will do tonight
Reply With Quote
  #4  
Old 11-17-2007, 11:48 PM
Joshva Joshva is offline
 
Join Date: Nov 2005
Posts: 58
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK I now have been able to add events and they are appearing at the bottom of the forums:

http://www.joshandfriends.com.au/forums/

BUT the events aren't appearing in the Calendar:

http://www.joshandfriends.com.au/forums/calendar.php

I only have 1 calendar by the way and the events are definately being linked to that calendar.

Any ideas?
Reply With Quote
  #5  
Old 11-19-2007, 10:22 PM
Joshva Joshva is offline
 
Join Date: Nov 2005
Posts: 58
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Does anyone know what might be the problem??

Thanks

--------------- Added [DATE]1195540217[/DATE] at [TIME]1195540217[/TIME] ---------------

A good example is here:
http://www.joshandfriends.com.au/for...1-23&e=160&c=1

I click on that link and can see the event. When I click on the date 23rd of November in the breadcrump it shows no events. Even though it is there.
Reply With Quote
  #6  
Old 11-20-2007, 01:01 PM
Analogpoint's Avatar
Analogpoint Analogpoint is offline
 
Join Date: Feb 2007
Posts: 656
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Post the code that you're using to add events.
Reply With Quote
  #7  
Old 11-20-2007, 10:05 PM
Joshva Joshva is offline
 
Join Date: Nov 2005
Posts: 58
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The following is java code but it should be fairly simple to read.


long currentDateLine = Calendar.getInstance().getTimeInMillis() / 1000;
long eventDateLine = (event.getDateTime().getTime()) / 1000;

forumEvent.setTitle(event.getTitle());
forumEvent.setDescription(description);
forumEvent.setCreatedBy(event.getCreatedBy());
forumEvent.setDateline(currentDateLine);
forumEvent.setFromDate(eventDateLine);
forumEvent.setCustomFields(CUSTOM_FIELDS);
forumEvent.setCalendarId(systemConfiguration.getVB ulletinCalendarId());
event.setForumEvent(forumEvent);

The event object is then saved via a hibernate an the above row is inserted in the vbulletin_event table.

Please let me know if I am missing anything.

Thanks,
Josh
Reply With Quote
  #8  
Old 11-26-2007, 04:00 AM
Joshva Joshva is offline
 
Join Date: Nov 2005
Posts: 58
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Any further thoughts on this? What else am i missing?
Reply With Quote
  #9  
Old 11-26-2007, 01:29 PM
Analogpoint's Avatar
Analogpoint Analogpoint is offline
 
Join Date: Feb 2007
Posts: 656
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

As long as you're doing everything in the 'add event' code in calendar.php, it should work fine.
Reply With Quote
  #10  
Old 11-27-2007, 07:03 AM
Joshva Joshva is offline
 
Join Date: Nov 2005
Posts: 58
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The problem is i don't know php so i don't know what i'm missing
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 07:00 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04471 seconds
  • Memory Usage 2,230KB
  • Queries Executed 11 (?)
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
  • (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
  • (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_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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete