Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

Post deleted by ryel01

Quote Reply
Post deleted by ryel01
Quote Reply
Re: Command to alter multiple link & category paths? In reply to
Regan,

If you've only got a few links you can do it manually:

Add the new category names (keep them handy to paste into the links you want to modify)
Search for the links in the categories you are changing and modify them to the new category names
Remove the old category names (and the physical files/directories on your server)
Re-build

If you've got a lot of links to modify you'll probably find it quicker to do with mysql but I'm not sure what the statement should be so maybe someone else can come in here ...

All the best
Shaun

Quote Reply
Re: Command to alter multiple link & category paths? In reply to
In Reply To:
If you've got a lot of links to modify you'll probably find it quicker to do with mysql but I'm not sure what the statement should be so maybe someone else can come in here ...
UPDATE tablename SET Category='Sports & Recreation A-E' WHERE Category='Sports A-E';


easy does it
Quote Reply
Re: Command to alter multiple link & category paths? In reply to
If the category name is longer than:

Sports A-E

eg:

Sports A-E/Camping & Tramping/Reference & Recources

will the command you've given:

UPDATE tablename SET Category='Sports & Recreation A-E' WHERE Category='Sports A-E';

alter the name and keep the full path, or would it truncate it back to be:

Sports A-E

Sorry if thas a stupid question.

Regan.

Quote Reply
Re: Command to alter multiple link & category paths? In reply to
I give you a piece of code I use for something quite similar.. (move an entire subtree from a location to another)

hope that helps...

Code:
my @subs = split("\/", $move_subcat_from);
my $name = pop @subs;
$move_subcat_to ? ($move_subcat_to .= "/$name") : ($move_subcat_to = "$name");
$query = qq! UPDATE Category
SET Name = REPLACE(Name,'$move_subcat_from','$move_subcat_to')
WHERE Name LIKE '$move_subcat_from/%' or
Name = '$move_subcat_from'
!;
$result = $db->do ($query);

ciao


lepo


Lepo - lepo@lepo.org