Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Unvalidate all in Certain Category

Quote Reply
Unvalidate all in Certain Category
For example within www.needscripts.com directory, would it be possible to unvalidate all the links only within /PHP/ Category?

Thanks for the help.

Vishal

Vishal
-------------------------------------------------------
Quote Reply
Re: [NeedScripts.Com] Unvalidate all in Certain Category In reply to
A) For one-time solution you need to do an SQL query:
1) list all records into a temp table in a category from lsql_catlinks
2) update IsValidated field to No for all records IDs listed in the temp table

B) you need a plugin for this (may be also solved using an unusual global, on a non-public page).

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] Unvalidate all in Certain Category In reply to
In Reply To:
A) For one-time solution you need to do an SQL query:
1) list all records into a temp table in a category from lsql_catlinks
2) update IsValidated field to No for all records IDs listed in the temp table

B) you need a plugin for this (may be also solved using an unusual global, on a non-public page).

Hello there,

Thanks for the quick reply... and your idea does makes sense.. except the fact that I do not know what sql query I need to use to unvalidate the listings once I get the ID numbers of all the listings within certain category?

B) I can do a test install, import entire DB, change the settings to it should display 10,000 link on one page, and then change the link.html page so it will only display the ID number of the listing, I think doing so should give me the ID number of all the listings within any given category within seconds... thanks for the wonderful trick. :)

Now still I am hoping if I can get some help with the sql query to unvalidate all the listings.

Vishal

Vishal
-------------------------------------------------------
Quote Reply
Re: [NeedScripts.Com] Unvalidate all in Certain Category In reply to
As for the SQL query, I should check the docs then try the query in practice, but that would take more time, so I can't afford for free. If you use MySQL 4.x, it allows nested queries, so makes possible to do the task without temp table.
Maybe some SQL guru may give you quick & free answer without checking the docs...

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: [NeedScripts.Com] Unvalidate all in Certain Category In reply to
If your datbase prefix is lsql_, then you could use the following command in SQL Monitor to set the value for isValidated to No for all of the links in a specific category (category identified by its ID number):

Update lsql_Links, lsql_CatLinks
set lsql_Links.isValidated = 'No'
where lsql_Links.ID = lsql_CatLinks.LinkID
and lsql_CatLinks.CategoryID= Put the Category ID Number Here

BUT to be safe I would first create a test field in the Links Database (something like Validate_Test), and then run the above command using Validate_Test instead of isValidated. Then if those links that have the value of No for Validate_Test are the ones you actually want unvalidated, then you can do the above command with the actual isValidated value.

--FrankM
Quote Reply
Re: [FrankM] Unvalidate all in Certain Category In reply to
Hello FrankM,

Thank you for the detailed post, it is very much apprecaited.

I am little confused, suppose if I already have the ID numbers of links, do I still need to have the ID number of category?

Vishal

Vishal
-------------------------------------------------------
Quote Reply
Re: [NeedScripts.Com] Unvalidate all in Certain Category In reply to
Hi,

Actually, you wouldn't need the ID numbers for the links. This is because the CatLinks table has two fields:

LinkID and CategoryID

The SQL commands noted would only find those records in the CatLinks table where the CategoryID matches the one you specify. Then it will only find the Links records where the LinkID matches the CategoryID, and it will then set the isValidated field = No only for those link ID numbers.

So basically you wouldn't need to specify any LinkID's as it can find these from the CatLinks table when you specify the category ID. Kind of confusing, I agree. I tried it and it worked, but I would test it first with a custom field Validate_Test as noted in the previous post. And if you don't feel comfortable doing it, then it might be best not to try as mistakes in SQL Monitor can cause big problems. I just wanted to provide a solution that worked for me.

--Frank

Last edited by:

FrankM: Oct 5, 2004, 8:32 AM