Gossamer Forum
Home : Products : DBMan : Installation :

defining titles...

Quote Reply
defining titles...
Hi,
I will define the $html_title in some forms.
for ex. When a default user click a link, that call the records of a specific user, it would be nice, if the title shows: Records of '$specific user'. I tried a lot, but no succes. How can I do this??

Thanks in advance,
---------
Mart.
Quote Reply
Re: defining titles... In reply to
It will require a lot of rearranging of your html.pl file, since the results are returned after the <head> tags are printed.

How is the search conducted? Would it be possible just to use the search terms?


------------------
JPD





Quote Reply
Re: defining titles... In reply to
The link can also called from outside the programm,
Code:
<A HREF="http://www.autorandstad.nl/cgi-bin/dealer/dealer.cgi?db=dealer&ww=on&uid=default&$db_key=$rec{$db_key}&view_records=1&ID=*">
, where the '$db_key'is defined as the userid.

[This message has been edited by mart (edited June 19, 1999).]
Quote Reply
Re: defining titles... In reply to
It doesn't matter where the link is called from. It just matters whether you can use the search terms for what you want to print out.

I'm not sure I understand what you're doing, though. Is the link you included the actual link from outside the database? If so, you can't use

$db_key=$rec{$db_key}

You can only use variables from within DBMan.

Also, you don't need both

$db_key=$rec{$db_key}

and

ID=*

in a link from within DBMan. The $db_key=$rec{$db_key} term is enough. (It doesn't hurt anything, but it could possibly slow down a search.)

If you use the link you have supplied from within DBMan and you want to have the userid printed in the browser title, you can just use

$in{$db_key}

in the browser title.




------------------
JPD





Quote Reply
Re: defining titles... In reply to
I think it's more complecated:
The records that is ask for with the search order all have the same user, so the search field must be the userid_field. All that records have the same field, that I will place in the $html_title, the 'name_field'. But when the user ask for another search defenition, one that has not all the same users, the $html_title has to stay default. I've experimented with some 'if'/'else' statements, but no succes. I hope, that this is clear for you.

Thanks in advance,
----------
Mart.
Quote Reply
Re: defining titles... In reply to
What have you tried? Seems like this would work:

Code:
if ($in{'name_field'}) {
$html_title = "Records for $in{'name_field'}";
}
else {
$html_title = "Search results";
}


------------------
JPD





Quote Reply
Re: defining titles... In reply to
No, nothing works.
This is the link, whitch can be called from outside the programm, try it and you see what I mean:
http://www.autorandstad.nl/cgi-bin/dealer/dealer.cgi?db=dealer&ww=on&uid=default&Userid=mart&view_records=1&ID=*
In here, the 'Userid' is known. From that userid all the records are called. He has the same value in the field, whitch I will define in my title. I tried also something with 'if ($auth_user_field eq $db_userid) {', but not with result. I feel, that there must be a solution, I only don't know, if I can make clear, what I mean. Hope you understand...
Quote Reply
Re: defining titles... In reply to
Using

if ($auth_user_field eq $db_userid)

would definitely not work the way you want. In the link you supplied, $db_userid is equal to "default" and the $auth_user_field is always equal to a number. Those two variables will never be equal.

Did you try

Code:
if ($in{'Userid'}) {
$html_title = "Records for $in{'Userid'}";
}
else {
$html_title = "Search results";
}

This would go at the very top of your html_view_success subroutine, before any other code.

------------------
JPD





Quote Reply
Re: defining titles... In reply to
OK, this works, but I don't want the Userid display in the title, I will the value of field 'Name' display in the title. I try to change the $in{'Userid'} in $in{'Name'}, but that gives an empty value. What must I do???
Quote Reply
Re: defining titles... In reply to
Okay. Try this, then. After my (@hits) = @_;

add

Code:
if ($in{'Userid'}) {
$html_title = "Records for $hits[#]";
}
else {
$html_title = "Search Results";
}

Change the # above to match the number of the field where the person's name is.


------------------
JPD





Quote Reply
Re: defining titles... In reply to
 Smile Well, there's a few things I've had trouble with. (I still am struggling with the file upload, for one thing.) But things like this can be worked out.

------------------
JPD





Quote Reply
Re: defining titles... In reply to
I think, there is NOTHING you cannot solve, Smile
Thanks,
-------
Mart.
Quote Reply
Re: defining titles... In reply to
Wish I could help, but I've not installed the image upload mod yet. I ask my visitors to upload it to their own homepage and give the URL in the adding routine, whitch I load in a field-value. (So, till the next problem...) Smile