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


PHP tlocal::date方法代码示例

本文整理汇总了PHP中tlocal::date方法的典型用法代码示例。如果您正苦于以下问题:PHP tlocal::date方法的具体用法?PHP tlocal::date怎么用?PHP tlocal::date使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在tlocal的用法示例。


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

示例1: postschanged

 public function postschanged()
 {
     $posts = tposts::i();
     $this->lock();
     $this->items = array();
     //sort archive by months
     $linkgen = tlinkgenerator::i();
     $db = litepublisher::$db;
     $res = $db->query("SELECT YEAR(posted) AS 'year', MONTH(posted) AS 'month', count(id) as 'count' FROM  {$db->posts}\n    where status = 'published' GROUP BY YEAR(posted), MONTH(posted) ORDER BY posted DESC ");
     while ($r = $db->fetchassoc($res)) {
         $this->date = mktime(0, 0, 0, $r['month'], 1, $r['year']);
         $this->items[$this->date] = array('idurl' => 0, 'url' => $linkgen->Createlink($this, 'archive', false), 'title' => tlocal::date($this->date, 'F Y'), 'year' => $r['year'], 'month' => $r['month'], 'count' => $r['count']);
     }
     $this->CreatePageLinks();
     $this->unlock();
 }
开发者ID:laiello,项目名称:litepublisher,代码行数:16,代码来源:archives.class.php

示例2: getmonth

 public function getmonth()
 {
     return tlocal::date($this->posted, 'M');
 }
开发者ID:laiello,项目名称:litepublisher,代码行数:4,代码来源:post.class.php

示例3: getdate

 public function getdate()
 {
     $theme = ttheme::i();
     return tlocal::date($this->posted, $theme->templates['content.post.templatecomments.comments.comment.date']);
 }
开发者ID:laiello,项目名称:litepublisher,代码行数:5,代码来源:comments.class.db.php

示例4: __get

 public function __get($name)
 {
     $item = ttheme::$vars['item'];
     switch ($name) {
         case 'status':
             return tlocal::get('commentstatus', $item['status']);
         case 'date':
             return tlocal::date(strtotime($item['posted']));
     }
     return '';
 }
开发者ID:laiello,项目名称:litepublisher,代码行数:11,代码来源:admin.pingbacks.class.php

示例5: set_post

 protected function set_post(tpost $post)
 {
     extract($_POST, EXTR_SKIP);
     $post->title = $title;
     $cats = self::processcategories();
     $cats = array_unique($cats);
     array_delete_value($cats, 0);
     array_delete_value($cats, '');
     array_delete_value($cats, false);
     array_delete_value($cats, null);
     $post->categories = $cats;
     if ($post->id == 0 && litepublisher::$options->user > 1) {
         $post->author = litepublisher::$options->user;
     }
     if (isset($tags)) {
         $post->tagnames = $tags;
     }
     if (isset($icon)) {
         $post->icon = (int) $icon;
     }
     if (isset($idview)) {
         $post->idview = $idview;
     }
     if (isset($files)) {
         $files = trim($files, ', ');
         $post->files = tdatabase::str2array($files);
     }
     if (isset($date) && $date) {
         $post->posted = tadminhtml::getdatetime('date');
     }
     if (isset($status)) {
         $post->status = $status == 'draft' ? 'draft' : 'published';
         $post->comstatus = $comstatus;
         $post->pingenabled = isset($pingenabled);
         $post->idperm = (int) $idperm;
         if ($password != '') {
             $post->password = $password;
         }
     }
     if (isset($url)) {
         $post->url = $url;
         $post->title2 = $title2;
         $post->keywords = $keywords;
         $post->description = $description;
         $post->rawhead = $head;
     }
     $post->content = $raw;
     if (isset($excerpt)) {
         $post->excerpt = $excerpt;
     }
     if (isset($rss)) {
         $post->rss = $rss;
     }
     if (isset($more)) {
         $post->moretitle = $more;
     }
     if (isset($filtered)) {
         $post->filtered = $filtered;
     }
     if (isset($upd)) {
         $update = sprintf($this->lang->updateformat, tlocal::date(time()), $upd);
         $post->content = $post->rawcontent . "\n\n" . $update;
     }
 }
开发者ID:laiello,项目名称:litepublisher,代码行数:64,代码来源:kernel.admin.php

示例6: getmyself

 protected function getmyself()
 {
     $lang = tlocal::i('foaf');
     $result = array();
     if ($this->img != '') {
         $i = strrpos($this->img, '.');
         $preview = substr($this->img, 0, $i) . '.preview' . substr($this->img, $i);
         $result[] = sprintf('<a rel="prettyPhoto" href="%s"><img src="%s" alt="profile" /></a>', $this->img, $preview);
     }
     if ($this->nick != '') {
         $result[] = "{$lang->nick} {$this->nick}";
     }
     if ($this->dateOfBirth != '' && @sscanf($this->dateOfBirth, '%d-%d-%d', $y, $m, $d)) {
         $date = mktime(0, 0, 0, $m, $d, $y);
         $ldate = tlocal::date($date);
         $result[] = sprintf($lang->birthday, $ldate);
     }
     $result[] = $this->gender == 'female' ? $lang->female : $lang->male;
     if (!$this->country != '') {
         $result[] = $this->country;
     }
     if (!$this->region != '') {
         $result[] = $this->region;
     }
     if (!$this->city != '') {
         $result[] = $this->city;
     }
     $result[] = sprintf('<a rel="me" href="%s">Google profile</a>', $this->googleprofile);
     return implode("</li>\n<li>", $result);
 }
开发者ID:laiello,项目名称:litepublisher,代码行数:30,代码来源:profile.class.php

示例7: datestr

 public static function datestr($date)
 {
     if ($date == '0000-00-00 00:00:00') {
         return tlocal::i()->noword;
     }
     return tlocal::date(strtotime($date), 'd F Y');
 }
开发者ID:laiello,项目名称:litepublisher,代码行数:7,代码来源:htmlresource.class.php

示例8: monthname

 public function monthname()
 {
     return tlocal::date($this->getdate(), '%F');
 }
开发者ID:laiello,项目名称:litepublisher,代码行数:4,代码来源:linkgen.class.php


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