Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Admin search bool

Quote Reply
Admin search bool
Hi,

When I go to Database--> Category---> Delete

How can I set the "Name" field to search by the "or" bool?


Even if I type "or" between the keywords it won't work


Thank you for any help.
Quote Reply
Re: [shimmy1] Admin search bool In reply to
Mmm, I don't think you can actuall do that. Why do you want to? It may be easier for you to use "Browse" if you are deleting a lot of them :)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Admin search bool In reply to
I just need to delete a lot, and doing it in browse is very time consuming
Quote Reply
Re: [shimmy1] Admin search bool In reply to
Hi,

You could make a little global to do it.

BE SURE TO BACKUP YOUR DATABASE FIRST THOUGH, JUST IN CASE!!!

delete_categories
Code:
sub {
my $cond = GT::SQL::Condition->new(
'Full_Name' => 'the/full/name',
'Full_Name' => 'the/full/name2',
'Full_Name' => 'the/full2/name'
);
$cond->bool("OR");

my $sth = $DB->table('Category')->delete( $cond ) || die $GT::SQL::error;

return "done...";

}

Then make a new template called test.html, and put inside it:

Code:
<%delete_categories%>

Then run this from your browser:

page.cgi?p=test

This should then delete the categories that match your condition.

I can't stress enough how careful you need to be when doing this... so do be sure to make a backup

Also, once this has been run successfully, be sure to remove that global :)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Admin search bool In reply to
okay , thanks, this will help. just wish there was a way I could could search for a list of keywords in the category names and select the ones I want to delete instead of having to name all the exact categories, but looks like there is no way to do that.
Quote Reply
Re: [shimmy1] Admin search bool In reply to
You could always do it using a SQL query to grab the category name:

Code:
SELECT ID,Full_Name FROM glinks_Category WHERE Full_Name LIKE '%keyword%'

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Admin search bool In reply to
okay, I tried that, but It wouldn't let me search for more than 1 keyword at a time. Is that possible?
Quote Reply
Re: [shimmy1] Admin search bool In reply to
With the SQL query in my last post? You can use it to enter as many as you want... for example:

Code:
SELECT ID,Full_Name FROM glinks_Category WHERE
Full_Name LIKE '%keyword%'
OR Full_Name LIKE '%another keyword%'
OR Full_Name LIKE '%and another%'

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!