Language Drop Down

Started by Matthew K., January 02, 2007, 11:41:04 PM

Previous topic - Next topic

l_nix

I just uploaded it directly...

here is the error...

Fatal error: Cannot redeclare template_language_select() (previously declared in /home/ftma6384/public_html/forum/php2ftm/Sources/Load.php(1726) : eval()'d code:522) in /home/ftma6384/public_html/forum/php2ftm/Sources/Load.php(1726) : eval()'d code on line 393


I've never opened Load.php... only the index.template.php.

do i only need to move a file or is it something that was changed in the index.template.php you just sent me?

Kindest regards,

SleePy

Some reason it was already in the code like somebody tried to add it  :o

Removed the duplicate function.
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

l_nix

Great work... thanks Sleepy!

That works great... one last thing.

<form action="" method="post" class="smalltext" style="float: right;">

What can i do to move it down a couple pixels and over to the right more.... as of now it's in the middle of the page.

Can i add something to that form action...

Best,

:)

SleePy

In the code template_language_select() is called (Not the one with function before it)
You can move that anywhere you want in the code or edit code around it.
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

Croco

in smf2 it was running for a couple of days and then stopped with a note: 'sorry, no matches were found'  (it happened twice on 2 separate copies of smf2 after couple of days it stops finding any languages)

i checked the code and even reinstall the mod nothing changed same problem (so it is not related to any modification on mod's code (though i didn't change anything) )

i suspect it is related to dir::read() but i am not sure
any opinion about this ?


I am back. I will try to catch up with some stuff soon.
Regards,
Croco

My sites
Andareena.com
Andareen.net(Under Constraction :P)

New plans coming soon


Good links for you to visit:
Docs
Search

SleePy

Well this mod saves in the cache. So clear your file cache and see if it fixes it. It may be possible sometimes when it reads the files that either none are returned.
If this happens still after this, I might have to look into having it not save the cache or clearing the cache if its empty.
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

Croco

Quote from: SleePy on March 30, 2008, 06:36:57 PM
Well this mod saves in the cache. So clear your file cache and see if it fixes it. It may be possible sometimes when it reads the files that either none are returned.
If this happens still after this, I might have to look into having it not save the cache or clearing the cache if its empty.

if you mean my browser cache this happens for all my browsers and all my users
I am back. I will try to catch up with some stuff soon.
Regards,
Croco

My sites
Andareena.com
Andareen.net(Under Constraction :P)

New plans coming soon


Good links for you to visit:
Docs
Search

Croco

about this line

updateMemberData($user_info['id'], array('lngfile' => '\'' . $language . '\''));


i think it should be like this

updateMemberData($user_info['id'], array('lngfile' =>  $language ));


because $language contains a string already and when you use the first line it is saved in DB as ('English')
when it should be only (English)

so you are adding ( ' ) for the string name

when updating the language in same session it works but in next login it cause a problem because 'English' doesn't exist thats when it takes its value from DB

this post is not related to the previous problem i mentioned
SMF version: 2.0 Beta 3 Public
I am back. I will try to catch up with some stuff soon.
Regards,
Croco

My sites
Andareena.com
Andareen.net(Under Constraction :P)

New plans coming soon


Good links for you to visit:
Docs
Search

SleePy

No this is SMF file cache that was added in SMF 2.0 (as well as regular caching in SMF 1.1).

Yea, I think I copied part of that code from the Profile in some version of SMF..
Hmm, looking at things I think I see a few bugs.. I need to check this out and edit some things to get it working properly now..
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

Croco

new error in SMF2.0 beta 3 public

this line

$context['languages'] = unserialize($modSettings['selectLanguage']);


give me this error:
Quote
8: unserialize() [<a href='function.unserialize'>function.unserialize</a>]: Error at offset 5 of 171 bytes

i didn't investigate it yet but i will soon if anyone knows a solution for this i will appreciate that

thanks in advance
I am back. I will try to catch up with some stuff soon.
Regards,
Croco

My sites
Andareena.com
Andareen.net(Under Constraction :P)

New plans coming soon


Good links for you to visit:
Docs
Search

Croco

about cache file it is disable on my site
I am back. I will try to catch up with some stuff soon.
Regards,
Croco

My sites
Andareena.com
Andareen.net(Under Constraction :P)

New plans coming soon


Good links for you to visit:
Docs
Search

SleePy

The cache has to be enabled as that is only used when the cache exists and is valid.

Edit. Though try this line as a replacement:

$context['languages'] = unserialize(stripslashes($modSettings['selectLanguage']));
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

Croco

yea that solved the problem thank you
I am back. I will try to catch up with some stuff soon.
Regards,
Croco

My sites
Andareena.com
Andareen.net(Under Constraction :P)

New plans coming soon


Good links for you to visit:
Docs
Search

SleePy

Ahh then thats it :P

In the 2.0 version I kinda forced a cache with my own method (This is something that due to its nature I wanted to force caching of). When I added it to the database I added slashes.. But I forgot to remove them :P

Will see it in the next update of the mod (most likely on the next 2.0 update).
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

Mike_R

Hi SleePy,

I'm sorry to bother you but I read the posts here and I can't figure it out. It works with the default theme no problems. I just can't figure out where to insert the code into my DilberMC theme. I would like it to be in the same position as the default, but I don't have any of the code in my index.template.php. I kinda makes it worse as I have the Ads mod also which seems to be in the same area.  Can you help me please? I am running SMF 1.1.4 I am very new but try my best to do it myself.  Thank-you

SleePy

Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

Mike_R

Thank you for the quick reply! I did try it and the site would not come up... it gave me this error:

Unable to load the 'main_above' template.

Any ideas?

Thanks again, Mike

Quote from: SleePy on April 21, 2008, 10:47:25 PM
Try this one.

SleePy

Did the file complete uploading?
Did you try another browser/ftp program to download it?
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

Mike_R

#178
Yes I did, I downloaded it again and then FTP'd and have the same error still. I reloaded the original so everything is OK. I tried moving the code you gave me around and unfortunatley I was getting worse errors (fatal). I don't know much about PHP so I guess I should know better  :)  Hope you can help me through this I really like this Mod.

SleePy

Can you pm me your ftp and site details? I an make the change.

Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

Advertisement: