Database Results Riddle

M

magmike

We are discussing www.netterweb.com/articles/

Upon visiting this page, hitting the "Search" link, and then using a
keyword, such as "travel", to search, then clicking on a link to view the
article, database results are shown. However, within the text, when a link
is displayed, it is not active, and when copied over to Word, or an email,
the links do not become active.

My users have complained about this, yet I do not know how to ensure that
links within the fields become active when displayed within a "memo" field
in HTML results.

Can anyone help me with this?

Thanks in advance,
Mike
 
A

Andrew Urquhart

*magmike* said:
We are discussing www.netterweb.com/articles/

Upon visiting this page, hitting the "Search" link, and then using a
keyword, such as "travel", to search, then clicking on a link to view
the article, database results are shown. However, within the text,
when a link is displayed, it is not active, and when copied over to
Word, or an email, the links do not become active.

Help us to help you, please post a direct link to a page exhibiting the
problem - I got lost at the end of your directions and didn't find an
example of the problem you're describing.
 
N

nice.guy.nige

[follow-up set to news:alt.html]

While the city slept, magmike (mike.kline@***nospam***netterweb.com)
feverishly typed...

May be better if we discuss http://www.netterweb.com/articles/ as some
newsreaders won't render an address as a link without the protocol being
specified.
Upon visiting this page, hitting the "Search" link, and then using a
keyword, such as "travel", to search, then clicking on a link to view
the article, database results are shown. However, within the text,
when a link is displayed, it is not active
[...]

Not sure what problem you are having here. I followed your instructions, and
links (eg, "Editor Email", "Info Link") are indeed active links. Maybe you
would care to elaborate further?

Cheers,
Nige
 
K

Kathleen Anderson [MVP - FP]

Mike:
One way to do this is to put the content of the Memo field in as HTML in
your database, and then in FrontPage, right-click on the field in Normal
View and check the box that says "column contains HTML".
 
M

magmike

One way to do this is to put the content of the Memo field in as HTML in
your database

How do I do this when using Access? The title of the field, by the way, is
"article" and it is set as a "memo" field.

Mike
 
H

Hywel Jenkins

magmike said:
We are discussing www.netterweb.com/articles/

Upon visiting this page, hitting the "Search" link, and then using a
keyword, such as "travel", to search, then clicking on a link to view the
article, database results are shown. However, within the text, when a link
is displayed, it is not active, and when copied over to Word, or an email,
the links do not become active.

My users have complained about this, yet I do not know how to ensure that
links within the fields become active when displayed within a "memo" field
in HTML results.

Can anyone help me with this?

Presumably people are just entering the URL as plain text without the
markup that's required top make the text a link. You'll need to
modify your server-side code to scan the content of the memo field for
linkable content and modify it before it's returned to the browser.
Simple starting some text with http:// doesn't make that text a link -
someone has to do some work for that to happen.

Could the search be any slower, by the way? The search for "travel",
over an 8meg connection, took 19 seconds. Time to upgrade to MySQL
and PHP, I reckon.
 
M

magmike

To manually copy over 6,000 articles would be beyond desire. And to
continually do so for the 200 or so articles that are posted to the database
every week is also undesirable. This is at least what I understand you are
telling me to do.

See this example page (outside of the frames):
http://www.netterweb.com/articles/fulllisting.asp?ID=3592

What I am looking for is - Is there a tag that I can enclosed my database
results code in that will turn any apparent link into a live, clickable one?
 
M

magmike

You'll need to modify your server-side code....

So what do I do on the server side to make that happen?
Could the search be any slower....

Probably not. I am unhappy with it, too, however, this is a hobby site that
is hosted for $10/mo. To upgrade to MySQL would jump my monthly cost
considerably. Also, I am not familiar with MySQL and how to manage it. My
guess is, that I could no longer use the Database wizards inside FrontPage
if I upgrade my data to it. Is that right?

I do have DreamWeaver, but haven't spent much time with it. That would
likely be a better program for managing MySQL driven ASP pages.

Mike
 
K

Kathleen Anderson [MVP - FrontPage]

The only thing I can think of would be to write an Access macro that would
turn the text that begins with http into a real hyperlink, like this:

<a
href="http://www.cheap--airline--tickets.com">http://www.cheap--airline--tic
kets.com</a>

But you would still be left with the issue of line breaks - you could try
the tweak here:
http://home.att.net/~codelibrary/FrontPage/tweaks.htm#Line Breaks (note
that the <br/ should really be <br/>.

--

~ Kathleen Anderson
Microsoft FrontPage MVP
Spider Web Woman Designs
http://www.spiderwebwoman.com/resources/
 
A

Adrienne

So what do I do on the server side to make that happen?

'this function replaces code

for each word in split(memofield," ")
if instr(word,"http://") > 0 then
replace(word,"http://",<a href=" & chr(034) & word & chr(034) &
">" & word & "</a>"
elseif instr(word,"www") > 0 and left(word,7) <> "http://" then
replace(word,"www","<a href=" &chr(034) & "http://" & word & &
chr(034) & ">" & word & "</a>"
end if
next

'not tested, you might have to play with it
Probably not. I am unhappy with it, too, however, this is a hobby site
that is hosted for $10/mo. To upgrade to MySQL would jump my monthly
cost considerably. Also, I am not familiar with MySQL and how to manage
it. My guess is, that I could no longer use the Database wizards inside
FrontPage if I upgrade my data to it. Is that right?

I do have DreamWeaver, but haven't spent much time with it. That would
likely be a better program for managing MySQL driven ASP pages.

Frankly, I would get away from using Frontpage altogether. Go to W3schools
and do some of the SQL and ADO tutorials. Then get a plain text editor,
and get WinSQl lite, that will let you run queries against Access or other
types of databases.
 
T

Toby Inkster

magmike said:
However, within the text, when a link is displayed, it is not active,
and when copied over to Word, or an email, the links do not become
active.

Recently I have mostly been using...

<?php
/**
NAME : autolink()
VERSION : 1.0
AUTHOR : J de Silva
DESCRIPTION : returns VOID; handles converting
URLs into clickable links off a string.
TYPE : functions
======================================*/

function autolink( &$text, $target='_blank' )
{
// grab anything that looks like a URL...
$urls = _autolink_find_URLS( $text );
if( !empty($urls) ) // i.e. there were some URLS found in the text
{
array_walk( $urls, '_autolink_create_html_tags', $target );
$text = strtr( $text, $urls );
}
}

function _autolink_find_URLS( $text )
{
// build the patterns
$scheme = '(http:\/\/|https:\/\/)';
$www = 'www\.';
$ip = '\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}';
$subdomain = '[-a-z0-9_]+\.';
$name = '[a-z][-a-z0-9]+\.';
$tld = '[a-z]+(\.[a-z]{2,2})?';
$the_rest = '\/?[a-z0-9.-_\/~#&=;%+?]+[a-z0-9\/#=?]{1,1}';
$pattern = "$scheme?(?(1)($ip|($subdomain)?$name$tld)|($www$name$tld))$the_rest";

$pattern = '/'.$pattern.'/is';
$c = preg_match_all( $pattern, $text, $m );
unset( $text, $scheme, $www, $ip, $subdomain, $name, $tld, $the_rest, $pattern );
if( $c )
{
return( array_flip($m[0]) );
}
return( array() );
}

function _autolink_create_html_tags( &$value, $key, $target='' )
{
# if( $target )
# $target = " target=\"$target\"";
$value = "<a href=\"$key\">$key</a>";
}

?>
 
M

magmike

I'm not very familiar with PHP - is this a seperate file on the server - or
is it included in the code of the actuall page returning the database
results?

Mike
(Thanks by the way for the info!)
 
T

Toby Inkster

magmike said:
I'm not very familiar with PHP - is this a seperate file on the server - or
is it included in the code of the actuall page returning the database
results?

Can be a seperate file brought in using an include() function or can be
copy and pasted in directly.
 
Top