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


PHP friendly_date函数代码示例

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


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

示例1: setData

 public function setData(&$user)
 {
     $user['friendlydate'] = friendly_date($user['ctime']);
     $user['DOACTION'] = '<a href="' . U('User/Admin/editUser', array('id' => $user['uid'], 'tabHash' => 'editUser')) . '">' . L('ADMIN_EDIT') . '</a>';
     $user['DOACTION'] .= '|<a href="javascript:void(0);" onclick="user.del(' . $user['uid'] . ')">' . L('ADMIN_DEL') . '</a>';
     $user['DOACTION'] .= '|<a href="' . U('User/Admin/userPrivilege', array('uid' => $user['uid'], 'tabHash' => 'userPrivilege')) . '">' . L('ADMIN_USER_PRIVILEGE') . '</a>';
 }
开发者ID:BellyWong,项目名称:ebtAdmin,代码行数:7,代码来源:UserModel.class.php

示例2: get_meal

 function get_meal($id)
 {
     $this->db->where('id', $id);
     $query = $this->db->get('meals');
     $meal = $query->row();
     $meal->friendly_date = friendly_date($meal->start, $meal->end);
     return $meal;
 }
开发者ID:nolastan,项目名称:NoMealPoints,代码行数:8,代码来源:meals_model.php

示例3: getFriendlySigninAtAttribute

 /**
  * Access control: Friendly signin_at
  * @return string
  */
 public function getFriendlySigninAtAttribute()
 {
     if (is_null($this->signin_at)) {
         return '新账号尚未登录';
     } else {
         return friendly_date($this->signin_at);
     }
 }
开发者ID:rimshavbase,项目名称:timefragment,代码行数:12,代码来源:User.php

示例4: getUserGroupList

 public function getUserGroupList($limit = 20, $map = array())
 {
     $listData = $this->where($map)->findPage($limit);
     foreach ($listData['data'] as $k => $v) {
         $listData['data'][$k]['friendlydate'] = friendly_date($v['ctime']);
         $listData['data'][$k]['DOACTION'] = '<a href="' . U('User/Admin/editUserGroup', array('id' => $v['gid'], 'tabHash' => 'editUserGroup')) . '">' . L('ADMIN_EDIT') . '</a>';
         $listData['data'][$k]['DOACTION'] .= '|<a href="javascript:void(0);" onclick="user.delGroup(' . $v['gid'] . ');" >' . L('ADMIN_DEL') . '</a>';
         $listData['data'][$k]['DOACTION'] .= '|<a href="' . U('User/Admin/groupPrivilege', array('gid' => $v['gid'], 'tabHash' => 'groupPrivilege')) . '">' . L('ADMIN_USER_GROUP_PRIVILEGE') . '</a>';
     }
     return $listData;
 }
开发者ID:BellyWong,项目名称:ebtAdmin,代码行数:11,代码来源:UserGroupModel.class.php

示例5: setData

 public function setData(&$app)
 {
     $app['friendlydate'] = friendly_date($app['ctime']);
     // TODO set the uninstall operation
     if ($app['app_type'] == 'sys') {
         $app['DOACTION'] = '<a href="' . U('Admin/Admin/unInstallSystemApp', array('name' => $app['app_name'])) . '">' . L('uninstall') . '</a>';
     } else {
         $app['DOACTION'] = '<a href="' . U('Admin/Admin/unInstallApp', array('name' => $app['app_name'])) . '">' . L('uninstall') . '</a>';
     }
     $app['DOACTION'] = $app['DOACTION'] . '|<a href="' . U('Admin/Admin/editAppInfo', array('id' => $app['app_id'])) . '">' . L('ADMIN_EDIT') . '</a>';
 }
开发者ID:BellyWong,项目名称:ebtAdmin,代码行数:11,代码来源:AppModel.class.php

示例6: meal_to_english

function meal_to_english($meal)
{
    $mealtoenglish = clone $meal;
    if ($mealtoenglish->title) {
        $mealtoenglish->location = " at " . $mealtoenglish->location;
    }
    if ($mealtoenglish->intended) {
        $mealtoenglish->intended = " (for " . $mealtoenglish->intended . ")";
    }
    $mealtoenglish->date = friendly_date($mealtoenglish->start, $mealtoenglish->end);
    return $mealtoenglish->title . $mealtoenglish->location . " " . $mealtoenglish->date . $mealtoenglish->intended;
}
开发者ID:nolastan,项目名称:NoMealPoints,代码行数:12,代码来源:meals_helper.php

示例7: activity_feed

 /**
  * 
  * 
  */
 public function activity_feed()
 {
     ajx_set_no_back(true);
     require_javascript("og/modules/dashboardComments.js");
     require_javascript("jquery/jquery.scrollTo-min.js");
     $filesPerPage = config_option('files_per_page');
     $start = array_var($_GET, 'start') ? (int) array_var($_GET, 'start') : 0;
     $limit = array_var($_GET, 'limit') ? array_var($_GET, 'limit') : $filesPerPage;
     $order = array_var($_GET, 'sort');
     $orderdir = array_var($_GET, 'dir');
     $page = (int) ($start / $limit) + 1;
     $extra_conditions = " AND jt.type IN ('content_object', 'comment')";
     $trashed = array_var($_GET, 'trashed', false);
     $archived = array_var($_GET, 'archived', false);
     $pagination = ContentDataObjects::listing(array("start" => $start, "limit" => $limit, "order" => $order, "order_dir" => $orderdir, "trashed" => $trashed, "archived" => $archived, "count_results" => false, "extra_conditions" => $extra_conditions, "join_params" => array("jt_field" => "id", "e_field" => "object_type_id", "table" => TABLE_PREFIX . "object_types")));
     $result = $pagination->objects;
     $total_items = $pagination->total;
     if (!$result) {
         $result = array();
     }
     $info = array();
     foreach ($result as $obj) {
         $info_elem = $obj->getArrayInfo($trashed, $archived);
         $instance = Objects::instance()->findObject($info_elem['object_id']);
         $info_elem['url'] = $instance->getViewUrl();
         if (method_exists($instance, "getText")) {
             $info_elem['content'] = $instance->getText();
         }
         $info_elem['picture'] = $instance->getCreatedBy()->getPictureUrl();
         $info_elem['friendly_date'] = friendly_date($instance->getCreatedOn());
         $info_elem['comment'] = $instance->getComments();
         if ($instance instanceof Contact) {
             if ($instance->isCompany()) {
                 $info_elem['icon'] = 'ico-company';
                 $info_elem['type'] = 'company';
             }
         }
         $info_elem['isRead'] = $instance->getIsRead(logged_user()->getId());
         $info_elem['manager'] = get_class($instance->manager());
         $info[] = $info_elem;
     }
     $listing = array("totalCount" => $total_items, "start" => $start, "objects" => $info);
     tpl_assign("feeds", $listing);
 }
开发者ID:abhinay100,项目名称:feng_app,代码行数:48,代码来源:DashboardController.class.php

示例8: getCommentList

 /**
  * 根据条件获取评论列表
  * @author jry <598821125@qq.com>
  */
 public function getCommentList($map)
 {
     $map['status'] = 1;
     $comments = $this->where($map)->order('sort desc,id asc')->select();
     foreach ($comments as $key => $val) {
         $comments[$key]['ctime'] = friendly_date($val['ctime']);
         $comments[$key]['username'] = D('User')->getFieldById($val['uid'], 'username');
         $comments[$key]['avatar'] = D('User')->getFieldById($val['uid'], 'avatar');
         if ($comments[$key]['pictures']) {
             $comments[$key]['pictures'] = explode(',', $comments[$key]['pictures']);
             //解析图片列表
         }
         if ($comments[$key]['pid'] > 0) {
             $parent_comment = $this->find($comments[$key]['pid']);
             $comments[$key]['parent_comment_username'] = D('User')->getFieldById($parent_comment['uid'], 'username');
         }
     }
     return $comments;
 }
开发者ID:sayi21cn,项目名称:corethink,代码行数:23,代码来源:UserCommentModel.class.php

示例9: get_url

            $url = get_url('person/workshops/' . $workshop->id);
            if ($flag) {
                $l_action = "<a href=\"{$url}/unsubscribe\" class=\"precaucion\">" . __('Dar de baja') . "</a>";
            } elseif ($workshops_limit <= $CFG->max_inscripcionTA) {
                $l_action = __('Dar de alta');
                $l_action = "<a href=\"{$url}/subscribe\" class=\"verde\">" . __('Dar de alta') . "</a>";
            } else {
                $l_action = '';
            }
        }
        if (Context == 'asistente') {
            // data
            $table_data[] = array($l_ponencia, $workshop->orientacion, $workshop->lugar, $time, $disp, $l_action);
        }
    }
    $human_date = friendly_date($last_date);
    ?>

<h2><?php 
    echo $human_date;
    ?>
</h2>
<h3><?php 
    echo $last_date_desc;
    ?>
</h2>

<?php 
    // do last table
    do_table($table_data, 'wide');
} else {
开发者ID:BackupTheBerlios,项目名称:yupana,代码行数:31,代码来源:workshop_list.php

示例10: lang

					</div>
					<script>
						var crumbHtml = <?php 
    echo $crumbJs;
    ?>
 ;
						$("#document-<?php 
    echo $document->getId();
    ?>
 .breadcrumb").html(crumbHtml);
					</script>
					<?php 
    if ($document->getUpdatedBy() instanceof Contact) {
        ?>
					<div class="desc date-container"><?php 
        echo lang('last updated by') . ' ' . lang('user date', $document->getUpdatedBy()->getCardUserUrl(), clean($document->getUpdatedByDisplayName()), lcfirst(friendly_date($document->getUpdatedOn())), clean($document->getUpdatedByDisplayName()));
        ?>
</div>
					<?php 
    }
    ?>
				</li>
			<?php 
}
?>
		</ul>	
		<?php 
if (count($documents) < $total) {
    ?>
		<div class="view-all-container">
			<a href="#" onclick="og.openLink(og.getUrl('files','init'), {caller:'documents-panel'})"><?php 
开发者ID:abhinay100,项目名称:feng_app,代码行数:31,代码来源:template.php

示例11: widget

    function widget($args, $instance)
    {
        $instance = array_merge(self::get_default_options(), $instance);
        echo $args['before_widget'];
        $comments = get_comments(array('status' => 'approve', 'number' => isset($instance['number']) ? (int) $instance['number'] : 6, 'type' => 'comment'));
        if (!empty($instance['title'])) {
            echo $args['before_title'];
            ?>
			<i class="fa fa-comments-o"></i> 
			<?php 
            echo $instance['title'];
            echo $args['after_title'];
        }
        if (!empty($comments)) {
            global $comment;
            $comment_bak = $comment;
            ?>
			<ul class="list-group">
				<?php 
            foreach ($comments as $comment) {
                /**
                 * cache
                 */
                static $caches = [];
                /** author_name */
                if (!isset($caches['author_name'][$comment->comment_author])) {
                    $caches['author_name'][$comment->comment_author] = esc_html(get_comment_author());
                }
                /** avatar placeholder */
                if (!isset($caches['avatar_placeholder'])) {
                    $caches['avatar_placeholder'] = theme_functions::$avatar_placeholder;
                }
                /** comment text */
                $comment_text = str_sub(strip_tags(preg_replace('/<img[^>]+>/i', '[' . ___('Image') . ']', get_comment_text($comment->comment_ID))), 35);
                ?>
<li class="list-group-item">
	<a class="media tooltip top" href="<?php 
                echo theme_cache::get_permalink($comment->comment_post_ID);
                ?>
#comment-<?php 
                echo $comment->comment_ID;
                ?>
" title="<?php 
                echo theme_cache::get_the_title($comment->comment_post_ID);
                ?>
">
		<div class="media-left">
			<img class="avatar media-object" data-src="<?php 
                echo esc_url(theme_cache::get_avatar_url($comment));
                ?>
" src="<?php 
                echo $caches['avatar_placeholder'];
                ?>
" alt="<?php 
                echo $caches['author_name'][$comment->comment_author];
                ?>
" width="<?php 
                echo self::$avatar_size;
                ?>
" height="<?php 
                echo self::$avatar_size;
                ?>
"/>
		</div>
		<div class="media-body">
			<h4 class="media-heading">
				<span class="author"><?php 
                echo $caches['author_name'][$comment->comment_author];
                ?>
</span>
				<time datetime="<?php 
                echo get_comment_time('c');
                ?>
">
					<small><?php 
                echo friendly_date(get_comment_time('U'));
                ?>
</small>
				</time>
			</h4>
			<div class="text"><?php 
                echo $comment_text;
                ?>
</div>
		</div>
	</a>
</li>
				<?php 
            }
            ?>
			</ul>
			<?php 
            $comment = $comment_bak;
        } else {
            ?>
			<div class="content">
				<div class="page-tip"><?php 
            echo status_tip('info', ___('No any comment yet.'));
            ?>
</div>
//.........这里部分代码省略.........
开发者ID:ClayMoreBoy,项目名称:mx,代码行数:101,代码来源:widget-comments.php

示例12: friendly_date

<div class="comment-unit">
	<a class="person" href="Javascript:;" onclick="og.openLink('<?php echo $comment->getCreatedBy()->getViewUrl(); ?>')"><?php echo $comment->getCreatedBy()->getObjectName();?></a> -
	<em class="feed-date"><?php echo friendly_date($comment->getCreatedOn());?></em> 
	<p><?php echo $comment->getText(); ?></p>
</div>
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:5,代码来源:comment_unit.php

示例13: friendly_date

        ?>
...</a>中</h4>
	                                <?php 
        if ($v['ntype'] == 0) {
            ?>
回复了你 <?php 
        }
        ?>
									<?php 
        if ($v['ntype'] == 1) {
            ?>
提到了@你 <?php 
        }
        ?>
                                    <?php 
        echo friendly_date($v['ntime']);
        ?>
                                    </blockquote>
                                </div>
                            </li>
                            <?php 
    }
    ?>
                        </ul>
                        <?php 
    if (@$pagination) {
        ?>
<ul class="pagination"><!--<?php 
        echo $pagination;
        ?>
--></ul><?php 
开发者ID:stoneStyle,项目名称:startbbs,代码行数:31,代码来源:notifications.php

示例14: friendly_date

<div class="comment-unit">
	<a class="person" href="Javascript:;" onclick="og.openLink('<?php 
echo $comment->getCreatedBy()->getViewUrl();
?>
')"><?php 
echo $comment->getCreatedBy()->getObjectName();
?>
</a> -
	<em class="feed-date"><?php 
echo friendly_date($comment->getCreatedOn());
?>
</em> 
	<p><?php 
echo $comment->getText();
?>
</p>
</div>
开发者ID:abhinay100,项目名称:feng_app,代码行数:17,代码来源:comment_unit.php

示例15: do_submit_cancel

<div class="block"></div>
<?php 
                do_submit_cancel('', __('Continuar'), get_url('admin/schedule'));
            } else {
                $errmsg[] = __('Ocurrió un error al insertar los datos.');
                show_error($errmsg);
            }
            ?>

<div class="block"></div>

<?php 
        }
    } else {
        $values = array(__('Lugar') => $room->nombre_lug, __('Fecha') => friendly_date($date->fecha), __('Hora') => sprintf('%02d:00 hrs.', $hour));
        do_table_values($values, 'narrow');
        ?>

<h2 class="center"><?php 
        echo __('Ponencias disponibles');
        ?>
</h2>

<?php 
        include $CFG->comdir . 'prop_list.php';
        do_submit_cancel('', __('Regresar'), get_url('admin/schedule'));
    }
}
if (!empty($errmsg)) {
    do_submit_cancel('', __('Regresar'), get_url('admin/schedule'));
开发者ID:BackupTheBerlios,项目名称:yupana,代码行数:30,代码来源:schedule_add.php


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