messages.id="' . $id . '" and messages_to.person="' . $_SESSION['userid'] . '" '; $db->select($query); if ($db->num_rows == 1) { $this->data = $db->data[0]; } } function load_to() { global $db; $query = 'person.id, person.first_name, person.last_name from messages_to left join person on messages_to.person=person.id where messages_to.message="' . $this->data['id'] . '"'; $db->select($query); $this->to = $db->data; } function format() { $fdata = $this->data; $fdata['text_html'] = html_br($fdata['text']); $fdata['created_html'] = local_date($fdata['created'], 'ymdHi'); $fdata['author_first_name_html'] = mask_html($fdata['author_first_name']); $fdata['author_last_name_html'] = mask_html($fdata['author_last_name']); $to_list = array(); $seperator = array(); foreach ($this->to as $i => $to) { $to['first_name'] = mask_html($to['first_name']); $to['last_name'] = mask_html($to['last_name']); $to['seperator'] = $seperator; $seperator = array(array());
function person_requests() { global $db; $db->select('id, vorname as first_name, nachname as last_name from neu_account'); $data = array(); foreach ($db->data as $i => $person) { $person['first_name'] = mask_html($person['first_name']); $person['last_name'] = mask_html($person['last_name']); $data[] = $person; } return $data; }
function format() { $fdata = $this->data; if (!isset($fdata['nid'])) { $fdata['nid'] = ''; } $fdata['description'] = mask_html($fdata['description']); $fdata['birthday'] = date_input('data[birthday_arr]', $fdata['birthday']); for ($i = 0; $i < strlen($this->opt_str); $i++) { $fdata['opt' . $i] = array(); if ($this->opt_str[$i]) { $fdata['opt' . $i][] = array(); } } $fdata['pic'] = $this->picture(); $this->fdata = $fdata; }
function format_data($prefix = '') { $this->format_user_rights(); $d =& $this->data; $d['dir'] = array(); $d['file'] = array(); if ($this->is_file()) { $d['file'][] = array(); } else { $d['dir'][] = array(); } $d['last_change_local'] = local_date_new($d['last_change']); $d['name_html'] = mask_html($d['name']); if ($prefix) { $d_cache = $d; foreach ($d_cache as $key => $value) { $d[$prefix . $key] = $value; } } }
function text2line() { $this->teacher_offset = 0; $text = substr($this->text, 1, -56); $html = mask_html($text); $all_lines = explode("\r\n", $html); $array = array(); foreach ($all_lines as $i => $text) { $text = trim($text); $text = substr($text, 1); $line = array(); $line['text'] = $text; $line['class'] = ''; $array[$i] = $line; if ($text == 'Betroffen:') { $this->teacher_offset = $i; } } $this->line = $array; }
function list_names(&$data, $type) { $data[$type] = array(); $string = ''; $ids = array(); if (isset($_POST[$type])) { $string = $_POST[$type]; if ($string) { $ids = find_name($type, $string); } foreach ($ids as $id => $name) { $data[$type][$id] = array('id' => $id, 'name' => $name); } } $data[$type . '_name'] = stripslashes(mask_html($string)); $data[$type . '_count'] = count($ids); }
function set_data($data) { $this->id = (int) $data['id']; $_SESSION['this'] = 'infoschool'; $_SESSION['userid'] = $this->id; $_SESSION['first_name'] = $data['first_name']; $_SESSION['last_name'] = $data['last_name']; // $_SESSION['name'] = str_replace(' ',' ',mask_html($data['first_name'].' '.$data['last_name'])); // obsolete $_SESSION['name'] = mask_html($data['first_name'] . ' ' . $data['last_name']); $_SESSION['last_login'] = $data['last_login']; $_SESSION['admin'] = false; if (isset($data['admin']) && $data['admin']) { $_SESSION['admin'] = true; } self::loadOptionsFromCookies(); if (isset($_COOKIE['userid']) || isset($_POST['passwd']) && isset($_POST['save'])) { setcookie('userid', $this->id, strtotime('+3 months'), '/'); setcookie('passwd', $data['passwd'], strtotime('+3 months'), '/'); setcookie('first_name', $data['first_name'], strtotime('+3 months'), '/'); setcookie('last_name', $data['last_name'], strtotime('+3 months'), '/'); } }
function format_data() { $fdata = $this->data; if ($fdata['topic'] == '') { $fdata['topic'] = '?'; } $fdata['topic_html'] = mask_html($fdata['topic']); $fdata['text_html'] = mask_html($fdata['text']); $fdata['text_html_xt'] = html_br($fdata['text']); if ($this->new) { $fdata['created_html'] = local_date_new($fdata['created']); } else { $fdata['created_html'] = local_date($fdata['created'], 'ymdHi'); } $this->fdata = $fdata; }