當前位置: 首頁>>代碼示例>>PHP>>正文


PHP relative_modified_date函數代碼示例

本文整理匯總了PHP中relative_modified_date函數的典型用法代碼示例。如果您正苦於以下問題:PHP relative_modified_date函數的具體用法?PHP relative_modified_date怎麽用?PHP relative_modified_date使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了relative_modified_date函數的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: foreach

		<?php 
foreach ($_['files'] as $file) {
    $simple_file_size = simple_file_size($file['size']);
    $simple_size_color = intval(200 - $file['size'] / (1024 * 1024) * 2);
    // the bigger the file, the darker the shade of grey; megabytes*2
    if ($simple_size_color < 0) {
        $simple_size_color = 0;
    }
    $relative_modified_date = relative_modified_date($file['mtime']);
    $relative_date_color = round((time() - $file['mtime']) / 60 / 60 / 24 * 14);
    // the older the file, the brighter the shade of grey; days*14
    if ($relative_date_color > 200) {
        $relative_date_color = 200;
    }
    ?>
			<tr data-file="<?php 
    echo $file['name'];
    ?>
" data-type="<?php 
    echo $file['type'] == 'dir' ? 'dir' : 'file';
    ?>
" data-mime="<?php 
    echo $file['mime'];
    ?>
" data-size='<?php 
    echo $file['size'];
    ?>
'>
				<td class="filename svg" style="background-image:url(<?php 
    if ($file['type'] == 'dir') {
        echo mimetype_icon('dir');
開發者ID:Teino1978-Corp,項目名稱:Teino1978-Corp-owncloud_.htaccess-,代碼行數:31,代碼來源:owncloud_files_templates_part.list.php

示例2: p

    }
}
?>

<div class="section" id="backgroundjobs">
	<h2 class="inlineblock"><?php 
p($l->t('Cron'));
?>
</h2>
	<?php 
if ($_['cron_log']) {
    ?>
	<p class="cronlog inlineblock">
		<?php 
    if ($_['lastcron'] !== false) {
        $relative_time = relative_modified_date($_['lastcron']);
        $absolute_time = OC_Util::formatDate($_['lastcron']);
        if (time() - $_['lastcron'] <= 3600) {
            ?>
				<span class="cronstatus success"></span>
				<span class="crondate" original-title="<?php 
            p($absolute_time);
            ?>
">
					<?php 
            p($l->t("Last cron job execution: %s.", [$relative_time]));
            ?>
				</span>
			<?php 
        } else {
            ?>
開發者ID:henkRW,項目名稱:core,代碼行數:31,代碼來源:admin.php

示例3: testRelativeTimeYearsAgo

 public function testRelativeTimeYearsAgo()
 {
     $currentTime = 1380703592;
     $elementTime = $currentTime - 86400 * 365.25 * 2;
     $result = (string) relative_modified_date($elementTime, $currentTime, false);
     $this->assertEquals('years ago', $result);
     $elementTime = $currentTime - 86400 * 365.25 * 3;
     $result = (string) relative_modified_date($elementTime, $currentTime, false);
     $this->assertEquals('years ago', $result);
 }
開發者ID:olucao,項目名稱:owncloud-core,代碼行數:10,代碼來源:template.php

示例4: relative_modified_date

 /**
  * Return the relative date in relation to today. Returns something like "last hour" or "two month ago"
  *
  * @param int $timestamp unix timestamp
  * @param boolean $dateOnly
  * @return string human readable interpretation of the timestamp
  * @since 8.0.0
  */
 public static function relative_modified_date($timestamp, $dateOnly = false)
 {
     return \relative_modified_date($timestamp, null, $dateOnly);
 }
開發者ID:samj1912,項目名稱:repo,代碼行數:12,代碼來源:template.php

示例5: relative_modified_date

/**
 * @brief Return the relative date in relation to today. Returns something like "last hour" or "two month ago"
 * @param $timestamp unix timestamp
 * @returns human readable interpretation of the timestamp
 */
function relative_modified_date($timestamp)
{
    return \relative_modified_date($timestamp);
}
開發者ID:jaeindia,項目名稱:ownCloud-Enhancements,代碼行數:9,代碼來源:template.php

示例6: p

    p($l->t('Other'));
    ?>
						...
					</option>
				</select>
			</td>
			<td class="storageLocation"><?php 
    p($user["storageLocation"]);
    ?>
</td>
			<?php 
    if ($user["lastLogin"] === 0) {
        $lastLogin = $l->t('never');
        $lastLoginDate = $lastLogin;
    } else {
        $lastLogin = relative_modified_date($user["lastLogin"]);
        $lastLoginDate = \OC_Util::formatDate($user["lastLogin"]);
    }
    ?>
			<td class="lastLogin" title="<?php 
    p('<span class="usersLastLoginTooltip">' . $lastLoginDate . '</span>');
    ?>
"><?php 
    p($lastLogin);
    ?>
</td>
			<td class="remove">
				<?php 
    if ($user['name'] != OC_User::getUser()) {
        ?>
					<a href="#" class="action delete" original-title="<?php 
開發者ID:Romua1d,項目名稱:core,代碼行數:31,代碼來源:part.userlist.php

示例7: relative_modified_date

            ?>
" title="admin"><?php 
            echo $l->t('Visit');
            ?>
</a>
         <a class="name" href="<?php 
            echo $blog['domain'];
            ?>
" title="<?php 
            echo $l->t('Open it in a new window');
            ?>
" target="_blank">+</a>
        </td>
       <td>
         <?php 
            echo relative_modified_date($blog['registered']);
            ?>
        </td>
      </tr>
    <?php 
        }
        ?>
    <?php 
    } else {
        ?>
    	<tr><td colspan="3">
    	<?php 
        echo $l->t('You have no site registered, please check your');
        ?>
    	 <a class="name" href="<?php 
        echo OC::$CLASSPATH['OC_wordpress_site_list'];
開發者ID:silvioheinze,項目名稱:user_wordpress,代碼行數:31,代碼來源:sites.php


注:本文中的relative_modified_date函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。