{"id":812,"date":"2024-05-17T15:06:01","date_gmt":"2024-05-17T19:06:01","guid":{"rendered":"https:\/\/sites.bu.edu\/marcom-team\/?page_id=812"},"modified":"2025-09-03T17:25:04","modified_gmt":"2025-09-03T21:25:04","slug":"calendar","status":"publish","type":"page","link":"https:\/\/sites.bu.edu\/marcom-team\/departments\/interactive-design\/role-specific-info\/info-for-developers\/calendar\/","title":{"rendered":"Working with BU Calendar"},"content":{"rendered":"<p><span style=\"font-weight: 400;\">BU has a custom <code>phpbin<\/code> Calendar App that is the source for all the BU Calendar pages.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The calendar app data is fed <em>into<\/em> WordPress sites via the calendar <code>#id<\/code> [in the URL, at the end of the string] and custom coded within each site.<br \/>\nThis is usually some custom html, or custom WordPress templates.<\/span><\/p>\n<div class=\" bu-callout aligncenter\"><\/p>\n<h4>Example<\/h4>\n<p><span style=\"font-weight: 400;\"><a href=\"http:\/\/www.bu.edu\/bands\/calendar\/\">University Bands Calendar<\/a>,<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">Located at: http:\/\/www.bu.edu\/bands\/calendar\/<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Is powered by this data:<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><a href=\"http:\/\/www.bu.edu\/phpbin\/calendar\/app\/calendar.php?id=47\"><span style=\"font-weight: 400;\">http:\/\/www.bu.edu\/phpbin\/calendar\/app\/calendar.php?id=47<\/span><\/a><\/p>\n<p><span style=\"font-weight: 400;\">[Using the page template in the responsive framework 2x:<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><a href=\"https:\/\/github.com\/bu-ist\/responsive-framework\/blob\/master\/inc\/calendar.php\"><span style=\"font-weight: 400;\">https:\/\/github.com\/bu-ist\/responsive-framework\/blob\/master\/inc\/calendar.php<\/span><\/a>]<\/p>\n<p><\/div>\n<p>&nbsp;<\/p>\n<h2><strong>Common Tasks &amp; Issues<\/strong><\/h2>\n<p><span style=\"font-weight: 400;\">When developing in a sandbox it is helpful to have data to match production. But, by default, sandbox sites are pointed to a development version of the calendar that is usually out of sync with the main University calendar.<\/span><\/p>\n<h2><strong>Making Calendar Data Viewable in Sandbox<\/strong><\/h2>\n<h4><strong>Requesting Permission to Add Events To A Calendar<\/strong><\/h4>\n<p><span style=\"font-weight: 400;\">Each individual calendar has its own Access permissions. If you are looking at a calendar in the development environment and do not see the New Events, Topics, Options, and Sharing in the menu bar then you do not have access to add events.<\/span><\/p>\n<h4><strong>Request Access<\/strong><\/h4>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Post the calendar URL in the #Interactive-Design Slack channel and ask if anyone in ID has admin access that can add you as an admin.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">If there are no general admins for that calendar, Slack Steve @srudolfi or Adam @adamzp\u00a0 in Slack ( Global Access Owners ) and request they add you to the calendar as an admin.<\/span><\/li>\n<\/ol>\n<h4><strong>Ask #WebTeam slack channel<\/strong><\/h4>\n<p><span style=\"font-weight: 400;\">Ask the #WebTeam channel in slack to copy the data over from Prod to your sandbox environment, usually this will request will be completed by Adam P. They will export the prod database and import that database into your sandbox development environment.<\/span><\/p>\n<p>&nbsp;<\/p>\n<h2><strong>Update Sandbox BU Calendar Plugin Constants<\/strong><\/h2>\n<p><span style=\"font-weight: 400;\"><div class=\" bu-callout aligncenter\"><\/span><\/p>\n<h4><span style=\"font-weight: 400;\"><strong>Caution: This method will point all calendar links in your sandbox to production. <\/strong><\/span><span style=\"font-weight: 400;\"><strong>Do not edit the production calendar unless that is your intention.<\/strong><\/span><\/h4>\n<p><span style=\"font-weight: 400;\"><\/div><\/span><\/p>\n<h4><strong>In Your Sandbox:<\/strong><\/h4>\n<p><span style=\"font-weight: 400;\">In the php file located at: <code>wp-content\/mu-plugins\/bu-calendar\/bu-calendar.php<\/code>, <strong>a<\/strong><\/span><span style=\"font-weight: 400;\"><strong>dd this line to the top of the file<\/strong>:<\/span><\/p>\n<table>\n<tbody>\n<tr>\n<td><span style=\"font-weight: 400;\">1<\/span><\/td>\n<td><span style=\"font-weight: 400;\">define( &#8216;DEV_BU_CALENDAR_RPC_URI&#8217;, &#8216;<\/span><a href=\"http:\/\/www.bu.edu\/phpbin\/calendar\/rpc\"><span style=\"font-weight: 400;\">http:\/\/www.bu.edu\/phpbin\/calendar\/rpc<\/span><\/a><span style=\"font-weight: 400;\">&#8216; );<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"font-weight: 400;\">In the php file located at: <code>wp-content\/mu-plugins\/bu-calendar\/calendar.php<\/code>, c<\/span><span style=\"font-weight: 400;\">omment out the existing endpoints and replace with <strong><em>new<\/em><\/strong> endpoints with the new constant:<\/span><\/p>\n<table>\n<tbody>\n<tr>\n<td><span style=\"font-weight: 400;\">1<\/span><\/p>\n<p><span style=\"font-weight: 400;\">2<\/span><\/p>\n<p><span style=\"font-weight: 400;\">3<\/span><\/p>\n<p><span style=\"font-weight: 400;\">4<\/span><\/p>\n<p><span style=\"font-weight: 400;\">5<\/span><\/p>\n<p><span style=\"font-weight: 400;\">6<\/span><\/p>\n<p><span style=\"font-weight: 400;\">7<\/span><\/p>\n<p><span style=\"font-weight: 400;\">8<\/span><\/p>\n<p><span style=\"font-weight: 400;\">9<\/span><\/p>\n<p><span style=\"font-weight: 400;\">10<\/span><\/p>\n<p><span style=\"font-weight: 400;\">11<\/span><\/td>\n<td><span style=\"font-weight: 400;\">\/\/\u00a0 const CALENDARS_ENDPOINT = BU_CALENDAR_RPC_URI\u00a0 . &#8216;\/calendars.php?cid=&#8217;;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\/\/\u00a0 const EVENTS_ENDPOINT = BU_CALENDAR_RPC_URI\u00a0 . &#8216;\/events.php?cid=&#8217;;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\/\/\u00a0 const EVENT_ENDPOINT = BU_CALENDAR_RPC_URI\u00a0 . &#8216;\/event.php?cid=&#8217;;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\/\/\u00a0 const FIELDS_ENDPOINT = BU_CALENDAR_RPC_URI\u00a0 . &#8216;\/fields.php?cid=&#8217;;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\/\/\u00a0 const TOPICS_ENDPOINT = BU_CALENDAR_RPC_URI\u00a0 . &#8216;\/topics.php?cid=&#8217;;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0const CALENDARS_ENDPOINT = DEV_BU_CALENDAR_RPC_URI\u00a0 . &#8216;\/calendars.php?cid=&#8217;;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0const EVENTS_ENDPOINT<\/span> <span style=\"font-weight: 400;\">= DEV_BU_CALENDAR_RPC_URI\u00a0 . &#8216;\/events.php?cid=&#8217;;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0const EVENT_ENDPOINT <\/span> <span style=\"font-weight: 400;\">= DEV_BU_CALENDAR_RPC_URI\u00a0 . &#8216;\/event.php?cid=&#8217;;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0const FIELDS_ENDPOINT<\/span> <span style=\"font-weight: 400;\">= DEV_BU_CALENDAR_RPC_URI\u00a0 . &#8216;\/fields.php?cid=&#8217;;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0const TOPICS_ENDPOINT<\/span> <span style=\"font-weight: 400;\">= DEV_BU_CALENDAR_RPC_URI\u00a0 . &#8216;\/topics.php?cid=&#8217;;<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"font-weight: 400;\">After the file&#8217;s been uploaded to the desired sandbox, wait about 30 minutes for the transients to clear and the calendar to refresh. In some cases it may take as long as 45 minutes.<\/span><\/p>\n<p>&nbsp;<\/p>\n<h2><strong>Adding BU Calendar ID<\/strong><\/h2>\n<p><span style=\"font-weight: 400;\"><div class=\" bu-callout alignright\"><\/span><\/p>\n<p><span style=\"font-weight: 400;\"><strong>If you don\u2019t know the Calendar ID<\/strong>, go to the site you want the ID from, select settings &gt; Site Options from the dashboard. Then, click the link for changing existing options as depicted above and search for the calendar ID. ( Or go into the database and search on the options table for the <code>option_name<\/code>: <code>bu_calendar_id<\/code> ).<\/div><\/span><\/p>\n<p><span style=\"font-weight: 400;\">For a calendar to show, there needs to be a BU Calendar ID in the site options. <\/span><span style=\"font-weight: 400;\">Sometimes on a fresh site or on a sandbox site there will often be no calendar ID defined.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">To add a new calendar ID go to S<strong>ettings<\/strong> &gt; <strong>Site Options<\/strong> in the dashboard of your sandbox site.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Add the option name <code>bu_calendar_id<\/code> and the option value will be the integer of the calendar you want to show. <strong>The main [University-wide] BU Calendar id is 17<\/strong>. Using this ID can be helpful during development testing, when you just need an example of calendar events in general and it doesn\u2019t need to be specific to the site.<\/span><\/p>\n<h4><strong>Caching<\/strong><\/h4>\n<p><span style=\"font-weight: 400;\">The cache on the average <code>devl<\/code> calendar takes about 30\u201345 minutes to clear. If you, or a designer, needs to make changes, or add events: be patient, and check back in 30 minutes.<\/span><\/p>\n<h4><\/h4>\n<h2><strong>Calendar URLs<\/strong><\/h2>\n<h3><span style=\"font-weight: 400;\"><strong>All Available Calendars Within The App [Listing]<\/strong><\/span><\/h3>\n<p>Located at: <a href=\"http:\/\/www.bu.edu\/phpbin\/calendar\/app\/calendars.php\"><span style=\"font-weight: 400;\">http:\/\/www.bu.edu\/phpbin\/calendar\/app\/calendars.php<\/span><\/a><\/p>\n<h3><span style=\"font-weight: 400;\"><strong>Official BU Calendar Plugin Documentation<\/strong><\/span><\/h3>\n<p>Located at: <a href=\"http:\/\/developer.bu.edu\/webteam\/applications\/calendar\/\"><span style=\"font-weight: 400;\">http:\/\/developer.bu.edu\/webteam\/applications\/calendar\/<\/span><\/a><\/p>\n<h3><strong>Main University Calendar<\/strong><\/h3>\n<p>Located at: <a href=\"http:\/\/www.bu.edu\/calendar\/\"><span style=\"font-weight: 400;\">http:\/\/www.bu.edu\/calendar\/<\/span><\/a><\/p>\n<h3><strong>Development Calendar<\/strong><\/h3>\n<p><span style=\"font-weight: 400;\">Located at: <a href=\"http:\/\/www-devl.bu.edu\/nisdev\/php5\/calendar\/app\/calendar.php?id=1386\">http:\/\/www-devl.bu.edu\/nisdev\/php5\/calendar\/app\/calendar.php?id=1386<\/a><\/span><\/p>\n<h3><strong>Production Calendar<\/strong><\/h3>\n<p><a href=\"http:\/\/www.bu.edu\/phpbin\/calendar\/app\/calendar.php?id=1386\"><span style=\"font-weight: 400;\">http:\/\/www.bu.edu\/phpbin\/calendar\/app\/calendar.php?id=1386<\/span><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>BU has a custom phpbin Calendar App that is the source for all the BU Calendar pages. The calendar app data is fed into WordPress sites via the calendar #id [in the URL, at the end of the string] and custom coded within each site. This is usually some custom html, or custom WordPress templates. [&hellip;]<\/p>\n","protected":false},"author":12906,"featured_media":0,"parent":230,"menu_order":6,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"_links":{"self":[{"href":"https:\/\/sites.bu.edu\/marcom-team\/wp-json\/wp\/v2\/pages\/812"}],"collection":[{"href":"https:\/\/sites.bu.edu\/marcom-team\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/sites.bu.edu\/marcom-team\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/sites.bu.edu\/marcom-team\/wp-json\/wp\/v2\/users\/12906"}],"replies":[{"embeddable":true,"href":"https:\/\/sites.bu.edu\/marcom-team\/wp-json\/wp\/v2\/comments?post=812"}],"version-history":[{"count":5,"href":"https:\/\/sites.bu.edu\/marcom-team\/wp-json\/wp\/v2\/pages\/812\/revisions"}],"predecessor-version":[{"id":2595,"href":"https:\/\/sites.bu.edu\/marcom-team\/wp-json\/wp\/v2\/pages\/812\/revisions\/2595"}],"up":[{"embeddable":true,"href":"https:\/\/sites.bu.edu\/marcom-team\/wp-json\/wp\/v2\/pages\/230"}],"wp:attachment":[{"href":"https:\/\/sites.bu.edu\/marcom-team\/wp-json\/wp\/v2\/media?parent=812"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}