本文整理汇总了PHP中add_tags函数的典型用法代码示例。如果您正苦于以下问题:PHP add_tags函数的具体用法?PHP add_tags怎么用?PHP add_tags使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了add_tags函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: db_correction
function db_correction()
{
$db_connect = mysqli_connect('localhost', 'root', '', 'ddn');
$query = "SELECT news_id, news_content FROM news";
if ($res = mysqli_query($db_connect, $query)) {
while ($row = mysqli_fetch_assoc($res)) {
$arr[] = $row;
}
foreach ($arr as $row) {
$text1 = $row['news_content'];
$id = $row['news_id'];
$text2 = add_tags($text1);
if ($text2['change']) {
$text = $text2['text'];
$query = "UPDATE news " . "SET news_content={$text} " . "WHERE news_id={$id}";
mysqli_query($db_connect, $query);
}
}
}
}
示例2: display_html
echo "<td width='80%' class='tbl'><textarea name='page_content' cols='100' rows='25' class='textbox' style='width:98%'>" . $page_content . "</textarea></td>\n";
echo "</tr>\n<tr>\n";
if (!isset($_COOKIE['custompages_wysiwyg_editor']) || !$_COOKIE['custompages_wysiwyg_editor'] || !$settings['wysiwyg_enabled']) {
echo "<td class='tbl'></td><td class='tbl'>\n";
echo "<input type='button' value='<?php?>' class='button' style='width:60px;' onclick=\"addText('page_content', '<?php\\n', '\\n?>');\" />\n";
echo "<input type='button' value='<p>' class='button' style='width:35px;' onclick=\"addText('page_content', '<p>', '</p>');\" />\n";
echo "<input type='button' value='<br />' class='button' style='width:40px;' onclick=\"insertText('page_content', '<br />');\" />\n";
echo display_html("inputform", "page_content", true) . "</td>\n";
echo "</tr>\n";
}
if ($settings['enable_tags']) {
if ($request_edit && $request_page_id) {
echo edit_tags($request_page_id, "C");
// Pimped: tag
} else {
echo add_tags("C");
// Pimped: tag
}
}
echo "<tr>\n";
echo "<td width='100' class='tbl'>" . $locale['431'] . "</td>\n";
// meta
echo "<td class='tbl'><input type='text' name='page_keywords' value='" . $page_keywords . "' class='textbox' style='width:250px;' /></td>\n";
echo "</tr>\n<tr>\n";
if (!check_admin_pass(isset($_POST['admin_password']) ? stripinput($_POST['admin_password']) : "")) {
echo "<td class='tbl'>" . $locale['425'] . "</td>\n";
echo "<td class='tbl'><input type='password' name='admin_password' value='" . (isset($_POST['admin_password']) ? stripinput($_POST['admin_password']) : "") . "' class='textbox' style='width:150px;' /></td>\n";
echo "</tr>\n<tr>\n";
}
echo "<td class='tbl'></td><td class='tbl'>\n";
if (!$request_page_id) {
示例3: _die
<?php
/* Adds a post to the database */
if (!(isset($_POST) && @$_POST['title'] != '')) {
_die("tpl/post_form.html");
}
include "lib/post.php";
include "lib/tags.php";
$post_data =& $_POST;
foreach (array('title', 'contents', 'tags', 'time', 'slug') as $key) {
$post_data[$key] = pg_escape_string(@$post_data[$key]);
}
$post_data['tags'] = clean_tags($post_data['tags']);
if (trim($post_data['slug']) == '') {
$post_data['slug'] = make_slug($post_data['title']);
}
if (!($time = strtotime(@$post_data['time']))) {
$time = date("Y-m-d H:i:s O", time());
} else {
$time = date("Y-m-d H:i:s O", $time);
}
if (db('INSERT INTO "public"."notes" ("title", "contents", "slug", "tags", "time") VALUES (' . "\n\t'{$post_data['title']}','{$post_data['contents']}','{$post_data['slug']}','{$post_data['tags']}','{$time}' )")) {
add_tags($post_data['tags']);
header('Location: ' . _l("/archive/{$_POST['slug']}"));
} else {
_die("Some error occoured. Try again.");
}
示例4: json_decode
$res = null;
// decode and unpack data
if (@$_REQUEST['data']) {
$data = json_decode(urldecode(@$_REQUEST['data']), true);
switch (@$_REQUEST['action']) {
case 'delete_bookmark':
$res = delete_bookmarks($data);
break;
case 'add_wgTags_by_id':
$res = add_wgTags_by_id($data);
break;
case 'remove_wgTags_by_id':
$res = remove_wgTags_by_id($data);
break;
case 'add_tags':
$res = add_tags($data);
break;
case 'remove_tags':
$res = remove_tags($data);
break;
case 'bookmark_reference':
$res = bookmark_references($data);
break;
case 'bookmark_and_tag':
case 'bookmark_and_tags':
//save collection of ids with some tag
$res = bookmark_and_tag_record_ids($data);
break;
case 'set_ratings':
$res = set_ratings($data);
break;
示例5: array
$datas = array();
$errors = array();
$warnings = array();
$infos = array();
foreach ($images as $image) {
// Fech reverse location from API
$condition = $forecast->getHistoricalConditions($image['latitude'], $image['longitude'], $image['date']);
if (!isset($condition) or $condition === 'false') {
$errors[] = "Error fetching weather condition data for " . $image['name'];
}
//print_r($condition);
// If reponse include icon
if (isset($condition) and isset($condition->icon) and !empty($condition->icon)) {
if (!$sync_options['simulate']) {
$id = tag_id_from_tag_name($sync_options['fc_tag_group'] . ":" . $condition->icon);
add_tags([$id], [$image['id']]);
}
$infos[] = "Set tag '" . $condition->icon . "' for " . $image['name'];
$datas[] = $image['id'];
} else {
$warnings[] = "No valid tags for " . $image['name'];
}
//die("Done one image");
}
// Images loop
// Send sync result to template
$template->assign('sync_errors', $errors);
$template->assign('sync_warnings', $warnings);
$template->assign('sync_infos', $infos);
// Send result to templates
$template->assign('metadata_result', array('NB_ELEMENTS_DONE' => count($datas), 'NB_ELEMENTS_CANDIDATES' => count($images), 'NB_ERRORS' => count($errors), 'NB_WARNINGS' => count($warnings)));
示例6: gmdate
$dt = gmdate('Y-m-d H:i:s');
$hash = md5($dt . $to_email . $message);
$hash = md5($dt . $email . $message);
$db->query($db->prepare("INSERT INTO {$db->threads} ( hash, dt, email, subject ) VALUES ( %s, %s, %s, %s )", $hash, $dt, $to_email, $subject));
$thread_id = $db->insert_id;
$db->query($db->prepare("INSERT INTO {$db->messages} ( hash, thread_id, dt, email, content ) VALUES ( %s, %s, %s, %s, %s )", $hash, $thread_id, $dt, "support+{$current_user->user_login}@{$email_domain}", $message));
// Status stuff
$status = 'open';
if (isset($_POST['sendtickle'])) {
$status = 'tickle';
}
if (isset($_POST['sendclose'])) {
$status = 'closed';
}
if ($tags) {
add_tags($thread_id, $tags);
}
$count = $db->get_var("SELECT COUNT(*) FROM {$db->messages} WHERE thread_id = {$thread_id}");
$db->query("UPDATE {$db->threads} SET messages = {$count}, state = '{$status}' WHERE thread_id = {$thread_id}");
$name = "{$current_user->first_name} {$current_user->last_name}";
$reply = str_replace(array("\r\n", "\r"), "\n", $reply);
// cross-platform newlines
$reply = preg_replace("/\n\n+/", "\n\n", $reply);
// take care of duplicates
$reply .= "\n\n-- \n{$name}";
wp_mail($to_email, $subject, $message, "From: {$name} <{$support_email}>\nReply-to: {$name} <{$support_email}>\nMessage-Id: <{$hash}@{$email_domain}>");
if ('closed' == $status) {
header('Location: ' . $site_url);
} else {
header('Location: thread.php?t=' . $thread_id);
}
示例7: foreach
<p>We have a great selection of musical instruments including
guitars, basses, and drums. And we're constantly adding more to give
you the best selection possible!
</p>
<table>
<?php
foreach ($products as $product) {
// Get product data
$list_price = $product['listPrice'];
$discount_percent = $product['discountPercent'];
$description = $product['description'];
// Calculate unit price
$discount_amount = round($list_price * ($discount_percent / 100.0), 2);
$unit_price = $list_price - $discount_amount;
// Get first paragraph of description
$description_with_tags = add_tags($description);
$i = strpos($description_with_tags, "</p>");
$first_paragraph = substr($description_with_tags, 3, $i - 3);
?>
<tr>
<td class="product_image_column" >
<img src="images/<?php
echo htmlspecialchars($product['productCode']);
?>
_s.png"
alt=" ">
</td>
<td>
<p>
<a href="catalog?product_id=<?php
echo $product['productID'];
示例8: date
}
if ($game['leaderboard_enabled'] == true) {
$highscores = 1;
} else {
$highscores = 0;
}
$date = date("Y-m-d H:i:s");
$default_ad = $feed_setting['default_ad'];
$seo_url = create_seoname($name, 0, 'game');
mysql_query("INSERT INTO ava_games (name, description, url, category_id, published, filetype, width, height, image, instructions , mochi, date_added, advert_id, highscores, mochi_id, seo_url)\nVALUES ('{$name}', '{$description}', '{$url}', '{$category}', 1, 'swf', '{$game['width']}', '{$game['height']}', '{$thumb_url}', '{$instructions}', 1, '{$date}', {$default_ad}, {$highscores}, '{$game['game_tag']}', '{$seo_url}')") or die(mysql_error());
$new_id = mysql_insert_id();
mysql_query("UPDATE ava_mochi SET visible='2' WHERE gametag='{$game['game_tag']}'");
$tag_list = '';
$ti = 0;
print_r($game['tags']);
foreach ($game['tags'] as $game_tags) {
if ($ti == 1) {
$tag_list = $tag_list . ',' . $game_tags;
} else {
$tag_list = $tag_list . $game_tags;
$ti = 1;
}
}
// Add game tags
if ($feed_setting['get_tags'] == 1) {
$tags = str_replace(" ", "", $tag_list);
$tag_array = explode(",", $tags);
add_tags($tag_array, $new_id);
include 'tagcloud_gen.php';
}
}
示例9: add_tags
echo "<td valign='top' width='145' class='tbl2'>" . $locale['463'] . "</td>\n";
echo "<td class='tbl1'>\n";
if (iMOD || iSUPERADMIN) {
echo "<label><input type='checkbox' name='sticky_thread' value='1'" . $sticky_thread_check . " /> " . $locale['480'] . "</label><br />\n";
echo "<label><input type='checkbox' name='lock_thread' value='1'" . $lock_thread_check . " /> " . $locale['481'] . "</label><br />\n";
}
echo "<label><input type='checkbox' name='disable_smileys' value='1'" . $disable_smileys_check . " /> " . $locale['482'] . "</label>";
if (array_key_exists("user_sig", $userdata) && $userdata['user_sig']) {
echo "<br />\n<label><input type='checkbox' name='show_sig' value='1'" . $sig_checked . " /> " . $locale['483'] . "</label>";
}
if ($settings['thread_notify']) {
echo "<br />\n<label><input type='checkbox' name='notify_me' value='1'" . $notify_checked . " /> " . $locale['486'] . "</label>";
}
echo "</td>\n</tr>\n";
if ($settings['enable_tags']) {
echo add_tags("F", "tbl2");
// Pimped: tag
}
if ($fdata['forum_attach'] && checkgroup($fdata['forum_attach'])) {
add_to_head("<script src='" . INCLUDES_JS . "multiupload.js' type='text/javascript'></script>");
// Pimped: Multi-Upload
echo "<tr>\n<td width='145' class='tbl2'>" . $locale['464'] . "</td>\n";
$attachtypes = explode(",", $settings['attachtypes']);
$insert_type = '';
$x = true;
foreach ($attachtypes as $type) {
if (substr($type, 0, 1) == '.') {
$type = substr($type, 1);
}
$insert_type .= ($x == false ? '|' : '') . $type;
$x = false;
示例10: clean_text_with_tags
function clean_text_with_tags($string, $wrap=0, $replace_nl=true, $maxlength=0) {
$string = add_tags(clean_text($string, $wrap, $replace_nl, $maxlength));
$string = preg_replace_callback('/(?:<|<)(\/{0,1})(\w{1,6})(?:>|>)/', 'enable_tags_callback', $string);
$string = close_tags($string);
$string = preg_replace('/<\/(\w{1,6})>( *)<(\1)>/', "$2", $string); // Deletes useless close+open tags
//$string = preg_replace('/<(\/{0,1}\w{1,6})>( *)<(\1)>/', "<$1>$2", $string); // Deletes repeated tags
return $string;
}
示例11: array_push
array_push($tag_ids, tag_id_from_tag_name($sync_options['osm_tag_group'] . ":" . $response['address']['country']));
array_push($tag_names, $response['address']['country']);
}
if (isset($response['address']['postcode']) and $sync_options['osm_tag_address_postcode']) {
array_push($tag_ids, tag_id_from_tag_name($sync_options['osm_tag_group'] . ":" . $response['address']['postcode']));
array_push($tag_names, $response['address']['postcode']);
}
if (isset($response['address']['country_code']) and $sync_options['osm_tag_address_country_code']) {
array_push($tag_ids, tag_id_from_tag_name($sync_options['osm_tag_group'] . ":" . $response['address']['country_code']));
array_push($tag_names, $response['address']['country_code']);
}
//print_r($tag_ids);
//print_r($tag_names);
if (!empty($tag_ids) and !empty($tag_names)) {
if (!$sync_options['simulate']) {
add_tags($tag_ids, [$image['id']]);
}
$datas[] = $image['id'];
$infos[] = "Set tags '" . osm_pprint_r($tag_names) . "' for " . $image['name'];
} else {
$warnings = "No valid tags for " . $image['name'] . " available tag: " . osm_pprint_r(array_keys($response['address']));
}
}
//die("Done one image");
}
// Images loop
// Send sync result to template
$template->assign('sync_errors', $errors);
$template->assign('sync_warnings', $warnings);
$template->assign('sync_infos', $infos);
// Send result to templates
示例12: delete_tag
<div class="banner"><h2>Workgroup Tags</h2></div>
<?php
}
?>
<div id="page-inner">
Unlike personal tags, which can be freely added by individual users while editing data and apply only to that user,
workgroup tags are a controlled list of shared tags established by a workgroup administrator.
<br>The list below only shows workgroups of which you are an administrator. <br>
<?php
if (array_key_exists('deleting', $_REQUEST) && $_REQUEST['deleting']) {
delete_tag();
} else {
if (array_key_exists('adding', $_REQUEST) && $_REQUEST['adding']) {
add_tags();
}
}
?>
<form method="post">
<br>Note: Deleting a tag deletes all references to that tag.
<p>To add new tags, type a tag into the blank field at the end of a workgroup and hit [enter] or click this button:
<input type="submit" value="Add workgroup tag(s)">
<?php
if (@$_REQUEST['popup'] == "yes") {
?>
<input type="button" value="Close Form" onclick="{window.close('bla');}">
<?php
}
示例13: display_html
echo "<tr>\n<td valign='top' width='100' class='tbl'>" . $locale['425'] . "</td>\n";
echo "<td class='tbl'><textarea name='body2' cols='95' rows='10' class='textbox' style='width:98%'>" . $body2 . "</textarea></td>\n";
echo "</tr>\n";
if (!isset($_COOKIE['articles_wysiwyg_editor']) || !$_COOKIE['articles_wysiwyg_editor'] || !$settings['wysiwyg_enabled']) {
echo "<tr>\n<td class='tbl'></td><td class='tbl'>\n";
echo "<input type='button' value='" . $locale['432'] . "' class='button' style='width:80px;' onclick=\"insertText('body2', '<--PAGEBREAK-->');\" />\n";
echo display_html("inputform", "body2", true, true, true, IMAGES_A);
echo "</td>\n</tr>\n";
}
if ($settings['enable_tags']) {
if (isset($_GET['action']) && $_GET['action'] == "edit" && (isset($_POST['article_id']) && isnum($_POST['article_id']) || isset($_GET['article_id']) && isnum($_GET['article_id']))) {
$id = isset($_POST['article_id']) ? $_POST['article_id'] : $_GET['article_id'];
echo edit_tags($id, "A");
// Pimped: tag
} else {
echo add_tags("A");
// Pimped: tag
}
}
echo "<tr>\n";
echo "<td width='100' class='tbl'>" . $locale['435'] . "</td>\n";
// meta
echo "<td class='tbl'><input type='text' name='article_keywords' value='" . $article_keywords . "' class='textbox' style='width:250px;' /></td>\n";
echo "</tr>\n<tr>\n";
echo "<td class='tbl'></td><td class='tbl'>\n";
echo "<label><input type='checkbox' name='article_draft' value='yes'" . $draft . " /> " . $locale['426'] . "</label><br />\n";
if (!isset($_COOKIE['articles_wysiwyg_editor']) || !$_COOKIE['articles_wysiwyg_editor'] || !$settings['wysiwyg_enabled']) {
echo "<label><input type='checkbox' name='line_breaks' value='yes'" . $breaks . " /> " . $locale['427'] . "</label><br />\n";
}
echo "<label><input type='checkbox' name='article_comments' value='yes'" . $comments . " /> " . $locale['428'] . "</label><br />\n";
echo "<label><input type='checkbox' name='article_ratings' value='yes'" . $ratings . " /> " . $locale['429'] . "</label></td>\n";
示例14: isset
<?php
require_once '_init.php';
/*foreach($_POST as $key=>$value) {
echo $key." = ".$value;
}*/
$id = $_POST['id'];
$tags = isset($_POST['tags' . '_' . $id]);
$from = $_POST['from'];
$tipo = $_POST['mediatype'];
$arrayCampos = array('titulo' . '_' . $id, 'texto' . '_' . $id, 'fuente' . '_' . $id, 'preview' . '_' . $id);
if (makeUpdateQuery($arrayCampos, $id, true, 'files', true)) {
$out[] = array('mode' => 'update media info', 'success' => 'true', 'arrayCampos' => $arrayCampos);
} else {
$out[] = array('mode' => 'update media info', 'success' => 'false', 'arrayCampos' => $arrayCampos);
}
if ($tags && add_tags($tags, $id, $from, 'files', $tipo)) {
$out[] = array('mode' => 'add tags to media', 'success' => 'true', 'tags' => $tags);
}
echo json_encode($out);
示例15: isset
echo "</select> : <select name='news_end[minutes]' class='textbox'>\n";
for ($i = 0; $i <= 60; $i++) {
echo "<option" . (isset($news_end['minutes']) && $news_end['minutes'] == $i ? " selected='selected'" : "") . ">{$i}</option>\n";
}
echo "</select> : 00 " . $locale['429'] . "</td>\n";
echo "</tr>\n<tr>\n";
echo "<td class='tbl'>" . $locale['430'] . "</td>\n";
echo "<td class='tbl'><select name='news_visibility' class='textbox'>\n" . $visibility_opts . "</select></td>\n";
echo "</tr>\n";
if ($settings['enable_tags']) {
if (isset($_GET['action']) && $_GET['action'] == "edit" && (isset($_POST['news_id']) && isnum($_POST['news_id']) || isset($_GET['news_id']) && isnum($_GET['news_id']))) {
$id = isset($_POST['news_id']) ? $_POST['news_id'] : $_GET['news_id'];
echo edit_tags($id, "N");
// Pimped: tag
} else {
echo add_tags("N");
// Pimped: tag
}
}
echo "<tr>\n";
echo "<td width='100' class='tbl'>" . $locale['441'] . "</td>\n";
// meta
echo "<td class='tbl'><input type='text' name='news_keywords' value='" . $news_keywords . "' class='textbox' style='width:250px;' /></td>\n";
echo "</tr>\n<tr>\n";
echo "<td class='tbl'></td><td class='tbl'>\n";
echo "<label><input type='checkbox' name='news_draft' value='yes'" . $news_draft . " /> " . $locale['431'] . "</label><br />\n";
echo "<label><input type='checkbox' name='news_sticky' value='yes'" . $news_sticky . " /> " . $locale['432'] . "</label><br />\n";
if (!isset($_COOKIE['news_wysiwyg_editor']) || !$_COOKIE['news_wysiwyg_editor'] || !$settings['wysiwyg_enabled']) {
echo "<label><input type='checkbox' name='line_breaks' value='yes'" . $news_breaks . " /> " . $locale['433'] . "</label><br />\n";
}
echo "<label><input type='checkbox' name='news_comments' value='yes' onclick='SetRatings();'" . $news_comments . " /> " . $locale['434'] . "</label><br />\n";