Welcome to Geeklog, Anonymous Friday, March 29 2024 @ 04:31 am EDT

Geeklog Forums

glblocks, titles, and languages


Status: offline

Tymz79

Forum User
Junior
Registered: 07/23/03
Posts: 15
Hey Folks, Lovin GL, it\'s working great as a content management tool for a project I\'m working on. Anyways, just some minor stuff I noticed with the language output for Block Titles in GL blocks, such as Poll and User Functions. In lib_common.php, when calling the function COM_startBlock, in some cases $title is sent (a parameter that is either blank \'\', or a value taken from the database) and in other cases it\'s respective value from a LANG array is sent. For example: Example 1) When a poll exists, but has not been taken, the LANG01[16] is passed to the function, and the proper word for \"Vote\" from the language file is outputed. When the poll has already been taken, or the user visits the pollbooth, then $title is passed, resulting in what is typically the english value from the database. Example 2) When a user is not logged in, $LANG01[47] is passed to the function, and the proper words for \"User Functions\" from the language file is outputed. When the user is logged in, then $title is passed, resulting in the english value from the database. In most cases the language for \"User Functions\" block title isn\'t even noticed, but I made the language functionality available to guests, which is why it came up. So far these are the only ones I found, and I think \"Events\" might be doing the same thing, but I am still sifting through and testing. I took a quick glance through the forum to see if anyone had posted this, in order to avoid redunt topics, and I did not find anything. I am still using version 1.3.7, but noticed that geeklog.net does a similar thing with v. 1.3.8. Anyways, hope this helps towards future updates, or explains the reason for anyone else who encounters it.
 Quote

Status: offline

Tymz79

Forum User
Junior
Registered: 07/23/03
Posts: 15
I forgot to mention that this is only noticeable when a user changes their language settings. Some glblock titles (mentioned in last post) remain in english despite them having a value in the language files. I hope I explained it alright and it makes sense.
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Quote by Tymz79:Some glblock titles (mentioned in last post) remain in english despite them having a value in the language files.
Haven\'t looked into the details yet (most of it did seem to make sense, though). But most of the block titles are stored in the database, so they won\'t change when you switch languages. bye, Dirk
 Quote

Status: offline

Tymz79

Forum User
Junior
Registered: 07/23/03
Posts: 15
Quote by Dirk: Haven\'t looked into the details yet (most of it did seem to make sense, though). But most of the block titles are stored in the database, so they won\'t change when you switch languages.
Yep, they are. And glblock titles are editable in geeklog as an Admin as well. I presume that this is in case admin\'s want to change it, they can. It seems that if they are left to the default from installation, the functions in lib-common check for that and replace them from the language php file, a great feature, but works partially. For example: If I change my language to spanish, notice the User Functions block title remains in english. This value is in the database. Now, if I log out, the block title changes to what it would be in spanish, from the language php file. Log back in, and its in english again. Tym.
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Quote by Tymz79:It seems that if they are left to the default from installation, the functions in lib-common check for that and replace them from the language php file, a great feature, but works partially.
Actually, there is no such feature Mr. Green The block titles are always read from the database. The default titles are hard-coded in sql/mysql_tableanddata.php (which isn\'t nice but hard to change in the current code base). The only side blocks that I can think of that actually use strings from the language file are What\'s Related, Story Options, and (partially) the User Functions block. bye, Dirk
 Quote

Status: offline

Tymz79

Forum User
Junior
Registered: 07/23/03
Posts: 15
Oh okay, that makes more sense. I\'ll check it out. Thanks. By the way, don\'t know if I mentioned, but GL is a great app. It\'s not only met, but exceeded my expectations. Great work. Tym.
Quote by Dirk: Actually, there is no such feature Mr. Green The block titles are always read from the database. The default titles are hard-coded in sql/mysql_tableanddata.php (which isn\'t nice but hard to change in the current code base). The only side blocks that I can think of that actually use strings from the language file are What\'s Related, Story Options, and (partially) the User Functions block. bye, Dirk
 Quote

tycoon

Anonymous
curious
I too have just noticed this behavior with the 'User Functions' block. When logged in as a user, the title displays as 'My Account' (as I set it in the admin section). When logged out, it goes back to 'User Functions'. Any ideas??

Thanks!
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
As (implicitly) mentioned above, the block will use the title you set when someone's logged in and the default text from the language file when they're not. That's normal behaviour.

If you don't like the default text, change it in the language file.

bye, Dirk
 Quote

tycoon

Anonymous
happy
Changed it in the /language/english.php file. Better now - thanks!
 Quote

All times are EDT. The time is now 04:31 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content