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
 
M

magmike

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?

If you were viewing "editor email" links, you were looking in the wrong
database (and did not follow my directions very well). My article listings
are in question here. The field in which users paste in their cleverly
crafted (and some not-so-clevely-crafted) article text, is simply titled,
[article]. When the database results generate on the web page, web site
links and email links within the text are not active. I would like to
rectify that.

Direct link to example:
http://www.netterweb.com/articles/fulllisting.asp?ID=3592
While the city slept, magmike (mike.kline@***nospam***netterweb.com)
feverishly typed...

7:30 AM (EST) is hardly city sleeping time - unless you are a vampire.
[wink]
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

Picky, picky. If you aren't smart enough to figure the link out, you
probably can't help me on this issue. [smirk]


Back at ya.

Mike
 
R

rf

magmike wrote

Just in case you happen to visit alt.html:

The crosspost to that frontpage group has precluded me from giving you the
answer you require. The group is not on my server and in any case I would
never post (even cross) to a frontpage group.
 
D

Dave Patton

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?

If you were viewing "editor email" links, you were looking in the
wrong database (and did not follow my directions very well). My
article listings are in question here. The field in which users paste
in their cleverly crafted (and some not-so-clevely-crafted) article
text, is simply titled, [article]. When the database results generate
on the web page, web site links and email links within the text are
not active. I would like to rectify that.

Then fix your server code.
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

Picky, picky. If you aren't smart enough to figure the link out, you
probably can't help me on this issue. [smirk]

Stop being an ass if you want people to help you.
Given that you can't figure out that your problem is
an ASP problem, and that you should be asking for
help in an ASP-related newsgroup, it's hardly wise
for you to be complainging about a reply that
correctly pointed out a problem with how you
included a URL.
 
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.
 
N

nice.guy.nige

While the city slept, magmike (mike.kline@***nospam***netterweb.com)
feverishly typed...
If you were viewing "editor email" links, you were looking in the
wrong database (and did not follow my directions very well).

Funny. I followed your "instructions" to the letter. I went to the address
you gave, clicked on the "Search" link, entered "travel" as a keyword, then
clicked on one of the links that came up. Exactly as you described the
process. Not my fault if your navigation is screwed up by having two
"search" links that go to different places. Consider changing this.
My article listings are in question here. The field in which users paste
in their cleverly crafted (and some not-so-clevely-crafted) article
text, is simply titled, [article]. When the database results generate
on the web page, web site links and email links within the text are
not active. I would like to rectify that.

That would be because they are text, not links. Do as Hywel suggested and
use a script to parse the text for possible links. As for your server, $10 /
month and you don't get MySQL? My hosting costs far less than that and comes
with MySQL, PHP, etc, etc. If you're nice to me in your next post, I might
tell you who they are! ;-) And BTW, MySQL aint that hard to learn really, at
least not for simple database queries.

Might have been a good idea if you posted that in the first place, but at
least you are including the http:// bit now. ;-)
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

Picky, picky. If you aren't smart enough to figure the link out, you
probably can't help me on this issue. [smirk]

Oh I knew it was a URL alright, and my newsreader also turned it into a link
for me. But the point is that some newsreaders won't. The issue then is
*not* whether someone can "figure the link out", but whether they can be
arsed to highlight it, copy it, open a browser, paste the URL into the
address bar and click "Go", when all that can be avoided if you include the
protocol when you supply a URL.

Cheers,
Nige
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top