Recent Edits
i want to display two values in asp.net.
the value is print like 500 61,there is a space between the values.
how can i get ...
» complete changei want to display two values in asp.net.
the value is print like 500 61,there is a space between the values.
how can i get this space code
java code
<?
////////////////////////////////////////////////////////////////////////////
// OneFilePersonalDesktop //
////////////////////////////////////////////////////////////////////////////...
<?
////////////////////////////////////////////////////////////////////////////
// OneFilePersonalDesktop //
////////////////////////////////////////////////////////////////////////////
// made by erwandivers@yahoo.fr
//
$language="en"; //only one data to modify
//--data--------------
$title="Bureau";
$postit_1_title="Post-it 1";
$postit_1_content="test";
$bookmarks_1_url="http://www.framasoft.net";
$bookmarks_1_title="Framasoft";
//-----------------------
//--internationalisation--
$menu["en"]=array("home"=>"Home","postit"=>"Post-it","bookmarks"=>"Bookmarks");
$messages["en"]["waiting"]="Waiting...";
$messages["en"]["newPostitTitle"]="New post-it";
$messages["en"]["newPostitContent"]="Content";
$messages["en"]["newSiteUrl"]="New site";
//---- français -----------
$menu["fr"]=array("home"=>"Accueil","postit"=>"Post-it","bookmarks"=>"Favoris");
$messages["fr"]["waiting"]="Modification en cours";
$messages["fr"]["newPostitTitle"]="Nouvelle note";
$messages["fr"]["newPostitContent"]="Contenu";
$messages["fr"]["newSiteUrl"]="Nouveau site";
//------------------------
$file = basename ($_SERVER["PHP_SELF"]);
$content = file_get_contents($file);
setlocale (LC_ALL, 'fr_FR');
$_POST=array_map("utf8_decode",$_POST);
//call the function choiced in menu
if(isset($_POST["el_e_ment"])){
eval("echo ".$_POST["el_e_ment"]."();");
exit();
}
//update or delete a var
foreach($_POST as $key=>$value){
echo $value;
switch($_POST["action"]){
case "delete":
deleteParam($key);
break;
default:
updateParam($key,$value);
}
exit();
}
function updateParam($param,$value){
global $content,$file;
$newContent=preg_replace('`\$'.$param.'=.*;`','\$'.$param.'="'.$value.'";',$content,1);
if($content==$newContent){
$newContent=preg_replace('`//-----------------------`',"$".$param."=\"".$value."\";\n//-----------------------",$content,1);
}
file_put_contents($file,$newContent);
}
function deleteParam($param){
global $content,$file;
$newContent=preg_replace('`\$'.$param.'=.*;`','',$content,1);
file_put_contents($file,$newContent);
}
function menu(){
global $language,$menu;
$text="";
$text.= "<div id=\"menu\">
<ul>";
foreach($menu[$language] as $key=>$value){
$text.= "<li onClick=\"printPost('$key')\">".$value."</li>\n";
}
$text.= " </ul>
</div>\n";
return $text;
}
function home(){
return "";
}
function postit(){
global $menu,$language,$messages;
$text="<h2>".$menu[$language]["postit"]."</h2>";
$text.="<ul>\n";
$continue=true;$i=1;
while($continue){
$string="global \$postit_".$i."_title,\$postit_".$i."_content; return isset(\$postit_".$i."_title);";
if(eval($string)=="1"){
$text.="<li><span id=\"postit_".$i."_title\" onClick=\"update(this,'text')\">".eval("return \$postit_".$i."_title;")."</span>\n";
$text.=" :<br /><span id=\"postit_".$i."_content\" onClick=\"update(this,'zone')\">".eval("return nl2br(\$postit_".$i."_content);")."<span></li>\n";
$i++;
}else{
$continue=false;
}
}
$text.="<li><span id=\"postit_".$i."_title\" onClick=\"update(this,'text')\">".$messages[$language]["newPostitTitle"]."</span>\n";
$text.=" :<br /><span id=\"postit_".$i."_contentu\" onClick=\"update(this,'zone')\">".$messages[$language]["newPostitContent"]."</li>\n";
$text.="</ul>\n";
return $text;
}
function bookmarks(){
global $menu,$language,$messages;
$text="<h2>".$menu[$language]["bookmarks"]."</h2>";
$text.="<ul>\n";
$continue=true;$i=1;
while($continue){
$string="global \$bookmarks_".$i."_url,\$bookmarks_".$i."_title,\$bookmarks_".$i."_content,\$favoris_".$i."_keywordss; return isset(\$bookmarks_".$i."_url);";
if(eval($string)=="1"){
$text.="<li><span id=\"bookmarks_".$i."_title\"
onClick=\"update(this,'text')\"
>".eval("return \$bookmarks_".$i."_title;")."</span>\n
<a href=\"".eval("return \$bookmarks_".$i."_url;")."\">@</a>
<span id=\"bookmarks_".$i."_url\" onClick=\"update(this,'text')\" style=\"font-size:x-small;font-style:italic\"
>".eval("return \$bookmarks_".$i."_url;")."</span>\n";
$text.="<br /><span id=\"bookmarks_".$i."_content\" onClick=\"update(this,'zone')\">".eval("return nl2br(\$bookmarks_".$i."_content);")."<span></li>\n";
$i++;
}else{
$continue=false;
}
}
$text.="<li><span id=\"bookmarks_".$i."_url\" onClick=\"update(this,'text')\">".$messages[$language]["newSiteUrl"]."</span>\n";
$text.="</ul>\n";
return $text;
}
echo "
<html>
<head>
<style type=\"text/css\">
body{
background-color:#0d3950;
color:#cbb26e;
margin-left:100px;
padding:0px 10px 10px 10px;
border-left:thin solid #e2386b;
font-family:Arial;
height:100%
}
body a{
color:#cbb26e;
}
.title{
font-size:x-large;
border-left:thin solid;
border-bottom:thin solid;
padding-left:5px;
}
#waiting{
position:absolute;
right:10px;
top:10px;
}
#menu ul{
margin-left:-10px;
}
#menu ul li{
color:#e2386b;
list-style-type: none;
padding:0px 5px 0px 5px;
margin-left:-5px;
display:inline;
border-left : thin solid;
border-right : thin solid;
}
#menu ul li:hover{
background-color:#e2386b;
color:#0d3950;
cursor:pointer;
}
#content{
position:relative;
border-top:thin solid;
border-left:thin solid;
}
#content h2{
margin:0px;
border-bottom : thin dashed;
}
</style>
<script>
function update(element,type){
content=element.innerHTML;
switch(type){
case 'text' :
element.innerHTML=\"<input name='\"+element.id+\"' type='text' value='\"+content+\"' onClick='' onChange='post(this)'>\";
break;
case 'zone' :
element.innerHTML=\"<textarea cols=20 rows=4 name='\"+element.id+\"' onClick='' onChange='post(this)'>\"+content.replace(/<br>/,String.fromCharCode(13))+\"</textarea>\";
break;
}
element.focus();
element.onClick='element.value=\"content\"';
}
function post(element){
document.getElementById(\"waiting\").style.visibility='visible';
p = new XMLHttpRequest();
p.onload = null;
p.open(\"POST\",\"$file\", false);
p.setRequestHeader(\"Content-type\",\"application/x-www-form-urlencoded\");
var corps = element.name+\"=\"+element.value;
p.send(corps);
//alert(corps);
if (p.status != \"200\") {
alert(\"Réception erreur\" + p.status);
}else {
document.getElementById(element.name).innerHTML=p.responseText;
if(element.name=='titre'){
document.title=p.responseText;
}
}
document.getElementById(\"waiting\").style.visibility='hidden';
}
function printPost(element){
document.getElementById(\"waiting\").style.visibility='visible';
p = new XMLHttpRequest();
p.onload = null;
p.open(\"POST\",\"$file\", false);
p.setRequestHeader(\"Content-type\",\"application/x-www-form-urlencoded\");
var corps = \"el_e_ment=\"+element;
p.send(corps);
//alert(corps);
if (p.status != \"200\") {
alert(\"Réception erreur\" + p.status);
}else {
document.getElementById('content').innerHTML=p.responseText;
}
document.getElementById(\"waiting\").style.visibility='hidden';
}
function afficher(element){
document.getElementById('content').innerHTML=document.getElementById(element).innerHTML;
}
</script>
<title>$title</title>
</head>
<body>
<div id=\"title\" class=\"title\" onClick=\"modifier(this,'text')\">$title</div>
<span id=\"waiting\" style=\"display:none\">".$messages[$language]["waiting"]."</span>
".menu()."
<div id=\"content\"></div>
</body>
</html>
\n";
<?
////////////////////////////////////////////////////////////////////////////
// OneFilePersonalDesktop //
////////////////////////////////////////////////////////////////////////////...
» complete change<?
////////////////////////////////////////////////////////////////////////////
// OneFilePersonalDesktop //
////////////////////////////////////////////////////////////////////////////
// made by erwandivers@yahoo.fr
//
$language="en"; //only one data to modify
//--data--------------
$title="Bureau";
$postit_1_title="Post-it 1";
$postit_1_content="test";
$bookmarks_1_url="http://www.framasoft.net";
$bookmarks_1_title="Framasoft";
//-----------------------
//--internationalisation--
$menu["en"]=array("home"=>"Home","postit"=>"Post-it","bookmarks"=>"Bookmarks");
$messages["en"]["waiting"]="Waiting...";
$messages["en"]["newPostitTitle"]="New post-it";
$messages["en"]["newPostitContent"]="Content";
$messages["en"]["newSiteUrl"]="New site";
//---- français -----------
$menu["fr"]=array("home"=>"Accueil","postit"=>"Post-it","bookmarks"=>"Favoris");
$messages["fr"]["waiting"]="Modification en cours";
$messages["fr"]["newPostitTitle"]="Nouvelle note";
$messages["fr"]["newPostitContent"]="Contenu";
$messages["fr"]["newSiteUrl"]="Nouveau site";
//------------------------
$file = basename ($_SERVER["PHP_SELF"]);
$content = file_get_contents($file);
setlocale (LC_ALL, 'fr_FR');
$_POST=array_map("utf8_decode",$_POST);
//call the function choiced in menu
if(isset($_POST["el_e_ment"])){
eval("echo ".$_POST["el_e_ment"]."();");
exit();
}
//update or delete a var
foreach($_POST as $key=>$value){
echo $value;
switch($_POST["action"]){
case "delete":
deleteParam($key);
break;
default:
updateParam($key,$value);
}
exit();
}
function updateParam($param,$value){
global $content,$file;
$newContent=preg_replace('`\$'.$param.'=.*;`','\$'.$param.'="'.$value.'";',$content,1);
if($content==$newContent){
$newContent=preg_replace('`//-----------------------`',"$".$param."=\"".$value."\";\n//-----------------------",$content,1);
}
file_put_contents($file,$newContent);
}
function deleteParam($param){
global $content,$file;
$newContent=preg_replace('`\$'.$param.'=.*;`','',$content,1);
file_put_contents($file,$newContent);
}
function menu(){
global $language,$menu;
$text="";
$text.= "<div id=\"menu\">
<ul>";
foreach($menu[$language] as $key=>$value){
$text.= "<li onClick=\"printPost('$key')\">".$value."</li>\n";
}
$text.= " </ul>
</div>\n";
return $text;
}
function home(){
return "";
}
function postit(){
global $menu,$language,$messages;
$text="<h2>".$menu[$language]["postit"]."</h2>";
$text.="<ul>\n";
$continue=true;$i=1;
while($continue){
$string="global \$postit_".$i."_title,\$postit_".$i."_content; return isset(\$postit_".$i."_title);";
if(eval($string)=="1"){
$text.="<li><span id=\"postit_".$i."_title\" onClick=\"update(this,'text')\">".eval("return \$postit_".$i."_title;")."</span>\n";
$text.=" :<br /><span id=\"postit_".$i."_content\" onClick=\"update(this,'zone')\">".eval("return nl2br(\$postit_".$i."_content);")."<span></li>\n";
$i++;
}else{
$continue=false;
}
}
$text.="<li><span id=\"postit_".$i."_title\" onClick=\"update(this,'text')\">".$messages[$language]["newPostitTitle"]."</span>\n";
$text.=" :<br /><span id=\"postit_".$i."_contentu\" onClick=\"update(this,'zone')\">".$messages[$language]["newPostitContent"]."</li>\n";
$text.="</ul>\n";
return $text;
}
function bookmarks(){
global $menu,$language,$messages;
$text="<h2>".$menu[$language]["bookmarks"]."</h2>";
$text.="<ul>\n";
$continue=true;$i=1;
while($continue){
$string="global \$bookmarks_".$i."_url,\$bookmarks_".$i."_title,\$bookmarks_".$i."_content,\$favoris_".$i."_keywordss; return isset(\$bookmarks_".$i."_url);";
if(eval($string)=="1"){
$text.="<li><span id=\"bookmarks_".$i."_title\"
onClick=\"update(this,'text')\"
>".eval("return \$bookmarks_".$i."_title;")."</span>\n
<a href=\"".eval("return \$bookmarks_".$i."_url;")."\">@</a>
<span id=\"bookmarks_".$i."_url\" onClick=\"update(this,'text')\" style=\"font-size:x-small;font-style:italic\"
>".eval("return \$bookmarks_".$i."_url;")."</span>\n";
$text.="<br /><span id=\"bookmarks_".$i."_content\" onClick=\"update(this,'zone')\">".eval("return nl2br(\$bookmarks_".$i."_content);")."<span></li>\n";
$i++;
}else{
$continue=false;
}
}
$text.="<li><span id=\"bookmarks_".$i."_url\" onClick=\"update(this,'text')\">".$messages[$language]["newSiteUrl"]."</span>\n";
$text.="</ul>\n";
return $text;
}
echo "
<html>
<head>
<style type=\"text/css\">
body{
background-color:#0d3950;
color:#cbb26e;
margin-left:100px;
padding:0px 10px 10px 10px;
border-left:thin solid #e2386b;
font-family:Arial;
height:100%
}
body a{
color:#cbb26e;
}
.title{
font-size:x-large;
border-left:thin solid;
border-bottom:thin solid;
padding-left:5px;
}
#waiting{
position:absolute;
right:10px;
top:10px;
}
#menu ul{
margin-left:-10px;
}
#menu ul li{
color:#e2386b;
list-style-type: none;
padding:0px 5px 0px 5px;
margin-left:-5px;
display:inline;
border-left : thin solid;
border-right : thin solid;
}
#menu ul li:hover{
background-color:#e2386b;
color:#0d3950;
cursor:pointer;
}
#content{
position:relative;
border-top:thin solid;
border-left:thin solid;
}
#content h2{
margin:0px;
border-bottom : thin dashed;
}
</style>
<script>
function update(element,type){
content=element.innerHTML;
switch(type){
case 'text' :
element.innerHTML=\"<input name='\"+element.id+\"' type='text' value='\"+content+\"' onClick='' onChange='post(this)'>\";
break;
case 'zone' :
element.innerHTML=\"<textarea cols=20 rows=4 name='\"+element.id+\"' onClick='' onChange='post(this)'>\"+content.replace(/<br>/,String.fromCharCode(13))+\"</textarea>\";
break;
}
element.focus();
element.onClick='element.value=\"content\"';
}
function post(element){
document.getElementById(\"waiting\").style.visibility='visible';
p = new XMLHttpRequest();
p.onload = null;
p.open(\"POST\",\"$file\", false);
p.setRequestHeader(\"Content-type\",\"application/x-www-form-urlencoded\");
var corps = element.name+\"=\"+element.value;
p.send(corps);
//alert(corps);
if (p.status != \"200\") {
alert(\"Réception erreur\" + p.status);
}else {
document.getElementById(element.name).innerHTML=p.responseText;
if(element.name=='titre'){
document.title=p.responseText;
}
}
document.getElementById(\"waiting\").style.visibility='hidden';
}
function printPost(element){
document.getElementById(\"waiting\").style.visibility='visible';
p = new XMLHttpRequest();
p.onload = null;
p.open(\"POST\",\"$file\", false);
p.setRequestHeader(\"Content-type\",\"application/x-www-form-urlencoded\");
var corps = \"el_e_ment=\"+element;
p.send(corps);
//alert(corps);
if (p.status != \"200\") {
alert(\"Réception erreur\" + p.status);
}else {
document.getElementById('content').innerHTML=p.responseText;
}
document.getElementById(\"waiting\").style.visibility='hidden';
}
function afficher(element){
document.getElementById('content').innerHTML=document.getElementById(element).innerHTML;
}
</script>
<title>$title</title>
</head>
<body>
<div id=\"title\" class=\"title\" onClick=\"modifier(this,'text')\">$title</div>
<span id=\"waiting\" style=\"display:none\">".$messages[$language]["waiting"]."</span>
".menu()."
<div id=\"content\"></div>
</body>
</html>
\n";
