本文整理汇总了PHP中get_author_name函数的典型用法代码示例。如果您正苦于以下问题:PHP get_author_name函数的具体用法?PHP get_author_name怎么用?PHP get_author_name使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_author_name函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: otf_author
function otf_author($option_key, $result, $ext)
{
if ($ext) {
$s = explode(':', $ext);
if (count($s) == 1) {
$type = $s[0];
}
}
switch ($type) {
case 'display':
$author = get_author_name($result->post_author);
break;
case 'full':
$auth = get_userdata($result->post_author);
$author = $auth->first_name . ' ' . $auth->last_name;
break;
case 'reverse':
$auth = get_userdata($result->post_author);
$author = $auth->last_name . ', ' . $auth->first_name;
break;
case 'first':
$auth = get_userdata($result->post_author);
$author = $auth->first_name;
break;
case 'last':
$auth = get_userdata($result->post_author);
$author = $auth->last_name;
break;
default:
$author = get_author_name($result->post_author);
}
return $author;
}
示例2: id_get_author_name
function id_get_author_name()
{
if (function_exists('get_the_author_meta')) {
return get_the_author_meta('display_name');
}
return get_author_name();
}
示例3: ipad_html
function ipad_html($post)
{
global $ml_html_banners_enable;
$ml_html_banners_enable = get_option("ml_html_banners_enable");
$prefiltered_html = ml_filters_get_filtered($post->post_content);
$prefiltered_html = str_replace("\n", "<p></p>", $prefiltered_html);
$html = str_get_html($prefiltered_html);
$img_tags = $html->find('img');
$iframe_tags = $html->find('iframe');
$object_tags = $html->find('object');
$embed_tags = $html->find('embed');
$tags = array_merge($img_tags, $iframe_tags, $object_tags, $embed_tags);
$scripts = $html->find('script');
//on center, with specific width and no height
foreach ($tags as $e) {
//no width or height
if (isset($e->width)) {
$e->width = null;
}
if (isset($e->height)) {
$e->height = null;
}
$e->style = "max-width:520px;margin-top:20px;margin-bottom:20px;";
if ($e->tag == "iframe" || $e->tag == "object" || $e->tag == "embed") {
//should be a video
$e->width = 500;
$e->height = 300;
}
//center
$e->outertext = "<center><div class=\"wp2android_media\">" . $e->outertext . "</div></center><p></p>";
}
foreach ($scripts as $s) {
$s->outertext = "";
}
//JAVASCRIPT INCLUDES
//HEAD
$header = "<head>" . $header_js;
$header .= "<meta name=\"viewport\" content=\"width=device-width; minimum-scale=1.0; maximum-scale=1.0;\" />";
$header .= "<link rel=\"StyleSheet\" href=\"" . plugin_dir_url(__FILE__) . "css/ipad.css\" type=\"text/css\" media=\"screen\">";
$header .= "<link rel=\"StyleSheet\" href=\"" . plugin_dir_url(__FILE__) . "css/ipad_portrait.css\" type=\"text/css\" media=\"screen\" id=\"orient_css\">";
$header .= ml_filters_header($post->postID);
$header .= "</head>";
$init_html = "<html manifest=\"" . plugin_dir_url(__FILE__ + "../") . "manifest.php\">" . $header;
$title = "<h1 class='title' align='left'>" . $post->post_title . "</h1>";
$author = get_author_name($post->post_author);
$text_author = "";
if (strcmp($author, "admin") != 0) {
if (strcmp($author, "") != 0) {
$text_author = " • " . get_author_name($post->post_author);
}
}
if (get_post_type($post->ID) != "page") {
$title .= "<p class='details'>" . mysql2date('F j Y', $post->post_date) . "" . $text_author . "</p><p> </p>";
}
$final_html = $init_html;
$final_html .= "<body><div id=\"content\">";
$final_html .= $spaces;
$final_html .= $title . $html->save() . $spaces . "<br/><br/><br/><br/><br/><br/><br/><br/></div></body></html>";
return $final_html;
}
示例4: iphone_html
function iphone_html($post)
{
global $ml_html_banners_enable;
$ml_html_banners_enable = get_option(base64_decode('bWxfaHRtbF9iYW5uZXJzX2VuYWJsZQ=='));
$prefiltered_html = ml_filters_get_filtered($post->post_content);
$prefiltered_html = str_replace(base64_decode('Cg=='), base64_decode('PHA+PC9wPg=='), $prefiltered_html);
$html = str_get_html($prefiltered_html);
if ($html == NULL) {
return $prefiltered_html;
}
$img_tags = $html->find(base64_decode('aW1n'));
$iframe_tags = $html->find(base64_decode('aWZyYW1l'));
$object_tags = $html->find(base64_decode('b2JqZWN0'));
$embed_tags = $html->find(base64_decode('ZW1iZWQ='));
$tags = array_merge($img_tags, $iframe_tags, $object_tags, $embed_tags);
$scripts = $html->find(base64_decode('c2NyaXB0'));
foreach ($tags as $e) {
if (isset($e->width)) {
$e->width = null;
}
if (isset($e->height)) {
$e->height = null;
}
$e->style = base64_decode('bWF4LXdpZHRoOjI4MHB4Ow==');
$e->outertext = base64_decode('PGNlbnRlcj48ZGl2IGNsYXNzPSJtb2JpbG91ZF9tZWRpYSI+') . $e->outertext . base64_decode('PC9kaXY+PC9jZW50ZXI+PHA+PC9wPg==');
}
foreach ($scripts as $s) {
$s->outertext = '';
}
$header = base64_decode('PGhlYWQ+') . $header_js;
$header .= base64_decode('PG1ldGEgbmFtZT0idmlld3BvcnQiIGNvbnRlbnQ9IndpZHRoPWRldmljZS13aWR0aDsgbWluaW11bS1zY2FsZT0xLjA7IG1heGltdW0tc2NhbGU9MS4wOyIgLz4=');
$header .= base64_decode('PGxpbmsgcmVsPSJTdHlsZVNoZWV0IiBocmVmPSI=') . plugin_dir_url(__FILE__) . base64_decode('Y3NzL2lwaG9uZS5jc3MiIHR5cGU9InRleHQvY3NzIiAgbWVkaWE9InNjcmVlbiI+');
$header .= base64_decode('PGxpbmsgcmVsPSJTdHlsZVNoZWV0IiBocmVmPSI=') . plugin_dir_url(__FILE__) . base64_decode('Y3NzL2lwaG9uZV9wb3J0cmFpdC5jc3MiIHR5cGU9InRleHQvY3NzIiAgbWVkaWE9InNjcmVlbiIgaWQ9Im9yaWVudF9jc3MiPg==');
$header .= ml_filters_header($post->postID);
$header .= base64_decode('PC9oZWFkPg==');
$init_html = base64_decode('PGh0bWwgbWFuaWZlc3Q9Ig==') . plugin_dir_url(__FILE__ + base64_decode('Li4v')) . base64_decode('bWFuaWZlc3QucGhwIj4=') . $header;
$title = base64_decode('PGgxIGFsaWduPSdsZWZ0Jz4=') . $post->post_title . base64_decode('PC9oMT4=');
$author = get_author_name($post->post_author);
$text_author = '';
if (strcmp($author, base64_decode('YWRtaW4=')) != 0) {
if (strcmp($author, '') != 0) {
$text_author = base64_decode('ICZidWxsOyA=') . get_author_name($post->post_author);
}
}
if (get_post_type($post->ID) != base64_decode('cGFnZQ==')) {
$title .= base64_decode('PHAgY2xhc3M9J2RldGFpbHMnPg==') . mysql2date(base64_decode('RiBqIFk='), $post->post_date) . '' . $text_author . base64_decode('PC9wPjxwPiZuYnNwOzwvcD4=');
}
$final_html = $init_html;
if ($ml_html_banners_enable) {
$final_html .= base64_decode('PGJvZHk+PGRpdiBpZD0iY29udGVudCIgc3R5bGU9Im1hcmdpbi10b3A6NjBweCI+');
$final_html .= $spaces;
} else {
$final_html .= base64_decode('PGJvZHk+PGRpdiBpZD0iY29udGVudCIgPg==');
}
$final_html .= $spaces . $title . $html->save() . $spaces . base64_decode('PGJyLz48YnIvPjxici8+PGJyLz48YnIvPjxici8+PGJyLz48YnIvPjwvZGl2PjwvYm9keT48L2h0bWw+');
return $final_html;
}
示例5: get_page_list
function get_page_list()
{
$cat = $_GET['cat'];
$page = $_GET['page'];
$posts_per_page = $_GET['posts_per_page'];
if (!is_null($cat) && $cat != 0 && !is_null($page)) {
$args = array("category__in" => array($cat), "paged" => $page, "posts_per_page" => $posts_per_page, "post_status" => "publish", 'post_type' => 'post', 'orderby' => 'post_date', 'order' => 'desc');
} else {
if (!is_null($cat) && $cat != 0 && is_null($page)) {
$args = array("category__in" => array($cat), "posts_per_page" => $posts_per_page, "post_status" => "publish", 'post_type' => 'post', 'orderby' => 'post_date', 'order' => 'desc');
} else {
if ((is_null($cat) || $cat == 0) && !is_null($page)) {
$args = array("paged" => $page, "posts_per_page" => $posts_per_page, "post_status" => "publish", 'post_type' => 'post', 'orderby' => 'post_date', 'order' => 'desc');
} else {
$args = array("posts_per_page" => $posts_per_page, "post_status" => "publish", 'post_type' => 'post', 'orderby' => 'post_date', 'order' => 'desc');
}
}
}
if (!is_null($cat)) {
$posts = get_posts('post_status=publish&numberposts=-1&category=' . $cat);
$count_total = count($posts);
} else {
$cat_case = get_category_by_slug('case');
$cat_interview = get_category_by_slug('interview');
$cat_personnel = get_category_by_slug('personnel');
$cat_special = get_category_by_slug('special-column');
$cat_news = get_category_by_slug('news');
$posts = get_posts('post_status=publish&numberposts=-1&category=' . $cat_case . ',' . $cat_interview . ',' . $cat_personnel . ',' . $cat_special . ',' . $cat_news);
$count_total = count($posts);
}
$the_query = new WP_Query($args);
$resultData = new resultData();
$resultList = array();
$resultData->count_total = $count_total;
while ($the_query->have_posts()) {
$the_query->the_post();
$post = new postData();
$post->title_plain = get_the_title();
$post->url = get_permalink();
$post->thumbnail = get_template_directory_uri() . "/timthumb.php?src=" . post_thumbnail_src() . "&h=168&w=224&zc=1";
$post->excerpt = get_the_excerpt();
$post->date = get_the_date('20y-m-d');
$post->author_name = get_author_name();
$post->views = getPostViews(get_the_ID());
$the_post_category = get_the_category(get_the_ID());
$post->category_name = $the_post_category[0]->cat_name;
$the_post_category = get_the_category(get_the_ID());
$catSlug = $the_post_category[0]->slug;
$post->category_slug = $catSlug;
$resultList[] = $post;
}
$resultData->posts = $resultList;
header("Content-type: application/json");
echo json_encode($resultData);
wp_reset_query();
die;
}
示例6: ipad_html
function ipad_html($post)
{
global $ml_html_banners_enable;
$ml_html_banners_enable = get_option(base64_decode('bWxfaHRtbF9iYW5uZXJzX2VuYWJsZQ=='));
$prefiltered_html = ml_filters_get_filtered($post->post_content);
$prefiltered_html = str_replace(base64_decode('Cg=='), base64_decode('PHA+PC9wPg=='), $prefiltered_html);
$html = str_get_html($prefiltered_html);
$img_tags = $html->find(base64_decode('aW1n'));
$iframe_tags = $html->find(base64_decode('aWZyYW1l'));
$object_tags = $html->find(base64_decode('b2JqZWN0'));
$embed_tags = $html->find(base64_decode('ZW1iZWQ='));
$tags = array_merge($img_tags, $iframe_tags, $object_tags, $embed_tags);
$scripts = $html->find(base64_decode('c2NyaXB0'));
foreach ($tags as $e) {
if (isset($e->width)) {
$e->width = null;
}
if (isset($e->height)) {
$e->height = null;
}
$e->style = base64_decode('bWF4LXdpZHRoOjUyMHB4O21hcmdpbi10b3A6MjBweDttYXJnaW4tYm90dG9tOjIwcHg7');
if ($e->tag == base64_decode('aWZyYW1l') || $e->tag == base64_decode('b2JqZWN0') || $e->tag == base64_decode('ZW1iZWQ=')) {
$e->width = 500;
$e->height = 300;
}
$e->outertext = base64_decode('PGNlbnRlcj48ZGl2IGNsYXNzPSJtb2JpbG91ZF9tZWRpYSI+') . $e->outertext . base64_decode('PC9kaXY+PC9jZW50ZXI+PHA+PC9wPg==');
}
foreach ($scripts as $s) {
$s->outertext = '';
}
$header = base64_decode('PGhlYWQ+') . $header_js;
$header .= base64_decode('PG1ldGEgbmFtZT0idmlld3BvcnQiIGNvbnRlbnQ9IndpZHRoPWRldmljZS13aWR0aDsgbWluaW11bS1zY2FsZT0xLjA7IG1heGltdW0tc2NhbGU9MS4wOyIgLz4=');
$header .= base64_decode('PGxpbmsgcmVsPSJTdHlsZVNoZWV0IiBocmVmPSI=') . plugin_dir_url(__FILE__) . base64_decode('Y3NzL2lwYWQuY3NzIiB0eXBlPSJ0ZXh0L2NzcyIgIG1lZGlhPSJzY3JlZW4iPg==');
$header .= base64_decode('PGxpbmsgcmVsPSJTdHlsZVNoZWV0IiBocmVmPSI=') . plugin_dir_url(__FILE__) . base64_decode('Y3NzL2lwYWRfcG9ydHJhaXQuY3NzIiB0eXBlPSJ0ZXh0L2NzcyIgIG1lZGlhPSJzY3JlZW4iIGlkPSJvcmllbnRfY3NzIj4=');
$header .= ml_filters_header($post->postID);
$header .= base64_decode('PC9oZWFkPg==');
$init_html = base64_decode('PGh0bWwgbWFuaWZlc3Q9Ig==') . plugin_dir_url(__FILE__ + base64_decode('Li4v')) . base64_decode('bWFuaWZlc3QucGhwIj4=') . $header;
$title = base64_decode('PGgxIGNsYXNzPSd0aXRsZScgYWxpZ249J2xlZnQnPg==') . $post->post_title . base64_decode('PC9oMT4=');
$author = get_author_name($post->post_author);
$text_author = '';
if (strcmp($author, base64_decode('YWRtaW4=')) != 0) {
if (strcmp($author, '') != 0) {
$text_author = base64_decode('ICZidWxsOyA=') . get_author_name($post->post_author);
}
}
if (get_post_type($post->ID) != base64_decode('cGFnZQ==')) {
$title .= base64_decode('PHAgY2xhc3M9J2RldGFpbHMnPg==') . mysql2date(base64_decode('RiBqIFk='), $post->post_date) . '' . $text_author . base64_decode('PC9wPjxwPiZuYnNwOzwvcD4=');
}
$final_html = $init_html;
$final_html .= base64_decode('PGJvZHk+PGRpdiBpZD0iY29udGVudCI+');
$final_html .= $spaces;
$final_html .= $title . $html->save() . $spaces . base64_decode('PGJyLz48YnIvPjxici8+PGJyLz48YnIvPjxici8+PGJyLz48YnIvPjwvZGl2PjwvYm9keT48L2h0bWw+');
return $final_html;
}
示例7: get_breadcrumbs
function get_breadcrumbs()
{
// $xoops_breadcrumbs[0] = array( 'name' => get_bloginfo('description') , 'url' => get_settings('home'));
$xoops_breadcrumbs[0] = array('name' => get_bloginfo('name'), 'url' => get_settings('home'));
$pagetitle = '';
if (is_category()) {
$this_cat = get_category($cat);
$p_count = 0;
while ($this_cat->parent) {
$this_cat = get_category($this_cat->parent);
$cat_parrent[$p_count] = array('name' => $this_cat->cat_name, 'url' => get_category_link($this_cat->cat_ID));
$p_count++;
}
for ($i = 1; $i <= $p_count; $i++) {
$xoops_breadcrumbs[$i] = $cat_parrent[$p_count - $i];
}
$xoops_breadcrumbs[$p_count + 1] = array('name' => single_cat_title('', false));
} elseif (is_day()) {
$xoops_breadcrumbs[1] = array('name' => get_the_time(__('F j, Y')));
} elseif (is_month()) {
$xoops_breadcrumbs[1] = array('name' => get_the_time(__('F, Y')));
} elseif (is_year()) {
$xoops_breadcrumbs[1] = array('name' => get_the_time('Y'));
} elseif (is_author()) {
$xoops_breadcrumbs[1] = array('name' => get_author_name(get_query_var('author')));
} elseif (is_single()) {
$xoops_breadcrumbs[1] = array('name' => single_post_title('', false));
} elseif (is_page()) {
$now_page = get_page($page_id);
$this_page = $now_page;
$p_count = 0;
while ($this_page->post_parent) {
$this_page = get_page($this_page->post_parent);
$page_parrent[$p_count] = array('name' => $this_page->post_title, 'url' => get_permalink($this_page->ID));
$p_count++;
}
for ($i = 1; $i <= $p_count; $i++) {
$xoops_breadcrumbs[$i] = $page_parrent[$p_count - $i];
}
$xoops_breadcrumbs[$p_count + 1] = array('name' => $now_page->post_title);
} elseif (is_search()) {
$xoops_breadcrumbs[1] = array('name' => $pagetitle);
} elseif (function_exists('is_tag')) {
if (is_tag()) {
$xoops_breadcrumbs[1] = array('name' => single_tag_title('', false));
}
}
return $xoops_breadcrumbs;
}
示例8: jmd_author
/**
* Provides access to an author's username and email address.
* Replaces the spaces in an author's real name with any character.
*
* @param array $atts
* @param string $atts['display'] 'email', 'name', 'username'
* @param bool $atts['lowercase'] Lowercases $display
* @param string $atts['separator'] Replace spaces in $display with any char.
* @param string $atts['username'] Username to base output on. Default:
* article author
*/
function jmd_author($atts)
{
global $thisarticle;
extract(lAtts(array('display' => 'username', 'lowercase' => 0, 'separator' => ' ', 'username' => $thisarticle['authorid']), $atts));
$out = $username;
switch ($display) {
case 'email':
$out = eE(safe_field("email", "txp_users", "name='{$username}'"));
break;
case 'name':
$out = get_author_name($username);
break;
default:
}
if ($lowercase == 1) {
$out = strtolower($out);
}
return str_replace(' ', $separator, $out);
}
示例9: list_post_revisions
function list_post_revisions($post)
{
if ($revisions = wp_get_post_revisions($post->ID)) {
$items = '';
$revision_id = valid_revision_id() ? $revision_id = $_GET['revision'] : $post->ID;
foreach ($revisions as $revision) {
$date = wp_post_revision_title($revision, 0);
$name = get_author_name($revision->post_author);
$query_string = get_query_string($revision);
$items .= "<li>";
if ($revision_id == $revision->ID) {
$items .= "{$date} by {$name} (<em>displayed above</em>)";
} else {
$items .= "<a href=\"{$query_string}\">{$date}</a> by {$name}";
}
$items .= "</li>";
}
return "<ul class='revision-list'>{$items}</ul>";
}
}
示例10: _e
_e("Posts By:", "bonestheme");
?>
</span>
<!-- google+ rel=me function -->
<?php
$curauth = get_query_var('author_name') ? get_user_by('slug', get_query_var('author_name')) : get_userdata(get_query_var('author'));
$google_profile = get_the_author_meta('google_profile', $curauth->ID);
if ($google_profile) {
echo '<a href="' . esc_url($google_profile) . '" rel="me">' . $curauth->display_name . '</a>';
?>
</a>
<?php
} else {
?>
<?php
echo get_author_name(get_query_var('author'));
?>
<?php
}
?>
</h1>
<?php
if (have_posts()) {
while (have_posts()) {
the_post();
?>
<article id="post-<?php
the_ID();
?>
示例11: thesis_default_archive_info
function thesis_default_archive_info()
{
echo "\t\t\t<div id=\"archive_info\">\n";
if (is_category()) {
?>
<p><?php
_e('From the category archives:', 'thesis');
?>
</p>
<h1><?php
single_cat_title();
?>
</h1>
<?php
} elseif (is_tag()) {
?>
<p><?php
_e('Posts tagged as:', 'thesis');
?>
</p>
<h1><?php
single_tag_title();
?>
</h1>
<?php
} elseif (is_author()) {
?>
<p><?php
_e('Posts by author:', 'thesis');
?>
</p>
<h1><?php
echo get_author_name(get_query_var('author'));
?>
</h1>
<?php
} elseif (is_day()) {
?>
<p><?php
_e('From the daily archives:', 'thesis');
?>
</p>
<h1><?php
the_time('l, F j, Y');
?>
</h1>
<?php
} elseif (is_month()) {
?>
<p><?php
_e('From the monthly archives:', 'thesis');
?>
</p>
<h1><?php
the_time('F Y');
?>
</h1>
<?php
} elseif (is_year()) {
?>
<p><?php
_e('From the yearly archives:', 'thesis');
?>
</p>
<h1><?php
the_time('Y');
?>
</h1>
<?php
} elseif (is_search()) {
?>
<p><?php
_e('You searched for:', 'thesis');
?>
</p>
<h1><?php
echo attribute_escape(get_search_query());
?>
</h1>
<?php
}
echo "\t\t\t</div>\n";
}
示例12: rss
function rss()
{
global $prefs, $thisarticle;
set_error_handler('feedErrorHandler');
ob_clean();
extract($prefs);
extract(doSlash(gpsa(array('limit', 'area'))));
// build filter criteria from a comma-separated list of sections and categories
$feed_filter_limit = get_pref('feed_filter_limit', 10);
$section = gps('section');
$category = gps('category');
if (!is_scalar($section) || !is_scalar($category)) {
txp_die('Not Found', 404);
}
$section = $section ? array_slice(array_unique(do_list($section)), 0, $feed_filter_limit) : array();
$category = $category ? array_slice(array_unique(do_list($category)), 0, $feed_filter_limit) : array();
$st = array();
foreach ($section as $s) {
$st[] = fetch_section_title($s);
}
$ct = array();
foreach ($category as $c) {
$ct[] = fetch_category_title($c);
}
$sitename .= $section ? ' - ' . join(' - ', $st) : '';
$sitename .= $category ? ' - ' . join(' - ', $ct) : '';
$dn = explode('/', $siteurl);
$mail_or_domain = $use_mail_on_feeds_id ? eE($blog_mail_uid) : $dn[0];
// feed header
$out[] = tag('http://textpattern.com/?v=' . $version, 'generator');
$out[] = tag(doSpecial($sitename), 'title');
$out[] = tag(hu, 'link');
$out[] = '<atom:link href="' . pagelinkurl(array('rss' => 1, 'area' => $area, 'section' => $section, 'category' => $category, 'limit' => $limit)) . '" rel="self" type="application/rss+xml" />';
$out[] = tag(doSpecial($site_slogan), 'description');
$last = fetch('unix_timestamp(val)', 'txp_prefs', 'name', 'lastmod');
$out[] = tag(safe_strftime('rfc822', $last), 'pubDate');
$out[] = callback_event('rss_head');
// feed items
$articles = array();
$section = doSlash($section);
$category = doSlash($category);
if (!$area or $area == 'article') {
$sfilter = !empty($section) ? "and Section in ('" . join("','", $section) . "')" : '';
$cfilter = !empty($category) ? "and (Category1 in ('" . join("','", $category) . "') or Category2 in ('" . join("','", $category) . "'))" : '';
$limit = $limit ? $limit : $rss_how_many;
$limit = intval(min($limit, max(100, $rss_how_many)));
$frs = safe_column("name", "txp_section", "in_rss != '1'");
if ($frs) {
foreach ($frs as $f) {
$query[] = "and Section != '" . doSlash($f) . "'";
}
}
$query[] = $sfilter;
$query[] = $cfilter;
$expired = $publish_expired_articles ? '' : ' and (now() <= Expires or Expires = ' . NULLDATETIME . ') ';
$rs = safe_rows_start("*, unix_timestamp(Posted) as uPosted, unix_timestamp(LastMod) as uLastMod, unix_timestamp(Expires) as uExpires, ID as thisid", "textpattern", "Status = 4 " . join(' ', $query) . "and Posted < now()" . $expired . "order by Posted desc limit {$limit}");
if ($rs) {
while ($a = nextRow($rs)) {
extract($a);
populateArticleData($a);
$cb = callback_event('rss_entry');
$a['posted'] = $uPosted;
$permlink = permlinkurl($a);
$summary = trim(replace_relative_urls(parse($thisarticle['excerpt']), $permlink));
$content = trim(replace_relative_urls(parse($thisarticle['body']), $permlink));
if ($syndicate_body_or_excerpt) {
# short feed: use body as summary if there's no excerpt
if (!trim($summary)) {
$summary = $content;
}
$content = '';
}
if ($show_comment_count_in_feed) {
$count = $comments_count > 0 ? ' [' . $comments_count . ']' : '';
} else {
$count = '';
}
$Title = escape_title(strip_tags($Title)) . $count;
$thisauthor = get_author_name($AuthorID);
$item = tag($Title, 'title') . n . (trim($summary) ? tag(n . escape_cdata($summary) . n, 'description') . n : '') . (trim($content) ? tag(n . escape_cdata($content) . n, 'content:encoded') . n : '') . tag($permlink, 'link') . n . tag(safe_strftime('rfc822', $a['posted']), 'pubDate') . n . tag(htmlspecialchars($thisauthor), 'dc:creator') . n . tag('tag:' . $mail_or_domain . ',' . $feed_time . ':' . $blog_uid . '/' . $uid, 'guid', ' isPermaLink="false"') . n . $cb;
$articles[$ID] = tag($item, 'item');
$etags[$ID] = strtoupper(dechex(crc32($articles[$ID])));
$dates[$ID] = $uPosted;
}
}
} elseif ($area == 'link') {
$cfilter = $category ? "category in ('" . join("','", $category) . "')" : '1';
$limit = $limit ? $limit : $rss_how_many;
$limit = intval(min($limit, max(100, $rss_how_many)));
$rs = safe_rows_start("*, unix_timestamp(date) as uDate", "txp_link", "{$cfilter} order by date desc limit {$limit}");
if ($rs) {
while ($a = nextRow($rs)) {
extract($a);
$item = tag(doSpecial($linkname), 'title') . n . tag(doSpecial($description), 'description') . n . tag(doSpecial($url), 'link') . n . tag(safe_strftime('rfc822', $uDate), 'pubDate');
$articles[$id] = tag($item, 'item');
$etags[$id] = strtoupper(dechex(crc32($articles[$id])));
$dates[$id] = $date;
}
}
}
//.........这里部分代码省略.........
示例13: the_post
the_post();
?>
<h1 class="page-title"><?php
printf(__('Posts by: <a href="%s">%s</a>', 'carrington-blog'), get_author_posts_url($authordata->ID), get_author_name($authordata->ID));
?>
</h1>
<?php
if (!empty($bio)) {
?>
<div class="description author-bio">
<h2><?php
printf(__('About %s', 'carrington-blog'), get_author_name($authordata->ID));
?>
</h2>
<?php
echo cfct_basic_content_formatting(get_the_author_description());
?>
</div>
<?php
}
break;
}
}
rewind_posts();
示例14: file_list
function file_list($message = '')
{
global $file_base_path, $file_statuses, $file_list_pageby, $txp_user;
pagetop(gTxt('file'), $message);
extract(gpsa(array('page', 'sort', 'dir', 'crit', 'search_method')));
if ($sort === '') {
$sort = get_pref('file_sort_column', 'filename');
}
if ($dir === '') {
$dir = get_pref('file_sort_dir', 'asc');
}
$dir = $dir == 'desc' ? 'desc' : 'asc';
if (!is_dir($file_base_path) or !is_writeable($file_base_path)) {
echo graf(gTxt('file_dir_not_writeable', array('{filedir}' => $file_base_path)), ' id="warning"');
} elseif (has_privs('file.edit.own')) {
$existing_files = get_filenames();
if (count($existing_files) > 0) {
echo form(eInput('file') . sInput('file_create') . graf(gTxt('existing_file') . sp . selectInput('filename', $existing_files, '', 1) . sp . fInput('submit', '', gTxt('Create'), 'smallerbox')), 'text-align: center;');
}
echo file_upload_form(gTxt('upload_file'), 'upload', 'file_insert');
}
switch ($sort) {
case 'id':
$sort_sql = 'id ' . $dir;
break;
case 'description':
$sort_sql = 'description ' . $dir . ', filename desc';
break;
case 'category':
$sort_sql = 'category ' . $dir . ', filename desc';
break;
case 'downloads':
$sort_sql = 'downloads ' . $dir . ', filename desc';
break;
case 'author':
$sort_sql = 'author ' . $dir . ', id asc';
break;
default:
$sort = 'filename';
$sort_sql = 'filename ' . $dir;
break;
}
set_pref('file_sort_column', $sort, 'file', 2, '', 0, PREF_PRIVATE);
set_pref('file_sort_dir', $dir, 'file', 2, '', 0, PREF_PRIVATE);
$switch_dir = $dir == 'desc' ? 'asc' : 'desc';
$criteria = 1;
if ($search_method and $crit) {
$crit_escaped = doSlash($crit);
$critsql = array('id' => "ID in ('" . join("','", do_list($crit_escaped)) . "')", 'filename' => "filename like '%{$crit_escaped}%'", 'description' => "description like '%{$crit_escaped}%'", 'category' => "category like '%{$crit_escaped}%'", 'author' => "author like '%{$crit_escaped}%'");
if (array_key_exists($search_method, $critsql)) {
$criteria = $critsql[$search_method];
$limit = 500;
} else {
$search_method = '';
$crit = '';
}
} else {
$search_method = '';
$crit = '';
}
$total = safe_count('txp_file', "{$criteria}");
if ($total < 1) {
if ($criteria != 1) {
echo n . file_search_form($crit, $search_method) . n . graf(gTxt('no_results_found'), ' class="indicator"');
} else {
echo n . graf(gTxt('no_files_recorded'), ' class="indicator"');
}
return;
}
$limit = max($file_list_pageby, 15);
list($page, $offset, $numPages) = pager($total, $limit, $page);
echo file_search_form($crit, $search_method);
$rs = safe_rows_start('*', 'txp_file', "{$criteria} order by {$sort_sql} limit {$offset}, {$limit}");
if ($rs) {
$show_authors = !has_single_author('txp_file');
echo '<form name="longform" method="post" action="index.php" onsubmit="return verify(\'' . gTxt('are_you_sure') . '\')">' . startTable('list') . tr(column_head('ID', 'id', 'file', true, $switch_dir, $crit, $search_method, 'id' == $sort ? $dir : '') . hCell() . column_head('file_name', 'filename', 'file', true, $switch_dir, $crit, $search_method, 'filename' == $sort ? $dir : '') . column_head('description', 'description', 'file', true, $switch_dir, $crit, $search_method, 'description' == $sort ? $dir : '') . column_head('file_category', 'category', 'file', true, $switch_dir, $crit, $search_method, 'category' == $sort ? $dir : '') . hCell(gTxt('tags')) . hCell(gTxt('status')) . hCell(gTxt('condition')) . column_head('downloads', 'downloads', 'file', true, $switch_dir, $crit, $search_method, 'downloads' == $sort ? $dir : '') . ($show_authors ? column_head('author', 'author', 'file', true, $switch_dir, $crit, $search_method, 'author' == $sort ? $dir : '') : '') . hCell());
while ($a = nextRow($rs)) {
extract($a);
$edit_url = '?event=file' . a . 'step=file_edit' . a . 'id=' . $id . a . 'sort=' . $sort . a . 'dir=' . $dir . a . 'page=' . $page . a . 'search_method=' . $search_method . a . 'crit=' . $crit;
$file_exists = file_exists(build_file_path($file_base_path, $filename));
$download_link = $file_exists ? '<li>' . make_download_link($id, '', $filename) . '</li>' : '';
$category = $category ? '<span title="' . htmlspecialchars(fetch_category_title($category, 'file')) . '">' . $category . '</span>' : '';
$tag_url = '?event=tag' . a . 'tag_name=file_download_link' . a . 'id=' . $id . a . 'description=' . urlencode($description) . a . 'filename=' . urlencode($filename);
$condition = '<span class="';
$condition .= $file_exists ? 'ok' : 'not-ok';
$condition .= '">';
$condition .= $file_exists ? gTxt('file_status_ok') : gTxt('file_status_missing');
$condition .= '</span>';
$can_edit = has_privs('file.edit') || $author == $txp_user && has_privs('file.edit.own');
echo tr(n . td($id) . td('<ul>' . ($can_edit ? '<li>' . href(gTxt('edit'), $edit_url) . '</li>' : '') . $download_link . '</ul>', 65) . td($can_edit ? href(htmlspecialchars($filename), $edit_url) : htmlspecialchars($filename), 125) . td(htmlspecialchars($description), 150) . td($category, 90) . td(n . '<ul>' . n . t . '<li><a target="_blank" href="' . $tag_url . a . 'type=textile" onclick="popWin(this.href, 400, 250); return false;">Textile</a></li>' . n . t . '<li><a target="_blank" href="' . $tag_url . a . 'type=textpattern" onclick="popWin(this.href, 400, 250); return false;">Textpattern</a></li>' . n . t . '<li><a target="_blank" href="' . $tag_url . a . 'type=xhtml" onclick="popWin(this.href, 400, 250); return false;">XHTML</a></li>' . n . '</ul>', 75) . td(in_array($status, array_keys($file_statuses)) ? $file_statuses[$status] : '<span class="not-ok">' . gTxt('none') . '</span>', 45) . td($condition, 45) . td($downloads == '0' ? gTxt('none') : $downloads, 25) . ($show_authors ? td('<span title="' . htmlspecialchars(get_author_name($author)) . '">' . htmlspecialchars($author) . '</span>') : '') . td($can_edit ? fInput('checkbox', 'selected[]', $id) : ' ', 10));
}
echo tr(tda(select_buttons() . file_multiedit_form($page, $sort, $dir, $crit, $search_method), ' colspan="' . ($show_authors ? '11' : '10') . '" style="text-align: right; border: none;"')) . endTable() . '</form>' . nav_form('file', $page, $numPages, $sort, $dir, $crit, $search_method, $total, $limit) . pageby_form('file', $file_list_pageby);
}
}
示例15: feed_links_extra
/**
* Display the links to the extra feeds such as category feeds.
*
* @since 2.8.0
*
* @param array $args Optional arguments.
*/
function feed_links_extra($args)
{
$defaults = array('seperator' => _c('»|Seperator character for feed titles in theme head'), 'singletitle' => __('%1$s %2$s %3$s Comments Feed'), 'cattitle' => __('%1$s %2$s %3$s Category Feed'), 'tagtitle' => __('%1$s %2$s %3$s Tag Feed'), 'authortitle' => __('%1$s %2$s Posts by %3$s Feed'), 'searchtitle' => __('%1$s %2$s Search Results for "%3$s" Feed'));
$args = wp_parse_args($args, $defaults);
if (is_single() || is_page()) {
$post =& get_post($id = 0);
if (comments_open() || pings_open() || $post->comment_count > 0) {
$title = attribute_escape(sprintf($args['singletitle'], get_bloginfo('name'), $args['seperator'], wp_specialchars(get_the_title())));
$href = get_post_comments_feed_link($post->ID);
}
} elseif (is_category()) {
$cat_id = intval(get_query_var('cat'));
$title = attribute_escape(sprintf($args['cattitle'], get_bloginfo('name'), $args['seperator'], get_cat_name($cat_id)));
$href = get_category_feed_link($cat_id);
} elseif (is_tag()) {
$tag_id = intval(get_query_var('tag_id'));
$tag = get_tag($tag_id);
$title = attribute_escape(sprintf($args['tagtitle'], get_bloginfo('name'), $args['seperator'], $tag->name));
$href = get_tag_feed_link($tag_id);
} elseif (is_author()) {
$author_id = intval(get_query_var('author'));
$title = attribute_escape(sprintf($args['authortitle'], get_bloginfo('name'), $args['seperator'], get_author_name($author_id)));
$href = get_author_feed_link($author_id);
} elseif (is_search()) {
$title = attribute_escape(sprintf($args['searchtitle'], get_bloginfo('name'), $args['seperator'], get_search_query()));
$href = get_search_feed_link();
}
if (isset($title) && isset($href)) {
echo '<link rel="alternate" type="' . feed_content_type() . '" title="' . $title . '" href="' . $href . '" />' . "\n";
}
}