Global Language Change Block »  Show posts from    to     

Icy Phoenix


Old Support Topics - Global Language Change Block



KugeLSichA [ Mon 14 Mar, 2011 23:11 ]
Post subject: Global Language Change Block
Hey guys,

i´ve been working on this for 2 days now... and cant figure it out... i hope you can give me some tips...

I want to let my users change there lang in a easy way... so i´ve done this so far, look the picture...
lang_select
Deactivated the lang select function in page_header, an put the function in a block file, and the added the block file as global block via CMS...

Works pretty good! ... BUT: only for guests...

I want to allow loggedin users this feature too... I tried to take some functions from usercp_register but cant get this to work if the user is logged in...

Can someone help me the add the needed code lines/sql queries to update the users lang in the DB...

here is my work so far...

blocks\blocks_imp_lang.php
Spoiler: [ Show ]


templates\default\blocks\lang_block.tpl
Spoiler: [ Show ]


Thanks in advance!


spydie [ Mon 14 Mar, 2011 23:37 ]
Post subject: Re: Global Language Change Block
your doing this for .53 or for new version ??

Ups . sorry.

looks like your on .53 cause new version (svn) got no page header. only globals




i think you forgot to declare : $lang_select = '';

on the begining of the function

Code: [Hide] [Select]
// Mighty Gorgon - Change Lang/Style - Begin
$lang_select = '';
if ((($board_config['select_lang'] == true) && (!$userdata['session_logged_in'])))


hm and maybe include the constants.php because of the defines

this is just a snippet of your code


KugeLSichA [ Mon 14 Mar, 2011 23:57 ]
Post subject: Re: Global Language Change Block
Hi spydie!

spydie wrote: [View Post]
your doing this for .53 or for new version ??

Ups . sorry.

looks like your on .53 cause new version (svn) got no page header. only globals


oh yeah i forgot that... sorry...

not a .53 its a beta version from some time ago... but similar to .53 (not the SVN version)

spydie wrote: [View Post]

i think you forgot to declare : $lang_select = '';

on the begining of the function

Code: [Hide] [Select]
// Mighty Gorgon - Change Lang/Style - Begin
$lang_select = '';
if ((($board_config['select_lang'] == true) && (!$userdata['session_logged_in'])))


this is just a snippet of your code


yupp but this var is for the guests not needed...

and for the logged in users i also tried with this var... -> not working


spydie [ Tue 15 Mar, 2011 00:02 ]
Post subject: Re: Global Language Change Block
hm

i´ll have a look on that tomorow. bit late allready.

let´s see, if i finish my menu mod first




Powered by Icy Phoenix