Rev | Line | |
---|
[12554] | 1 | <?php |
---|
| 2 | |
---|
| 3 | function plugin_activate() |
---|
| 4 | { |
---|
| 5 | // Update all url name for tags |
---|
| 6 | include_once('main.inc.php'); |
---|
| 7 | $query = 'SELECT * FROM '.TAGS_TABLE.';'; |
---|
| 8 | $result = pwg_query($query); |
---|
| 9 | |
---|
| 10 | $datas = array(); |
---|
| 11 | while ($row = pwg_db_fetch_assoc($result)) |
---|
| 12 | { |
---|
| 13 | array_push( |
---|
| 14 | $datas, |
---|
| 15 | array( |
---|
| 16 | 'id' => $row['id'], |
---|
[28633] | 17 | 'url_name' => trigger_change('render_tag_url', $row['name']) |
---|
[12554] | 18 | ) |
---|
| 19 | ); |
---|
| 20 | } |
---|
| 21 | |
---|
| 22 | if (!empty($datas)) |
---|
| 23 | { |
---|
| 24 | mass_updates( |
---|
| 25 | TAGS_TABLE, |
---|
| 26 | array('primary' => array('id'), 'update' => array('url_name')), |
---|
| 27 | $datas |
---|
| 28 | ); |
---|
| 29 | } |
---|
| 30 | } |
---|
| 31 | |
---|
| 32 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.