Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

New Data Into Search Pages

Quote Reply
New Data Into Search Pages
Hey!

I wanted to add new data into search pages. I will start a new table- called "Name" I want the data from the fields of Name- "Name", "Birth" "Death" and a few other fields to be returned when I search.

I can edit search.cgi to do this I guess, but I figured I could also do this from a global. There would be a switch in the searcghh url (se=1) and if that was set, I would want to check for info in Name, and return it.

So the global would have to take the query term, and search Name for term, and return all the fields as "Name=xxxxxx", "Birth=xxxxxx" "Death=xxxx"

Is this the right way to do this... and how would I return more than one field in globals? Is that called a "Hash"???
dave

Big Cartoon DataBase
Big Comic Book DataBase
Quote Reply
Re: [carfac] New Data Into Search Pages In reply to
Mmm, if thats all you wanna do - why not just make a new search_quick.cgi script , and do the searching from there? Makes more sense than trying to do it via globals/ pluign hooks :)

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] New Data Into Search Pages In reply to
Hi Andy!

How are you? Hope all is well across the pond!

I could do that, too. Not sure the best way to approach this. STILL want to run searches, and run this concurrently.

You know my site... so let me tell you where I am going. I want to be able to go to a cartoon, let's say "The Wonder Gloves" (http://www.bcdb.com/cartoon/4762-Wonder_Gloves.html)

From there, you can see I have "linked" Director, producer, etc. directly into search. This is only doing OK... I want to do a bit better. I would like the first page of the results to have a mini-bio at the top, and that is what this is meant to do.

So click on "Robert 'Bobe' Cannon" (Director).. See how I modded the search_reults.html to recognize this guy is a director... and name him as such? I also want his birth and death dates, and a mini bio there. I figgered since I was already using Search to do this, I might as well stay doing tht, and just add bio and dates in with a global.

Unless you think I should make a new search script- search_bio.cgi. I COULD do that, if that would be better...

My other problem is that Bob went by another could names.... Bob Cannon , Bobe Cannon , R. Cannon etc. It woiuld be WAY cool if I could get ALL those results in one. I am thinking to add Bob in with this:

Robert Cannon (as Bob Cannon)

And then I could use perl to take the " (as Bob Cannon)" for searches.

Whatever- I am looking at a LOT of work to get thjis all working well.
dave

Big Cartoon DataBase
Big Comic Book DataBase
Quote Reply
Re: [carfac] New Data Into Search Pages In reply to
Quote:
How are you? Hope all is well across the pond!

Yeah good thanks :)

Ok, so if you already have the directors name - you just wnana grab it from a table?

Just do with with a global I guess:

get_director_details
Code:
sub {
my $director_details = $DB->table('Director_Details')->select( { Director => $_[0] } )->fetchrow_hashref;
return $director_details;
}
..then call with:

Code:
<%get_director_details($Director)%>

..or whatever you call it with.

Not sure what else to suggest otherwise :)

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] New Data Into Search Pages In reply to
I think this may work, quick and easy.

I just coded it in, and got an error.

I put '<%get_director_details($Director)%>' into the search_results.html, and then threw up some random fields from the table (<%Name%><%Birth%>)

It errored out, with this on the results page:

Error: Variable 'get_director_details' is not a code reference Dave KochUnknown Tag: 'Birth'

So it took Name from my logged in name, and did not recognize the field Birth... and the code I usewd to call this into the page (<%get_director_details($Director)%>) did not work...

I named the Global "director_details"- figuring the get tag wuld call that global.
dave

Big Cartoon DataBase
Big Comic Book DataBase

Last edited by:

carfac: May 12, 2010, 2:48 PM
Quote Reply
Re: [carfac] New Data Into Search Pages In reply to
Hi,

Whats the exact global you are using?

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] New Data Into Search Pages In reply to
sub {
my $director_details = $DB->table('Name')->select( { Name => $_[0] } )->fetchrow_hashref;
return $director_details;
}

The table is names "Name"... and the key field with the persons name that we match on is also called "Name"

I named the global "director_details"
dave

Big Cartoon DataBase
Big Comic Book DataBase
Quote Reply
Re: [carfac] New Data Into Search Pages In reply to
If you have named the global l "director_details" , then this won't work :p

<%get_director_details($Director)%>

You need something like:

<%director_details($Director)%>

Wink

Off to bed now - its almost 11pm over here.

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] New Data Into Search Pages In reply to
Thank you Andy!
dave

Big Cartoon DataBase
Big Comic Book DataBase