• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP locale_datefmt函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: foreach

         }
         // Initialize GeoIP plugin
         $geoip_Plugin =& $Plugins->get_by_code('evo_GeoIP');
         foreach ($login_attempts as $attempt) {
             $attempt = explode('|', $attempt);
             $attempt_ip = $attempt[1];
             $plugin_country_by_IP = '';
             if (!empty($geoip_Plugin) && ($Country =& $geoip_Plugin->get_country_by_IP($attempt_ip))) {
                 // Get country by IP if plugin is enabled
                 $plugin_country_by_IP = ' (' . $Country->get_name() . ')';
             }
             if ($attempt_ip != $current_ip) {
                 // Get DNS by IP if current IP is different from attempt IP
                 $attempt_ip .= ' ' . gethostbyaddr($attempt_ip);
             }
             $Messages->add(sprintf(T_('Someone tried to log in to your account with a wrong password on %s from %s%s'), date(locale_datefmt() . ' ' . locale_timefmt(), $attempt[0]), $attempt_ip, $plugin_country_by_IP), 'error');
         }
         // Clear the attempts list
         $UserSettings->delete('login_attempts', $current_User->ID);
         $UserSettings->dbupdate();
     }
 } elseif (empty($login_error)) {
     // if the login_error wasn't set yet, add the default one:
     // This will cause the login screen to "popup" (again)
     $login_error = T_('Wrong login/password.');
     if (isset($login_attempts)) {
         // Save new login attempt into DB
         if (count($login_attempts) == 9) {
             // Unset first attempt to clear a space for new attempt
             unset($login_attempts[0]);
         }
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:31,代码来源:_init_login.inc.php


示例2: die

    die('Please, do not access this page directly.');
}
global $blog, $admin_url, $UserSettings;
global $datestartinput, $datestart, $datestopinput, $datestop, $email;
if (param_date('datestartinput', T_('Invalid date'), false, NULL) !== NULL) {
    // We have a user provided localized date:
    memorize_param('datestart', 'string', NULL, trim(form_date($datestartinput)));
    memorize_param('datestartinput', 'string', NULL, empty($datestartinput) ? NULL : date(locale_datefmt(), strtotime($datestartinput)));
} else {
    // We may have an automated param transmission date:
    param('datestart', 'string', '', true);
}
if (param_date('datestopinput', T_('Invalid date'), false, NULL) !== NULL) {
    // We have a user provided localized date:
    memorize_param('datestop', 'string', NULL, trim(form_date($datestopinput)));
    memorize_param('datestopinput', 'string', NULL, empty($datestopinput) ? NULL : date(locale_datefmt(), strtotime($datestopinput)));
} else {
    // We may have an automated param transmission date:
    param('datestop', 'string', '', true);
}
param('email', 'string', '', true);
// Create result set:
$SQL = new SQL();
$SQL->SELECT('SQL_NO_CACHE emlog_ID, emlog_timestamp, emlog_user_ID, emlog_to, emlog_result, emlog_subject');
$SQL->FROM('T_email__log');
$count_SQL = new SQL();
$count_SQL->SELECT('SQL_NO_CACHE COUNT(emlog_ID)');
$count_SQL->FROM('T_email__log');
if (!empty($datestart)) {
    // Filter by start date
    $SQL->WHERE_and('emlog_timestamp >= ' . $DB->quote($datestart . ' 00:00:00'));
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:31,代码来源:_email_sent.view.php


示例3: get_mod_date

 /**
  * Get last mod date (datetime) of Item
  *
  * @param string date/time format: leave empty to use locale default date format
  * @param boolean true if you want GMT
  */
 function get_mod_date($format = '', $useGM = false)
 {
     if (empty($format)) {
         return mysql2date(locale_datefmt(), $this->datemodified, $useGM);
     }
     return mysql2date($format, $this->datemodified, $useGM);
 }
开发者ID:ldanielz,项目名称:uesp.blog,代码行数:13,代码来源:_itemlight.class.php


示例4: mysql2localedatetime_spans

function mysql2localedatetime_spans($mysqlstring, $datefmt = NULL, $timefmt = NULL)
{
    if (is_null($datefmt)) {
        $datefmt = locale_datefmt();
    }
    if (is_null($timefmt)) {
        $timefmt = locale_timefmt();
    }
    return '<span class="date">' . mysql2date($datefmt, $mysqlstring) . '</span> <span class="time">' . mysql2date($timefmt, $mysqlstring) . '</span>';
}
开发者ID:ldanielz,项目名称:uesp.blog,代码行数:10,代码来源:_misc.funcs.php


示例5: date

 /**
  * Template function: display date (datetime) of comment
  *
  * @param string date/time format: leave empty to use locale default date format
  * @param boolean true if you want GMT
  */
 function date($format = '', $useGM = false)
 {
     if (empty($format)) {
         echo mysql2date(locale_datefmt(), $this->date, $useGM);
     } else {
         echo mysql2date($format, $this->date, $useGM);
     }
 }
开发者ID:ldanielz,项目名称:uesp.blog,代码行数:14,代码来源:_comment.class.php


示例6: debug_die

    default:
        debug_die('unhandled action 1:' . htmlspecialchars($action));
}
$AdminUI->breadcrumbpath_init();
$AdminUI->breadcrumbpath_add(T_('Contents'), '?ctrl=items&amp;blog=$blog$&amp;tab=full&amp;filter=restore');
/**
 * Perform action:
 */
switch ($action) {
    case 'nil':
        // Do nothing
        break;
    case 'new':
    case 'new_mass':
        // $set_issue_date = 'now';
        $item_issue_date = date_i18n(locale_datefmt(), $localtimenow);
        $item_issue_time = date('H:i:s', $localtimenow);
        // pre_dump( $item_issue_date, $item_issue_time );
    // pre_dump( $item_issue_date, $item_issue_time );
    case 'new_switchtab':
        // this gets set as action by JS, when we switch tabs
        // New post form  (can be a bookmarklet form if mode == bookmarklet )
        // We don't check the following earlier, because we want the blog switching buttons to be available:
        if (!blog_has_cats($blog)) {
            break;
        }
        load_class('items/model/_item.class.php', 'Item');
        $edited_Item = new Item();
        $edited_Item->set('main_cat_ID', $Blog->get_default_cat_ID());
        // We use the request variables to fill the edit form, because we need to be able to pass those values
        // from tab to tab via javascript when the editor wants to switch views...
开发者ID:ldanielz,项目名称:uesp.blog,代码行数:31,代码来源:items.ctrl.php


示例7: array

/*
 * Chart
 */
if (count($res_hits)) {
    $last_date = 0;
    $chart['chart_data'][0] = array();
    $chart['chart_data'][1] = array();
    $count = 0;
    foreach ($res_hits as $row_stats) {
        $this_date = mktime(0, 0, 0, $row_stats['month'], $row_stats['day'], $row_stats['year']);
        if ($last_date != $this_date) {
            // We just hit a new day, let's display the previous one:
            $last_date = $this_date;
            // that'll be the next one
            $count++;
            array_unshift($chart['chart_data'][0], date(locale_datefmt(), $last_date));
            array_unshift($chart['chart_data'][1], 0);
        }
        $chart['chart_data'][1][0] = $row_stats['hits'];
    }
    array_unshift($chart['chart_data'][0], '');
    array_unshift($chart['chart_data'][1], 'XML (RSS/Atom) hits');
    // Translations need to be UTF-8
    // Include common chart properties:
    require dirname(__FILE__) . '/inc/_bar_chart.inc.php';
    $chart['series_color'] = array($agent_type_color['rss']);
    echo '<div class="center">';
    load_funcs('_ext/_swfcharts.php');
    DrawChart($chart);
    echo '</div>';
}
开发者ID:ldanielz,项目名称:uesp.blog,代码行数:31,代码来源:_stats_syndication.view.php


示例8: SkinTag


//.........这里部分代码省略.........
         $params['link_type'] = 'canonic';
     }
     if (!isset($params['context_isolation'])) {
         $params['context_isolation'] = 'm,w,p,title,unit,dstart';
     }
     // Add form fields?:
     if (!isset($params['form'])) {
         $params['form'] = false;
     }
     // Number of archive entries to display:
     if (!isset($params['limit'])) {
         $params['limit'] = 12;
     }
     // More link text:
     if (!isset($params['more_link'])) {
         $params['more_link'] = T_('More...');
     }
     // This is what will enclose the list:
     if (!isset($params['list_start'])) {
         $params['list_start'] = '<ul>';
     }
     if (!isset($params['list_end'])) {
         $params['list_end'] = "</ul>\n";
     }
     // This is what will separate the archive links:
     if (!isset($params['line_start'])) {
         $params['line_start'] = '<li>';
     }
     if (!isset($params['line_end'])) {
         $params['line_end'] = "</li>\n";
     }
     // Daily archive date format?
     if (!isset($params['day_date_format']) || $params['day_date_format'] == '') {
         $dateformat = locale_datefmt();
         $params['day_date_format'] = $dateformat;
     }
     $ArchiveList =& new ArchiveList($params['mode'], $params['limit'], $params['sort_order'], $params['link_type'] == 'context', $this->dbtable, $this->dbprefix, $this->dbIDname);
     echo $params['block_start'];
     if (!empty($params['title'])) {
         // We want to display a title for the widget block:
         echo $params['block_title_start'];
         echo $params['title'];
         echo $params['block_title_end'];
     }
     echo $params['list_start'];
     while ($ArchiveList->get_item($arc_year, $arc_month, $arc_dayofmonth, $arc_w, $arc_count, $post_ID, $post_title)) {
         echo $params['line_start'];
         switch ($params['mode']) {
             case 'monthly':
                 // --------------------------------- MONTHLY ARCHIVES -------------------------------------
                 $arc_m = $arc_year . zeroise($arc_month, 2);
                 if ($params['form']) {
                     // We want a radio button:
                     echo '<input type="radio" name="m" value="' . $arc_m . '" class="checkbox"';
                     if ($m == $arc_m) {
                         echo ' checked="checked"';
                     }
                     echo ' /> ';
                 }
                 $text = T_($month[zeroise($arc_month, 2)]) . ' ' . $arc_year;
                 if ($params['link_type'] == 'context') {
                     // We want to preserve current browsing context:
                     echo '<a rel="nofollow" href="' . regenerate_url($params['context_isolation'], 'm=' . $arc_m) . '">' . $text . '</a>';
                 } else {
                     // We want to link to the absolute canonical URL for this archive:
                     echo $Blog->gen_archive_link($text, T_('View monthly archive'), $arc_year, $arc_month);
开发者ID:LFSF,项目名称:oras,代码行数:67,代码来源:_archives.plugin.php


示例9: param_check_date

/**
 * Check if param is an ISO date.
 *
 * NOTE: for tokens like e.g. "D" (abbr. weekday), T_() gets used and it uses the current locale!
 *
 * @param string param name
 * @param string error message
 * @param boolean Is a non-empty date required?
 * @param string date format (php format)
 * @return boolean|string false if not OK, ISO date if OK
 */
function param_check_date($var, $err_msg, $required = false, $date_format = NULL)
{
    if (empty($GLOBALS[$var])) {
        // empty is OK if not required:
        if ($required) {
            param_error($var, $err_msg);
            return false;
        }
        return '';
    }
    if (empty($date_format)) {
        // Use locale date format:
        $date_format = locale_datefmt();
    }
    // Convert PHP date format to regexp pattern:
    $date_regexp = '~' . preg_replace_callback('~(\\\\)?(\\w)~', create_function('$m', '
		if( $m[1] == "\\\\" ) return $m[2]; // escaped
		switch( $m[2] )
		{
			case "d": return "([0-3]\\d)"; // day, 01-31
			case "j": return "([1-3]?\\d)"; // day, 1-31
			case "l": return "(".str_replace("~", "\\~", implode("|", array_map("trim", array_map("T_", $GLOBALS["weekday"])))).")";
			case "D": return "(".str_replace("~", "\\~", implode("|", array_map("trim", array_map("T_", $GLOBALS["weekday_abbrev"])))).")";
			case "e": // b2evo extension!
				return "(".str_replace("~", "\\~", implode("|", array_map("trim", array_map("T_", $GLOBALS["weekday_letter"])))).")";
				case "S": return "(st|nd|rd|th)"; // english suffix for day

			case "m": return "([0-1]\\d)"; // month, 01-12
			case "n": return "(1?\\d)"; // month, 1-12
			case "F": return "(".str_replace("~", "\\~", implode("|", array_map("trim", array_map("T_", $GLOBALS["month"])))).")"; //  A full textual representation of a month, such as January or March
			case "M": return "(".str_replace("~", "\\~", implode("|", array_map("trim", array_map("T_", $GLOBALS["month_abbrev"])))).")";

			case "y": return "(\\d\\d)"; // year, 00-99
			case "Y": return "(\\d{4})"; // year, XXXX
			default:
				return $m[0];
		}'), $date_format) . '~i';
    // case-insensitive?
    // Allow additional spaces, e.g. "03  May 2007" when format is "d F Y":
    $date_regexp = preg_replace('~ +~', '\\s+', $date_regexp);
    // echo $date_format.'...'.$date_regexp;
    // Check that the numbers match the date pattern:
    if (preg_match($date_regexp, $GLOBALS[$var], $numbers)) {
        // Date does match pattern:
        //pre_dump( $numbers );
        // Get all date pattern parts. We should get 3 parts!:
        preg_match_all('/(?<!\\\\)[A-Za-z]/', $date_format, $parts);
        // "(?<!\\\\)" means that the letter is not escaped with "\"
        //pre_dump( $parts );
        foreach ($parts[0] as $position => $part) {
            switch ($part) {
                case 'd':
                case 'j':
                    $day = $numbers[$position + 1];
                    break;
                case 'm':
                case 'n':
                    $month = $numbers[$position + 1];
                    break;
                case 'F':
                    // full month name
                    $month = array_search(strtolower($numbers[$position + 1]), array_map('strtolower', array_map('trim', array_map('T_', $GLOBALS['month']))));
                    break;
                case 'M':
                    $month = array_search(strtolower($numbers[$position + 1]), array_map('strtolower', array_map('trim', array_map('T_', $GLOBALS['month_abbrev']))));
                    break;
                case 'y':
                case 'Y':
                    $year = $numbers[$position + 1];
                    if ($year < 50) {
                        $year = 2000 + $year;
                    } elseif ($year < 100) {
                        $year = 1900 + $year;
                    }
                    break;
            }
        }
        if (checkdate($month, $day, $year)) {
            // all clean! :)
            // We convert the value to ISO:
            $iso_date = substr('0' . $year, -4) . '-' . substr('0' . $month, -2) . '-' . substr('0' . $day, -2);
            return $iso_date;
        }
    }
    // Date did not pass all tests:
    param_error($var, $err_msg);
    return false;
}
开发者ID:LFSF,项目名称:oras,代码行数:99,代码来源:_param.funcs.php


示例10: author

/**
 * Create author cell for message list table
 *
 * @param integer user ID
 * @param string login
 * @param string first name
 * @param string last name
 * @param integer avatar ID
 * @param string datetime
 */
function author($user_ID, $datetime)
{
    $author = get_user_avatar_styled($user_ID, array('size' => 'crop-top-80x80'));
    return $author . '<div class="note black">' . mysql2date(locale_datefmt() . '<\\b\\r />' . str_replace(':s', '', locale_timefmt()), $datetime) . '</div>';
}
开发者ID:ldanielz,项目名称:uesp.blog,代码行数:15,代码来源:_message_list.view.php


示例11: mktime

        }
        $hits['session']++;
        $hits_total['session']++;
    }
    if ($last_date != 0) {
        // We had a day pending:
        $this_date = mktime(0, 0, 0, $row_stats['month'], $row_stats['day'], $row_stats['year']);
        $link_text = $admin_url . '?ctrl=stats&tab=hits&datestartinput=' . urlencode(date(locale_datefmt(), $last_date)) . '&datestopinput=' . urlencode(date(locale_datefmt(), $last_date)) . '&blog=' . $blog . '&agent_type=browser';
        $link_text_total_day = $admin_url . '?ctrl=stats&tab=hits&datestartinput=' . urlencode(date(locale_datefmt(), $last_date)) . '&datestopinput=' . urlencode(date(locale_datefmt(), $last_date)) . '&blog=' . $blog . '&agent_type=browser';
        ?>
				<tr class="<?php 
        echo $count % 2 == 1 ? 'odd' : 'even';
        ?>
">
				<td class="firstcol right"><?php 
        echo date('D ' . locale_datefmt(), $this_date);
        if ($current_User->check_perm('stats', 'edit')) {
            echo action_icon(T_('Prune hits for this date!'), 'delete', url_add_param($admin_url, 'ctrl=stats&amp;action=prune&amp;date=' . $last_date . '&amp;show=summary&amp;blog=' . $blog . '&amp;' . url_crumb('stats')));
        }
        ?>
</td>
				<td class="right"><?php 
        echo $hits['session'];
        ?>
</td>
				<td class="right"><a href="<?php 
        echo $link_text . '&referer_type=search';
        ?>
"><?php 
        echo $hits['search'];
        ?>
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:31,代码来源:_stats_browserhits.view.php


示例12: param

            // Required!
            Hitlist::change_type($hit_ID, $new_hit_type);
            $Messages->add(sprintf(T_('Changed hit #%d type to: %s.'), $hit_ID, $new_hit_type), 'success');
            break;
        case 'prune':
            // PRUNE hits for a certain date
            // Check that this action request is not a CSRF hacked request:
            $Session->assert_received_crumb('stats');
            // Check permission:
            $current_User->check_perm('stats', 'edit', true);
            param('date', 'integer', true);
            // Required!
            if ($r = Hitlist::prune($date)) {
                $Messages->add(sprintf(T_('Deleted %d hits for %s.'), $r, date(locale_datefmt(), $date)), 'success');
            } else {
                $Messages->add(sprintf(T_('No hits deleted for %s.'), date(locale_datefmt(), $date)), 'note');
            }
            // Redirect so that a reload doesn't write to the DB twice:
            header_redirect('?ctrl=stats', 303);
            // Will EXIT
            // We have EXITed already at this point!!
            break;
        case 'reset_counters':
            $current_User->check_perm('stats', 'edit', true);
            $sql = 'UPDATE T_track__keyphrase
				SET keyp_count_refered_searches = 0,
					keyp_count_internal_searches = 0';
            $DB->query($sql, ' Reset keyphrases counters');
            break;
    }
}
开发者ID:ldanielz,项目名称:uesp.blog,代码行数:31,代码来源:stats.ctrl.php


示例13: get_last_touched_date

 /**
  * Get last touched date (datetime) of Chapter
  *
  * @param string date/time format: leave empty to use locale default date format
  * @param boolean true if you want GMT
  */
 function get_last_touched_date($format = '', $useGM = false)
 {
     if (empty($format)) {
         return mysql2date(locale_datefmt(), $this->last_touched_ts, $useGM);
     }
     return mysql2date($format, $this->last_touched_ts, $useGM);
 }
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:13,代码来源:_chapter.class.php


示例14: T_

    }
    echo '</div>';
}
$facilitate_exploits = '<p>' . T_('When enabled, this feature is known to facilitate hacking exploits in any PHP application.') . "</p>\n<p>" . T_('b2evolution includes additional measures in order not to be affected by this.
	However, for maximum security, we still recommend disabling this PHP feature.') . "</p>\n";
$change_ini = '<p>' . T_('If possible, change this setting to <code>%s</code> in your php.ini or ask your hosting provider about it.') . '</p>';
echo '<h2>' . T_('About this system') . '</h2>';
$block_item_Widget =& new Widget('block_item');
/**
 * b2evolution
 */
$block_item_Widget->title = 'b2evolution';
$block_item_Widget->disp_template_replaced('block_start');
// Version:
$app_timestamp = mysql2timestamp($app_date);
init_system_check('b2evolution version', $app_version . ' released on ' . date_i18n(locale_datefmt(), $app_timestamp));
$app_age = ($localtimenow - $app_timestamp) / 3600 / 24 / 30;
// approx age in months
if ($app_age > 12) {
    disp_system_check('error', sprintf(T_('This version is old. You should check for newer releases on <a %s>b2evolution.net</a>.'), ' href="http://b2evolution.net/downloads/"'));
} elseif ($app_age > 6) {
    disp_system_check('warning', sprintf(T_('This version is aging. You may want to check for newer releases on <a %s>b2evolution.net</a>.'), ' href="http://b2evolution.net/downloads/"'));
} else {
    disp_system_check('ok');
}
// Media folder writable?
list($mediadir_status, $mediadir_msg) = system_check_media_dir();
$mediadir_long = '';
if ($mediadir_status == 'error') {
    $mediadir_long = '<p>' . T_('You will not be able to upload files/images and b2evolution will not be able to generate thumbnails.') . "</p>\n" . '<p>' . T_('Your host requires that you set special file permissions on your media directory.') . get_manual_link('media_file_permission_errors') . "</p>\n";
}
开发者ID:LFSF,项目名称:oras,代码行数:31,代码来源:system.ctrl.php


示例15: date

 /**
  * Template function: display date (datetime) of comment
  *
  * @param string date/time format: leave empty to use locale default date format
  * @param boolean true if you want GMT
  */
 function date($format = '', $useGM = false)
 {
     if (empty($format)) {
         // Get the current locale's default date format
         $format = locale_datefmt();
     }
     echo mysql2date($format, $this->date, $useGM);
 }
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:14,代码来源:_comment.class.php


示例16: search_result_block

function search_result_block($params = array())
{
    global $Blog, $Session, $debug;
    $search_keywords = param('s', 'string', '', true);
    // Try to load existing search results from Session:
    $search_params = $Session->get('search_params');
    $search_result = $Session->get('search_result');
    $search_result_loaded = false;
    if (empty($search_params) || $search_params['search_keywords'] != $search_keywords || $search_params['search_blog'] != $Blog->ID || $search_result === NULL) {
        // We need to perform a new search:
        if ($debug) {
            echo '<p class="text-muted">Starting a new search...</p>';
        }
        // Flush first part of the page before starting search, which can be long...
        evo_flush();
        $search_params = array('search_keywords' => $search_keywords, 'search_blog' => $Blog->ID);
        // Perform new search:
        $search_result = perform_scored_search($search_keywords);
        // Save results into session:
        $Session->set('search_params', $search_params);
        $Session->set('search_result', $search_result);
        $search_result_loaded = true;
    } else {
        // We found the desired saved search results in the Session:
        if ($debug) {
            // Display counts
            echo '<div class="text-muted">';
            echo '<p>We found the desired saved search results in the Session:</p>';
            echo '<ul><li>' . sprintf('%d posts', $search_result[0]['nr_of_items']) . '</li>';
            echo '<li>' . sprintf('%d comments', $search_result[0]['nr_of_comments']) . '</li>';
            echo '<li>' . sprintf('%d chapters', $search_result[0]['nr_of_cats']) . '</li>';
            echo '<li>' . sprintf('%d tags', $search_result[0]['nr_of_tags']) . '</li></ul>';
            echo '</div>';
        }
        // Flush first part of the page before starting search, which can be long...
        evo_flush();
    }
    // Make sure we are not missing any display params:
    $params = array_merge(array('no_match_message' => '<p class="alert alert-info msg_nothing" style="margin: 2em 0">' . T_('Sorry, we could not find anything matching your request, please try to broaden your search.') . '<p>', 'title_suffix_post' => ' (' . T_('Post') . ')', 'title_suffix_comment' => ' (' . T_('Comment') . ')', 'title_suffix_category' => ' (' . T_('Category') . ')', 'title_suffix_tag' => ' (' . T_('Tag') . ')', 'block_start' => '', 'block_end' => '', 'pagination' => array(), 'use_editor' => false, 'author_format' => 'avatar_name', 'date_format' => locale_datefmt()), $params);
    $search_result = $Session->get('search_result');
    if (empty($search_result)) {
        echo $params['no_match_message'];
        return;
    }
    // Prepare pagination:
    $result_count = count($search_result);
    $result_per_page = $Blog->get_setting('search_per_page');
    if ($result_count > $result_per_page) {
        // We will have multiple search result pages:
        $current_page = param('page', 'integer', 1);
        $total_pages = ceil($result_count / $result_per_page);
        if ($current_page > $total_pages) {
            $current_page = $total_pages;
        }
        $page_params = array_merge(array('total' => $result_count, 'current_page' => $current_page, 'total_pages' => $total_pages, 'list_span' => 11), $params['pagination']);
        search_page_links($page_params);
    } else {
        // Only one page of results:
        $current_page = 1;
        $total_pages = 1;
    }
    // Set current page indexes:
    $from = ($current_page - 1) * $result_per_page;
    $to = $current_page < $total_pages ? $from + $result_per_page : $result_count;
    // Init caches
    $ItemCache =& get_ItemCache();
    $CommentCache =& get_CommentCache();
    $ChapterCache =& get_ChapterCache();
    if (!$search_result_loaded) {
        // Search result objects are not loaded into memory yet, load them
        // Group required object ids by type:
        $required_ids = array();
        for ($index = $from; $index < $to; $index++) {
            $row = $search_result[$index];
            if (isset($required_ids[$row['type']])) {
                $required_ids[$row['type']][] = $row['ID'];
            } else {
                $required_ids[$row['type']] = array($row['ID']);
            }
        }
        // Load each required object into the corresponding cache:
        foreach ($required_ids as $type => $object_ids) {
            switch ($type) {
                case 'item':
                    $ItemCache->load_list($object_ids);
                    break;
                case 'comment':
                    $CommentCache->load_list($object_ids);
                    break;
                case 'category':
                    $ChapterCache->load_list($object_ids);
                    break;
                    // TODO: we'll probably load "tag" objects once we support tag-synonyms.
                // TODO: we'll probably load "tag" objects once we support tag-synonyms.
                default:
                    // Not handled search result type
                    break;
            }
        }
    }
//.........这里部分代码省略.........
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:101,代码来源:_search.funcs.php


示例17: display_activateinfo

/**
 * Display user activate info form content
 *
 * @param Object activateinfo Form
 */
function display_activateinfo($params)
{
    global $current_User, $Settings, $UserSettings, $Plugins;
    global $secure_htsrv_url, $rsc_path, $rsc_url, $dummy_fields;
    if (!is_logged_in()) {
        // if this happens, it means the code is not correct somewhere before this
        debug_die("You must log in to see this page.");
    }
    // init force request new email address param
    $force_request = param('force_request', 'boolean', false);
    // get last activation email timestamp from User Settings
    $last_activation_email_date = $UserSettings->get('last_activation_email', $current_User->ID);
    if ($force_request || empty($last_activation_email_date)) {
        // notification email was not sent yet, or user needs another one ( forced request )
        $params = array_merge(array('form_action' => $secure_htsrv_url . 'login.php', 'form_name' => 'form_validatemail', 'form_class' => 'fform', 'form_layout' => 'fieldset', 'inskin' => false), $params);
        $Form = new Form($params['form_action'], $params['form_name'], 'post', $params['form_layout']);
        $Form->begin_form($params['form_class']);
        $Form->add_crumb('validateform');
        $Form->hidden('action', 'req_validatemail');
        $Form->hidden('redirect_to', $params['redirect_to']);
        if ($params['inskin']) {
            $Form->hidden('inskin', $params['inskin']);
            $Form->hidden('blog', $params['blog']);
        }
        $Form->hidden('req_validatemail_submit', 1);
        // to know if the form has been submitted
        $Form->begin_fieldset();
        echo '<ol>';
        echo '<li>' . T_('Please confirm your email address below:') . '</li>';
        echo '</ol>';
        // set email text input content only if this is not a forced request. This way the user may have bigger chance to write a correct email address.
        $user_email = $force_request ? '' : $current_User->email;
        // fp> note: 45 is the max length for evopress skin.
        $Form->text_input($dummy_fields['email'], $user_email, 45, T_('Your email'), '', array('maxlength' => 255, 'class' => 'input_text', 'required' => true));
        $Form->end_fieldset();
        // Submit button:
        $submit_button = array(array('name' => 'submit', 'value' => T_('Send me a new activation email now!'), 'class' => 'submit'));
        $Form->buttons_input($submit_button);
        if (!$params['inskin']) {
            $Plugins->trigger_event('DisplayValidateAccountFormFieldset', array('Form' => &$Form));
        }
        $Form->end_form();
        return;
    }
    // get notification email from general Settings
    $notification_email = $Settings->get('notification_sender_email');
    // convert date to timestamp
    $last_activation_email_ts = mysql2timestamp($last_activation_email_date);
    // get difference between local time and server time
    $time_difference = $Settings->get('time_difference');
    // get last activation email local date and time
    $last_email_date = date(locale_datefmt(), $last_activation_email_ts + $time_difference);
    $last_email_time = date(locale_shorttimefmt(), $last_activation_email_ts + $time_difference);
    $user_email = $current_User->email;
    echo '<ol start="1" class="expanded">';
    $instruction = sprintf(T_('Open your email account for %s and find a message we sent you on %s at %s with the following title:'), $user_email, $last_email_date, $last_email_time);
    echo '<li>' . $instruction . '<br /><b>' . sprintf(T_('Activate your account: %s'), $current_User->login) . '</b>';
    $request_validation_url = 'href="' . regenerate_url('', 'force_request=1&validate_required=true&redirect_to=' . $params['redirect_to']) . '"';
    echo '<p>' . sprintf(T_('NOTE: If you don\'t find it, check your "Junk", "Spam" or "Unsolicited email" folders. If you really can\'t find it, <a %s>request a new activation email</a>.'), $request_validation_url) . '</p></li>';
    echo '<li>' . sprintf(T_('Add us (%s) to your contacts to make sure you receive future email notifications, especially when someone sends you a private message.'), '<b><span class="nowrap">' . $notification_email . '</span></b>') . '</li>';
    echo '<li><b class="red">' . T_('Click on the activation link in the email.') . '</b>';
    echo '<p>' . T_('If this does not work, please copy/paste that link into the address bar of your browser.') . '</p>';
    echo '<p>' . sprintf(T_('If you need assistance, please send an email to %s'), '<b><a href="mailto:"' . $notification_email . '"><span class="nowrap">' . $notification_email . '</span></a></b>') . '</p></li>';
    echo '</ol>';
    if ((strpos($user_email, '@hotmail.') || strpos($user_email, '@live.') || strpos($user_email, '@msn.')) && file_exists($rsc_path . 'img/login_help/hotmail-validation.png')) {
        // The user is on hotmail and we have a help screen to show him: (needs to be localized and include correct site name)
        echo '<div class="center" style="margin: 2em auto"><img src="' . $rsc_url . 'img/login_help/hotmail-validation.png" /></div>';
    }
}
开发者ID:ldanielz,项目名称:uesp.blog,代码行数:74,代码来源:_template.funcs.php


示例18: basename

        $Table->display_line_start();
        // Checkbox to import
        $Table->display_col_start();
        echo '<input type="radio" name="wp_file" value="' . $import_file['path'] . '"' . (get_param('wp_file') == $import_file['path'] ? ' checked="checked"' : '') . ' />';
        $Table->display_col_end();
        // File
        $Table->display_col_start();
        echo basename($import_file['path']);
        $Table->display_col_end();
        // Type
        $Table->display_col_start();
        echo $import_file['type'];
        $Table->display_col_end();
        // File date
        $Table->display_col_start();
        echo date(locale_datefmt() . ' ' . locale_timefmt(), filemtime($import_file['path']));
        $Table->display_col_end();
        $Table->display_line_end();
        evo_flush();
    }
}
// BODY END / TABLE END:
$Table->display_body_end();
$Table->display_list_end();
if (!empty($import_files)) {
    $Form->begin_fieldset(T_('Select a blog for import'));
    $BlogCache =& get_BlogCache();
    $BlogCache->load_all('shortname,name', 'ASC');
    $BlogCache->none_option_text = '&nbsp;';
    $Form->select_input_object('wp_blog_ID', param('wp_blog_ID', 'integer', 0), $BlogCache, T_('Blog for import'), array('note' => T_('This blog will be used for import.') . ' <a href="' . $admin_url . '?ctrl=collections&action=new">' . T_('Create new blog') . ' &raquo;</a>', 'allow_none' => true, 'required' => true, 'loop_object_method' => 'get_extended_name'));
    $import_type = param('import_type', 'string', 'replace');
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:31,代码来源:_wpxml_file.form.php


示例19: date_if_changed

 /**
  * Template tag: Display the date if it has changed since last call
  *
  * Optionally also displays empty dates in between.
  *
  * @param array
  */
 function date_if_changed($params = array())
 {
     if ($this->current_Obj->ityp_ID == 1000) {
         // This is not applicable to pages
         return;
     }
     // Make sure we are not missing any param:
     $params = array_merge(array('before' => '<h2>', 'after' => '</h2>', 'empty_day_display' => false, 'empty_day_before' => '<h2>', 'empty_day_after' => '</h2>', 'date_format' => '#'), $params);
     // Get a timestamp for the date WITHOUT the time:
     $current_item_date = mysql2datestamp($this->current_Obj->issue_date);
     if ($current_item_date != $this->last_displayed_date) {
         // Date has changed...
         if ($params['date_format'] == '#') {
             // No format specified, use default locale format:
             $params['date_format'] = locale_datefmt();
         }
         if ($params['empty_day_display'] && !empty($this->last_displayed_date)) {
             // We want to display ALL dates from the previous to the current:
             while ($this->last_displayed_date < $current_item_date - 86400) {
                 $this->last_displayed_date += 86400;
                 // Add one day's worth of seconds
                 echo date_sprintf($params['empty_day_before'], $this->last_displayed_date) . date_i18n($params['date_format'], $this->last_displayed_date) . date_sprintf($params['empty_day_after'], $this->last_displayed_date);
             }
         }
         // Display the new current date:
         echo date_sprintf($params['before'], $this->last_displayed_date) . date_i18n($params['date_format'], $current_item_date) . date_sprintf($params['after'], $this->last_displayed_date);
         $this->last_displayed_date = $current_item_date;
     }
 }
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:36,代码来源:_itemlistlight.class.php


示例20: T_

        $Form->hidden('oldloc_locale', $newlocale);
    }
    $Form->begin_fieldset();
    $Form->text('newloc_locale', $newlocale, 20, T_('Locale'), sprintf(T_('The first two letters should be a <a %s>ISO 639 language code</a>. The last two letters should be a <a %s>ISO 3166 country code</a>.'), 'href="http://www.gnu.org/software/gettext/manual/html_chapter/gettext_15.html#SEC221"', 'href="http://www.gnu.org/software/gettext/manual/html_chapter/gettext_16.html#SEC 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP locale_money_format函数代码示例发布时间:2022-05-15
下一篇:
PHP locale_add_language函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap