Predefined Variables

From e107 Wiki
Jump to: navigation, search

e107 Wiki: English | Русский | Deutsch | Français | Magyar | Português | Български | Česky | Nederlands | Ελληνικά | Italiano | Norske | Polska | Slovenščina | Español | Svenska | Translate: Wiki | Page

logo_wiki.png

Current Release 1.0.4 | e107.org | Download | Changelog | Forum | Plugins | Themes | RSS Feed of Latest Changes | Atom Feed of Latest Changes


How to write a plugin
Main page > I : First Aid > II : Development > III : Administration > IV : How To's > V : Plugin Writing > VI : Theming & Shortcodes


This page is a stub. You can help e107 by expanding it. Portuguese

There are many variables created by e107 by default on each pageload - these should be used in code wherever practicable.

Name Type Meaning
$currentUser array This variable is created in class2.php on pageload if the user accessing the page is a logged-in user. Each key of the array will be populated with the field values from the e107_user and e107_user_extended tables.

The value of the extended fields takes into consideration the default values for the fields as specified in the user extended config.

For example, if you want the current user's login name, you would use $currentUser['user_loginname'].

Also, when using extended user field values, the keys will be prepended with user_ before the name.

Depending on your scope, you may be required to use global $currentUser;