$alias = $db->real_escape_string($_GET['alias']);
 if ($_POST['accept'] == 1) {
     $tagc = new tag();
     //tag boot, alias boots singular is better.
     $query = "UPDATE {$alias_table} SET status='accepted' WHERE tag='{$tag}' AND alias='{$alias}'";
     $db->query($query);
     //Convert all current posts from the AKA to the tag.
     $query = "SELECT * FROM {$post_table} WHERE tags LIKE '% " . str_replace('%', '\\%', str_replace('_', '\\_', $alias)) . " %'";
     $result = $db->query($query) or die($db->error);
     while ($row = $result->fetch_assoc()) {
         $tags = explode(" ", $row['tags']);
         foreach ($tags as $current) {
             $tagc->deleteindextag($current);
         }
         $tmp = str_replace(' ' . $alias . ' ', ' ' . $tag . ' ', $row['tags']);
         $tags = implode(" ", $tagc->filter_tags($tmp, $tag, explode(" ", $tmp)));
         $tags = mb_trim(str_replace("  ", "", $tags));
         $tags2 = explode(" ", $tags);
         foreach ($tags2 as $current) {
             $tagc->addindextag($current);
         }
         $tags = " {$tags} ";
         $query = "UPDATE {$post_table} SET tags='{$tags}' WHERE id='" . $row['id'] . "'";
         $db->query($query);
     }
 } else {
     if ($_POST['accept'] == 2) {
         $query = "UPDATE {$alias_table} SET status='rejected' WHERE tag='{$tag}' AND alias='{$alias}'";
         $db->query($query);
     }
 }
Exemple #2
0
     }
     if (strpos($current, 'parent:') !== false) {
         $parent = str_replace("parent:", "", $current);
         if (!is_numeric($parent)) {
             $parent = '';
         }
         $query = "SELECT COUNT(*) FROM {$post_table} WHERE id='{$parent}'";
         $result = $db->query($query);
         $row = $result->fetch_assoc();
         if ($row['COUNT(*)'] < 1) {
             $parent = '';
         }
         $current = '';
     }
     if ($current != "") {
         $ttags = $tclass->filter_tags($tags, $current, $ttags);
         $alias = $tclass->alias($current);
         if ($alias !== false) {
             $key_array = array_keys($ttags, $current);
             foreach ($key_array as $key) {
                 $ttags[$key] = $alias;
             }
         }
     }
 }
 $tags = implode(" ", $ttags);
 foreach ($ttags as $current) {
     if ($current != "" && $current != " ") {
         $ttags = $tclass->filter_tags($tags, $current, $ttags);
         if (is_dir("{$main_cache_dir}" . "" . "search_cache/" . $misc->windows_filename_fix($current) . "/")) {
             $cache->destroy_page_cache("search_cache/" . $misc->windows_filename_fix($current) . "/");