function plug_chat($p, $msg, $res = '') { //$_SESSION['muse']=''; $p = $p ? normalize($p) : 'public'; ses('muse', $res ? ajxg($res) : ses('USE')); return chatform($p, $msg) . divd('cht' . $p, chatread($p)); }
function poll_init() { $db = plugin_func('install', 'install_db', ses('qd')); if ($db['_poll']) { mysql_query($db['_poll']) or die($db['_poll']); } }
function plug_msqedit($p, $o) { ses('msqdt', ses('qb') . '_' . $p); $bt = msqedit($p, $o); //$bt.=msqlink('',nod($p)); return $bt . $ret; }
function matrix_j($p, $o, $res = '') { list($p, $o) = ajxp($res, $p, $o); //$resultant des champs $ret = matrix_build($p, $o); return plugin_func('svg', 'svg_j', $ret, ses('sz')); }
function plug_microform($p, $id) { $rid = 'mfr' . randid(); //echo $p.'-'.$id; $nod = ses('mform', ses('qb') . '_microform_' . $id); req('pop'); ses('mformj', $rid . '_plug___microform_plug*microform_' . ajx($p) . '_' . $id); reqp('msql'); $msq = new msql('', $nod); //table list($p, $tp) = explode('§', $p); $rb = mform_mr($p); //p($rb); $msq->create($rb); $ret .= make_form($p, 'mfr' . $id, '_plug___microform_mform*j_' . ajx($p, '') . '_' . $id . '_') . br(); if (auth(4)) { $ret .= msqlink('users', ses('mform')) . ' ' . btn('txtsmall2', $nod) . ' '; } if ($tp == 1) { $ret .= mform_read($id); } elseif ($tp) { $ret .= plugin('msqtemplate', $nod, $tp); } return divd($rid, $ret . $bt); }
function sql_init($t) { $db = plugin_func('install', 'install_db', ses('qd')); if ($db['_' . $t]) { mysql_query($db['_' . $t]) or die(mysql_error() . $db['_' . $t]); } }
function pad_write($p, $o, $res) { $pad = 'pad' . ses('USE') . date('ymd'); $f = 'plug/_data/' . $pad . '.txt'; write_file($f, ajxg($res)); return lkt('popbt', root() . $f, $pad); }
function plug_negcss($p, $o) { if ($n = $_SESSION['prmb'][5]) { $nod = ses(qb) . '_auto'; } else { $nod = ses(qb) . '_design_' . $_SESSION['prmd']; } $f = 'css/' . $nod . '_neg.css'; $tima = ftime('css/' . $nod . '.css', 'ymdhi'); $timb = ftime($f, 'ymdhi'); if ($tima > $timb) { req('styl'); if ($n = $_SESSION['prmb'][5]) { if ($n < 4) { $r = msql_read('system', 'default_css_' . $n); } elseif (is_numeric($n)) { $r = msql_read('design', 'public_design_' . $n); } } else { $r = msql_read('design', $nod); } $clr = $_SESSION['clrs'][$_SESSION['prmd']]; foreach ($clr as $k => $v) { if ($v) { $klr[$k] = invert_color($v, 0); } } $_SESSION['clrs'][$_SESSION['prmd']] = $klr; build_css($f, $r); } }
function plug_umdico($p, $o) { ses('qdvoc', qd('umvoc')); ses('qdvoc_b', qd('umvoc_arts')); $ret = udc_build($p); $ret .= msqlink('', 'ummo_umvoc_1', '') . ' '; $ret .= lkt('', '/plug/umvoc', picto('link')); return $ret; }
function plug_imtx($p, $o) { $rid = 'plg' . randid(); ses('out', '/plug/_data/imtx.png'); $j = $rid . '_plug__2_imtx_imt*j_' . $w . '_' . $h . '_txtarec'; $sj = 'SaveJ(\'' . $j . '\')'; $ret .= txarea('txtarec', $p, 44, 14, atc('console') . atb('onkeyup', $sj) . atb('onclick', $sj)); $ret .= lj('', $j, picto('reload')) . ' '; return $ret . divd($rid, image(root() . ses('out'))); }
function natwords() { $r = sql_inner('msg', 'qdm', 'qda', 'id', 'vr', ' ' . ses('qda') . '.day>"' . calc_date(1) . '"'); foreach ($r as $k => $v) { $ra = addwords($v, $ra); } //p($ra); $ra = array_flip($ra); return $ra; }
function plug_arts($p, $o) { $rid = 'plg' . randid(); Head::add('csslink', '/css/' . ses('qb') . '_design_' . ses('prmd')); $p = $p ? $p : 'nbdays=2&preview=auto'; //priority=>1&priority=<4 $ret .= input(1, 'params', $p, '', 30) . ' '; $ret .= lj('', $rid . '_plug__3_arts_arts*j__nl_params', picto('reload')) . ' '; return divd('page', $ret . divd($rid, divd('content', arts_j($p, '', '')))); }
function plug_ummdico($p, $o) { //umm_sav(); ses('qu', 'umm_dico'); $ret = bal('h3', 'Recherche sur le dictionnaire des vocables'); $ret .= input(1, 'search', '', '') . ' '; $ret .= checkbox('chk', '1', 'phonétique', 0); $ret .= lj('txtbox', 'ucbk_plug___ummdico_ud*search_1_2_search|chk', 'chercher') . br() . br(); $ret .= divd('ucbk', '') . br(); //callback return $ret; }
function plug_rss($hub, $preview) { if ($hub) { $_GET['hub'] = $hub; } if ($preview == '=' or !$preview) { $preview = 2; } if (!$hub) { return slct_menus(ses('mn'), '/plug/rss/', '', '', '', 'kv'); } require_once '../prog/lib.php'; req('pop,art'); require '../plug/sys.php'; require '../plug/lib.php'; $fnod = $_SESSION["qb"] . '_cache'; $main = msql_read_b('users', $fnod, '', 1); $nb_arts = count($main); $lastid = lastid('qda'); $last_art = $main[$lastid]; $newest = key($main); $oldest = array_pop($main); $nb_days = round((time() - $oldest[0]) / 86400); $cache = 1; $f = '../plug/_data/' . $_SESSION["qb"] . '_' . $newest . '_' . $preview . '.xml'; if (is_file($f) && !$_GET['rebuild'] && $cache) { return read_file($f); } else { $http = host(); if ($preview) { req('tri,pop,art'); } //spe,mod $xml .= '<' . '?xml version="1.0" encoding="iso-8859-1"?' . '>' . "\n"; $xml .= '<rss version="2.0">' . "\n"; $xml .= '<channel>' . "\n"; $xml .= bal('title', $_SESSION['qb']) . "\n"; $xml .= bal('link', $http) . "\n"; $xml .= bal('description', $nb_arts . ' articles / ' . $nb_days . ' days - preview=' . $preview . ' - static url=' . $http . substr($f, 2)) . "\n"; $xml .= bal('language', 'fr') . "\n"; $xml .= bal('lastBuildDate', date("r", $last_art[0])) . "\n"; if ($main) { $xml .= flux_xml($main, $preview) . "\n"; } $xml .= '</channel>' . "\n"; $xml .= '</rss>' . "\n"; write_file($f, $xml); rss_del_old($newest); } //eye eye('rss'); return $xml; }
static function menu($p, $o, $rid) { $ret = inp('inp', $p ? $p : 1) . ' '; $ret .= lj('', $rid . '_app___slides_j__' . $rid . '_inp', picto('reload')) . ' '; if (auth(6)) { $ret .= lj('', 'popup_plupin___msqedit_slides*' . $p . '_val', picto('edit')) . ' '; $j = 'popup_msqledit___users_' . ajx(ses('nodslid')) . '_'; $ret .= lj('', $j . $p . '_1', picto('editxt')) . ' '; $ret .= lj('', 'popup_plup___msqedit_msqdt*add_slides*' . $p . '_val', picto('add')) . ' '; } return divc('', $ret); }
/** * @public * @method __construct */ public function __construct() { //params of you App are in an msql table named (hub)_twit $r = msql_read('', ses('qb') . '_twit', '', 1); $this->_oauth_token = $r[1]; $this->_oauth_token_secret = $r[2]; $this->_oauth_consumer_key = $r[3]; $this->_oauth_consumer_secret = $r[4]; $this->_oauth_nonce = md5(rand()); $this->_oauth_signature_method = 'HMAC-SHA1'; $this->_oauth_timestamp = time(); $this->_oauth_version = '1.0'; }
function svg_conn($d) { $ra = svg_motor(); list($p, $b) = split_one(':', $d, 1); list($p, $v) = split('§', $p); $rb = explode(',', $p); $pr = array_combine_a($ra[$b], $rb); if ($b == 'attr') { ses('attr', $pr); $pr = ''; } elseif (ses('attr')) { $pr = array_merge_b($pr, ses('attr')); $_SESSION['attr'] = ''; } // //if($b=='attrb'){foreach($rb as $vb){list($atb,$va)=split('=',$vb);$pr[$atb]=$va;}ses('attr',$pr);$pr='';} if (isset($pr['points'])) { $pr['points'] = svg_build_prop($pr['points']); } if (isset($pr['transform'])) { $pr['transform'] = svg_build_prop($pr['transform']); } if (isset($pr['fill'])) { $pr['fill'] = svg_clr($pr['fill']); } if (isset($pr['stroke'])) { $pr['stroke'] = svg_clr($pr['stroke']); } if (isset($pr['onclick']) && $b == 'lj') { $pr['onclick'] = sj($pr['onclick']); $b = 'a'; } if (@$pr['fillurl']) { $pr['fill'] = 'url(#' . $pr['fillurl'] . ')'; $pr['fillurl'] = ''; } if (@$pr['filter']) { $pr['filter'] = 'url(#' . $pr['filter'] . ')'; } if ($b == 'feColorMatrix') { $pr['values'] = svg_build_prop($pr['values']); } if ($b == 'stop') { $pr['style'] = 'stop-color:' . svg_clr($pr['style']) . '; stop-opacity:' . $pr['opac'] . ';'; } //echo $b.br(); pr($pr); if ($b != 'attr') { return balise($b, $pr, $v); } }
function plug_msqads($p, $o) { $rid = 'plg' . randid(); $p = $p ? $p : 'msqads'; reqp('msql'); $msq = new msql('', $p); //table $rb = array('day', 'quest', 'resp'); $msq->create($rb); $ret .= input(1, $rb[0], $rb[0], '', 1) . br() . txarea($rb[1], '', 40, 4) . txarea($rb[2], '', 40, 4); $ret .= lj('txtbox', $rid . '_plug___msqads_msqads*j_' . $p . '__' . implode('|', $rb), 'save') . ' '; $ret .= msqlink('users', ses('qb') . '_' . $p); $msq->read('i'); return $ret . divd($rid, make_table($msq->ret, 'txtblc', 'txtx')); }
function plug_links() { foreach (ses('rqt') as $k => $v) { $rb[preplink($v[9])] += 1; } arsort($rb); //p($rb); foreach ($rb as $k => $v) { if ($k) { $ret .= $k . ' (' . $v . ')' . br(); } } $ret .= hr() . links_all(); return $ret; }
function msqlxread() { $page = $_GET['page'] ? $_GET['page'] : 1; $npg = 10; require 'plug/microxml.php'; $min = ($page - 1) * $npg; $max = $page * $npg; $i = 0; $site = 'http://philum.net'; //$site=philum();//father_server $r = clkt($site . '/msql/clients/philum_tickets'); unset($r['_menus_']); if ($r) { foreach ($r as $k => $v) { //array('host','hub','msg','day','ip') if ($v[0] == $_SERVER['HTTP_HOST'] && $v[1] == ses('qb')) { $del = lj('txtyl', 'tickets_plug___tickets_tickets*j_' . $k . '_x', 'x'); } else { $del = ''; } $answ = ljb('popbt', 'jumpMenu_text', 'tckansw_' . ($v[5] ? $v[5] : $k), nms(91)); $rb[$k] .= btn('txtsmall2', $v[3]) . ' '; $rb[$k] .= lkc('txtsmall', 'http://' . $v[0] . '/' . $v[1], $v[1]) . ' '; if (!$v[5]) { $rb[$k] .= $answ . ' '; } $rb[$k] .= $del . br(); $msg = $v[2]; if (!function_exists('correct_txt')) { req('tri,pop,spe'); } //$msg=correct_txt($msg,'','sconn'); if ($i >= $min && $i < $max) { $msg = miniconn($msg); } $i++; $rb[$k] .= divc('" style="width:400px;', nl2br(stripslashes($msg))) . br(); if ($v[5]) { $rb[$v[5]] .= div(ats('margin-left:40px;'), $rb[$k]); unset($rb[$k]); } } } if ($rb) { rsort($rb); } return by_pages($rb, $page); }
function plug_model($p, $o) { $rid = 'plg' . randid(); $p = $p ? $p : 'model'; reqp('msql'); $msq = new msql('', $p); //table $rb = array('title', 'text'); $msq->create($rb); //cols $ret .= input(1, $rb[0], '', '', 20); $ret .= lj('txtbox', $rid . '_plug___model_model*j_' . $p . '__' . implode('|', $rb), 'save') . br(); $ret .= txarea($rb[1], '', 40, 4); $ret .= msqlink('users', ses('qb') . '_' . $p); $msq->read('i'); return $ret . divd($rid, make_table($msq->ret, 'txtblc', 'txtx')); }
function plug_umtoa($p, $o) { $rid = 'plg' . randid(); Head::add('csscode', ' .hline{padding-left:10px; border-top:2px solid black;width:100%;} .hline:hover{z-index:2; background:silver; min-height:40px;} .vline{border-left:20px dashed black;} .aeon{border-top:2px solid dashed; background:silver;} .aeon1{background:bisque;} .aeon2{background:darkkhaki;} .aeonblack{background:lightslategray;} .aeon3{background:darkturquoise;} .aeon4{background:hotpink;}'); $ret = umtoa_build($p, $o); $bt .= msqlink('', ses('qb') . '_umtoa'); return $bt . divd($rid, $ret); }
function upim_h() { $_SESSION['uproot'] = 'users/' . ses('qb') . '/downloads'; //destination folder Head::add('csslink', '../css/_admin.css'); //Head::add('jslink','../js/upload.js'); Head::add('csscode', ' .upload_form_cont {border:1px solid transparent; color:#000;} .info {background:#eee; border:1px solid #ddd; font-weight:bold; margin:20px;} .info > div {padding:10px 15px;} .info > h2 {padding:0 15px;} #dropArea {background:#ddd; border:3px dashed #000; font-size:32px; height:50px; line-height:50px; margin:10px; text-align:center;} #dropArea.hover {background:#ccc;} #result .success, #result .failure {font-size:12px; margin-bottom:10px; padding:5px; border-radius:5px;} #result .success {background-color:#77fc9f;} #result .failure {background-color:#fcc577;} }'); }
function plug_download($p, $o) { $dir = 'plug/_data/' . ses('qb') . '_'; $f = base64_decode($p); if ($f != "../" && strpos($f, "params") === false && is_file($f)) { //nb_of_dwnl $nm = rednm($f); $nmf = $nm . '.txt'; if (is_file($dir . $nmf)) { $nb = read_file($dir . $nmf); } write_file($dir . $nmf, $nb = $nb ? $nb + 1 : 1); //clients $arr = array($f, hostname()); $dy = date('ymd-hi', time()); download_eye($arr, $dy); download_file($f, $nm); } }
function upload_sav($d, $p) { req('sav'); $id = ses('read'); if ($id) { req('pop'); } $ret = css_link('/css/_global.css') . js_link('/prog/ajx.js') . js_link('/prog/utils.js'); $_POST["imnot"] = 1; list($er, $url) = save_img(); $t = $er ? $er : 'saved'; //foreach($_GET as $k=>$v)if($k=='opdir' or $k=='mode' or $k=='read')$lk.='&'.$k.'='.$v; //$tb=$t?strrchr_b($t,'/'):'empty'; $ret .= up_form($_GET['go'], $_GET['chk']); if ($_GET['chk']) { $ret .= up_back(urlread($id)); } //if($_GET['mode']=="banim")$ret.=up_back('/?admin=banner'); return $ret; }
function plug_stats($c, $n, $res = '') { static $i; $i++; if ($i == 2) { return; } $c = $c ? $c : 'nbv'; $n = $n ? $n : 7; ses('png', 1); list($w, $h) = split('_', $res); ses('stw', $w ? $w : 550); ses('sth', $h = $h ? $h : 100); $day_max_known = sql('day', 'qds', 'v', 'qb="' . ses('qb') . '" and day<"' . date('ymd') . '" order by id desc limit 1'); if ($day_max_known < date('ymd', calc_date(1))) { $ret = stat_solid($day_max_known); } //if(ses('png'))$ret.=stat_graph($c,$n,$res).br().br(); //else $ret.=divd('graph',stat_canvas($c,$n,$res)).br().br(); $ret .= stat_read($c, $n) . br(); $ret .= stat_board($c, $n, $res); //stat_upd(); return divd('stat', $ret); }
case "artone": req('art,pop,spe,tri'); $ret = art_read_b($id, '', $va, $opt); break; case "load": req('art,pop,spe,tri'); $ret = play_arts('', '', '', $id); break; case "popart": req('pop,spe,art,tri,mod,boot'); //$_SESSION['read']=$id; $_SESSION['cur_div'] = 'content'; deductions_from_read($id, ''); $p = 2; if (auth(6)) { ses('popm', lj('', 'popup_tit___' . $id, picto('tag')) . ' ' . lj('', 'popup_artedit___' . $id, picto('edit'))); } $t = suj_of_id($id); $s = prma('content') + 20; $nl = 'nlpop'; $ret = art_read_b($id, '', 3, ''); break; case "popartmod": req('mod,spe,art,pop,tri,boot'); deductions_from_read($id, ''); $ret = build_art_mod(''); $t = nms(39); $s = 440; break; case "divcontent": req('pop,spe,art,tri,mod,boot');
function troc_init() { reqp('mysql'); troc_ses(); ses('jscode', troc_js()); troc_mysql_obj(); troc_mysql_prop(); }
function makenew($qb, $restore = '') { $qdu = ses('qdu'); require 'styl.php'; if (!auth(4)) { $_SESSION['auth'] = 4; } msq_copy("system", "default_css_1", 'design', $qb . '_design_1'); msq_copy("system", "default_clr_1", 'design', $qb . '_clrset_1'); msq_copy("system", "default_css_2", 'design', $qb . '_design_2'); msq_copy("system", "default_clr_2", 'design', $qb . '_clrset_2'); msq_copy("system", "default_mods", 'users', $qb . '_mods_1'); msq_copy("system", "default_rstr", 'users', $qb . '_rstr'); msq_copy("system", "default_apps", 'users', $qb . '_apps'); if ($restore) { list($rstr, $config) = ndprms_defaults(); update('qdu', 'rstr', $rstr, 'name', ses('qb')); update('qdu', 'config', $config, 'name', ses('qb')); } $clr = msql_read('system', 'default_clr_1', ''); $css = 'css/' . $qb . '_design_1.css'; build_css($css, css_default(1), $clr); $clr = msql_read('system', 'default_clr_2', ''); $css = 'css/' . $qb . '_design_2.css'; build_css($css, css_default(), $clr); update('qdu', 'menus', ses('dayx'), 'name', $qb); if (!is_dir('users/' . $qb)) { mkdir_r('users/' . $qb); } return $qb; }
function sugnote() { $sg = $_SESSION['sugm']; $_SESSION['sugm'] = ''; $r = msql_modif('users', ses('qb') . '_suggest', 'ok', 1, 'val', $sg); $mail = $r[$sg][3]; list($m, $a) = split("@", $mail); $id = lastid('qda') + 1; $msg = lkc('', host() . urlread($id), helps('suggest_ok')); if ($mail) { send_mail_html($mail, nms(1) . ' ' . nms(89), $msg, $_SESSION['qbin']['adminmail'], $id); } if ($m) { return '[' . nms(56) . ' ' . nms(88) . ' ' . $m . ':q]' . "\n"; } }