tags1.php
来自「一款基于PHP的网络日记程序。WikyBlog支持:多用户的 BLOG」· PHP 代码 · 共 48 行
PHP
48 行
<?phpif ( !defined('WikyBlog') ){ die("Not an entry point...");}//////////////////////////////////// 2006-March// changing the way keywords are stored..// fixTags() is used to transform the old data to the new format// - must run before the new getKeywords() function is used so we reset $pageOwner['keywords'] immediately// - ////use updateTags($delete,$add) to add the keywords from each rowincludeFile('tool/Tags.php');function fixTags(){ global $pageOwner,$dbInfo,$wbTables; $newArray = array(); //message('Updating Tags'); $query = 'SELECT keywords '; $query .= ' FROM '.$wbTables['all_files']; $query .= ' WHERE (`keywords` IS NOT NULL) '; $query .= ' AND (`keywords` != "") '; $query .= ' AND (owner_id="'.$pageOwner['user_id'].'") '; $query .= ' AND !FIND_IN_SET("hidden", '.$wbTables['all_files'].'.`flags`) '; $query .= ' AND !FIND_IN_SET("deleted", '.$wbTables['all_files'].'.`flags`) '; $result = wbDB::runQuery($query); $num = mysql_num_rows($result); while( $row = mysql_fetch_assoc($result) ){ $newArray = updateTags('',$row['keywords'],$newArray); } $pageOwner['keywords'] = $newArray; $pageOwner['keyupdated'] = 2; $query = 'UPDATE '.$wbTables['users']; $query .= ' SET `modified` = `modified` '; $query .= ' ,`keyword_count` = "" '; $query .= ' WHERE `user_id` = "'.$pageOwner['user_id'].'" '; wbDB::runQuery($query);}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?