$t = '/plug/' . $id; break; case "openapp": $ret = openapp($id, $va, $opt); $t = $id; break; case "sesmake": if (forbidden_sessions($va)) { $_SESSION[$va] = $id; } break; case "session": $ret = $_SESSION[$id]; break; case "togses": $ret = offon(yesnoses($id)); break; case "tog": $ret = yesnoses($id); break; case "jump": $ret = $id; if ($va) { $t = $va; } break; case "lj": $ret = $lj($opt, $id, $va); $tt = $va; break; }
function show_params_cat($r, $h) { $ron = 1; $fon = 0; $j = 'lang_admin*restrictions_'; foreach ($r as $k => $v) { $hlp = bubble('txtsmall2', 'popmsqt', $j . $k . '_description', $k); $t = $h[$k][0] ? $h[$k][0] : $v; if (rstr($k)) { $n = 1; $c = ''; } else { $n = 0; $c = 'active'; } $ret[] = offon($n) . ' ' . btn($cx, lj('', 'rstr_params___' . $k . '_' . $n, $t)) . $hlp . br(); } return divc('nbp', colonize($ret, 3, '', '', 550)); }
function troc_read_table($r, $rid, $ob, $picto) { $rh = array('id', 'Utilisateur', 'Désignation', 'Type de transaction', 'Description', 'Etat'); if ($r) { foreach ($r as $k => $v) { $usr = divc('', lj('popbt', $rid . '_plug___troc_troc*profil_' . $v[1] . '_' . $rid . '-offers', pictxt('user', $v[1]))); $bt = lj('popbt', $rid . '_plug___troc_troc*read*obj_' . $v[0] . '_' . $rid . '-offers', pictxt('view', $v[2])); $rt[] = array($v[0], $usr, $bt, $v[3], $v[4], offon($v[5])); } } return make_tables($rh, $rt, 'txtx', 'txtblc'); }
function prior_edit($va, $id) { $j = 'rdbt' . $id . '_call___meta_prior*sav_'; $r = array(2 => picto('s1'), 3 => picto('s2'), 4 => picto('s3')); if ($va == 0) { $ret .= lj('popbt', $j . 'trash_' . $id, picto('trash')) . ' '; } if ($va == 0) { $ret .= lj('popbt active" title="' . nms(43), $j . 'del_' . $id, picto('del')) . ' '; } $ret .= lj('popbt', $j . ($va == 0 ? 1 : 0) . '_' . $id, offon($va)) . ' '; foreach ($r as $k => $v) { $js = sj($j . ($k == $va ? 1 : $k) . '_' . $id); $js .= ' var ob=getbyid(\'art\'+' . $id . '); '; if ($k) { $ex = 'hide'; } else { $rep = 'hide'; } $js .= 'ob.className=ob.className.replace(\'justy ' . $ex . '\',\'justy ' . $rep . '\');'; $ret .= lja('popbt ' . ($k == $va ? 'active' : ''), $js, $v); } return $ret; }
function tracks_read($id, $page = '', $n = '') { $USE = $_SESSION['USE']; $qb = $_SESSION['qb']; $read = $_SESSION['read']; $ip = hostname(); $panout['css'] = 'track'; $panout['sty'] = 'margin:8px 0;'; if ($id) { $panout['id'] = $id; list($ib, $name, $mail, $day, $nod, $frm, $suj, $msg, $re, $lu, $img, $thm, $host) = sql('ib,name,mail,day,nod,frm,suj,msg,re,lu,img,thm,host', 'qdi', 'r', 'id=' . $id); } $panout['date'] = mkday($day, 'y/m/d H:i'); //time_ago($day); $panout['edit'] .= lj('', 'popup_track___' . $read . '_[' . $id . ':track]', picto('get')) . ' '; if ($re == "0" && $host == $ip) { $panout['sty'] .= 'opacity:0.5;'; $panout['edit'] .= btn('txtsmall', helps('trackbacks')) . ' '; } if ($_GET['admin']) { $purl = '/?admin=' . $_GET['admin']; } if ($_GET['read']) { $purl = '/?read=' . $_GET['read']; } if ($host == $ip && $_SESSION['dayx'] - $day < 600 or auth(6)) { //redit $panout['edit'] .= lj('', 'popup_trkedit___' . $id, picto('edit')) . ' '; } $sender = rse("id", $_SESSION['qdu'] . ' WHERE name="' . $name . '"'); if ($sender) { $panout['author'] = lj('', 'popup_track___' . $name, $name); } elseif ($mail != 'mail') { $panout['author'] = lj('', 'popup_plupin___mail_' . $mail, $name); } else { $panout['author'] = $name; } if (substr($suj, 0, 4) != "hide" or $_GET['idy_show'] == $id) { $state = "hide"; $f = 'imgb/avatar_' . $name . '.gif'; //avat if (is_file($f)) { $panout['avatar'] .= image($f, 48, 48, ats('vertical-align:bottom;')); } if ($re != "0" or auth(3) or $host == $ip) { //$msg=format_txt($msg,'',''); $msg = correct_br($msg); $msg = miniconn($msg); $msg = correct_txt($msg, '', 'sconn'); $msg = embed_p($msg); $msg = nl2br($msg); } else { $msg = divc('txtalert', helps('trackbacks')); } } else { $state = 'show'; $msg = ''; } if (auth(4) && $frm != $qb) { $j = 'trk' . $id . '_plug___tracks_trk*publish_' . $id; if ($re != 1) { $panout['edit'] .= lj('txtyl', $j . '_on', nms(29)) . ' '; } else { $panout['edit'] .= lj('', $j . '_off', offon(0)) . ' '; } } if ((auth(4) or $USE == $name) && ($re == 0 or auth(6))) { $panout['edit'] .= lj('" title="' . nms(43), 'trk' . $id . '_call___sav_edit*tracks__' . $id . '', picto('trash')) . ' '; } $panout['msg'] = stripslashes($msg); if (substr($n, 0, 2) == "nl") { $http = host() . '/'; } $panout['url'] = $http . htacc('read'); return template($panout, 'tracks'); }
function plug_taxonav($p, $o) { req('mod,spe'); $r = collect_hierarchie_d("reverse", $o); if (is_numeric($p)) { $r = $r[$p]; } if ($r) { $ret = build_titl($r, $p > 0 ? suj_of_id($p) : $p, 1); $ret .= balc("ul", "taxonomy", make_menus_rb($r, '', 1, $o)); $ret .= lkc('', '/module/taxonav/' . ajx($p) . '/' . yesno($o), offon($o) . ' ' . nms(129)); } else { $ret = nms(11) . ' ' . nms(16); } return $ret; }
function prior_edit($va, $id) { $css = 'popbt'; $r = array(2 => picto('s1'), 3 => picto('s2'), 4 => picto('s3')); //0=>nms(30),1=>nms(29), if ($va == 0) { $ret .= lkc($css, '/?read=' . $id . '&trash_art=' . $id, picto('trash')) . ''; } if ($va == 0) { $ret .= lkc($css . ' active" title="' . nms(43), '/?read=' . $id . '&delete_art=' . $id, picto('del')) . ''; } $ret .= ljc($css, 'rdbt' . $id, 'meta_prior*sav_' . ($va == 0 ? 1 : 0) . '_' . $id, offon($va)) . ' '; foreach ($r as $k => $v) { $c = $k == $va ? 'active' : ''; $j = 'rdbt' . $id . '_call___meta_prior*sav_' . ($k == $va ? 1 : $k) . '_' . $id; $js = ' var ob=document.getElementById(\'art\'+' . $id . '); '; if ($k) { $js .= 'ob.className=ob.className.replace(\'tab hide\',\'tab\');'; } else { $js .= 'ob.className=ob.className.replace(\'tab\',\'tab hide\');'; } $ret .= balb('a', atc($css . ' ' . $c) . atb('onclick', sj($j) . $js), $v) . ''; } return $ret; }
function adm_hubs($auth) { $goto = '/?admin=hubs'; $qb = ses('qb'); $qdu = ses('qdu'); $USE = ses('USE'); if ($mna && $auth >= 5) { $mna = $_SESSION['mn'] + $mna; } else { $mna = ses('mn'); } //if($mna)$ret.=balc('ul','panel',m_nodes_b($mna,1)); $ret .= hublist() . br(); if ($auth >= 6 && prms('create_hub') == 'on' or $auth >= 7) { $ret .= loged('', '', 'create new hub', '10') . br(); } if ($_GET['rename_hub'] && $auth >= 5) { //renmae_hub if ($_POST['hub_name']) { $newname = trim($_POST['hub_name']); $_SESSION['mn'][$qb] = $newname; update('qdu', 'hub', $newname, 'name', $qb); } $valu = input2('text', 'hub_name', $_SESSION['mn'][$qb], 'txtx'); $valu .= input2('submit', 'Submit', 'rename_hub', ''); $ret .= form($goto . '&rename_hub==', btn('panel', $valu)) . br(); } elseif ($auth >= 5) { $ret .= lkc('popsav', $goto . '&rename_hub==', nms(87)) . ' '; } //kill_hub if ($auth >= 6 && $_GET['kill_hub'] == 'ok') { $f = 'users/' . ses('qb'); walk_dir($f, 'remove'); rmdir($f); $f = 'msql/users/' . $qb . '_cache.php'; if (is_file($f)) { unlink($f); } for ($i = 1; $i < 10; $i++) { $f = 'msql/design/' . $qb . '_design_' . $i . '.php'; if (is_file($f)) { unlink($f); } $f = 'msql/design/' . $qb . '_clrset_' . $i . '.php'; if (is_file($f)) { unlink($f); } $f = 'msql/users/' . $qb . '_mods_' . $i . '.php'; if (is_file($f)) { unlink($f); } } msquery('DELETE FROM ' . $qdu . ' WHERE name="' . $qb . '" LIMIT 1'); $_SESSION['USE'] = ''; relod(subdom(prms('default_hub'))); } //reinit_hub if ($auth >= 6 && $_GET['reinit_hub'] == 'ok') { makenew(ses('qb'), 1); } //publish if ($auth >= 6) { if ($_GET['publish']) { if ($_GET['publish'] == 'off') { $actv = 0; } else { $actv = 1; } update('qdu', 'active', $actv, 'name', $qb); } $opened = rse('active', $qdu . ' WHERE name="' . $qb . '"'); if ($opened == '1') { $ere = 'off'; $st = nms(130); } else { $ere = 'on'; $st = nms(131); } $ret .= lkc('popsav', $goto . '&publish=' . $ere . '#' . $id, offon($opened) . ' ' . $st) . ' '; $ret .= lkc('popsav', $goto . '&reinit==', nms(95) . ' ' . nms(103)) . ' '; } if ($_GET['reinit'] == '=') { $ret .= btn('txtx', 'restore all defaults ?') . lkc('txtyl', $goto . '&reinit_hub=ok', 'ok') . ' '; } if ($auth >= 6) { $ret .= lkc('txtyl', $goto . '&kill_hub==', nms(76) . ' ' . nms(100)) . ' '; if ($_GET['kill_hub'] == '=') { $ret .= btn('txtx', 'All datas will be lost') . lkc('txtyl', $goto . '&kill_hub=ok', 'ok'); } } return $ret . br(); }
function kbtog($d, $t) { $id = 'oo' . randid(); $v = ses($d); return lj('', $id . '_togses___' . $d, btd($id, offon($v)) . $t); }
function rstr_sav($d) { if ($d) { $_SESSION['rstr'][$d] = rstr($d) ? '1' : '0'; } if (auth(6)) { backup_rstr('save'); } return 'rstr' . $d . ': ' . offon(rstr($d)); }
function loadjs($f, $d, $t = '') { $v = $_SESSION['offon']; $h = hidden('', 'offon' . $d, $v); $t = $t ? '" title="' . $t : ''; return ljb($t . '" id="offonbt' . $d, 'offon', $f . '\',\'' . $d, offon($v)) . $h; }
function adm_hubs($auth) { $goto = '/?admin=hubs'; $qb = ses('qb'); $qdu = ses('qdu'); $USE = ses('USE'); if ($mna && $auth >= 5) { $mna = $_SESSION['mn'] + $mna; } else { $mna = ses('mn'); } if ($auth >= 6 && prms('create_hub') == 'on' or $auth >= 7) { $ret .= loged('', '', 'create new hub') . br(); } if ($_GET['rename_hub'] && $auth >= 5) { //renmae_hub if ($_POST['hub_name']) { $newname = trim($_POST['hub_name']); $_SESSION['mn'][$qb] = $newname; update('qdu', 'hub', $newname, 'name', $qb); } $valu = input2('text', 'hub_name', $_SESSION['mn'][$qb], 'txtx'); $valu .= input2('submit', 'Submit', 'rename_hub', ''); $ret .= form($goto . '&rename_hub==', btn('panel', $valu)) . br(); } elseif ($auth >= 5) { $ret .= lkc('popsav', $goto . '&rename_hub==', nms(87)) . ' '; } //kill_hub //if($auth>=6 && $_GET['kill_hub']=='ok')adm_killhub(); //reinit_hub if ($auth >= 6 && $_GET['reinit_hub'] == 'ok') { makenew(ses('qb'), 1); } //publish if ($auth >= 6) { if ($_GET['publish']) { if ($_GET['publish'] == 'off') { $actv = 0; } else { $actv = 1; } update('qdu', 'active', $actv, 'name', $qb); } $opened = sql('active', 'qdu', 'v', 'name="' . $qb . '"'); if ($opened == '1') { $ere = 'off'; $st = nms(130); } else { $ere = 'on'; $st = nms(131); } $ret .= lkc('popsav', $goto . '&publish=' . $ere . '#' . $id, offon($opened) . ' ' . $st) . ' '; $ret .= lkc('popsav', $goto . '&reinit==', nms(95) . ' ' . nms(103)) . ' '; } if ($_GET['reinit'] == '=') { $ret .= btn('txtx', 'restore all defaults ?') . lkc('txtyl', $goto . '&reinit_hub=ok', 'ok') . ' '; } if ($auth >= 6) { $ret .= lkc('txtred', $goto . '&kill_hub==', nms(76) . ' ' . nms(100)) . ' '; if ($_GET['kill_hub'] == '=') { $ret .= btn('txtx', 'All datas will be lost') . lkc('txtyl', $goto . '&kill_hub=ok', 'ok'); } } return $ret . br() . br() . hublist(); }