Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
daf17518
Commit
daf17518
authored
Aug 07, 2004
by
Steven Wittens
Browse files
- Adding an update to convert old taxonomy URL aliases to new ones.
parent
1e1144f1
Changes
1
Hide whitespace changes
Inline
Side-by-side
database/updates.inc
View file @
daf17518
...
...
@@ -68,7 +68,8 @@
"2004-07-22"
=>
"update_94"
,
"2004-07-30"
=>
"update_95"
,
"2004-08-04"
=>
"update_96"
,
"2004-08-06"
=>
"update_97"
"2004-08-06"
=>
"update_97"
,
"2004-08-07"
=>
"update_98"
);
function
update_32
()
{
...
...
@@ -1282,6 +1283,31 @@ function update_97() {
return
array
();
}
function
update_98
()
{
$result
=
db_query
(
"SELECT pid, src FROM
{
url_alias
}
WHERE src LIKE 'taxonomy/%%'"
,
$from
);
while
(
$alias
=
db_fetch_object
(
$result
))
{
list
(,
$page
,
$op
,
$terms
)
=
explode
(
'/'
,
$alias
->
src
);
if
(
$page
==
'feed'
||
$page
==
'page'
)
{
switch
(
$op
)
{
case
'or'
:
$new
=
'taxonomy/terms/'
.
str_replace
(
','
,
'+'
,
$terms
);
break
;
case
'and'
:
$new
=
'taxonomy/terms/'
.
$terms
;
break
;
}
if
(
$new
)
{
if
(
$page
==
'feed'
)
{
$new
.
=
'/0/feed'
;
}
db_query
(
"UPDATE
{
url_alias
}
SET src = '%s' WHERE pid = '%s'"
,
$new
,
$alias
->
pid
);
}
}
}
return
array
();
}
function
update_sql
(
$sql
)
{
$edit
=
$_POST
[
"edit"
];
$result
=
db_query
(
$sql
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment