本文整理汇总了PHP中JHTML::date方法的典型用法代码示例。如果您正苦于以下问题:PHP JHTML::date方法的具体用法?PHP JHTML::date怎么用?PHP JHTML::date使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JHTML
的用法示例。
在下文中一共展示了JHTML::date方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: output
function output()
{
// main wrapper
echo '<div class="gkNspPM gkNspPM-EventsList" data-cols="' . $this->parent->config['portal_mode_events_list_cols'] . '">';
if (trim($this->parent->config['nsp_pre_text'])) {
echo $this->parent->config['nsp_pre_text'];
}
// render images
for ($i = 0; $i < count($this->parent->content); $i++) {
$title = $this->parent->content[$i]['title'];
$text = $this->parent->content[$i]['text'];
// parse event data
$event_info = array("date" => '', "when" => '', "timestamp" => '', "counter_timestamp" => '');
$event_data = array();
$event_data_count = preg_match('@<div class="gkEvent">.*?</div>@mis', $text, $event_data);
if ($event_data_count > 0) {
$event_datetimes = array();
$event_datetimes_count = preg_match_all('@<time.*?datetime="(.*?)".*?>(.*?)</time>@', $event_data[0], $event_datetimes);
if ($event_datetimes_count > 0) {
$event_timestamp = strtotime($event_datetimes[1][0]);
$event_timestamp_sql = strftime('%Y-%m-%d %H:%M:%S', $event_timestamp);
$event_info['timestamp'] = date(DATE_W3C, $event_timestamp);
$event_info['counter_timestamp'] = date(DATE_W3C, strtotime($event_datetimes[1][4]));
$event_info['date'] = JHTML::date($event_timestamp_sql, 'D') . '<small>' . JHTML::date($event_timestamp_sql, 'M j') . '</small>';
$event_info['when'] = $event_datetimes[2][0] . ' @ ' . $event_datetimes[2][2];
}
}
// output the HTML code
echo '<div>';
if ($event_info['date'] != '') {
echo '<time datetime="' . $event_info['timestamp'] . '" data-start="' . $event_info['counter_timestamp'] . '">' . $event_info['date'] . '</time>';
}
echo '<div>';
echo '<h3>';
echo '<a href="' . $this->get_link($i) . '" title="' . strip_tags($this->parent->content[$i]['title']) . '">';
echo $title;
echo '</a>';
echo '</h3>';
if ($event_info['when'] != '') {
echo '<span>';
echo JText::_('MOD_NEWS_PRO_GK5_PORTAL_MODE_EVENTS_LIST_WHEN') . $event_info['when'];
echo '<span class="gkEventsListProgress"></span>';
echo '</span>';
}
echo '</div>';
echo '</div>';
}
if (count($this->parent->content) == 0) {
echo '<p style="text-align: center"><strong>' . JText::_('MOD_NEWS_PRO_GK5_PORTAL_MODE_EVENTS_LIST_NO_EVENTS') . '</strong></p>';
}
if (trim($this->parent->config['nsp_post_text'])) {
echo $this->parent->config['nsp_post_text'];
}
// closing main wrapper
echo '</div>';
}
示例2: formatRoundStartEnd
/**
* Format round date
*
* @param Object $round round
*
* @return bool|string|void
*/
public static function formatRoundStartEnd($round)
{
if (!self::isValidDate($round->start_date)) {
return false;
}
if (self::isValidDate($round->end_date)) {
// Both dates are defined.
$format_end = 'j F Y';
if (JHTML::date($round->start_date, 'Ym') === JHTML::date($round->end_date, 'Ym')) {
// No need to display twice the month and year here
$format_start = 'j';
} else {
$format_start = 'j F Y';
}
return JHTML::date($round->start_date, $format_start) . ' - ' . JHTML::date($round->end_date, $format_end);
} else {
return JHTML::date($round->start_date, 'j F Y');
}
return;
}
示例3: formatRoundStartEnd
/**
* return formated string for round start date - end date
*
* @param object round (must have variables start_date, end_date)
*
* @return string html
*/
function formatRoundStartEnd($round)
{
if ($round->start_date && $round->start_date != '0000-00-00 00:00:00') {
if ($round->end_date && $round->end_date != '0000-00-00 00:00:00') {
// both dates are defined.
$format_end = 'j F Y';
if (JHTML::date($round->start_date, 'Ym') == JHTML::date($round->end_date, 'Ym')) {
// no need to display twice the month and year here
$format_start = 'j';
} else {
$format_start = 'j F Y';
}
return JHTML::date($round->start_date, $format_start) . ' - ' . JHTML::date($round->end_date, $format_end);
} else {
return JHTML::date($round->start_date, 'j F Y');
}
} else {
return '';
}
}
示例4: saveTransactionLog
public static function saveTransactionLog($log, $id, $append = true)
{
if (!$log || !$id) {
return false;
}
$db = JFactory::getDBO();
$query = $db->getQuery(true);
if (!is_array($log)) {
$log = array($log);
}
foreach ($log as $i => $item) {
$log[$i] = JHTML::date('now') . ' ' . $item;
}
$log = implode("\n", $log);
if ($append) {
$query->update($db->qn('#__rsmembership_transactions'))->set($db->qn('response_log') . ' = CONCAT(' . $db->qn('response_log') . ', ' . $db->q("\n" . $log) . ')')->where($db->qn('id') . ' = ' . $db->q($id));
} else {
$query->update($db->qn('#__rsmembership_transactions'))->set($db->qn('response_log') . ' = ' . $db->q($log))->where($db->qn('id') . ' = ' . $db->q($id));
}
$db->setQuery($query);
return $db->execute();
}
示例5:
}
?>
<!-- Date -->
<?php
if ($this->config['show_match_date'] == 1) {
if ($this->match->match_date > 0) {
?>
<tr>
<td colspan="3" >
<span class="label"><?php
echo JText::_('COM_JOOMLEAGUE_MATCHREPORT_DATE');
?>
</span>
<span><?php
echo JHTML::date($this->match->match_date, JText::_('COM_JOOMLEAGUE_MATCHREPORT_GAMES_DATE'));
?>
</span>
</td>
</tr>
<?php
}
}
?>
<!-- Time -->
<?php
if ($this->config['show_match_time'] == 1) {
if ($this->match->match_date > 0) {
?>
<tr>
示例6: substr
$class = $k == 0 ? 'sectiontableentry1' : 'sectiontableentry2';
$result_link = JoomleagueHelperRoute::getResultsRoute($game->project_id, $game->roundid);
$report_link = JoomleagueHelperRoute::getMatchReportRoute($game->project_id, $game->id);
$home = $this->gamesteams[$game->projectteam1_id];
$away = $this->gamesteams[$game->projectteam2_id];
?>
<tr class="<?php
echo $class;
?>
">
<td><?php
echo JHTML::link($result_link, $game->roundcode);
?>
</td>
<td class="nowrap"><?php
echo JHTML::date($date, JText::_('COM_JOOMLEAGUE_MATCHDAYDATE'));
?>
</td>
<td><?php
echo substr($game->match_date, 11, 5);
?>
</td>
<td class="nowrap"><?php
echo $home->name;
?>
</td>
<td class="nowrap">-</td>
<td class="nowrap"><?php
echo $away->name;
?>
</td>
示例7: defined
<?php
defined('_JEXEC') or die('Restricted access');
?>
<table class="contentpaneopen">
<tr>
<td class="contentheading"><?php
$pageTitle = 'COM_JOOMLEAGUE_MATCHREPORT_TITLE';
if (isset($this->round->name)) {
$matchDate = JoomleagueHelper::getTimestamp($this->match->match_date, 1);
echo ' ' . JText::sprintf($pageTitle, $this->round->name, JHTML::date($matchDate, JText::_('COM_JOOMLEAGUE_MATCHREPORT_GAMES_DATE')), JoomleagueHelperHtml::showMatchTime($this->match, $this->config, $this->overallconfig, $this->project));
} else {
echo ' ' . JText::sprintf($pageTitle, '', '', '');
}
?>
</td>
</tr>
</table>
示例8: foreach
$i = 0;
foreach ($this->rating_reviews as $review) {
if ($i % 2 == 0) {
$color = 'normal';
} else {
$color = 'highlight';
}
// Loop through all reviews
if (!empty($this->rating_reviews)) {
?>
<div class="<?php
echo $color;
?>
">
<span class="date"><?php
echo JHTML::date($review->created_on, JText::_('DATE_FORMAT_LC'));
?>
</span>
<?php
//echo $stars[ $review->review_rating ] //Attention the review rating is the rating of the review itself, rating for the product is the vote !
?>
<blockquote><?php
echo $review->comment;
?>
</blockquote>
<span class="bold"><?php
echo $review->customer;
?>
</span>
</div>
<?php
示例9: getInput
protected function getInput()
{
$writeable = '<b><font color="green">' . JText::_('COM_BIDS_WRITABLE') . '</font></b>';
$unwriteable = '<b><font color="red">' . JText::_('COM_BIDS_UNWRITABLE') . '</font></b>';
$template_dir = $unwriteable;
$image_dir = $unwriteable;
$config_dir = $unwriteable;
if (is_writable(AUCTION_TEMPLATE_CACHE)) {
$template_dir = $writeable;
}
if (is_writable(JPATH_COMPONENT_SITE . DS . 'images')) {
$image_dir = $writeable;
}
if (is_writable(JPATH_COMPONENT_SITE . DS . 'options.php')) {
$config_dir = $writeable;
}
$cfg = JFactory::getConfig();
$error_reporting = $cfg->get('error_reporting');
$error_reporting_text = "";
if ($error_reporting & E_ERROR) {
$error_reporting_text .= " E_ERROR,";
}
if ($error_reporting & E_WARNING) {
$error_reporting_text .= " E_WARNING,";
}
if ($error_reporting & E_PARSE) {
$error_reporting_text .= " E_PARSE,";
}
if ($error_reporting & E_NOTICE) {
$error_reporting_text .= " E_NOTICE,";
}
if ($error_reporting & E_CORE_ERROR) {
$error_reporting_text .= " E_CORE_ERROR,";
}
if ($error_reporting & E_CORE_WARNING) {
$error_reporting_text .= " E_CORE_WARNING,";
}
if ($error_reporting & E_COMPILE_ERROR) {
$error_reporting_text .= " E_COMPILE_ERROR,";
}
if ($error_reporting & E_COMPILE_WARNING) {
$error_reporting_text .= " E_COMPILE_WARNING,";
}
if ($error_reporting & E_USER_ERROR) {
$error_reporting_text .= " E_USER_ERROR,";
}
if ($error_reporting & E_USER_WARNING) {
$error_reporting_text .= " E_USER_WARNING,";
}
if ($error_reporting & E_USER_NOTICE) {
$error_reporting_text .= " E_USER_NOTICE,";
}
if ($error_reporting & E_STRICT) {
$error_reporting_text .= " E_STRICT,";
}
if ($error_reporting & E_RECOVERABLE_ERROR) {
$error_reporting_text .= " E_RECOVERABLE_ERROR,";
}
// if($error_reporting & E_DEPRECATED) $error_reporting_text.=" E_DEPRECATED,";
// if($error_reporting & E_USER_DEPRECATED) $error_reporting_text.=" E_USER_DEPRECATED,";
if ($error_reporting & E_ALL) {
$error_reporting_text .= " E_ALL";
}
$local_time = JHTML::date('now', 'l, d F Y H:i');
$gmt_time = gmdate('l, d F Y H:i');
$html = "\r\n <table class='adminlist'>\r\n <tr>\r\n <td colspan='2'><h3>" . JText::_('COM_BIDS_FILE_PERMISSIONS') . "</h3></td>\r\n </tr>\r\n <tr>\r\n <td class='item'>\r\n " . JText::_('COM_BIDS_SMARTY_TEMPLATE_CACHE_DIRECTORY') . "\r\n </td>\r\n <td>\r\n {$template_dir}\r\n </td>\r\n </tr>\r\n <tr>\r\n <td class='item'>\r\n " . JText::_('COM_BIDS_IMAGE_UPLOADING_DIRECTORY') . "\r\n </td>\r\n <td>\r\n {$image_dir}\r\n </td>\r\n </tr>\r\n <tr>\r\n <td class='item'>\r\n " . JText::_('COM_BIDS_CONFIGURATION_FILE') . "\r\n </td>\r\n <td>\r\n {$config_dir}\r\n </td>\r\n </tr>\r\n <tr>\r\n <td colspan='2'><h3>" . JText::_("COM_BIDS_JOOMLA_SETTINGS") . "</h3></td>\r\n </tr>\r\n <tr>\r\n <td>\r\n " . JText::_('COM_BIDS_ERROR_REPORTING') . "\r\n </td>\r\n <td>\r\n {$error_reporting_text}\r\n </td>\r\n </tr>\r\n <tr>\r\n <td>\r\n " . JText::_('COM_BIDS_SITE_LOCALE_TIME') . "\r\n </td>\r\n <td>\r\n {$local_time}\r\n </td>\r\n </tr>\r\n <tr>\r\n <td colspan='2'><h3>" . JText::_("COM_BIDS_PHP_SETTINGS") . "</h3></td>\r\n </tr>\r\n <tr>\r\n <td>\r\n " . JText::_('COM_BIDS_DISPLAY_ERRORS') . "\r\n </td>\r\n <td>\r\n " . (ini_get('display_errors') ? JText::_('COM_BIDS_ON') : JText::_('COM_BIDS_OFF')) . "\r\n </td>\r\n </tr>\r\n <tr>\r\n <td>\r\n " . JText::_('COM_BIDS_FILE_UPLOADS') . "\r\n </td>\r\n <td>\r\n " . (ini_get('file_uploads') ? JText::_('COM_BIDS_ON') : JText::_('COM_BIDS_OFF')) . "\r\n </td>\r\n </tr>\r\n <tr>\r\n <td>\r\n " . JText::_('COM_BIDS_MAX_UPLOAD_FILESIZE') . "\r\n </td>\r\n <td>\r\n " . ini_get('upload_max_filesize') . "\r\n </td>\r\n </tr>\r\n <tr>\r\n <td>\r\n " . JText::_('COM_BIDS_GMT_TIME') . "\r\n </td>\r\n <td>\r\n {$gmt_time}\r\n </td>\r\n </tr>\r\n </table>\r\n\r\n ";
return $html;
}
示例10: showMatchdaysTitle
/**
* Shows matchday title
*
* @param string $title
* @param int $current_round
* @param array $config
* @param int $mode
* @return string html
*/
function showMatchdaysTitle($title, $current_round, &$config, $mode = 0)
{
$projectid = JRequest::getInt('p', 0);
$joomleague =& JTable::getInstance('Project', 'Table');
$joomleague->load($projectid);
echo $title != '' ? $title . ' - ' : $title;
if ($current_round > 0) {
$thisround =& JTable::getInstance('Round', 'Table');
$thisround->load($current_round);
if ($config['type_section_heading'] == 1 && $thisround->name != '') {
if ($mode == 1) {
$link = JoomleagueHelperRoute::getRankingRoute($projectid, $thisround->id);
echo JHTML::link($link, $thisround->name);
} else {
echo $thisround->name;
}
} elseif ($thisround->id > 0) {
echo ' - ' . $thisround->id . '. ' . JText::_('COM_JOOMLEAGUE_RESULTS_MATCHDAY') . ' ';
}
if ($config['show_rounds_dates'] == 1) {
echo " (";
if (!strstr($thisround->round_date_first, "0000-00-00")) {
echo JHTML::date($thisround->round_date_first, 'COM_JOOMLEAGUE_GLOBAL_CALENDAR_DATE');
}
if ($thisround->round_date_last != $thisround->round_date_first && !strstr($thisround->round_date_last, "0000-00-00")) {
echo " - " . JHTML::date($thisround->round_date_last, 'COM_JOOMLEAGUE_GLOBAL_CALENDAR_DATE');
}
echo ")";
}
}
}
示例11: foreach
$k = 1 - $k;
}
?>
</tbody>
</table>
<?php
echo JHTML::_('tabs.panel', JText::_('COM_JOOMLEAGUE_ADMIN_UPDATES_HISTORY'), 'panel' . $idxTab++);
foreach ($this->versionhistory as $history) {
?>
<fieldset>
<legend>
<strong>
<?php
//echo $history->date;
echo JText::sprintf('COM_JOOMLEAGUE_ADMIN_UPDATES_VERSIONEN', $history->version, JHTML::date($history->date, JText::_('COM_JOOMLEAGUE_ADMIN_UPDATES_DAYDATE')));
?>
</strong>
</legend>
<?php
//echo $history->text;
echo JText::_($history->text);
?>
</fieldset>
<?php
}
echo JHTML::_('tabs.end');
?>
<input type="hidden" name="view" value="updates" />
示例12: showValue
/**
* Show the field based on the eav type
* @param EavAttribute $eav
* @param unknown_type $value
*/
public static function showValue($eav, $value = null)
{
// Type of the field
switch ($eav->eavattribute_type) {
case "bool":
if ($value) {
echo JText::_('COM_TIENDA_YES');
} else {
echo JText::_('COM_TIENDA_NO');
}
break;
case "datetime":
$format = !empty($eav->eavattribute_format_date) ? $eav->eavattribute_format_date : 'Y-m-d H:i:s';
$datetime = date('Y-m-d H:i:s', strtotime($value));
return JHTML::date($datetime, $format);
break;
case "text":
$dispatcher = JDispatcher::getInstance();
$item = new JObject();
$item->text =& $value;
$item->params = array();
if (Tienda::getInstance()->get('eavtext_content_plugin', 1)) {
if ($eav->editable_by == 1) {
JPluginHelper::importPlugin('content');
$dispatcher->trigger('onPrepareContent', array(&$item, &$item->params, 0));
}
} else {
JPluginHelper::importPlugin('content');
$dispatcher->trigger('onPrepareContent', array(&$item, &$item->params, 0));
}
return $value;
case "decimal":
if (Tienda::getInstance()->get('eavinteger_use_thousand_separator', 0)) {
return self::number($value);
} else {
return self::number($value, array('thousands' => ''));
}
case "int":
if (Tienda::getInstance()->get('eavinteger_use_thousand_separator', 0)) {
return self::number($value, array('num_decimals' => 0));
} else {
return self::number($value, array('thousands' => '', 'num_decimals' => 0));
}
case "hidden":
case "varchar":
default:
return $value;
break;
}
return '';
}
示例13:
</div>
<?php
}
// deathday
if ($this->row->deathday != "0000-00-00") {
?>
<div>
<span class="jl_roster_persondetails_label">
<?php
echo JText::_("COM_JOOMLEAGUE_ROSTER_DEATHDAY");
?>
[ † ]
</span>
<span class="jl_roster_persondetails_data">
<?php
echo JHTML::date($this->row->deathday, JText::_('COM_JOOMLEAGUE_GLOBAL_DAYDATE'));
?>
</span>
</div>
<?php
}
}
// if ($this->config['show_birthday'] > 0 AND $this->row->birthday !="0000-00-00") ends
if ($this->config['show_country_flag']) {
?>
<div>
<span class="jl_roster_persondetails_label">
<?php
echo JText::_("COM_JOOMLEAGUE_PERSON_NATIONALITY");
?>
</span><!-- /.jl_roster_persondetails_label -->
示例14: foreach
$maillink = $base_url . "&emailverify=1&userid=" . $my->id . "&catid=";
if (count(@$_POST['cid'])) {
$subscribeto .= $vmchosencat . "<br><br>";
foreach ($_POST['cid'] as $cat) {
$maillink .= $cat . ",";
$cattitle = vmn_getCatTitle($cat);
$subscribeto .= $cattitle . "<br>";
}
$maillink = rtrim($maillink, ",");
$subscribeto = rtrim($subscribeto, "<br>");
} else {
$subscribeto .= $vmnocats;
}
$maillink = vmn_sefRelToAbs($maillink);
$search = array('[sitename]', '[livesite]', '[senddate]', '[sendtime]');
$replace = array($mainframe->getCfg('sitename'), JURI::root(), JHTML::date('now', JTEXT::_('DATE_FORMAT_LC')), JHTML::date('now', '%H:%M'));
$subject = str_replace($search, $replace, stripslashes($vmsubject));
$subject = html_entity_decode($subject, ENT_QUOTES);
$database->setQuery("SELECT mailformat FROM #__vemod_news_mailer_users WHERE id={$my->id}");
$usermailformat = $database->loadResult();
if ($mailformat == 1 || $mailformat == 2 && $usermailformat == 1) {
$message = stripslashes($verifymailText);
$subscribeto = str_replace("<br>", "\n", $subscribeto);
$maillink = $vmlinktext . "\n" . $maillink;
} else {
$maillink = '<a href="' . $maillink . '" target="_blank">' . $vmlinktext . '</a>';
$message = stripslashes($verifymailHTML);
}
$search = array('[sitename]', '[livesite]', '[subject]', '[username]', '[subscribeto]', '[verifylink]');
$replace = array($mainframe->getCfg('sitename'), JURI::root(), stripslashes($vmsubject), $my->name, $subscribeto, $maillink);
$message = str_replace($search, $replace, $message);
示例15:
:
<strong><?php
echo JHTML::date($item->created, 'd-m-Y');
?>
</strong> |
<?php
echo JText::_('COM_JMS_FINISH_ON');
?>
:
<strong>
<?php
if ($item->days_left <= 0) {
echo '<span class="jms-red">' . JHTML::date($item->expired, 'd-m-Y') . '</span>';
} else {
echo JHTML::date($item->expired, 'd-m-Y');
}
?>
</strong>
</span>
</td>
<td align="center">
<img src="<?php
echo JURI::base();
?>
components/com_jms/assets/images/<?php
echo $imgActive;
?>
" />