本文整理汇总了PHP中keywords函数的典型用法代码示例。如果您正苦于以下问题:PHP keywords函数的具体用法?PHP keywords怎么用?PHP keywords使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了keywords函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: keywords
function keywords($text)
{
strpos($text, ',') && ($text = explode(',', $text));
if (is_array($text)) {
foreach ($text as $value) {
keywords(trim($value));
}
return;
}
$cogear = getInstance();
$cogear->meta->info->title->append($text);
}
示例2: draw_page
<?php
if (!path()) {
draw_page('Поваренная книга программиста', dview('index_content', main_categories()));
} elseif (is_category_path(path()) && is_category_exists(path())) {
is_need_cache(true);
$category = new Category(path());
keywords($category->keywords());
draw_page($category->getTitle(), dview('one_category', $category));
} elseif (is_example_path(path()) && is_example_exists(path())) {
is_need_cache(true);
$example = new Example(path());
keywords($example->keywords());
draw_page($example->prop('desc'), view('path_block', ['id' => $example->id()]) . view('one_example', ['data' => $example, 'show_link' => true]));
} else {
show_404();
}
示例3: admin_manage_tags
public function admin_manage_tags($admin)
{
if (!Post::any_editable()) {
show_403(__("Access Denied"), __("You do not have sufficient privileges to manage tags.", "tags"));
}
$sql = SQL::current();
$tags = array();
$names = array();
foreach ($sql->select("post_attributes", "*", array("name" => "tags"))->fetchAll() as $tag) {
$post_tags = YAML::load($tag["value"]);
$tags = array_merge($tags, $post_tags);
foreach ($post_tags as $name => $clean) {
$names[] = $name;
}
}
$popularity = array_count_values($names);
$cloud = array();
if (!empty($popularity)) {
$max_qty = max($popularity);
$min_qty = min($popularity);
$spread = $max_qty - $min_qty;
if ($spread == 0) {
$spread = 1;
}
$step = 75 / $spread;
foreach ($popularity as $tag => $count) {
$cloud[] = array("size" => 100 + ($count - $min_qty) * $step, "popularity" => $count, "name" => $tag, "title" => sprintf(_p("%s post tagged with "%s"", "%s posts tagged with "%s"", $count, "tags"), $count, $tag), "clean" => $tags[$tag], "url" => url("tag/" . $tags[$tag], MainController::current()));
}
}
fallback($_GET['query'], "");
list($where, $params) = keywords($_GET['query'], "post_attributes.value LIKE :query OR url LIKE :query");
$visitor = Visitor::current();
if (!$visitor->group->can("view_draft", "edit_draft", "edit_post", "delete_draft", "delete_post")) {
$where["user_id"] = $visitor->id;
}
$results = Post::find(array("placeholders" => true, "where" => $where, "params" => $params));
$ids = array();
foreach ($results[0] as $result) {
$ids[] = $result["id"];
}
if (!empty($ids)) {
$posts = new Paginator(Post::find(array("placeholders" => true, "drafts" => true, "where" => array("id" => $ids))), 25);
} else {
$posts = new Paginator(array());
}
$admin->display("manage_tags", array("tag_cloud" => $cloud, "posts" => $posts));
}
示例4: sub_authors
<div class="media well">
<div class="media-body">
<div class="col-lg-8">
<div class="ibox-content">
<h3 class="media-heading">
<?php
echo $article_data->title;
?>
</h3>
<span>Sub Authors : <?php
echo sub_authors($article_data->sub_authors);
?>
</span><br/>
<span>Keywords : <?php
echo keywords($article_data->keyword);
?>
</span><br/>
</div>
</div>
<div class="col-lg-2 pull-right">
<a href="<?php
echo base_url();
?>
./uploads/FreshCopy/<?php
echo $article_data->id . '.docx';
?>
"
target="_blank">
<button type="button" style="margin-bottom: 10px"
示例5: set_metadata
/**
* Set metadata for output later
*
* @access public
* @param string
* @return void
*/
public function set_metadata($name, $content, $type = 'meta')
{
$name = htmlspecialchars(strip_tags($name));
$content = htmlspecialchars(strip_tags($content));
// Keywords with no comments? ARG! comment them
if ($name == 'keywords' && !strpos($content, ',')) {
$this->CI->load->helper('inflector');
$content = keywords($content);
}
switch ($type) {
case 'meta':
$meta = '<meta name="' . $name . '" content="' . $content . '" />';
break;
case 'link':
$meta = '<link rel="' . $name . '" href="' . $content . '" />';
break;
}
$this->extra_head($meta);
return $this;
}
示例6: admin_manage_comments
static function admin_manage_comments($admin)
{
if (!Comment::any_editable() and !Comment::any_deletable()) {
show_403(__("Access Denied"), __("You do not have sufficient privileges to manage any comments.", "comments"));
}
fallback($_GET['query'], "");
list($where, $params) = keywords($_GET['query'], "body LIKE :query");
$where[] = "status != 'spam'";
$visitor = Visitor::current();
if (!$visitor->group->can("edit_comment", "delete_comment", true)) {
$where["user_id"] = $visitor->id;
}
$admin->display("manage_comments", array("comments" => new Paginator(Comment::find(array("placeholders" => true, "where" => $where, "params" => $params)), 25)));
}
示例7: autokeyword
function autokeyword($updatedb = 0)
{
$this->detail_data();
$fields = read_cache('fields', $this->archive['chid']);
if ($fields['keywords']['available'] && $this->channel['autokeyword'] && empty($this->archive['keywords']) && !empty($this->archive[$this->channel['autokeyword']])) {
$keywords = autokeyword($this->archive[$this->channel['autokeyword']]);
$this->updatefield('keywords', keywords(addslashes($keywords)), 'main');
}
unset($fields, $keywords);
$updatedb && $this->updatedb();
}
示例8: search
/**
* Function: search
* Grabs the posts for a search query.
*/
public function search()
{
fallback($_GET['query'], "");
$config = Config::current();
if ($config->clean_urls and substr_count($_SERVER['REQUEST_URI'], "?") and !substr_count($_SERVER['REQUEST_URI'], "%2F")) {
# Searches with / and clean URLs = server 404
redirect("search/" . urlencode($_GET['query']) . "/");
}
if (empty($_GET['query'])) {
return Flash::warning(__("Please enter a search term."));
}
list($where, $params) = keywords($_GET['query'], "post_attributes.value LIKE :query OR url LIKE :query", "posts");
$results = Post::find(array("placeholders" => true, "where" => $where, "params" => $params));
$ids = array();
foreach ($results[0] as $result) {
$ids[] = $result["id"];
}
if (!empty($ids)) {
$posts = new Paginator(Post::find(array("placeholders" => true, "where" => array("id" => $ids))), $this->post_limit);
} else {
$posts = new Paginator(array());
}
$this->display(array("pages/search", "pages/index"), array("posts" => $posts, "search" => $_GET['query']), fix(_f("Search results for \"%s\"", array($_GET['query']))));
}
示例9: amessage
$a_field->deal('archivenew');
if (!empty($a_field->error)) {
$c_upload->rollback();
amessage($a_field->error, axaction(2, M_REFERER));
}
$archivenew[$k] = $a_field->newvalue;
}
}
}
}
unset($a_field);
$cu_ret = cu_fields_deal($channel['cuid'], 'archivenew', $aedit->archive);
!empty($cu_ret) && amessage($cu_ret, axaction(2, M_REFERER));
$aedit->edit_cudata($archivenew, 1);
if (isset($archivenew['keywords'])) {
$archivenew['keywords'] = keywords($archivenew['keywords'], $aedit->archive['keywords']);
}
if ($fields['abstract']['available'] && $channel['autoabstract'] && empty($archivenew['abstract']) && isset($archivenew[$channel['autoabstract']])) {
$archivenew['abstract'] = autoabstract($archivenew[$channel['autoabstract']]);
}
if ($fields['thumb']['available'] && $channel['autothumb'] && empty($archivenew['thumb']) && isset($archivenew[$channel['autothumb']])) {
$archivenew['thumb'] = $c_upload->thumb_pick(stripslashes($archivenew[$channel['autothumb']]), $fields[$channel['autothumb']]['datatype'], $fields['thumb']['rpid']);
}
if ($channel['autosize'] && isset($archivenew[$channel['autosize']]) && $archivenew[$channel['autosize']] != addslashes($aedit->archive[$channel['autosize']])) {
$archivenew['atmsize'] = atm_size(stripslashes($archivenew[$channel['autosize']]), $fields[$channel['autosize']]['datatype'], $channel['autosizemode']);
$aedit->updatefield('atmsize', $archivenew['atmsize'], 'main');
}
if ($channel['autobyte'] && isset($archivenew[$channel['autobyte']])) {
$archivenew['bytenum'] = atm_byte(stripslashes($archivenew[$channel['autobyte']]), $fields[$channel['autobyte']]['datatype']);
$aedit->updatefield('bytenum', $archivenew['bytenum'], 'main');
}
示例10: usersMenus
<?php
include_once('ressources/class.templates.inc');
include_once('ressources/class.ldap.inc');
include_once('ressources/class.users.menus.inc');
include_once('ressources/class.artica.inc');
include_once('ressources/class.ini.inc');
include_once('ressources/class.spamassassin.inc');
$user=new usersMenus();
if($user->AsPostfixAdministrator==false){
$tpl=new templates();
echo "alert('". $tpl->javascript_parse_text("{ERROR_NO_PRIVS}")."');";
die();exit();
}
if(isset($_GET["tabs"])){tabs();exit;}
if(isset($_GET["keywords"])){keywords();exit;}
if(isset($_GET["keywords-popup"])){keywords_add_popup();exit;}
if(isset($_GET["keywords-list"])){keywords_list();exit;}
if(isset($_POST["keywords-save"])){keywords_add();exit;}
if(isset($_GET["keywords-edit"])){keywords_edit();exit;}
if(isset($_GET["keywords-edit-save"])){keywords_edit_save();exit;}
if(isset($_GET["SimpleKeywordDisable"])){SimpleKeywordDisable();exit;}
if(isset($_GET["SimpleWordsDelete"])){SimpleWordsDelete();exit;}
js();
function js(){
$tpl=new templates();
$page=CurrentPageName();
$title=$tpl->_ENGINE_parse_body("{APP_SPAMASSASSIN}::{block_keywords}");
echo "YahooWin3('700','$page?tabs=yes','$title');";
示例11: mysql_query
echo "</select>";
}
if ($id_politico) {
$tamanho = 3;
$numero = 3;
$consulta = $consulta . " WHERE v2.id_politico = '{$id_politico}'";
}
echo "<br />";
$input1 = '';
$consulta1 = $consulta . " AND v2.id_voto_tipo = 'Sim'";
//$consulta = $consulta." ORDER BY data DESC LIMIT 0,2000";
$sql_votacao1 = mysql_query($consulta1) or die(mysql_error());
while ($row_votacao1 = mysql_fetch_array($sql_votacao1)) {
$input1 = $input1 . ' ' . $row_votacao1[0];
}
$input2 = '';
$consulta2 = $consulta . " AND v2.id_voto_tipo = 'Não'";
//$consulta = $consulta." ORDER BY data DESC LIMIT 0,2000";
$sql_votacao2 = mysql_query($consulta2) or die(mysql_error());
while ($row_votacao2 = mysql_fetch_array($sql_votacao2)) {
$input2 = $input2 . ' ' . $row_votacao2[0];
}
echo "<div style='width:50%;float:left;'>";
echo "<h1 class='verde'>SIM</h1>";
keywords($input1, 1, 10, 'verde');
echo "</div>";
echo "<div style='width:50%;float:right;text-align:right;'>";
echo "<h1 class='vermelho'>NÃO</h1>";
keywords($input2, 1, 10, 'vermelho');
echo "</div>";
echo "<div style='clear:both;'> </div>";
示例12: foreach
<?php
echo "<div class='divisao'>Proposições</div>";
$conta_proposicao = 1;
$input = '';
echo "<table border=1 class='tabelas'>\n\t<tr>\n\t\t<td>N<sup>o</sup></td>\n\t\t<td>Título</td>\n\t\t<td>Data</td>\n\t\t<td>Casa</td>\t\n\t\t<td>Número</td>\n\t\t<td>Tipo</td>\t\n\t\t<td>Ementa</td>\t\t\t\t\t\t\n\t</tr>";
foreach ($sparql11 as $row) {
$data = $row['data'];
if ($data == '01/01/1970') {
$data = '-';
}
echo "\n\t\t<tr>\n\t\t\t<td>{$conta_proposicao}</td>\n\t\t\t<td>" . $row['titulo'] . "</td>\n\t\t\t<td>" . $data . "</td>\n\t\t\t<td>" . $row['casa'] . "</td>\n\t\t\t<td>" . $row['numero'] . "</td>\n\t\t\t<td>" . $row['tipo'] . " - " . $row['descricao_tipo'] . "</td>\n\t\t\t<td>" . $row['ementa'] . "</td>\n\t\t</tr>";
$conta_proposicao++;
$input = $input . ' ' . $row['ementa'];
}
echo "</table>";
echo "<br />";
keywords($input, 3, 5, 'azul');
示例13: title
">
<LINK REL="stylesheet" TYPE="text/css" HREF="<?php
echo bu::pub('default.css');
?>
">
<link href='http://fonts.googleapis.com/css?family=Lobster&subset=cyrillic,latin' rel='stylesheet' type='text/css'>
<LINK REL="SHORTCUT ICON" HREF="<?php
echo bu::pub('favicon.png');
?>
">
<title><?php
echo title();
?>
</title>
<meta name="keywords" content="<?php
echo is_array(keywords()) ? implode(', ', keywords()) : keywords();
?>
">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<div class="container">
<div class="col-md-10 col-md-push-1">
<div id='header'> Большая поваренная книга программиста. </div>
<div class="row">
<div id='sub_header'>
<?php
echo view('menu');
?>
示例14: elseif
echo ' 个';
} elseif (is_tag()) {
$description = strip_tags(tag_description());
echo trim($description);
} else {
$description = strip_tags(term_description());
echo trim($description);
}
}
?>
<meta name="description" content="<?php
description();
?>
">
<meta name="keywords" content="<?php
keywords();
?>
">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<?php
if (is_404()) {
?>
<meta http-equiv='refresh' content=5;URL="<?php
bloginfo('url');
?>
">
<?php
}
?>
<?php
wp_head();
示例15: search
public function search()
{
if (empty($_GET['query'])) {
exit;
}
# TODO
$config = Config::current();
if ($config->clean_urls and substr_count($_SERVER['REQUEST_URI'], "?") and !substr_count($_SERVER['REQUEST_URI'], "%2F")) {
# Searches with / and clean URLs = server 404
redirect("search/" . urlencode($_GET['query']) . "/");
}
if (empty($_GET['query'])) {
return Flash::warning(__("Please enter a search term."));
}
list($where, $params) = keywords($_GET['query'], "name LIKE :query OR url LIKE :query", "extensions");
$extensions = Extension::find(array("placeholders" => true, "where" => $where, "params" => $params));
list($where, $params) = keywords($_GET['query'], "description LIKE :query OR tags LIKE :query", "versions");
$versions = Version::find(array("placeholders" => true, "where" => $where, "params" => $params));
list($where, $params) = keywords($_GET['query'], "body LIKE :query", "notes");
$notes = Note::find(array("placeholders" => true, "where" => $where, "params" => $params));
$this->display("extend/search", array("extensions" => new Paginator($extensions, 25, "extensions_page"), "versions" => new Paginator($versions, 25, "versions_page"), "notes" => new Paginator($notes, 25, "notes_page"), "search" => $_GET['query']), fix(_f("Search results for \"%s\"", $_GET['query'])));
}