Gossamer Forum
Home : Products : DBMan : Installation :

Different layout of results page

Quote Reply
Different layout of results page
Before I even start to install DBMan, I'd like to know is it possible to change the layout of results page to like this:
http://www.henriksson.com/results.html

Example of search page is here:
http://www.henriksson.com/search.html

The database will have the following fields:
Name|Position|Country|TeamURL|TeamName|LeagueURL|LeagueName
Quote Reply
Re: Different layout of results page In reply to
1) Yes. (There are Mods written for this.)

I would HIGHLY recommend that you browse the various Sites in Action located in the DBMAN section of the Resource Center (linked off the Forum Home Page) to see the capabilities of this script.

Feel free to look at the various DBMAN projects I've worked on:


2) Yes. (Very easy with a few subtle differences.)

Again look at the Sites in Action or check out the projects I've worked on.

That is the default structure of DBMAN database files.

Hope this helps.

Regards,

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
----------------------




[This message has been edited by Eliot (edited November 02, 1999).]
Quote Reply
Re: Different layout of results page In reply to
Thanks for your help. I've now installed DBMan (http://www.henriksson.com/dbman/db.cgi -> userid/password 'guest/guest') and it's working quite ok.

However, there's still at least one thing wrong:

This is how I got the links working (capture from html.pl's sub html_record):

<tr><td>$rec{'Nimi'}</td><td>$rec{'Asema'}</td><td>$rec{'Maa'}</td><td><a href="$rec{'SeuraURL'}">$rec{'Seura'}</a></td><td><a href="$rec{'SarjaURL'}">$rec{'Sarja'}</td></tr>

(Translation: Nimi=Name, Asema=Position, Maa=Country, SeuraURL=TeamURL, Seura=Team, SarjaURL=LeagueURL and Sarja=League)

But when there's no URL for 'Seura' or 'Sarja', the script still gives it. See the database and 'Seura' of Niukkanen Harri. Actually the team don't have a homepage.
Quote Reply
Re: Different layout of results page In reply to
All you have to do is use if and else statements for comparing data and printing codes, like the following:

Code:
if ($rec{'SeuraURL'}) {
print qq|<a href="$rec{'SeuraURL'}">$rec{'SeuraURL'}</a>|;
}
else {
print qq|No Link|;
}

BTW: Since you have installed the script successfully and you are now beginning to customize your database project, you should use the DBMAN Discussion Forum for further problems or questions regarding your scripts.

Smile

Regards,

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
----------------------


Quote Reply
Re: Different layout of results page In reply to
I'd better stay here until this is fixed. Smile
These are the mofications I made to html.pl:

if ($rec{'SeuraURL'}) {
print qq|<a href="$rec{'SeuraURL'}">$rec{'Seura'}</a>|;

}
else {
print qq|$rec{'Seura'}|;
}

if ($rec{'SarjaURL'}) {
print qq|<a href="$rec{'SarjaURL'}">$rec{'Sarja'}</a>|;
}

else {
print qq|$rec{'Sarja'}|;
}

print qq|
<tr><td>$rec{'Nimi'}</td><td>$rec{'Asema' </td><td>$rec{'Maa'}</td><td></td><td></td>
</tr>
|;
}

And here's the result: http://www.henriksson.com/dbman/db.cgi?db=default&uid=default&view_records=1&Nimi=*

BTW, I may ask stupid questions etc., but I really don't know much about Perl. Sorry about that.
Quote Reply
Re: Different layout of results page In reply to
That's fine...although this is the Installation forum....

Wink

You need to put the codes you have in tables, like the following:

Code:
if ($rec{'SeuraURL'}) {
print qq|<td><a href="$rec{'SeuraURL'}">$rec{'Seura'}</a></td>|;

}
else {
print qq|<td>$rec{'Seura'}</td>|;
}

if ($rec{'SarjaURL'}) {
print qq|<td><a href="$rec{'SarjaURL'}">$rec{'Sarja'}</a></td>|;
}

else {
print qq|<td>$rec{'Sarja'}</td>|;
}

BTW: You can put ANY HTML codes between the print qq| and |; codes.

Wink

Also you are missing the right bracket, }, in your Asema field. It should be the following:

$rec{'Asema'}

Hope this helps.

Regards,

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
----------------------


Quote Reply
Re: Different layout of results page In reply to
Whatever works...Glad you are getting the hang of it.

Regards,

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
----------------------


Quote Reply
Re: Different layout of results page In reply to
I changed the code to:

Code:
print qq|<tr><td>$rec{'Nimi'}</td><td>$rec{'Asema'}</td><td>$rec{'Maa'}</td>|;

if ($rec{'SeuraURL'}) {
print qq|<td><a href="$rec{'SeuraURL'}">$rec{'Seura'}</a></td>|;
}
else {
print qq|<td>$rec{'Seura'}</td>|;
}
if ($rec{'SarjaURL'}) {
print qq|<td><a href="$rec{'SarjaURL'}">$rec{'Sarja'}</a></td>|;
}
else {
print qq|<td>$rec{'Sarja'}</td>|;
}
print qq|</tr>|;

And it's working perfectly! Thanks again for your help and patience. Now it's my time to change the forum. Smile