本文整理汇总了PHP中loadLanguage函数的典型用法代码示例。如果您正苦于以下问题:PHP loadLanguage函数的具体用法?PHP loadLanguage怎么用?PHP loadLanguage使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了loadLanguage函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: AddPost
function AddPost()
{
global $txt, $mbname, $context, $db_prefix, $sourcedir, $modSettings;
loadLanguage('index');
adminIndex('postscheduler_settings');
require_once $sourcedir . '/Subs-Post.php';
// Get the boards.
$context['schedule_boards'] = array();
$request = db_query("\n\tSELECT \n\t\tb.ID_BOARD, b.name AS bName, c.name AS cName \n\tFROM {$db_prefix}boards AS b, {$db_prefix}categories AS c \n\tWHERE b.ID_CAT = c.ID_CAT ORDER BY c.catOrder, b.boardOrder", __FILE__, __LINE__);
while ($row = mysql_fetch_assoc($request)) {
$context['schedule_boards'][$row['ID_BOARD']] = $row['cName'] . ' - ' . $row['bName'];
}
mysql_free_result($request);
// Load Message Icons
$context['msg_icons'] = array();
$result = db_query("SELECT title, filename\n\t\t\t\tFROM {$db_prefix}message_icons\n\t\t\t\t", __FILE__, __LINE__);
while ($row = mysql_fetch_assoc($result)) {
$context['msg_icons'][] = $row;
}
$context['page_title'] = $mbname . ' - ' . $txt['postscheduler_addpost'];
// Set the page title
$context['sub_template'] = 'addpost';
// Check if spellchecking is both enabled and actually working.
$context['show_spellchecking'] = !empty($modSettings['enableSpellChecking']) && function_exists('pspell_new');
$context['post_box_name'] = 'message';
$context['post_form'] = 'frmfeed';
}
示例2: testInstall
public function testInstall($verify = 1)
{
global $DB;
// Delete if Table of Monitoring yet in DB
$query = "SHOW FULL TABLES WHERE TABLE_TYPE LIKE 'VIEW'";
$result = $DB->query($query);
while ($data = $DB->fetch_array($result)) {
if (strstr($data[0], "monitoring")) {
$DB->query("DROP VIEW " . $data[0]);
}
}
$query = "SHOW TABLES";
$result = $DB->query($query);
while ($data = $DB->fetch_array($result)) {
if (strstr($data[0], "monitoring")) {
$DB->query("DROP TABLE " . $data[0]);
}
}
passthru("cd ../tools && /usr/local/bin/php -f cli_install.php");
$_SESSION['glpi_use_mode'] = 2;
$_SESSION["glpiID"] = 2;
Plugin::load("monitoring");
loadLanguage("en_GB");
if ($verify == '1') {
$MonitoringInstall = new MonitoringInstall();
$MonitoringInstall->testDB("monitoring");
}
$GLPIlog = new GLPIlogs();
$GLPIlog->testSQLlogs();
$GLPIlog->testPHPlogs();
}
示例3: ShowAdminHelp
function ShowAdminHelp()
{
global $txt, $helptxt, $context, $scripturl;
if (!isset($_GET['help']) || !is_string($_GET['help'])) {
fatal_lang_error('no_access', false);
}
if (!isset($helptxt)) {
$helptxt = array();
}
// Load the admin help language file and template.
loadLanguage('Help');
// Permission specific help?
if (isset($_GET['help']) && substr($_GET['help'], 0, 14) == 'permissionhelp') {
loadLanguage('ManagePermissions');
}
loadTemplate('Help');
// Set the page title to something relevant.
$context['page_title'] = $context['forum_name'] . ' - ' . $txt['help'];
// Don't show any template layers, just the popup sub template.
$context['template_layers'] = array();
$context['sub_template'] = 'popup';
// What help string should be used?
if (isset($helptxt[$_GET['help']])) {
$context['help_text'] = $helptxt[$_GET['help']];
} elseif (isset($txt[$_GET['help']])) {
$context['help_text'] = $txt[$_GET['help']];
} else {
$context['help_text'] = $_GET['help'];
}
// Does this text contain a link that we should fill in?
if (preg_match('~%([0-9]+\\$)?s\\?~', $context['help_text'], $match)) {
$context['help_text'] = sprintf($context['help_text'], $scripturl, $context['session_id'], $context['session_var']);
}
}
示例4: load_theme
public static function load_theme()
{
global $context, $modSettings, $txt, $settings, $user_info;
if (($themes = cache_get_data('TS_themes_list', 3600)) === null) {
loadLanguage('ManageThemes');
require_once SUBSDIR . '/Themes.subs.php';
$themes = availableThemes($user_info['theme'], $user_info['id']);
cache_put_data('TS_themes_list', $themes, 3600);
}
foreach ($themes[0] as $theme_id => $theme) {
$name = $theme['name'];
$selected = !empty($user_info['theme']) && $user_info['theme'] == $theme_id;
$context['ThemeSelector'][$theme_id] = array('name' => $name, 'selected' => $selected, 'variants' => array());
if (isset($theme['variants'])) {
foreach ($theme['variants'] as $key => $variant) {
$context['ThemeSelector'][$theme_id]['variants'][$key] = array('name' => $variant['label'], 'selected' => $context['theme_variant'] == '_' . $key);
}
}
}
if (!isset($context['theme_header_callbacks'])) {
$context['theme_header_callbacks'] = array();
}
$context['theme_header_callbacks'][] = 'themeselector';
loadTemplate('ThemeSelector');
loadJavascriptFile('ThemeSelector.js');
loadCSSFile('ThemeSelector.css');
}
示例5: ManageCalendar
function ManageCalendar()
{
global $context, $txt, $scripturl, $modSettings;
isAllowedTo('admin_forum');
// Administrative side bar, here we come!
adminIndex('manage_calendar');
// Everything's gonna need this.
loadLanguage('ManageCalendar');
// Default text.
$context['explain_text'] =& $txt['calendar_desc'];
// Little short on the ground of functions here... but things can and maybe will change...
$subActions = array('editholiday' => 'EditHoliday', 'holidays' => 'ModifyHolidays', 'settings' => 'ModifySettings');
$_REQUEST['sa'] = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : 'settings';
// Set up the two tabs here...
$context['admin_tabs'] = array('title' => &$txt['manage_calendar'], 'help' => 'calendar', 'description' => $txt['calendar_settings_desc'], 'tabs' => array('holidays' => array('title' => $txt['manage_holidays'], 'description' => $txt['manage_holidays_desc'], 'href' => $scripturl . '?action=managecalendar;sa=holidays'), 'settings' => array('title' => $txt['calendar_settings'], 'description' => $txt['calendar_settings_desc'], 'href' => $scripturl . '?action=managecalendar;sa=settings', 'is_last' => true)));
// Select the tab they're at...
if (isset($context['admin_tabs']['tabs'][$_REQUEST['sa']])) {
$context['admin_tabs']['tabs'][$_REQUEST['sa']]['is_selected'] = true;
}
// Some settings may not be enabled, disallow these from the tabs as appropriate.
if (empty($modSettings['cal_enabled'])) {
unset($context['admin_tabs']['tabs']['holidays']);
}
$subActions[$_REQUEST['sa']]();
}
示例6: ManageSmileys
function ManageSmileys()
{
global $context, $txt, $scripturl, $modSettings;
isAllowedTo('manage_smileys');
adminIndex('manage_smileys');
loadLanguage('ManageSmileys');
loadTemplate('ManageSmileys');
$subActions = array('addsmiley' => 'AddSmiley', 'editicon' => 'EditMessageIcons', 'editicons' => 'EditMessageIcons', 'editsets' => 'EditSmileySets', 'editsmileys' => 'EditSmileys', 'import' => 'EditSmileySets', 'modifyset' => 'EditSmileySets', 'modifysmiley' => 'EditSmileys', 'setorder' => 'EditSmileyOrder', 'settings' => 'EditSmileySettings', 'install' => 'InstallSmileySet');
// Default the sub-action to 'edit smiley settings'.
$_REQUEST['sa'] = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : 'settings';
$context['page_title'] =& $txt['smileys_manage'];
$context['sub_action'] = $_REQUEST['sa'];
$context['sub_template'] =& $context['sub_action'];
// Load up all the tabs...
$context['admin_tabs'] = array('title' => &$txt['smileys_manage'], 'help' => 'smileys', 'description' => $txt['smiley_settings_explain'], 'tabs' => array('editsets' => array('title' => $txt['smiley_sets'], 'description' => $txt['smiley_editsets_explain'], 'href' => $scripturl . '?action=smileys;sa=editsets'), 'addsmiley' => array('title' => $txt['smileys_add'], 'description' => $txt['smiley_addsmiley_explain'], 'href' => $scripturl . '?action=smileys;sa=addsmiley'), 'editsmileys' => array('title' => $txt['smileys_edit'], 'description' => $txt['smiley_editsmileys_explain'], 'href' => $scripturl . '?action=smileys;sa=editsmileys'), 'setorder' => array('title' => $txt['smileys_set_order'], 'description' => $txt['smiley_setorder_explain'], 'href' => $scripturl . '?action=smileys;sa=setorder'), 'editicons' => array('title' => $txt['icons_edit_message_icons'], 'description' => $txt['icons_edit_icons_explain'], 'href' => $scripturl . '?action=smileys;sa=editicons'), 'settings' => array('title' => $txt['settings'], 'description' => $txt['smiley_settings_explain'], 'href' => $scripturl . '?action=smileys;sa=settings', 'is_last' => true)));
// Select the right tab based on the sub action.
if (isset($context['admin_tabs']['tabs'][$context['sub_action']])) {
$context['admin_tabs']['tabs'][$context['sub_action']]['is_selected'] = true;
}
// Some settings may not be enabled, disallow these from the tabs as appropriate.
if (empty($modSettings['messageIcons_enable'])) {
unset($context['admin_tabs']['tabs']['editicons']);
}
if (empty($modSettings['smiley_enable'])) {
unset($context['admin_tabs']['tabs']['addsmiley']);
unset($context['admin_tabs']['tabs']['editsmileys']);
unset($context['admin_tabs']['tabs']['setorder']);
}
// Call the right function for this sub-acton.
$subActions[$_REQUEST['sa']]();
}
示例7: RegCenter
function RegCenter()
{
global $modSettings, $context, $txt, $db_prefix, $scripturl;
// Old templates might still request this.
if (isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'browse') {
redirectexit('action=viewmembers;sa=browse' . (isset($_REQUEST['type']) ? ';type=' . $_REQUEST['type'] : ''));
}
$subActions = array('register' => array('AdminRegister', 'moderate_forum'), 'agreement' => array('EditAgreement', 'admin_forum'), 'reservednames' => array('SetReserve', 'admin_forum'), 'settings' => array('AdminSettings', 'admin_forum'));
// Work out which to call...
$context['sub_action'] = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : (allowedTo('moderate_forum') ? 'register' : 'settings');
// Must have sufficient permissions.
isAllowedTo($subActions[$context['sub_action']][1]);
// Set the admin area...
adminIndex('registration_center');
// Loading, always loading.
loadLanguage('Login');
loadTemplate('Register');
// Next create the tabs for the template.
$context['admin_tabs'] = array('title' => &$txt['registration_center'], 'help' => 'registrations', 'description' => $txt['admin_settings_desc'], 'tabs' => array('register' => array('title' => $txt['admin_browse_register_new'], 'description' => $txt['admin_register_desc'], 'href' => $scripturl . '?action=regcenter;sa=register', 'is_selected' => $context['sub_action'] == 'register', 'is_last' => !allowedTo('admin_forum'))));
if (allowedTo('admin_forum')) {
$context['admin_tabs']['tabs']['agreement'] = array('title' => $txt['smf11'], 'description' => $txt['smf12'], 'href' => $scripturl . '?action=regcenter;sa=agreement', 'is_selected' => $context['sub_action'] == 'agreement');
$context['admin_tabs']['tabs']['reservednames'] = array('title' => $txt[341], 'description' => $txt[699], 'href' => $scripturl . '?action=regcenter;sa=reservednames', 'is_selected' => $context['sub_action'] == 'reservednames');
$context['admin_tabs']['tabs']['settings'] = array('title' => $txt['settings'], 'description' => $txt['admin_settings_desc'], 'href' => $scripturl . '?action=regcenter;sa=settings', 'is_last' => true, 'is_selected' => $context['sub_action'] == 'settings');
}
// Finally, get around to calling the function...
$subActions[$context['sub_action']][0]();
}
示例8: Packages
function Packages()
{
global $txt, $scripturl, $sourcedir, $context;
isAllowedTo('admin_forum');
// Managing packages!
adminIndex('manage_packages');
// Load all the basic stuff.
require_once $sourcedir . '/Subs-Package.php';
loadLanguage('Packages');
loadTemplate('Packages');
// Set up the linktree and title so it's already done.
$context['linktree'][] = array('url' => $scripturl . '?action=packages', 'name' => &$txt['package1']);
$context['page_title'] = $txt['package1'];
// Delegation makes the world... that is, the package manager go 'round.
$subActions = array('browse' => 'PackageBrowse', 'remove' => 'PackageRemove', 'list' => 'PackageList', 'install' => 'PackageInstallTest', 'install2' => 'PackageInstall', 'uninstall' => 'PackageInstallTest', 'uninstall2' => 'PackageInstall', 'installed' => 'InstalledList', 'options' => 'PackageOptions', 'flush' => 'FlushInstall', 'examine' => 'ExamineFile');
// Work out exactly who it is we are calling.
if (isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']])) {
$context['sub_action'] = $_REQUEST['sa'];
} else {
$context['sub_action'] = 'browse';
}
// Set up some tabs...
$context['admin_tabs'] = array('title' => &$txt['package1'], 'description' => $txt['package_manager_desc'], 'tabs' => array('browse' => array('title' => $txt['package3'], 'href' => $scripturl . '?action=packages;sa=browse'), 'packageget' => array('title' => $txt['download_packages'], 'description' => $txt['download_packages_desc'], 'href' => $scripturl . '?action=packageget'), 'installed' => array('title' => $txt['installed_packages'], 'description' => $txt['installed_packages_desc'], 'href' => $scripturl . '?action=packages;sa=installed'), 'options' => array('title' => $txt['package_settings'], 'description' => $txt['package_install_options_ftp_why'], 'href' => $scripturl . '?action=packages;sa=options', 'is_last' => true)));
// Attempt to automatically select the right tab.
if (isset($context['admin_tabs']['tabs'][$context['sub_action']])) {
$context['admin_tabs']['tabs'][$context['sub_action']]['is_selected'] = true;
} else {
$context['admin_tabs']['tabs']['browse']['is_selected'] = true;
}
// Call the function we're handing control to.
$subActions[$context['sub_action']]();
}
示例9: ManageSmileys
function ManageSmileys()
{
global $context, $txt, $scripturl, $modSettings;
isAllowedTo('manage_smileys');
loadLanguage('ManageSmileys');
loadAdminTemplate('ManageSmileys');
$subActions = array('addsmiley' => 'AddSmiley', 'editicon' => 'EditMessageIcons', 'editicons' => 'EditMessageIcons', 'editsets' => 'EditSmileySets', 'editsmileys' => 'EditSmileys', 'import' => 'EditSmileySets', 'modifyset' => 'EditSmileySets', 'modifysmiley' => 'EditSmileys', 'setorder' => 'EditSmileyOrder', 'settings' => 'EditSmileySettings', 'install' => 'InstallSmileySet');
// Default the sub-action to 'edit smiley settings'.
$_REQUEST['sa'] = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : 'editsets';
$context['page_title'] = $txt['smileys_manage'];
$context['sub_action'] = $_REQUEST['sa'];
$context['sub_template'] = $context['sub_action'];
// Load up all the tabs...
$context[$context['admin_menu_name']]['tab_data'] = array('title' => $txt['smileys_manage'], 'help' => 'smileys', 'description' => $txt['smiley_settings_explain'], 'tabs' => array('editsets' => array('description' => $txt['smiley_editsets_explain']), 'addsmiley' => array('description' => $txt['smiley_addsmiley_explain']), 'editsmileys' => array('description' => $txt['smiley_editsmileys_explain']), 'setorder' => array('description' => $txt['smiley_setorder_explain']), 'editicons' => array('description' => $txt['icons_edit_icons_explain']), 'settings' => array('description' => $txt['smiley_settings_explain'])));
// Some settings may not be enabled, disallow these from the tabs as appropriate.
if (empty($modSettings['messageIcons_enable'])) {
$context[$context['admin_menu_name']]['tab_data']['tabs']['editicons']['disabled'] = true;
}
if (empty($modSettings['smiley_enable'])) {
$context[$context['admin_menu_name']]['tab_data']['tabs']['addsmiley']['disabled'] = true;
$context[$context['admin_menu_name']]['tab_data']['tabs']['editsmileys']['disabled'] = true;
$context[$context['admin_menu_name']]['tab_data']['tabs']['setorder']['disabled'] = true;
}
// Call the right function for this sub-acton.
$subActions[$_REQUEST['sa']]();
}
示例10: Packages
function Packages()
{
global $txt, $sourcedir, $context;
//!!! Remove this!
if (isset($_GET['get']) || isset($_GET['pgdownload'])) {
require_once $sourcedir . '/PackageGet.php';
return PackageGet();
}
isAllowedTo('admin_forum');
// Load all the basic stuff.
require_once $sourcedir . '/lib/Subs-Package.php';
loadLanguage('Packages');
loadAdminTemplate('Packages');
$context['page_title'] = $txt['package'];
// Delegation makes the world... that is, the package manager go 'round.
$subActions = array('browse' => 'PackageBrowse', 'remove' => 'PackageRemove', 'list' => 'PackageList', 'ftptest' => 'PackageFTPTest', 'install' => 'PackageInstallTest', 'install2' => 'PackageInstall', 'uninstall' => 'PackageInstallTest', 'uninstall2' => 'PackageInstall', 'installed' => 'InstalledList', 'options' => 'PackageOptions', 'perms' => 'PackagePermissions', 'flush' => 'FlushInstall', 'examine' => 'ExamineFile', 'showoperations' => 'ViewOperations');
// Work out exactly who it is we are calling.
if (isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']])) {
$context['sub_action'] = $_REQUEST['sa'];
} else {
$context['sub_action'] = 'browse';
}
// Set up some tabs...
$context[$context['admin_menu_name']]['tab_data'] = array('title' => $txt['package_manager'], 'description' => $txt['package_manager_desc'], 'tabs' => array('browse' => array(), 'packageget' => array('description' => $txt['download_packages_desc']), 'installed' => array('description' => $txt['installed_packages_desc']), 'perms' => array('description' => $txt['package_file_perms_desc']), 'options' => array('description' => $txt['package_install_options_ftp_why'])));
// Call the function we're handing control to.
$subActions[$context['sub_action']]();
}
示例11: ModifyKarmaSettings
/**
* Config array for chaning the karma settings
* Accessed from ?action=admin;area=featuresettings;sa=karma;
*
* @param $return_config
*/
function ModifyKarmaSettings($return_config = false)
{
global $txt, $scripturl, $context, $modSettings;
loadLanguage('Karma+ManageKarma');
if (empty($modSettings['karmaMode'])) {
$config_vars = array(array('select', 'karmaMode', explode('|', $txt['karma_options'])));
} else {
$config_vars = array(array('select', 'karmaMode', explode('|', $txt['karma_options'])), '', array('int', 'karmaMinPosts', 6, 'postinput' => strtolower($txt['posts'])), array('float', 'karmaWaitTime', 6, 'postinput' => $txt['hours']), array('check', 'karmaTimeRestrictAdmins'));
}
call_integration_hook('integrate_karma_settings', array(&$config_vars));
if ($return_config) {
return $config_vars;
}
// Saving?
if (isset($_GET['save'])) {
checkSession();
call_integration_hook('integrate_save_karma_settings');
saveDBSettings($config_vars);
$_SESSION['adm-save'] = true;
redirectexit('action=admin;area=featuresettings;sa=karma');
}
$context['post_url'] = $scripturl . '?action=admin;area=featuresettings;save;sa=karma';
$context['settings_title'] = $txt['karma'];
loadLanguage('ManageKarma');
prepareDBSettingContext($config_vars);
}
示例12: PackageGet
function PackageGet()
{
global $txt, $scripturl, $context, $boarddir, $sourcedir, $modSettings;
isAllowedTo('admin_forum');
require_once $sourcedir . '/Subs-Package.php';
// Still managing packages...
adminIndex('manage_packages');
// Use the Packages template... no reason to separate.
loadLanguage('Packages');
loadTemplate('Packages');
// Add the appropriate items to the link tree.
$context['linktree'][] = array('url' => $scripturl . '?action=packages', 'name' => &$txt['package1']);
$context['linktree'][] = array('url' => $scripturl . '?action=packageget', 'name' => &$txt['smf182']);
$context['page_title'] = $txt['package1'];
// Here is a list of all the potentially valid actions.
$subActions = array('servers' => 'PackageServers', 'add' => 'PackageServerAdd', 'browse' => 'PackageGBrowse', 'download' => 'PackageDownload', 'remove' => 'PackageServerRemove', 'upload' => 'PackageUpload');
// Now let's decide where we are taking this...
if (isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']])) {
$context['sub_action'] = $_REQUEST['sa'];
} elseif ($_REQUEST['action'] == 'pgdownload') {
$context['sub_action'] = 'download';
} else {
$context['sub_action'] = 'servers';
}
// Now create the tabs for the template.
$context['admin_tabs'] = array('title' => &$txt['package1'], 'description' => $txt['package_manager_desc'], 'tabs' => array('browse' => array('title' => $txt['package3'], 'href' => $scripturl . '?action=packages;sa=browse'), 'packageget' => array('title' => $txt['download_packages'], 'description' => $txt['download_packages_desc'], 'href' => $scripturl . '?action=packageget', 'is_selected' => true), 'installed' => array('title' => $txt['installed_packages'], 'description' => $txt['installed_packages_desc'], 'href' => $scripturl . '?action=packages;sa=installed'), 'options' => array('title' => $txt['package_settings'], 'description' => $txt['package_install_options_ftp_why'], 'href' => $scripturl . '?action=packages;sa=options', 'is_last' => true)));
$subActions[$context['sub_action']]();
}
示例13: AddPost
function AddPost()
{
global $txt, $mbname, $context, $smcFunc, $sourcedir, $modSettings;
loadLanguage('index');
require_once $sourcedir . '/Subs-Post.php';
// Get the boards.
$context['schedule_boards'] = array();
$request = $smcFunc['db_query']('', "\n\tSELECT \n\t\tb.ID_BOARD, b.name AS bName, c.name AS cName \n\tFROM {db_prefix}boards AS b, {db_prefix}categories AS c \n\tWHERE b.ID_CAT = c.ID_CAT ORDER BY c.cat_order, b.board_order");
while ($row = $smcFunc['db_fetch_assoc']($request)) {
$context['schedule_boards'][$row['ID_BOARD']] = $row['cName'] . ' - ' . $row['bName'];
}
$smcFunc['db_free_result']($request);
// Load Message Icons
$context['msg_icons'] = array();
$result = $smcFunc['db_query']('', "SELECT title, filename\n\t\t\t\tFROM {db_prefix}message_icons\n\t\t\t\t");
while ($row = $smcFunc['db_fetch_assoc']($result)) {
$context['msg_icons'][] = $row;
}
$context['page_title'] = $mbname . ' - ' . $txt['postscheduler_addpost'];
// Set the page title
$context['sub_template'] = 'addpost';
// Check if spellchecking is both enabled and actually working.
$context['show_spellchecking'] = !empty($modSettings['enableSpellChecking']) && function_exists('pspell_new');
$context['post_box_name'] = 'message';
$context['post_form'] = 'frmfeed';
// Needed for the WYSIWYG editor.
require_once $sourcedir . '/Subs-Editor.php';
// Now create the editor.
$editorOptions = array('id' => 'message', 'value' => '', 'width' => '90%', 'form' => 'frmfeed', 'labels' => array('addpost' => $txt['postscheduler_addpost']));
create_control_richedit($editorOptions);
$context['post_box_name'] = $editorOptions['id'];
}
示例14: ENotifyMain
function ENotifyMain()
{
global $modSettings;
// Guests can't have unread things, we don't know anything about them.
is_not_guest();
// Update our unread replies log
if (!empty($modSettings['enotify_replies'])) {
ENotifyUpdateUnreadReplies();
}
// Update our personal messages log
if (!empty($modSettings['enotify_pms'])) {
ENotifyUpdatePms();
}
// Load up the notifications at last :)
ENotifyLoad();
// Run our garbage collection randomly (setting 0.05% chance for it to run)
$random = rand(1, 5000);
if ($random == '1987') {
ENotifyGarbageCollect();
}
// Load the language and the template file.
loadLanguage('ENotify');
loadTemplate('ENotify');
template_enotify_main();
// We use this to deactivate the SMF Wrapping Templates
die;
}
示例15: member_context
public static function member_context(&$memID, $display_custom_fields)
{
global $context, $modSettings, $memberContext, $scripturl, $txt;
static $karma;
loadLanguage('Karma');
if (!empty($modSettings['karmaMode']) && $display_custom_fields) {
if (empty($karma[$memID])) {
$karma = loadMemberCustomFields($memID, array('karma_good', 'karma_bad'));
}
if (empty($karma[$memID]['karma_good']['value'])) {
$karma[$memID]['karma_good']['value'] = 0;
}
if (empty($karma[$memID]['karma_bad']['value'])) {
$karma[$memID]['karma_bad']['value'] = 0;
}
// Total or +/-?
if ($modSettings['karmaMode'] == 1) {
$value = $karma[$memID]['karma_good']['value'] - $karma[$memID]['karma_bad']['value'];
} elseif ($modSettings['karmaMode'] == 2) {
$value = '+' . $karma[$memID]['karma_good']['value'] . ' / -' . $karma[$memID]['karma_bad']['value'];
}
$memberContext[$memID]['custom_fields'][] = array('title' => $txt['karma'], 'col_name' => 'karma', 'value' => $value, 'placement' => 6);
$memberContext[$memID]['custom_fields'][] = array('title' => '', 'col_name' => 'karma_labels', 'value' => '
<a href="' . $scripturl . '?action=karma;sa=applaud;uid=' . $memID . ';' . $context['session_var'] . '=' . $context['session_id'] . '">' . $txt['karmaApplaudLabel'] . '</a>
<a href="' . $scripturl . '?action=karma;sa=smite;uid=' . $memID . ';' . $context['session_var'] . '=' . $context['session_id'] . '">' . $txt['karmaSmiteLabel'] . '</a>', 'placement' => 6);
}
}