Add extra language drop down-lists

Need some custom code changes to the phpBB core simple enough that you feel doesn't require an extension? Then post your request here so that community members can provide some assistance.

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Post Reply
fnys
Registered User
Posts: 26
Joined: Sun Oct 24, 2010 11:52 pm
Location: Stockholm
Name: Fredrik Nyström

Add extra language drop down-lists

Post by fnys »

Support Request Template
What version of phpBB are you using? phpBB 3.2.2
What is your board's URL? www.toysport.se
Who do you host your board with? www.one.com
How did you install your board? I used the download package from phpBB.com
What is the most recent action performed on your board? Fresh Install
Is registration required to reproduce this issue? No
Do you have any MODs installed? No
Do you have any extensions installed? Yes
What extensions do you have installed? STOP FORUM SPAM
BOARD RULES
ONEALL SOCIAL LOGIN
PHPBB FORM CREATOR
CALENDAR
IMGUR
What styles do you currently have installed? Prosilver, Aero
What language(s) is your board currently using? English, Swedish
Which database type/version are you using? MariaDB
What is your level of experience? New to PHP but not phpBB
What actions did you take (updating your board; installing a MOD, style or extension; etc.) prior to this problem becoming noticeable? none
Please describe your problem.

I'm trying to get a functional language drop-down list on my forum, in the board rules section but the drop down list won't show any languages to choose between :cry:
language drop down-list.jpg

I took the drop down-list code from /styles/prosilver/template/ucp_agreement.html:

Code: Select all

<script type="text/javascript">
// <![CDATA[
	/**
	* Change language
	*/
	function change_language(lang_iso)
	{
		document.cookie = '{COOKIE_NAME}_lang=' + lang_iso + '; path={COOKIE_PATH}';
		document.forms['register'].change_lang.value = lang_iso;
		document.forms['register'].submit();
	}

// ]]>
</script>

	<form method="post" action="{S_UCP_ACTION}" id="register">
		<p class="rightside">
			<label for="lang">{L_LANGUAGE}{L_COLON}</label><select name="lang" id="lang" onchange="change_language(this.value); return false;" title="{L_LANGUAGE}">{S_LANG_OPTIONS}</select>
			{S_HIDDEN_FIELDS}
		</p>
	</form>

	<div class="clear"></div>

...and I tried for example placing it in your official extension BOARD RULES, in
/ext/phpbb/boardrules/styles/prosilver/template/boardrules_controller.html:

Code: Select all

<!-- INCLUDECSS @phpbb_boardrules/boardrules_controller.css -->
<!-- INCLUDE overall_header.html -->


<script type="text/javascript">
// <![CDATA[
	/**
	* Change language
	*/
	function change_language(lang_iso)
	{
		document.cookie = '{COOKIE_NAME}_lang=' + lang_iso + '; path={COOKIE_PATH}';
		document.forms['register'].change_lang.value = lang_iso;
		document.forms['register'].submit.click();
	}
// ]]>
</script>

	<dl>
		<dt><label for="lang">{L_LANGUAGE}{L_COLON}</label></dt>
		<dd><select name="lang" id="lang" onchange="change_language(this.value); return false;" tabindex="6" title="{L_LANGUAGE}">{S_LANG_OPTIONS}</select></dd>
	</dl>








<h2 class="boardrules-header">{L_BOARDRULES_HEADER}</h2>


<div class="panel bg1" id="faqlinks">
	<div class="inner">

<!-- IF S_CATEGORIES -->
<div class="boardrules-categories">
	<div class="mini-panel">
		<div class="inner">	
			<h3>{L_BOARDRULES_CATEGORIES}</h3>
			<ul class="boardrules-menu">
				<!-- BEGIN rules -->
					<!-- IF rules.S_IS_CATEGORY --><li><a href="#{rules.U_ANCHOR}">{rules.TITLE}</a></li><!-- ENDIF -->
				<!-- END rules -->
			</ul>
		</div>
	</div>
</div>
<!-- ENDIF -->

<div class="boardrules-container">
<br>
	<div id="main" class="content">
		<p>{BOARDRULES_EXPLAIN}</p>
		<ol class="boardrules-rules">
			<!-- BEGIN rules -->
				<!-- IF rules.S_CLOSE_LIST -->
						</ol>
					</li>
				<!-- ELSEIF rules.S_IS_CATEGORY -->
					<li id="{rules.U_ANCHOR}">
						<h3>{rules.TITLE}</h3>
						<ol>
				<!-- ELSE -->
							<li class="rule-item" id="{rules.U_ANCHOR}">
								{rules.MESSAGE} <a class="rule-anchor postlink" href="#{rules.U_ANCHOR}">#</a>
							</li>
				<!-- ENDIF -->
			<!-- END rules -->
		</ol>
	</div>
</div>

	</div>
</div>

<!-- INCLUDEJS @phpbb_boardrules/boardrules_controller.js -->
<!-- INCLUDE overall_footer.html -->
It shows the drop down list but without content/text/options.

I have Purge the cache after uploading to server.
Does anyone knows what I am doing wrong?

Generated by SRT Generator
Post Reply

Return to “phpBB Custom Coding”