Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Detailed page as default URL?

Quote Reply
Detailed page as default URL?
I am using Links SQL as online directory of local businesses. Some of these businesses are small and/or part time and do not have a website.

I wanted to make the entry's detailed page their default page to accomodate this and avoid the 404 errors on the random page routine. BTW, this is all new to me, so please type slowly :-)

The following is the relavent code from the form.txt.

<tr><td align="right" valign="top">URL:</td>
<td>
<input name="URL" value="<%if URL%><%URL%><%endif%>" size="50">
</td></tr>

My thought was to change the input line to:

<input name="URL" value="<%build_detail_url%>/<%ID%>.html" size="50">

From what I understand, this same form is also used for both the modify and add routines.

Would it be better to save this as the add_form.txt and change the related tag and leave form.txt for modify, or is there a way to use the <%if Description%> tag and have one form.txt?
--
Rob Van Deren


Quote Reply
Re: Detailed page as default URL? In reply to
I think I know what you are trying to do.

What you need to do, is if a website does not have a URL, allow them to just enter "http://"

In your link.html and detail.html, you need to use an <%if%> tag, such that:

<%if URL eq 'http://'%>
link to detail.html
<%else%>
use link to website
<%endif%>

If you want to change the default masking in the Links table to includ "none" as a valid protocol, any website that enters "none" for their URL, you could do:


<%if URL eq 'none'%>
link to detail.html
<%else%>
use link to website
<%endif%>


In the detail.html where you have the "jump to site" link, you could do something like:

<%if URL eq 'none'%>
This Business has no website.
<%else%>
use link to website
<%endif%>


===

Last case, is if you are _NOT_ using detail pages in general, and you want your business that has no web address to link to the detail page, then what you can do is use the same idea, but use my detail.cgi script to generate the detail pages for businesses that have no website dynamcially, and edit the detail.html to _not_ contain any references or jumps to "URL".

In link.html you'd do something like this:

<%if URL eq 'none'%>
<A href="<%db_cgi_url%>/detail_page.cgi?ID=<%ID%>">
<%else%>
<A href="<%db_cgi_url%>/jump.cgi?ID=<%ID%>">
<%endif%>

What that will do is generate a detail page for users who have no website, but jump to the existing website if they do.

Make sense?

PUGDOG« Enterprises, Inc.
FAQ:http://LinkSQL.com/FAQ
Forum:http://LinkSQL.com/forum
Quote Reply
Re: Detailed page as default URL? In reply to
Pugdog,

Thanks for the information. That was what I was needing. It should be useful in other areas, with the examples of the if/else logic and some simple parsing.
--
Rob Van Deren

Quote Reply
Re: [pugdog] Detailed page as default URL? In reply to
Does detail_page.cgi also count hits, or do we lose them?

What I would like to do is have the Detail page as the Default URL for either jump.cgi or detail_page.cgi, but still account for all hits.

Thanks very much. Smile

DogTags
Quote Reply
Re: [DogTags] Detailed page as default URL? In reply to
I believe detail_page.cgi when installed will count both hits and jumps. "hits" are counted as detail_page hits, while jumps are counted as jumps to the website.

"hits" continue to get written to the "hits" field, while "jumps" get written to the Jumps field.

That was the best solution, since it allowed the "hits" field to continue to work as before, more or less, and the jumps were a "new" feature.

If you have always "jumped" to the website, you might want to tweak the code a bit, and reverse what is stored in the "hits" and "jump" fields. That really depends on your website, as I said, the installed solution is the most reasonable for most people, but not for everyone :)




PUGDOG´┐Ż Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] Detailed page as default URL? In reply to
I found this within Jump.pm:


# Redirect to a detailed page if requested.
if ($CFG->{build_detailed} and $IN->param('Detailed')) {
$goto = $CFG->{build_detail_url} . '/' . $id . $CFG->{build_extension};
}
($goto =~ m,^\w+://,) or ($goto = "http://$goto");
if ($goto) {
print $IN->redirect ($goto);
}

It looks like if I include a reference to Detailed that I could get jump.cgi to do a direct hop to the detailed page and still get the hit count bumped.

If I am on the right track, how would I make the reference to Detailed? Would this go in the .../jump.cgi link?

<a href="<%db_cgi_url%>/jump.cgi?ID=<%ID%>&Detailed=1">

Many thanks.

DogTags
Quote Reply
Re: [DogTags] Detailed page as default URL? In reply to
Hey, it worked!!

Let me go check the hit count...

Okay, the hit count and the detail_hits count did not change, but jump.cgi did go to the Detail page.

Would anyone have an idea about why jump.cgi is not logging hits now?

Thanks.

DogTags
Quote Reply
Re: [DogTags] Detailed page as default URL? In reply to
I tried to copy the ClickTrack code from one section of Jump.pm to the Detailed section of Jump.pm. However, the Hits field is not changing.

The Detailed stuff went from this:

Code:
# Redirect to a detailed page if requested.
if ($CFG->{build_detailed} and $IN->param('Detailed')) {
$goto = $CFG->{build_detail_url} . '/' . $id . $CFG->{build_extension};
}
($goto =~ m,^\w+://,) or ($goto = "http://$goto");
if ($goto) {
print $IN->redirect ($goto);
}

To the following:

Code:
# Redirect to a detailed page if requested.
if ($CFG->{build_detailed} and $IN->param('Detailed')) {
$goto = $CFG->{build_detail_url} . '/' . $id . $CFG->{build_extension};

my $ip = $ENV{REMOTE_HOST} || $ENV{REMOTE_ADDR} || 'None';
my $click_db = $DB->table ('ClickTrack');
my $rows = $click_db->count ( { LinkID => $id, IP => $ip, ClickType => 'Hits' } );
if (! $rows) {
$db->update ( { Hits => \"Hits + 1" }, { ID => $id }, { GT_SQL_SKIP_INDEX => 1 } );
$click_db->insert ( { LinkID => $id, IP => $ip, ClickType => 'Hits', Created => \"NOW()"} );
}


}
($goto =~ m,^\w+://,) or ($goto = "http://$goto");
if ($goto) {
print $IN->redirect ($goto);
}

Could it be that I have the hit stuff in the wrong location? There are no errors so far.

Thanks.

DogTags

------------------------------------------

Last edited by:

DogTags: Oct 28, 2001, 8:31 AM