Page 1 of 1

Add language block to simple portal

Posted: 11 Nov 2011, 10:57
by Terr0r
I have try to set a language block to simple portal but it will not work

I get the code uit the UCP file for the register file but it will not work

I have now this code

I Have this in the portal.php

Code: Select all

			// Checking amount of available languages
			$sql = 'SELECT lang_id
				FROM ' . LANG_TABLE;
			$result = $db->sql_query($sql);

			$lang_row = array();
			while ($row = $db->sql_fetchrow($result))
			{
				$lang_row[] = $row;
			}
			$db->sql_freeresult($result);

			if ($coppa === false && $config['coppa_enable'])
			{
				$now = getdate();
				$coppa_birthday = $user->format_date(mktime($now['hours'] + $user->data['user_dst'], $now['minutes'], $now['seconds'], $now['mon'], $now['mday'] - 1, $now['year'] - 13), $user->lang['DATE_FORMAT']);
				unset($now);

				$template->assign_vars(array(
					'S_LANG_OPTIONS'	=> (sizeof($lang_row) > 1) ? language_select($user_lang) : '',
				));
			}
			else
			{
				$template->assign_vars(array(
					'S_LANG_OPTIONS'	=> (sizeof($lang_row) > 1) ? language_select($user_lang) : '',
					)
				);
			}
			unset($lang_row);

			$this->tpl_name = 'ucp_agreement';
			return;
		
		
		$add_lang = ($change_lang) ? '&change_lang=' . urlencode($change_lang) : '';
		$change_lang	= request_var('change_lang', '');
		if ($change_lang || $user_lang != $config['default_lang'])
		{
			$use_lang = ($change_lang) ? basename($change_lang) : basename($user_lang);

			if (!validate_language_iso_name($use_lang))
			{
				if ($change_lang)
				{
					$submit = false;

					// Setting back agreed to let the user view the agreement in his/her language
					$agreed = (empty($_GET['change_lang'])) ? 0 : $agreed;
				}

				$user->lang_name = $user_lang = $use_lang;
				$user->lang = array();
				$user->data['user_lang'] = $user->lang_name;
				$user->add_lang(array('common', 'ucp'));
			}
			else
			{
				$change_lang = '';
				$user_lang = $user->lang_name;
			}
		}
I Have this in the simple_portal.php language file

Code: Select all

	'LANGUAGE'					=> 'Change language',
I Have this in the this in the simple_portal.html

Code: Select all

	<!-- Start Board Language -->
	<div class="forabg">
		<div class="inner"><span class="corners-top"><span></span></span>
		<ul class="topiclist">
			<li class="header">
				<dl class="icon">
					<dt>{LANGUAGE}</dt>
				</dl>
			</li>
		</ul>
		<ul class="topiclist forums">
			<li>			
			<div class="content" style="width:auto; height:auto; padding:10px; padding-bottom:0px; text-align:center;">
<select name="lang" id="lang" onchange="change_language(this.value); return false;" tabindex="6" title="{LANGUAGE}">{S_LANG_OPTIONS}</select>
<br />		
			</div>
			</li>
		</ul>
		<span class="corners-bottom"><span></span></span></div>
	</div>
	<!-- End Board Language -->
I have now this
taal.png
I think the code that state in the portal.php is not good

I hope there is some that can help me out this

already thanks for the help

Greets Terr0r

Add language block to simple portal

Posted: 11 Nov 2011, 18:45
by Theriddler
why so difficult? try this and place the generated code in your block.

I can't test it because i use board3 portal 2.x

good luck :thumb:

http://www.gmodules.com/ig/creator?synd ... ml&lang=en

Add language block to simple portal

Posted: 12 Nov 2011, 20:17
by Terr0r
no that is not what I want

maybe someone else have a solution for me how I can get this block working good

Add language block to simple portal

Posted: 13 Nov 2011, 02:22
by Terr0r
Bump :music:

Add language block to simple portal

Posted: 13 Nov 2011, 15:04
by Stoker

Add language block to simple portal

Posted: 13 Nov 2011, 20:43
by Terr0r
thanks stoker I have it installed on my test forum board and it is working :thumb: