function add_todo($data, $gids = array())
{
    $uid = $_SESSION['userid'];
    if (trim($data['name']) == '') {
        $data['name'] = 'todo';
    }
    $data['name'] = text2html($data['name']);
    $data['text'] = format_msg($data['text']);
    if (sizeof($gids) > 0) {
        foreach ($gids as $gid => $gname) {
            $member = get_personen($gid);
            if (personArrayContainsId($member, $uid)) {
                for ($i = 0; $i < sizeof($member); $i++) {
                    $pids[$member[$i]['id']] = 'those who understand binary and those who dont';
                }
            }
        }
    } else {
        $pids[$uid] = '';
    }
    $todo = new todo();
    $todo->data = $data;
    foreach ($pids as $pid => $there_are_only_10_types_of_people) {
        $todo->create($pid);
    }
}
Example #2
0
function format_msg($text)
{
    $text = text2html($text);
    $t = '.*?';
    foreach ($GLOBALS['code_html'] as $c => $r) {
        $p = '/\\[' . $c . '\\](' . $t . ')\\[\\/' . $c . '\\]/s';
        while (preg_match($p, $text, $m)) {
            $ersatz = $r;
            $text = preg_replace($p, $ersatz, $text, 1);
        }
    }
    $text = nl2br($text);
    return $text;
}
function mod_todo($data, $origin)
{
    $validDate = new Date($data['year'], $data['month'], $data['day']);
    $data['deadline'] = $validDate->toString() . ' ' . $data['hour'] . ':' . $data['minute'] . ':' . $data['second'];
    if (trim($data['name']) == '') {
        $data['name'] = 'todo';
    }
    $data['name'] = text2html($data['name']);
    $data['text'] = format_msg($data['text']);
    if (!isset($data['expire'])) {
        $data['expire'] = false;
    }
    $t = new todo();
    $t->data = $data;
    $t->save();
    $_SESSION['calendar_week'] = w_dif($data['deadline']);
    redirect('todo.php?tid=' . $data['id']);
}
Example #4
0
function rss2html($message, $shortlinks = TRUE)
{
    $message = unhtmlentities($message);
    // 1. remove html-enties
    $message = text2html($message);
    // 2. make new html
    $message = link2html($message, TRUE);
    // 3. make links in html
    $message = preg_replace("'&lt;([\\/\\!]*?[^&gt;]*?)&gt;'si", "<\\1>", $message);
    // 4. special bugfix (some tags are not interpreted)
    if ($shortlinks == TRUE) {
        // 5. breaking large links (bugfix template damaged with large links)
        $max_length_for_link = 40;
        $message = preg_replace("/>(https?:\\/\\/|ftps?:\\/\\/)(www\\.)?([\\w\\s\\=\\?\\.\\&\\#\\/\\:\\;\\,\\_\\-\\@\\*\\!\\%\$\\'\"]+)</e", "'><span title=\"\\1\\2\\3\">' . substr('\\3',0,strpos('\\3','/')) . ((strpos('\\3','/')!= strrpos('\\3','/')) ? '/...' : '') . substr('\\3', strrpos('\\3','/'), (strlen('\\3') > {$max_length_for_link} ? {$max_length_for_link} : strlen('\\3'))) . '</span><'", $message);
        // 6. this replaces all absolute links to 'phpmyadmin.net/home_page/' into relative links
        //    because this is needed for building and testing the new homepage on my debug-server (mkkeck)
        $message = preg_replace("/<a href=\"http:\\/\\/(www\\.)phpmyadmin.net\\/home_page\\/([\\w\\s\\=\\?\\.\\&\\#\\/\\:\\;\\,\\_\\-\\@\\*\\!\\%\$\\'\"]+)/", "<a href=\"\\2", $message);
    }
    return $message;
}
Example #5
0
$tar->toTar("combined.tgz", TRUE);
unset($tar);
// Removing 2 files from the new.tar file created above
$tar = new tar();
$tar->openTar("new.tar", FALSE);
$tar->removeFile("example.php");
$tar->removeFile("example2.php");
$tar->saveTar();
// Saves to currently open TAR file (In this case, new.tar)
unset($tar);
// Check if a TAR file contains a specific file
$tar = new tar();
$tar->openTar("new.tar", FALSE);
if ($tar->containsFile("tar.class.php")) {
    echo "This tar file contains a file named 'tar.class.php'!<br>\n";
} else {
    echo "This tar file does NOT contain a file named 'tar.class.php'!<br>\n";
}
// There is no need to save our tar file since we did not edit it, so delete our tar class
unset($tar);
// Get information about a file in a TAR file
$tar = new tar();
$tar->openTar("new.tar");
// If second argument is not present, default is FALSE
$information = $tar->getFile("tar.class.php");
echo "<br>\n<b>Information about tar.class.php!</b><br>\n";
foreach ($information as $key => $value) {
    echo "&nbsp;&nbsp;&nbsp;&nbsp;{$key} = " . text2html($value) . "<br>\n";
}
echo "<br>\n";
echo "</font>";
 function save($data)
 {
     $id = $this->data['id'];
     $name = text2html($data['name']);
     $dsc = text2html($data['description']);
     $notiz = text2html($data['note']);
     $update = "gruppe set\n                     name='{$name}',\n                     dsc='{$dsc}',\n                     notiz='{$notiz}'\n                    where id='{$id}'";
     $this->db->update($update);
 }
Example #7
-5
function get_neu_person_form($person)
{
    $dir = $GLOBALS['root'] . 'benutzer/';
    if (isset($person['accept'])) {
        $person['accept'] = ' checked';
    } else {
        $person['accept'] = '';
    }
    if (!isset($person['vorname'])) {
        $person['vorname'] = '';
    }
    if (!isset($person['nachname'])) {
        $person['nachname'] = '';
    }
    if (!isset($person['gebtag'])) {
        $person['gebtag'] = '';
    }
    if (!isset($person['gebmon'])) {
        $person['gebmon'] = '';
    }
    if (!isset($person['mail'])) {
        $person['mail'] = '';
    }
    if (!isset($person['passwd1'])) {
        $person['passwd1'] = '';
    }
    if (!isset($person['passwd2'])) {
        $person['passwd2'] = '';
    }
    $vars['%bedingungen%'] = FileReader::readFile($dir . 'bedingungen.html');
    $vars['%accept%'] = $person['accept'];
    $vars['%vorname%'] = text2html($person['vorname']);
    $vars['%nachname%'] = text2html($person['nachname']);
    if (isset($person['gebjahr'])) {
        $gebjahr = $person['gebjahr'];
    } else {
        $gebjahr = date('Y') - 12;
    }
    $gebdat = get_select_int('person[gebtag]', 1, 32, $person['gebtag']);
    $gebdat .= get_select_int('person[gebmon]', 1, 13, $person['gebmon']);
    $gebdat .= get_select_int('person[gebjahr]', date('Y') - 65, date('Y') - 5, $gebjahr);
    $vars['%gebdat%'] = $gebdat;
    $vars['%mail%'] = $person['mail'];
    $vars['%passwd1%'] = text2html($person['passwd1']);
    $vars['%passwd2%'] = text2html($person['passwd2']);
    $form = FileReader::readFile($dir . 'neu_person.html', $vars);
    return $form;
}