Results 1 to 6 of 6

Thread: Delete category with links in it?

  1. #1
    Join Date
    Sep 2002
    Posts
    11

    Default Delete category with links in it?

    Is there a way to delete a category with links in it? When I try to do so it just tells me can't delete category it has links in it. If there is a way around this it would be great.

  2. #2
    Join Date
    Aug 2001
    Location
    Toronto, Ontario
    Posts
    678

    Default

    This is probably a hack request and something that should be considered for future releases. As of right now there's no easy way around it.

  3. #3
    Join Date
    Apr 2003
    Location
    Atlanta GA
    Posts
    3,395

    Default Re: Delete category with links in it?

    Originally posted by starchdoggy
    Is there a way to delete a category with links in it? When I try to do so it just tells me can't delete category it has links in it. If there is a way around this it would be great.
    well, depends on how brave you are. You can use phpmyadmin that is found in your host's control panel as part of the mysql section ( well, most of them use phpmyadmin ).

    first, back up your database and know how to restore it.

    first, you will need the category id. browse the idx_category table and notice the first three columns - caategory_id, parent_id and name.

    then in the SQL box find any links in the category you are trying to delete. Using category_id = 4:

    Code:
    select * from idx_link where category_id = 4 or cat1=4 or cat2=4
    if you have sub-categories you will need to search thru all the subcats of the parent and then search the parent.

    if you don't want to delete the link, change the appropriate subcat, cat1 or cat2 for the link

    the safe thing to do at this point is to go to your INDEXU admin control panel and delete the links.

    do this for all subcats and the parent


    ************************ ************************* ************************
    if you want to use SQL ( this is the dangerous part )

    Code:
    delete from idx_link where category_id = 4 or cat1=4 or cat2=4
    do this for all subcats and the parent

    use your INDEXU admin control panel and delete the category.

    I haven't test this but the syntax is simple. just watch the typing.

    One thing that you can do before running the delete command is something like the following:

    Code:
    update idx_link set category_id=99999 where category_id = 4 or cat1=4 or cat2=4
    then run a select command to review those links to make sure they are the ones you want to delete

    Code:
    select * from idx_link where category_id = 99999
    when you are satisfied

    Code:
    delete from idx_link where category_id = 99999
    unless you have a lot of links, it is better to delete from the admin control panel.
    esm
    "The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."

    .

  4. #4
    Join Date
    Aug 2001
    Location
    Indonesia
    Posts
    3,732

    Default

    This could be a dangerous feature for many users. You must be careful

  5. #5
    Join Date
    Apr 2003
    Location
    Atlanta GA
    Posts
    3,395

    Default

    I am glad you posted that. even though I said it was dangerous, having you point that out also at least warns them.
    esm
    "The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."

    .

  6. #6
    Join Date
    Aug 2001
    Location
    Indonesia
    Posts
    3,732

    Default

    esm, yeah a simple javascript will do

Similar Threads

  1. Delete 800 links one at a time ?
    By killipso in forum v5.x
    Replies: 2
    Last Post: 01-26-2004, 10:55 AM
  2. delete links and categories
    By egi in forum v5.x
    Replies: 2
    Last Post: 12-19-2002, 10:04 AM
  3. How to?
    By Che Guevara in forum v5.x
    Replies: 1
    Last Post: 08-28-2001, 06:48 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •