vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Please help: Adding events programatically (https://vborg.vbsupport.ru/showthread.php?t=162672)

Joshva 11-14-2007 08:55 AM

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

Analogpoint 11-14-2007 01:35 PM

Copy the 'add event' code in calendar.php starting on line 1613, and it should work.

Joshva 11-14-2007 08:42 PM

Awesome. Will do tonight

Joshva 11-17-2007 11:48 PM

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?

Joshva 11-19-2007 10:22 PM

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.

Analogpoint 11-20-2007 01:01 PM

Post the code that you're using to add events.

Joshva 11-20-2007 10:05 PM

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

Joshva 11-26-2007 04:00 AM

Any further thoughts on this? What else am i missing?

Analogpoint 11-26-2007 01:29 PM

As long as you're doing everything in the 'add event' code in calendar.php, it should work fine.

Joshva 11-27-2007 07:03 AM

The problem is i don't know php so i don't know what i'm missing


All times are GMT. The time now is 09:11 AM.

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.01060 seconds
  • Memory Usage 1,733KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete