本文整理汇总了PHP中tags函数的典型用法代码示例。如果您正苦于以下问题:PHP tags函数的具体用法?PHP tags怎么用?PHP tags使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了tags函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: update
/**
* (non-PHPdoc)
* 修改方法
* @see CommonAction::update()
*/
public function update()
{
unset($_POST['__hash__']);
if (tags($_POST) > 0) {
$this->success(L('_SUCCESS_'));
} else {
$this->error(L('_ERROR_'));
}
}
示例2: round
$file['size'] = round($size / 1048576) . ' MB';
} else {
$file['size'] = round($size / 1024) . ' KB';
}
}
} else {
$file['size'] = 'File not found';
$file['url'] = '#';
}
#Mark
if (isset($cfg['frate']) && $file['opt'] & 4) {
$view->css(SKIN_DIR . 'rate.css');
$rate = 'vote.php?type=2&id=' . $id;
} else {
$rate = 0;
}
#Date, author
$file['date'] = genDate($file['date'], true);
$file['author'] = autor($file['author']);
#Template
$view->add('file', array('file' => &$file, 'path' => catPath($file['cat']), 'rates' => $rate, 'edit' => admit($file['cat'], 'CAT') ? url('edit/2/' . $id, 'ref') : false, 'root' => isset($cfg['allCat']) ? $lang['cats'] : $lang['files'], 'cats' => url(isset($cfg['allCat']) ? 'cats' : 'cats/files')));
#Tags
if (isset($cfg['tags'])) {
include './lib/tags.php';
tags($id, 2);
}
#Comments
if (isset($cfg['fcomm']) && $file['opt'] & 2) {
require './lib/comm.php';
comments($id, 2);
}
示例3: array
" class="post">
<?php
echo $this->template->render('blog/_author', array('post' => $post));
?>
<h1><?php
echo $post['title'];
?>
<?php
echo post_control($post);
?>
</h1>
<?php
echo $post['full'];
?>
<div class="tags"><span class="icon icon-tags"></span>Тэги: <?php
echo tags($post);
?>
</div>
</div>
<hr/>
<div class="share">
<noindex>
<!-- AddThis Button BEGIN -->
<div class="addthis_toolbox addthis_default_style addthis_32x32_style">
<a class="addthis_button_facebook"></a>
<a class="addthis_button_vk"></a>
<a class="addthis_button_twitter"></a>
<a class="addthis_button_livejournal"></a>
<a class="addthis_button_google_plusone_share"></a>
<a class="addthis_button_blogger"></a>
<a class="addthis_button_evernote"></a>
示例4: tags_link
" height="<?php
echo $height;
?>
"/>
</a>
<?if($mater[$n]['PROPERTY'][0]['metka']['~VALUE']!=''):?>
<div class="tag row">
<?
$link_tag = tags_link($mater[$n]['PROPERTY'][0]['metka']['~VALUE']);
?>
<a href="<?php
echo $link_tag;
?>
" class="link_tag">
<div class="name-tag"><?php
echo tags($mater[$n]['PROPERTY'][0]['metka']['~VALUE']);
?>
</div>
<div class="trigon"></div>
</a>
</div>
<?endif;?>
<div class="pad_10_15 name-item">
<h3>
<a href="/<?php
echo $mater[$n]['PROPERTY'][0]['type']['VALUE_XML_ID'];
?>
/<?php
echo $mater[$n]['CODE'];
?>
/"><?php
示例5: cbdate
echo $firstrating;
} else {
echo $vrating . '.0';
}
?>
</video:rating>
<video:view_count><?php
echo $video['views'];
?>
</video:view_count>
<video:publication_date><?php
echo cbdate("Y-m-d H:i:s", strtotime($video['date_added']));
?>
</video:publication_date>
<?php
$vtags = strip_tags(tags($video['tags'], 'video'));
$vtableau = explode(",", $vtags);
for ($i = 0; $i < sizeof($vtableau); $i++) {
echo '<video:tag><![CDATA[' . trim($vtableau[$i]) . ']]></video:tag>';
}
?>
<video:category><?php
echo strip_tags(categories($video['category'], 'video'));
?>
</video:category>
<video:family_friendly>yes</video:family_friendly>
<video:duration><?php
$defaultime = $video['duration'];
$dotfixed = explode(".", $defaultime);
echo $dotfixed[0] . $dotfixed[1];
?>
示例6: tags
<?php
function tags($a, $b)
{
return "<i>{$a}</i><i>{$b}</i>";
}
print tags('i', 'Yay');
print tags('i', 'Hello');
print tags('cite', 'Yay');
?>
示例7: fbrogmt
function fbrogmt()
{
if (is_plugin_active('shopp/Shopp.php')) {
if (shopp('catalog', 'is-product')) {
$meta[] = __(trim(shopp('product', 'name', 'return=1'))) . ' - ' . shopp('product', 'price', 'return=1');
$meta[] = shopp('product', 'link', 'return=1');
$meta[] = get_option('blogname');
//Site name
//get summary, or use description if no summary is set.
$description = trim(strip_tags(shopp('product', 'summary', 'return=1')));
$long_description = trim(strip_tags(shopp('product', 'description', 'return=1')));
if ('' == $description) {
$description = $long_description;
}
//truncate description to 300
if (strlen($description) > 300) {
$description = substr($description, 0, 297) . '...';
}
$meta[] = $description;
$meta[] = 'product';
foreach (all_images_shopp() as $img_meta) {
// The loop to dish out all the images meta tags explained lower
echo $img_meta;
}
} else {
if (is_single()) {
// Post
if (have_posts()) {
while (have_posts()) {
the_post();
$meta[] = get_the_title($post->post_title);
// Gets the title
$meta[] = get_permalink();
// gets the url of the post
$meta[] = get_option('blogname');
//Site name
$meta[] = the_excerpt_max_charlength(300) . '...';
//Description comes from the excerpt, because by using the_content, it will dish out the [caption id...]
$meta[] = 'article';
// $meta[]=get_the_image();//Gets the first image of a post/page if there is one -- Remove this for now
foreach (all_images() as $img_meta) {
// The loop to dish out all the images meta tags explained lower
echo $img_meta;
}
}
}
} elseif (is_page()) {
// Page
if (have_posts()) {
while (have_posts()) {
the_post();
$meta[] = get_the_title($post->post_title);
// Gets the title
$meta[] = get_permalink();
// gets the url of the post
$meta[] = get_option('blogname');
//Site name
$meta[] = the_excerpt_max_charlength(300) . '...';
//Description comes from the excerpt, because by using the_content, it will dish out the [caption id...]
$meta[] = 'article';
// $meta[]=get_the_image();//Gets the first image of a post/page if there is one -- Remove this for now
foreach (all_images() as $img_meta) {
// The loop to dish out all the images meta tags explained lower
echo $img_meta;
}
}
}
} elseif (is_category()) {
global $post, $wp_query;
$category_id = get_cat_ID(single_cat_title('', false));
// Get the URL of this category
$category_link = get_category_link($category_id);
$term = $wp_query->get_queried_object();
if (is_plugin_active('wordpress-seo/wp-seo.php')) {
//checks for yoast seo plugin for description of category
$metadesc = wpseo_get_term_meta($term, $term->taxonomy, 'desc');
} else {
$metadesc = category_description($category_id);
}
$meta[] = wp_title('', false);
//Title
$meta[] = $category_link;
//URL
$meta[] = get_option('blogname');
//Site name
$meta[] = $metadesc;
//Description
$meta[] = 'website';
foreach (all_images() as $img_meta) {
// The loop to dish out all the images meta tags explained lower
echo $img_meta;
}
} elseif (is_home() || is_front_page()) {
$meta[] = get_option('blogname');
//Title
$meta[] = get_option('siteurl');
//URL
$meta[] = get_option('blogname');
//Site name
$meta[] = get_option('blogdescription');
//.........这里部分代码省略.........
示例8: tags_link
{
$arFields = $ob->GetFields();
$active = $arFields['ACTIVE'];
}
if($active=='Y'):
?>
<div class="tag row left">
<?
$link_tag = tags_link($id_metka);
?>
<a href="<?php
echo $link_tag;
?>
" class="link_tag">
<div class="name-tag"><?php
echo tags($id_metka);
?>
</div>
<div class="trigon"></div>
</a>
</div>
<?endif?>
<?endforeach;?>
</div>
<?endif;?>
<div class="social">
<?$APPLICATION->IncludeComponent("bitrix:asd.favorite.button", "crado", Array(
"FAV_TYPE" => "content", // Тип избранного
"BUTTON_TYPE" => "fav", // Тип кнопки
示例9: res_NubeTextoPeriodo
function res_NubeTextoPeriodo($idPregunta, $idPeriodo)
{
$base = new PDOConfig();
$idPregunta = $base->filtrar($idPregunta);
$palabras = array();
$lista = array();
$texto = "";
$sqlResp = "SELECT RespuestaTexto from respuestaspreguntas R INNER JOIN respuestas E ON R.idRespuesta = E.idRespuesta\r\n WHERE E.idPeriodo = {$idPeriodo} AND R.idPregunta = {$idPregunta}";
$resOps = $base->query($sqlResp);
if ($resOps) {
$resultado = $resOps->fetchAll(PDO::FETCH_ASSOC);
foreach ($resultado as $row) {
$texto .= " " . $row["RespuestaTexto"];
}
//echo $texto;exit();
$palabras = tags(quitarAcentos($texto));
$lista = repeatedElements($palabras, true);
//print_r($lista);exit();
return json_encode($lista);
} else {
return "0";
}
}
示例10: tr_date
</div>
<div class="post post-info">
<span class="date">
<?php
echo tr_date('d F Y', $created_at->sec);
?>
</span>
<span class="category">
<?php
echo categories($categories);
?>
</span>
<span class="tags">
<?php
echo tags($tags);
?>
</span>
<span class="read">
<?php
echo $counter;
?>
kez okundu.
</span>
</div>
<div class="row post-share">
<div class="span5">
<?php
echo anchor('http://feeds.feedburner.com/' . get_option('feedburner_username'), 'Yazılarımızı RSS ile takip edebilirsiniz.');
?>
示例11: register_shutdown_function
if (isset($cfg['arate']) && $art['catOpt'] & 4) {
$view->css(SKIN_DIR . 'rate.css');
$rates = 'vote.php?type=1&id=' . $id;
} else {
$rates = 0;
}
#Count popularity
if (isset($cfg['adisp'])) {
register_shutdown_function(array($db, 'exec'), 'UPDATE ' . PRE . 'arts SET views=views+1 WHERE ID=' . $id);
++$art['views'];
} else {
$art['ent'] = 0;
}
#Pages
if ($art['pages'] > 1) {
$pages = pages($page, $art['pages'], 1, url('art/' . $id), 0, '/');
} else {
$pages = false;
}
#Template
$view->add('art', array('art' => &$art, 'pages' => &$pages, 'path' => catPath($art['cat']), 'edit' => admit($art['cat'], 'CAT') ? url('edit/1/' . $id, 'ref=' . $page) : false, 'color' => $art['opt'] & 4, 'rates' => $rates, 'root' => isset($cfg['allCat']) ? $lang['cats'] : $lang['arts'], 'cats' => url(isset($cfg['allCat']) ? 'cats' : 'cats/articles'), 'lightbox' => isset($cfg['lightbox'])));
#Tags
if (isset($cfg['tags'])) {
include './lib/tags.php';
tags($id, 1);
}
#Comments
if (isset($cfg['acomm']) && $art['catOpt'] & 2) {
require './lib/comm.php';
comments($id, 1);
}
示例12: foreach
if (count($files) == 0) {
echo '<div class="alert alert-info"><strong>Oups!</strong> Aucune actualitée pour le moment...</div>';
} else {
foreach ($files as $file) {
$user = User::getUserById($file->id_user);
$list_avatars = Avatar::getAvatarsByUserId($file->id_user);
echo '<hr/>';
echo '<div class="post">
<a href="' . url('profil/view/' . $file->id_user) . '"><img src="' . $list_avatars[0]->getMiniatureLink() . '" class="img-polaroid avatar-little" alt="Voir le profil de ' . ucfirst($user->vorname) . ' ' . ucfirst($user->name) . '" title="Voir le profil de ' . ucfirst($user->vorname) . ' ' . ucfirst($user->name) . '" /></a>
<h4>' . ucfirst($user->vorname) . ' ' . ucfirst($user->name) . ' a partagé : <small>(le ' . $file->date . ')</small> <span class="label label-important">' . $file->type . '</span></h4>
<div class="well">
<blockquote>
<p>' . $file->desc . '</p>
</blockquote>
' . $file->getHTML() . '
<p class="tags"><i class="icon-tags"></i> Tags: ' . tags($file->keywords) . '</p>
</div>
</div>';
}
}
?>
</div>
<div class="span4">
<h3>Actions:</h3>
<div class="dropdown">
<button class="dropdown-toggle btn" data-toggle="dropdown" >Dérouler <span class="caret"></span></button>
<a href="" class="btn btn-info"><i class="icon-refresh icon-white"></i></a>
<ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
<li><a tabindex="-1" href="<?php
echo url('flux/share');
?>
示例13: trim
{
$string = trim(strip_tags(html_entity_decode(urldecode($string))));
if (empty($string)) {
return false;
}
$extras = array('p' => array('ante', 'bajo', 'con', 'contra', 'desde', 'durante', 'entre', 'hacia', 'hasta', 'mediante', 'para', 'por', 'pro', 'segun', 'sin', 'sobre', 'tras', 'via'), 'a' => array('los', 'las', 'una', 'unos', 'unas', 'este', 'estos', 'ese', 'esos', 'aquel', 'aquellos', 'esta', 'estas', 'esa', 'esas', 'aquella', 'aquellas', 'usted', 'nosotros', 'vosotros', 'ustedes', 'nos', 'les', 'nuestro', 'nuestra', 'vuestro', 'vuestra', 'mis', 'tus', 'sus', 'nuestros', 'nuestras', 'vuestros', 'vuestras', 'tengo'), 'o' => array('esto', 'que'));
$string = strtr(mb_strtolower((string) $string, $encoding), 'âàåáäèéêëïîìíôöòóúûüùñ', 'aaaaaeeeeiiiioooouuuun');
if (preg_match_all('/\\pL{3,}/s', $string, $m)) {
$m = array_diff(array_unique($m[0]), $extras['p'], $extras['a'], $extras['o']);
}
return $m;
}
//print_r(tags($busqueda));
include_once 'conexion.php';
$contador2 = 0;
foreach (tags($busqueda) as $valor) {
$contador = 0;
$consulta = "SELECT * FROM deseos WHERE cumplido = 'n' AND deseo like '%{$valor}%' ";
$result = mysql_query($consulta) or die('Ha fallado la conexión: ' . mysql_error());
$array = mysql_fetch_array($result);
$total_registros = mysql_num_rows($result);
do {
$id = $array['id'];
$id_usuario = $array['id_usuario'];
$consulta3 = "SELECT * FROM usuarios WHERE id = '{$id_usuario}' ";
$result3 = mysql_query($consulta3) or die('Ha fallado la conexión: ' . mysql_error());
$array3 = mysql_fetch_array($result3);
$total_registros3 = mysql_num_rows($result3);
do {
$nombre = $array3['nombre'];
} while ($array3 = mysql_fetch_array($result3));
示例14: get_subscription_photo
/**
* This function get photo details, setups an array for content.
* This also serves as an example on how to use custom callback
* for subscription type
*
* @author Fawaz Tahir <fawaz.cb@gmail.com>
* @param type $id
* @return array|boolean
*/
function get_subscription_photo($id)
{
global $cbphoto, $userquery;
$photo = $cbphoto->get_photo($id, true);
if ($photo) {
$fields = array('photo_description', 'photo_tags', 'collection_id', 'collection_name', 'views', 'file_directory', 'server_url', 'broadcast', 'date_added');
$fields = get_photo_fields($fields);
foreach ($fields as $field) {
if ($field == 'photo_details') {
continue;
}
$details[$field] = $photo[$field];
}
$details['title'] = $photo['photo_title'];
$details['description'] = $photo['photo_descritpion'];
$details['tags'] = tags($photo['photo_tags'], "photos");
$details['heading'] = sprintf(lang('<a href="%s">%s</a> added a new photo in <a href="%s">%s</a>'), $userquery->profile_link($photo), name($photo), collection_links($photo), $photo['collection_name']);
$details['link'] = view_photo_link($photo);
$details['thumb'] = get_image_url($photo, 'm');
return $details;
}
return false;
}
示例15: elseif
} elseif (!UID) {
return;
}
}
#Evaluate PHP first
if ($page['opt'] & 16) {
ob_start();
eval('?>' . $page['text']);
$page['text'] = ob_get_clean();
}
#Emoticons
if ($page['opt'] & 2) {
$page['text'] = emots($page['text']);
}
#Line breaks
if ($page['opt'] & 1) {
$page['text'] = nl2br($page['text']);
}
#Page title, template
$view->title = $page['name'];
$view->add('page', array('page' => &$page, 'box' => $page['opt'] & 4, 'all' => $edit ? url('pages', '', 'admin') : false, 'edit' => $edit ? url('editPage/' . $id, 'ref', 'admin') : false));
#Keywords
if (isset($cfg['tags'])) {
include './lib/tags.php';
tags($id, 59);
}
#Comments
if ($page['opt'] & 8) {
require './lib/comm.php';
comments($id, 59);
}