Gossamer Forum
Home : Products : Gossamer Links : Discussions :

How to Escape Hidden Description?

Quote Reply
How to Escape Hidden Description?
Hello!

I've got the description of a link hidden in javascript code, so when a user rolls over an icon it displays the description of that link in a pop up window. My problem is that if the description contains a ' or " character it doesn't work - I need to escape them, but am not sure how.

I've done something similar to this in an older version of linkSQL but it doesn't seem to work in my latest install. The following code..

Code:
<SCRIPT TYPE="text/javascript">
<!--
features[<%ID%>] = "<%if Description%><%GT::CGI::html_escape(<%Description%>)%><%endif%>" ;
//-->
</SCRIPT>

produces an unknown tag error in the html...

Code:
features[10] = "Unknown Tag: 'GT::CGI::html_escape(<%Description')%>" ;

any idea how I can get this to work?

thanks

r

Last edited by:

ryel01: Mar 25, 2004, 1:50 AM
Quote Reply
Re: [ryel01] How to Escape Hidden Description? In reply to
You probably need to use;

<%GT::CGI::html_escape($Description)%>

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] How to Escape Hidden Description? In reply to
 
that was easy. Unimpressed

thanks andy!!!

regan
Quote Reply
Re: [Andy] How to Escape Hidden Description? In reply to
 
One more for you - currently if there's a return (new line) entered into the description it won't display - is there another tag I can use to make these escaped as well so they display?

regan
Quote Reply
Re: [ryel01] How to Escape Hidden Description? In reply to
Try this;

<%global_name($Field)%>

Code:
sub {
my $_in = $_[0];
$_in = GT::CGI::html_unescape($_in);
$_in =~ s,\r|\n,\<BR\>,gi;
return $_in;
}

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] How to Escape Hidden Description? In reply to
Hello

Any idea on how to solve the following problem:

We have added a field called article where users can submit articles through a textarea..

Now if the users types in the TEXT words separated by a return (new line).. when validating we can see the lines, but the article is printed on the category and detailed page without the return showing

Any idea how to fix this..
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory
Quote Reply
Re: [katabd] How to Escape Hidden Description? In reply to
Use the global

sub {
my $tags = shift;
my $article= $tags->{article};
$article= GT::CGI::html_escape($article);
$article=~ s/\n/<br\/>\n/g;
$article=~ s,\[([/\w]+)\],<$1>,g;
return $article;
}
Quote Reply
Re: [Alba] How to Escape Hidden Description? In reply to
Thanks Alba

Do you you if their is a way to make this global a non field specific so we can specfify the filed name in the global tag used in the template?
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory
Quote Reply
Re: [katabd] How to Escape Hidden Description? In reply to
... not sure what you mean.

You can re-write the global for each field replacing 'article' with the field name,