Overview

Packages

  • CONTENIDO
  • Core
    • Authentication
    • Backend
    • Cache
    • CEC
    • Chain
    • ContentType
    • Database
    • Debug
    • Exception
    • Frontend
      • Search
      • URI
      • Util
    • GenericDB
      • Model
    • GUI
      • HTML
    • I18N
    • LayoutHandler
    • Log
    • Security
    • Session
    • Util
    • Validation
    • Versioning
    • XML
  • Module
    • ContentRssCreator
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationTop
    • ScriptCookieDirective
  • mpAutoloaderClassMap
  • None
  • Plugin
    • ContentAllocation
    • CronjobOverview
    • FormAssistant
    • FrontendLogic
    • FrontendUsers
    • Linkchecker
    • ModRewrite
    • Newsletter
    • Repository
      • FrontendNavigation
      • KeywordDensity
    • SearchSolr
    • SmartyWrapper
    • UrlShortener
    • UserForum
    • Workflow
  • PluginManager
  • Setup
    • Form
    • GUI
    • Helper
      • Environment
      • Filesystem
      • MySQL
      • PHP
    • UpgradeJob
  • Smarty
    • Cacher
    • Compiler
    • Config
    • Debug
    • PluginsBlock
    • PluginsFilter
    • PluginsFunction
    • PluginsInternal
    • PluginsModifier
    • PluginsModifierCompiler
    • PluginsShared
    • Security
    • Template
    • TemplateResources
  • Swift
    • ByteStream
    • CharacterStream
    • Encoder
    • Events
    • KeyCache
    • Mailer
    • Mime
    • Plugins
    • Transport

Classes

  • Swift_FailoverTransport
  • Swift_LoadBalancedTransport
  • Swift_MailTransport
  • Swift_Plugins_Loggers_ArrayLogger
  • Swift_Plugins_Loggers_EchoLogger
  • Swift_SendmailTransport
  • Swift_SmtpTransport
  • Swift_Transport_AbstractSmtpTransport
  • Swift_Transport_Esmtp_Auth_CramMd5Authenticator
  • Swift_Transport_Esmtp_Auth_LoginAuthenticator
  • Swift_Transport_Esmtp_Auth_PlainAuthenticator
  • Swift_Transport_Esmtp_AuthHandler
  • Swift_Transport_EsmtpTransport
  • Swift_Transport_FailoverTransport
  • Swift_Transport_LoadBalancedTransport
  • Swift_Transport_MailTransport
  • Swift_Transport_SendmailTransport
  • Swift_Transport_SimpleMailInvoker
  • Swift_Transport_StreamBuffer

Interfaces

  • Swift_Plugins_Logger
  • Swift_Plugins_Pop_Pop3Exception
  • Swift_Transport
  • Swift_Transport_Esmtp_Authenticator
  • Swift_Transport_EsmtpHandler
  • Swift_Transport_IoBuffer
  • Swift_Transport_MailInvoker
  • Swift_Transport_SmtpAgent
  • Swift_TransportException
  • Overview
  • Package
  • Function
  • Todo
  • Download
 1: <?php
 2: /**
 3:  * Smarty shared plugin
 4:  *
 5:  * @package    Smarty
 6:  * @subpackage PluginsShared
 7:  */
 8: 
 9: /**
10:  * Function: smarty_make_timestamp<br>
11:  * Purpose:  used by other smarty functions to make a timestamp from a string.
12:  *
13:  * @author   Monte Ohrt <monte at ohrt dot com>
14:  *
15:  * @param DateTime|int|string $string date object, timestamp or string that can be converted using strtotime()
16:  *
17:  * @return int
18:  */
19: function smarty_make_timestamp($string)
20: {
21:     if (empty($string)) {
22:         // use "now":
23:         return time();
24:     } elseif ($string instanceof DateTime) {
25:         return $string->getTimestamp();
26:     } elseif (strlen($string) == 14 && ctype_digit($string)) {
27:         // it is mysql timestamp format of YYYYMMDDHHMMSS?
28:         return mktime(substr($string, 8, 2), substr($string, 10, 2), substr($string, 12, 2),
29:                       substr($string, 4, 2), substr($string, 6, 2), substr($string, 0, 4));
30:     } elseif (is_numeric($string)) {
31:         // it is a numeric string, we handle it as timestamp
32:         return (int) $string;
33:     } else {
34:         // strtotime should handle it
35:         $time = strtotime($string);
36:         if ($time == - 1 || $time === false) {
37:             // strtotime() was not able to parse $string, use "now":
38:             return time();
39:         }
40: 
41:         return $time;
42:     }
43: }
44: 
CMS CONTENIDO 4.9.7 API documentation generated by ApiGen