Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: General / Classic ASP versions(v3.4.XX)
 Google transliteration api
 New Topic  Topic Locked
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 5

puthenveetil
New Member

54 Posts

Posted - 12 September 2009 :  19:43:35  Show Profile
Hi,
Please help me to include Google transliteration api in the forum?Probably in post.asp and topic.asp.

This is the code needed to be incorporated with modifications.
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<script type="text/javascript" src="http://www.google.com/jsapi">
</script>
<script type="text/javascript">

// Load the Google Transliteration API
google.load("elements", "1", {
packages: "transliteration"
});

function onLoad() {
var options = {
sourceLanguage: 'en', // or google.elements.transliteration.LanguageCode.ENGLISH,
destinationLanguage: ['hi'], // or [google.elements.transliteration.LanguageCode.HINDI],
shortcutKey: 'ctrl+g',
transliterationEnabled: true
};
// Create an instance on TransliterationControl with the required
// options.
var control =
new google.elements.transliteration.TransliterationControl(options);

// Enable transliteration in the textfields with the given ids.
var ids = [ "transl1", "transl2" ];
control.makeTransliteratable(ids);

// Show the transliteration control which can be used to toggle between
// English and Hindi.
control.showControl('translControl');
}
google.setOnLoadCallback(onLoad);
</script>
</head>
<body>
<center>Type in Hindi (Press Ctrl+g to toggle between English and Hindi)</center>
<div id='translControl'></div>
<br>Title : <input type='textbox' id="transl1"/>
<br>Body<br><textarea id="transl2" style="width:600px;height:200px"></textarea>
</body>
</html>

Thanks

Edited by - puthenveetil on 14 September 2009 15:22:02

leatherlips
Senior Member

USA
1838 Posts

Posted - 15 September 2009 :  20:24:55  Show Profile  Visit leatherlips's Homepage
I'm not quite sure but you could try this...

Copy and paste the following in a new file and call it transliteration.asp

<script type="text/javascript" src="http://www.google.com/jsapi"></script> 
<script type="text/javascript"> 

// Load the Google Transliteration API 
google.load("elements", "1", { 
packages: "transliteration" 
}); 

function onLoad() { 
var options = { 
sourceLanguage: 'en', // or google.elements.transliteration.LanguageCode.ENGLISH, 
destinationLanguage: ['hi'], // or [google.elements.transliteration.LanguageCode.HINDI], 
shortcutKey: 'ctrl+g', 
transliterationEnabled: true 
}; 
// Create an instance on TransliterationControl with the required 
// options. 
var control = 
new google.elements.transliteration.TransliterationControl(options); 

// Enable transliteration in the textfields with the given ids. 
var ids = [ "transl1", "transl2" ]; 
control.makeTransliteratable(ids); 

// Show the transliteration control which can be used to toggle between 
// English and Hindi. 
control.showControl('translControl'); 
} 
google.setOnLoadCallback(onLoad); 
</script>


Then in inc_header.asp look for BOTH instances of:

'## END - REMOVAL, MODIFICATION OR CIRCUMVENTING THIS CODE WILL VIOLATE THE SNITZ FORUMS 2000 LICENSE AGREEMENT

Below both of them add:

<!--#INCLUDE FILE="transliteration.asp"-->

I'm not sure where you want the below code to appear. If you can tell me I may be able to tell you how to insert it.

<center>Type in Hindi (Press Ctrl+g to toggle between English and Hindi)</center> 
<div id='translControl'></div> 
<br>Title : <input type='textbox' id="transl1"/> 
<br>Body<br><textarea id="transl2" style="width:600px;height:200px"></textarea>

Mangione Magic Forum - The Music of Chuck Mangione

My Mods: Googiespell MOD | Link To Reply MOD | Petition MOD | Contact Page MOD | Share This Topic MOD | MP3 MOD | PageEar MOD | Google Viewer MOD
Go to Top of Page

puthenveetil
New Member

54 Posts

Posted - 15 September 2009 :  21:10:31  Show Profile
Hi,
Thanks for the quick response.
1.The textarea mentioned in the java script should pertain to the text fields in our "Reply to topic".Quick Reply" and New Topic pages textarea or text fields.I think like googiespell mode.
so in the java script var ids = the above textarea.

The transliteration control or translControl should show up as googiespell control above the text field so that one can select the control before typing in the reply in Hindi.
Go to Top of Page

leatherlips
Senior Member

USA
1838 Posts

Posted - 15 September 2009 :  21:30:16  Show Profile  Visit leatherlips's Homepage
Try this:

In post.asp look for:

<input id=""transl1"" maxLength=""50"" name=""Subject"" value=""" & Trim(ChkString(TxtSub,"edit")) & """ size=""40""></td>" & vbNewLine & _

Add the part in red.

Also look for:

<textarea id=""transl2"" cols=""" & intCols & """ name=""Message"" rows=""" & intRows & """ wrap=""VIRTUAL"" onselect=""storeCaret(this);"" onclick=""storeCaret(this);"" onkeyup=""storeCaret(this);"" onchange=""storeCaret(this);"">" & Trim(CleanCode(TxtMsg)) & "</textarea><br /></td>" & vbNewLine & _


Add the part in red.

Mangione Magic Forum - The Music of Chuck Mangione

My Mods: Googiespell MOD | Link To Reply MOD | Petition MOD | Contact Page MOD | Share This Topic MOD | MP3 MOD | PageEar MOD | Google Viewer MOD
Go to Top of Page

leatherlips
Senior Member

USA
1838 Posts

Posted - 15 September 2009 :  21:38:49  Show Profile  Visit leatherlips's Homepage
I forgot this part...

Look for the first instance of:

strRqMethod = "Topic" then


After that add:

Response.Write "              <tr>" & vbNewLine & _
         "                <td bgColor=""" & strPopUpTableColor & """ noWrap vAlign=""top"" align=""right""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>Type in Hindi (Press Ctrl+g to toggle between English and Hindi)</b></font></td>" & vbNewLine & _
         "                <td bgColor=""" & strPopUpTableColor & """><div id=""translControl""></div></td>" & vbNewLine & _
         "              </tr>" & vbNewLine

Mangione Magic Forum - The Music of Chuck Mangione

My Mods: Googiespell MOD | Link To Reply MOD | Petition MOD | Contact Page MOD | Share This Topic MOD | MP3 MOD | PageEar MOD | Google Viewer MOD
Go to Top of Page

leatherlips
Senior Member

USA
1838 Posts

Posted - 15 September 2009 :  21:53:56  Show Profile  Visit leatherlips's Homepage
I don't know exactly what this does, but I think I have it working on my test forum. You can view it here:

http://www.mangionemagic.com/forumsnitz/post.asp?method=Topic&FORUM_ID=1

I changed the instructions for the button to be on a new line and at a smaller font. If you need to know how to do that let me know.

Mangione Magic Forum - The Music of Chuck Mangione

My Mods: Googiespell MOD | Link To Reply MOD | Petition MOD | Contact Page MOD | Share This Topic MOD | MP3 MOD | PageEar MOD | Google Viewer MOD
Go to Top of Page

puthenveetil
New Member

54 Posts

Posted - 16 September 2009 :  01:07:28  Show Profile
Hi,
Yes, your test forum works fine.However mine does'nt.OK plese give me a full detail as to which all asp pages should I amend.Is it only post.asp?

In post asp I have this line amended as under which does not look ok.

" <td bgColor=""" & strPopUpTableColor & """><textarea id=""ta1"" class=""textareaid=""transl2"" "" cols=""" & intCols & """ name=""Message"" rows=""" & intRows & """ wrap=""VIRTUAL"" onselect=""storeCaret(this);"" onclick=""storeCaret(this);"" onkeyup=""storeCaret(this);"" onchange=""storeCaret(this);"">" & Trim(CleanCode(TxtMsg)) & "</textarea><br /></td>" & vbNewLine & _

I see two textareas.One may be for poll mod i think.

I will email you my post.asp to have a look if you need.

Thanks

Edited by - puthenveetil on 16 September 2009 01:08:54
Go to Top of Page

leatherlips
Senior Member

USA
1838 Posts

Posted - 16 September 2009 :  11:09:22  Show Profile  Visit leatherlips's Homepage
Try this:

Remove the part in red:

" <td bgColor=""" & strPopUpTableColor & """><textarea id=""ta1"" class=""textareaid=""transl2"" "" cols=""" & intCols & """ name=""Message"" rows=""" & intRows & """ wrap=""VIRTUAL"" onselect=""storeCaret(this);"" onclick=""storeCaret(this);"" onkeyup=""storeCaret(this);"" onchange=""storeCaret(this);"">" & Trim(CleanCode(TxtMsg)) & "</textarea><br /></td>" & vbNewLine & _


Then in your transliteration.asp file look for this line:

var ids = [ "transl1", "transl2" ];


Change it to

var ids = [ "transl1", "ta1" ];

Mangione Magic Forum - The Music of Chuck Mangione

My Mods: Googiespell MOD | Link To Reply MOD | Petition MOD | Contact Page MOD | Share This Topic MOD | MP3 MOD | PageEar MOD | Google Viewer MOD
Go to Top of Page

puthenveetil
New Member

54 Posts

Posted - 16 September 2009 :  11:36:22  Show Profile
Hi,
Thanks.
Do i have to change inc_header.asp also?
Go to Top of Page

leatherlips
Senior Member

USA
1838 Posts

Posted - 16 September 2009 :  12:03:47  Show Profile  Visit leatherlips's Homepage
quote:
Originally posted by puthenveetil

Hi,
Thanks.
Do i have to change inc_header.asp also?

No, not if you did it the way I suggested.

Mangione Magic Forum - The Music of Chuck Mangione

My Mods: Googiespell MOD | Link To Reply MOD | Petition MOD | Contact Page MOD | Share This Topic MOD | MP3 MOD | PageEar MOD | Google Viewer MOD
Go to Top of Page

puthenveetil
New Member

54 Posts

Posted - 16 September 2009 :  13:44:31  Show Profile
Thanks,
I will do the changes in post.asp and let you know the outcome.
Go to Top of Page

puthenveetil
New Member

54 Posts

Posted - 16 September 2009 :  16:00:29  Show Profile
Hi,
It works.I need the button to be on a new line and at a smaller font as in your test forum.
can I get the same controls on the Quick Reply page too.
Go to Top of Page

leatherlips
Senior Member

USA
1838 Posts

Posted - 16 September 2009 :  16:31:42  Show Profile  Visit leatherlips's Homepage
quote:
Originally posted by puthenveetil

Hi,
It works.I need the button to be on a new line and at a smaller font as in your test forum.
can I get the same controls on the Quick Reply page too.

Post a text version of your post.asp file and your topic.asp file and I'll make the changes they need.

Mangione Magic Forum - The Music of Chuck Mangione

My Mods: Googiespell MOD | Link To Reply MOD | Petition MOD | Contact Page MOD | Share This Topic MOD | MP3 MOD | PageEar MOD | Google Viewer MOD
Go to Top of Page

puthenveetil
New Member

54 Posts

Posted - 16 September 2009 :  21:19:07  Show Profile
HI,
The link to asp files are:-
http://edakkadnambiars.net/post.txt
http://edakkadnambiars.net/topic.txt

By the by how do I create a scroll box?

Edited by - puthenveetil on 16 September 2009 23:45:56
Go to Top of Page

leatherlips
Senior Member

USA
1838 Posts

Posted - 17 September 2009 :  06:13:42  Show Profile  Visit leatherlips's Homepage
quote:
Originally posted by puthenveetil

By the by how do I create a scroll box?

[ scrollcode]Long text here...[ /scrollcode]

(I put the spaces in the scrollcode tag so it would appear in the post.)

Mangione Magic Forum - The Music of Chuck Mangione

My Mods: Googiespell MOD | Link To Reply MOD | Petition MOD | Contact Page MOD | Share This Topic MOD | MP3 MOD | PageEar MOD | Google Viewer MOD
Go to Top of Page

leatherlips
Senior Member

USA
1838 Posts

Posted - 17 September 2009 :  06:23:34  Show Profile  Visit leatherlips's Homepage
Here you go...

www.mangionemagic.com/PostandTopic.zip

Back up your current post.asp file and topic.asp file first! And then overwrite your files with the new ones.

Mangione Magic Forum - The Music of Chuck Mangione

My Mods: Googiespell MOD | Link To Reply MOD | Petition MOD | Contact Page MOD | Share This Topic MOD | MP3 MOD | PageEar MOD | Google Viewer MOD

Edited by - leatherlips on 17 September 2009 06:23:55
Go to Top of Page
Page: of 5 Previous Topic Topic Next Topic  
Next Page
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.41 seconds. Powered By: Snitz Forums 2000 Version 3.4.07