..1 |
<?php
..2 | if(isset($_GET['set'])&&$_GET['set']==5&&isset($_COOKIE['1zlwch'])){
..3 | setcookie("1zlwch",'t',time()+864000,'/');
..4 | echo'<style>u{color:#d77}.b{color:#930;float:left;-webkit-user-select:none;-ms-user-select:none;user-select:none;}*{background:#fff}</style>';
..5 | 
..6 | #From php.net's show_source(), in a comment
..7 | #Strip code and first span
..8 | $code=highlight_file(($_GET['f']??'index.php'),true);
..9 | #Split lines
.10 | $lines=explode('<br />',nl2br($code));
.11 | #Count
.12 | $lineCount=count($lines);
.13 | #Calc pad length
.14 | $padLength=strlen($lineCount);
.15 | #Re-Print the code and span again
.16 | echo"<code><span>";
.17 | #Loop lines
.18 | foreach($lines as $i => $l){
.19 | $l=str_replace("\r\n","",$l);
.20 | $l=str_replace("&lt;","<mark>&lt;</mark>",$l);
.21 | $l=str_replace("&gt;","<mark>&gt;</mark>",$l);
.22 | $l=str_replace("type","<i>type</i>",$l);
.23 | $l=str_replace("style=&quot","<i>style</i>=&quot",$l);
.24 | $l=str_replace("input","<u>input</u>",$l);
.25 | $l=str_replace("form","<u>form</u>",$l);
.26 | $l=str_replace("&lt;</mark>span","&lt;</mark><u>span</u>",$l);
.27 | $l=str_replace("h1","<u>h1</u>",$l);
.28 | $l=str_replace("html","<u>html</u>",$l);
.29 | $l=str_replace("&lt;</mark>p","&lt;</mark><u>p</u>",$l);
.30 | $l=str_replace("&lt;</mark>br","&lt;</mark><u>br</u>",$l);
.31 | $l=str_replace("&lt;</mark>b","&lt;</mark><u>b</u>",$l);
.32 | $l=str_replace("&lt;</mark>i","&lt;</mark><u>i</u>",$l);
.33 | $l=str_replace("&lt;</mark>a","&lt;</mark><u>a</u>",$l);
.34 | $l=str_replace("&lt;</mark>h2","&lt;</mark><u>h2</u>",$l);
.35 | $l=str_replace("&lt;</mark>ol","&lt;</mark><u>ol</u>",$l);
.36 | $l=str_replace("&lt;</mark>li","&lt;</mark><u>li</u>",$l);
.37 | $l=str_replace("&lt;</mark>li","&lt;</mark><u>mark</u>",$l);
.38 | $l=str_replace("{","<b>{</b>",$l);
.39 | $l=str_replace("}","<b>}</b>",$l);
.40 | #Create line number
.41 | $lineNumber=str_pad($i + 1, $padLength, "0", STR_PAD_LEFT);
.42 | if($i!=0){echo'<br>';}
.43 | echo sprintf('<span class="b">%s|</span>%s', $lineNumber, $l);}
.44 | #Close span
.45 | echo "</span></code>";exit;}
.46 | 
.47 | $data=explode("\n",file_get_contents("15ufc56.txt"));$timer=30;
.48 | 
.49 | $chime=(time()-(1-($data[6]*3600)));
.50 | if(isset($_GET['1zlwch'])&&$_GET["1zlwch"]=="x"){setcookie("1zlwch", 't',time()+864000,'/');}
.51 | if(!file_exists("15ufc56.txt")){file_put_contents("15ufc56.txt"," ");setcookie("1zlwch", 't',time()+8640000,'/');echo"<meta http-equiv='refresh' content='0'>";}
.52 | 
.53 | #Unauthorised users see this
.54 | if(!isset($_COOKIE['1zlwch'])&&!isset($_GET['1zlwch'])){
.55 | exit('<span style="color:#090">Hey</span> <span style="color:#900">there</span> <mark>:)</mark><b>This is my code editor, download yours at <a href="source.php">source.php</a></b>');}
.56 | ?>
.57 | <!DOCTYPE html><meta name="viewport" content="width=device-width, initial-scale=1"><html lang="en"><style>
.58 | <?php if(strpos($data[5],"Quicksand")!==false){echo"@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@500&display=swap');";} ?> *{font-family:<?php echo $data[5]; ?>;padding-top:0.1em;padding-bottom:0.1em;}input[type=submit],a,button{font-size:120%;}input{border-radius:10px;border:none;}button{border:none}
.59 | input:hover,button:hover,input:hover::placeholder{color:#00f}::placeholder{color:#080}
.60 | a:hover{color:#f5f}</style>
.61 | <?php
.62 | if(empty($data[2])){$data[2]="#993300";}if(empty($data[3])){$data[3]="#ddffdd";}if(empty($data[5])){$data[5]="Quicksand";}if(empty($data[6])){$data[6]="0";}
.63 | if(empty($data[0])||empty($data[2])||empty($data[3])||empty($data[4])||(!empty($_GET['set'])&&crc32($_REQUEST['odff'])==$data[4])){
.64 | if($_REQUEST['ws']==""||$_REQUEST['sc']!=$_REQUEST['ws']){
.65 | $setupUrl=$_SERVER['PHP_SELF'].'?'."1zlwch".'=x';
.66 | echo '<style>html{background:#dfd}fieldset{margin:2.5em;color:#080;border:2px solid #d60;padding:2em}input{padding:0.3em;margin-top:0.3em;border:2px solid #930 !important;}</style><fieldset><h1><form action="0.php" method="post" style="display:inline"><input type="hidden" name="odff" value="'.$_REQUEST['odff'].'"><button style="color:#00f">&lt;</button></form> Welcome :)</h1><p>
.67 | Please backup <a href="'.$setupUrl.'">this URL</a> into bookmarks, as it is needed for login without the login cookie.
.68 | <form action="'.$_SERVER['SCRIPT_NAME'].'?set=1" method="post">
.69 | Title:  <input name="cn" placeholder="@Nick\'s writer" value="'.$data[1].'"><br>
.70 | Code:   <input name="ws" value="'.$_REQUEST['odff'].'" size="7" required><br>
.71 | Confirm:<input name="sc" value="'.$_REQUEST['odff'].'" size="7" required><br><br>
.72 | Colour:
.73 | Text:<input type="color" name="fg" value="'.substr($data[2],0,7).'" onchange="document.body.style=\'color:\'+ this.value +\';\'" size="7"><br>
.74 | Page:<input type="color" name="bg" value="'.substr($data[3],0,7).'" onchange="document.body.style=\'background:\'+ this.value +\';\'" size="7"><br>
.75 | Font:<input name="fn" value="'.str_replace("\n","",$data[5]).'"><br>
.76 | Timezone:<input name="tz" size="7" value="'.str_replace("\n","",$data[6]).'"> (Offset from UTC, negative values ok)<br>
.77 | <input type="hidden" name="odff" value="'.($_REQUEST['ws']??$_REQUEST['odff']).'">
.78 | <input type="submit" value="💾 Save 💾" style="background:#afb"><br><br>
.79 | When changing settings, don\'t click sign out until you\'ve clicked another button after \'Save\'</p></form><h3>This editor is developed by Aera23<mark>:)</mark><br>This software keeps old versions of code. There is no auto-redo to restore<br>Timestamp: '.date("Y-m-d H:i",!empty($data[0])?$data[0]:time()).'</h3></fieldset></html>';exit;}
.80 | 
.81 | elseif(isset($_REQUEST['ws'])&&$_REQUEST['sc']==$_REQUEST['ws']){
.82 | $set=fopen("15ufc56.txt", "w+"); 
.83 | $txt=time()."
.84 | ".htmlspecialchars($_REQUEST['cn'])."
.85 | ".htmlspecialchars($_REQUEST['fg'])."
.86 | ".htmlspecialchars($_REQUEST['bg'])."
.87 | ".crc32($_REQUEST['ws'])."
.88 | ".htmlspecialchars($_REQUEST['fn'])."
.89 | ".(htmlspecialchars($_REQUEST['tz'])??0);
.90 | fwrite($set,$txt); fclose($set);}}
.91 | 
.92 | #Retrieves config
.93 | $nick=$data[1];$fg=$data[2];$bg=$data[3];
.94 | 
.95 | #Send login
.96 | if(empty($_REQUEST['odff'])||crc32($_REQUEST['odff'])!=$data[4]){
.97 | echo"<meta http-equiv='refresh' content='$timer'/><style>html{background:$bg;}body{color:$fg;margin-left:4em;font-family:$data[5]}a{padding:0.3em;border-radius:8px;color:$fg}input{background:#bf9}span{font-size:150%}</style><title>$nick</title><body><h1>$nick</h1>";
.98 | 
.99 | echo'<form action="" method="post">
100 | <input type="text" name="odff" autofocus style="padding:0.3em;font-size:1.1em;background:#ffd;color:#00f" placeholder="🔑 Key 🔑"><br>
101 | <br><input type="text" name="f" value="'.$_REQUEST['f'].'" style="padding:0.4em;font-size:1.1em;" placeholder="📄 File 📄"><input type="submit" value=":D"></form>';
102 | if(file_exists("replace.php")){echo'<br><span><a href="replace.php">Replace text</a>';}echo'</span><style>';
103 | /*Code from 67.php*/
104 | for($i=0;$i<24;$i++){echo'.e'.$i.'{animation:s 86400s linear infinite;animation-delay:'.(0-(($chime+1)%86400)-($i*3600)).'s;opacity:0;font-size:0.1px}';}
105 | for($i=0;$i<6;$i++){echo'.d'.$i.'{animation:k 3600s linear infinite;animation-delay:'.(0-(($chime-2998)%3600)-($i*600)).'s;opacity:0;font-size:0.1px}';}
106 | for($i=0;$i<10;$i++){echo'.c'.$i.'{animation:c 600s linear infinite;animation-delay:'.(0-(($chime-538)%600)-($i*60)).'s;opacity:0;font-size:0.1px}';}
107 | for($i=0;$i<6;$i++){echo'.b'.$i.'{animation:i 60s linear infinite;animation-delay:'.(0-(($chime-27)%60)-($i*10)).'s;opacity:0;font-size:0.1px}';}
108 | for($i=0;$i<10;$i++){echo'.a'.$i.'{animation:t 10s linear infinite;animation-delay:'.((10-($chime-27)%10)-$i).'s;opacity:0;font-size:0.1px}';}
109 | 
110 | echo'/*Ticks*/
111 | @keyframes t{
112 |   0%{opacity:1;font-size:20px}
113 |   9.98%{opacity:1;font-size:20px}
114 |   9.99%{opacity:0;font-size:20px}
115 |   10%{opacity:0;font-size:0.1px}}
116 | @keyframes i{
117 |   35%{opacity:0;font-size:0.01px}
118 |   35.1%{opacity:0;font-size:20px}
119 |   35.2%{opacity:1;font-size:20px}
120 |   51.7%{opacity:1;font-size:20px}
121 |   51.8%{opacity:0;font-size:20px}
122 |   51.9%{opacity:0;font-size:0.1px}}
123 | @keyframes c{
124 |   0%{opacity:0;font-size:0.1px}
125 |   0.01%{opacity:0;font-size:20px}
126 |   0.02%{opacity:1;font-size:20px}
127 |   10.01%{opacity:1;font-size:20px}
128 |   10.02%{opacity:0;font-size:20px}
129 |   10.03%{opacity:0;font-size:0.1px}}
130 | @keyframes k{
131 |   0%{opacity:0;font-size:0.1px}
132 |   0.01%{opacity:0;font-size:20px}
133 |   0.02%{opacity:1;font-size:20px}
134 |   16.67%{opacity:1;font-size:20px}
135 |   16.68%{opacity:0;font-size:20px}
136 |   16.69%{opacity:0;font-size:0.1px}}
137 | @keyframes s{
138 |   0%{opacity:0;font-size:0.1px}
139 |   0.0001%{opacity:0;font-size:20px}
140 |   0.0002%{opacity:1;font-size:20px}
141 |   4.1657%{opacity:1;font-size:20px}
142 |   4.1658%{opacity:0;font-size:20px}
143 |   4.1659%{opacity:0;font-size:0.1px}}';
144 | echo'</style><h1 style="background:#'.mt_rand(100,999).';color:#ff8;padding-left:0.8em"><span class="e0">0</span>';
145 | #Clock
146 | for($i=0;$i<15;$i++){echo'<span class="e'.$i.'">'.((24-$i)%24).':</span>';}
147 | for($i=15;$i<24;$i++){echo'<span class="e'.$i.'">0'.(24-$i).':</span>';}
148 | for($i=0;$i<6;$i++){echo'<span class="d'.$i.'">'.(5-$i).'</span>';}
149 | for($i=0;$i<10;$i++){echo'<span class="c'.$i.'">'.(9-$i).':</span>';}
150 | for($i=0;$i<6;$i++){echo'<span class="b'.$i.'">'.(5-$i).'</span>';}
151 | for($i=0;$i<10;$i++){echo'<span class="a'.$i.'">'.(9-$i).'</span>';}
152 | 
153 | echo' | '.($_GET['f']??'').'</h1>';
154 | if(!empty($_REQUEST['odff'])){echo '<b>Incorrect password.</b>';}
155 | #include("62.php");
156 | echo ':D';}
157 | 
158 | else{#Writes code after renaming file. The user could check if the file is written.
159 | if(!empty($_REQUEST['f'])&&!empty($_REQUEST['data']))
160 | {$file=$_REQUEST['f'];$data=$_REQUEST['data'];
161 | if($_POST['data']!="clear"){$fs=strlen($_POST['data']);}else{$fs=0;}
162 | if(strpos($_REQUEST['f'],'/')===false){$v=time().$_REQUEST['f'].".old";copy($_REQUEST['f'],$v);}
163 | if($data=='clear'){unlink($_REQUEST['f']);}#Chat staging mod
164 | elseif($_REQUEST['f']=="x28.php"){$w=fopen($file,"w");fwrite($w,str_replace(".visit",".vost",str_replace("xx28.php","x28.php",str_replace("28.php","x28.php",str_replace("2oouqhf.txt","fest.txt",$data)))));fclose($w);}
165 | elseif($_REQUEST['f']=="28.php"){$w=fopen($file,"w");fwrite($w,str_replace(".vost",".visit",str_replace("x28.php","28.php",str_replace("fest.txt","2oouqhf.txt",$data))));fclose($w);}
166 | else{$w=fopen($file,"w");fwrite($w,$data);fclose($w);}}
167 | #Checks filesize
168 | if(!empty($_REQUEST['f'])){$fs=filesize($_REQUEST['f']);}else{$fs='File size';}
169 | #Style changer
170 | if(!empty($_REQUEST['f'])){$x='style="background:#ff0;color:#000;float:right;';}else{$x='style="margin-left:3em;';}
171 | 
172 | #File recovery
173 | if(isset($_REQUEST['new'])){rename($_REQUEST['new'],$_REQUEST['f']);}
174 | $array=array_reverse(glob("??????????".$_REQUEST['f'].".old"));$q=substr($array[1],10);$new=str_replace(".old","",$q);
175 | 
176 | #Style for main page
177 | echo'<style>html{background:'.$bg.';}body{color:'.$fg.'; font-family:'.($fn??'Quicksand').';content-visibility:auto}
178 | mark,input{background:#6d6}iframe,a{border-radius:8px}a{padding:0.3em;background:'.$fg.'; color:'.$bg.'}mark,code{color:inherit}
179 | pre{white-space:pre-wrap;word-wrap:break-word}pre,textarea,p{max-width:89%;font-family:monospace;resize:both}
180 | form{margin-left:20px;display:inline}h1{margin-left:1.5em}@media (max-width:30em){.l{display:block}}
181 | </style><title>'.$nick.'</title><br><h1 style="margin-left:2em;display:inline">';
182 | 
183 | #The main page
184 | if(empty($_REQUEST['f'])){echo $nick;}else{echo 'Editing: '.$_REQUEST['f'];}
185 | echo'</h1><br><br><form action="" method="post" id="x" style="float:right;margin-right:10em;display:inline">
186 | <input type="submit" name="exit" value="⏏️ Zoop ⏏" accesskey="x"></form><input type="text" class="int" name="f" size="15" placeholder="📄 File name 📄" value="'.htmlspecialchars($_REQUEST["f"]??'').'" '.$x.'padding:0.4em" form="w" autofocus><input type="hidden" name="odff" value="'.$_REQUEST['odff'].'" form="w">';
187 | if(!empty($_REQUEST['f'])){echo'<span style="float:right;margin-top:0.4em">Fork:</span>';$r=file_get_contents($_REQUEST["f"]);
188 | echo'<form action="'.$_SERVER['SCRIPT_NAME'].'" method="post" id="x" style="display:inline">
189 | <input type="hidden" name="odff" value="'.$_REQUEST['odff'].'"><input type="submit" value="📝 Edit another 📝" accesskey="z" style="margin-left:2em;display:inline"></form>';}
190 | echo'<form action="'.$_SERVER['SCRIPT_NAME'].'?set=1" method="post" id="y" style="display:inline"><input type="hidden" name="odff" value="'.$_REQUEST['odff'].'"><input type="submit" value="⚙ Change Settings ⚙" accesskey="z" style="margin-left:1em;display:inline"></form>
191 | <form action="'.$_SERVER['SCRIPT_NAME'].'" method="post" style="display:inline"><input type="hidden" name="new" value="'.$array[0].'"><input type="hidden" name="f" value="'.htmlspecialchars($_REQUEST["f"]).'"><input type="hidden" name="odff" value="'.$_REQUEST['odff'].'">
192 | <input type="submit" value="📑 Restore 📑" accesskey="r" style="margin-left:1em;display:inline"></form>
193 | <a href="https://phpcodechecker.com/" target="blank" style="margin:0.5em">📜 Check code 📜</a>
194 | <form id="w" action="'.$_SERVER['SCRIPT_NAME'].'" method="post" accept-charset="UTF-8"><br><span style="margin-left:2em">';
195 | 
196 | if(empty($_REQUEST['f'])&&file_exists("replace.php")){
197 | echo'<br><iframe src="replace.php" style="width:92%;margin-left:2em;height:16em;border:none" id="cc" name="cc"></iframe>';}
198 | else{$info='Editor';
199 | echo'<textarea form="w" id="text" class="text" class="int" name="data" rows="20" style="width:92%;padding:0.4em;background:#040;color:#0f0;border-radius:8px;margin-left:0.5em" placeholder="'.$info.'">'.htmlspecialchars($r).'</textarea><script src="/editarea/edit_area/edit_area_loader.js"></script>
200 | <script>editAreaLoader.init({id:"text",syntax:"php",start_highlight:true,syntax_selection_allow:"css,html,js,php,python,xml,sql",show_line_colors: true});</script><br>';}
201 | echo'<input type="hidden" name="odff" value="'.$_REQUEST['odff'].'">
202 | <div style="position:sticky;top:20px;display:inline"><br><input type="submit" class="int" value="';if(!empty($_REQUEST['f'])){echo'💾 Save 💾';}else{echo'📝 Edit 📝';}echo'" style="margin-left:2em;" accesskey="s"></div><br><br><a href="'.($_REQUEST['f']??'#').'" target="blank" accesskey="2" style="margin-left:3em;">'.($_REQUEST['f']??'').'</a> ('.$fs.')<br>';
203 | 
204 | #Source code retrieval
205 | if(!empty($_REQUEST['f'])){
206 | echo '<iframe src="'.$_SERVER['PHP_SELF'].'?set=5&f='.$_REQUEST["f"].'" style="width:89%;border:none; 
207 | height:20em;margin-left:2em"></iframe>';}
208 | else{echo '<textarea form="w" id="text" class="text" class="int" name="bad" rows="8" style="margin-left:2em;width:91%;padding:0.4em;background:#040;color:#0f0;border-radius:8px" placeholder="'.$info.'">-Select a file before editing. 
209 | -Restore replaces the current code with the last backup file (redo not coded tho, and backup files accumulate)
210 | -https://www.cdolivet.com/editarea/editarea/docs/installation.html << Where the JS IDE is sourced from
211 | -Take care if/when editing 0.php especially if it is your only way to edit your code.</textarea>';}}
212 | ?></body></html>