Simple Machines Community Forum

General Community => Scripting Help => Topic started by: dan1dyoung on October 07, 2006, 11:09:33 AM

Title: The "Select Language" Dropdown on this site??
Post by: dan1dyoung on October 07, 2006, 11:09:33 AM
I am trying to get a dropdown like this site has for selecting language but it does not work correctly yet.


The language drop down on this site, i have had a go at adding it, but with 2 issues.  First it would not allow the selection of english so i removed the Selected=Selected part and now i can change ALL languages but it always goes back to the first language no matter what language the page is in.  Second i want it visible to all users, but where it is placed it is only viewable to logged in users.  I have duplicated the form code for now to make it viewable by ALL users, but this is naturally not the solution.  What PHP code can i use to allow that part of the table viewable by all users but hide the read unanswered posts links to logged in users only??

index.template.php
http://www.simplemachines.org/community/index.php?topic=114747.msg734964#msg734964 (http://www.simplemachines.org/community/index.php?topic=114747.msg734964#msg734964)

Thanks

Dan
Title: Re: The "Select Language" Dropdown on this site??
Post by: sawz on October 10, 2006, 10:50:25 AM
i have one at my forum, and logged in or not it works, however,
like you, it reverts to the uppermost position which i have labeled "Language".
you select your language, it changes to the selected language, but the drop
down goes back to the top selection. doesn't work the same as here, but it works.
Title: Re: The "Select Language" Dropdown on this site??
Post by: dan1dyoung on October 14, 2006, 09:09:55 PM
Bump????

Thanks
Title: Re: The "Select Language" Dropdown on this site??
Post by: Oldiesmann on October 15, 2006, 10:48:12 PM
If you can post the code you're using, I'll show you how to do this. I can also show you how to make it stay on the current page :)
Title: Re: The "Select Language" Dropdown on this site??
Post by: sawz on October 16, 2006, 05:52:30 AM
its not pretty but it works. thanks for offering:
Quote<form action="http://forums.com/index.php" method="post" class="smalltext" style="float: right;">
            <label for="language_select" class="smalltext">Select language:</label> <select id="language_select" name="language" onchange="this.form.submit()" class="smalltext">
                                  <option value="">Language</option>
                                      <option value="brazilian-utf8">Brazilian</option>
               <option value="english">English</option>
                                      <option value="swedish-utf8">Swedish</option>
               </select>&nbsp;<noscript><input type="submit" value="Go" /></noscript>
         </form>