首页 \ 问答 \ 做一个asp的企业网站大约需要多少钱

做一个asp的企业网站大约需要多少钱

准备接点私话,给别人做一个企业网站,大体的功能就像这个http://www.szlmdg.com/企业网站的功能,个人做,应该开价多少?
更新时间:2021-11-17 18:11

最满意答案

好吧,因为没有人回答,我决定开始讨论Google Calendar API的非PHP文档,特别是.NET的东西,只是在原始协议中。 你不知道吗...

如果您转到.NET文档,它会提到很酷的功能,特别是如何为经过身份验证的用户创建新的非主日历以及如何将事件添加到非主日历。

当然,这个文档在PHP领域没有出现,并且似乎没有一对一的关联。 为了创建新的日历,我首先尝试了一些明显的东西,然后,破产,尝试了一些不那么明显的工作。 我想我会分享一下,因为无线电沉默的原因是没有人知道答案,但肯定会。

创建新日历:

这有两个关键:

  1. 您必须使用相同的方法来添加日历事件,即insertEvent()

  2. 您必须在方法中设置帖子网址,否则这些网址会转到默认Feed网址。

本示例检查App日历是否已经存在,如果没有,创建它:

 //Standard creation of the HTTP client
 $gdataCal = new Zend_Gdata_Calendar($client);

 //Get list of existing calendars
 $calFeed = $gdataCal->getCalendarListFeed();

 //Set this to true by default, only gets set to false if calendar is found
 $noAppCal = true;

 //Loop through calendars and check name which is ->title->text
 foreach ($calFeed as $calendar) {
  if($calendar -> title -> text == "App Calendar") {
   $noAppCal = false;
  }
 }

 //If name not found, create the calendar
 if($noAppCal) {

  // I actually had to guess this method based on Google API's "magic" factory
  $appCal = $gdataCal -> newListEntry();
  // I only set the title, other options like color are available.
  $appCal -> title = $gdataCal-> newTitle("App Calendar"); 

  //This is the right URL to post to for new calendars...
  //Notice that the user's info is nowhere in there
  $own_cal = "http://www.google.com/calendar/feeds/default/owncalendars/full";

  //And here's the payoff. 
  //Use the insertEvent method, set the second optional var to the right URL
  $gdataCal->insertEvent($appCal, $own_cal);
 }

在那里你有它。 下一个目标是将事件插入该日历,而不是默认日历。

将事件添加到非主日历

您可能会猜到的简单部分是,您需要再次设置该可选URL,例如: insertEvent($newEvent, $calURL) ,棘手的部分是获取日历的URL。 与“拥有的日历”路径不同,特定的日历不仅具有用户特定的信息,还具有某种类型的哈希查找ID。

代码如下:

 //Set up  that loop again to find the new calendar:
 $calFeed = $gdataCal->getCalendarListFeed();
 foreach ($calFeed as $calendar) {
  if($calendar->title->text == "App Calendar")
   //This is the money, you need to use '->content-src'
   //Anything else and you have to manipulate it to get it right. 
   $appCalUrl = $calendar->content->src;
 }

 //.......... Some Assumed MySQL query and results .............

      while ($event = $result->fetch_assoc()) {
   $title = $event['description'];

   //Quick heads up
   //This is a handy way of getting the date/time in one expression.
   $eventStart = date('Y-m-d\TH:i:sP', strtotime($event['start']));
   $eventEnd = date('Y-m-d\TH:i:sP', strtotime($event['end']));

   $newEvent = $gdataCal->newEventEntry();
   $newEvent->title = $gdataCal->newTitle($title);
   $when = $gdataCal->newWhen();
   $when->startTime = $eventStart;
   $when->endTime = $eventEnd;

   $newEvent->when = array($when);

   //And at last, the insert is set to the calendar URL found above
   $createdEvent = $gdataCal->insertEvent($newEvent, $appCalUrl);
  }
  echo "<p>".$result->num_rows." added to your Google calendar.</p>";

感谢任何阅读过我的问题并对此做过任何思考的人。 如果有人知道一种方法来收紧上面的代码(也许我不需要两个循环?),我很想获得反馈。


Well since no one answered, I decided to start poking around at the non-PHP documentation for the Google Calendar API, specifically at the .NET stuff and just a bit in the raw protocol. And wouldn't you know it...

If you go to the .NET documentation it mentions cool new features, specifically how to create new non-primary calendars for authenticated users and how to add events to non-primary calendars.

Of course, this documentation shows up nowhere in the PHP area, and there does not seem to be a one-to-one correlation. For the creating of the new calendar, I tried some obvious stuff first, then, going for broke, tried something not-so-obvious that worked. I thought I'd share in case the reason for the radio silence was that no one knew the answer but sure would like to.

To create a new calendar:

There are two keys to this:

  1. You have to use the same method for adding calendar events, which is insertEvent()

  2. You have to set the post URL in the method, which otherwise goes to the default feed URL.

This example checks to see if the App Calendar already exists and if not, creates it:

 //Standard creation of the HTTP client
 $gdataCal = new Zend_Gdata_Calendar($client);

 //Get list of existing calendars
 $calFeed = $gdataCal->getCalendarListFeed();

 //Set this to true by default, only gets set to false if calendar is found
 $noAppCal = true;

 //Loop through calendars and check name which is ->title->text
 foreach ($calFeed as $calendar) {
  if($calendar -> title -> text == "App Calendar") {
   $noAppCal = false;
  }
 }

 //If name not found, create the calendar
 if($noAppCal) {

  // I actually had to guess this method based on Google API's "magic" factory
  $appCal = $gdataCal -> newListEntry();
  // I only set the title, other options like color are available.
  $appCal -> title = $gdataCal-> newTitle("App Calendar"); 

  //This is the right URL to post to for new calendars...
  //Notice that the user's info is nowhere in there
  $own_cal = "http://www.google.com/calendar/feeds/default/owncalendars/full";

  //And here's the payoff. 
  //Use the insertEvent method, set the second optional var to the right URL
  $gdataCal->insertEvent($appCal, $own_cal);
 }

And there you have it. The next goal is to insert events to that calendar, not to the default calendar.

Adding events to non-primary calendar

The easy part that you can probably guess is that you need to set that optional URL again, like such : insertEvent($newEvent, $calURL), the tricky part is getting the calendar's URL. Unlike the "owned calendars" path, specific calendars not only have user-specifc info in it, they have some kind of hash-lookin' ID in there, too.

Here's the code:

 //Set up  that loop again to find the new calendar:
 $calFeed = $gdataCal->getCalendarListFeed();
 foreach ($calFeed as $calendar) {
  if($calendar->title->text == "App Calendar")
   //This is the money, you need to use '->content-src'
   //Anything else and you have to manipulate it to get it right. 
   $appCalUrl = $calendar->content->src;
 }

 //.......... Some Assumed MySQL query and results .............

      while ($event = $result->fetch_assoc()) {
   $title = $event['description'];

   //Quick heads up
   //This is a handy way of getting the date/time in one expression.
   $eventStart = date('Y-m-d\TH:i:sP', strtotime($event['start']));
   $eventEnd = date('Y-m-d\TH:i:sP', strtotime($event['end']));

   $newEvent = $gdataCal->newEventEntry();
   $newEvent->title = $gdataCal->newTitle($title);
   $when = $gdataCal->newWhen();
   $when->startTime = $eventStart;
   $when->endTime = $eventEnd;

   $newEvent->when = array($when);

   //And at last, the insert is set to the calendar URL found above
   $createdEvent = $gdataCal->insertEvent($newEvent, $appCalUrl);
  }
  echo "<p>".$result->num_rows." added to your Google calendar.</p>";

Thanks to anyone who read my question and did any thinking on it. If anyone knows of a way to tighten the above code up (maybe I don't need two loops?) I'd love to get feedback.

相关问答

更多

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)