当前位置: 首页>>代码示例>>PHP>>正文


PHP IsTimestamp函数代码示例

本文整理汇总了PHP中IsTimestamp函数的典型用法代码示例。如果您正苦于以下问题:PHP IsTimestamp函数的具体用法?PHP IsTimestamp怎么用?PHP IsTimestamp使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了IsTimestamp函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Index

 public function Index()
 {
     $this->AddJsFile('settings.js');
     $this->Title(Translate('Dashboard'));
     $this->RequiredAdminPermissions[] = 'Garden.Settings.Manage';
     $this->RequiredAdminPermissions[] = 'Garden.Routes.Manage';
     $this->RequiredAdminPermissions[] = 'Garden.Applications.Manage';
     $this->RequiredAdminPermissions[] = 'Garden.Plugins.Manage';
     $this->RequiredAdminPermissions[] = 'Garden.Themes.Manage';
     $this->RequiredAdminPermissions[] = 'Garden.Registration.Manage';
     $this->RequiredAdminPermissions[] = 'Garden.Applicants.Manage';
     $this->RequiredAdminPermissions[] = 'Garden.Roles.Manage';
     $this->RequiredAdminPermissions[] = 'Garden.Users.Add';
     $this->RequiredAdminPermissions[] = 'Garden.Users.Edit';
     $this->RequiredAdminPermissions[] = 'Garden.Users.Delete';
     $this->RequiredAdminPermissions[] = 'Garden.Users.Approve';
     $this->FireEvent('DefineAdminPermissions');
     $this->Permission($this->RequiredAdminPermissions, '', FALSE);
     $this->AddSideMenu('garden/settings');
     $UserModel = Gdn::UserModel();
     // Load some data to display on the dashboard
     $this->BuzzData = array();
     // Get the number of users in the database
     $CountUsers = $UserModel->GetCountLike();
     $this->AddDefinition('CountUsers', $CountUsers);
     $this->BuzzData[Translate('Users')] = number_format($CountUsers);
     // Get the number of new users in the last day
     $this->BuzzData[Translate('New users in the last day')] = number_format($UserModel->GetCountWhere(array('DateInserted >=' => Format::ToDateTime(strtotime('-1 day')))));
     // Get the number of new users in the last week
     $this->BuzzData[Translate('New users in the last week')] = number_format($UserModel->GetCountWhere(array('DateInserted >=' => Format::ToDateTime(strtotime('-1 week')))));
     // Get recently active users
     $this->ActiveUserData = $UserModel->GetActiveUsers(5);
     // Check to see if the application needs to phone-home for updates. Doing
     // this here because this method is always called when admin pages are
     // loaded regardless of the application loading them.
     $UpdateCheckDate = Gdn::Config('Garden.UpdateCheckDate', '');
     if ($UpdateCheckDate == '' || !IsTimestamp($UpdateCheckDate) || $UpdateCheckDate < strtotime("-1 day")) {
         $UpdateData = array();
         // Grab all of the plugins & versions
         $PluginManager = Gdn::Factory('PluginManager');
         $Plugins = $PluginManager->AvailablePlugins();
         foreach ($Plugins as $Plugin => $Info) {
             $Name = ArrayValue('Name', $Info, $Plugin);
             $Version = ArrayValue('Version', $Info, '');
             if ($Version != '') {
                 $UpdateData[] = array('Name' => $Name, 'Version' => $Version, 'Type' => 'Plugin');
             }
         }
         // Grab all of the applications & versions
         $ApplicationManager = Gdn::Factory('ApplicationManager');
         $Applications = $ApplicationManager->AvailableApplications();
         foreach ($Applications as $Application => $Info) {
             $Name = ArrayValue('Name', $Info, $Application);
             $Version = ArrayValue('Version', $Info, '');
             if ($Version != '') {
                 $UpdateData[] = array('Name' => $Name, 'Version' => $Version, 'Type' => 'Application');
             }
         }
         // Grab all of the themes & versions
         $ThemeManager = new Gdn_ThemeManager();
         $Themes = $ThemeManager->AvailableThemes();
         foreach ($Themes as $Theme => $Info) {
             $Name = ArrayValue('Name', $Info, $Theme);
             $Version = ArrayValue('Version', $Info, '');
             if ($Version != '') {
                 $UpdateData[] = array('Name' => $Name, 'Version' => $Version, 'Type' => 'Theme');
             }
         }
         // Dump the entire set of information into the definition list (jQuery
         // will pick it up and ping the VanillaForums.org server with this info).
         $this->AddDefinition('UpdateChecks', Format::Serialize($UpdateData));
     }
     // Fire an event so other applications can add some data to be displayed
     $this->FireEvent('DashboardData');
     $this->Render();
 }
开发者ID:jeastwood,项目名称:Garden,代码行数:76,代码来源:settings.php

示例2: AddUpdateCheck

 /**
  * Adds information to the definition list that causes the app to "phone
  * home" and see if there are upgrades available. Currently added to the
  * dashboard only.
  * Nothing renders with this method. It is public so it can be added by
  * plugins.
  */
 public function AddUpdateCheck()
 {
     if (C('Garden.NoUpdateCheck')) {
         return;
     }
     // Check to see if the application needs to phone-home for updates. Doing
     // this here because this method is always called when admin pages are
     // loaded regardless of the application loading them.
     $UpdateCheckDate = Gdn::Config('Garden.UpdateCheckDate', '');
     if ($UpdateCheckDate == '' || !IsTimestamp($UpdateCheckDate) || $UpdateCheckDate < strtotime("-1 day")) {
         $UpdateData = array();
         // Grab all of the plugins & versions
         $Plugins = Gdn::PluginManager()->AvailablePlugins();
         foreach ($Plugins as $Plugin => $Info) {
             $Name = ArrayValue('Name', $Info, $Plugin);
             $Version = ArrayValue('Version', $Info, '');
             if ($Version != '') {
                 $UpdateData[] = array('Name' => $Name, 'Version' => $Version, 'Type' => 'Plugin');
             }
         }
         // Grab all of the applications & versions
         $ApplicationManager = Gdn::Factory('ApplicationManager');
         $Applications = $ApplicationManager->AvailableApplications();
         foreach ($Applications as $Application => $Info) {
             $Name = ArrayValue('Name', $Info, $Application);
             $Version = ArrayValue('Version', $Info, '');
             if ($Version != '') {
                 $UpdateData[] = array('Name' => $Name, 'Version' => $Version, 'Type' => 'Application');
             }
         }
         // Grab all of the themes & versions
         $ThemeManager = new Gdn_ThemeManager();
         $Themes = $ThemeManager->AvailableThemes();
         foreach ($Themes as $Theme => $Info) {
             $Name = ArrayValue('Name', $Info, $Theme);
             $Version = ArrayValue('Version', $Info, '');
             if ($Version != '') {
                 $UpdateData[] = array('Name' => $Name, 'Version' => $Version, 'Type' => 'Theme');
             }
         }
         // Dump the entire set of information into the definition list (jQuery
         // will pick it up and ping the VanillaForums.org server with this info).
         $this->AddDefinition('UpdateChecks', Gdn_Format::Serialize($UpdateData));
     }
 }
开发者ID:tautomers,项目名称:knoopvszombies,代码行数:52,代码来源:class.settingscontroller.php

示例3: addUpdateCheck

 /**
  * Adds information to the definition list that causes the app to "phone
  * home" and see if there are upgrades available.
  *
  * Currently added to the dashboard only. Nothing renders with this method.
  * It is public so it can be added by plugins.
  */
 public function addUpdateCheck()
 {
     if (c('Garden.NoUpdateCheck')) {
         return;
     }
     // Check to see if the application needs to phone-home for updates. Doing
     // this here because this method is always called when admin pages are
     // loaded regardless of the application loading them.
     $UpdateCheckDate = Gdn::config('Garden.UpdateCheckDate', '');
     if ($UpdateCheckDate == '' || !IsTimestamp($UpdateCheckDate) || $UpdateCheckDate < strtotime("-1 day")) {
         $UpdateData = array();
         // Grab all of the available addons & versions.
         foreach ([Addon::TYPE_ADDON, Addon::TYPE_THEME] as $type) {
             $addons = Gdn::addonManager()->lookupAllByType($type);
             /* @var Addon $addon */
             foreach ($addons as $addon) {
                 $UpdateData[] = ['Name' => $addon->getRawKey(), 'Version' => $addon->getVersion(), 'Type' => $addon->getSpecial('oldType', $type)];
             }
         }
         // Dump the entire set of information into the definition list. The client will ping the server for updates.
         $this->addDefinition('UpdateChecks', $UpdateData);
     }
 }
开发者ID:vanilla,项目名称:vanilla,代码行数:30,代码来源:class.settingscontroller.php


注:本文中的IsTimestamp函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。