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


PHP _c函数代码示例

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


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

示例1: relative_time

/**
 * Make a timestamp into a relative string
 *
 * @todo Tidy up and move out of this file.
 * Based on Garrett Murray's code from http://graveyard.maniacalrage.net/etc/relative/
 */
function relative_time($posted_date)
{
    $in_seconds = $posted_date;
    $diff = time() - $in_seconds;
    $months = floor($diff / 2592000);
    $diff -= $months * 2419200;
    $weeks = floor($diff / 604800);
    $diff -= $weeks * 604800;
    $days = floor($diff / 86400);
    $diff -= $days * 86400;
    $hours = floor($diff / 3600);
    $diff -= $hours * 3600;
    $minutes = floor($diff / 60);
    $diff -= $minutes * 60;
    $seconds = $diff;
    if ($months > 0) {
        return sprintf(_c('on %s', 'on <date>'), date('N, jS \\o\\f F, Y'));
    }
    switch (true) {
        case $weeks > 0:
            // weeks and days
            $week = sprintf(Locale::ngettext('%d week', '%d weeks', $weeks), $weeks);
            if ($days > 0) {
                $day = sprintf(Locale::ngettext('%d day', '%d days', $days), $days);
                $relative_date = sprintf(_c('%s, %s ago', 'relative time, "x weeks, x days ago"'), $week, $day);
            } else {
                $relative_date = sprintf(_c('%s ago', 'relative time, "x weeks ago"'), $week);
            }
            break;
        case $days > 0:
            // days and hours
            $day = sprintf(Locale::ngettext('%d day', '%d days', $days), $days);
            if ($hours > 0) {
                $hour = sprintf(Locale::ngettext('%d hour', '%d hours', $hours), $hours);
                $relative_date = sprintf(_c('%s, %s ago', 'relative time, "x days, x hours ago"'), $day, $hour);
            } else {
                $relative_date = sprintf(_c('%s ago', 'relative time, "x days ago"'), $day);
            }
            break;
        case $hours > 0:
            // hours and minutes
            $hour = sprintf(Locale::ngettext('%d hour', '%d hours', $hours), $hours);
            if ($minutes > 0) {
                $minute = sprintf(Locale::ngettext('%d minute', '%d minutes', $minutes), $minutes);
                $relative_date = sprintf(_c('%s, %s ago', 'relative time, "x hours, x minutes ago"'), $hour, $minute);
            } else {
                $relative_date = sprintf(_c('%s ago', 'relative time, "x hours ago"'), $hour);
            }
            break;
        case $minutes > 0:
            // minutes only
            return sprintf(Locale::ngettext('%d minute ago', '%d minutes ago', $minutes), $minutes);
            break;
        case $seconds > 0:
            // seconds only
            return sprintf(Locale::ngettext('%d second ago', '%d seconds ago', $seconds), $seconds);
            break;
    }
    return $relative_date;
}
开发者ID:JocelynDelalande,项目名称:Lilina,代码行数:66,代码来源:index.php

示例2: load_course_roles

function load_course_roles()
{
    global $wp_roles;
    if (!$wp_roles->is_role('course_manager')) {
        _c('Course Manager|User role');
        $author = get_role('author');
        add_role('course_manager', 'Course Manager|User role', $author->capabilities);
        $role = get_role('course_manager');
        $role->add_cap('manage_courses');
        $role = get_role('administrator');
        $role->add_cap('manage_courses');
    }
}
开发者ID:koke,项目名称:warp_lms,代码行数:13,代码来源:register.php

示例3: _

 /**
  * Helper renvoyant l'url correspondante aux paramètres d'entrés
  * @return String $url
  * @param $params Array
  */
 public static function _($params, $domain = null)
 {
     if (is_string($params)) {
         // si c'est simplement une url...
         if (preg_match('#^http://#i', $params)) {
             return $params;
         } else {
             $params = self::selector($params);
         }
     }
     $urlEngineClassName = '\\Mynd\\Core\\Url\\' . ucwords(_c('url_handler')) . 'Url';
     $urlEngine = new $urlEngineClassName();
     if (!is_null($domain)) {
         $path = $urlEngine->params2path($params);
         return $urlEngine->path2url($path, $domain);
     }
     return $urlEngine->params2url($params);
 }
开发者ID:wamania,项目名称:mynd-framework,代码行数:23,代码来源:Url.php

示例4: params2path

 public function params2path($params)
 {
     if (empty($params['controller'])) {
         $params['controller'] = _c('default_controller');
     }
     if (empty($params['action'])) {
         $params['action'] = _c('default_action');
     }
     if (empty($params['module'])) {
         $params['module'] = null;
     }
     $url_vars = array();
     foreach ($params as $key => $value) {
         $url_vars[] = $key . '=' . urlencode($value);
     }
     $url_vars = implode('&', $url_vars);
     return $url_vars;
 }
开发者ID:wamania,项目名称:mynd-framework,代码行数:18,代码来源:SimpleUrl.php

示例5: wp_install_defaults

 function wp_install_defaults($user_id)
 {
     global $wpdb;
     // Default category
     $cat_name = $wpdb->escape(__('Uncategorized'));
     $cat_slug = sanitize_title(_c('Uncategorized|Default category slug'));
     $wpdb->query("INSERT INTO {$wpdb->terms} (name, slug, term_group) VALUES ('{$cat_name}', '{$cat_slug}', '0')");
     $wpdb->query("INSERT INTO {$wpdb->term_taxonomy} (term_id, taxonomy, description, parent, count) VALUES ('1', 'category', '', '0', '1')");
     // Default link category
     $cat_name = $wpdb->escape(__('Blogroll'));
     $cat_slug = sanitize_title(_c('Blogroll|Default link category slug'));
     $wpdb->query("INSERT INTO {$wpdb->terms} (name, slug, term_group) VALUES ('{$cat_name}', '{$cat_slug}', '0')");
     $wpdb->query("INSERT INTO {$wpdb->term_taxonomy} (term_id, taxonomy, description, parent, count) VALUES ('2', 'link_category', '', '0', '7')");
     // Now drop in some default links
     $wpdb->query("INSERT INTO {$wpdb->links} (link_url, link_name, link_category, link_rss, link_notes) VALUES ('http://codex.wordpress.org/', 'Documentation', 0, '', '');");
     $wpdb->query("INSERT INTO {$wpdb->term_relationships} (`object_id`, `term_taxonomy_id`) VALUES (1, 2)");
     $wpdb->query("INSERT INTO {$wpdb->links} (link_url, link_name, link_category, link_rss, link_notes) VALUES ('http://wordpress.org/development/', 'Development Blog', 0, 'http://wordpress.org/development/feed/', '');");
     $wpdb->query("INSERT INTO {$wpdb->term_relationships} (`object_id`, `term_taxonomy_id`) VALUES (2, 2)");
     $wpdb->query("INSERT INTO {$wpdb->links} (link_url, link_name, link_category, link_rss, link_notes) VALUES ('http://wordpress.org/extend/ideas/', 'Suggest Ideas', 0, '', '');");
     $wpdb->query("INSERT INTO {$wpdb->term_relationships} (`object_id`, `term_taxonomy_id`) VALUES (3, 2)");
     $wpdb->query("INSERT INTO {$wpdb->links} (link_url, link_name, link_category, link_rss, link_notes) VALUES ('http://wordpress.org/support/', 'Support Forum', 0, '', '');");
     $wpdb->query("INSERT INTO {$wpdb->term_relationships} (`object_id`, `term_taxonomy_id`) VALUES (4, 2)");
     $wpdb->query("INSERT INTO {$wpdb->links} (link_url, link_name, link_category, link_rss, link_notes) VALUES ('http://wordpress.org/extend/plugins/', 'Plugins', 0, '', '');");
     $wpdb->query("INSERT INTO {$wpdb->term_relationships} (`object_id`, `term_taxonomy_id`) VALUES (5, 2)");
     $wpdb->query("INSERT INTO {$wpdb->links} (link_url, link_name, link_category, link_rss, link_notes) VALUES ('http://wordpress.org/extend/themes/', 'Themes', 0, '', '');");
     $wpdb->query("INSERT INTO {$wpdb->term_relationships} (`object_id`, `term_taxonomy_id`) VALUES (6, 2)");
     $wpdb->query("INSERT INTO {$wpdb->links} (link_url, link_name, link_category, link_rss, link_notes) VALUES ('http://planet.wordpress.org/', 'WordPress Planet', 0, '', '');");
     $wpdb->query("INSERT INTO {$wpdb->term_relationships} (`object_id`, `term_taxonomy_id`) VALUES (7, 2)");
     // First post
     $now = date('Y-m-d H:i:s');
     $now_gmt = gmdate('Y-m-d H:i:s');
     $first_post_guid = get_option('home') . '/?p=1';
     $wpdb->query("INSERT INTO {$wpdb->posts} (post_author, post_date, post_date_gmt, post_content, post_excerpt, post_title, post_category, post_name, post_modified, post_modified_gmt, guid, comment_count, to_ping, pinged, post_content_filtered) VALUES ({$user_id}, '{$now}', '{$now_gmt}', '" . $wpdb->escape(__('Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!')) . "', '', '" . $wpdb->escape(__('Hello world!')) . "', '0', '" . $wpdb->escape(_c('hello-world|Default post slug')) . "', '{$now}', '{$now_gmt}', '{$first_post_guid}', '1', '', '', '')");
     $wpdb->query("INSERT INTO {$wpdb->term_relationships} (`object_id`, `term_taxonomy_id`) VALUES (1, 1)");
     // Default comment
     $wpdb->query("INSERT INTO {$wpdb->comments} (comment_post_ID, comment_author, comment_author_email, comment_author_url, comment_date, comment_date_gmt, comment_content) VALUES ('1', '" . $wpdb->escape(__('Mr WordPress')) . "', '', 'http://wordpress.org/', '{$now}', '{$now_gmt}', '" . $wpdb->escape(__('Hi, this is a comment.<br />To delete a comment, just log in and view the post&#039;s comments. There you will have the option to edit or delete them.')) . "')");
     // First Page
     $first_post_guid = get_option('home') . '/?page_id=2';
     $wpdb->query("INSERT INTO {$wpdb->posts} (post_author, post_date, post_date_gmt, post_content, post_excerpt, post_title, post_category, post_name, post_modified, post_modified_gmt, guid, post_status, post_type, to_ping, pinged, post_content_filtered) VALUES ({$user_id}, '{$now}', '{$now_gmt}', '" . $wpdb->escape(__('This is an example of a WordPress page, you could edit this to put information about yourself or your site so readers know where you are coming from. You can create as many pages like this one or sub-pages as you like and manage all of your content inside of WordPress.')) . "', '', '" . $wpdb->escape(__('About')) . "', '0', '" . $wpdb->escape(_c('about|Default page slug')) . "', '{$now}', '{$now_gmt}','{$first_post_guid}', 'publish', 'page', '', '', '')");
 }
开发者ID:alx,项目名称:blogsfera,代码行数:40,代码来源:upgrade.php

示例6: foreach

<?php 
            if ($comments) {
                ?>
<ol id="commentlist">
<?php 
                foreach ($comments as $comment) {
                    ?>
	<li id="comment-<?php 
                    comment_ID();
                    ?>
">
	<?php 
                    comment_text();
                    ?>
	<p><cite><?php 
                    comment_type(_c('Comment|noun'), __('Trackback'), __('Pingback'));
                    ?>
 <?php 
                    _e("by");
                    ?>
 <?php 
                    comment_author_link();
                    ?>
 &#8212; <?php 
                    comment_date();
                    ?>
 @ <a href="#comment-<?php 
                    comment_ID();
                    ?>
"><?php 
                    comment_time();
开发者ID:alvaropereyra,项目名称:shrekcms,代码行数:31,代码来源:comments-popup.php

示例7: unset

        }
        unset($users_of_blog);
        $current_role = false;
        $class = empty($role) ? ' class="current"' : '';
        $role_links[] = "<li><a href='users.php'{$class}>" . sprintf(__ngettext('All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $total_users), number_format_i18n($total_users)) . '</a>';
        foreach ($wp_roles->get_names() as $this_role => $name) {
            if (!isset($avail_roles[$this_role])) {
                continue;
            }
            $class = '';
            if ($this_role == $role) {
                $current_role = $role;
                $class = ' class="current"';
            }
            $name = translate_with_context($name);
            $name = sprintf(_c('%1$s <span class="count">(%2$s)</span>|user role with count'), $name, $avail_roles[$this_role]);
            $role_links[] = "<li><a href='users.php?role={$this_role}'{$class}>{$name}</a>";
        }
        echo implode(" |</li>\n", $role_links) . '</li>';
        unset($role_links);
        ?>
</ul>
</form>
</div>

<form class="search-form" action="" method="get">
<p class="search-box">
	<label class="hidden" for="user-search-input"><?php 
        _e('Search Users');
        ?>
:</label>
开发者ID:blowery,项目名称:wordpress,代码行数:31,代码来源:users.php

示例8: checked

   </label>
</p>
<p>
	<label>
<input name="selection" type="radio" value="<?php 
echo $structures[2];
?>
" class="tog" <?php 
checked($structures[2], $permalink_structure);
?>
 />
<?php 
_e('Numeric');
?>
<br /> <span> <?php 
echo _c('&raquo;|Used as a list bullet');
?>
 <code><?php 
echo get_option('home') . $prefix;
?>
/archives/123</code></span>
   </label>
</p>
<p>
<label>
<input name="selection" id="custom_selection" type="radio" value="custom" class="tog"
<?php 
if (!in_array($permalink_structure, $structures)) {
    ?>
checked="checked"
<?php 
开发者ID:helmonaut,项目名称:owb-mirror,代码行数:31,代码来源:options-permalink.php

示例9: statusAction

 /**
  * @Request({"status": "int", "ids": "int[]"}, csrf=true)
  * @Response("json")
  */
 public function statusAction($status, $ids = [])
 {
     foreach ($ids as $id) {
         if ($page = $this->pages->find($id) and $page->getStatus() != $status) {
             $page->setStatus($status);
             $this->pages->save($page);
         }
     }
     if ($status == Page::STATUS_PUBLISHED) {
         $message = _c('{0} No page published.|{1} Page published.|]1,Inf[ Pages published.', count($ids));
     } else {
         $message = _c('{0} No page unpublished.|{1} Page unpublished.|]1,Inf[ Pages unpublished.', count($ids));
     }
     return compact('message');
 }
开发者ID:amirkheirabadi,项目名称:pagekit,代码行数:19,代码来源:PageController.php

示例10: _e

<div id="current-theme">
<?php 
if ($ct->screenshot) {
    ?>
<img src="<?php 
    echo WP_CONTENT_URL . $ct->stylesheet_dir . '/' . $ct->screenshot;
    ?>
" alt="<?php 
    _e('Current theme preview');
    ?>
" />
<?php 
}
?>
<h3><?php 
printf(_c('%1$s %2$s by %3$s|1: theme title, 2: theme version, 3: theme author'), $ct->title, $ct->version, $ct->author);
?>
</h3>
<p class="description"><?php 
echo $ct->description;
?>
</p>
<?php 
if ($ct->tags) {
    ?>
<p><?php 
    _e('Tags:');
    ?>
 <?php 
    echo join(', ', $ct->tags);
    ?>
开发者ID:alx,项目名称:blogsfera,代码行数:31,代码来源:themes.php

示例11: wp_widget_control

/**
 * Meta widget used to display the control form for a widget.
 *
 * Called from dynamic_sidebar().
 *
 * @since unknown
 *
 * @param array $sidebar_args
 * @return array
 */
function wp_widget_control($sidebar_args)
{
    global $wp_registered_widgets, $wp_registered_widget_controls, $sidebars_widgets, $edit_widget;
    $widget_id = $sidebar_args['widget_id'];
    $sidebar_id = isset($sidebar_args['id']) ? $sidebar_args['id'] : false;
    $control = isset($wp_registered_widget_controls[$widget_id]) ? $wp_registered_widget_controls[$widget_id] : 0;
    $widget = $wp_registered_widgets[$widget_id];
    $key = $sidebar_id ? array_search($widget_id, $sidebars_widgets[$sidebar_id]) : 'no-key';
    // position of widget in sidebar
    $edit = -1 < $edit_widget && is_numeric($key) && $edit_widget === $key;
    // (bool) are we currently editing this widget
    $id_format = $widget['id'];
    if (!isset($sidebar_args['_show'])) {
        $sidebar_args['_show'] = '';
    }
    if (!isset($sidebar_args['_display'])) {
        $sidebar_args['_display'] = '';
    }
    // We aren't showing a widget control, we're outputing a template for a mult-widget control
    if ('all' == $sidebar_args['_show'] && 'template' == $sidebar_args['_display'] && isset($control['params'][0]['number'])) {
        // number == -1 implies a template where id numbers are replaced by a generic '%i%'
        $control['params'][0]['number'] = -1;
        // if given, id_base means widget id's should be constructed like {$id_base}-{$id_number}
        if (isset($control['id_base'])) {
            $id_format = $control['id_base'] . '-%i%';
        }
    }
    $widget_title = '';
    // We grab the normal widget output to find the widget's title
    if (('all' != $sidebar_args['_show'] || 'template' != $sidebar_args['_display']) && is_callable($widget['_callback'])) {
        ob_start();
        $args = func_get_args();
        call_user_func_array($widget['_callback'], $args);
        $widget_title = ob_get_clean();
        $widget_title = wp_widget_control_ob_filter($widget_title);
    }
    $wp_registered_widgets[$widget_id]['callback'] = $wp_registered_widgets[$widget_id]['_callback'];
    unset($wp_registered_widgets[$widget_id]['_callback']);
    if ($widget_title && $widget_title != $sidebar_args['widget_name']) {
        $widget_title = sprintf(_c('%1$s: %2$s|1: widget name, 2: widget title'), $sidebar_args['widget_name'], $widget_title);
    } else {
        $widget_title = wp_specialchars(strip_tags($sidebar_args['widget_name']));
    }
    $sidebar_args['_widget_title'] = $widget_title;
    if (empty($sidebar_args['_display']) || 'template' != $sidebar_args['_display']) {
        echo $sidebar_args['before_widget'];
    }
    ?>
		<div class="widget-top">
		<h4 class="widget-title"><span><?php 
    echo $widget_title;
    ?>
</span>

			<?php 
    if ($edit) {
        ?>

			<a class="widget-action widget-control-edit" href="<?php 
        echo clean_url(remove_query_arg(array('edit', 'key')));
        ?>
"><?php 
        _e('Cancel');
        ?>
</a>

			<?php 
    } else {
        ?>

			<a class="widget-action widget-control-edit" href="<?php 
        echo clean_url(add_query_arg(array('edit' => $id_format, 'key' => $key)));
        ?>
"><?php 
        _e('Edit');
        ?>
</a>

			<?php 
    }
    ?>

			<br class="clear" />

		</h4></div>

		<div class="widget-control"<?php 
    if ($edit) {
        echo ' style="display: block;"';
    }
//.........这里部分代码省略.........
开发者ID:SymbiSoft,项目名称:litprojects,代码行数:101,代码来源:widgets.php

示例12: WP_members_list_list

function WP_members_list_list()
{
    global $wp_roles, $getWP, $tern_wp_msg, $tern_wp_members_defaults, $current_user, $notice;
    get_currentuserinfo();
    $o = $getWP->getOption('tern_wp_members', $tern_wp_members_defaults);
    $wps = new WP_User_Search($_GET['query'], $_GET['userspage'], $_GET['role']);
    $paging_text = paginate_links(array('total' => ceil($wps->total_users_for_query / $wps->users_per_page), 'current' => $wps->page, 'base' => 'admin.php?page=members-list-edit-members-list&%_%', 'format' => 'userspage=%#%', 'add_args' => $args));
    if ($paging_text) {
        $paging_text = sprintf('<span class="displaying-num">' . __('Displaying %s&#8211;%s of %s') . '</span>%s', number_format_i18n(($wps->page - 1) * $wps->users_per_page + 1), number_format_i18n(min($wps->page * $wps->users_per_page, $wps->total_users_for_query)), number_format_i18n($wps->total_users_for_query), $paging_text);
    }
    ?>
	<div class="wrap">
		<div id="icon-users" class="icon32"><br /></div>
		<h2>Members List</h2>
		<?php 
    if (!empty($notice)) {
        ?>
<div id="notice" class="error"><p><?php 
        echo $notice;
        ?>
</p></div><?php 
    }
    ?>
		<p>Here you are able to select which of your members you'd like to show or hide in your members list. By default all members are showm.</p>
		<?php 
    if (!empty($tern_wp_msg)) {
        echo '<div id="message" class="updated fade"><p>' . $tern_wp_msg . '</p></div>';
    }
    ?>
		<div class="filter">
			<form id="list-filter" action="" method="get">
				<ul class="subsubsub">
					<?php 
    $l = array();
    $a = array();
    $u = get_users_of_blog();
    $t = count($u);
    foreach ((array) $u as $c) {
        $d = unserialize($c->meta_value);
        foreach ((array) $d as $e => $v) {
            if (!isset($a[$e])) {
                $a[$e] = 0;
            }
            $a[$e]++;
        }
    }
    unset($u);
    $current_role = false;
    $class = empty($role) ? ' class="current"' : '';
    $l[] = "<li><a href='admin.php?page=members-list-edit-members-list'{$class}>" . sprintf(__ngettext('All<span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $t), number_format_i18n($t)) . '</a>';
    foreach ($wp_roles->get_names() as $s => $name) {
        if (!isset($a[$s])) {
            continue;
        }
        $class = '';
        if ($s == $role) {
            $current_role = $role;
            $class = ' class="current"';
        }
        $name = translate_with_context($name);
        $name = sprintf(_c('%1$s <span class="count">(%2$s)</span>|user role with count'), $name, $a[$s]);
        $l[] = "<li><a href='admin.php?page=members-list-edit-members-list&role={$s}'{$class}>{$name}</a>";
    }
    echo implode(" |</li>\n", $l) . '</li>';
    unset($l);
    ?>
				</ul>
			</form>
		</div>
		<form class="search-form" action="" method="get">
			<p class="search-box">
				<label class="hidden" for="user-search-input">Search Users:</label>
				<input type="text" class="search-input" id="user-search-input" name="query" value="" />
				<input type="hidden" id="page" name="page" value="<?php 
    echo $_REQUEST['page'];
    ?>
" />
				<input type="submit" value="Search Users" class="button" />
			</p>
		</form>
		<form id="posts-filter" action="" method="get">
			<div class="tablenav">
				<?php 
    if ($wps->results_are_paged()) {
        ?>
					<div class="tablenav-pages"><?php 
        echo $paging_text;
        ?>
</div>
				<?php 
    }
    ?>
				<div class="alignleft actions">
					<select name="action">
						<option value="" selected="selected">Bulk Actions</option>
						<option value="show">Show</option>
						<option value="hide">Hide</option>
					</select>
					<input type="submit" value="Apply" name="doaction" id="doaction" class="button-secondary action" />
				</div>
//.........这里部分代码省略.........
开发者ID:oligoform,项目名称:WP-Members-Lists,代码行数:101,代码来源:list.php

示例13: elseif

    ?>
</div>
                  <?php 
    /* If this is a monthly archive */
} elseif (is_month()) {
    ?>
                    <div class="pagetitle"><?php 
    printf(_c('Archive for %s|Monthly archive page'), get_the_time(__('F, Y')));
    ?>
</div>
                  <?php 
    /* If this is a yearly archive */
} elseif (is_year()) {
    ?>
                    <div class="pagetitle"><?php 
    printf(_c('Archive for %s|Yearly archive page'), get_the_time(__('Y')));
    ?>
</div>
                  <?php 
    /* If this is an author archive */
} elseif (is_author()) {
    ?>
                    <div class="pagetitle"><?php 
    _e('Author Archive');
    ?>
</div>
                  <?php 
    /* If this is a paged archive */
} elseif (isset($_GET['paged']) && !empty($_GET['paged'])) {
    ?>
                    <div class="pagetitle"><?php 
开发者ID:runpeaceya,项目名称:Teachive_Theme,代码行数:31,代码来源:archive.php

示例14: printf

<?php

/**
 * Footer Template
 *
 * This file is loaded by footer.php and used for content inside the #footer div
 *
 * @package K2
 * @subpackage Templates
 */
?>

<?php 
printf(_c('Powered by %1$s Theme by %2$s templates from %3$s|1:WordPress, 2:K2', 'k2_domain'), '<a href="http://wordpress.org/">' . __('WordPress', 'k2_domain') . '</a>', '<a href="http://github.com/harryxu/ktwitt" title="A twitter like wordpress theme base on k2" target="_blank">KTwitt</a>', '<a href="http://getk2.com/" title="' . __('Loves you like a kitten.', 'k2_domain') . '">K2</a>');
?>
 | 
<?php 
printf(_c('%1$s and %2$s|1:Entries Feed, 2:Comments Feed', 'k2_domain'), '<a href="' . get_bloginfo('rss2_url') . '">' . __('Entries Feed', 'k2_domain') . '</a>', '<a href="' . get_bloginfo('comments_rss2_url') . '">' . __('Comments Feed', 'k2_domain') . '</a>');
开发者ID:harryxu,项目名称:ktwitt,代码行数:18,代码来源:k2-footer.php

示例15: touch_time

/**
 * {@internal Missing Short Description}}
 *
 * @since unknown
 *
 * @param unknown_type $edit
 * @param unknown_type $for_post
 * @param unknown_type $tab_index
 * @param unknown_type $multi
 */
function touch_time( $edit = 1, $for_post = 1, $tab_index = 0, $multi = 0 ) {
	global $wp_locale, $post, $comment;

	if ( $for_post )
		$edit = ( in_array($post->post_status, array('draft', 'pending') ) && (!$post->post_date || '0000-00-00 00:00:00' == $post->post_date ) ) ? false : true;

	$tab_index_attribute = '';
	if ( (int) $tab_index > 0 )
		$tab_index_attribute = " tabindex=\"$tab_index\"";

	// echo '<label for="timestamp" style="display: block;"><input type="checkbox" class="checkbox" name="edit_date" value="1" id="timestamp"'.$tab_index_attribute.' /> '.__( 'Edit timestamp' ).'</label><br />';

	$time_adj = time() + (get_option( 'gmt_offset' ) * 3600 );
	$post_date = ($for_post) ? $post->post_date : $comment->comment_date;
	$jj = ($edit) ? mysql2date( 'd', $post_date ) : gmdate( 'd', $time_adj );
	$mm = ($edit) ? mysql2date( 'm', $post_date ) : gmdate( 'm', $time_adj );
	$aa = ($edit) ? mysql2date( 'Y', $post_date ) : gmdate( 'Y', $time_adj );
	$hh = ($edit) ? mysql2date( 'H', $post_date ) : gmdate( 'H', $time_adj );
	$mn = ($edit) ? mysql2date( 'i', $post_date ) : gmdate( 'i', $time_adj );
	$ss = ($edit) ? mysql2date( 's', $post_date ) : gmdate( 's', $time_adj );

	$cur_jj = gmdate( 'd', $time_adj );
	$cur_mm = gmdate( 'm', $time_adj );
	$cur_aa = gmdate( 'Y', $time_adj );
	$cur_hh = gmdate( 'H', $time_adj );
	$cur_mn = gmdate( 'i', $time_adj );

	$month = "<select " . ( $multi ? '' : 'id="mm" ' ) . "name=\"mm\"$tab_index_attribute>\n";
	for ( $i = 1; $i < 13; $i = $i +1 ) {
		$month .= "\t\t\t" . '<option value="' . zeroise($i, 2) . '"';
		if ( $i == $mm )
			$month .= ' selected="selected"';
		$month .= '>' . $wp_locale->get_month_abbrev( $wp_locale->get_month( $i ) ) . "</option>\n";
	}
	$month .= '</select>';

	$day = '<input type="text" ' . ( $multi ? '' : 'id="jj" ' ) . 'name="jj" value="' . $jj . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" />';
	$year = '<input type="text" ' . ( $multi ? '' : 'id="aa" ' ) . 'name="aa" value="' . $aa . '" size="4" maxlength="5"' . $tab_index_attribute . ' autocomplete="off" />';
	$hour = '<input type="text" ' . ( $multi ? '' : 'id="hh" ' ) . 'name="hh" value="' . $hh . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" />';
	$minute = '<input type="text" ' . ( $multi ? '' : 'id="mn" ' ) . 'name="mn" value="' . $mn . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" />';
	printf(_c('%1$s%2$s, %3$s @ %4$s : %5$s|1: month input, 2: day input, 3: year input, 4: hour input, 5: minute input'), $month, $day, $year, $hour, $minute);

	echo '<input type="hidden" id="ss" name="ss" value="' . $ss . '" />';

	if ( $multi ) return;

	echo "\n\n";
	foreach ( array('mm', 'jj', 'aa', 'hh', 'mn') as $timeunit ) {
		echo '<input type="hidden" id="hidden_' . $timeunit . '" name="hidden_' . $timeunit . '" value="' . $$timeunit . '" />' . "\n";
		$cur_timeunit = 'cur_' . $timeunit;
		echo '<input type="hidden" id="'. $cur_timeunit . '" name="'. $cur_timeunit . '" value="' . $$cur_timeunit . '" />' . "\n";
	}
?>

<input type="hidden" id="ss" name="ss" value="<?php echo $ss ?>" size="2" maxlength="2" />

<p>
<a href="#edit_timestamp" class="save-timestamp hide-if-no-js button"><?php _e('OK'); ?></a>
<a href="#edit_timestamp" class="cancel-timestamp hide-if-no-js"><?php _e('Cancel'); ?></a>
</p>
<?php
}
开发者ID:staylor,项目名称:develop.svn.wordpress.org,代码行数:72,代码来源:template.php


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