Home | Products | Consulting | Forums | Support | Order | 1-800-752-0455
  Main
Index
Search
Posts
Who's
Online
Log
In

Home: Products: CMS Builder:
Putting javascript into a field

 

 


steve_e
User

Mar 27, 2008, 8:19 AM

Post #1 of 7 (471 views)
Shortcut
Putting javascript into a field Can't Post

Hi -
I use an email address obfuscater called hivemail enkoder to try to prevent email addresses being harvested from my site (I have to put customer email addresses on the site and I don't want this to result in them getting hugely increased levels of spam).

All it does is convert the email address and a couple more fields (email popup text, email title etc) into a field of gobbledegook, which is translated into an email link by javascript when someone loads the page in their browser.

I'm building the page that is going to include this email address, and I'm having problems getting it to be included properly into a field. If I input it as a wysiwyg field or text box it puts <br /> in at the end of every line. Can anyone suggest a way I can create a field that will exactly implant this code into a page?

Here's what the original looks like:


Code
<script type="text/javascript"> 
/* <![CDATA[ */
function hivelogic_enkoder(){var kode=
"kode=\";)'':)1-htgnel.edok(tArahc.edok?htgnel.edok<i(+x=edok})i(tArahc.edo"+
"k+)1+i(tArahc.edok=+x{)2=+i;)1-htgnel.edok(<i;0=i(rof;''=x;\\\"=xdeko)}(cd"+
"eCoarChomfrg.intr=Sx+8;12+=)c<0(cif3;)-(iAtdeCoarche.od=k{c+)i+h;gten.ldek"+
"oi<0;i=r(fo';=';x>\\\"\\\\*,=*4,k0jwhq1oghnrw+uDkd1fghnrkBjwhq1oghnrl?.+@{"+
"ghnr00\\\\\\\\0l,w+uDkd1fghnr,..4+lDwdufkh1rg@n{.,~@5l.,>04wkqjohh1rg+nl?3"+
">l@u+ir*>@*>{,%*>,*0=w4qkojhhr1+gDndwfuhkr1Bgwnqkojhhr1?g+n{lh.r@0g00n\\\\"+
"\\\\,l+wDudkf1hgrn.,4.l+wDudkf1hgrn@.{~,5@.l>,40kwjqho1hgrn+?l>3@l+uri>**@"+
"{>%,*_+*lqmr,1h+uvyhuh,1**w+olvsh1rg@nghnr%>g__fp_qr1xuhww+z_lh__%___dk_h?"+
"@#\\\\_ui__________%___do_rpNl|wZ=wdl1jdvoxqkCprwwqdjsyrx1Brx1mnfv@e\\\\\\"+
"\\hw\\\\\\\\HVSp#phhevulk#sri#urVwxdksprw#\\\\\\\\\\\\\\\\Fq_HG__________%"+
"___ww_h#_lo__@__%_______h__do_Np|l_#d__________%___Hd_oANp|l2#Ad_?d__%___>"+
"@__,%_h_rg@n_%hgrn@%ghnr=\\\"\\\\deko\\\"=edok\";kode=kode.split('').rever"+
"se().join('')"
;var i,c,x;while(eval(kode));}hivelogic_enkoder();
/* ]]> */
</script>



Dave
Staff / Moderator


Mar 27, 2008, 10:25 AM

Post #2 of 7 (465 views)
Shortcut
Re: [steve_e] Putting javascript into a field [In reply to] Can't Post

Can you set aside a textbox field to use just for this? Is so, edit that field in the field editor and check this under: Field Editor > Advanced Options:

[ ] Disable auto-formatting (don't add break tags to content)

Then try updating the field again.

Let me know if that does the trick.

Dave Edis - Senior Developer
interactivetools.com


steve_e
User

Mar 27, 2008, 11:19 AM

Post #3 of 7 (463 views)
Shortcut
Re: [Dave] Putting javascript into a field [In reply to] Can't Post

Aaagh! I was looking for the 'disable auto formatting' option - I use it with AM - but must have missed it!

Thanks Dave that's fine now.


nburkha1
User

Mar 27, 2008, 5:19 PM

Post #4 of 7 (445 views)
Shortcut
Re: [steve_e] Putting javascript into a field [In reply to] Can't Post

Hi Dave,

I was having the same issue and everytime I put in the javascript to hide the email the CMS just froze up and would not let me do it. Let me know how and if you are able to resolve this? I was using the WYSYWIG editor and tried uploading it using the html function. Thanks.

Nina


(This post was edited by nburkha1 on Mar 27, 2008, 5:21 PM)


steve_e
User

Mar 28, 2008, 2:20 AM

Post #5 of 7 (440 views)
Shortcut
Re: [nburkha1] Putting javascript into a field [In reply to] Can't Post

Hi Nina -
While you're waiting for Dave, I can tell you what I did.

I set up a section with a text box(call it 'email address' or something). As Dave mentions above, you I modified that field. Click on 'advanced options' at the bottom and check the box marked 'Disable auto-formatting (don't add break tags to content)'. This gets rid of the line breaks that otherwise break the javascript.

Then I set up my page by taking out the php viewer code for the page viewer and editing it into one of my web pages.

Where I want to put the javascripted email address I just pasted the field in like this:


Code
<?php echo $record['email_address'] ?>


Didn't need to use any upload or html functions. When whoever is adding a record to that section needs to do so, they just copy the complete javascript and paste it into the text box. It works fine on my page.

Hope that helps.

Regards, Steve.


nburkha1
User

Mar 28, 2008, 9:05 AM

Post #6 of 7 (431 views)
Shortcut
Re: [steve_e] Putting javascript into a field [In reply to] Can't Post

Hi Steve,

Did you have to set up this field for each page that had an email address? Thanks.

Nina


steve_e
User

Mar 28, 2008, 10:07 AM

Post #7 of 7 (429 views)
Shortcut
Re: [nburkha1] Putting javascript into a field [In reply to] Can't Post

Well, not for each page, but for each page type (ie if you want to put email addresses on pages that are generated by other sections you'll need to set up the field for that section separately.

But if you just want the ability to put up unique addresses, for example, on a multiple page section like vacancies, so that a browser can contact the organisation directly, then you just set it up once for that section, then whoever is creating a new record in CMS Builder can paste the javascript into the field that already exists.

If you just want the same email address to be available on each page of a certain type (ie generated by the same section), then all you have to do is put that javascript enkoded email address directly into the page template when you set it up.

Does that make sense or am I misunderstanding you?

Regards, Steve

 
 
 


Search for (options)
Products
CMS Builder
Article Manager
Realty Manager
Listings Manager
Order Now
Services
Priority Consulting
Support
Online Documentation
Support Forums
Support Homepage
Company Info
12 reasons to choose us!
Meet the team
Monthly newsletter
Contact Us
Toll Free: 1-800-752-0455
Phone: (604) 689-3347
Sales | Support
Conditions of Use | Privacy Policy | Copyright © interactivetools.com 2008
#201 - 2730 Commercial Drive, Vancouver BC Canada V5N 5P4