begin process at 2012 02 15 09:32:26
  Trouver un code source :
 
dans
 
Accueil > 

Code

 > 

Application

 > SELFBUILD MODIFIEZ VOTRE SITE EN UN CLIC

SELFBUILD MODIFIEZ VOTRE SITE EN UN CLIC


 Description

Cliquez pour voir la capture en taille normale
Tous les détails sur ce site : http://selfbuild.free.fr

SelBuild est un logiciel qui vous permettra de modifier votre site web en un seul clic ! Il s'agit d'un application PHP que vous n'avez qu'à transférer sur votre FTP et lancer dans n'importe quel navigateur. Ce qui signifie que vous n'avez plus besoin ni de bloc-note ni de logiciel de transfert pour éditer votre site. Les modifications sont instantanées et bien sûr le logiciel est protégé par mot de passe. Je m'en sers depuis l'été 2007 sur plusieurs de mes sites sans accroc, j'espère donc qu'il pourra être utile à d'autres.

Ce logiciel utilise l'application xAjax qui est fournie avec mais peut se trouver sans sur le site http://selfbuild.free.fr

PS : j'utilise dans cette source un code pour colorer le code qui vient de là : http://www.javascriptfr.com/codes/COLORATION-PHP-
CSS-HTML-JAVASCRIPT_39905.aspx

Source

  • <?php
  • $version='1.0.1';
  • $selfbuild=@file_get_contents('http://selfbuild.free.fr/update/version.txt');
  • if($version==$selfbuild || strlen($selfbuild)<1)
  • $maj=false; else $maj=true;
  • session_start();
  • if(isset($_GET['rac']))
  • {
  • $rac_select=$_GET['rac']*1;
  • if(is_int($rac_select) && $rac_select>=0 && $rac_select<count($racc))
  • $_SESSION['dossier']=realpath(str_replace($http,'./',$racc[$rac_select]));
  • }
  • if(!$_SESSION['navig_access'])
  • {
  • header('Location:admin.php5');
  • }
  • $nomd='Demonstration';
  • $http='http://selfbuild.free.fr/demo';
  • $racc=explode('|',preg_replace('#\s#','',$config[6]));
  • $code=file('code.txt.php');
  • if(isset($_GET['rac']))
  • {
  • $addr=str_replace($http,'./',$racc[$_GET['rac']]);
  • if(file_exists($addr))
  • $_SESSION['dossier']=$addr;
  • else
  • $operations_effectuees.='<span style="color:red">Le fichier est introuvable.</span><br/>';
  • }
  • require('../xajax.inc.php');
  • function sauvegarde($type=false,$tavant='',$texte='',$tapres='',$file='Aucun!!!',$time=0)
  • {
  • global $operations_effectuees,$nomd;
  • if($file=='Aucun!!!')
  • $file=$_SESSION['dossier'];
  • if($type==true)
  • {
  • $operations_effectuees.='<span style="color:red">Cette fonction est d&eacute;sactiv&eacute;e dans la d&eacute;monstration.</span><br />';
  • $reponse=new xajaxResponse();
  • $reponse->addAssign("bouton_save", "src", 'fav/save.png');
  • $reponse->addScript('favicon.change(\'fav/save.ico\');');
  • $reponse->addAssign("title", "innerHTML", $nomd.' - Edition');
  • $reponse->addAssign("ope", "innerHTML", $operations_effectuees);
  • $reponse->addScript('ladate=new Date(); document.getElementById(\'chrono\').innerHTML=(ladate.getTime()-'.$time.')+\'ms\';');
  • return $reponse->getXML();
  • }
  • else
  • {
  • $operations_effectuees.='<span style="color:red">Cette fonction est d&eacute;sactiv&eacute;e dans la d&eacute;monstration.</span><br />';
  • return true;
  • }
  • }
  • $xajax=new xajax();
  • $xajax->setCharEncoding('ISO-8859-1');
  • $xajax->decodeUTF8InputOn();
  • $xajax->registerFunction('sauvegarde');
  • $xajax->processRequests();
  • function som_occ()
  • {
  • $somme=0;
  • $numargs=func_num_args();
  • $arg_list=func_get_args();
  • for($i=0;$i<$numargs;$i++)
  • if(false!==$occ=strpos($_SESSION['dossier'],$arg_list[$i]))
  • $somme+=$occ;
  • return $somme;
  • }
  • if(som_occ('edit.php5','navigateur.php5','code.txt.php')>0)
  • {
  • $_SESSION['erreur']='tentative d\'éfraction';
  • header('Location: navigateur.php5');
  • }
  • ?>
  • <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
  • <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr">
  • <head>
  • <title><?php echo $nomd; ?> - Edition</title>
  • <link rel="stylesheet" media="screen" type="text/css" title="principal" href="admin_style.css"/>
  • <link rel="shortcut icon" type="image/x-icon" href="fav/save.ico" id="icone" />
  • <script type="text/javascript" src="ColoreCode.js"></script>
  • <?php if(file_exists('statistiques.js')) { ?>
  • <script type="text/javascript" src="statistiques.js"></script>
  • <?php } ?>
  • <script type="text/javascript" language="JavaScript">
  • <!-- 1.
  • var ladate;
  • var favicon = {
  • change: function(iconURL) {
  • if (arguments.length==2) {
  • document.title = optionalDocTitle;
  • }
  • this.addLink(iconURL, "icon");
  • this.addLink(iconURL, "shortcut icon");
  • },
  • addLink: function(iconURL, relValue) {
  • var link = document.createElement("link");
  • link.type = "image/x-icon";
  • link.rel = relValue;
  • link.href = iconURL;
  • this.removeLinkIfExists(relValue);
  • this.docHead.appendChild(link);
  • },
  • removeLinkIfExists: function(relValue) {
  • var links = this.docHead.getElementsByTagName("link");
  • for (var i=0; i<links.length; i++) {
  • var link = links[i];
  • if (link.type=="image/x-icon" && link.rel==relValue) {
  • this.docHead.removeChild(link);
  • return;
  • }
  • }
  • },
  • docHead:document.getElementsByTagName("head")[0]
  • }
  • var save_charg_img = new Image();
  • save_charg_img.src = 'fav/save_charg.gif';
  • function envoyer(f)
  • {
  • f.submit();
  • }
  • function edit_zform_height(id_textarea, diff)
  • {
  • var champ = document.getElementById(id_textarea);
  • var case_numeros = document.getElementById('numeros');
  • height_avant = champ.rows + Number(diff);
  • if (height_avant < 30)
  • height_avant = 30;
  • var contenu = '1';
  • for(i=2;i<=height_avant+1;i++)
  • {
  • contenu = contenu+'<br />'+i;
  • }
  • case_numeros.innerHTML = contenu;
  • champ.rows = height_avant;
  • return false;
  • }
  • function edit_zform_width(id_textarea, diff)
  • {
  • var champ = document.getElementById(id_textarea);
  • width_avant = champ.cols + Number(diff);
  • if (width_avant < 60)
  • width_avant = 60;
  • champ.cols = width_avant;
  • return false;
  • }
  • function storeCaret(id_textarea)
  • {
  • champ = document.getElementById(id_textarea);
  • if (champ.createTextRange)
  • champ.curseur = document.selection.createRange().duplicate();
  • }
  • function verif_title()
  • {
  • if(document.getElementById('bouton_save').src!=save_charg_img.src)
  • document.title='<?php echo addslashes($nomd); ?> - Edition';
  • return true;
  • }
  • var timer=setInterval('verif_title()',500);
  • var liste_affichee=false;
  • var sora;
  • function rep_met()
  • {
  • sora=(document.getElementById('avec').style.display=='none')? 'avec':'sans';
  • document.getElementById('avec').style.display='none';
  • document.getElementById('sans').style.display='none';
  • document.getElementById(sora).style.display='block';
  • sora='Remplacement '+sora+' rechargement';
  • document.getElementById('text_rep').innerHTML=sora;
  • return true;
  • }
  • var isMozilla = (navigator.userAgent.toLowerCase().indexOf('gecko')!=-1) ? true : false;
  • var regexp = new RegExp("[\r]","gi");
  • var nouvelle_ligne = new RegExp("\n","gi");
  • function ajoute(selec)
  • {
  • if (isMozilla)
  • {
  • oField = document.getElementById('codebrute');
  • objectValue = oField.value;
  • deb = oField.selectionStart;
  • fin = oField.selectionEnd;
  • objectValueDeb = objectValue.substring( 0 , oField.selectionStart );
  • objectValueFin = objectValue.substring( oField.selectionEnd , oField.textLength );
  • objectSelected = objectValue.substring( oField.selectionStart ,oField.selectionEnd );
  • objectSelected = objectSelected.replace(nouvelle_ligne,'\n'+selec);
  • if(regexp.test(objectSelected)) objectSelected.replace( regexp, selec );
  • oField.value = objectValueDeb + selec + objectSelected + objectValueFin;
  • oField.selectionStart = objectValueDeb.length;
  • oField.selectionEnd = objectValue.length - objectValueFin.length;
  • oField.focus();
  • oField.setSelectionRange(
  • objectValueDeb.length + selec.length,
  • objectValueDeb.length + selec.length);
  • }
  • else
  • {
  • oField = document.getElementById('codebrute');;
  • var str = document.selection.createRange().text;
  • if (str.length>0)
  • {
  • var sel = document.selection.createRange();
  • sel.text = selec + str;
  • sel.collapse();
  • sel.select();
  • }
  • else
  • {
  • oField.focus(oField.caretPos);
  • oField.focus(oField.value.length);
  • oField.caretPos = document.selection.createRange().duplicate();
  • var bidon = "%~%";
  • var orig = oField.value;
  • oField.caretPos.text = bidon;
  • var i = oField.value.search(bidon);
  • oField.value = orig.substr(0,i) + selec + orig.substr(i, oField.value.length);
  • var r = 0;
  • for(n = 0; n < i; n++)
  • {
  • if(regexp.test(oField.value.substr(n,2)) == true)
  • {
  • r++;
  • }
  • };
  • pos = i + selec.length - r;
  • var r = oField.createTextRange();
  • r.moveStart('character', pos);
  • r.collapse();
  • r.select();
  • }
  • }
  • }
  • var play=new Image();
  • play.src="fav/play.png";
  • var fin=new Image();
  • fin.src="fav/fin.png";
  • //-->
  • </script>
  • <?php
  • function change_src($buffer)
  • {
  • $buffer=str_replace('src="xajax_js/xajax.js"','src="'.'../'.'/xajax_js/xajax.js"',$buffer);
  • return $buffer;
  • }
  • ob_start('change_src');
  • $xajax->printJavascript();
  • ob_end_flush();
  • ?>
  • <style media="all" type="text/css">
  • p
  • {
  • font-size:14px;
  • }
  • a
  • {
  • color:navy;
  • text-decoration:none;
  • }
  • a:hover
  • {
  • color:navy;
  • text-decoration:underline;
  • }
  • a:focus, a:active
  • {
  • color:#2e4ff4;
  • }
  • strong
  • {
  • font-weight:bolder;
  • font-style:italic;
  • color:blue;
  • }
  • /*** Général ***/
  • .CodeSource {
  • color:#000000;
  • margin:0;
  • padding:0;
  • position:absolute;
  • top:0px;
  • font-family:monospace;
  • font-size:13px;
  • }
  • .CodeSource tr:hover td {
  • border-bottom:#CCCCCC 1px solid;
  • }
  • #codecolore {
  • position:relative;
  • border:1px solid #000000;
  • height:436px;
  • width:auto;
  • padding:0;
  • margin:0;
  • font-family:monospace;
  • font-size:13px;
  • overflow:auto;
  • }
  • /*** Affiche le temps d'éxécution et le nombre de ligne parsé ***/
  • #CODE_TimeStamp {
  • font-family:Arial, Helvetica, sans-serif;
  • font-size:12px;
  • padding-left:12px;
  • }
  • /*** Numérotation des lignes ***/
  • .CODE_NumLn {
  • font-size:13px;
  • background-color:#EFEFEF;
  • border-bottom:#EFEFEF 1px solid;
  • border-right:#999999 solid 1px;
  • color:#000000;
  • font-family:monospace;
  • vertical-align:text-top;
  • padding-left:6px;
  • }
  • /*** Lang CSS ***/
  • .CODE_CSS s, .CODE_CSS u, .CODE_CSS i, .CODE_CSS em, .CODE_CSS cite, .CODE_CSS strike {
  • text-decoration:none;
  • text-transform:none;
  • font-style:normal;
  • font-weight:normal;
  • font-family:monospace;
  • font-size:13px;
  • }
  • /*** Lang HTML ***/
  • .CODE_HTM s, .CODE_HTM u, .CODE_HTM i, .CODE_HTM cite {
  • text-decoration:none;
  • text-transform:none;
  • font-style:normal;
  • font-weight:normal;
  • font-family:monospace;
  • font-size:13px;
  • }
  • /*** Lang PHP ***/
  • .CODE_PHP li, .CODE_PHP cite, .CODE_PHP strike, .CODE_PHP i, .CODE_PHP em, .CODE_PHP big, .CODE_PHP u, .CODE_PHP var, .CODE_PHP small, .CODE_PHP b, .CODE_PHP sup , .CODE_PHP s {
  • text-decoration:none;
  • text-transform:none;
  • font-style:normal;
  • font-weight:normal;
  • font-size:13px;
  • vertical-align:inherit;
  • display:inline;
  • font-family:monospace;
  • font-size:13px;
  • }
  • /*** LANG JS ***/
  • .CODE_JS, .CODE_JS cite, .CODE_JS strike, .CODE_JS i, .CODE_JS em, .CODE_JS big, .CODE_JS u, .CODE_JS var, .CODE_JS small, .CODE_JS b, .CODE_JS sup , .CODE_JS s {
  • text-decoration:none;
  • text-transform:none;
  • font-style:normal;
  • font-weight:normal;
  • font-size:13px;
  • vertical-align:inherit;
  • display:inline;
  • font-family:monospace;
  • font-size:13px;
  • }
  • /*** Coloration HTML ***/
  • .CODE_HTM u { /* Tag Name */
  • color:#880088;
  • font-weight:bold;
  • font-size:12px;
  • }
  • .CODE_HTM i { /* Attribut */
  • color:#000000;
  • font-weight:bold;
  • font-size:12px;
  • }
  • .CODE_HTM s { /* Value */
  • color:#0000CC;
  • }
  • .CODE_HTM cite { /* commentaires */
  • color:#999999;
  • font-style:italic;
  • font-size:12px;
  • }
  • /*** Coloration CSS ***/
  • .CODE_CSS s { /** class, tag **/
  • color:#880088;
  • font-weight:bold;
  • font-size:12px;
  • }
  • .CODE_CSS u { /** Propriété CSS **/
  • color:#000088;
  • font-weight:bold;
  • font-size:12px;
  • }
  • .CODE_CSS i { /** Value propriété CSS **/
  • color:#880000;
  • font-weight:normal;
  • }
  • .CODE_CSS em { /** Effet ( over, link ... ) **/
  • color:#0000CC;
  • font-weight:normal;
  • }
  • .CODE_CSS cite { /** Commentaire **/
  • color:#999999;
  • font-style:italic;
  • font-size:12px;
  • }
  • .CODE_CSS strike { /** String **/
  • color:#996699;
  • }
  • /*** Coloration PHP ***/
  • .CODE_PHP big {
  • color:#FF0000;
  • font-weight:bold;
  • font-size:12px;
  • }
  • .CODE_PHP strike { /* String */
  • color:#CC3333;
  • }
  • .CODE_PHP cite { /* Commentaires */
  • color:#CC9900;
  • font-style:italic;
  • font-size:12px;
  • }
  • .CODE_PHP sup { /* Décimaux */
  • color:#0066FF;
  • }
  • .CODE_PHP u { /* fonctione du type mysql_connect(), fopen() etc ... */
  • color:#003399;
  • }
  • .CODE_PHP var { /* variables ( mot qui commence par $ ) */
  • color:#0000CC;
  • }
  • .CODE_PHP i { /* du type function, var, class ... */
  • color:#000099;
  • font-weight:bold;
  • font-size:12px;
  • }
  • .CODE_PHP small { /* Conditions boucle et autres ... */
  • color:#669900;
  • font-weight:bold;
  • font-size:12px;
  • }
  • .CODE_PHP b { /* Expression régulière */
  • color:#9900CC;
  • font-style:italic;
  • font-size:12px;
  • }
  • .CODE_PHP em { /* Booléen => null, false, true Autre caractère => !=, <=, >=, &&, ||, .=, ( ), [] etc ... */
  • color:#990000;
  • font-weight:bold;
  • font-size:12px;
  • }
  • /*** Coloration javascript ***/
  • .CODE_JS cite { /* commentaires */
  • color:#999999;
  • font-style:italic;
  • font-size:12px;
  • }
  • .CODE_JS strike { /* String */
  • color:#0000CC;
  • font-weight:normal;
  • }
  • .CODE_JS i { /* Réservé a JS ( window, document, layer, event ... ) */
  • color:#008800;
  • font-weight:normal;
  • }
  • .CODE_JS em { /* Réservé a JS ( getElement, frame ,forms, item ... ) */
  • color:#000088;
  • font-weight:normal;
  • }
  • .CODE_JS big { /* Mot spéciaux réservé a JS ( alert, focus, open, close ... ) */
  • color:#990099;
  • font-weight:bold;
  • font-size:12px;
  • }
  • .CODE_JS u { /* propriété / attributs / action sur un élément ( value, style, innerHTML, innerText ... ) */
  • color:#9900CC;
  • font-weight:normal;
  • }
  • .CODE_JS var { /* fonction, class, var ... */
  • color:#000000;
  • font-weight:bold;
  • font-size:12px;
  • }
  • .CODE_JS small { /* boucle, condition ... ( for, while, foreach, if ... ) */
  • color:#009966;
  • font-weight:bold;
  • font-size:12px;
  • }
  • .CODE_JS b { /* Expression Régulière */
  • color:#009900;
  • font-style:italic;
  • font-size:12px;
  • }
  • .CODE_JS sup { /* Décimaux */
  • color:#CC0000;
  • font-weight:normal;
  • }
  • .CODE_JS s { /* booléen, et divers charctère ( &&, [, ] ... ) */
  • color:#0099FF;
  • font-weight:normal;
  • }
  • .onglet img {
  • position:relative;
  • top:0px;
  • border:none;
  • }
  • .onglet:hover img {
  • top:-2px;
  • }
  • </style>
  • </head>
  • <body style="background:white" onclick="javascript:if(!liste_affichee) document.getElementById('liste').style.display='none';">
  • <img id="ltest" src="fav/ltest.gif" alt="." style="position:absolute; width:100%; height:1px;" />
  • <div style="position:absolute; top:0px; left:240px;">
  • <a class="onglet" href="http://selfbuild.free.fr/contact.php5" onclick="javascript:window.open(this.href); return false;"><img src="fav/contact.gif" alt="Contact" /></a><a class="onglet" href="http://selfbuild.free.fr/notice.php5" onclick="javascript:window.open(this.href); return false;"><img src="fav/notice.gif" alt="Notice" /></a><?php if($maj) { ?><a class="onglet" href="update.php5"><img src="fav/miseajour.gif" alt="Mise à jour" /></a><?php } else echo ' &nbsp; <b style="position:relative; top:-8px;">Version '.$version.'</b>'; ?>
  • </div>
  • <?php
  • $int=TRUE;
  • $operations_effectuees='';
  • if(isset($_POST['envoyer']))
  • {
  • $_SESSION['dossier']=$_POST['fichier'];
  • sauvegarde();
  • }
  • if(isset($_POST['ouvrir']) OR isset($_SESSION['dossier']))
  • {
  • if(isset($_POST['changement']))
  • {
  • $_SESSION['dossier']=null;
  • }
  • if(!isset($_SESSION['dossier']))
  • {
  • $_SESSION['dossier']=$_POST['fichier'];
  • }
  • if($_POST['go'])
  • {
  • $operations_effectuees.='<span style="color:red">Cette fonction est d&eacute;sactiv&eacute;e dans la d&eacute;monstration.</span><br />';
  • }
  • if(strpos($_SESSION['dossier'],'/mnt/140/sdb/5/e/selfbuild/demo')===false)
  • {
  • $_SESSION['dossier']='./'.$_SESSION['dossier'];
  • }
  • $index=0;
  • if(file_exists($_SESSION['dossier']))
  • {
  • function poid($objet)
  • {
  • $size=filesize($objet);
  • if($size<1024)
  • {
  • return number_format($size,0,","," ").' octets';
  • }
  • elseif($size<(1024*1024))
  • {
  • $exp_fl=explode('.',$float=$size/1024);
  • $len=3-strlen($exp_fl[0]);
  • return number_format($float,$len,","," ").' Ko';
  • }
  • elseif($size<(1024*1024*1024))
  • {
  • $exp_fl=explode('.',$float=$size/(1024*1024));
  • $len=3-strlen($exp_fl[0]);
  • return number_format($float,$len,","," ").' Mo';
  • }
  • elseif($size<(1024*1024*1024*1024))
  • {
  • $exp_fl=explode('.',$float=$size/(1024*1024*1024));
  • $len=3-strlen($exp_fl[0]);
  • return number_format($float,$len,","," ").' Go';
  • }
  • else
  • {
  • $exp_fl=explode('.',$float=$size/(1024*1024*1024*1024));
  • $len=3-strlen($exp_fl[0]);
  • return number_format($float,$len,","," ").' To';
  • }
  • }
  • $echo=file($_SESSION['dossier']);
  • $longueur=0;
  • foreach($echo as $key=>$long)
  • {
  • $compteur=0;
  • preg_replace('#\t#','',$long,-1,$compteur);
  • $longueur=max($longueur,(strlen($long)+(8*$compteur)));
  • }
  • }
  • else
  • {
  • if(false===strpos($operations_effectuees,'Ordre de suppression'))
  • $operations_effectuees.='<span style="color:red">Fichier introuvable</span><br />';
  • $int=FALSE;
  • }
  • ?>
  • <div style="position:absolute; top:10px; right:10px; cursor:pointer; text-align:right;">
  • <img id="bouton_save" src="fav/save.png" width="32" height="32" <?php if(file_exists($_SESSION['dossier']) && $poid=poid($_SESSION['dossier'])) echo 'title="'.$poid.'"'; ?> onclick="javascript:ladate=new Date(); xajax_sauvegarde(true,document.getElementById('content_avant').value,document.getElementById('codebrute').value,document.getElementById('content_apres').value,'<?php echo $_SESSION['dossier']; ?>',ladate.getTime()); document.getElementById('copie_du_contenu').innerHTML=document.getElementById('codebrute').value; document.getElementById('bouton_save').src=save_charg_img.src; document.title='<?php echo $nomd; ?> - Edition [S]'; favicon.change('fav/charg.ico'); " />
  • <br /><span id="chrono"></span>
  • </div>
  • <div style="float:right; margin-right:50px;">
  • <p style="text-align:right; margin:0px; padding:0px;" id="ope">
  • <?php echo $operations_effectuees; ?>
  • </p>
  • </div>
  • <img onclick="javascript:location.href='navigateur.php5?get=3';" src="fav/parent.gif" title="Dossier parent" alt="Dossier parent" style="position:relative; top:5px; cursor:pointer;" />&nbsp;&nbsp;&nbsp;<a class="lien" href="navigateur.php5">Navigateur</a>
  • <br />
  • <form style="margin:0px; padding:0px;" id="changer_de_fichier" method="post" action="">
  • <input type="hidden" name="changement" value="oui" />
  • <input type="hidden" name="fichier" value="<?php echo $_SESSION['dossier']; ?>" id="fichier_chang_value" />
  • </form>
  • <div onmouseout="javascript:liste_affichee=false;" onmouseover="javascript:liste_affichee=true;" style="position:absolute; top:55px; left:8px; z-index:30; display:none; background:#e7e7e7; border:1px solid black; padding:0px; max-height:250px; overflow:auto;" id="liste">
  • <ul style="list-style-type:none; margin:0px; text-indent:0px; padding:0px;">
  • <?php
  • $dirname=dirname($_SESSION['dossier']);
  • if(false!==$dir_selected=opendir($dirname))
  • {
  • while(false!==($file_selected=readdir($dir_selected)))
  • {
  • if(false!==strpos($file_selected,'.') && ''!=str_replace('.','',$file_selected) && $file_selected!=basename($_SESSION['dossier']))
  • $liste_deroulante[]=$file_selected;
  • }
  • if(count($liste_deroulante)>0)
  • {
  • sort($liste_deroulante);
  • for($i=0;$i<count($liste_deroulante);$i++)
  • {
  • ?>
  • <li
  • style="cursor:pointer; padding-top:1px; padding-bottom:1px; padding-right:5px; padding-left:5px; min-width:200px; margin:0px; text-indent:0px;"
  • onmouseover="javascript:this.style.backgroundColor='#ffffff';"
  • onmouseout="javascript:this.style.backgroundColor='#e7e7e7';"
  • onclick="javascript:this.style.backgroundColor='#316ac5';this.style.color='white';this.style.paddingLeft='4px';this.style.paddingRight='4px';this.style.paddingTop='0px';this.style.paddingBottom='0px';this.style.borderColor='silver';this.style.borderStyle='dotted';this.style.borderWidth='1px';document.getElementById('fichier_chang_value').value='<?php echo $dirname.'/'.$liste_deroulante[$i] ; ?>';document.getElementById('changer_de_fichier').submit();"
  • ><?php echo $liste_deroulante[$i] ; ?></li>
  • <?php
  • }
  • }
  • else
  • {
  • ?><li style="cursor:pointer; padding-top:1px; padding-bottom:1px; padding-right:5px; padding-left:5px; min-width:200px; margin:0px; text-indent:0px;">Aucun autre fichier</li><?php
  • }
  • }
  • else
  • {
  • ?>
  • <li>Erreur de chargement</li>
  • <?php
  • }
  • $copie_du_contenu='';
  • ?>
  • </ul>
  • </div>
  • <form style="margin:0px; padding:0px;" id="formulaire_principal" method="post" action="">
  • <strong onmouseout="javascript:liste_affichee=false;" onmouseover="javascript:liste_affichee=true;" style="cursor:pointer;" onclick="javascript:var liste=document.getElementById('liste');liste.style.display=(liste.style.display=='none')? 'block':'none';"><?php echo str_replace('/mnt/140/sdb/5/e/selfbuild/demo',$http,realpath($_SESSION['dossier'])); ?></strong><br />
  • <input type="submit" id="bouton_enregister" name="envoyer" value="Enregistrer" />
  • <input type="hidden" name="fichier" value="<?php echo $_POST['fichier']; ?>"/>
  • <input type="hidden" name="avant" value="<?php echo $avant; ?>" id="content_avant" />
  • <input type="hidden" name="apres" value="<?php echo $apres; ?>" id="content_apres" />
  • <input type="button" name="zform_width_moins" id="zform_width_moins" value="<-" onclick="javascript:edit_zform_width('codebrute', -5);" />
  • <input type="button" name="zform_height_moins" id="zform_height_moins" value="-" onclick="javascript:edit_zform_height('codebrute', -5);" />
  • <input type="button" name="zform_height_plus" id="zform_height_plus" value="+" onclick="javascript:edit_zform_height('codebrute', 5);" />
  • <input type="button" name="zform_width_plus" id="zform_width_plus" value="->" onclick="javascript:edit_zform_width('codebrute', 5);" />
  • <input type="button" value="|-->" title="Tabulation" onclick="javascript:ajoute('\t');" />
  • &nbsp;&nbsp;
  • <label>Aller &agrave; la ligne : <input type="text" size="5" name="aller_a_la_ligne" id="aller_a_la_ligne" onkeyup="javascript:document.getElementById('scroll_case').scrollTop=(this.value-1)*15;" /></label>
  • <div style="width:100%;<?php
  • if(false!==strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 7'))
  • {
  • echo ' height:400px;';
  • }
  • elseif(false!==strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE'))
  • {
  • echo '';
  • }
  • else
  • {
  • echo ' height:400px;';
  • }
  • ?> overflow:auto; border:1px solid #000000;" id="scroll_case">
  • <table style="border-collapse:collapse;">
  • <tr>
  • <td id="numeros" style="width:34px; padding-right:5px; padding-bottom:2px; border-right:1px dotted #333333; float:left; text-align:right; font-family:monospace; font-size:12px;">
  • <?php echo '1'; $nbr_lignes_champ=count($echo)+30; for($i=2;$i<=$nbr_lignes_champ;$i++) echo '<br />'.$i; ?>
  • </td>
  • <td style="margin:0px; padding:1px; padding-left:3px;"><?php if($int) { ?>
  • <textarea onkeyup="javascript:document.getElementById('bouton_save').src=(document.getElementById('codebrute').value!=document.getElementById('copie_du_contenu').value)? 'fav/save_must.png':'fav/save.png'; if(document.getElementById('codebrute').value!=document.getElementById('copie_du_contenu').value) favicon.change('fav/save_must.ico'); else favicon.change('fav/save.ico');" style="overflow:hidden; margin:0px; border:0px; border-right:1px dotted red; font-family:monospace; font-size:12px;<?php
  • if(false!==strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 7'))
  • {
  • echo ' position:relative; top:-13px;';
  • }
  • elseif(false===strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox'))
  • {
  • echo ' position:relative; top:-7px;';
  • }
  • ?>" rows="<?php echo $nbr_lignes_champ-1; ?>" cols="<?php echo max($longueur,100); ?>" name="codebrute" id="codebrute"><?php
  • foreach($echo as $ligne)
  • {
  • $nouvelle_ligne=htmlentities(str_replace(preg_replace('#\s#','',$code[1]),preg_replace('#\s#','',$code[2]),$ligne));
  • echo $nouvelle_ligne;
  • $copie_du_contenu.=$nouvelle_ligne;
  • }
  • ?></textarea>
  • <textarea id="copie_du_contenu" style="display:none;"><?php echo $copie_du_contenu; ?></textarea><?php }
  • ?>
  • </td>
  • </tr>
  • </table>
  • </div>
  • <div style="float:right; text-align:right; padding-top:5px;">
  • <table style="margin:0px; padding:0px; border-collapse:collapse;">
  • <tr>
  • <td id="text_rep" style="width:115px; margin:0px; padding:0px; padding-right:20px; text-align:center; cursor:pointer;" onclick="javascript:rep_met();">
  • Remplacement
  • sans rechargement
  • </td>
  • <td style="margin:0px; padding:0px; display:none;" id="avec">
  • <form style="margin:0px; padding:0px;" method="post" action="">
  • <label>Remplacer&nbsp; <input type="text" name="cible" value="" /></label><br />
  • <label>Par&nbsp;&nbsp; <input type="text" name="replace" value="" /></label><input type="submit" name="go" value="Go" />
  • </form>
  • </td>
  • <td style="margin:0px; padding:0px;" id="sans">
  • <form style="margin:0px; padding:0px;" method="post" action="">
  • <label>Remplacer&nbsp; <input type="text" id="cible" value="" /></label><br />
  • <label>Par&nbsp;&nbsp; <input type="text" id="replace" value="" /></label><input type="button" onclick="javascript:var reg=new RegExp(document.getElementById('cible').value, 'g'); document.getElementById('codebrute').value=document.getElementById('codebrute').value.replace(reg,document.getElementById('replace').value); document.getElementById('bouton_save').src=(document.getElementById('codebrute').value!=document.getElementById('copie_du_contenu').value)? 'fav/save_must.png':'fav/save.png'; if(document.getElementById('codebrute').value!=document.getElementById('copie_du_contenu').value) favicon.change('fav/save_must.ico'); else favicon.change('fav/save.ico');" value="Go" />
  • </form>
  • </td>
  • </tr>
  • </table>
  • </div>
  • <p style="margin-top:15px; margin-bottom:16px; text-align:left;">
  • <select name="SelColore" id="SelColore">
  • <option>HTML, CSS, PHP, JavaScript</option>
  • <option>X/HTML</option>
  • <option>CSS</option>
  • <option>JavaScript</option>
  • <option>PHP</option>
  • </select> <input type="checkbox" name="addNum" id="addNum" checked="checked" />Lignes &nbsp;
  • <input type="submit" value="Colorier" onclick="return ColoreCode(document.getElementById('codebrute').value,document.getElementById('codecolore'), document.getElementById('SelColore').selectedIndex, document.getElementById('addNum').checked);" /><span id="CODE_TimeStamp"></span>
  • </p>
  • </form>
  • <div id="codecolore"></div>
  • <?php
  • }
  • else
  • {
  • echo '<a class="lien" href="./navigateur.php5?get=1">Erreur</a>';
  • }
  • ?>
  • </form>
  • </div>
  • <div style="float:right;">
  • <img id="logo_bmwx" src="http://bmwx.free.fr/bmwx.gif" alt="Produit par BMWX" />
  • </div>
  • <?php
  • foreach($racc as $key=>$rac)
  • {
  • echo '<a href="?rac='.$key.'">'.$rac.'</a><br />';
  • }
  • ?>
  • </body>
  • </html>
<?php
$version='1.0.1';
$selfbuild=@file_get_contents('http://selfbuild.free.fr/update/version.txt');
if($version==$selfbuild || strlen($selfbuild)<1)
$maj=false; else $maj=true;
session_start();
if(isset($_GET['rac']))
{
  $rac_select=$_GET['rac']*1;
  if(is_int($rac_select) && $rac_select>=0 && $rac_select<count($racc))
    $_SESSION['dossier']=realpath(str_replace($http,'./',$racc[$rac_select]));
}
if(!$_SESSION['navig_access'])
{
	header('Location:admin.php5');
}
$nomd='Demonstration';
$http='http://selfbuild.free.fr/demo';
$racc=explode('|',preg_replace('#\s#','',$config[6]));
$code=file('code.txt.php');
if(isset($_GET['rac']))
{
   $addr=str_replace($http,'./',$racc[$_GET['rac']]);
   if(file_exists($addr))
   $_SESSION['dossier']=$addr;
   else
   $operations_effectuees.='<span style="color:red">Le fichier est introuvable.</span><br/>';
}
require('../xajax.inc.php');
function sauvegarde($type=false,$tavant='',$texte='',$tapres='',$file='Aucun!!!',$time=0)
{
	global $operations_effectuees,$nomd;
	if($file=='Aucun!!!')
	$file=$_SESSION['dossier'];
	if($type==true)
	{
		$operations_effectuees.='<span style="color:red">Cette fonction est d&eacute;sactiv&eacute;e dans la d&eacute;monstration.</span><br />';
		$reponse=new xajaxResponse();
		$reponse->addAssign("bouton_save", "src", 'fav/save.png');
		$reponse->addScript('favicon.change(\'fav/save.ico\');');
		$reponse->addAssign("title", "innerHTML", $nomd.' - Edition');
		$reponse->addAssign("ope", "innerHTML", $operations_effectuees);
		$reponse->addScript('ladate=new Date(); document.getElementById(\'chrono\').innerHTML=(ladate.getTime()-'.$time.')+\'ms\';');
		return $reponse->getXML();
	}
	else
	{
		$operations_effectuees.='<span style="color:red">Cette fonction est d&eacute;sactiv&eacute;e dans la d&eacute;monstration.</span><br />';
		return true;
	}
}
$xajax=new xajax();
$xajax->setCharEncoding('ISO-8859-1');
$xajax->decodeUTF8InputOn();
$xajax->registerFunction('sauvegarde');
$xajax->processRequests();
function som_occ()
{
  $somme=0;
  $numargs=func_num_args();
  $arg_list=func_get_args();
  for($i=0;$i<$numargs;$i++)
	if(false!==$occ=strpos($_SESSION['dossier'],$arg_list[$i]))
	  $somme+=$occ;
  return $somme;
}
if(som_occ('edit.php5','navigateur.php5','code.txt.php')>0)
{
	$_SESSION['erreur']='tentative d\'éfraction';
	header('Location: navigateur.php5');
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr">
   <head>
       <title><?php echo $nomd; ?> - Edition</title>
		<link rel="stylesheet" media="screen" type="text/css" title="principal" href="admin_style.css"/>
		<link rel="shortcut icon" type="image/x-icon" href="fav/save.ico" id="icone" />
		<script type="text/javascript" src="ColoreCode.js"></script>
		<?php if(file_exists('statistiques.js')) { ?>
		<script type="text/javascript" src="statistiques.js"></script>
		<?php } ?>
		<script type="text/javascript" language="JavaScript">
		<!--   1.
        var ladate;
        var favicon = {
	        change: function(iconURL) {
	          if (arguments.length==2) {
				document.title = optionalDocTitle;
	          }
	          this.addLink(iconURL, "icon");
	          this.addLink(iconURL, "shortcut icon");
			},
			addLink: function(iconURL, relValue) {
	          var link = document.createElement("link");
	          link.type = "image/x-icon";
	          link.rel = relValue;
	          link.href = iconURL;
	          this.removeLinkIfExists(relValue);
	          this.docHead.appendChild(link);
		    },
	        removeLinkIfExists: function(relValue) {
	          var links = this.docHead.getElementsByTagName("link");
			  for (var i=0; i<links.length; i++) {
				var link = links[i];
				if (link.type=="image/x-icon" && link.rel==relValue) {
					this.docHead.removeChild(link);
					return;
				}
			  }
			},
			docHead:document.getElementsByTagName("head")[0]
		} 
		var save_charg_img = new Image();
		save_charg_img.src = 'fav/save_charg.gif';
		function envoyer(f)
		{
			f.submit();
		}
		function edit_zform_height(id_textarea, diff)
		{
			var champ = document.getElementById(id_textarea);
			var case_numeros = document.getElementById('numeros');
			height_avant = champ.rows + Number(diff);
				if (height_avant < 30)
				height_avant = 30;
			var contenu = '1';
			for(i=2;i<=height_avant+1;i++)
			{
				contenu = contenu+'<br />'+i;
			}
			case_numeros.innerHTML = contenu;
			champ.rows = height_avant;
			return false;
		}
		function edit_zform_width(id_textarea, diff)
		{
			var champ = document.getElementById(id_textarea);
			width_avant = champ.cols + Number(diff);
				if (width_avant < 60)
				width_avant = 60;
			champ.cols = width_avant;
			return false;
		}
		function storeCaret(id_textarea)
		{ 
			champ = document.getElementById(id_textarea);
				if (champ.createTextRange)
				champ.curseur = document.selection.createRange().duplicate();
		}
		function verif_title()
		{
			if(document.getElementById('bouton_save').src!=save_charg_img.src)
			document.title='<?php echo addslashes($nomd); ?> - Edition';
			return true;
		}
		var timer=setInterval('verif_title()',500);
		var liste_affichee=false;
		var sora;
		function rep_met()
		{
			sora=(document.getElementById('avec').style.display=='none')? 'avec':'sans';
			document.getElementById('avec').style.display='none';
			document.getElementById('sans').style.display='none';
			document.getElementById(sora).style.display='block';
			sora='Remplacement '+sora+' rechargement';
			document.getElementById('text_rep').innerHTML=sora;
			return true;
		}
		var isMozilla = (navigator.userAgent.toLowerCase().indexOf('gecko')!=-1) ? true : false;
		var regexp = new RegExp("[\r]","gi");
		var nouvelle_ligne = new RegExp("\n","gi");
		function ajoute(selec)
		{
			if (isMozilla) 
			{
				oField = document.getElementById('codebrute');
				objectValue = oField.value;
				deb = oField.selectionStart;
				fin = oField.selectionEnd;
				objectValueDeb = objectValue.substring( 0 , oField.selectionStart );
				objectValueFin = objectValue.substring( oField.selectionEnd , oField.textLength );
				objectSelected = objectValue.substring( oField.selectionStart ,oField.selectionEnd );
				objectSelected = objectSelected.replace(nouvelle_ligne,'\n'+selec);
				if(regexp.test(objectSelected)) objectSelected.replace( regexp, selec );
				oField.value = objectValueDeb + selec + objectSelected + objectValueFin;
				oField.selectionStart = objectValueDeb.length;
				oField.selectionEnd = objectValue.length - objectValueFin.length;
				oField.focus();
				oField.setSelectionRange(
					objectValueDeb.length + selec.length,
					objectValueDeb.length + selec.length);
			}
			else
			{
				oField = document.getElementById('codebrute');;
				var str = document.selection.createRange().text;
				if (str.length>0)
				{
					var sel = document.selection.createRange();
					sel.text = selec + str;
					sel.collapse();
					sel.select();
				}
				else
				{
					oField.focus(oField.caretPos);
					oField.focus(oField.value.length);
					oField.caretPos = document.selection.createRange().duplicate();
					var bidon = "%~%";
					var orig = oField.value;
					oField.caretPos.text = bidon;
					var i = oField.value.search(bidon);
					oField.value = orig.substr(0,i) + selec + orig.substr(i, oField.value.length);
					var r = 0;
					for(n = 0; n < i; n++)
					{
						if(regexp.test(oField.value.substr(n,2)) == true)
						{
							r++;
						}
					};
					pos = i + selec.length - r;
					var r = oField.createTextRange();
					r.moveStart('character', pos);
					r.collapse();
					r.select();
				}
			}
		}
		var play=new Image();
		play.src="fav/play.png";
		var fin=new Image();
		fin.src="fav/fin.png";
		//-->
		</script>
		<?php
		function change_src($buffer)
		{
			$buffer=str_replace('src="xajax_js/xajax.js"','src="'.'../'.'/xajax_js/xajax.js"',$buffer);
			return $buffer;
		}
		ob_start('change_src');
		$xajax->printJavascript();
		ob_end_flush();
		?>
		<style media="all" type="text/css">
			p
			{
				font-size:14px;
			}
			a
			{
				color:navy;
				text-decoration:none;
			}
			a:hover
			{
				color:navy;
				text-decoration:underline;
			}
			a:focus, a:active
			{
				color:#2e4ff4;
			}
			strong
			{
				font-weight:bolder;
				font-style:italic;
				color:blue;
			}
			/*** Général ***/
			.CodeSource {
				color:#000000;
				margin:0;
				padding:0;
				position:absolute;
				top:0px;
				font-family:monospace;
				font-size:13px;
			}
			.CodeSource tr:hover td {
				border-bottom:#CCCCCC 1px solid;
			}
			
			#codecolore {
				position:relative;
				border:1px solid #000000;
				height:436px;
				width:auto;
				padding:0;
				margin:0;
				font-family:monospace;
				font-size:13px;
				overflow:auto;
			}
			/*** Affiche le temps d'éxécution et le nombre de ligne parsé ***/
			#CODE_TimeStamp {
				font-family:Arial, Helvetica, sans-serif;
				font-size:12px;
				padding-left:12px;
			}
			
			/*** Numérotation des lignes ***/
			.CODE_NumLn {
				font-size:13px;
				background-color:#EFEFEF;
				border-bottom:#EFEFEF 1px solid;
				border-right:#999999 solid 1px;
				color:#000000;
				font-family:monospace;
				vertical-align:text-top;
				padding-left:6px;
			}
			
			/*** Lang CSS ***/
			.CODE_CSS s, .CODE_CSS u, .CODE_CSS i, .CODE_CSS em, .CODE_CSS cite, .CODE_CSS strike {
				text-decoration:none;
				text-transform:none;
				font-style:normal;
				font-weight:normal;
				font-family:monospace;
				font-size:13px;
			}
			
			/*** Lang HTML ***/
			.CODE_HTM s, .CODE_HTM u, .CODE_HTM i, .CODE_HTM cite {
				text-decoration:none;
				text-transform:none;
				font-style:normal;
				font-weight:normal;
				font-family:monospace;
				font-size:13px;
			}
			
			/*** Lang PHP ***/
			.CODE_PHP li, .CODE_PHP cite, .CODE_PHP strike, .CODE_PHP i, .CODE_PHP em, .CODE_PHP big, .CODE_PHP u, .CODE_PHP var, .CODE_PHP small, .CODE_PHP b, .CODE_PHP sup , .CODE_PHP s {
				text-decoration:none;
				text-transform:none;
				font-style:normal;
				font-weight:normal;
				font-size:13px;
				vertical-align:inherit;
				display:inline;
				font-family:monospace;
				font-size:13px;
			}
			
			/*** LANG JS ***/
			.CODE_JS, .CODE_JS cite, .CODE_JS strike, .CODE_JS i, .CODE_JS em, .CODE_JS big, .CODE_JS u, .CODE_JS var, .CODE_JS small, .CODE_JS b, .CODE_JS sup , .CODE_JS s {
				text-decoration:none;
				text-transform:none;
				font-style:normal;
				font-weight:normal;
				font-size:13px;
				vertical-align:inherit;
				display:inline;
				font-family:monospace;
				font-size:13px;
			}
			
			/*** Coloration HTML ***/
			.CODE_HTM u { /* Tag Name */
				color:#880088;
				font-weight:bold;
				font-size:12px;
			}
			.CODE_HTM i { /* Attribut */
				color:#000000;
				font-weight:bold;
				font-size:12px;
			}
			.CODE_HTM s {	/* Value */
				color:#0000CC;
			}
			.CODE_HTM cite { /* commentaires */
				color:#999999;
				font-style:italic;
				font-size:12px;
			}
			
			/*** Coloration CSS ***/
			.CODE_CSS s { /** class, tag **/
				color:#880088;
				font-weight:bold;
				font-size:12px;
			}
			.CODE_CSS u { /** Propriété CSS **/
				color:#000088;
				font-weight:bold;
				font-size:12px;
			}
			.CODE_CSS i { /** Value propriété CSS **/
				color:#880000;
				font-weight:normal;
			}
			.CODE_CSS em { /** Effet ( over, link ... ) **/
				color:#0000CC;
				font-weight:normal;
			}
			.CODE_CSS cite { /** Commentaire **/
				color:#999999;
				font-style:italic;
				font-size:12px;
			}
			.CODE_CSS strike { /** String **/
				color:#996699;
			}
			
			/*** Coloration PHP ***/
			.CODE_PHP big {	
				color:#FF0000;
				font-weight:bold;
				font-size:12px;
			}
			.CODE_PHP strike { /* String */
				color:#CC3333;
			}
			.CODE_PHP cite { /* Commentaires */
				color:#CC9900;
				font-style:italic;
				font-size:12px;
			}
			.CODE_PHP sup { /* Décimaux */
				color:#0066FF;
			}
			.CODE_PHP u { /* fonctione du type mysql_connect(), fopen() etc ... */
				color:#003399;
			}
			.CODE_PHP var { /* variables ( mot qui commence par $ ) */
				color:#0000CC;
			}
			.CODE_PHP i { /* du type function, var, class ... */
				color:#000099;
				font-weight:bold;
				font-size:12px;
			}
			.CODE_PHP small { /* Conditions boucle et autres ... */
				color:#669900;
				font-weight:bold;
				font-size:12px;
			}
			.CODE_PHP b { /* Expression régulière */
				color:#9900CC;
				font-style:italic;
				font-size:12px;
			}
			.CODE_PHP em { /* Booléen => null, false, true  Autre caractère => !=, <=, >=, &&, ||, .=, ( ), [] etc ... */
				color:#990000;
				font-weight:bold;
				font-size:12px;
			}
			
			/*** Coloration javascript ***/
			.CODE_JS cite { /* commentaires */
				color:#999999;
				font-style:italic;
				font-size:12px;
			}
			.CODE_JS strike { /* String */
				color:#0000CC;
				font-weight:normal;
			}
			.CODE_JS i { /* Réservé a JS ( window, document, layer, event ... ) */
				color:#008800;
				font-weight:normal;
			}
			.CODE_JS em { /* Réservé a JS ( getElement, frame ,forms, item ... ) */
				color:#000088;
				font-weight:normal;
			}
			.CODE_JS big { /* Mot spéciaux réservé a JS ( alert, focus, open, close ... ) */
				color:#990099;
				font-weight:bold;
				font-size:12px;
			}
			.CODE_JS u { /* propriété / attributs / action sur un élément ( value, style, innerHTML, innerText ... ) */
				color:#9900CC;
				font-weight:normal;
			}
			.CODE_JS var { /* fonction, class, var ... */
				color:#000000;
				font-weight:bold;
				font-size:12px;
			}
			.CODE_JS small { /* boucle, condition ... ( for, while, foreach, if ... ) */
				color:#009966;
				font-weight:bold;
				font-size:12px;
			}
			.CODE_JS b { /* Expression Régulière */
				color:#009900;
				font-style:italic;
				font-size:12px;
			}
			.CODE_JS sup { /* Décimaux */
				color:#CC0000;
				font-weight:normal;
				
			}
			.CODE_JS s { /* booléen, et divers charctère ( &&, [, ] ... ) */
				color:#0099FF;
				font-weight:normal;
			}
			.onglet img {
				position:relative;
				top:0px;
				border:none;
			}
			.onglet:hover img {
				top:-2px;
			}
		</style>
   </head>
   <body style="background:white" onclick="javascript:if(!liste_affichee) document.getElementById('liste').style.display='none';">
   <img id="ltest" src="fav/ltest.gif" alt="." style="position:absolute; width:100%; height:1px;" />
   <div style="position:absolute; top:0px; left:240px;">
		<a class="onglet" href="http://selfbuild.free.fr/contact.php5" onclick="javascript:window.open(this.href); return false;"><img src="fav/contact.gif" alt="Contact" /></a><a class="onglet" href="http://selfbuild.free.fr/notice.php5" onclick="javascript:window.open(this.href); return false;"><img src="fav/notice.gif" alt="Notice" /></a><?php if($maj) { ?><a class="onglet" href="update.php5"><img src="fav/miseajour.gif" alt="Mise à jour" /></a><?php } else echo ' &nbsp; <b style="position:relative; top:-8px;">Version '.$version.'</b>'; ?>
   </div>
   <?php
	$int=TRUE;
	$operations_effectuees='';
	if(isset($_POST['envoyer']))
	{
		$_SESSION['dossier']=$_POST['fichier'];
		sauvegarde();
	}
	if(isset($_POST['ouvrir']) OR isset($_SESSION['dossier']))
	{
		if(isset($_POST['changement']))
		{
			$_SESSION['dossier']=null;
		}
		if(!isset($_SESSION['dossier']))
		{
			$_SESSION['dossier']=$_POST['fichier'];
		}
		if($_POST['go'])
		{
			$operations_effectuees.='<span style="color:red">Cette fonction est d&eacute;sactiv&eacute;e dans la d&eacute;monstration.</span><br />';
		}
		if(strpos($_SESSION['dossier'],'/mnt/140/sdb/5/e/selfbuild/demo')===false)
		{
			$_SESSION['dossier']='./'.$_SESSION['dossier'];
		}
		$index=0;
		if(file_exists($_SESSION['dossier']))
		{
			function poid($objet)
			{
				$size=filesize($objet);
				if($size<1024)
				{
					return number_format($size,0,","," ").' octets';
				}
				elseif($size<(1024*1024))
				{
					$exp_fl=explode('.',$float=$size/1024);
					$len=3-strlen($exp_fl[0]);
					return number_format($float,$len,","," ").' Ko';
				}
				elseif($size<(1024*1024*1024))
				{
					$exp_fl=explode('.',$float=$size/(1024*1024));
					$len=3-strlen($exp_fl[0]);
					return number_format($float,$len,","," ").' Mo';
				}
				elseif($size<(1024*1024*1024*1024))
				{
					$exp_fl=explode('.',$float=$size/(1024*1024*1024));
					$len=3-strlen($exp_fl[0]);
					return number_format($float,$len,","," ").' Go';
				}
				else
				{
					$exp_fl=explode('.',$float=$size/(1024*1024*1024*1024));
					$len=3-strlen($exp_fl[0]);
					return number_format($float,$len,","," ").' To';
				}
			}
			$echo=file($_SESSION['dossier']);
			$longueur=0;
			foreach($echo as $key=>$long)
			{
				$compteur=0;
				preg_replace('#\t#','',$long,-1,$compteur);
				$longueur=max($longueur,(strlen($long)+(8*$compteur)));
			}
		}
		else
		{
			if(false===strpos($operations_effectuees,'Ordre de suppression'))
			$operations_effectuees.='<span style="color:red">Fichier introuvable</span><br />';
			$int=FALSE;
		}
		?>
		<div style="position:absolute; top:10px; right:10px; cursor:pointer; text-align:right;">
			<img id="bouton_save" src="fav/save.png" width="32" height="32" <?php if(file_exists($_SESSION['dossier']) && $poid=poid($_SESSION['dossier'])) echo 'title="'.$poid.'"'; ?> onclick="javascript:ladate=new Date(); xajax_sauvegarde(true,document.getElementById('content_avant').value,document.getElementById('codebrute').value,document.getElementById('content_apres').value,'<?php echo $_SESSION['dossier']; ?>',ladate.getTime()); document.getElementById('copie_du_contenu').innerHTML=document.getElementById('codebrute').value; document.getElementById('bouton_save').src=save_charg_img.src; document.title='<?php echo $nomd; ?> - Edition [S]'; favicon.change('fav/charg.ico'); " />
			<br /><span id="chrono"></span>
		</div>
		<div style="float:right; margin-right:50px;">
		  <p style="text-align:right; margin:0px; padding:0px;" id="ope">
			<?php echo $operations_effectuees; ?>
		  </p>
		</div>
		<img onclick="javascript:location.href='navigateur.php5?get=3';" src="fav/parent.gif" title="Dossier parent" alt="Dossier parent" style="position:relative; top:5px; cursor:pointer;" />&nbsp;&nbsp;&nbsp;<a class="lien" href="navigateur.php5">Navigateur</a>
		<br />
		<form style="margin:0px; padding:0px;" id="changer_de_fichier" method="post" action="">
		  <input type="hidden" name="changement" value="oui" />
		  <input type="hidden" name="fichier" value="<?php echo $_SESSION['dossier']; ?>" id="fichier_chang_value" />
		</form>
		<div onmouseout="javascript:liste_affichee=false;" onmouseover="javascript:liste_affichee=true;" style="position:absolute; top:55px; left:8px; z-index:30; display:none; background:#e7e7e7; border:1px solid black; padding:0px; max-height:250px; overflow:auto;" id="liste">
		  <ul style="list-style-type:none; margin:0px; text-indent:0px; padding:0px;">
			<?php
			$dirname=dirname($_SESSION['dossier']);
			if(false!==$dir_selected=opendir($dirname))
			{
			while(false!==($file_selected=readdir($dir_selected)))
			{
				if(false!==strpos($file_selected,'.') && ''!=str_replace('.','',$file_selected) && $file_selected!=basename($_SESSION['dossier']))
				$liste_deroulante[]=$file_selected;
			}
			if(count($liste_deroulante)>0)
			{
				sort($liste_deroulante);
				for($i=0;$i<count($liste_deroulante);$i++)
				{
				?>
				<li
					style="cursor:pointer; padding-top:1px; padding-bottom:1px; padding-right:5px; padding-left:5px; min-width:200px; margin:0px; text-indent:0px;"
					onmouseover="javascript:this.style.backgroundColor='#ffffff';"
					onmouseout="javascript:this.style.backgroundColor='#e7e7e7';"
					onclick="javascript:this.style.backgroundColor='#316ac5';this.style.color='white';this.style.paddingLeft='4px';this.style.paddingRight='4px';this.style.paddingTop='0px';this.style.paddingBottom='0px';this.style.borderColor='silver';this.style.borderStyle='dotted';this.style.borderWidth='1px';document.getElementById('fichier_chang_value').value='<?php echo $dirname.'/'.$liste_deroulante[$i] ; ?>';document.getElementById('changer_de_fichier').submit();"
					><?php echo $liste_deroulante[$i] ; ?></li>
				<?php
				}
			}
			else
			{
				?><li style="cursor:pointer; padding-top:1px; padding-bottom:1px; padding-right:5px; padding-left:5px; min-width:200px; margin:0px; text-indent:0px;">Aucun autre fichier</li><?php
			}
			}
			else
			{
			?>
			<li>Erreur de chargement</li>
			<?php
			}
			$copie_du_contenu='';
			?>
		  </ul>
		</div>
		<form style="margin:0px; padding:0px;" id="formulaire_principal" method="post" action="">
			<strong onmouseout="javascript:liste_affichee=false;" onmouseover="javascript:liste_affichee=true;" style="cursor:pointer;" onclick="javascript:var liste=document.getElementById('liste');liste.style.display=(liste.style.display=='none')? 'block':'none';"><?php echo str_replace('/mnt/140/sdb/5/e/selfbuild/demo',$http,realpath($_SESSION['dossier'])); ?></strong><br />
			<input type="submit" id="bouton_enregister" name="envoyer" value="Enregistrer" />
			<input type="hidden" name="fichier" value="<?php echo $_POST['fichier']; ?>"/>
			<input type="hidden" name="avant" value="<?php echo $avant; ?>" id="content_avant" />
			<input type="hidden" name="apres" value="<?php echo $apres; ?>" id="content_apres" />
					<input type="button" name="zform_width_moins" id="zform_width_moins" value="<-" onclick="javascript:edit_zform_width('codebrute', -5);" />
					<input type="button" name="zform_height_moins" id="zform_height_moins" value="-" onclick="javascript:edit_zform_height('codebrute', -5);" />
					<input type="button" name="zform_height_plus" id="zform_height_plus" value="+" onclick="javascript:edit_zform_height('codebrute', 5);" />
					<input type="button" name="zform_width_plus" id="zform_width_plus" value="->" onclick="javascript:edit_zform_width('codebrute', 5);" />
					<input type="button" value="|-->" title="Tabulation" onclick="javascript:ajoute('\t');" />
					&nbsp;&nbsp;
					<label>Aller &agrave; la ligne : <input type="text" size="5" name="aller_a_la_ligne" id="aller_a_la_ligne" onkeyup="javascript:document.getElementById('scroll_case').scrollTop=(this.value-1)*15;" /></label>
			<div style="width:100%;<?php
		if(false!==strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 7'))
		{
			echo ' height:400px;';
		}
		elseif(false!==strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE'))
		{
			echo '';
		}
		else
		{
			echo ' height:400px;';
		}
		?> overflow:auto; border:1px solid #000000;" id="scroll_case">
			<table style="border-collapse:collapse;">
			  <tr>
				<td id="numeros" style="width:34px; padding-right:5px; padding-bottom:2px; border-right:1px dotted #333333; float:left; text-align:right; font-family:monospace; font-size:12px;">
				<?php echo '1'; $nbr_lignes_champ=count($echo)+30; for($i=2;$i<=$nbr_lignes_champ;$i++) echo '<br />'.$i; ?>
				</td>
				<td style="margin:0px; padding:1px; padding-left:3px;"><?php if($int) { ?>
					<textarea onkeyup="javascript:document.getElementById('bouton_save').src=(document.getElementById('codebrute').value!=document.getElementById('copie_du_contenu').value)? 'fav/save_must.png':'fav/save.png'; if(document.getElementById('codebrute').value!=document.getElementById('copie_du_contenu').value) favicon.change('fav/save_must.ico'); else favicon.change('fav/save.ico');" style="overflow:hidden; margin:0px; border:0px; border-right:1px dotted red; font-family:monospace; font-size:12px;<?php
		if(false!==strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 7'))
		{
			echo ' position:relative; top:-13px;';
		}
		elseif(false===strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox'))
		{
			echo ' position:relative; top:-7px;';
		}
		?>" rows="<?php echo $nbr_lignes_champ-1; ?>" cols="<?php echo max($longueur,100); ?>" name="codebrute" id="codebrute"><?php
					foreach($echo as $ligne)
					{
						$nouvelle_ligne=htmlentities(str_replace(preg_replace('#\s#','',$code[1]),preg_replace('#\s#','',$code[2]),$ligne));
						echo $nouvelle_ligne;
						$copie_du_contenu.=$nouvelle_ligne;
					}
					?></textarea>
					<textarea id="copie_du_contenu" style="display:none;"><?php echo $copie_du_contenu; ?></textarea><?php }
					?>
				</td>
			  </tr>
			</table>
			</div>
			<div style="float:right; text-align:right; padding-top:5px;">
			  <table style="margin:0px; padding:0px; border-collapse:collapse;">
			  <tr>
			   <td id="text_rep" style="width:115px; margin:0px; padding:0px; padding-right:20px; text-align:center; cursor:pointer;" onclick="javascript:rep_met();">
				Remplacement
				sans rechargement
			   </td>
			   <td style="margin:0px; padding:0px; display:none;" id="avec">
				<form style="margin:0px; padding:0px;" method="post" action="">
					<label>Remplacer&nbsp; <input type="text" name="cible" value="" /></label><br />
					<label>Par&nbsp;&nbsp; <input type="text" name="replace" value="" /></label><input type="submit" name="go" value="Go" />
				</form>
			   </td>
			   <td style="margin:0px; padding:0px;" id="sans">
				<form style="margin:0px; padding:0px;" method="post" action="">
					<label>Remplacer&nbsp; <input type="text" id="cible" value="" /></label><br />
					<label>Par&nbsp;&nbsp; <input type="text" id="replace" value="" /></label><input type="button" onclick="javascript:var reg=new RegExp(document.getElementById('cible').value, 'g'); document.getElementById('codebrute').value=document.getElementById('codebrute').value.replace(reg,document.getElementById('replace').value); document.getElementById('bouton_save').src=(document.getElementById('codebrute').value!=document.getElementById('copie_du_contenu').value)? 'fav/save_must.png':'fav/save.png'; if(document.getElementById('codebrute').value!=document.getElementById('copie_du_contenu').value) favicon.change('fav/save_must.ico'); else favicon.change('fav/save.ico');" value="Go" />
				</form>
			   </td>
			  </tr>
			  </table>
			</div>
			<p style="margin-top:15px; margin-bottom:16px; text-align:left;">
				<select name="SelColore" id="SelColore">
					<option>HTML, CSS, PHP, JavaScript</option>
					<option>X/HTML</option>
					<option>CSS</option>
					<option>JavaScript</option>
					<option>PHP</option>
				</select> <input type="checkbox" name="addNum" id="addNum" checked="checked" />Lignes &nbsp;
				<input type="submit" value="Colorier" onclick="return ColoreCode(document.getElementById('codebrute').value,document.getElementById('codecolore'), document.getElementById('SelColore').selectedIndex, document.getElementById('addNum').checked);" /><span id="CODE_TimeStamp"></span>
			</p>
		</form>
		<div id="codecolore"></div>
		<?php
	}
	else
	{
		echo '<a class="lien" href="./navigateur.php5?get=1">Erreur</a>';
	}
	?>
	</form>
	</div>
	<div style="float:right;">
	<img id="logo_bmwx" src="http://bmwx.free.fr/bmwx.gif" alt="Produit par BMWX" />
	</div>
	<?php
	foreach($racc as $key=>$rac)
	{
		echo '<a href="?rac='.$key.'">'.$rac.'</a><br />';
	}
	?>
   </body>
</html>

 Conclusion

Désormais vous voilà paré d'un nouvel outil rapide et (j'espère) efficace.

 Fichier Zip

Les Membres Club peuvent télécharger directement un fichier contenu dans le zip sans télécharger le zip en entier !

Télécharger le zip


 Sources du même auteur

GÉNÉRER UNE CHAÎNE ALÉATOIRE SANS BOUCLE NI CRYPTAGE (MD5 OU...
ELIMINER LES FAUTES DE VALIDITÉ W3C COURANTES.
MASQUER VOTRE CODE AUX ROBOTS VALIDEURS W3C

 Sources de la même categorie

Source avec une capture PHPREPOGENERATOR + REPO (WIN) par alvinp
Source avec Zip IPHONE - ICÔNE D'APPEL TÉLÉPHONIQUE SUR L'ÉCRAN D'ACCUEIL par Rainbow
Source avec Zip Source avec une capture [APP WEB]SERVEUREXPLOREUR par thematrix01
Source avec Zip Source avec une capture MY.BOOKMARKS par inwebo
Source avec Zip M.V.C M.E.D par faceme

 Sources en rapport avec celle ci

Source avec Zip PAYPAL CMS V1 par mkfreedown
Source avec Zip Source avec une capture FORMULAIRE DE RECOMMANDATION DE SITE par Dje33
Source avec Zip Source avec une capture GRACENATUR V02 - CDMS: CONTAIN AND DESIGN MANAGMENT SYSTEM par sajaris
Source avec Zip IMAGINE-CMS V2.20 par djack69
Source avec Zip Source avec une capture ZORAWEAVER : GESTIONNAIRE DE SITE EN-LIGNE, TYPE DREAMWEAVER par zoran_8000

Commentaires et avis

Commentaire de yoman64 le 02/01/2008 09:23:34

Salut,
quelques remarques:
Tu utilises des liens/références/images en dur/externe dans ton code exemple: http://galerie.images.free.fr/images/type/
Pourquoi ne pas inclure les images dans le zip à la place de se tapper des références externes ?

Dans edit.php5 tu ne vérifie même pas si l'utilisateur est bien connecté.
Les header('Location:../../../'); ne mène pas forcément à un fichier valide pour tout le monde.

Sinon si j'ai bien compris la coloraison se fait en javascript ? Ça peut être lourd lorsqu'on travail sur des gros fichier et des machines peu puissante, mais c'est totalement subjectif :).

Voila c'est tout, sinon l'idée est bonne et d'après ta capture c'est interessant. Il est vrai que cela peut faire sauver beaucoup de temps, mais bon tu en mets un peu quand tu dis "SelfBuild est le nouveau mode de vie du webmaster-codeur." , t'es quand meme pas le premier à faire ça :P

Commentaire de kylekatarnls le 02/01/2008 13:41:46

Les liens externes, oups je croyais qu'ils allaient tous sur selfbuild.free.fr, mais le problème du relatif c'est que si les fichiers ne se retrouvent pas là où il faut, c'est mort. Donc l'idée c'était de pouvoir placer les fichiers et dossiers n'importe où.

 Ajouter un commentaire


Discussions en rapport avec ce code source dans le forum

comment se deconnecté d'une session ? [ par coolboy78 ] ce que j'aimerai faire c que quand un utilsateur se logue que sa mettre à 1 le champs online par exemple et quand il ferme la fenetre ou qu'il aille s comment se deconnecté d'une session ? [ par coolboy78 ] ce que j'aimerai faire c que quand un utilsateur se logue que sa mettre à 1 le champs online par exemple et quand il ferme la fenetre ou qu'il aille s Problème d'affichage d'HEADERS avec mail(); [ par JeanMi66 ] Bonjour &#224; tous !j'utilise la fonction mail() pour envoyer un mail au format HTML. Je suis all&#233; sur le site officiel de PHP pour voir comment Je n'ai jamais vu d'editeur php. [ par c v ] Dans le thème Divers nous avons Général et nous avons Divers, alors je pensai que l'on pouvait ajouter le thème Autres.Nous sérieusement j'ai toujours creer un editeur de texte [ par neofranck ] bonjour je travail sur un site qui contient un rubrique ou l'on peut rediger des articles. je voudrai donc savoir comment creer un petit editeur de te Editeur PHP [ par ALEX001 ] Je suis nouveau dans le domaine du php et je sais pas quoi utilisé comme editeur et que faut t'il de plus pour faire un projet de la taille de VBfranc Probléme de mise en page editeur Wysiwyg [ par sky_striker ] Bonjour &#224; tous,J'ai plusieurs int&#233;rogations ... Le client &#224; souhaiter l'int&#233;gration d'un editeur Wysiwyg pour faire des mises &#22 integrer un editeur de texte dans un site [ par chat blanc ] Bonjour tout le monde;comment je peut intégrer un éditeur de texte ( comme celle de ce forum) <div class="m editeur d'article sur un site [ par 8livier ] bonjour,j'ai deux contraintes pour un site web:-il faut que je puisse avoir un editeur de texte me permettant d'ajouter des articles mis en forme, ave Obtenir un editeur bbcode comme l'editeur de PHPCS.COM dans mon site [ par fenomeno18 ] Salut à tous, je suis entrain de creer un petit site de partage de code sources, PHP/MYSQL/CSS, alors que j'ai besoin d'un bon editeur bbcode, surtout


Nos sponsors


Sondage...

Comparez les prix

CalendriCode

Février 2012
LMMJVSD
  12345
6789101112
13141516171819
20212223242526
272829    

Consulter la suite du CalendriCode

 
Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils.
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés

Google Coop CodeS-SourceS Google Coop CodeS-SourceS
Temps d'éxécution de la page : 4,056 sec (3)

Nous contacter | Annoncer sur CodeS-SourceS | Mentions légales