当前位置: 首页>>代码示例>>PHP>>正文


PHP add_tag函数代码示例

本文整理汇总了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;
}
开发者ID:nchiapol,项目名称:ecamp,代码行数:12,代码来源:template.php

示例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();
开发者ID:BGCX261,项目名称:zishashop-svn-to-git,代码行数:31,代码来源:user.php

示例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;
}
开发者ID:seanguo166,项目名称:yinoos,代码行数:33,代码来源:user.php

示例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;
开发者ID:xiaoxiaowu007,项目名称:jicai,代码行数:31,代码来源:user.php

示例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));
    }
}
开发者ID:sitracker,项目名称:sitracker_old,代码行数:21,代码来源:tags.inc.php

示例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");
开发者ID:supriyadas,项目名称:machprinciplenew,代码行数:31,代码来源:user_post.php

示例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?");
//.........这里部分代码省略.........
开发者ID:MichaelEniolade,项目名称:MechrisPlanetWebsite,代码行数:101,代码来源:Player.php

示例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';
    }
}
开发者ID:xmar,项目名称:laclef-webapp,代码行数:25,代码来源:controllers.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;
}
开发者ID:philum,项目名称:cms,代码行数:8,代码来源:meta.php

示例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);
 }
开发者ID:divyat09,项目名称:Discussion-Forum,代码行数:7,代码来源:Welcome.php

示例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);
开发者ID:pthdnq,项目名称:ivalley-svn,代码行数:31,代码来源:tags.php

示例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);
开发者ID:jkrusinski,项目名称:my_blog,代码行数:31,代码来源:add_tag.php

示例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')");
}
开发者ID:JosephsPlace,项目名称:PccBay,代码行数:13,代码来源:commonFunctions.php

示例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;
    }
}
开发者ID:voquanghoa,项目名称:WebPhim,代码行数:84,代码来源:Player.php


注:本文中的add_tag函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。