Beispiel #1
0
function kb_build($id, $o)
{
    if ($o) {
        $r = array('²1234567890°+', 'AZERTYUIOP¨£', 'QSDFGHJKLM%µ', 'WXCVBN?./§', '~#{[|`\\^@]}€<>');
    } else {
        $r = array('&é"\'(-è_çà)=', 'azertyuiop^$', 'qsdfghjklmù*', 'wxcvbn,;:!');
    }
    $cap = lj($o ? 'active' : '', 'kbd_plug___keyboard_kb*build_' . $id . '_' . yesno($o), picto('up'));
    foreach ($r as $v) {
        $ra = strsplit($v);
        $i++;
        foreach ($ra as $va) {
            $ret .= lja('popbt', 'insert_b(\'' . $va . '\',\'' . $id . '\')', $va) . ' ';
        }
        if ($i == 1) {
            $ret .= ljb('popw', 'conn', $id . '_del', picto('no'));
        }
        if ($i == 2) {
            $ret .= ljb('popw', 'insert_b', '\\n\',\'' . $id, picto('back'));
        }
        if ($i == 3) {
            $ret .= $cap;
        }
        if ($i == 4) {
            $ret .= lja('popbt', 'insert_b(\' \',\'' . $id . '\')', '--');
        }
        $ret .= br();
    }
    return $ret;
}
Beispiel #2
0
function define_config()
{
    $qbn = sql('mail,rstr,mbrs,config,dscrp', 'qdu', 'a', 'name="' . $_SESSION['qb'] . '"');
    $_SESSION['rstr'] = strsplit($qbn['rstr']);
    unset($_SESSION['rstr'][0]);
    //$_SESSION['rstr']=msql_read('',$_SESSION['qb'].'_rstr','',1);
    $prmb = explode('#', $qbn['config']);
    $_SESSION['prmb'] = prmb_defaults($prmb);
    //config
    $qbin['adminmail'] = $qbn['mail'];
    //$qbin['struct']=$qbn['struct'];
    $qbin['membrs'] = tab_members($qbn['mbrs']);
    $qbin['dscrp'] = $qbn['dscrp'];
    $_SESSION['qbin'] = $qbin;
    $_SESSION['modsnod'] = $_SESSION['qb'] . '_mods_' . prmb(1);
    if ($_SESSION['prmb'][5]) {
        auto_design();
    }
    define_mods('');
    $_SESSION['nms'] = msql_read('lang', 'helps_nominations', '', 1);
    $_SESSION['art_options'] = array('related', 'folder', 'agenda', 'lang', 'template', 'authlevel', 'tracks', '2cols', 'fav', 'like', 'poll');
    $_SESSION['node_clr'] = $_SESSION['qb'];
    $_SESSION['mobile'] = mobile();
    $_SESSION['switch'] = '';
    $_SESSION['prma'] = '';
    $_SESSION['ip'] = sesmk('hostname');
}
Beispiel #3
0
function alternate_design($node_clr)
{
    $_SESSION['switch'] = 1;
    $_SESSION['tab'] = '';
    define_mods($node_clr);
    $qbinb = ser("rstr,config", $_SESSION['qdu'] . ' WHERE name="' . $node_clr . '"');
    $prmb = explode('#', $qbinb["config"]);
    $_SESSION['prmb'] = prmb_defaults($prmb);
    $_SESSION['node_clr'] = $node_clr;
    $_SESSION['rstr'] = strsplit($qbinb['rstr']);
}
 /**
  * Function chmod
  *
  * @param int
  *
  */
 public function chmod($mode)
 {
     $mode = intval($mode);
     if ($this->exists == false) {
         throw new \Exception("File does not exist");
     }
     if ($this->isWriteable == false) {
         throw new \Exception("File is not writeable");
     }
     $validmode = false;
     if ($mode > 777) {
         throw new \Exception("Bad file mode");
     }
     if ($mode < 0) {
         throw new \Exception("Bad file mode");
     }
     $characters = strsplit($mode);
     foreach ($characters as $character) {
         if (intval($character) > 7) {
             throw new \Exception("Bad file mode");
         }
     }
     return chmod($this->value, $mode);
 }
Beispiel #5
0
function clean_punct_b($v)
{
    //del space after first and before last "
    $nbc = substr_count($v, '"');
    if ($nbc / 2 != round($nbc / 2)) {
        return $v;
    }
    $r = strsplit($v);
    $n = count($r);
    $ia = 2;
    for ($i = 0; $i < $n; $i++) {
        if ($r[$i] == '"') {
            $ia = $ia == 2 ? 1 : 2;
            if ($ia == 1 && $r[$i + 1] == ' ') {
                unset($r[$i + 1]);
            }
            if ($ia == 2 && $r[$i - 1] == ' ') {
                unset($r[$i - 1]);
            }
        }
    }
    if ($r) {
        return implode('', $r);
    }
}