Exemple #1
0
function plug_philumsize($p = '', $o = '')
{
    $dr = $p ? $p : 'progb';
    //_old/
    $r = explore($dr, 'files', 1);
    $nm = date('ym');
    if ($r) {
        foreach ($r as $k => $v) {
            if ($v != '_trash.php') {
                $f = $dr . '/' . $v;
                $v = read_file($f);
                $ret[nbf][$k] = substr_count($v, 'function ');
                $ret[siz][$k] = filesize($f);
            }
        }
    }
    if ($ret[nbf]) {
        $nbf = array_sum($ret[nbf]);
    }
    if ($ret[siz]) {
        $siz = round(array_sum($ret[siz]) / 1024, 2);
    }
    //$exs=msql_read('system','program_sizes',$nm); if(!$exs)//eco($exs);
    modif_vars('system', 'program_sizes', array(round($siz), $nbf), $nm);
    $ret = ' ' . $nbf . ' functions / ' . $siz . ' Ko';
    return $ret;
}
Exemple #2
0
function chatsav($p, $nm, $msg)
{
    $nod = ses('qb') . '_chat_' . $p;
    $ret = ajxg($msg);
    if ($ret) {
        modif_vars('users', $nod, array(time(), $nm, $ret), 'push');
    }
    return chatread($p);
}
Exemple #3
0
function umm_sav()
{
    require_once 'params/_connectx.php';
    $dfb['_menus_'] = array('id', 'doc', 'date', 'lang', 'voc', 'link', 'def', 'ex');
    $r = sql('*', 'qu', '', '');
    echo ses('qb') . '_ummodico';
    //p($r);
    if ($r) {
        $r = modif_vars('users', ses('qb') . '_ummodico', $r, 'add', $dfb);
    }
}
Exemple #4
0
function msqadd_j($p, $o, $res)
{
    list($p, $msg) = ajxp($res, $p, $o);
    $dfb['_menus_'] = array('day', 'text');
    $nod = ses('qb') . '_msqadd_' . $p;
    if ($msg) {
        $rb = array(mkday(), $msg);
    }
    //if($rb)$r=msql_modif('users',$nod,$rb,$dfb,'push','');
    if ($rb) {
        $r = modif_vars('users', $nod, $rb, 'push', $dfb);
    }
    $bt = msqlink('users', $nod);
    return lj('popbt', 'plugmsqadd_plug___msqadd_msqadd*read_' . ajx($p), 'reload') . ' ' . $bt;
}
Exemple #5
0
function pet_insert($id, $optb, $res)
{
    $day = time();
    list($name, $mail, $web, $city, $country) = ajxr($res);
    $arr = array($name, $mail, $web, $city, $country, hostname(), 0);
    $bk = lj('txtbox', 'petform_plug___petition_pet*form_' . $id, picto('left'));
    if (pet_insert_verif($mail) == true) {
        return pet_hlp('alert_exists');
    }
    if (strpos($mail, '@') === false or !$name) {
        return $bk . ' ' . pet_hlp('alert_value');
    }
    modif_vars('users', ses('qb') . '_petition_' . $id, $arr, $day);
    pet_mail($id, $day, $mail, $name);
    return nl2br(pet_hlp('confirm_before'));
}
Exemple #6
0
function save_xmsg($dr, $nod, $arr, $dfb = '')
{
    $dir = '../msql/' . $dr . '/';
    if (is_file($dir . $nod . '.php')) {
        if (is_numeric($_GET['suj'])) {
            modif_vars($dr, $nod, $_GET['suj'], 'del');
        } else {
            modif_vars($dr, $nod, $arr, 'push');
        }
    } else {
        $r = read_vars($dir, $nod, $dfb);
        $r[] = $arr;
        if ($r[0]) {
            $r = msq_reorder($r);
        }
        msql_save($dr, $nod, $r);
    }
    if ($arr[2] && ($_GET['chat'] == 'tickets' or $_GET['tickets'])) {
        mail('*****@*****.**', 'tickets', stripslashes($arr[2]), 'From: ' . $_GET['name'] . '<' . $_GET['admail'] . '>');
    }
}
Exemple #7
0
function master_config($div, $va, $cond, $res)
{
    req('boot');
    $r = ajxr(substr($res, 1));
    $r[4] = substr($r[4], 0, 1) != '-' ? $r[4] : '';
    $r[5] = $r[5] != '-' ? $r[5] : '';
    $r[9] = $r[9] != '-' ? $r[9] : '';
    //4cond 5com 6opt 9tmpl
    if ($r[1] == 'blocks') {
        $r[2] = str_replace(array('page', 'popup'), 'bloc', $r[2]);
    }
    //forbidden_blocks
    $nod = $_SESSION['modsnod'];
    $_SESSION['cond'] = determine_cond($r[4]);
    if ($cond == "sav" or $cond == "savb") {
        $ret[$va] = $r;
        array_shift($r);
        $_SESSION['mods'][$div][$va] = $r;
        $ret = modif_vars('users', $nod, $ret, "mdf");
    } elseif ($cond == "add") {
        $md = $r[1] ? $r[1] : $va;
        $pos = $r[0];
        $cnd = $r[2] == '-' ? '' : $r[2];
        $ret = array($div, $md, '', '', $cnd, '', '', '', '', '');
        $cmd = define_modc_b($div);
        if ($cmd) {
            $keys = array_keys($cmd);
            $i = 0;
            foreach ($cmd as $k => $v) {
                $nv = $v;
                array_unshift($nv, $div);
                $nk = $keys[$i];
                if ($nk == 0) {
                    $nk = 'push';
                }
                if ($k == $r[0]) {
                    $nmd[$nk] = $nv;
                    $i++;
                    $nk = $keys[$i];
                    if ($nk == 0) {
                        $nk = 'push';
                    }
                    $nmd[$nk] = $ret;
                } else {
                    $nmd[$nk] = $nv;
                }
                $i++;
            }
        } else {
            $nmd[] = $ret;
        }
        $r = modif_vars('users', $nod, $nmd, "mdf");
        define_mods('', $r);
        define_modc();
        define_prma();
    } elseif ($cond == "new") {
        $nv = $r;
        $nv[0] = $div;
        $r = modif_vars('users', $nod, $nv, "push");
        define_mods('', $r);
        define_modc();
        define_prma();
    } elseif ($cond == "del") {
        unset($_SESSION['mods'][$div][$va]);
        modif_vars('users', $nod, $va, "del");
        define_modc();
        define_prma();
    } elseif ($cond) {
        $_SESSION['cond'] = determine_cond($cond);
    }
    if ($div == 'newsletter') {
        define_mods('');
    }
    return console_block($div, $ret);
}
Exemple #8
0
function informe_config_design()
{
    $cnd = $_SESSION['cond'];
    $cndb = $cnd[1] ? $cnd[1] : $cnd[0];
    $r = define_modc_b('system');
    foreach ($r as $k => $v) {
        if ($v[0] == 'design') {
            $v[1] = $_SESSION['desgn'];
            $_SESSION['prma'][$v[0]] = $v[1];
            //if($_GET['cr_mod'] && $v[3]!=$cndb){$v[3]=$cndb; $k='push';}
            if ($k == 'push') {
                $_SESSION['mods']['system'][] = $v;
            } else {
                $_SESSION['mods']['system'][$k] = $v;
            }
            array_unshift($v, 'system');
            if ($_GET["apply"] == 'save') {
                modif_vars('users', $_SESSION['modsnod'], $v, $k);
            }
        }
    }
}
Exemple #9
0
function patch_sql_stats()
{
    $open = 1;
    $sql = 'CREATE TABLE `' . ses(qd) . '_ips` (
`id` int( 11 ) NOT NULL AUTO_INCREMENT,
`ip` varchar( 255 ) COLLATE latin1_german1_ci NOT NULL DEFAULT "",
`iq` int( 7 ) NOT NULL,
`nav` varchar( 255 ) COLLATE latin1_german1_ci NOT NULL DEFAULT "",
`pag` longtext COLLATE latin1_german1_ci NOT NULL,
`nb` int( 10 ) NOT NULL,
PRIMARY KEY (`id`),
KEY `ip` (`ip`)
) ENGINE = MYISAM DEFAULT CHARSET = latin1 COLLATE = latin1_german1_ci;';
    if ($open) {
        mysql_query($sql) or $ret .= qlerror('ips:exists');
    }
    $ret .= $sql . br() . br();
    $sql = '
INSERT INTO `' . ses(qd) . '_ips` SELECT * FROM `' . ses(qd) . '_eye` ;';
    if ($open) {
        mysql_query($sql) or $ret .= qlerror('ips_copy_eye');
    }
    $ret .= $sql . br() . br();
    $sql = 'alter table ' . ses(qdp) . ' drop iq, drop pag, add ref varchar(255) COLLATE latin1_general_ci NOT NULL after nav, add time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP';
    if ($open) {
        mysql_query($sql) or $ret .= qlerror('alter_ips:error');
    }
    $ret .= $sql . br() . br();
    $sql = 'CREATE TABLE IF NOT EXISTS `' . ses(qd) . '_live` (`id` int(11) NOT NULL AUTO_INCREMENT,
  `iq` int(11) NOT NULL,`qb` int(3) NOT NULL,
  `page` varchar(255) COLLATE latin1_general_ci NOT NULL,
  `time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`), KEY `qb` (`qb`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=1 ;';
    if ($open) {
        mysql_query($sql) or $ret .= qlerror('live:exists');
    }
    $ret .= $sql . br() . br();
    modif_vars('server', 'program_patches', array(1), '140615');
    $_SESSION['stsys'] = 'yes';
    return $ret;
}
Exemple #10
0
function slider_sav($nod, $n)
{
    $rb = explode('_', $nod);
    $rb = ajxr($_GET['res']);
    $nb = count($rb);
    //preload("","","")
    $r = msql_read('gallery', $nod, substr($n, 0, 3) == 'mdf' ? '' : $n);
    if (substr($n, 0, 3) == 'mdf') {
        list($n, $nb) = split('-', $n);
        foreach ($r as $k => $v) {
            if ($k == '_menus_') {
                $rc[$k] = $v;
            } else {
                $rc[$k] = array($v[0], $v[1], $v[2], $v[3], $v[4], $v[5], $v[6], $v[7], $rb[2], $rb[3], $rb[4], $rb[5], $rb[6]);
            }
        }
    } elseif (substr($n, 0, 3) == 'del') {
        list($n, $rc) = split('-', $n);
        msql_modif('gallery', $nod, '', '', 'del', $rc);
        return '';
    } else {
        $rc = array($rb[0], $r['mini'], $r['img'], $r['width'], $r['height'], $r['mini_w'], $r['mini_h'], $rb[1], $rb[2], $rb[3], $rb[4], $rb[5], $rb[6]);
    }
    modif_vars('gallery', $nod, $rc, $n);
    if ($n == 'mdf') {
        return slider_edit($nod, $nb);
    } else {
        return slider_edit($nod, $n);
    }
}
Exemple #11
0
function distrib_share()
{
    $r = distrib_virtual_dir();
    $dr = 'server';
    $nod = 'shared_files';
    if ($r) {
        $ra['_menus_'] = array('url', 'vurl');
        $ra += $r;
        modif_vars($dr, $nod, $ra, 'repl');
    }
}
Exemple #12
0
function msq_create($d, $r, $rb, $k)
{
    $dfb['_menus_'] = $rb;
    foreach ($r as $k => $v) {
        if (!is_array($v)) {
            $r[$k] = array($v);
        }
    }
    if ($r) {
        return modif_vars('users', ses('qb') . '_' . $d, $r, $k, $dfb);
    }
}
Exemple #13
0
function update_msql()
{
    $nm = date('ymd', time());
    $nmb = date('ym', time());
    //mensuel/quotidien
    modif_vars('system', 'program_version', array($nm), 1);
    $exs = msql_read('system', 'program_updates_' . $nmb, '');
    $r = array(date('md', time()), 'publication');
    $dfb['_menus_'] = array('date', 'text');
    if (!$exs) {
        msql_modif('system', 'program_updates_' . $nmb, $r, $dfb, 'push', '');
    }
    $r = array('updates-table', 'ajax', 'popup', 'msql___system_program_updates*' . $nmb, '', 'menu', 'sys', 'server', '', '7');
    //menus
    //modif_vars('system','default_apps_desk',$r,27);
}
Exemple #14
0
function informe_config_widths($defs, $lw, $mw, $rw, $tw)
{
    //inner_values!=css_values
    if ($lw && $rw) {
        $rblc = "lr";
    } elseif ($lw) {
        $rblc = "l";
    } elseif ($rw) {
        $rblc = "r";
    }
    //$cr=obtain_css_widths($defs,array("#content"),"margin:");//see obtain_widths
    //$cr+=obtain_css_widths($defs,array("#content"),"padding:");
    $cr += obtain_css_widths($defs, array('', ".justy"), "padding:");
    $cr += obtain_css_widths($defs, array('', ".justy"), "margin:");
    if (strpos($_SESSION['prma']['blocks'], 'leftbar')) {
        $cr2 = obtain_css_widths($defs, array("#leftbar"), "padding:");
        $cr2 += obtain_css_widths($defs, array("#leftbar"), "margin:");
    }
    if (strpos($_SESSION['prma']['blocks'], 'rightbar')) {
        $cr3 = obtain_css_widths($defs, array("#rightbar"), "padding:");
        $cr3 += obtain_css_widths($defs, array("#rightbar"), "margin:");
    }
    $cr = obtain_css_widths($defs, array('', ".panel"), "padding:");
    if ($lw) {
        $lw -= $cr + $cr2;
    }
    if ($rw) {
        $rw -= $cr + $cr3;
    }
    $cr4 = obtain_css_widths($defs, array("#banner"), "padding:");
    $cr4 += obtain_css_widths($defs, array("#banner"), "margin:");
    $nod = $_SESSION['modsnod'];
    $cnd = $_SESSION['cond'];
    $cndb = $cnd[0] . $cnd[1];
    $r = define_mods_cond_b('system');
    foreach ($r as $k => $v) {
        $presence[$v[0]] = 1;
    }
    if (!$presence['leftbar'] && $lw) {
        $r[] = array('leftbar', $lw, '', $cndb, '', '', '', '');
    }
    if (!$presence['rightbar'] && $rw) {
        $r[] = array('rightbar', $rw, '', $cndb, '', '', '', '');
    }
    foreach ($r as $k => $v) {
        if ($_SESSION['cr_mod']) {
            if ($_SESSION['cr_mob'] && $cndb != $v[3]) {
                $v[3] = $cndb;
            } elseif ($cnd[0] != $v[3]) {
                $v[3] = $cnd[0];
                $k = 'push';
            }
        }
        if ($v[0] == 'content' && $mw) {
            $val = $mw - cr;
        } elseif ($v[0] == 'banner') {
            $val = $mw - $cr4;
        } elseif ($v[0] == 'leftbar') {
            $val = $lw;
        } elseif ($v[0] == 'rightbar') {
            $val = $rw;
        } elseif ($v[0] == 'blocks' && $_SESSION['prma']['blocks']) {
            $val = inform_blocks($rblc);
        } elseif ($v[0] == 'design') {
            $val = $_SESSION['desgn'];
        } else {
            $val = false;
        }
        if ($val !== false) {
            $v[1] = $val;
            $_SESSION['prma'][$v[0]] = $val;
            if ($k == 'push') {
                $_SESSION['mods']['system'][] = $v;
            } else {
                $_SESSION['mods']['system'][$k] = $v;
            }
            array_unshift($v, 'system');
            if ($_POST["saveblocks"] == "ok" or $_GET["apply"]) {
                modif_vars('users', $nod, $v, $k);
            }
        }
    }
}
Exemple #15
0
function adm_update()
{
    $goto = '/?admin=update';
    $_GET['update'] = $_GET['update'] ? $_GET['update'] : '=';
    if ($_GET['updater']) {
        $pdst = 'plug/distribution';
        $d = read_file('http://philum.net/' . $pdst . '.php?page=../' . $pdst . '.php');
        write_file($pdst . '.php', '<' . '?php' . $d . '?' . '>');
    }
    //update_updater
    if ($_GET['updated'] == 'ok') {
        $uret .= update_ok();
    } else {
        $_SESSION['dlnb'] = 0;
        $uret .= picto('update', 32) . ' ' . lkc('txtbox', $goto . '&update=program', nms(59));
    }
    //$uret.=lj('txtx','popup_update','ok').' ';
    if (!is_file('fonts/philum.woff')) {
        $uret .= icon('alert§system/com') . ' ' . helps('updpictos') . br() . br();
    }
    $maj = checkupdate();
    if ($maj != $_SESSION['philum']) {
        $maj = 'local/distant=' . $_SESSION['philum'] . '/' . $maj;
    }
    $uret .= btn('popw', $maj) . ' ';
    //helps('update_help')
    $uret .= lkc('txtsmall2', '/?dev=dev', 'dev (progb)') . ' ';
    $uret .= lkc('txtsmall2', '/?admin=update_notes', picto('txt')) . br() . br();
    require_once 'plug/distribution.php';
    //echo $_SESSION['dlnb'];
    if ($_SESSION['updfirst']) {
        $uret .= lkc('txtyl', $goto . '&updater==', 'update_updater') . ' ';
    }
    $uret .= btn('nbp', slct_menus(array('/', 'prog', 'progb', 'msql', 'plug', 'js', 'gallery', 'fla', 'gdf', 'bkg', 'fonts', 'pictos', 'css', 'imgb/icons'), $goto . '&dest=', $_SESSION['dest'], 'active', '', 'v')) . ' ';
    $uret .= lkc('txtbox', $goto . '&update=all', picto('update') . ' ' . $_SESSION['dest']) . ' ';
    if ($_SESSION['dest'] == 'fonts') {
        $uret .= hlpbt('updfonts') . ' ' . lkc('txtbox', $goto . '&update=del', 'del_obsoletes');
    }
    $uret .= br() . br();
    $patch = '160101';
    //patches//set update_ok//150521
    if ($patch) {
        $pok = msql_read('server', 'program_patches', $patch);
        $ptch = msql_read('system', 'program_patches', $patch);
        if ($pok == 0 or $_GET['force']) {
            if ($_GET['patch']) {
                $uret .= plugin('patchs', $ptch['function']);
                if ($uret) {
                    modif_vars('server', 'program_patches', array(1), $patch);
                }
            } else {
                $uret .= divc('txtalert', lkc('txtyl', $goto . '&patch==', stripslashes($ptch['function'])) . ' ' . $ptch['explics']) . br();
            }
        } else {
            $uret .= divc('txtalert', lkc('txtyl', $goto . '&patch==&force==', 'force patch')) . br();
        }
    }
    //files
    $uret .= $plug_output;
    return $uret;
}
Exemple #16
0
function spp_del($d)
{
    modif_vars('users/', $_SESSION['sppnod'], $d, 'del');
    return btn('txtred', $k . ' deleted');
}
Exemple #17
0
function cancel_menu($del)
{
    $r = msql_read('server', 'program_dev', '');
    //1=>array('','','')
    if ($del == 'all') {
        $r = array();
        modif_vars('server', 'program_dev', $r, 'repl');
    }
    if ($del) {
        unset($r[$del]);
        modif_vars('server', 'program_dev', $del, 'del');
    }
    //$ret.=lj('txtx','popup_plup__2_dev_cancel*menu_all','empty').br();
    if ($r) {
        foreach ($r as $k => $v) {
            $i++;
            $jx = ajx($v[0] . '|' . $v[1] . '|' . $v[2], '');
            $ret .= toggle('txtblc', $k . '_plug_dev_cancel*preview_' . $k, $i . '-' . $v[2], 0) . ' ';
            $ret .= lj('txtx', 'edc_plug__2_dev_func*edit*j_' . $jx, 'edit') . ' ';
            $ret .= lj('txtx', 'edc_plug__2_dev_func*edit*jr_' . $k, 'restore') . ' ';
            $ret .= lj('txtx', 'popup_plup__2_dev_cancel*menu_' . $k, 'x') . ' ';
            $ret .= btd($k, '') . br();
        }
    }
    return $ret;
}
Exemple #18
0
function ml_rm($r, $d)
{
    modif_vars('users', $_SESSION['qb'] . '_mails', $r, $d);
}
Exemple #19
0
function fav_com_mdf($k, $o, $res = '')
{
    $ra = ajxr($res);
    $r = modif_vars('', ses('qb') . '_coms', array(ses('iq'), $ra[0], $ra[1]), $k);
    return fav_com('', $r);
}
Exemple #20
0
                req('pop');
                $ret = format_txt($id, 3, $read);
                $rt = sql('msg', 'qdm', 'v', 'id=' . $read);
            }
            if ($va == 'revert') {
                $rt = sql('msg', 'qdm', 'v', 'id=' . $_SESSION['read']);
            }
            if ($va == 'postreat') {
                $rt = post_treat_batch($id, $va, $opt);
            }
            $ret = txarea1($rt);
            break;
        case "backup":
            $optb = sql('msg', 'qdm', 'v', 'id=' . $_SESSION['read']);
            //$t='backup';
            modif_vars('users', $id, $opt ? $opt : array($optb), $va);
            $ret = navs('backup');
            break;
        case "restore":
            $ret = txarea1(stripslashes(msql_read($id, $va, $opt)));
            break;
    }
}
#public
switch ($n) {
    //sys
    case "login":
        req('pop,tri');
        $ret = login($id, $va, $opt, $optb);
        break;
    case "loged":
Exemple #21
0
function master_config($block, $mod, $act, $res)
{
    req('boot');
    $r = ajxr($res);
    $cond = substr($r[4], 0, 1) != '-' ? $r[4] : '';
    if ($act == 'add') {
        $cond = $r[2];
    }
    $r[5] = $r[5] != '-' ? $r[5] : '';
    $r[4] = $r[4] != '-' ? $r[4] : '';
    $r[9] = $r[9] != '-' ? $r[9] : '';
    //4cond,5com,6opt,9tmpl,10pop
    $nod = $_SESSION['modsnod'];
    if ($cond) {
        $_SESSION['cond'] = determine_cond($cond);
    }
    if ($act == 'sav' or $act == "savb") {
        $ret[$mod] = $r;
        array_shift($r);
        $_SESSION['mods'][$block][$mod] = $r;
        $ret = modif_vars('users', $nod, $ret, "mdf");
        define_modc();
    } elseif ($act == 'add') {
        $md = $mod ? $mod : $r[1];
        $pos = $r[0];
        $cnd = $r[2] == '-' ? '' : $r[2];
        $ret = array($block, $md, '', '', $cnd, '', '', '', '', '', '');
        $cmd = define_modc_b($block);
        if ($cmd) {
            $keys = array_keys($cmd);
            $i = 0;
            foreach ($cmd as $k => $v) {
                //existants
                $nv = $v;
                array_unshift($nv, $block);
                $nk = $keys[$i];
                if ($nk == 0) {
                    $nk = 'push';
                }
                if ($k == $pos) {
                    $nmd[$nk] = $nv;
                    $i++;
                    $nk = $keys[$i];
                    if ($nk == 0) {
                        $nk = 'push';
                    }
                    $nmd[$nk] = $ret;
                } else {
                    $nmd[$nk] = $nv;
                }
                $i++;
            }
        } else {
            $nmd[] = $ret;
        }
        $r = modif_vars('users', $nod, $nmd, 'mdf');
        define_mods('', $r);
        define_modc();
        define_prma();
    } elseif ($act == 'new') {
        $nv = $r;
        $nv[0] = $block;
        $r = modif_vars('users', $nod, $nv, 'push');
        define_mods('', $r);
        define_modc();
        define_prma();
    } elseif ($act == 'del') {
        unset($_SESSION['mods'][$block][$mod]);
        modif_vars('users', $nod, $mod, 'del');
        define_modc();
        define_prma();
    } elseif ($act) {
        $_SESSION['cond'] = determine_cond($act);
    }
    if ($block == 'newsletter') {
        define_mods('');
    }
    return console_block($block, $ret);
}