Advertisement
Guest User

API v3 and TXP Calendar via Calendario Plugin

a guest
Nov 17th, 2014
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.96 KB | None | 0 0
  1. <txp:aks_cache id="OCCALDATA" disable="0">var codropsEvents = {<txp:etc_query url="YOURYAHOOPIPEJSONFEEDURL" markup="json" query="value/items/*"><txp:variable name="author"><txp:sho_urlencode>{author?}</txp:sho_urlencode></txp:variable><txp:variable name="start" value="{start?}" /><txp:variable name="eventtitle">{title?}</txp:variable><txp:variable name="itemdesc">{description?}</txp:variable><txp:variable name="location">{location?}</txp:variable><txp:variable name="safetitle"><txp:smd_wrap transform="escape|all_quotes"><txp:variable name="eventtitle" /></txp:smd_wrap></txp:variable><txp:variable name="startcompute" value='<txp:smd_wrap delim="@" transform="date|%m-%d-%Y"><txp:variable name="start" /></txp:smd_wrap>' /><txp:variable name="starttime" value='<txp:smd_wrap delim="@" transform="date|%l:%M%P"><txp:variable name="start" /></txp:smd_wrap>' /><txp:variable name="starthour" value='<txp:smd_wrap delim="@" transform="date|%l"><txp:variable name="start" /></txp:smd_wrap>' /><txp:variable name="startminutes" value='<txp:smd_wrap delim="@" transform="date|:%M"><txp:variable name="start" /></txp:smd_wrap>' /><txp:variable name="startampm" value='<txp:smd_wrap delim="@" transform="date|%P"><txp:variable name="start" /></txp:smd_wrap>' /><txp:variable name="end" value="{end?}" /><txp:variable name="endcompute" value='<txp:smd_wrap delim="@" transform="date|%m-%d-%Y"><txp:variable name="end" /></txp:smd_wrap>' /><txp:variable name="endtime" value='<txp:smd_wrap delim="@" transform="date|%l:%M%P"><txp:variable name="end" /></txp:smd_wrap>' /><txp:variable name="startplusone"><txp:php>$date = variable(array('name' => 'startcompute','escape'=>1));
  2. $date1 = str_replace('-', '/', $date);
  3. $startplusone = date('m-d-Y',strtotime($date1 . "+1 days"));
  4. echo $startplusone;</txp:php></txp:variable><txp:variable name="displayName">{organizer/displayName?}</txp:variable><txp:variable name="difdate" value='<txp:if_different><txp:variable name="startcompute" /></txp:if_different>' /><txp:variable name="number" value="{##}" /><txp:variable name="total" value="{#total}" /><txp:variable name="timespan"><txp:smd_if field='<txp:variable name="starttime" />,<txp:variable name="endtime" />,<txp:variable name="endcompute" />' mod_delim="/" operator="eq,eq,eq" value='12:00am,12:00am,<txp:variable name="startplusone" />'><txp:else /><txp:smd_if field='<txp:variable name="starttime" />,<txp:variable name="endtime" />' mod_delim="/" operator="eq,eq" value="12:00am,12:00am"><txp:else /><txp:if_variable name="startcompute" value='<txp:variable name="endcompute" />'><txp:variable name="starttime" /><txp:else /><txp:smd_if field='<txp:variable name="startplusone" />,<txp:variable name="endtime" />' mod_delim="/" operator="eq,eq" value='<txp:variable name="endcompute" />,12:00am'><txp:variable name="starttime" /><txp:else /><txp:variable name="starttime" /></txp:smd_if></txp:if_variable></txp:smd_if></txp:smd_if></txp:variable><txp:variable name="datatitle"><txp:smd_if field="NULL,NULL,NULL" operator="eq,eq,eq" logic="and" value='<txp:variable name="timespan" />,<txp:variable name="location" />,<txp:variable name="itemdesc" />'><span><txp:variable name="safetitle" /></span><txp:else /><a href="http://www.YOURWEBSITEURL.COM/calendar/?calid=<txp:variable name="author" />&eid=<txp:sho_urlencode>{id?}</txp:sho_urlencode>"><txp:if_variable name="timespan" value=""><txp:else /><txp:if_variable name="startminutes" value=":00"><txp:variable name="starthour" /><txp:variable name="startampm" /><txp:else /><txp:variable name="starttime" /></txp:if_variable>: </txp:if_variable><txp:variable name="safetitle" /></a></txp:smd_if></txp:variable><txp:if_variable name="difdate" value=""><txp:variable name="datatitle" /><txp:else /><txp:if_variable name="number" value="1"><txp:else />',</txp:if_variable>
  5. '<txp:variable name="startcompute" />' : '<txp:variable name="datatitle" /></txp:if_variable><txp:if_variable name="number" value='<txp:variable name="total" />'>'<txp:else /></txp:if_variable></txp:etc_query>
  6. };</txp:aks_cache>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement