Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Category Clean Up

Quote Reply
Category Clean Up
Ok, I am starting to see that whenever I execute an SQL statement on one of my tables, this could have disasterous consequences on any number of the other tables. Unfortunatley this leaves me really wondering how to do a few things:
  • Moving Links - This has been discussed in the post: http://www.gossamer-threads.com/perl/gforum/gforum.cgi?post=187169, and unfortunatly does not work because it causes the category counts to become incorrect.
  • Delete categories which contain zero links, do not have child directories and have a parent category with the title "Cites" for example. This is a common house keeping task for me, especially after an import. I get the feeling I cannot just DELETE FROM lsql_Category WHERE Number_of_Links=0 AND (somekind of check for the title of the parent category) as this would not adjust the other tables accordingly.
  • Removing duplicate links from the same category only, and when doing this keeping the link which has a user other than 'admin'. In otherwords only remove links which dont belong to a user! This is a big one for me, and I'd LOVE to know how to do this safely! This is also something I would like to see in the editor panel as an assigned privilledge. It stops editor removing links which belong to users ie don't give them delete privilleges per say, just this safe, remove duplicates from current directory function. Yes?


Other Wants (not necessarily needs) I am thinking about for house keeping, is:
  • Swear remover.... cgi which searches your link titles, descriptions and reviews for certain words and replaces them with symbols or whatever you specify... it. F*** could become F*** (if you get my drift)
  • Initial Capitals - "THE DOG IN THE HOUSE", "The dog in the House" etc becomes "The Dog in The House" just like word, or wordperfect does. I have seen a function for this in visual basic somewhere... but a cgi which goes through your Category titles and does this would be an excellent way of keeping your thousands of categories in good order, especially when editors are not always following your guidelines!

    If anyone has any solid methods for housekeeping links and categories with SQL (for time saving) I'd love to hear from you!

Last edited by:

sooke: May 1, 2002, 2:54 PM
Quote Reply
Re: [sooke] Category Clean Up In reply to
Sooke,

About your suggestion:
"Removing duplicate links from the same category only".

I implemented something similar into Links 2.0.
Features was:
- link posting is denied, if a duplicate record exists already in the same category
- in case of deny, both posted & duplicate record is displayed
- on admin interface there was possible to list all duplicate records sitewide, so you were able to select those to delete (as I remember this was built originally into Links 2.0)

This feature may be subject to think about to create a plugin for it. Wink

Best regards,
Webmaster33


Paid Support
from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...
Quote Reply
Re: [webmaster33] Category Clean Up In reply to
It sounds similar to what I want for this.... nice!

I still want someone to be able to submit if there is a duplicate - only if the duplicate is owned by 'admin' though.... in otherwords, replace the admin with their one. I wasnt sure if this is what you are thinking with this.

I am hoping that this may be a possible 'include' for a future version of links. If not, a plugin would be greatWink
Quote Reply
Re: [webmaster33] Category Clean Up In reply to
Re: Removing duplicate links from the same category:

I guess this would be a mod to the existing duplicate links checker, which is site (database) wide.

I am thinking when there may be an SQL solution to this, but it would be much better right out the links control panel.

I like the idea of site-wide fixes, which go through in one swoop, and remove all duplicate links which occur in any same category, taking the links which have a LinkOwner of 'admin' only, and leaving the user submitted ones. This is an especially useful function if you have editors adding links and you cannot check 30,000 categories manually.

Is this just useful to someone who has editors, or to anyone? I think if you have a site which lets users sumit without admin validation, this would also come in handy. It could go into our proposed editor plugin? Or into a housekeeping, or tools pluginCool

Last edited by:

sooke: May 9, 2002, 12:35 PM
Quote Reply
Re: [sooke] Category Clean Up In reply to
Not really.
Once I developed duplicate checking & denying at link submit feature, I've never ever need to use again the Duplicate checker from the admin interface (always showed no duplicates Wink)
I changed the logic of duplicates, and I deny right at the link adding. I found it the best solution.

Best regards,
Webmaster33


Paid Support
from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...

Last edited by:

webmaster33: May 9, 2002, 10:05 PM
Quote Reply
Re: [webmaster33] Category Clean Up In reply to
I agree with you, and that is a great solution.... unless you do imports from more than one source on a regular basis. This means you may end up with many, many duplications.
Quote Reply
Re: [webmaster33] Category Clean Up In reply to
I guess I cannot write something to check duplicates in the same cateogry, as removing a duplicate links wouuld affect other tables such as catlinks.Unsure I feel this is a good tool for checking categories which editors are involved in.

Alex, is there a way I can do this, or is this something you might add to the duplicate checker?
Quote Reply
Re: [sooke] Category Clean Up In reply to
>>
I guess I cannot write something to check duplicates in the same cateogry, as removing a duplicate links wouuld affect other tables such as catlinks.
<<

Deleting from the links table automatically handles the CatLinks table and deletes the row.
Quote Reply
Re: [Paul] Category Clean Up In reply to
You mean when I delete from within the Links Admin of course?

Or do you mean I can use an sql statement in my own code, and it will effect the change?

(this might sound a little retarded, but just need to clarify my understanding of thisWink)
Quote Reply
Re: [sooke] Category Clean Up In reply to
Yes anything using the $DB object.
Quote Reply
Re: [Paul] Category Clean Up In reply to
Thanks Paul!

This means I can write something to clean up my categories. This thread is not over yetWink

Gosh I have some writing to do today! It won't be anything as spectacular as the "camel code", but i'll be giving it a go!