Jump to content


[Hack] MKPortal Search block Google language support


  • You cannot reply to this topic
No replies to this topic

#1 visiblesoul

  • Administrators
  • 551 posts
  • Location:Earth
  • Texas

Posted 14 May 2006 - 06:46 PM

This is a nice hack that will change which international Google site is used when searching from the MKPortal Search block. The URL will change depending on what language the user has set in forum preferences.

For example, an English user's search would go to google.com but a German user's search would go to google.de

Thanks to stefroy for a great idea. This should be a default feature of MKPortal.

FIND in /mkportal/blocks/search.php:
				<tr>
				  <td class="tdblock" align="center">
					<a href="http://www.google.it/"><img src="$this->siteurl/mkportal/modules/search/google_logo.gif" alt="Google" align="top" /></a>


					<form action="http://www.google.com/search" method="get" target="blank">		
					<input size="12" name="q" class="mkblkinput" />

					<input type="hidden" name="hl" />
					<input type="submit" name="btnG" value="{$this->lang['m_search']}" />
					</form>
				  </td>
				</tr>
REPLACE WITH:
				<tr>
				  <td class="tdblock" align="center">
					<a href="{$this->lang['googlesite']}"><img src="$this->siteurl/mkportal/modules/search/google_logo.gif" alt="Google" align="top" /></a>


					<form action="{$this->lang['googlesite']}search" method="get" target="blank">		
					<input size="12" name="q" class="mkblkinput" />

					<input type="hidden" name="hl" />
					<input type="submit" name="btnG" value="{$this->lang['m_search']}" />
					</form>
				  </td>
				</tr>
ADD this to each lang_global.php language file:
$langmk['googlesite'] = "http://www.google.com/";
Change the URL in each lang file to point to the Google site for each language. For example put this in the German language file...

$langmk['googlesite'] = "http://www.google.de/";



Please note that I offer free support on this forum in my free time. Depending on how much work I have backlogged it may take me a week or more to answer questions. I am not ignoring you. I answer everyone but please be patient. Thanks.

Disclaimer: All forum posts, including code examples, on this forum are offered for free in the hope that they will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Use code examples at your own risk.

"If at first you don't succeed, keep on suckin' til you do succeed." -Curly Howard





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users