News:

Join the Facebook Fan Page.

Main Menu

Text Strings

Started by Acans, September 07, 2010, 11:01:47 PM

Previous topic - Next topic

Acans

How do they work?

Basically I want to load text strings from admin.english.php to work in my subs.php, however how do i do that?
"The Book of Arantor, 17:3-5
  And I said unto him, thy database query shalt always be sent by the messenger of $smcFunc
  And $smcFunc shall protect you against injections and evil
  And so it came to pass that mysql_query was declared deprecated and even though he says he is not
  dead yet, the time was soon to come to pass when mysql_query shall be gone and no more

Matthew K.

loadLanguage('Admin');
That loads a language file. Replacing "Admin" with the name of the language file, dropping .language.php, obviously.

Then you can call up strings contained in the file below.

Labradoodle-360

Acans

Just pop that in subs.php?
"The Book of Arantor, 17:3-5
  And I said unto him, thy database query shalt always be sent by the messenger of $smcFunc
  And $smcFunc shall protect you against injections and evil
  And so it came to pass that mysql_query was declared deprecated and even though he says he is not
  dead yet, the time was soon to come to pass when mysql_query shall be gone and no more

Matthew K.

Well, not just anywhere. But as long as it's in the function where you need to use the strings, yes.

Acans

I'm tring to load it to the menu, so this function right?

function setupMenuContext()
"The Book of Arantor, 17:3-5
  And I said unto him, thy database query shalt always be sent by the messenger of $smcFunc
  And $smcFunc shall protect you against injections and evil
  And so it came to pass that mysql_query was declared deprecated and even though he says he is not
  dead yet, the time was soon to come to pass when mysql_query shall be gone and no more

Matthew K.

Try this.

./Sources/Subs.php
Code (Find) Select

function setupMenuContext()
{
global $context, $modSettings, $user_info, $txt, $scripturl;

Code (Add After) Select

// Load the Admin Language File...
loadLanguage('Admin');

Acans

Works perfectly, Thanks Labradoodle-360!
"The Book of Arantor, 17:3-5
  And I said unto him, thy database query shalt always be sent by the messenger of $smcFunc
  And $smcFunc shall protect you against injections and evil
  And so it came to pass that mysql_query was declared deprecated and even though he says he is not
  dead yet, the time was soon to come to pass when mysql_query shall be gone and no more

Matthew K.

Not a problem...glad you got it! :)

Marking topic as resolved.

Advertisement: