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


PHP dformat函数代码示例

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


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

示例1: white_pageinfo

function white_pageinfo($ret = false)
{
    global $conf;
    global $lang;
    global $INFO;
    global $ID;
    // return if we are not allowed to view the page
    if (!auth_quickaclcheck($ID)) {
        return false;
    }
    $date = dformat($INFO['lastmod']);
    // print it
    if ($INFO['exists']) {
        $out = '';
        $out .= $lang['lastmod'];
        $out .= ' ';
        $out .= $date;
        if ($ret) {
            return $out;
        } else {
            echo $out;
            return true;
        }
    }
    return false;
}
开发者ID:ipari,项目名称:dokuwiki-template-white,代码行数:26,代码来源:tpl_functions.php

示例2: run

 /**
  * Build a nice email from the submitted data and send it
  */
 function run($data, $thanks, $argv)
 {
     global $ID;
     // get recipient address(es)
     $to = join(',', $argv);
     $sub = sprintf($this->getLang('mailsubject'), $ID);
     $txt = sprintf($this->getLang('mailintro') . "\n\n\n", dformat());
     foreach ($data as $opt) {
         $value = $opt->getParam('value');
         $label = $opt->getParam('label');
         switch ($opt->getFieldType()) {
             case 'fieldset':
                 $txt .= "\n====== " . hsc($label) . " ======\n\n";
                 break;
             default:
                 if ($value === null || $label === null) {
                     break;
                 }
                 $txt .= $label . "\n";
                 $txt .= "\t\t{$value}\n";
         }
     }
     global $conf;
     if (!mail_send($to, $sub, $txt, $conf['mailfrom'])) {
         throw new Exception($this->getLang('e_mail'));
     }
     return $thanks;
 }
开发者ID:nefercheprure,项目名称:dokuwiki-plugin-bureaucracy,代码行数:31,代码来源:mail.php

示例3: mkpostid

 /**
  * Return a page id based on the given format and title.
  *
  * @param $format string the format of the id to generate
  * @param $title  string the title of the page to create
  * @return string a page id
  */
 public static function mkpostid($format, $title)
 {
     global $conf;
     $replace = array('%{title}' => str_replace(':', $conf['sepchar'], $title), '%{user}' => $_SERVER['REMOTE_USER']);
     $out = $format;
     $out = str_replace(array_keys($replace), array_values($replace), $out);
     $out = dformat(null, $out);
     return cleanID($out);
 }
开发者ID:stretchyboy,项目名称:plugin-blogtng,代码行数:16,代码来源:tools.php

示例4: run

 /**
  * Build a nice email from the submitted data and send it
  *
  * @param helper_plugin_bureaucracy_field[] $fields
  * @param string                            $thanks
  * @param array                             $argv
  * @return string thanks message
  * @throws Exception mailing failed
  */
 public function run($fields, $thanks, $argv)
 {
     global $ID;
     global $conf;
     $mail = new Mailer();
     $this->prepareNamespacetemplateReplacements();
     $this->prepareDateTimereplacements();
     $this->prepareLanguagePlaceholder();
     $this->prepareNoincludeReplacement();
     $this->prepareFieldReplacements($fields);
     //set default subject
     $this->subject = sprintf($this->getLang('mailsubject'), $ID);
     //build html&text table, collect replyto and subject
     list($table_html, $table_text) = $this->processFieldsBuildTable($fields, $mail);
     //Body
     if ($this->mailtemplate) {
         //show template
         $this->patterns['__tablehtml__'] = '/@TABLEHTML@/';
         $this->patterns['__tabletext__'] = '/@TABLETEXT@/';
         $this->values['__tablehtml__'] = $table_html;
         $this->values['__tabletext__'] = $table_text;
         list($this->_mail_html, $this->_mail_text) = $this->getContent();
     } else {
         //show simpel listing
         $this->_mail_html .= sprintf($this->getLang('mailintro') . "<br><br>", dformat());
         $this->_mail_html .= $table_html;
         $this->_mail_text .= sprintf($this->getLang('mailintro') . "\n\n", dformat());
         $this->_mail_text .= $table_text;
     }
     $mail->setBody($this->_mail_text, null, null, $this->_mail_html);
     // Reply-to
     if (!empty($this->replyto)) {
         $replyto = $mail->cleanAddress($this->replyto);
         $mail->setHeader('Reply-To', $replyto, false);
     }
     // To
     $to = $this->replace(implode(',', $argv));
     // get recipient address(es)
     $to = $mail->cleanAddress($to);
     $mail->to($to);
     // From
     if (empty($this->from)) {
         $this->from = $conf['mailfrom'];
     }
     $this->from = $this->replace($this->from);
     $mail->from($this->from);
     // Subject
     $this->subject = $this->replace($this->subject);
     $mail->subject($this->subject);
     if (!$mail->send()) {
         throw new Exception($this->getLang('e_mail'));
     }
     return $thanks;
 }
开发者ID:andreasbenzing,项目名称:dokuwiki-plugin-bureaucracy,代码行数:63,代码来源:actionmail.php

示例5: toolbar_signature

/**
 * prepares the signature string as configured in the config
 *
 * @author Andreas Gohr <andi@splitbrain.org>
 */
function toolbar_signature()
{
    global $conf;
    global $INFO;
    $sig = $conf['signature'];
    $sig = strftime($sig);
    $sig = str_replace('@USER@', $_SERVER['REMOTE_USER'], $sig);
    $sig = str_replace('@NAME@', $INFO['userinfo']['name'], $sig);
    $sig = str_replace('@MAIL@', $INFO['userinfo']['mail'], $sig);
    $sig = str_replace('@DATE@', dformat(), $sig);
    $sig = str_replace('\\\\n', '\\n', addslashes($sig));
    return $sig;
}
开发者ID:stretchyboy,项目名称:dokuwiki,代码行数:18,代码来源:toolbar.php

示例6: send_change_mail

 /**
  * send an email to inform about a changed page
  *
  * @param $event
  * @param $param
  * @return bool false if the receiver is invalid or there was an error passing the mail to the MTA
  */
 function send_change_mail(&$event, $param)
 {
     global $ID;
     global $ACT;
     global $INFO;
     global $conf;
     $data = pageinfo();
     if ($ACT != 'save') {
         return true;
     }
     // IO_WIKIPAGE_WRITE is always called twice when saving a page. This makes sure to only send the mail once.
     if (!$event->data[3]) {
         return true;
     }
     // Does the publish plugin apply to this page?
     if (!$this->hlp->isActive($ID)) {
         return true;
     }
     //are we supposed to send change-mails at all?
     if ($this->getConf('apr_mail_receiver') === '') {
         return true;
     }
     // get mail receiver
     $receiver = $this->getConf('apr_mail_receiver');
     $validator = new EmailAddressValidator();
     $validator->allowLocalAddresses = true;
     if (!$validator->check_email_address($receiver)) {
         dbglog(sprintf($this->getLang('mail_invalid'), htmlspecialchars($receiver)));
         return false;
     }
     // get mail sender
     $ReplyTo = $data['userinfo']['mail'];
     if ($ReplyTo == $receiver) {
         return true;
     }
     if ($INFO['isadmin'] == '1') {
         return true;
     }
     // get mail subject
     $timestamp = dformat($data['lastmod'], $conf['dformat']);
     $subject = $this->getLang('apr_mail_subject') . ': ' . $ID . ' - ' . $timestamp;
     $body = $this->create_mail_body('change');
     $mail = new Mailer();
     $mail->to($receiver);
     $mail->subject($subject);
     $mail->setBody($body);
     $mail->setHeader("Reply-To", $ReplyTo);
     $returnStatus = $mail->send();
     return $returnStatus;
 }
开发者ID:hefanbo,项目名称:dokuwiki-plugin-publish,代码行数:57,代码来源:mail.php

示例7: toolbar_signature

/**
 * prepares the signature string as configured in the config
 *
 * @author Andreas Gohr <andi@splitbrain.org>
 */
function toolbar_signature()
{
    global $conf;
    global $INFO;
    /** @var Input $INPUT */
    global $INPUT;
    $sig = $conf['signature'];
    $sig = dformat(null, $sig);
    $sig = str_replace('@USER@', $INPUT->server->str('REMOTE_USER'), $sig);
    $sig = str_replace('@NAME@', $INFO['userinfo']['name'], $sig);
    $sig = str_replace('@MAIL@', $INFO['userinfo']['mail'], $sig);
    $sig = str_replace('@DATE@', dformat(), $sig);
    $sig = str_replace('\\\\n', '\\n', addslashes($sig));
    return $sig;
}
开发者ID:wernerflamme,项目名称:dokuwiki,代码行数:20,代码来源:toolbar.php

示例8: run

 /**
  * Build a nice email from the submitted data and send it
  */
 function run($fields, $thanks, $argv)
 {
     global $ID;
     $this->prepareLanguagePlaceholder();
     // get recipient address(es)
     $to = join(',', $argv);
     $replyto = array();
     $headers = null;
     $subject = sprintf($this->getLang('mailsubject'), $ID);
     $txt = sprintf($this->getLang('mailintro') . "\n\n\n", dformat());
     foreach ($fields as $opt) {
         /** @var syntax_plugin_bureaucracy_field $opt */
         $value = $opt->getParam('value');
         $label = $opt->getParam('label');
         switch ($opt->getFieldType()) {
             case 'fieldset':
                 $txt .= "\n====== " . hsc($label) . " ======\n\n";
                 break;
             case 'subject':
                 $subject = $label;
                 break;
             case 'email':
                 if (!is_null($opt->getParam('replyto'))) {
                     $replyto[] = $value;
                 }
                 /** fall through */
             /** fall through */
             default:
                 if ($value === null || $label === null) {
                     break;
                 }
                 $txt .= $label . "\n";
                 $txt .= "\t\t{$value}\n";
         }
         $this->prepareFieldReplacements($label, $value);
     }
     $subject = $this->replaceDefault($subject);
     if (!empty($replyto)) {
         $headers = mail_encode_address(join(',', $replyto), 'Reply-To');
     }
     global $conf;
     if (!mail_send($to, $subject, $txt, $conf['mailfrom'], '', '', $headers)) {
         throw new Exception($this->getLang('e_mail'));
     }
     return $thanks;
 }
开发者ID:omusico,项目名称:isle-web-framework,代码行数:49,代码来源:mail.php

示例9: bootstrap3_pageinfo

/**
 * Print some info about the current page
 *
 * @author  Andreas Gohr <andi@splitbrain.org>
 * @author  Giuseppe Di Terlizzi <giuseppe.diterlizzi@gmail.com>
 *
 * @param   bool $ret return content instead of printing it
 * @return  bool|string
 */
function bootstrap3_pageinfo($ret = false)
{
    global $conf;
    global $lang;
    global $INFO;
    global $ID;
    // return if we are not allowed to view the page
    if (!auth_quickaclcheck($ID)) {
        return false;
    }
    // prepare date and path
    $fn = $INFO['filepath'];
    if (!$conf['fullpath']) {
        if ($INFO['rev']) {
            $fn = str_replace(fullpath($conf['olddir']) . '/', '', $fn);
        } else {
            $fn = str_replace(fullpath($conf['datadir']) . '/', '', $fn);
        }
    }
    $date_format = bootstrap3_conf('pageInfoDateFormat');
    $page_info = bootstrap3_conf('pageInfo');
    $fn = utf8_decodeFN($fn);
    $date = $date_format == 'dformat' ? dformat($INFO['lastmod']) : datetime_h($INFO['lastmod']);
    // print it
    if ($INFO['exists']) {
        $fn_full = $fn;
        if (!in_array('extension', $page_info)) {
            $fn = str_replace(array('.txt.gz', '.txt'), '', $fn);
        }
        $out = '<ul class="list-inline">';
        if (in_array('filename', $page_info)) {
            $out .= sprintf('<li><i class="fa fa-fw fa-file-text-o text-muted"></i> <span title="%s">%s</span></li>', $fn_full, $fn);
        }
        if (in_array('date', $page_info)) {
            $out .= sprintf('<li><i class="fa fa-fw fa-calendar text-muted"></i> %s <span title="%s">%s</span></li>', $lang['lastmod'], dformat($INFO['lastmod']), $date);
        }
        if (in_array('editor', $page_info)) {
            if (isset($INFO['editor'])) {
                $user = editorinfo($INFO['editor']);
                if (bootstrap3_conf('useGravatar')) {
                    global $auth;
                    $user_data = $auth->getUserData($INFO['editor']);
                    $HTTP = new DokuHTTPClient();
                    $gravatar_img = get_gravatar($user_data['mail'], 16);
                    $gravatar_check = $HTTP->get($gravatar_img . '&d=404');
                    if ($gravatar_check) {
                        $user_img = sprintf('<img src="%s" alt="" width="16" class="img-rounded" /> ', $gravatar_img);
                        $user = str_replace(array('iw_user', 'interwiki'), '', $user);
                        $user = $user_img . $user;
                    }
                }
                $out .= sprintf('<li class="text-muted">%s %s</li>', $lang['by'], $user);
            } else {
                $out .= sprintf('<li>(%s)</li>', $lang['external_edit']);
            }
        }
        if ($INFO['locked'] && in_array('locked', $page_info)) {
            $out .= sprintf('<li><i class="fa fa-fw fa-lock text-muted"></i> %s %s</li>', $lang['lockedby'], editorinfo($INFO['locked']));
        }
        $out .= '</ul>';
        if ($ret) {
            return $out;
        } else {
            echo $out;
            return true;
        }
    }
    return false;
}
开发者ID:huksley,项目名称:dokuwiki-template-bootstrap3,代码行数:78,代码来源:tpl_functions.php

示例10: prepareTokenReplacements

 /**
  * Prepare default token replacement strings
  *
  * Populates the '$replacements' property.
  * Should be called by the class constructor
  */
 protected function prepareTokenReplacements()
 {
     global $INFO;
     global $conf;
     /* @var Input $INPUT */
     global $INPUT;
     global $lang;
     $ip = clientIP();
     $cip = gethostsbyaddrs($ip);
     $this->replacements['text'] = array('DATE' => dformat(), 'BROWSER' => $INPUT->server->str('HTTP_USER_AGENT'), 'IPADDRESS' => $ip, 'HOSTNAME' => $cip, 'TITLE' => $conf['title'], 'DOKUWIKIURL' => DOKU_URL, 'USER' => $INPUT->server->str('REMOTE_USER'), 'NAME' => $INFO['userinfo']['name'], 'MAIL' => $INFO['userinfo']['mail']);
     $signature = str_replace('@DOKUWIKIURL@', $this->replacements['text']['DOKUWIKIURL'], $lang['email_signature_text']);
     $this->replacements['text']['EMAILSIGNATURE'] = "\n-- \n" . $signature . "\n";
     $this->replacements['html'] = array('DATE' => '<i>' . hsc(dformat()) . '</i>', 'BROWSER' => hsc($INPUT->server->str('HTTP_USER_AGENT')), 'IPADDRESS' => '<code>' . hsc($ip) . '</code>', 'HOSTNAME' => '<code>' . hsc($cip) . '</code>', 'TITLE' => hsc($conf['title']), 'DOKUWIKIURL' => '<a href="' . DOKU_URL . '">' . DOKU_URL . '</a>', 'USER' => hsc($INPUT->server->str('REMOTE_USER')), 'NAME' => hsc($INFO['userinfo']['name']), 'MAIL' => '<a href="mailto:"' . hsc($INFO['userinfo']['mail']) . '">' . hsc($INFO['userinfo']['mail']) . '</a>');
     $signature = $lang['email_signature_text'];
     if (!empty($lang['email_signature_html'])) {
         $signature = $lang['email_signature_html'];
     }
     $signature = str_replace(array('@DOKUWIKIURL@', "\n"), array($this->replacements['html']['DOKUWIKIURL'], '<br />'), $signature);
     $this->replacements['html']['EMAILSIGNATURE'] = $signature;
 }
开发者ID:boycaught,项目名称:dokuwiki,代码行数:26,代码来源:Mailer.class.php

示例11: dayheader

 /**
  * Render the day header
  *
  * @param Doku_Renderer $R
  * @param int $date
  */
 protected function dayheader(&$R, $date)
 {
     if ($R->getFormat() == 'xhtml') {
         /* @var Doku_Renderer_xhtml $R  */
         $R->doc .= '<h3 class="changes">';
         $R->cdata(dformat($date, $this->getConf('dayheaderfmt')));
         $R->doc .= '</h3>';
     } else {
         $R->header(dformat($date, $this->getConf('dayheaderfmt')), 3, 0);
     }
 }
开发者ID:phillip-hopper,项目名称:changes,代码行数:17,代码来源:syntax.php

示例12: _tpl_pageinfo

function _tpl_pageinfo()
{
    global $conf;
    global $lang;
    global $INFO;
    global $ID;
    // return if we are not allowed to view the page
    if (!auth_quickaclcheck($ID)) {
        return;
    }
    // prepare date and path
    $date = dformat($INFO['lastmod']);
    // echo it
    if ($INFO['exists']) {
        echo $lang['lastmod'], ': ', $date;
        if ($_SERVER['REMOTE_USER']) {
            if ($INFO['editor']) {
                echo ' ', $lang['by'], ' ', $INFO['editor'];
            } else {
                echo ' (', $lang['external_edit'], ')';
            }
            if ($INFO['locked']) {
                echo ' &middot; ', $lang['lockedby'], ': ', $INFO['locked'];
            }
        }
        return true;
    }
    return false;
}
开发者ID:particleKIT,项目名称:dokuKIT,代码行数:29,代码来源:tpl_functions.php

示例13: tpl_pagelink

    ?>
      </p>

      <p>&larr; <?php 
    echo $lang['img_backto'];
    ?>
 <?php 
    tpl_pagelink($ID);
    ?>
</p>

      <dl class="img_tags">
        <?php 
    $t = tpl_img_getTag('Date.EarliestTime');
    if ($t) {
        print '<dt>' . $lang['img_date'] . ':</dt><dd>' . dformat($t) . '</dd>';
    }
    $t = tpl_img_getTag('File.Name');
    if ($t) {
        print '<dt>' . $lang['img_fname'] . ':</dt><dd>' . hsc($t) . '</dd>';
    }
    $t = tpl_img_getTag(array('Iptc.Byline', 'Exif.TIFFArtist', 'Exif.Artist', 'Iptc.Credit'));
    if ($t) {
        print '<dt>' . $lang['img_artist'] . ':</dt><dd>' . hsc($t) . '</dd>';
    }
    $t = tpl_img_getTag(array('Iptc.CopyrightNotice', 'Exif.TIFFCopyright', 'Exif.Copyright'));
    if ($t) {
        print '<dt>' . $lang['img_copyr'] . ':</dt><dd>' . hsc($t) . '</dd>';
    }
    $t = tpl_img_getTag('File.Format');
    if ($t) {
开发者ID:omusico,项目名称:isle-web-framework,代码行数:31,代码来源:detail.php

示例14: _dateCell

    /**
     * Date - creation or last modification date if not set otherwise
     */
    function _dateCell() {    
        global $conf;

        if($this->column['date'] == 2) {
            $this->page['date'] = $this->_getMeta(array('date', 'modified'));
        } elseif(!$this->page['date'] && $this->page['exists']) {
            $this->page['date'] = $this->_getMeta(array('date', 'created'));
        }

        if ((!$this->page['date']) || (!$this->page['exists'])) {
            return $this->_printCell('date', '');
        } else {
            return $this->_printCell('date', dformat($this->page['date'], $conf['dformat']));
        }
    }
开发者ID:neutrinog,项目名称:Door43,代码行数:18,代码来源:helper.php

示例15: ajax_lock

/**
 * Refresh a page lock and save draft
 *
 * Andreas Gohr <andi@splitbrain.org>
 */
function ajax_lock()
{
    global $conf;
    global $lang;
    global $ID;
    global $INFO;
    global $INPUT;
    $ID = cleanID($INPUT->post->str('id'));
    if (empty($ID)) {
        return;
    }
    $INFO = pageinfo();
    if (!$INFO['writable']) {
        echo 'Permission denied';
        return;
    }
    if (!checklock($ID)) {
        lock($ID);
        echo 1;
    }
    if ($conf['usedraft'] && $INPUT->post->str('wikitext')) {
        $client = $_SERVER['REMOTE_USER'];
        if (!$client) {
            $client = clientIP(true);
        }
        $draft = array('id' => $ID, 'prefix' => substr($INPUT->post->str('prefix'), 0, -1), 'text' => $INPUT->post->str('wikitext'), 'suffix' => $INPUT->post->str('suffix'), 'date' => $INPUT->post->int('date'), 'client' => $client);
        $cname = getCacheName($draft['client'] . $ID, '.draft');
        if (io_saveFile($cname, serialize($draft))) {
            echo $lang['draftdate'] . ' ' . dformat();
        }
    }
}
开发者ID:AlexanderS,项目名称:Part-DB,代码行数:37,代码来源:ajax.php


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