function field_interface($field, $action, &$data) { // REMEMBER: fields must be declared in the construct, at customFields array # checks if this field should be displayed differently or not at all on an administrative environment # return TRUE to use default, FALSE not to display or the STRING that will replace the area if ($field == "history") { if ($action) { return false; } // do not show when adding $history = unserialize($data['history']); $output = ""; if (is_array($history)) { foreach ($history as $item) { $output .= "<b>" . fd($item['time'], "H:i:s " . $this->parent->intlControl->getdate()) . "</b> - "; $output .= outputBrowserName($item['browser']) . " " . $item['browserVersion']; $output .= " - IP=" . IPv6To4($item['ip']) . "<br/>"; } } return $output == '' ? false : $output; } else { if ($field == "userprefs" && isset($this->parent->loadedPlugins['bi_adm'])) { // THIS IS ABOUT NEKOI'S bi_ADM $admObj = $this->parent->loadedPlugins['bi_adm']; $up = isset($data['userprefs']) ? $data['userprefs'] : ''; $up = unserialize($up); if (!is_array($up)) { $up = array(); } if (!isset($up['skin'])) { $up['skin'] = defined("CONS_ADM_BASESKIN") ? CONS_ADM_BASESKIN : 'base'; } if (!isset($up['init'])) { $up['init'] = 'index'; } if (!isset($up['pfim'])) { $up['pfim'] = CONS_DEFAULT_IPP; } if (!isset($up['menufont'])) { $up['menufont'] = 12; } if (!isset($up['sf'])) { $up['sf'] = '1'; } if (!isset($up['floating'])) { $up['floating'] = '0'; } if (!isset($up['lang'])) { $up['lang'] = CONS_DEFAULT_LANG; } // prefered language $output = "<div style='height:32px'><div style='width:100px;float:left;height:20px'>" . $this->parent->langOut('language') . "</div><div style='height:20px'><select name='user_prefs_lang' style='margin:0px'>"; foreach (explode(",", CONS_POSSIBLE_LANGS) as $lang) { $output .= "<option value='{$lang}'" . ($lang == $up['lang'] ? ' selected="selected"' : "") . ">{$lang}</option>"; } $output .= "</select></div></div>"; // skin $output .= "<div style='height:32px'><div style='width:100px;float:left;height:20px'>" . $this->parent->langOut('skin') . "</div><div style='height:20px'><select name='user_prefs_skin' style='margin:0px'>"; if (defined('CONS_ADM_ACTIVESKINGS')) { $skins = explode(",", CONS_ADM_ACTIVESKINGS); } else { $skins = array('base'); } foreach ($skins as $skin) { $output .= "<option value='{$skin}'" . ($skin == $up['skin'] ? ' selected="selected"' : "") . ">{$skin}</option>"; } $output .= "</select></div></div>"; // start page $output .= "<div style='height:32px'><div style='width:100px;float:left;height:20px'>" . $this->parent->langOut('startpage') . "</div><div style='height:20px'><select name='user_prefs_init' style='margin:0px'>"; $possibles = array('index', 'logs'); if ($_SESSION[CONS_SESSION_ACCESS_LEVEL] == 100) { $possibles[] = "master"; } if (isset($this->parent->loadedPlugins['bi_stats'])) { $possibles[] = "stats_analytics"; } if (isset($this->parent->loadedPlugins['bi_pm'])) { $possibles[] = "bi_pm_index"; } foreach ($this->parent->modules as $modname => &$m) { if ($m->options[CONS_MODULE_SYSTEM] || $m->linker) { continue; } $possibles[] = $modname; } foreach ($possibles as $p) { $output .= "<option value='{$p}'" . ($p == $up['init'] ? ' selected="selected"' : "") . ">" . (isset($this->parent->modules[$p]) ? $this->parent->langOut('list') . " " : "") . $this->parent->langOut($p) . "</option>"; } $output .= "</select></div></div>"; // pfim (ipp - itens per page) $output .= "<div style='height:32px'><div style='width:100px;float:left;height:20px'>" . $this->parent->langOut('pfimsize') . "</div><div style='height:20px'>"; $output .= "<input type='text' style='width:50px;margin:0px' name='user_prefs_pfim' value='" . $up['pfim'] . "'/> " . $this->parent->langOut('itens') . "</div></div>"; // smart filter $output .= "<div style='height:32px'><div style='width:100px;float:left;height:20px'>" . $this->parent->langOut('smartfilter') . "</div><div style='height:20px'>"; $output .= "<input type='checkbox' name='user_prefs_sf' id='user_prefs_sf'" . ($up['sf'] == 1 ? " checked='checked'" : "") . "><label for='user_prefs_sf'>" . $this->parent->langOut('smartfilter_fulltext') . "</label></div></div>"; // floater $output .= "<div style='height:32px'><div style='width:100px;float:left;height:20px'>" . $this->parent->langOut('floaterbar') . "</div><div style='height:20px'>"; $output .= "<input type='checkbox' name='user_prefs_floating' id='user_prefs_floating'" . ($up['floating'] == 1 ? " checked='checked'" : "") . "><label for='user_prefs_floating'>" . $this->parent->langOut('floaterbar_fulltext') . "</label></div></div>"; // menu font $output .= "<div style='height:32px'><div style='width:100px;float:left;height:20px'>" . $this->parent->langOut('menufont') . "</div><div style='height:20px'>"; $output .= "<input type='text' style='width:50px;margin:0px' name='user_prefs_menufont' value='" . $up['menufont'] . "'/> px</div></div>"; return $output; } } return true; }
<?php $b = getbrowser(false); $core->template->assign("browser", $b[0]); $core->template->assign("fullbrowser", isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : ""); $core->template->assign("islegacy", $b[1] ? "1" : "0"); $core->template->assign("ismobile", $b[2] ? "1" : "0"); $ipv4 = IPv6To4(CONS_IP); $core->template->assign("ip", CONS_IP . ($ipv4 != CONS_IP ? " (" . $ipv4 . ")" : "")); $core->template->assign("servertime", date("H:i d/m/Y")); $core->template->assign("system", $b[3]); $core->template->assign("pversion", AFF_VERSION . " #" . AFF_BUILD);