本文整理汇总了PHP中add_tag函数的典型用法代码示例。如果您正苦于以下问题:PHP add_tag函数的具体用法?PHP add_tag怎么用?PHP add_tag使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了add_tag函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: gettemplate
function gettemplate($template, $replace, $endung, $folder)
{
return;
if (file_exists($folder . "/" . $template . "." . $endung)) {
// Tag anpassen
$replace = add_tag($replace);
$templatecontent = strtr(implode("", file($folder . "/" . $template . "." . $endung)), $replace);
} else {
error_message("Template nicht gefunden: " . $folder . "/" . $template . "." . $endung);
}
return $templatecontent;
}
示例2: elseif
$smarty->assign('order', $order);
$smarty->assign('action', 'account_deposit');
$smarty->display('user_transaction.dwt');
}
} elseif ($action == 'add_tag') {
include_once 'includes/cls_json.php';
include_once 'includes/lib_clips.php';
$result = array('error' => 0, 'message' => '', 'content' => '');
$id = isset($_POST['id']) ? intval($_POST['id']) : 0;
$tag = isset($_POST['tag']) ? json_str_iconv(trim($_POST['tag'])) : '';
if ($user_id == 0) {
/* 用户没有登录 */
$result['error'] = 1;
$result['message'] = $_LANG['tag_anonymous'];
} else {
add_tag($id, $tag);
// 添加tag
clear_cache_files('goods');
// 删除缓存
/* 重新获得该商品的所有缓存 */
$arr = get_tags($id);
foreach ($arr as $row) {
$result['content'][] = array('word' => htmlspecialchars($row['tag_words']), 'count' => $row['tag_count']);
}
}
$json = new JSON();
echo $json->encode($result);
exit;
} elseif ($action == 'collect') {
include_once ROOT_PATH . 'includes/cls_json.php';
$json = new JSON();
示例3: action_add_tag
function action_add_tag()
{
$user = $GLOBALS['user'];
$_CFG = $GLOBALS['_CFG'];
$_LANG = $GLOBALS['_LANG'];
$smarty = $GLOBALS['smarty'];
$db = $GLOBALS['db'];
$ecs = $GLOBALS['ecs'];
$user_id = $_SESSION['user_id'];
include_once 'includes/cls_json.php';
include_once 'includes/lib_clips.php';
$result = array('error' => 0, 'message' => '', 'content' => '');
$id = isset($_POST['id']) ? intval($_POST['id']) : 0;
$tag = isset($_POST['tag']) ? json_str_iconv(trim($_POST['tag'])) : '';
if ($user_id == 0) {
/* 用户没有登录 */
$result['error'] = 1;
$result['message'] = $_LANG['tag_anonymous'];
} else {
add_tag($id, $tag);
// 添加tag
clear_cache_files('goods');
// 删除缓存
/* 重新获得该商品的所有缓存 */
$arr = get_tags($id);
foreach ($arr as $row) {
$result['content'][] = array('word' => htmlspecialchars($row['tag_words']), 'count' => $row['tag_count']);
}
}
$json = new JSON();
echo $json->encode($result);
exit;
}
示例4: include_once
include_once('includes/cls_json.php');
include_once('includes/lib_clips.php');
$result = array('error' => 0, 'message' => '', 'content' => '');
$id = isset($_POST['id']) ? intval($_POST['id']) : 0;
$tag = isset($_POST['tag']) ? json_str_iconv(trim($_POST['tag'])) : '';
if ($user_id == 0)
{
/* 用户没有登录 */
$result['error'] = 1;
$result['message'] = $_LANG['tag_anonymous'];
}
else
{
add_tag($id, $tag); // 添加tag
clear_cache_files('goods'); // 删除缓存
/* 重新获得该商品的所有缓存 */
$arr = get_tags($id);
foreach ($arr AS $row)
{
$result['content'][] = array('word' => htmlspecialchars($row['tag_words']), 'count' => $row['tag_count']);
}
}
$json = new JSON;
echo $json->encode($result);
exit;
示例5: replace_tags
/**
* Remove existing tags and replace with a new set
* @author Ivan Lucas
*/
function replace_tags($type, $id, $tagstring)
{
global $dbSetTags;
// first remove old tags
$sql = "DELETE FROM `{$dbSetTags}` WHERE id = '{$id}' AND type = '{$type}'";
$result = mysql_query($sql);
if (mysql_error()) {
trigger_error("MySQL Query Error " . mysql_error(), E_USER_ERROR);
}
// Change seperators to spaces
$seperators = array(', ', ';', ',');
$tags = str_replace($seperators, ' ', trim($tagstring));
$tag_array = explode(" ", $tags);
foreach ($tag_array as $tag) {
add_tag($id, $type, trim($tag));
}
}
示例6: get_cat_arr_id
$categories = get_cat_arr_id($id);
$catforremove = array_diff($categories, $category);
$catforadd = array_diff($category, $categories);
foreach ($catforremove as $cat) {
mysql_query("DELETE FROM `" . POST_CATEGORY . "` WHERE `post_id`='{$id}' AND `category_id`='{$cat}'");
}
foreach ($catforadd as $cat) {
mysql_query("INSERT INTO `" . POST_CATEGORY . "`(`post_id`, `category_id`) VALUES ('{$id}','{$cat}')");
}
//Updating meta
update_post_meta($id, "meta_title", mysql_real_escape_string($name));
update_post_meta($id, "meta_description", mysql_real_escape_string($shortdesc));
//Updating Tags To database
$tagarr = explode(",", $tags);
foreach ($tagarr as $eachtag) {
add_tag($eachtag);
}
header("location:user_post.php?updatesuccess&edit={$id}");
}
?>
<?php
html("START");
?>
<!-- BEGIN HEAD -->
<head>
<?php
common_head("META");
put_seo(array("title" => get_the_option("website_title") . " | Manage Posts", "desc" => "", "author" => "", "keywords" => "", "image" => ""));
common_style("MANDATORY_STYLES");
page_style("USER_POST");
示例7: Tags_Spider_Video_Player
function Tags_Spider_Video_Player()
{
global $wpdb;
require_once "tag_functions.php";
// add functions for Spider_Video_Player
require_once "tag_function.html.php";
// add functions for vive Spider_Video_Player
if (isset($_GET["task"])) {
$task = htmlspecialchars($_GET["task"]);
} else {
$task = "default";
}
if (isset($_GET["id"])) {
$id = htmlspecialchars($_GET["id"]);
} else {
$id = 0;
}
switch ($task) {
case 'tag':
show_tag();
break;
case 'add_tag':
add_tag();
break;
case 'cancel_tag':
cancel_tag();
break;
case 'apply_tag':
if ($id == 0) {
check_admin_referer('nonce_sp_vid', 'nonce_sp_vid');
$save_or_no = save_tag();
} else {
check_admin_referer('nonce_sp_vid', 'nonce_sp_vid');
$save_or_no = apply_tag($id);
}
if ($save_or_no) {
edit_tag($id);
} else {
show_tag();
}
break;
case 'save_tag':
if (!$id) {
check_admin_referer('nonce_sp_vid', 'nonce_sp_vid');
save_tag();
} else {
check_admin_referer('nonce_sp_vid', 'nonce_sp_vid');
apply_tag($id);
}
show_tag();
break;
case 'saveorder':
check_admin_referer('nonce_sp_vid', 'nonce_sp_vid');
saveorder();
break;
case 'orderup':
ordertag(-1);
break;
case 'orderdown':
ordertag(1);
break;
case 'edit_tag':
edit_tag($id);
break;
case 'remove_tag':
$nonce_sp_vid = $_REQUEST['_wpnonce'];
if (!wp_verify_nonce($nonce_sp_vid, 'nonce_sp_vid')) {
die("Are you sure you want to do this?");
}
remove_tag($id);
show_tag();
break;
case 'publish_tag':
$nonce_sp_vid = $_REQUEST['_wpnonce'];
if (!wp_verify_nonce($nonce_sp_vid, 'nonce_sp_vid')) {
die("Are you sure you want to do this?");
}
change_tag($id);
show_tag();
break;
case 'unpublish_tag':
$nonce_sp_vid = $_REQUEST['_wpnonce'];
if (!wp_verify_nonce($nonce_sp_vid, 'nonce_sp_vid')) {
die("Are you sure you want to do this?");
}
change_tag($id);
show_tag();
break;
case 'required_tag':
$nonce_sp_vid = $_REQUEST['_wpnonce'];
if (!wp_verify_nonce($nonce_sp_vid, 'nonce_sp_vid')) {
die("Are you sure you want to do this?");
}
required_tag($id);
show_tag();
break;
case 'unrequired_tag':
$nonce_sp_vid = $_REQUEST['_wpnonce'];
if (!wp_verify_nonce($nonce_sp_vid, 'nonce_sp_vid')) {
die("Are you sure you want to do this?");
//.........这里部分代码省略.........
示例8: list_tags_action
function list_tags_action($uid)
{
// needed to set the tab active
$tags_active = true;
//check if the user is admin
if (user_is_admin($uid)) {
// dealing with tag add form
if (isset($_POST['owner'])) {
$tag_added = get_tag_by_uid($_POST['uid']);
// tag exists
if ($tag_added) {
update_tag($_POST['uid'], $_POST);
} else {
add_tag($_POST);
}
}
// list all the users
$tags = get_all_tags();
$types = get_tag_types();
$uids = get_all_uids();
require 'templates/tags.php';
} else {
require 'templates/login.php';
}
}
示例9: sav_tag
function sav_tag($idtag, $idart, $cat, $tag)
{
if (!$idtag) {
$idtag = add_tag($cat, $tag);
}
$idartag = add_artag($idart, $idtag, $cat, $tag);
return $idartag;
}
示例10: tag2
public function tag2()
{
$tag = $this->input->get("tag");
$title = $this->input->get("title");
$this->load->helper('login_check_helper');
add_tag($title, $tag);
}
示例11: display_error
if (strlen($_POST['name']) == 0) {
display_error(_("The tag name cannot be empty."));
set_focus('name');
return false;
}
return true;
}
//-----------------------------------------------------------------------------------
if ($Mode == 'ADD_ITEM' || $Mode == 'UPDATE_ITEM') {
if (can_process()) {
if ($selected_id != -1) {
if ($ret = update_tag($selected_id, $_POST['name'], $_POST['description'])) {
display_notification(_('Selected tag settings have been updated'));
}
} else {
if ($ret = add_tag($_POST['type'], $_POST['name'], $_POST['description'])) {
display_notification(_('New tag has been added'));
}
}
if ($ret) {
$Mode = 'RESET';
}
}
}
//-----------------------------------------------------------------------------------
function can_delete($selected_id)
{
if ($selected_id == -1) {
return false;
}
$result = get_records_associated_with_tag($selected_id);
示例12: add_tag_relationship
if (isset($post->pTags[strval($dupCheck)])) {
//if duplicate already exists in post
echo '<status>Tag already exists in post.</status>';
//update status
} else {
//if tag does not already exist in post
add_tag_relationship($postID, $dupCheck);
//add relationship
echo "<status>Existing tag added.</status><tag_id>{$dupCheck}</tag_id>";
//update status, tag_id
echo "<tag_body>{$tag}</tag_body>";
//update tag_body
}
} else {
//otherwise create new tag
$newID = add_tag($postID, $tag);
echo "<status>New tag added.</status>";
//update status
echo "<tag_id>{$newID}</tag_id><tag_body>{$tag}</tag_body>";
//update tag_id, tag_body
}
}
} else {
$tagID = substr($tagID, 4);
//get id in int format (splice pTag# -> #)
if (isset($post->pTags[$tagID])) {
//if tag already exists in post
echo "<status>Tag already exists in post.</status>";
//update status
} else {
add_tag_relationship($postID, $tagID);
示例13: pb_add_product
function pb_add_product($user_id)
{
$post_type = $_POST['post_type'];
$product_info = array();
array_push($product_info, array("timestamp" => "" . date("F j, Y, g:i a") . "", "title" => "" . htmlify($_POST['product_title']) . "", "desc" => "" . htmlify($_POST['product_desc']) . "", "tags" => "" . $_POST['product_tags'] . "", "price" => "" . $_POST['product_price'] . "", "condition" => "" . $_POST['product_condition'] . "", "images" => "" . $_POST['product_images'] . ""));
$product_info = json_encode($product_info);
$trans_info = array();
array_push($trans_info, array("completed" => 0, "method" => 0, "sold_to" => 0, "date_sold" => 0));
add_tag($_POST['product_tags'], true);
$expire = fDate(date("F j, Y, g:i a"), '+1 month');
$trans_info = json_encode($trans_info);
return pb_db("INSERT INTO pb_post (type, user_id, product_info, trans_info, status, expires, expires_tick) \n\t\tVALUES ('{$post_type}', '{$user_id}','{$product_info}','{$trans_info}', 'open', '{$expire}', '0')");
}
示例14: Tags_Spider_Video_Player
function Tags_Spider_Video_Player()
{
global $wpdb;
require_once "tag_functions.php";
// add functions for Spider_Video_Player
require_once "tag_function.html.php";
// add functions for vive Spider_Video_Player
if (isset($_GET["task"])) {
$task = htmlspecialchars($_GET["task"]);
} else {
$task = "default";
}
if (isset($_GET["id"])) {
$id = htmlspecialchars($_GET["id"]);
} else {
$id = 0;
}
switch ($task) {
case 'tag':
show_tag();
break;
case 'add_tag':
add_tag();
break;
case 'cancel_tag':
cancel_tag();
break;
case 'apply_tag':
if ($id == 0) {
$save_or_no = save_tag();
} else {
$save_or_no = apply_tag($id);
}
if ($save_or_no) {
edit_tag($id);
} else {
show_tag();
}
break;
case 'save_tag':
if (!$id) {
save_tag();
} else {
apply_tag($id);
}
show_tag();
break;
case 'saveorder':
saveorder();
break;
case 'orderup':
ordertag(-1);
break;
case 'orderdown':
ordertag(1);
break;
case 'edit_tag':
edit_tag($id);
break;
case 'remove_tag':
remove_tag($id);
show_tag();
break;
case 'publish_tag':
change_tag($id);
show_tag();
break;
case 'unpublish_tag':
change_tag($id);
show_tag();
break;
case 'required_tag':
required_tag($id);
show_tag();
break;
case 'unrequired_tag':
required_tag($id);
show_tag();
break;
default:
show_tag();
break;
}
}