function prep_msg($id) { $msg = sql('msg', 'qdm', 'v', 'id=' . $id); $msg = html_entity_decode($msg); if (strpos($msg, ':import') or strpos($msg, ':read')) { $msg = strip_tags(format_txt($msg, $id, 3)); } else { $msg = clean_internaltag($msg); } $msg = strtolower(eradic_acc($msg)); $msg = deln($msg, ' '); $msg = str_replace(" ", " ", $msg); return $msg; }
function ummoay_build($p, $o) { req('art,tri,pop,spe'); reqp('msqarts'); $tmp = ummoay_template(); $r = req_arts_y($p); $rtg = list_tags(); if ($r) { foreach ($r as $k => $v) { list($id, $day, $msg, $cat, $tag, $lk) = $v; $day = clean_day_tw($day); $msg = format_txt($msg, '', ''); $lnk = lka(urlread($id)); $pop = lj('', 'popup_trckpop___' . $id, picto('forum', 16)); $rb[$day] = array('suj' => $cat, 'day' => mkday($day, 'Y/m/d'), 'msg' => $msg, 'url' => $lk, 'open' => popart($id, 'articles') . ' ' . $pop, 'tag' => $rc = $rtg[$id]); } } krsort($rb); foreach ($rb as $k => $v) { $rd[nms(100)] .= template_build($tmp, $v); $rc = $v['tag']; if ($rc) { foreach ($rc as $kb => $vb) { $rd[$kb] .= template_build($tmp, $v); } } } return make_tabs($rd); }
function plug_deploy($deploy) { $qb = $_SESSION['qb']; $USE = $_SESSION['USE']; $raed = suj_of_id($deploy); $nl = $_GET['nl'] ? $_GET['nl'] : "nl"; if ($deploy && $USE) { //prep list($qauth, $subj) = sql('name,suj', 'qda', 'r', 'id="' . $deploy . '"'); $msg = sql('msg', 'qdm', 'v', 'id="' . $deploy . '"'); if ($USE == $qauth or auth(5)) { $http = host(); if (!$_POST['dpl']) { reqp('mail'); $qmail = mail_list_tosend(); $ret .= form("/?read={$deploy}&deploy={$deploy}&nl=nlb", txarea('dpl" maxlength="1000', $qmail, 40, 10) . br() . checkbox("dpf", "ok", "html", 1) . checkbox("multiple", "ok", "each_one", 1) . input2('submit', "send", nms(50), 'popbt')); } else { $htacc = urlread($deploy); $_SESSION['nl'] = $nl; //deploy if ($_POST['dpf'] == "ok") { $mail_format = "html"; $txt = format_txt($msg, $nl, $deploy); $txt = html_entity_decode($txt); $txt = str_replace('href="/', 'href="' . $http . '/', $txt); $msg = lkc("", $http . $htacc, bal("h2", $subj)); $msg .= divc("panel justy", $txt); } else { $mail_format = "txt"; $msg = clean_internaltag($msg); $msg = html_entity_decode($msg); } $_SESSION['nl'] = ""; //send $sender = sql('mail', 'qdu', 'v', 'name="' . $USE . '"'); $lstm = str_replace("\n", ",", $_POST['dpl']); $lstm = str_replace("\r", ",", $lstm); $listmail = explode(",", trim($lstm)); if ($_POST['multiple'] == "ok" && is_array($listmail)) { $sentto = send_mail_r($listmail, $mail_format, $qb . ' :: ' . $raed, $msg, $sender, $htacc); } else { $sentto = $_POST['dpl']; $vm = str_replace(array(",", ";", "\n", " "), ",", $sentto); send_mail($mail_format, $vm, $qb . ' :: ' . $raed, $msg, $sender, $htacc); } $ret .= lkc("popbt", '/?read=' . $deploy, 'article ' . $deploy . ' sent to: ' . $sentto); } } else { $ret .= btn("popdel", "forbidden"); } } //if($_POST['dpl'])return $ret; return $ret; }
function sugg_import($f, $o = '', $res = '') { list($f, $o) = ajxp($res, $f, $o); if (substr($f, 0, 4) != 'http') { return; } req('tri,pop'); $_GET['urlsrc'] = $f; list($suj, $msg) = vacuum($f, ''); $msg = format_txt($msg, '', ''); $ret = balc('h2', '', clean_title($suj)) . br() . $msg; return $ret; }
function plug_cards() { req('pop'); $data = sql('msg', 'qdm', 'v', 'id="' . $_GET['cards'] . '"'); $data = str_replace('[cards:plug]', '', $data); $obj = format_txt($data, 3, $_SESSION['read']); $obj = nl2br($obj); $size = msql_read('system', 'edition_cards', ''); //p($size); $styl = '" style="float:left; width:' . $size['card_width'] . 'px; height:' . $size['card_height'] . 'px; margin:' . $size['card_margin'] . 'px; border:' . $size['card_border'] . ';'; for ($i = 0; $i < 10; $i++) { $ret .= divc($styl, $obj); } if ($_GET['cards']) { Head::add('csscode', '/css/' . $_SESSION['qb'] . '_design_' . $_SESSION['prmd'] . '.css'); return divc('" style="width:' . $size['page_width'] . 'px; padding:' . $size['page_padding'] . 'px;', $ret); } else { return lkt('txtx', '/plug/cards.php?cards=' . $_SESSION['read'], 'open'); } }
function json_encode_r($r) { $r1 = array('ib', 'day', 'mail', 'frm', 'suj', 'img', 'nod', 'thm', 'name', 'lu', 're', 'host', 'msg'); $r2 = array('parent', 'time', 'url', 'category', 'title', 'image', 'hub', 'unused', 'admin', 'views', 'priority', 'length', 'content'); if ($r) { foreach ($r as $k => $v) { $re = ''; foreach ($v as $ka => $va) { if ($ka == 'msg') { $va = htmlentities(format_txt($va, 'nl', '')); } $ka = str_replace($r1, $r2, $ka); $re[] = '"' . $ka . '":"' . addslashes($va) . '"'; } $ret[] = '"' . $k . '":{' . implode(',', $re) . '}'; } } if ($ret) { return utf8_encode('{' . implode(',', $ret) . '}'); } }
function flux_xml($main, $preview) { $http = host(); foreach ($main as $k => $v) { if ($v[1] != "user" && $v[7] != "") { $url = $http . htacc('read') . $k; if ($preview) { $msg = sql('msg', 'qdm', 'v', 'id="' . $k . '"'); $msg = correct_txt($msg, 'b i h c l /2 /3', 'corrfast'); if ($preview != "full") { $msg = substr($msg, 0, kmax_nb(400, $msg)); } $msg = format_txt($msg, "nlc", $k); $msg = parse_msg_xml($msg); } $gmi = $http . '/imgc/' . $v[3]; if ($gmi && $preview) { $gmo = '<img src="' . $gmi . '" style="margin:0 10px 4px 0;" />' . "\n"; $gmo = parse_msg_xml($gmo); } else { $gmi = ""; $gmo = ""; } $lang = data_val('msg', $k, 'lang'); $xml .= "<item>\n"; $v[2] = str_replace(" ", ' ', $v[2]); $xml .= bal('title', parse_msg_xml($v[2])) . "\n"; $xml .= bal('link', $url) . "\n"; $xml .= bal('category', parse_msg_xml($v[1])) . "\n"; $xml .= balb('guid', ' isPermaLink="true"', $url) . "\n"; $xml .= bal('pubDate', date("r", $v[0])) . "\n"; $xml .= bal('description', $gmo . $msg) . "\n"; $xml .= bal('author', $author) . "\n"; $xml .= bal('language', $lang ? $lang : $_SESSION['prmb'][25]) . "\n"; $xml .= "</item>" . "\n\n"; } } return $xml; }
$_POST['name'] = format_txt($_POST['name']); } if (isset($_POST['firstname'])) { $_POST['firstname'] = format_txt($_POST['firstname']); } if (isset($_POST['email'])) { $_POST['email'] = trim($_POST['email']); } if (isset($_POST['date_birth'])) { $_POST['date_birth'] = format_txt($_POST['date_birth']); } if (isset($_POST['description'])) { $_POST['description'] = format_txt($_POST['description']); } if (isset($_POST['login_member'])) { $_POST['login'] = format_txt($_POST['login_member']); } # we check datas if (!isset($_POST['name']) or $_POST['name'] == "") { $page['erreur'][$nb_erreur]['message'] = $lang['member']['E_empty_name']; $nb_erreur++; } if (!isset($_POST['firstname']) or $_POST['firstname'] == "") { $page['erreur'][$nb_erreur]['message'] = $lang['member']['E_empty_firstname']; $nb_erreur++; } # email if (!isset($_POST['email']) or empty($_POST['email'])) { $page['erreur'][$nb_erreur]['message'] = $lang['member']['E_empty_email']; $nb_erreur++; } elseif (!check_email($_POST['email'])) {
function send_track_to_user($id) { $sender = $_SESSION['qbin']['adminmail']; //i. list($name, $day, $idt, $msg) = sql('name,day,frm,msg', 'qdi', 'r', 'id=' . $id); $by = helps('trackmail'); $msg = format_txt($msg, '', $idt) . "\n\n"; $msg = nl2br($by . "\n\n" . 'By: ' . $name . ', ' . mkday($day) . "\n\n" . $msg); $suj = sql('suj', 'qda', 'v', 'id=' . $idt); $rmails = sql('mail', 'qdi', 'k', 'frm="' . $idt . '"'); if ($rmails) { $r = array_keys_b($rmails); } if ($r) { send_mail_r($r, 'html', $suj, $msg, $sender, $id); } }
$_POST['title'] = format_txt($_POST['title']); } if (isset($_POST['subtitle'])) { $_POST['subtitle'] = format_txt($_POST['subtitle']); } if (isset($_POST['keyword'])) { $_POST['keyword'] = format_txt($_POST['keyword']); } if (isset($_POST['summary'])) { $_POST['summary'] = addslashes($_POST['summary']); } if (isset($_POST['text'])) { $_POST['text'] = addslashes($_POST['text']); } if (isset($_POST['ps'])) { $_POST['ps'] = format_txt($_POST['ps']); } /* verification des infos */ if (!isset($_POST['status']) or $_POST['status'] == "") { $page['erreur'][$nb_erreur]['message'] = $lang['news']['E_empty_status']; $nb_erreur++; } if (!isset($_POST['title']) or $_POST['title'] == "") { $page['erreur'][$nb_erreur]['message'] = $lang['news']['E_empty_title']; $nb_erreur++; } if (!isset($_POST['idurl']) or $_POST['idurl'] == "") { $page['erreur'][$nb_erreur]['message'] = $lang['news']['E_empty_idurl']; $nb_erreur++; } else { $sgbd = sql_connect();
$page['show_form'] = 1; } else { $page['show_form'] = ''; $page['L_message'] = $lang['general']['acces_reserve_admin']; } /* modification ou add */ if (isset($_POST['submit']) and !empty($_POST['submit'])) { /* we format datas */ if (isset($_POST['idurl'])) { $_POST['idurl'] = format_txt($_POST['idurl']); } if (isset($_POST['title'])) { $_POST['title'] = format_txt($_POST['title']); } if (isset($_POST['keyword'])) { $_POST['keyword'] = format_txt($_POST['keyword']); } if (isset($_POST['summary'])) { $_POST['summary'] = addslashes($_POST['summary']); } if (isset($_POST['text'])) { $_POST['text'] = addslashes($_POST['text']); } /* verification des infos */ if (!isset($_POST['title']) or $_POST['title'] == "") { $page['erreur'][$nb_erreur]['message'] = $lang['information']['E_empty_title']; $nb_erreur++; } if (!isset($_POST['status']) or $_POST['status'] == "") { $page['erreur'][$nb_erreur]['message'] = $lang['information']['E_empty_status']; $nb_erreur++;
$_POST['name'] = format_txt($_POST['name']); } if (isset($_POST['firstname'])) { $_POST['firstname'] = format_txt($_POST['firstname']); } if (isset($_POST['email'])) { $_POST['email'] = trim($_POST['email']); } if (isset($_POST['comment'])) { $_POST['comment'] = format_txt($_POST['comment']); } if (isset($_POST['description'])) { $_POST['description'] = format_txt($_POST['description']); } if (isset($_POST['place_birth'])) { $_POST['place_birth'] = format_txt($_POST['place_birth']); } if (isset($_POST['login_member'])) { $_POST['login'] = $_POST['login_member']; } if (isset($_POST['size'])) { $_POST['size'] = $_POST['size']; } # we check datas if (!isset($_POST['name']) or $_POST['name'] == "") { $page['erreur'][$nb_erreur]['message'] = $lang['member']['E_empty_name']; $nb_erreur++; } if (!isset($_POST['firstname']) or $_POST['firstname'] == "") { $page['erreur'][$nb_erreur]['message'] = $lang['member']['E_empty_firstname']; $nb_erreur++;
function friend_rub($o) { $id = id_of_suj($_SESSION['frm']); $ok = sql('id', 'qda', 'v', 'id=' . $id . ' and re>"0"'); $ret = sql('msg', 'qdm', 'v', 'id=' . $id); if (auth(4)) { $bt = popart($id); } if ($ok) { return $bt . divc($o, format_txt($ret, '', '')); } }
$page['data'][$i]['mod'] = $i % 2; $page['data'][$i]['checked_import'] = ''; $page['data'][$i]['checked_merge'] = ''; $page['data'][$i]['checked_dont_import'] = ''; if ($_POST['action'][$i] == 'import') { $page['data'][$i]['checked_import'] = 'checked="checked"'; } if ($_POST['action'][$i] == 'merge') { $page['data'][$i]['checked_merge'] = 'checked="checked"'; } if ($_POST['action'][$i] == 'dont_import') { $page['data'][$i]['checked_dont_import'] = 'checked="checked"'; } for ($j = 0; $j < $nb_column; $j++) { $id = $column[$j]; $page['data'][$i]['column'][$j]['value'] = format_txt($_POST['data'][$i][$j]); $page['data'][$i]['column'][$j]['i'] = $i; $page['data'][$i]['column'][$j]['j'] = $j; $page['data'][$i]['column'][$j]['value_list'] = array(); $page['data'][$i]['column'][$j]['show_value'] = ''; if ($id == "weather_id") { $z = 0; $page['data'][$i]['column'][$j]['L_choose'] = $lang['match']['choose_weather']; foreach ($weather_list as $id_weather => $value) { $page['data'][$i]['column'][$j]['value_list'][$z]['id'] = $id_weather; $page['data'][$i]['column'][$j]['value_list'][$z]['value'] = $value; if ($id_weather == $_POST['data'][$i][$j]) { $page['data'][$i]['column'][$j]['value_list'][$z]['selected'] = 'selected="selected"'; } else { $page['data'][$i]['column'][$j]['value_list'][$z]['selected'] = ''; }
function book_read($id, $rid) { bk_rq(); curwidth_set($_SESSION['prma']['content'] - 60); //[120:setwidth] $p['back'] .= book_prevnxt($id, $rid); $p['id'] = $id; $r = pecho_arts($id); $p['date'] = mkday($r[0], 1); $p['title'] = $r[2]; $p['opt'] = $r[1]; $p['tag'] = $r[5]; $p['length'] = art_length($r[8]); //$p['length'].=' '.lka(urlread($id),picto('articles')); $p['length'] .= ' ' . popart($id); $msg = sql('msg', 'qdm', 'v', 'id=' . $id); $msg = format_txt($msg, 'nlb', $id); $p['player'] = book_pages($id, $rid); $p['msg'] = scroll_c($msg, $rid); $ret .= template($p, 'book'); $_SESSION['cur_div'] = 'content'; //setwidth in template return $ret; }
$_POST['comment'] = format_txt($_POST['comment']); } if (isset($_POST['score_visitor'])) { $_POST['score_visitor'] = format_txt($_POST['score_visitor']); } if (isset($_POST['score_home'])) { $_POST['score_home'] = format_txt($_POST['score_home']); } if (isset($_POST['date'])) { $_POST['date'] = format_txt($_POST['date']); } if (isset($_POST['hour'])) { $_POST['hour'] = format_txt($_POST['hour']); } if (isset($_POST['spectators'])) { $_POST['spectators'] = format_txt($_POST['spectators']); } # we check datas if (!isset($_POST['club_home']) or $_POST['club_home'] == "") { $page['erreur'][$nb_erreur]['message'] = $lang['match']['E_empty_club_home_match']; $nb_erreur++; } if (!isset($_POST['club_visitor']) or $_POST['club_visitor'] == "") { $page['erreur'][$nb_erreur]['message'] = $lang['match']['E_empty_club_visitor_match']; $nb_erreur++; } # mode club /* if(CLUB!=0 AND ((isset($_POST['club_home']) AND $_POST['club_home']!=CLUB) AND (isset($_POST['club_visitor']) AND $_POST['club_visitor']!=CLUB))) { $page['erreur'][$nb_erreur]['message']=$lang['match']['E_invalid_club_defaut']; $nb_erreur++;
foreach ($tab_player as $key => $value) { $values[] = "('" . $page['value_id'] . "','" . $_POST['position'][$value] . "','" . $_POST['player'][$value] . "','" . $_POST['season_player'][$value] . "','" . $_POST['number_player'][$value] . "','" . $_POST['captain_player'][$value] . "')"; } $var['values'] = implode(", ", $values); $sql_add = sql_replace($sql['team']['insert_team_player'], $var); $sgbd = sql_connect(); sql_query($sql_add); sql_close($sgbd); } # team_photo if ($execution and isset($_POST['photo']) and !empty($_POST['photo'])) { $values = array(); $tab_photo = array_keys($_POST['photo']); foreach ($tab_photo as $key => $value) { if (!empty($_POST['photo'][$value]) or !empty($_POST['photo_description'][$value])) { $values[] = "('" . $page['value_id'] . "', '" . $_POST['season'][$value] . "', '" . $_POST['photo'][$value] . "', '" . format_txt($_POST['photo_description'][$value]) . "')"; } } $var['values'] = implode(", ", $values); $sql_add = sql_replace($sql['team']['insert_team_photo'], $var); $sgbd = sql_connect(); sql_query($sql_add); sql_close($sgbd); } } } } else { # there is some errors: we show the datas again if (isset($_POST['id'])) { $page['value_id'] = $_POST['id']; }
$page['forum_name'] = $ligne['forum_name']; $page['forum_description'] = $ligne['forum_description']; sql_free_result($res_forum); sql_close($sgbd); } # formulaire d'add de message $page['value_title'] = ""; $page['value_text'] = ""; $page['value_id'] = ""; $page['value_topic'] = ""; $page['erreur'] = array(); $page['form_action'] = convert_url("index.php?r=" . $lang['general']['idurl_forum'] . "&v1=" . $forum['forum_idurl']); /* modification ou add */ if (isset($_POST) and !empty($_POST)) { /* we format datas */ $_POST['title'] = format_txt($_POST['title']); $_POST['text'] = trim($_POST['text']); /* verification des infos */ if (!isset($_POST['title']) or $_POST['title'] == "") { $page['erreur'][$nb_erreur]['message'] = $lang['forum']['E_empty_title']; $nb_erreur++; } if (!isset($_POST['text']) or trim(html2txt($_POST['text'])) == "") { $page['erreur'][$nb_erreur]['message'] = $lang['forum']['E_empty_message']; $nb_erreur++; } /* we format datas */ if (isset($_SESSION['session_member_id']) and !empty($_SESSION['session_member_id'])) { $_POST['member'] = $_SESSION['session_member_id']; } else { $_POST['member'] = 0;
$_POST['telephone'] = format_txt($_POST['telephone']); } if (isset($_POST['fax'])) { $_POST['fax'] = format_txt($_POST['fax']); } if (isset($_POST['email'])) { $_POST['email'] = format_txt($_POST['email']); } if (isset($_POST['url'])) { $_POST['url'] = format_txt($_POST['url']); } if (isset($_POST['creation_year'])) { $_POST['creation_year'] = format_txt($_POST['creation_year']); } if (isset($_POST['comment'])) { $_POST['comment'] = format_txt($_POST['comment']); } # we check datas if (!isset($_POST['name']) or $_POST['name'] == "") { $page['erreur'][$nb_erreur]['message'] = $lang['club']['E_empty_club_name']; $nb_erreur++; } else { # we check if it does not already exist $sgbd = sql_connect(); $sql_verif = sql_replace($sql['club']['verif_presence_club'], $_POST); $res_verif = sql_query($sql_verif); $nb_res = sql_num_rows($res_verif); sql_free_result($res_verif); sql_close($sgbd); if ($nb_res != "0") { $page['erreur'][$nb_erreur]['message'] = $lang['club']['E_exist_club'];
$page['value_id'] = $_GET['v2']; } elseif (isset($_POST['id']) and $_POST['id'] != "") { $page['value_id'] = $_POST['id']; } if ($right_user['add_forum'] or $right_user['edit_forum']) { $page['show_form'] = 1; } else { $page['show_form'] = ''; $page['L_message'] = $lang['general']['acces_reserve_admin']; } # case of add or edit if (isset($_POST) and !empty($_POST)) { # we format datas $_POST['idurl'] = format_txt($_POST['idurl']); $_POST['name'] = format_txt($_POST['name']); $_POST['description'] = format_txt($_POST['description']); # we check datas if (!isset($_POST['name']) or $_POST['name'] == "") { $page['erreur'][$nb_erreur]['message'] = $lang['forum']['E_empty_name']; $nb_erreur++; } if (!isset($_POST['idurl']) or $_POST['idurl'] == "") { $page['erreur'][$nb_erreur]['message'] = $lang['forum']['E_empty_idurl']; $nb_erreur++; } else { $sgbd = sql_connect(); $sql_verif_forum = sql_replace($sql['forum']['verif_forum'], $_POST); $res = sql_query($sql_verif_forum); $nb_res = sql_num_rows($res); sql_free_result($res); sql_close($sgbd);
function save_track($msg, $id, $name, $mail) { $pdt = time(); $iq = hostname(); //ses('iq'); if (is_numeric($id) or substr($id, 0, 4) == 'wall') { $local = true; } if (!$msg) { return; } // btn('popdel','bruuu! '.helps('empty_msg')); req('sav'); $qb = $_SESSION['qb']; $base = $_SESSION['qdi']; $_GET['idy'] = 'ok'; $_GET['insert'] = 'ok'; $_POST['name'] = $nm; $_POST['msg'] = $msg; if (!rstr(2) or auth(4)) { $op = 1; } else { $op = 0; } $here = host() . '/?read=' . $id; $msg = str_replace(":chat", "", $msg); $msg = repair_latin($msg); $msg = embed_links($msg); //$amsg=mysql_real_escape_string(stripslashes($msg)); $values = array($ib, $name, $mail, $pdt, $qb, $id, $suj, $msg, $op, $ip); //,'','','' $nread = insert('qdi', mysqlra($values)); $suj = $local ? suj_of_id($id) : nms(84); $nmsg = lka($here . '#trk' . $nread, $local ? helps('trackmail') : nms(84)) . br() . br(); $nmsg .= nms(68) . ': ' . $name . ', ' . mkday($pdt) . br() . br() . format_txt($msg, '', ''); $admail = $_SESSION['qbin']['adminmail']; //to_admin if ($name != $_SESSION['USE']) { send_mail_html($admail, $suj, $nmsg, $mail, urlread($id)); } if ($local) { $rmails = sql('mail', 'qdi', 'k', 'frm="' . $id . '" AND re>="1"'); } //deploy $kem = sql('name', 'qda', 'v', 'id="' . $id . '"'); //send_to_author if ($kem != $name) { $kmail = sql('mail', 'qdu', 'v', 'name="' . $kem . '"'); if ($admail != $kmail) { $rmails[$kmail] = 1; } } //send_track_to_user if ($rmails && $op == 1) { send_mail_r(array_keys_b($rmails), 'html', $suj, $nmsg, $mail, $id); } if (!$local) { return popup(nms(34), divc('', helps('formail')), ''); } return tracks_read($nread, '', ''); }
function rss_art($u, $p, $br) { if (substr($u, 0, 4) != 'http') { $u = 'http://' . $u; } if ($p) { $u = rss_read($u); } //$r=load_xml($u,1); $r = read_rss($u, "item", array("title", "link", "pubDate", "description")); list($va, $lnk, $dat, $txt) = $r[1]; $va = html_entity_decode($va); $txt = html_entity_decode($txt); $txt = stripslashes($txt); if ($br) { $txt = format_txt($txt, 3, $id); } else { $txt = format_txt_r($txt, 3, $id); } if ($va) { return bal('h2', lkc('', $lnk, $va)) . divc('justy', $txt); } }
function batch_preview($f, $sug = '') { req('pop,spe,tri'); $f = http($f); $_GET['urlsrc'] = $f; $w = prma('content'); list($suj, $msg) = vacuum($f); $msg = embed_links($msg); $msg = clean_br_lite($msg); $msg = clean_punct($msg); $msg = format_txt($msg, '', 'test'); $sty = atc('justy') . ats('width:' . $w . 'px;'); if (strlen($msg) > 400) { $sty .= atd('scroll'); } $titl = bal('h2', $suj); $_SESSION['sugm'] = $sug; $rid = randid('btch'); $rel = lj('', 'popup_call__x_ajxf_batch*preview_' . ajx($f) . '_', pictit('reload', nms(101))) . ' '; $rel .= lj('', 'popup_addArt__x_' . ajx($f) . '_1', picto('edit')) . ' '; if (auth(6)) { $titl .= $rel . urledt($f) . ' '; } $titl .= lkt('', $f, picto('url')); if (auth(6)) { $titl .= newartcat($f); } $ret .= bal('section', bal('header', $titl) . balb('article', $sty, $msg)); //$_SESSION['vacuum'][$f]=''; return popup(preplink($f), $ret, $w); }
} else { $page['L_message'] = $lang['match']['form_stats_sup_0']; } sql_close($sgbd); } # case of add or edit if (isset($_POST) and !empty($_POST) and (!isset($included) or $included == 0) and $right_user['stats_list']) { # we format datas if (isset($_POST['name'])) { $_POST['name'] = format_txt($_POST['name']); } if (isset($_POST['abbreviation'])) { $_POST['abbreviation'] = format_txt($_POST['abbreviation']); } if (isset($_POST['code'])) { $_POST['code'] = format_txt($_POST['code']); } if (isset($_POST['formula'])) { $_POST['formula'] = trim($_POST['formula']); } # we check datas if (!isset($_POST['name']) or empty($_POST['name'])) { $page['erreur'][$nb_erreur]['message'] = $lang['match']['E_empty_stats_name']; $nb_erreur++; } else { # we check if it does not already exist $sgbd = sql_connect(); $sql_verif = sql_replace($sql['match']['verif_presence_stats'], $_POST); $res_verif = sql_query($sql_verif); $nb_res = sql_num_rows($res_verif); sql_free_result($res_verif);
} else { $page['L_message'] = $lang['member']['form_sex_sup_0']; } } else { $page['L_message'] = $lang['member']['form_sex_sup_0']; } sql_close($sgbd); } # case of add or edit if ($right_user['sex_list'] and isset($_POST) and !empty($_POST) and (!isset($included) or $included == 0)) { # we format datas if (isset($_POST['name'])) { $_POST['name'] = format_txt($_POST['name']); } if (isset($_POST['abbreviation'])) { $_POST['abbreviation'] = format_txt($_POST['abbreviation']); } # we check datas if (!isset($_POST['name']) or empty($_POST['name'])) { $page['erreur'][$nb_erreur]['message'] = $lang['member']['E_empty_name_sex']; $nb_erreur++; } else { # we check if it does not already exist $sgbd = sql_connect(); $sql_verif = sql_replace($sql['member']['verif_presence_sex'], $_POST); $res_verif = sql_query($sql_verif); $nb_res = sql_num_rows($res_verif); sql_free_result($res_verif); sql_close($sgbd); if ($nb_res != "0") { $page['erreur'][$nb_erreur]['message'] = $lang['member']['E_exist_sex'];
if ($nb_erreur == 0) { if (sql_query($sql_sup) != false) { $page['L_message'] = $lang['member']['form_country_sup_1']; } else { $page['L_message'] = $lang['member']['form_country_sup_0']; } } else { $page['L_message'] = $lang['member']['form_country_sup_0']; } sql_close($sgbd); } # case of add or edit if ($right_user['country_list'] and isset($_POST) and !empty($_POST) and (!isset($included) or $included == 0)) { # we format datas if (isset($_POST['name'])) { $_POST['name'] = format_txt($_POST['name']); } # we check datas if (!isset($_POST['name']) or empty($_POST['name'])) { $page['erreur'][$nb_erreur]['message'] = $lang['member']['E_empty_name_country']; $nb_erreur++; } else { # we check if it does not already exist $sgbd = sql_connect(); $sql_verif = sql_replace($sql['member']['verif_presence_country'], $_POST); $res_verif = sql_query($sql_verif); $nb_res = sql_num_rows($res_verif); sql_free_result($res_verif); sql_close($sgbd); if ($nb_res != "0") { $page['erreur'][$nb_erreur]['message'] = $lang['member']['E_exist_country'];
$rtc .= date($_SESSION["prmb"][17], $cnt[0]) . ' <small>' . lkc("", '#' . $id, $cnt[2]) . ' ' . art_lenght($cnt[8]) . '</small> ' . $tj . br(); } if (!$_SESSION["keep"][$id]) { $rtr .= '<a name="' . $id . '">'; $rtr .= lkc("", '#top' . $id, "^") . divc("titres", $cnt[2]) . br(); $rtr .= '<div class="txtfrmb">'; $rtr .= '<div class="txtb">'; $rtr .= '' . date($_SESSION["prmb"][17], $cnt[0]) . ' '; $rtr .= art_lenght($cnt[8]) . ' '; $rtr .= lkt('', '/' . $id, '>'); $rtr .= br() . br(); $rtr .= '</div>'; $rtr .= '<div class="justy">'; $msg = sql('msg', 'qdm', 'v', 'id="' . $id . '"'); $msg = correct_txt($msg, 'striplink', 'correct'); $msg = format_txt($msg, "nl", $id); $rtr .= $msg; $rtr .= '</div>'; $rtr .= '</div>'; $rtr .= br() . hr() . br(); $duree += $cnt[8]; if ($_GET["save_xml"]) { $i++; $xml .= bald("id", $id); $xml .= bald("title", $cnt[2]); $length = art_lenght($cnt[8]); $length = str_replace("< ", "", $length); $xml .= bald("category", $cnt[1]); $xml .= bald("date", date($_SESSION["prmb"][17], $cnt[0])); $xml .= bald("lenght", $length); $xml .= bald("link", $id);
$ret = plugin_func('tracks', 'trk_redit_sav', $id, $va); } else { $ret = plugin_func('tracks', 'trk_redit', $id, $va); $t = 'reedit'; } break; //conn //conn case "conn": req('pop,spe,art,tri,mod'); $ret = format_txt_r($id, $va, $opt); break; case "conn2": req('pop,spe,art,tri,mod'); $ret = sql('msg', 'qdm', 'v', 'id=' . $id); $ret = format_txt($ret, 'nl', $id); $ret = str_replace('</p>', "</p>\n", $ret); break; case "delconn": req('tri'); $rt = sql('msg', 'qdm', 'v', 'id=' . $id); $rt = html_entity_decode($rt, true, $_SESSION['enc']); $ret = correct_txt($rt, '', 'delconn'); $ret = clean_firstspace($ret); break; case "navs": $ret = navs($id); if (!$va) { $tt = $id; } $s = 500;
function prepare_msg($id, $msg, $r, $prw) { $read = $_GET['read']; $USE = $_SESSION['USE']; if (rstr(21) && $prw > 1) { $ath = $r['options']['authlevel']; } if (rstr(21) && $ath && $ath != 'all' && $ath > $_SESSION['auth']) { $msg = restricted_area($ath); } elseif (substr($_SESSION['frm'], 0, 1) == '_' && $_SESSION['auth'] < 3) { $msg = restricted_area(6); } elseif ($id == $read && $prw > 2 && !$_GET['page'] or $prw > 2) { $msg = format_txt($msg, $prw, $id); if ($prw != 'nl') { tometa($msg); } if ($_SESSION['USE']) { $lenght_msg = strlen($msg); //maj_lenght if ($lenght_msg != $r['host']) { update("qda", "host", $lenght_msg, "id", $id); } } update("qda", "lu", $r['lu'] + 1, "id", $id); } elseif ($prw == 1) { $msg = ""; } elseif ($id != $read or $prw == 2) { if (strlen($r['host']) < 15) { if (strpos($msg, ':import')) { $msg = sql('msg', 'qdm', 'v', 'id=' . substr($msg, 1, strlen($id))); } } if (rstr(34)) { $msg = correct_txt($msg, 'b i h c l /2 /3 table', 'corrfast'); } if (rstr(64)) { $msg = correct_txt($msg, 'q', 'stripconn'); } ////thumb $msg = kmax($msg); $msg = format_txt($msg, "noimages", $id); $msg = clean_br_lite($msg); } //if(rstr(9)) if ($_GET['look']) { $msg = str_detect($msg, $_GET['look'], 0); } $panout['msg'] = $msg; return $panout; }
function plug_editor($reset = '') { secure_inputs(); if ($_SESSION["dev"] == "dev" or $_SESSION["dev"] == "lab") { $g = "b"; } req('pop,spe,art,tri'); Head::add('csscode', '.tabc{border:1px dotted grey;padding:10px;min-height:25px;width:550px;}'); Head::add('jscode', ' function SaveIcpb(){//convert var opt=document.getElementById("txtareb").innerHTML; document.getElementById("txt").value=opt; SaveJ("txtarea_convhtml_txtareb_4"); toggle_tab(\'tab-1\',2);} function editab(p){ var act=document.getElementById("edt").className; if(act=="txtx" || p==1){var arr=[true,"on","txtred",""];} else{var arr=[false,"off","txtx","none"];} document.getElementById("txtareb").contentEditable=arr[0]; document.getElementById("txtareb").designMode="arr[1]"; void 0; document.getElementById("txtareb").focus; document.getElementById("edt").className=arr[2]; document.getElementById("edtc").style.display=arr[3];} '); //Head::add('rel',array('shortcut icon',uicon('copy_16','edit2','/'))); $out["head"] .= div(atd('popup') . ats('position:fixed;'), ''); $out["head"] .= hidden('', 'socket', ''); if ($_GET['switch_defcon']) { $_SESSION['rstr'][18] = $_SESSION['rstr'][18] == 0 ? 1 : 0; } $basedefs = $_SESSION['rstr'][18] == 0 ? 'public' : $_SESSION['qb']; if ($reset == 'reset_cache') { $_SESSION['vacuum'] = ''; } #### if ($_GET["urlsrc"]) { $urlsrc = $_GET["urlsrc"]; $_GET["urlsrc"] = $urlsrc = strdeb($urlsrc, '?utm_source'); $urlsrc = str_replace("\$", "?", $urlsrc); foreach ($_GET as $k => $v) { if ($k == "rssurl") { $urlsrc = $v; } elseif ($k != 'urlsrc') { $urlsrc .= '&' . $k . '=' . $v; } } } if ($_POST["urlsrc"]) { $urlsrc = $_POST["urlsrc"]; // && $_POST["txt"]=="" $_POST["urlsrc"] = $urlsrc = strdeb($urlsrc, '?utm_source'); } if ($_POST["suj"]) { $title = $_POST["suj"]; } if (strpos($urlsrc, "http") === false && $urlsrc) { $urlsrc = 'http://' . $urlsrc; } if ($urlsrc && $_POST["txt"] == "") { list($title, $reb, $ret, $defid, $defs) = vacuum($urlsrc, ""); } //echo txarea('',$ret,20,4); #### //see h-number in html(mnu) $tabnam = 'tbmdtab-1'; if ($_POST["urlsrc"] or $_POST["txt"] or $_POST["txb"]) { $_SESSION[$tabnam] = '2'; $npb = $_SESSION['npnb']; } elseif ($_POST["urlsrc"] && !$_POST["txt"]) { $_SESSION[$tabnam] = '1'; } //else $_SESSION[$tabnam]='0';//current_tab if ($_POST["txt"]) { $ret = stripslashes($_POST['txt']); } //html if ($_POST["txb"]) { $reb = stripslashes($_POST['txb']); } //conn if ($_POST["title"]) { $title = stripslashes($_POST['title']); } if ($_POST["convent"]) { $ret = html_entity_decode($ret); } if ($_POST["convutf"]) { $ret = utf8_decode($ret); } if ($_POST["convurl"]) { $ret = urldecode($ret); } if ($_POST["urlencode"]) { $ret = urlencode($ret); } if ($_POST["table2array"]) { $reb = plugin_func('table2array', 'table2array_build', $reb); } if ($ret && !$reb) { //if(!strpos($ret,'<br />') && strpos($ret,"\r"))$ret=nl2br($ret); $reb = converthtml($ret); //htmlentities //htmlspecialchars $reb = html_entity_decode_b($reb); $reb = html_entity_decode($reb); $reb = convertmail($reb); $reb = embed_links($reb); } elseif (!$ret) { $ret = format_txt(stripslashes($reb), 0, ""); } //if(!$ret) $ree = clean_br($ret); #edit //transformers if ($_POST['repla']) { if ($_POST['rec_prg']) { $reb = ereg_replace(stripslashes($_POST['repla']), stripslashes($_POST['replb']), $reb); } else { $reb = str_replace(stripslashes($_POST['repla']), stripslashes($_POST['replb']), $reb); } } if ($_POST['del_tab']) { $reb = del_tables($reb); } //if($_POST['conn_to_del']){$reb=correct_txt($reb,$_POST['conn_to_del'],'correct'); // $reb=str_replace(array("¬","|"),"",$reb); $reb=clean_br($reb);} if ($_POST['del_n'] == "ok") { $reb = del_n($reb); } if ($_POST['clean_mail']) { $reb = convertmail($reb); } if ($_POST["clean_punct"]) { $reb = clean_punct($reb); } if ($_POST["add_punct"] == "ok") { $reb = add_lines($reb); } if ($_POST['clean_br'] or $urlsrc) { $reb = clean_br($reb); } /*----------------------*/ //import if ($_SESSION["dev"]) { $dv = ' ' . btn('txtsmall', $_SESSION["dev"]); } $out['head'] .= lkc("txtx", "/plug/editor", picto('editxt', 16) . $dv) . ' '; //'₪' //defcons if (!$defid) { $defid = str_replace(array('http://', 'www.'), '', $urlsrc); $defid = substr($defid, 0, strpos($defid, '/')); } $defcon .= msqlink('users', $basedefs . '_defcons'); if ($_SESSION['rstr'][18] == 1 && $_SESSION['auth'] > 4) { $defcon .= lkc("txtblc", '?switch_defcon==', "switch") . ' '; $defcon .= lkt("txtblc", '/msql/users/' . $basedefs . '_defcons&append=users/public_defcons', "herit_from_public") . ' '; $defcon .= lkt("txtblc", '/msql/users/public_defcons&append=users/' . $_SESSION["qb"] . '_defcons', "inform_public") . ' '; } else { $defcon .= btn('txtsmall', 'public_defcons') . ' '; } if ($defid) { $defcon .= lj("txtred", 'popup_editmsql___users/' . $basedefs . '*defcons_' . $defid, "edit"); } $otab['html'] .= '<form id="form1" name="coded" method="post" action="/plug/editor">'; $otab['html'] .= ljb('txtbox', 'document.coded.txt.select()', '', '::'); $otab['html'] .= submitj('txtbox', 'codeb', 'convert') . ' '; $otab['html'] .= input2("text", "urlsrc", $urlsrc, '" size="36') . ' '; if ($urlsrc) { $otab['html'] .= lkt('txtx', $urlsrc, 'go') . ' '; } $otab['html'] .= br(); $otab['html'] .= '<textarea name="txt" id="txt" class="console" rows="21" cols="61">' . $ret . '</textarea>' . br(); //htmlentities $otab['html'] .= $defcon . ' '; $otab['html'] .= checkbox("objects", "ok", "objects", 0) . ' '; //$otab['html'].=checkbox("jump","ok","not_convert",0).br(); $otab['html'] .= checkbox("nobr", "ok", "br", 0); $otab['html'] .= checkbox("convent", "ok", "entities", 0) . ' '; $otab['html'] .= checkbox("convutf", "ok", "utf8", 0) . ' '; $otab['html'] .= checkbox("convurl", "ok", "url", 0) . ' '; $otab['html'] .= checkbox("see", "ok", "show_work", 0) . br(); $otab['html'] .= lkt("txtblc", "/plug/converts", "conversions") . ' '; $otab['html'] .= lkt("txtblc", "/plug/pad", "notepad") . ' '; $otab['html'] .= lkt("txtblc", "/plug/ifram", "iframe") . ' '; $otab['html'] .= lkc('txtblc', '/plug/editor/reset_cache', 'reset_cache') . ' '; $otab['html'] .= '</form>'; //notepad if ($_SESSION['USE']) { $otab['connectors'] .= divs('position:absolute; right:0; top:0;', plugin('txt', $npb, 1)); } $otab['connectors'] .= btn('txtit', $title); $otab['connectors'] .= '<form name="converted" method="post" action="">'; $otab['connectors'] .= ljb('txtbox', 'document.converted.txb.select()', '', '::'); $otab['connectors'] .= submitj('txtbox', 'converted', 'modif') . ' '; $otab["connectors"] .= div('', conn_correct($reb)); //local_reparation $otab['connectors'] .= div(ats('width:630px;'), conn_edit("")); $otab['connectors'] .= input(0, 'title', $title, ''); $otab['connectors'] .= '<textarea name="txb" id="txtarea" class="tab" rows="16" cols="68" wrap="VIRTUAL" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);" ondblclick="storeCaret(this);" onChange="clip.setText(this.value)">' . $reb . '</textarea><br>'; $otab['connectors'] .= '<div class="txtsmall2">'; $otab['connectors'] .= $defcon . ' '; $otab['connectors'] .= checkbox("clean_mail", "ok", "clean_mail", 0) . ' '; $otab['connectors'] .= checkbox("clean_br", "ok", "clean_br", 0) . ' '; $otab['connectors'] .= checkbox("del_n", "ok", "del_nl", 0) . ' '; $otab['connectors'] .= checkbox("add_punct", "ok", "add_nl", 0) . ' '; $otab['connectors'] .= checkbox("clean_punct", "ok", "typo_rules", 0) . ' '; $otab['connectors'] .= checkbox("del_tab", "ok", "del_tables", 0) . ' '; $otab['connectors'] .= checkbox("table2array", "ok", "table2array", 0) . ' '; //$otab['connectors'].='<label>delete:</label>'.balise("select",array(2=>"conn_to_del",5=>"txtblc"),batch_defil_kv(connectors_reference_lite(),"","vv")).' '; $otab['connectors'] .= '</div>'; $otab['connectors'] .= divc('txtsmall2', 'replace by:') . '' . txarea("repla", $_POST['repla'], 15, 1) . ' ' . txarea("replb", $_POST['replb'], 15, 1) . ' ' . checkbox("rec_prg", "ok", "preg", 0); $otab['connectors'] .= '</form>'; $otab['connectors'] .= lkt("txtblc", "/plug/converts", "converts") . ' '; $otab['connectors'] .= lkt("txtblc", "/plug/pad", "notepad") . ' '; $otab['connectors'] .= lkt("txtblc", "/plug/buildtable", "buildtable") . ' '; //wysiwyg //if($title)$otab["render"].=btn("txtit",$title).br(); $otab['render'] .= btd('bts', ljb('txtbox', 'SaveIcpb()', '', 'convert')) . ' '; $otab['render'] .= ljb('txtx" id="edt', 'editab(0)', '', 'editable') . ' '; $otab['render'] .= txareacb($ree, 'tabc panel justy'); $otab['render'] .= btd('bts', ljb('txtbox', 'SaveIcpb()', '', 'convert')) . ' '; $otab['render'] .= ljb('txtx" id="edt', 'editab(0)', '', 'editable') . ' '; $otab['render'] .= divd('popup', '') . "\n"; $otab['render'] .= divd('popw', '') . "\n"; $otab['render'] .= hidden('', 'socket', ''); $out["end"] .= '</body>' . "\n" . '</html>'; return implode("", $out) . make_tabs($otab); }