本文整理汇总了PHP中get_author函数的典型用法代码示例。如果您正苦于以下问题:PHP get_author函数的具体用法?PHP get_author怎么用?PHP get_author使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_author函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: pd_is_archived
function pd_is_archived($post_id, $field = NULL)
{
// check if there are any custom fields
$meta = get_post_custom($post_id);
if ($meta) {
if (isset($meta['_cp_id'])) {
$meta['_cp_id'] = get_cp_id($meta['_cp_id']);
}
if (isset($meta['_author'])) {
$meta['_author'] = get_author($meta['_author']);
}
if (isset($meta['_author_position'])) {
$meta['_author_position'] = get_author_position($meta['_author_position']);
}
if (isset($meta['_image1'])) {
$meta['_image1'] = get_image($meta['_image1']);
}
if (isset($meta['_legacy_id'])) {
$meta['_legacy_id'] = get_legacy_id($meta['_legacy_id']);
}
if ($field == '_image1') {
return $meta['_image1'];
}
if ($field == '_author') {
if (isset($meta['_author'])) {
return $meta['_author'];
}
return false;
}
return $meta;
}
// the article is not from the archives
return false;
}
示例2: get_form_security
echo get_form_security();
echo <<<html
</form>
html;
$file = get_ordered_toc();
$unvalidated_list = array();
$articles = array();
foreach ($file as $value) {
$toc = get_line_data('news_toc', $value);
if (!file_exists(FNEWS_ROOT_PATH . 'news/news.' . $toc['news_id'] . '.php')) {
continue;
}
$news_file = file(FNEWS_ROOT_PATH . 'news/news.' . $toc['news_id'] . '.php');
array_shift($news_file);
$article = get_line_data('news', $news_file[0]);
$writer = get_author($toc['author']);
$articles[] = array('numcomments' => $article['numcomments'], 'news_id' => $toc['news_id'], 'headline' => $toc['headline'], 'writer' => $writer === false ? $toc['author'] : $writer['nick'], 'date' => date('Y-m-d H:i:s T', $toc['timestamp']));
if (sizeof($news_file) <= 1) {
// There are no comments (<= 1 because we still count the news line) at all.
continue;
}
// Get a list of unvalidated comments.
array_shift($news_file);
$comments = array();
foreach ($news_file as $v2) {
$comment = get_line_data('comments', $v2);
if ($comment['validated'] == 0) {
$comments[] = $comment;
}
}
if (sizeof($comments) > 0) {
示例3: render_teaser
?>
">
<h3><?php
echo $opn->title;
?>
</h3>
</a>
<p>
<?php
echo render_teaser($opn, 90);
?>
...
</p>
<?php
$a = get_author($opn);
?>
<div class="author">
<img class="a-img" src="<?php
echo $a->image;
?>
" alt="">
<div class="a-info">
<div class="a-name">
<a href="<?php
echo render_href($a->nid);
?>
">
<?php
echo $a->title;
示例4: get_line_data
$toc = get_line_data('news_toc', $newsdata);
$categories = explode(',', $toc['categories']);
if ($fn_category !== 0 && !in_array($fn_category, $categories)) {
continue;
}
if (!file_exists(FNEWS_ROOT_PATH . 'news/news.' . $toc['news_id'] . '.php')) {
continue;
}
if ($count > 25) {
break;
}
++$count;
$news_file = file(FNEWS_ROOT_PATH . 'news/news.' . $toc['news_id'] . '.php');
$article = get_line_data('news', $news_file[1]);
$news_info = parse_news_to_view($article, $settings);
$writer = get_author($article['author']);
$news_info['date'] = date('r', $article['timestamp']);
$author = $news_info['email'] ? "\n\t\t" . '<author>' . $news_info['email'] . ' (' . htmlspecialchars($writer['nick']) . ')</author>' . "\n" : '';
$description = $news_info['description'];
if ($news_info['description'] == '') {
$lines = explode("\n", $news_info['news']);
$description = array_shift($lines);
}
?>
<item>
<title><?php
echo htmlspecialchars($news_info['subject']);
?>
</title>
<link><?php
echo $furl . '/fullnews.php?fn_id=' . $article['news_id'];
示例5: header
if (!$database->has("authors", array("id" => $author_id))) {
header("Location: " . main_url . "/404");
exit;
}
foreach ($vars as $var) {
if (strpos($var, 'p:') === 0) {
$page_no_var = $var;
//get the current Page from URL
}
}
//--PAGINATION--//
$perpage = poems_by_author_per_page;
$paginate = paginate($perpage, $page_no_var);
$next_number = $paginate['next_number'];
//--get author informations--//
$author = get_author($database, $author_id);
$tpl->author_info = $author;
//--increment of author views--//
$update_poet = author_view_increment($database, $author_id);
//--get all poems of author--//
$page_poems = get_author_poems($database, $author_id, ['LIMIT' => array($next_number, $perpage), 'COUNT' => true]);
$tpl->page_poems = $page_poems['data'];
$count_records = $page_poems['count'];
$total_pages = ceil($count_records / $perpage);
$current_count = count($page_poems['data']);
$page_array = array();
$page_array['current_page'] = $paginate['page_no'];
$page_array['total_pages'] = $total_pages;
$page_array['total_records'] = $count_records;
$page_array['current_count'] = $current_count;
$page_array['param_vars'] = $vars;
示例6: base_path
echo base_path() . path_to_theme();
?>
/temp/side-ad.jpg" alt="">
</div>
</div>
<div class="second">
<div class="w-full one-cell pagediv">
<div class="pageitem">
<?php
foreach ($nodes as $key => $nod) {
?>
<article>
<?php
$a = get_author($nodes[$key]);
?>
<div class="author">
<a href="<?php
echo render_href($a->nid);
?>
">
<img class="a-img" src="<?php
echo $a->image;
?>
" alt="">
</a>
<div class="a-info">
<div class="a-name">
<a href="<?php
示例7: get_articles
<div id="instafeed"></div>
</section>
</aside>
<article class="article-actualite col-10 col-m-5 col-offset-1">
<h2 class="titre-blog">Carnet de voyage</h2>
<?php
$articles = get_articles();
foreach ($articles as $article) {
$thumbnail = get_thumbnail($article['ID']);
$author = get_author($article['post_author']);
?>
<section class="article-blog col-m-12">
<div class="row">
<div class="thumbnail col-m-4">
<?php
if ($thumbnail['guid']) {
?>
<img src="<?php
echo $thumbnail['guid'];
示例8: themearticle
function themearticle($aid, $informant, $datetime, $title, $thetext, $topic, $topicname, $topicimage, $topictext)
{
global $admin, $sid, $tipath, $mainindex;
$posted = _POSTEDON . " {$datetime} " . _BY . " " . get_author($aid);
if ($notes != "") {
$notes = "<br><br><b>" . _NOTE . "</b> <i>{$notes}</i>\n";
}
if ($aid == $informant) {
$content = "{$thetext}{$notes}\n";
} else {
if ($informant != "") {
$content = '<a href="' . getlink("Your_Account&op=userinfo&username={$informant}") . "\">{$informant}</a> ";
} else {
$content = "{$anonymous} ";
}
$content .= _WRITES . " <i>\"{$thetext}\"</i>{$notes}\n";
}
$thefile = implode("", file("themes/MP3Tunes/story_page.html"));
$thefile = addslashes($thefile);
$thefile = "\$r_file=\"" . $thefile . "\";";
eval($thefile);
print $r_file;
}
示例9: foreach
$tpl->saved_poems = $get_saved_poems;
}
//--get saved poets--//
if (!empty($get_saved_poets)) {
foreach ($get_saved_poets as $k => $poet_id) {
$get_saved_poets[$k] = get_author($database, $poet_id);
}
$tpl->saved_poets = $get_saved_poets;
}
//--get saved users--//
if (!empty($get_saved_user)) {
foreach ($get_saved_user as $k => $poet_id) {
$data = get_user_info($database, $poet_id);
$get_saved_user[$k] = $data[0];
}
$tpl->saved_users = $get_saved_user;
}
//--get saved poets--//
if (!empty($get_user_added_function)) {
foreach ($get_user_added_function as $k => $poet_id) {
$get_saved_poets[$k] = get_author($database, $poet_id);
}
$tpl->saved_poets = $get_saved_poets;
}
$get_active_function = get_function($database, $user_id);
$get_inactive_function = get_inactive_function($database, $user_id);
$tpl->my_function = array_merge_recursive($get_active_function, $get_inactive_function);
} else {
header("location: " . main_url);
}
echo $tpl->render("themes/site/" . theme_name . "/html/mystuff.php");
示例10: render_teaser
?>
">
<h3><?php
echo $nodes[$i]->title;
?>
</h3>
</a>
<p>
<?php
echo render_teaser($nodes[$i], 90);
?>
...
</p>
<?php
$a = get_author($nodes[$i]);
?>
<div class="author">
<img class="a-img" src="<?php
echo $a->image;
?>
" alt="">
<div class="a-info">
<div class="a-name">
<?php
echo $a->title;
?>
</div>
<div class="a-title">
<?php
示例11: get_date
//$errors .= '<hr><font size="3">'. htmlspecialchars($wgs) .'</font><hr> ';
//$errors .= '<font size="3">'. $wgses[0] .$wgses[1] .$wgses[2] .'</font><hr>';
//$errors .= '<font size="3">lat='. $lat . ' lon=' .$lon .'</font><hr>';
}
// время
if (!$geo_date) {
get_date($line);
if ($date_t) {
//$errors .= '<font size="3">'. $date_t .'</font><hr>';
$geo_date = $date_t;
}
$date_t = '';
}
if ($first_line == true) {
// автор
get_author($line);
$author = substr($author, 1, -1);
//$errors .= '<font size="3">'. $author .'</font><hr>';
// название
get_name($line);
//$errors .= '<font size="3">'. $nameg .'</font><hr>';
// тип
get_type($line);
//$errors .= '<font size="3">'. $type .'</font><hr>';
}
$first_line = false;
find_me('<body>', $line);
//если результат, то данные из следующей линии
$first_line = $find_res == false ? false : true;
/*$geo_class =
示例12: implode
$h[4] = "";
// remove the PHP-statement part because of troubles with ' and "
$attrib_h = implode("|", $h);
break;
default:
$bgcolor = "dedede";
$act = true;
break;
}
start_row("style='background-color:#{$bgcolor};'");
echo "<td style='width;0px;display:none;'>\n";
start_form(false, false, "repgen_select.php", "edit" . $f["id"]);
echo "</td>\n";
label_cell(get_name($attrib_h), "nowrap");
label_cell(get_short($attrib_h));
label_cell(get_author($attrib_h));
label_cell(get_create_date($attrib_h) . hidden("id", $f["id"], false) . hidden("attr", $attrib_h, false));
if ($act) {
label_cell("<input type=\"button\" class=\"inputsubmit\" name=\"run\" value=\"" . _("Run") . "\" \n \t\t\tonclick=\"javascript:displayReport(document.edit, " . $f["id"] . ");\"");
} else {
label_cell("");
}
submit_cells("change", CHANGE);
submit_cells("delete", DELETE);
submit_cells("copy", COPY);
echo "<td style='width;0px;display:none;'>\n";
end_form();
echo "</td>\n";
end_row();
}
end_form();
示例13: while
?>
<?php
while (posts()) {
?>
<article>
<header>
<h1><a href="<?php
echo article_url();
?>
"><?php
echo article_title();
?>
</a></h1>
<div class="meta">
<?php
echo get_author();
?>
</div>
</header>
<?php
if (article_description()) {
echo "<p>" . article_description() . "</p>";
} else {
echo split_content(article_markdown());
}
?>
<p><a href="<?php
echo article_url();
?>
示例14: reading_list
function reading_list(){
// step 0 : delete feeds from db
//1. connect to BDD
$pdo_options[PDO::ATTR_ERRMODE] = PDO::ERRMODE_EXCEPTION;
$bdd = new PDO(DB_PMBA, DB_USER, DB_PWD);
$bdd->exec("SET CHARACTER SET utf8");
$count = 0;
// 2. clean
$bdd->exec('DELETE FROM reading_list');
$url = "http://personalmba.com/best-business-books/";
$pmba_url = "http://personalmba.com";
$html = connect_to($url,$book);
$html = str_get_html($html);
// 2. get category
$h2 = $html->find('h2[id]');
foreach($h2 as $category){
$en_category = $category->innertext;
$list_books = $category->next_sibling()->find('li');
foreach($list_books as $book){
//3. info
$title = $book->find('a',0)->plaintext;
$amazon_com_url = $pmba_url.$book->find('a',0)->href;
$author = $book->plaintext;
$id = get_id($author);
$author = get_author($author);
$en_review = $pmba_url.$book->find('a',1)->href;
$fr_category = "";
$fr_review = "";
$amazon_best_url = "";
$amazon_price = "";
$cheapest_price = "";
$ship_price = "";
$ISBN = "";
// step 4 : insert in db
$request = 'INSERT INTO reading_list VALUES(\''.$id.'\', \''.$title.'\', \''.$author.'\', \''.$en_category.'\', \''.$fr_category.
'\', \''.$en_review.'\', \''.$fr_review.'\', \''.$amazon_com_url.'\', \''.$amazon_best_url.'\', \''.$amazon_price.'\', \''.$cheapest_price.'\', \''.$ship_price.'\', \''.$ISBN.'\')';
$bdd->exec($request);
echo $id."\n";
}
}
$html->clear();
unset($html);
// and now we're done; close it
$bdd = null;
}
示例15: parse_news_to_view
/**
* Parses news text or news data so that it is displayed along with its template.
* @param string|array $news_string News text to parse, or the array from the required news file.
* @param array $settings Override settings when parsing.
* @return Parsed news text
*/
function parse_news_to_view($news_string, $settings = array())
{
assert(is_array($settings));
global $fsnw, $wfpost, $ht, $smilies, $bb, $stfpop, $compop, $furl, $fullnewsh, $fullnewsw, $fullnewss, $fullnewsz, $fslink, $datefor, $stflink, $stfheight, $stfwidth, $stfscrolls, $stfresize, $pclink, $datefor, $link_headline_fullstory, $hurl, $comheight, $comwidth, $comscrolls, $comresize;
$news_text = array();
if (!empty($news_string)) {
$icon = '';
$email = '';
$writer = '';
$link_full_news = '';
$link_comments = '';
$link_tell_friend = '';
$article = $news_string;
if (!is_array($news_string)) {
$article = get_line_data('news', $news_string);
}
// Get the template HTML
$news_tmpl = get_template((isset($settings['template']) ? $settings['template'] : 'news_temp') . '.php', false);
$other_qs = clean_query_string();
$news_url = isset($settings['news_url']) ? $settings['news_url'] : '';
$sep = strpos($news_url, '?') === false ? '?' : '&';
// Create the 'read more...' link
if ($article['fullnews'] != '') {
if ($fsnw) {
$link_full_news = '<a href="' . $furl . '/fullnews.php?fn_id=' . $article['news_id'] . '" onclick="window.open(this.href,\'\',\'height=' . $fullnewsh . ',width=' . $fullnewsw . ',toolbar=no,menubar=no,scrollbars=' . $fullnewss . ',resizable=' . $fullnewsz . '\'); return false">' . $fslink . '</a>';
} else {
$link_full_news = '<a href="' . $news_url . $sep . 'fn_mode=fullnews&fn_id=' . $article['news_id'] . $other_qs . '">' . $fslink . '</a>';
}
}
// Create the comments link
if ($compop) {
$link_comments = '<a href="' . $furl . '/comments.php?fn_id=' . $article['news_id'] . '" onclick="window.open(this.href,\'\',\'height=' . $comheight . ',width=' . $comwidth . ',toolbar=no,menubar=no,scrollbars=' . $comscrolls . ',resizable=' . $comresize . '\'); return false">' . $pclink . '</a>';
} else {
$link_comments = '<a href="' . $news_url . $sep . 'fn_mode=comments&fn_id=' . $article['news_id'] . $other_qs . '">' . $pclink . '</a>';
}
// Create the tell a friend link
if ($stfpop) {
$link_tell_friend = '<a href="' . $furl . '/send.php?fn_id=' . $article['news_id'] . '" onclick="window.open(this.href,\'\',\'height=' . $stfheight . ',width=' . $stfwidth . ',toolbar=no,menubar=no,scrollbars=' . $stfscrolls . ',resizable=' . $stfresize . '\'); return false">' . $stflink . '</a>';
} else {
$link_tell_friend = '<a href="' . $news_url . $sep . 'fn_mode=send&fn_id=' . $article['news_id'] . $other_qs . '">' . $stflink . '</a>';
}
// Make sure the number of comments is 0 or above.
$num_comments = max((int) $article['numcomments'], 0);
// Get author information
$author = get_author($article['author']);
if ($author === false) {
$author = array('showemail' => false, 'nick' => $article['author']);
}
// Create the icon
if (strpos($news_tmpl, '{icon}') !== false && !empty($author['icon'])) {
$icon = '<img src="' . $author['icon'] . '" alt="" />';
}
// Put the writer's name with his email as a link, or in some cases not.
$email = $author['showemail'] ? $author['email'] : '';
if (!$email) {
$writer = $author['nick'];
} else {
$writer = '<a href="mailto:' . $author['email'] . '">' . $author['nick'] . '</a>';
}
// Get our new lines back
$article['shortnews'] = str_replace('&br;', $ht ? '' : '<br />', $article['shortnews']);
$article['fullnews'] = str_replace('&br;', $ht ? '' : '<br />', $article['fullnews']);
$article['headline'] = format_message($article['headline'], $ht, $bb, $smilies, $wfpost);
$article['shortnews'] = format_message($article['shortnews'], $ht, $bb, $smilies, $wfpost);
$article['fullnews'] = format_message($article['fullnews'], $ht, $bb, $smilies, $wfpost);
$file = file(FNEWS_ROOT_PATH . 'categories.php');
array_shift($file);
$categories = explode(',', $article['categories']);
$cat_icon = '';
$cat_id = 0;
$cat_name = '';
$category_filter = isset($settings['category']) ? $settings['category'] : array();
$num_category_filter = sizeof($category_filter);
foreach ($file as $category) {
$category = get_line_data('categories', $category);
if ($num_category_filter > 0 && in_array($category['category_id'], $category_filter) || $num_category_filter == 0 && in_array($category['category_id'], $categories)) {
$cat_icon = $category['icon'] != '' ? '<img src="' . $category['icon'] . '" alt="" />' : '';
$cat_id = $category['category_id'];
$cat_name = $category['name'];
break;
}
}
$news_text = array('post_id' => $article['news_id'], 'link_tell_friend' => $link_tell_friend, 'link_full_news' => $link_full_news, 'subject' => $article['headline'], 'description' => $article['description'], 'writer' => $writer, 'email' => $email, 'date' => date($datefor, (int) $article['timestamp']), 'icon' => $icon, 'news' => $article['shortnews'], 'fullnews' => $article['fullnews'], 'cat_icon' => $cat_icon, 'cat_id' => $cat_id, 'cat_name' => $cat_name);
if (strpos($news_tmpl, '{comments}') !== false) {
$news_text += array('nrc' => $num_comments, 'link_comments' => $link_comments);
} else {
$news_text += array('nrc' => '', 'link_comments' => '');
}
// Replace in the values!
$news_tmpl = replace_masks($news_tmpl, array('post_id' => $news_text['post_id'], 'user' => $news_text['writer'], 'date' => $news_text['date'], 'icon' => $news_text['icon'], 'send' => $news_text['link_tell_friend'], 'nrc' => $news_text['nrc'], 'cat_id' => $news_text['cat_id'], 'cat_name' => $news_text['cat_name'], 'cat_icon' => $news_text['cat_icon'], 'fullstory' => $news_text['link_full_news'], 'comments' => $news_text['link_comments'], 'subject' => '<a id="fus_' . $news_text['post_id'] . '"></a>' . $news_text['subject'], 'news' => $news_text['news'], 'description' => $news_text['description']));
$news_text += array('display' => $news_tmpl);
}
return $news_text;
}