Example #1
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'] . '>');
    }
}
Example #2
0
function backup_rstr_msql($r)
{
    if ($r) {
        foreach ($r as $k => $v) {
            $rc[$k] = array($v ? 1 : 0);
        }
    }
    if ($_GET['mkdflts']) {
        $bs = 'system';
        $nd = 'default';
    } else {
        $bs = 'users';
        $nd = ses('qb');
    }
    msql_save($bs, $nd . '_rstr', $rc, array('rstr'));
}
Example #3
0
File: boot.php Project: philum/cms
function cache_arts()
{
    $nod = $_SESSION['qb'] . '_cache';
    $main = msql_read_b('', $nod, '', 1);
    if ($main) {
        $last = current($main);
    }
    $lastart = last_art($last[0]);
    if (!is_array($main[$lastart]) && $lastart or get('refresh')) {
        $ret['_menus_'] = array('date', 'cat', 'title', 'img', 'hub', 'tag', 'lu', 'author', 'length', 'url', 'ib', 're');
        //if(!ses('dayb'))ses('dayb',calc_date(ses('nbj')));
        $slct = 'id,day,frm,suj,img,nod,thm,lu,name,host,mail,ib,re';
        if (ses('dayb')) {
            $wh = ' and day>"' . ses('dayb') . '"';
        }
        $r = sq($slct, 'qda', 'where nod="' . ses('qb') . '"' . $wh . ' and substring(frm,1,1)!="_" and re>"0" order by ' . prmb(9));
        if ($r) {
            while ($rb = mysql_fetch_row($r)) {
                $k = array_shift($rb);
                $rb[3] = first_img($rb[3]);
                $rtb[$k] = $rb;
                if ($rtb) {
                    $ret += $rtb;
                }
            }
        }
        $ok = 'cache reloaded';
        msql_save('', $nod, $ret);
        $_SESSION['rqt'] = $rtb;
    } else {
        $_SESSION['rqt'] = $main;
    }
    return lka('/reload/' . ses('qb'), 'reload');
}
Example #4
0
File: boot.php Project: philum/cms
function cache_arts()
{
    $nod = $_SESSION['qb'] . '_cache';
    $main = msql_read_b('', $nod);
    if ($main["_menus_"]) {
        unset($main["_menus_"]);
    }
    if ($main) {
        $last = current($main);
    }
    $lastart = last_art($last[0]);
    if (!is_array($main[$lastart]) && $lastart or get('refresh') or $_GET['nbj']) {
        list($slct, $in, $wh, $ord) = play_req(' and re>0');
        $sq = sqlmk($slct, 'qda', $in, $wh, $ord);
        $rq = $req = mysql_query($sq);
        $ret["_menus_"] = array('date', 'cat', 'title', 'img', 'hub', 'tag', 'lu', 'author', 'lenght', 'url', 'ib', 're');
        $rtb = tri_cache($rq);
        if ($rtb) {
            $ret += $rtb;
        }
        if ($rq) {
            mysql_free_result($rq);
        }
        if (!$_GET["lang"] && count($ret) < 500) {
            //!$_GET["timetravel"] && !$_GET["nbj"] &&
            $ok = 'cache reloaded';
            msql_save('', $nod, $ret);
            maj_nbarts($last[0]);
        }
    } else {
        $_SESSION['rqt'] = $main;
    }
    //if($ok && $rtb)alert($ok);
    return lka('/reload/' . ses('qb'), 'reload');
}
Example #5
0
function sugg_j($v1, $v2, $res)
{
    req('spe');
    $nod = nod('suggest');
    $ra = ajxr($res);
    $dfb['_menus_'] = array('day', 'ok', 'url', 'mail', 'msg', 'iq');
    $r = read_vars('msql/users/', $nod, $dfb);
    $lnk = trim($ra[0]);
    $alx = sugg_alx($r, $lnk);
    $rap = 'popup_plup___suggest_sugg*rapport_' . ajx($ra[1]);
    if ($lnk && $alx) {
        return lj('txtyl', $rap, nms(56));
    }
    $ret = sugg_import($lnk);
    $r[] = array(date('ymdHi'), '', $lnk, $ra[1], '', ses('iq'));
    if ($r[0]) {
        $r = msq_reorder($r);
    }
    if ($lnk && !$alx) {
        msql_save('', $nod, $r);
        if ($ra[1]) {
            sugg_mail($ra[1], $lnk);
        }
        return lj('txtyl', 'popup_call__3__batch*preview_' . ajx($lnk), nms(56)) . ' ' . $ret;
    } else {
        return lj('txtyl', $rap, '404 not found');
    }
}
Example #6
0
function spp_poll($k, $p)
{
    $nod = $_SESSION['sppnod'];
    $r = msql_read('users', $nod, '');
    if ($p == 1) {
        $r[$k][1] += 1;
    } else {
        $r[$k][1] -= 1;
    }
    if ($k && !spp_verifuser($k, $p)) {
        msql_save('', $nod, $r);
    }
    return $r[$k][1];
}
Example #7
0
function detect_plugs()
{
    $dr = 'plug/';
    $r = msql_read('system', 'program_plugs', '', 1);
    //p($r);
    $rec = explore($dr, files, 1);
    //p($rec);
    foreach ($rec as $k => $v) {
        $f = $dr . $v;
        $vb = strdeb($v, '.');
        $xt = xt($v);
        $rc = $r[$vb];
        $bo = detect_plugable($f, $vb);
        $iface = $rc[4];
        //?$rc[4]:detect_interface($f,$vb);
        $pb = substr($v, 0, 1) == '_' ? '1' : '';
        if (is_file($f) && $v && $vb && $xt == '.php') {
            if (!$rc) {
                $na++;
            }
            $rb[$vb] = array($rc[0], $rc[1], $bo ? $bo : '0', $rc[3], $iface, $rc[5], $pb);
        }
        //$vr,
        if (is_file($f) && $v && $vb) {
            $rd[$vb] = array($rc[0]);
        }
    }
    //$rb=msq_reorder($rb);//p($rb);
    ksort($rb);
    //p($rf);
    $rh = array('usage', 'dir', 'loadable', 'callable', 'interface', 'state', 'private');
    //'vars',
    msql_save('system', 'program_plugs', $rb, $rh);
    //,'input','output'
    ///?msql=lang/eng/program_plugs&update==
    update_table_lang($rd, 'program_plugs', 'fr', array('usage'));
    update_table_lang($rd, 'program_plugs', 'eng', array('usage'));
    return 'program_plugs: added:' . ($na ? $na : 0) . ', deleted:' . (count($r) - count($rb)) . br();
}
Example #8
0
function ml_rs($r)
{
    msql_save('', $_SESSION['qb'] . '_mails', $r);
}
Example #9
0
File: lib.php Project: philum/cms
function msql_read_b($dr, $nod, $in = '', $u = '', $ra = '')
{
    $f = msq_f($dr, $nod);
    //db_write(db_f($dr,$nod),$r);
    if (is_file($f)) {
        require $f;
    } elseif ($ra) {
        msql_save($dr, $nod, $ra);
        $r = $ra;
        p($r);
    }
    if ($u) {
        unset($r['_menus_']);
    }
    if ($r) {
        return $in ? $r[$in] : $r;
    }
}