简体   繁体   English

预填充谷歌日历订阅 URL

[英]Pre-Populate Google Calendar Subscribe by URL

I want to pre-populate the URL box at我想预填充 URL 框

https://calendar.google.com/calendar/u/0/r/settings/addbyurlhttps://calendar.google.com/calendar/u/0/r/settings/addbyurl

with my calendar feel link webcal://domain.co.uk/calendar/export.php?Staff=Mr+Alan+Smith用我的日历感觉链接 webcal://domain.co.uk/calendar/export.php?Staff=Mr+Alan+Smith

is there any functionality to create a subscribe link so users don't have to manually copy and paste the URL in?有没有创建订阅链接的功能,这样用户就不必手动复制和粘贴 URL 了?

Found the answer找到答案

https://www.google.com/calendar/render?cid=webcal://domain.co.uk/calendar/export...

doesn't like spaces so I also swapped spaces for _ in the url where I had spaces (%20 or +) in staff names eg不喜欢空格,所以我还在 url 中用空格替换了 _,我在员工姓名中有空格(%20 或 +),例如

webcal://domain.co.uk/calendar/export.php?Staff=Mr+Alan+Smith or webcal://domain.co.uk/calendar/export.php?Staff=Mr Alan Smith becomes webcal://domain.co.uk/calendar/export.php?Staff=Mr_Alan_Smith webcal://domain.co.uk/calendar/export.php?Staff=Mr+Alan+Smithwebcal://domain.co.uk/calendar/export.php?Staff=Mr Alan Smith变为webcal://domain.co.uk/calendar/export.php?Staff=Mr_Alan_Smith

in my export.php which creates the ICS files it fetches, I then did a str_replace() to swap back the value to spaces.在我的 export.php 中,它创建了它获取的 ICS 文件,然后我执行了str_replace()以将值换回空格。

$staff = $_GET['Staff']; $staff = str_replace("_"," ",$staff);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM