1 (edited by Thomas2 2007-09-05 11:35)

Topic: External Hyperlinks

I have installed a bilingual forum, and because I want to give people the opportunity to read the posts of the opposite language as well, I have added a bit of code to viewtopic.php that puts out a link 'Translate this page' that should link to   the Google translation script (with the present forum page address appended as a query string). However, I always get my forum base url prefixed to the Google url. Any suggestions how to avoid this?

Thomas

Re: External Hyperlinks

Did you add http:// to the beginning of the URL?

Re: External Hyperlinks

Smartys wrote:

Did you add http:// to the beginning of the URL?

Yes, I did in principle, but I found the error now: I applied urlencode to the whole url by mistake rather than to the query string only. So effectively, the http:// was missing after all. I have corrected this now and it works as it should.

Thanks,
Thomas

4 (edited by Thomas2 2007-09-05 16:43)

Re: External Hyperlinks

I am having another problem now however in this context: is there a variable that I can use in viewtopics.php that gives me the forum id of the forum to which the particular topic belongs? I need this to make sure that I am doing the translation the right way around.

I tried both $fid and $forum_id (which are used in other parts of the forum code) but both variables appear to be unknown in viewtopics.php

Thomas

Re: External Hyperlinks

$cur_topic['forum_id']

Looking for a certain modification for your forum? Please take a look here before posting.

Re: External Hyperlinks

Thanks a lot.

It occured to me that having the category id would actually be better for my purposes as I wouldn't have to change the script if I add a new forum. I reckon however this is not known in viewtopics.php without adding a new query to the database.

Thomas