function plug_utmsrc($f = '', $o = '') { $d = get_file($f); $d = utmsrc_utf($d); //eco($d,1); $u = embed_detect($d, '<meta property="og:url" content="', '"', ''); //echo $u; return $u; }
function mail_mails() { $r = mails_list(); if ($r) { foreach ($r as $k => $v) { $vb = embed_detect($v, '<', '>', ''); $ret[$vb ? $vb : $v] = 1; } } if ($ret) { ksort($ret); } return $ret; }
function ifrget($a, $b, $f) { $f = ajxg($f); $f = http($f); if ($f) { $ret = curl_get_contents($f); if (is_image($f) && $ret) { $ret = ifrim($f, $ret); } } $encoding = embed_detect(strtolower($ret), "charset=", '"', ""); if (strtolower($encoding) == "utf-8" or strpos($ret, 'é')) { $ret = utf8_decode_b($ret); } return $ret; }
function addfonts_j($var1, $var2, $res) { $r = msql_read('', 'public_addfonts', ''); if ($r) { $rk = array_keys_r($r, 0, 'k'); } $res = ajx(substr($res, 0, -1), 1); $res = embed_detect($res, '{', '}', ''); $res = str_replace(array('"', "'", ' ', "\n", "\r", "\t", "?#iefix", "?", "!"), '', $res); $ra = explode(';', $res); $nb = count($ra); for ($i = 0; $i < $nb; $i++) { list($attrb, $value) = split_right(':', $ra[$i], 0); if ($attrb == 'font-family') { $rb['name'] = $value; } $rab = explode(',', $ra[$i]); if ($rab) { foreach ($rab as $k => $va) { $rt = embed_detect($va, 'url(', ')', ''); //echo $rt.br().br(); if ($rt && !$rk[$rb['name']]) { $rs = str_extract('#', $rt, 0, 0); $xt = strrchr_b($rt, '.'); if ($xt && substr($rs, 0, 4) == 'http' && $xt != 'eot?') { $rb[$xt] = $rs; } else { $noturl = 1; } } } } } if ($rb[0]) { $rb = msq_reorder($rb); } //p($rb); $dfb['_menus_'] = array('name', 'eot', 'woff', 'svg', 'ttf'); if (count($rb) > 1) { $r = msql_modif('users', 'public_addfonts', $rb, $dfb, 'push', ''); //p($rb); return addf_read($r); } else { return btn('txtred', $noturl ? 'not absolte url' : 'already_exists'); } }
function recup_func($dr, $p) { $d = read_file($dr . $p . '.php'); $r = explode('function ', $d); $n = count($r); for ($i = 0; $i < $n; $i++) { $v = $r[$i]; $func = substr($v, 0, strpos($v, '(')); $var = embed_detect($v, '(', ')', ''); if ($func != '\'.$name.$i.\'') { $ret[$func] = array($var, $cat); } if (strpos($v, "\n#")) { $cat = embed_detect($v, '#', "\n", ''); } } return $ret; }
function test_xml($f) { $d = get_file($f); echo $enc = embed_detect(strtolower($d), 'encoding="', '"'); if (strtolower($enc) == 'utf-8') { $d = utf8_decode_b($d); } //echo substr_count($d,'<').'-'.substr_count($d,'>'); eco($d, 1); $r = simplexml_load_string($d); $xml = explode("\n", $f); if (!$r) { $rr = libxml_get_errors(); foreach ($rr as $er) { $ret .= display_xml_error($er, $xml); } libxml_clear_errors(); return $ret; } }
function ifrget($a, $b, $f) { $f = ajxg($f); $f = http($f); if ($a) { ifradd(); } if ($f) { $ret = read_file($f); $ret = ifrcorr($ret, $f); if (is_image($f) && $ret) { $ret = ifrim($f, $ret); } } $encoding = embed_detect(strtolower($ret), "charset=", '"', ""); if (strtolower($encoding) == "utf-8" or strpos($ret, 'é')) { $ret = utf8_decode_b($ret); } return $ret; }
function stat_canvas_mk($r, $w, $h, $t = '') { $t = yes; $clr = $_SESSION['clrs'][$_SESSION['prmd']]; $xr = max($r); $bars = count($r); $x1 = 0; if ($bars < $w / 2) { $esp = 2; } $ecart = $w / $bars; if ($ecart < 10) { $t = off; } $ret = 'ctx.clearRect(0,0,1000,' . $h . '); ' . "\n"; foreach ($r as $k => $v) { $x2 = $x1 + $ecart; $ah = round($v / $xr * ($h - 12)); //$ret.=$x1.'-'.$h-$ah.'-'.$x2-$esp.'-'.$h.'|'; //$rb[]=array($x1,$h-$ah-12,$ecart,$ah,$k,$v,$h,$t); $ret .= 'ctx.fillStyle="#' . $clr[7] . '"; '; $ret .= 'ctx.fillRect(' . $x1 . ',' . ($h - $ah - 12) . ',' . $ecart . ',' . $ah . ');' . "\n"; if ($t == yes) { $ret .= 'ctx.fillStyle="#' . $clr[7] . '"; ctx.font="12px Arial"; '; if (strpos($k, '=')) { $k = embed_detect($k, '=', '&'); } $ret .= 'ctx.fillText("' . $k . '",' . $x1 . ',' . ($h - 2) . '); '; $ret .= 'ctx.fillStyle="yellow"; ctx.font="11px Arial"; '; $ret .= 'ctx.fillText("' . $v . '",' . ($x1 + 2) . ',' . ($h - $ah) . '); '; } $x1 += $ecart; } //eco($ret,1); return $ret; }
function flux_data() { $qb = $_SESSION['qb']; $qda = $_SESSION['qda']; $qdm = $_SESSION['qdm']; $_SESSION['nl'] = 'nlb'; $qba = 'WHERE nod="' . $qb . '"'; $prw = $_GET['preview']; if ($_GET['read']) { $qba = 'WHERE id="' . $_GET['read'] . '"'; } elseif ($_GET['tag']) { $qba = 'WHERE thm LIKE "%' . $_GET['tag'] . '%"'; } if ($_GET['topic']) { $frma = 'AND frm="' . $_GET['topic'] . '"'; } if ($_GET['order']) { $ordr = str_replace("_", " ", $_GET['order']); } else { $ordr = 'day DESC'; } if ($_SESSION['dayb'] && $_GET['read'] == "") { $sqlimit = 'AND day > ' . $_SESSION['dayb']; } $sql = "SELECT id,mail,day,suj,frm,thm,img,re FROM {$qda} {$qba} {$frma} {$sqlimit} ORDER BY {$ordr}"; $rq = mysql_query($sql) or die('Erreur SQL !<br>' . $sql . '<br>' . mysql_error()); while ($data = mysql_fetch_array($rq)) { if ($data['re']) { if ($prw) { $msg = sql('msg', 'qdm', 'v', 'id="' . $data["id"] . '"'); if ($_GET['brut'] && strpos($msg, ':import')) { $msg = sql('msg', 'qdm', 'v', 'id="' . embed_detect($msg, '[', ':import]', '') . '"'); } if (!$_GET['brut']) { $msg = format_txt_r($msg, "nlb", ""); } else { $msg = str_replace('[' . $qb . '/', '[' . host() . '/users/' . $qb . '/', $msg); $msg = str_replace('[' . $qb, '[' . host() . '/img/' . $qb, $msg); $msg = str_replace('[users', '[' . host() . '/users', $msg); } if ($prw != "full") { $msg = kmax($msg); } $msg = str_replace("imgl", "", $msg); //$msg=nl2br($msg); $http = 'http://' . $_SERVER['HTTP_HOST']; $msg = str_replace("../img/", $http . '/img/', $msg); $msg = str_replace("../imgb/", $http . '/imgb/', $msg); $msg = str_replace("../imgc/", $http . '/imgc/', $msg); $msg = str_replace("../users/", $http . '/users/', $msg); $msg = str_replace('href="/', 'href="' . $http . '/', $msg); $msg = str_replace('img src="img', 'img src="' . $http . '/img', $msg); $msg = str_replace('img src="imgb', 'img src="' . $http . '/imgb', $msg); $msg = str_replace('img src="imgc', 'img src="' . $http . '/imgc', $msg); $msg = str_replace('img src="users/', 'img src="' . $http . '/users/', $msg); $msg = parse_msg_xml($msg); } //array('date','cat','title','img','hub','tag','lu','author','lenght','url','ib') $ret[$data['id']] = array(0 => $data["day"], 1 => $data["frm"], 2 => $data["suj"], 3 => $data['img'], 4 => $data["mail"], 5 => $data["thm"], 12 => $msg); } } $_SESSION['nl'] = ''; return $ret; }
function balise_converter($aa_balise, $aa_inner, $bb_balise, $balise) { $br = "\n"; switch ($aa_balise) { // or strpos($balise,'http')!==false case "a": if (strpos($balise, '@') !== false) { $balise = interpret_html($balise, 'ok'); } else { $balise = treat_link($aa_inner, $balise); } break; case "img": $balise = treat_link($aa_inner, ''); $bim = antipuces($balise); if ($bim) { $balise = $br . $br . $bim; } else { $balise = ''; } break; case "source": $bim = treat_link($aa_inner, ''); //inside audio if ($bim) { $balise = $br . $br . $bim . $br . $br; } else { $balise = ''; } break; //case("aside"): $balise=$br.'['.$balise.'§1:msq_graph]'.$br;break;// //case("aside"): $balise=$br.'['.$balise.'§1:msq_graph]'.$br;break;// case "table": $balise = $br . $br . '[' . $balise . ':table]'; break; case "tr": $balise .= '¬'; break; case "td": $balise = prep_table($balise) . '|'; break; case "th": $balise = prep_table($balise) . '|'; break; case "strong": if (clarify_intag($balise, ":b]")) { $balise = '[' . $balise . ':b]'; } break; case "bold": if (clarify_intag($balise, ":b]")) { $balise = '[' . $balise . ':b]'; } break; case "em": if (clarify_intag($balise, ":em]")) { $balise = '[' . $balise . ':i]'; } break; case "h1": if (clarify_intag($balise, ":h]")) { $balise = $br . $br . '[' . $balise . ':h]' . $br . $br; } break; case "h2": if (clarify_intag($balise, ":h]")) { $balise = $br . $br . '[' . $balise . ':h]' . $br . $br; } break; case "h3": if (clarify_intag($balise, ":h]")) { $balise = $br . $br . '[' . $balise . ':h]' . $br . $br; } break; case "h4": if (clarify_intag($balise, ":b]")) { $balise = $br . $br . '[' . $balise . ':h4]' . $br . $br; } break; case "h5": if (clarify_intag($balise, ":b]")) { $balise = $br . '[' . $balise . ':b]' . $br; } break; case "i": if (clarify_intag($balise, ":i]")) { $balise = '[' . $balise . ':i]'; } break; case "b": if (clarify_intag($balise, ":b]")) { $balise = '[' . $balise . ':b]'; } break; case "u": if (clarify_intag($balise, ":u]")) { $balise = '[' . $balise . ':u]'; } break; case "li": $balise .= $br . $br; break; //$balise='['.$balise.':li]'; //$balise='['.$balise.':li]'; case "ul": $balise = $br . '[' . $balise . ':list]' . $br; break; case "ol": $balise = $br . '[' . $balise . ':numlist]' . $br; break; case "strike": $balise = '[' . $balise . ':k]'; break; case "sup": $balise = ' [' . $balise . ':e]'; break; case "red": $balise = ' [' . $balise . ':r]'; break; case "pre": $balise = ' [' . $balise . ':pre]'; break; case "code": $balise = ' [' . $balise . ':code]'; break; //case("hr"): $tagb="[--]"; break; //case("hr"): $tagb="[--]"; break; case "span": $balise = dico($aa_inner, $balise); break; case "div": $taga = $br; $tagb = $br; if (strpos($aa_inner, 'class="notes') !== false) { $taga = "["; $tagb = ":q]"; } //if(strpos($aa_inner,"spip_doc_descriptif")!==false){$taga="["; $tagb=":q]";} break; case "param": if ($_POST["objects"]) { $balise = '<' . $aa_inner . '>'; } elseif (strpos($aa_inner, 'soundFile')) { $balise = piege_mp3_b64($aa_inner); } break; case "object": $taga = $br; $tagb = $br; if ($_POST["objects"]) { $balise = '<object ' . correct_widths($aa_inner) . '>' . $balise . '</object>'; } elseif (strpos($balise, "<embed") === false && strpos($balise, "[") === false) { if (strpos($balise, ".flv") !== false or strpos($balise, ".mp") !== false) { $balise = piegemedia($balise); } elseif (strpos($aa_inner, ".flv") !== false or strpos($aa_inner, ".mp") !== false) { $balise = piegemedia($aa_inner); } elseif (strpos($aa_inner, 'dailymotion') !== false) { $balise = piege_daily($aa_inner); } elseif (strpos($aa_inner, 'youtube') !== false) { $balise = piege_utube($aa_inner); } } break; case "embed": $taga = $br; $tagb = $br; if ($_POST["objects"]) { $balise = '<' . correct_widths($aa_inner) . '>'; } else { if (strpos($aa_inner, 'dailymotion') !== false) { $balise = piege_daily($aa_inner); } elseif (strpos($aa_inner, 'youtube') !== false) { $balise = piege_utube($aa_inner); } elseif (strpos($aa_inner, 'rutube') !== false) { $balise = piege_rutube($aa_inner); } elseif (stristr($aa_inner, ".flv") !== false or stristr($aa_inner, ".mp") !== false) { $balise = piegemedia($aa_inner); } else { $balise = '<' . correct_widths($aa_inner) . '>'; } } break; //<'.$bb_balise.'> //<'.$bb_balise.'> case "iframe": if (strpos($aa_inner, 'youtube.com') !== false) { $d = trap_v_id($aa_inner, 'embed/'); if (!$d) { $d = embed_detect($aa_inner, '/v/', '&'); } $balise = $br . $br . '[' . $d . ':video]'; } elseif (strpos($aa_inner, 'dailymotion.com') !== false) { $balise = piege_daily($aa_inner); } elseif (strpos($aa_inner, 'vimeo.com') !== false) { $d = trap_v_id($aa_inner, 'video/'); $balise = '[' . $d . ':video]'; } else { $balise = '[' . embed_detect($aa_inner, 'src="', '"') . $sz . ':iframe]'; } break; case "center": $taga = $tagb = $br; break; //$balise=' ['.$balise.':center]'; //$balise=' ['.$balise.':center]'; case "p": $taga = $tagb = $br; break; case "dt": $taga = $tagb = $br; break; case "dd": $taga = '['; $tagb = ':q]'; break; case "dl": $tagb = $br . $br; break; case "br": if ($_POST["nobr"] == "ok") { $taga = $br; } $tagb = $br; break; // // case "blockquote": $taga = '['; $tagb = ':q]'; break; case "dir": $taga = '['; $tagb = ':q]'; break; } return array($taga, $balise, $tagb); }
function codeline($v, $p, $c) { //v§p:c //v:c switch ($c) { //elements case 'br': return br(); break; case 'hr': return hr(); break; case 'balise': if ($p) { @(list($bal, $id, $css, $sty) = explode('|', $p)); if ($v) { return balise($bal, array(5 => $css, 3 => $id, 16 => $sty), $v); } } break; case 'html': if ($p && $v) { return bal($p, $v); } break; case 'span': if (trim($v)) { return span($p, $v); } break; case 'div': if (trim($v)) { return div($p, $v); } break; case 'css': if (trim($v)) { return btn($p, $v); } break; case 'clear': return divc($c, $v); break; //attributs //attributs case 'id': return atd($c, $v); break; case 'class': return atb($c, $v); break; case 'style': return atb($c, $v); break; case 'name': return atb($c, $v); break; case 'font-size': return atb($c, $v); break; case 'font-family': return atb($c, $v); break; //apps //apps case 'text': return $v ? $v : $p; break; case 'url': return lka($v, $p ? $p : preplink($v)); break; case 'jurl': return lj('', $v, $p); break; case 'link': return special_link($v . '§' . $p); break; case 'ajx': return lj('', 'popup', '_' . $p, $v); break; case 'anchor': return '<a name="' . $v . '"></a>'; break; case 'date': return mkday(is_numeric($p) ? $p : '', $v); break; case 'title': return suj_of_id($v); break; case 'read': return read_msg($p, 3); break; case 'image': return image($v); break; case 'thumb': return make_thumb_d($v, $p); break; case 'picto': return picto($v, $p); break; //high_level //high_level case 'cut': list($s, $e) = split("/", $p); return embed_detect($v, $s, $e, ''); break; case 'split': return explode($p, $v); break; case 'conn': return connectors($v . ':' . $p, 3, ''); break; case 'exec': if (auth(5)) { $data = $p; eval($v); return $output; } break; case 'core': if (is_array($v)) { return call_user_func($p, $v, '', ''); } else { $vb = explode('/', $v); return call_user_func($p, $vb[0], $vb[1], $vb[2], $vb[3]); } break; case 'plug': return plugin($v, $p); break; case 'foreach': foreach ($v as $va) { $ret .= cbasic_exec($va, '', '', $o); } return $ret; break; default: return $v; } }
function modif_css($defs, $k, $deb, $end, $new) { $val = $defs[$k][6]; if (strpos($val, $deb) === false) { $defs[$k][6] .= ' ' . $new; } else { $old = embed_detect($val, $deb, $end, ''); $defs[$k][6] = str_replace($deb . $old . $end, $new, $val); } return $defs; }
function ffunc_row($v) { $func = $v[0] . '(' . embed_detect($v[2], '(', ')', '') . ')'; return array(lj('', 'popup_plupin__3_codev_progb_' . ajx($v[1]) . '_' . ajx($v[0]), picto('edit')) . lj('', 'edc_plug__2_dev_func*edit*j_progb|' . ajx($v[1]) . '|' . ajx($v[0]), picto('editxt')), lj('', 'codeview_plugin__3_codeview_progb_' . $v[1], $v[1]), lj('', 'popup_plupin__3_codeview_progb_' . ajx($v[1]) . '_' . ajx($v[0]), $func)); }
function modif_values($defs, $css, $newval, $vl, $vb) { $k = find_value($defs, $css); $val = $defs[$k][6]; $old = embed_detect($val, $vl, $vb, ""); $defs[$k][6] = str_replace($vl . $old . $vb, $vl . $newval . $vb, $val); return $defs; }
function inject_defs($r, $d) { if (!$d) { return $r; } if ($_POST['sql']) { return inject_sql($r, $d); } if ($_POST['mono']) { return inject_mono($r, $d); } $rb = explode('$', $d); echo $_POST['save']; foreach ($rb as $k => $v) { $key = embed_detect($v, '[', ']', ''); $key = str_replace(array("'", '"'), '', $key); $value = embed_detect($v, 'array(', ');', ''); $value = str_replace(array("'", '"'), '', $value); if (substr($value, 0, 1) == "#") { $value = '&' . $value; } if (strpos($value, ",") !== false) { $rc = explode(',', $value); } else { $rc = array($value); } if ($key && $value) { $rd[$key] = $rc; } } if ($_POST['replace']) { $r = $rd; } else { $r += $rd; } return $r; }
function feedproxy($f) { if (substr($f, 0, 2) == '//') { $f = 'http:' . $f; } $d = get_file($f); $enc = embed_detect(strtolower($d), 'charset=', '"', ""); if (strtolower($enc) == "utf-8") { $d = utf8_decode_b($d); } //eco($d,1); $s = '<meta property="og:url" content="'; if (strpos($d, $s)) { return embed_detect($d, $s, '"', ''); } $s = "<link rel='canonical' href='"; if (strpos($d, $s)) { return embed_detect($d, $s, "'", ''); } }