Просмотр файла topocolors.php

Размер файла: 24.32Kb
  1. <?php
  2. //
  3. // topocolors.php
  4. // rev005
  5. //
  6. include('config.php');
  7. include('lang/'.$idioma.'.php');
  8. include('funciones.php');
  9.  
  10. function extraer($para) {
  11. global $background, $textcolor;
  12. $linea=file('css/'.$para);
  13. foreach($linea as $value) {
  14. if(stristr($value,'TOPo')) {
  15. $aux=explode('TOPo',$value);
  16. if($aux[1]=='background') $background[$aux[2]]=$aux[3];
  17. if($aux[1]=='textcolor') $textcolor[$aux[2]]=$aux[3];
  18. }
  19. }
  20. for($i=0;$i<=8;$i++) {
  21. if(!isset($background[$i])) return 0;
  22. if(!isset($textcolor[$i])) return 0;
  23. }
  24. return 1;
  25. }
  26.  
  27. if($pass!=$adminPass OR $login!=$adminLogin) {
  28. $modo="666";
  29. if($pass!="") $HTML.='<br><center><span class="titulo">Incorrect user/pass !!!</span></center>';
  30. $HTML.='<form action="admin.php" method="post">';
  31. $HTML.='<table align="center" border="0" bgcolor="Black" cellspacing="1" cellpadding="5">';
  32. $HTML.='<caption><span class="titulo">'.$_LoginScreen_.'</span></caption>';
  33. $HTML.='<tr class="1"><td align="right" class="texto0">'.$_Login_.'</td><td><INPUT TYPE="text" name="login" size="40"></td></tr>';
  34. $HTML.='<tr class="0"><td align="right" class="texto0">'.$_Pass_.'</td><td class="minitexto0"><INPUT TYPE="password" name="pass" maxlength="50" size="40"></tr>';
  35. $HTML.='<INPUT TYPE="HIDDEN" name="modo" value="frames">';
  36. $HTML.='<tr class="1"><td>&nbsp;</td><td><input type="submit" class="boton"></td></tr>';
  37. $HTML.='</table></form>';
  38. setcookie("cookieLogin",$adminLogin,time()+1800,"/");
  39. setcookie("cookiePass",$adminPass,time()+1800,"/");
  40. }
  41.  
  42. if(isset($background[rand(0,8)]) AND isset($textcolor[rand(0,8)])) {
  43. //Comprobamos integridad y rellenamos huecos
  44. } else {
  45. //Cargamos variables desde $fileCSS
  46. if(!isset($fileCSS)) $fileCSS='topo.css';
  47. if(!extraer($fileCSS)) {
  48. $HTML.='<p class="titulo" align="center">'.$_InvalidCSS_.'</p>';
  49. $modo=$_Load_;
  50. }
  51. }
  52.  
  53. //Generamos archivo CSS con variables cargadas.
  54. $CSS="/* Please, edit this file using TOPoColors in the Control Panel */";
  55. $CSS.="BODY {\n";
  56. $CSS.=" background-repeat : no-repeat;\n";
  57. $CSS.=" background-position : center;\n";
  58. $CSS.=" background-color: ".$background[3]."; /*TOPobackgroundTOPo3TOPo".$background[3]."TOPo*/\n";
  59. $CSS.=" margin : 1px;\n";
  60. $CSS.=" font-family : Arial;\n";
  61. $CSS.=" font-size : 12px;\n";
  62. $CSS.=" color : ".$textcolor[0]."; /*TOPotextcolorTOPo0TOPo".$textcolor[0]."TOPo*/\n";
  63. $CSS.=" font-weight : bold;\n";
  64. $CSS.="}\n";
  65. $CSS.="A:LINK, A:ACTIVE, A:FOCUS, A:VISITED {\n";
  66. $CSS.=" font-weight : bold;\n";
  67. $CSS.=" color : ".$textcolor[5]."; /*TOPotextcolorTOPo5TOPo".$textcolor[5]."TOPo*/\n";
  68. $CSS.="}\n";
  69. $CSS.="A:HOVER {\n";
  70. $CSS.=" text-decoration : underline;\n";
  71. $CSS.=" color : ".$textcolor[6]."; /*TOPotextcolorTOPo6TOPo".$textcolor[6]."TOPo*/\n";
  72. $CSS.="}\n";
  73. $CSS.="TABLE.estructura {\n";
  74. $CSS.=" background-color : ".$background[3]."; /*TOPobackgroundTOPo3TOPo".$background[3]."TOPo*/\n";
  75. $CSS.="}\n";
  76. $CSS.="TABLE {\n";
  77. $CSS.=" background-color : ".$background[2]."; /*TOPobackgroundTOPo2TOPo".$background[2]."TOPo*/\n";
  78. $CSS.="}\n";
  79. $CSS.="TD.2 {\n";
  80. $CSS.=" background-color : ".$background[2]."; /*TOPobackgroundTOPo2TOPo".$background[2]."TOPo*/\n";
  81. $CSS.="}\n";
  82. $CSS.="TD.1 {\n";
  83. $CSS.=" background-color : ".$background[1]."; /*TOPobackgroundTOPo1TOPo".$background[1]."TOPo*/\n";
  84. $CSS.="}\n";
  85. $CSS.="TD.0 {\n";
  86. $CSS.=" background-color : ".$background[0]."; /*TOPobackgroundTOPo0TOPo".$background[0]."TOPo*/\n";
  87. $CSS.="}\n";
  88. $CSS.="TR.2 {\n";
  89. $CSS.=" background-color : ".$background[2]."; /*TOPobackgroundTOPo2TOPo".$background[2]."TOPo*/\n";
  90. $CSS.="}\n";
  91. $CSS.="TR.1 {\n";
  92. $CSS.=" background-color : ".$background[1]."; /*TOPobackgroundTOPo1TOPo".$background[1]."TOPo*/\n";
  93. $CSS.="}\n";
  94. $CSS.="TR.0 {\n";
  95. $CSS.=" background-color : ".$background[0]."; /*TOPobackgroundTOPo0TOPo".$background[0]."TOPo*/\n";
  96. $CSS.="}\n";
  97. $CSS.="INPUT {\n";
  98. $CSS.=" background-color : ".$background[6]."; /*TOPobackgroundTOPo6TOPo".$background[6]."TOPo*/\n";
  99. $CSS.=" color : ".$textcolor[4]."; /*TOPotextcolorTOPo4TOPo".$textcolor[4]."TOPo*/\n";
  100. $CSS.=" border : 2px ridge Black;\n";
  101. $CSS.=" font-size : 10px;\n";
  102. $CSS.=" font-family : Verdana, Arial;\n";
  103. $CSS.=" font-weight : normal;\n";
  104. $CSS.="}\n";
  105. $CSS.="INPUT.boton {\n";
  106. $CSS.=" background-color : ".$background[7]."; /*TOPobackgroundTOPo7TOPo".$background[7]."TOPo*/\n";
  107. $CSS.=" color : ".$textcolor[7]."; /*TOPotextcolorTOPo7TOPo".$textcolor[7]."TOPo*/\n";
  108. $CSS.=" border : 1px ridge ".$background[7]."; /*TOPobackgroundTOPo7TOPo".$background[7]."TOPo*/\n";
  109. $CSS.=" font : Arial;\n";
  110. $CSS.=" font-size : 12px;\n";
  111. $CSS.=" font-weight : bold;\n";
  112. $CSS.=" height : auto;\n";
  113. $CSS.="}\n";
  114. $CSS.="INPUT.reloj {\n";
  115. $CSS.=" background-color : ".$background[0]."; /*TOPobackgroundTOPo0TOPo".$background[0]."TOPo*/\n";
  116. $CSS.=" border-style: none;\n";
  117. $CSS.=" font-family : Arial;\n";
  118. $CSS.=" font-size : 12px;\n";
  119. $CSS.=" font-weight : bold;\n";
  120. $CSS.=" color : ".$textcolor[0]."; /*TOPotextcolorTOPo0TOPo".$textcolor[0]."TOPo*/\n";
  121. $CSS.=" height : auto;\n";
  122. $CSS.="}\n";
  123. $CSS.="INPUT.miniboton {\n";
  124. $CSS.=" background-color : ".$background[8]."; /*TOPobackgroundTOPo8TOPo".$background[8]."TOPo*/\n";
  125. $CSS.=" color : ".$textcolor[8]."; /*TOPotextcolorTOPo8TOPo".$textcolor[8]."TOPo*/\n";
  126. $CSS.=" border : 1px ridge ".$background[8]."; /*TOPobackgroundTOPo8TOPo".$background[8]."TOPo*/\n";
  127. $CSS.=" font-size : 9px;\n";
  128. $CSS.=" font-weight : bold;\n";
  129. $CSS.=" height : auto;\n";
  130. $CSS.=" font : Arial;\n";
  131. $CSS.="}\n";
  132. $CSS.="TEXTAREA {\n";
  133. $CSS.=" background-color : ".$background[6]."; /*TOPobackgroundTOPo6TOPo".$background[6]."TOPo*/\n";
  134. $CSS.=" color : ".$textcolor[4]."; /*TOPotextcolorTOPo4TOPo".$textcolor[4]."TOPo*/\n";
  135. $CSS.=" border : 2px ridge Black;\n";
  136. $CSS.=" font-size : smaller;\n";
  137. $CSS.=" font-family : Verdana, Arial;\n";
  138. $CSS.="}\n";
  139. $CSS.="SELECT {\n";
  140. $CSS.=" background-color : ".$background[6]."; /*TOPobackgroundTOPo6TOPo".$background[6]."TOPo*/\n";
  141. $CSS.=" color : ".$textcolor[4]."; /*TOPotextcolorTOPo4TOPo".$textcolor[4]."TOPo*/\n";
  142. $CSS.=" border : 2px ridge Black;\n";
  143. $CSS.=" font-size : 10px;\n";
  144. $CSS.=" font-family : Verdana, Arial;\n";
  145. $CSS.=" font-weight : normal;\n";
  146. $CSS.="}\n";
  147. $CSS.="OPTION.enable {\n";
  148. $CSS.=" background-color : #77FF77;\n";
  149. $CSS.=" font-weight : bold;\n";
  150. $CSS.=" color : Black;\n";
  151. $CSS.="}\n";
  152. $CSS.="OPTION.disable {\n";
  153. $CSS.=" background-color : #FF7777;\n";
  154. $CSS.=" font-weight : bold;\n";
  155. $CSS.=" color : Black;\n";
  156. $CSS.="}\n";
  157. $CSS.=".titulo {\n";
  158. $CSS.=" font-family : Arial;\n";
  159. $CSS.=" font-size : 16px;\n";
  160. $CSS.=" font-weight : bold;\n";
  161. $CSS.=" color : ".$textcolor[2]."; /*TOPotextcolorTOPo2TOPo".$textcolor[2]."TOPo*/\n";
  162. $CSS.="}\n";
  163. $CSS.=".minititulo {\n";
  164. $CSS.=" font-family : Arial;\n";
  165. $CSS.=" font-size : 12px;\n";
  166. $CSS.=" font-weight : bold;\n";
  167. $CSS.=" color : ".$textcolor[2]."; /*TOPotextcolorTOPo2TOPo".$textcolor[2]."TOPo*/\n";
  168. $CSS.="}\n";
  169. $CSS.=".texto0 {\n";
  170. $CSS.=" font-family : Arial;\n";
  171. $CSS.=" font-size : 12px;\n";
  172. $CSS.=" font-weight : bold;\n";
  173. $CSS.=" color : ".$textcolor[0]."; /*TOPotextcolorTOPo0TOPo".$textcolor[0]."TOPo*/\n";
  174. $CSS.="}\n";
  175. $CSS.=".texto1 {\n";
  176. $CSS.=" font-family : Arial;\n";
  177. $CSS.=" font-size : 12px;\n";
  178. $CSS.=" font-weight : bold;\n";
  179. $CSS.=" color : ".$textcolor[1]."; /*TOPotextcolorTOPo1TOPo".$textcolor[1]."TOPo*/\n";
  180. $CSS.="}\n";
  181. $CSS.=".minitexto0 {\n";
  182. $CSS.=" font-family : Arial;\n";
  183. $CSS.=" font-size : 8pt;\n";
  184. $CSS.=" font-weight : normal;\n";
  185. $CSS.=" color : ".$textcolor[0]."; /*TOPotextcolorTOPo0TOPo".$textcolor[0]."TOPo*/\n";
  186. $CSS.="}\n";
  187. $CSS.=".minitexto1 {\n";
  188. $CSS.=" font-family : Arial;\n";
  189. $CSS.=" font-size : 8pt;\n";
  190. $CSS.=" font-weight : normal;\n";
  191. $CSS.=" color : ".$textcolor[1]."; /*TOPotextcolorTOPo1TOPo".$textcolor[1]."TOPo*/\n";
  192. $CSS.="}\n";
  193. $CSS.=".in {\n";
  194. $CSS.=" font-family : Arial;\n";
  195. $CSS.=" color : ".$background[4]."; /*TOPobackgroundTOPo4TOPo".$background[4]."TOPo*/\n";
  196. $CSS.="}\n";
  197. $CSS.=".out {\n";
  198. $CSS.=" font-family : Arial;\n";
  199. $CSS.=" color : ".$background[5]."; /*TOPobackgroundTOPo5TOPo".$background[5]."TOPo*/\n";
  200. $CSS.="}\n";
  201. $CSS.="TD.bar1 {\n";
  202. $CSS.=" background-color : ".$background[4]."; /*TOPobackgroundTOPo4TOPo".$background[4]."TOPo*/\n";
  203. $CSS.="}\n";
  204. $CSS.="TD.bar2 {\n";
  205. $CSS.=" background-color : ".$background[5]."; /*TOPobackgroundTOPo5TOPo".$background[5]."TOPo*/\n";
  206. $CSS.="}\n";
  207. $CSS.=".textobar {\n";
  208. $CSS.=" font-family : Arial;\n";
  209. $CSS.=" font-size : 8pt;\n";
  210. $CSS.=" font-weight : normal;\n";
  211. $CSS.=" color : ".$textcolor[3]."; /*TOPotextcolorTOPo3TOPo".$textcolor[3]."TOPo*/\n";
  212. $CSS.="}\n";
  213.  
  214.  
  215. if($modo=="frames" OR $modo=="") {
  216. $HTML.='<html><head>';
  217. $HTML.='<meta http-equiv="Pragma" content="no-cache">';
  218. $HTML.='<meta http-equiv="no-cache">';
  219. $HTML.='<meta http-equiv="Expires" content="-1">';
  220. $HTML.='<meta http-equiv="Cache-Control" content="no-cache">';
  221. $HTML.='<title>'.$topNombre.'</title>';
  222. $HTML.='<frameset rows="200,*" cols="*" frameborder="NO" border="0" framespacing="0">';
  223. $HTML.='<frame name="interface" noresize scrolling="NO" src="topocolors.php?modo=interface&fileCSS='.$fileCSS.'&login='.$login.'&pass='.$pass.'">';
  224. $HTML.='<frame name="preview" noresize src="topocolors.php?modo='.$_Preview_.'&fileCSS='.$fileCSS.'&login='.$login.'&pass='.$pass.'" marginheight="0">';
  225. $HTML.='</frameset>';
  226. $HTML.='</head></html>';
  227. echo $HTML;
  228. exit();
  229. }
  230.  
  231. if($modo=="interface") {
  232. $HTML.='<table class="estructura" width="95%" align="center" border="0" cellspacing="1" cellpadding="5">';
  233. $HTML.='<form name="colores" action="topocolors.php" method="post" target="preview">';
  234. $HTML.='<caption><span class="titulo">'.$_TOPoColorsEditor_.': '.$fileCSS.'</span></caption>';
  235. $HTML.='<tr class="texto1">';
  236. $HTML.='<td colspan="2" align="center" valign="middle">|--&lt;INPUT&gt;--|</td>';
  237. $HTML.='<td colspan="2" align="center" valign="middle">|--'.$_Link_.'--|</td>';
  238. $HTML.='<td align="right" valign="middle">'.$_Texts_.'&gt;&gt;</td>';
  239. $HTML.='<td id="textcolor2" title=".titulo" align="center" valign="middle" bgcolor="'.$textcolor[2].'"><INPUT type="text" name="textcolor[2]" value="'.$textcolor[2].'" size="10" maxlength="10" onBlur="textcolor2.bgColor=value;"></td>';
  240. $HTML.='<td id="textcolor0" title=".texto0" align="center" valign="middle" bgcolor="'.$textcolor[0].'"><INPUT type="text" name="textcolor[0]" value="'.$textcolor[0].'" size="10" maxlength="10" onBlur="textcolor0.bgColor=value;"></td>';
  241. $HTML.='<td id="textcolor1" title=".texto1" align="center" valign="middle" bgcolor="'.$textcolor[1].'"><INPUT type="text" name="textcolor[1]" value="'.$textcolor[1].'" size="10" maxlength="10" onBlur="textcolor1.bgColor=value;"></td>';
  242. $HTML.='</tr>';
  243. $HTML.='<tr class="texto1">';
  244. $HTML.='<td id="textcolor4" title="INPUT" align="center" valign="middle" bgcolor="'.$textcolor[4].'"><INPUT type="text" name="textcolor[4]" value="'.$textcolor[4].'" size="10" maxlength="10" onBlur="textcolor4.bgColor=value;"></td>';
  245. $HTML.='<td id="background6" title="INPUT" align="center" valign="middle" bgcolor="'.$background[6].'"><INPUT type="text" name="background[6]" value="'.$background[6].'" size="10" maxlength="10" onBlur="background6.bgColor=value;"></td>';
  246. $HTML.='<td id="textcolor5" title="a:link" align="center" valign="middle" bgcolor="'.$textcolor[5].'"><INPUT type="text" name="textcolor[5]" value="'.$textcolor[5].'" size="10" maxlength="10" onBlur="textcolor5.bgColor=value;"></td>';
  247. $HTML.='<td id="textcolor6" title="a:over" align="center" valign="middle" bgcolor="'.$textcolor[6].'"><INPUT type="text" name="textcolor[6]" value="'.$textcolor[6].'" size="10" maxlength="10" onBlur="textcolor6.bgColor=value;"></td>';
  248. $HTML.='<td align="right" valign="middle">'.$_Ratio2_.'&gt;&gt;</td>';
  249. $HTML.='<td id="background4" title=".in" align="center" valign="middle" bgcolor="'.$background[4].'"><INPUT type="text" name="background[4]" value="'.$background[4].'" size="10" maxlength="10" onBlur="background4.bgColor=value;"></td>';
  250. $HTML.='<td id="background5" title=".out" align="center" valign="middle" bgcolor="'.$background[5].'"><INPUT type="text" name="background[5]" value="'.$background[5].'" size="10" maxlength="10" onBlur="background5.bgColor=value;"></td>';
  251. $HTML.='<td id="textcolor3" title="textobar" align="center" valign="middle" bgcolor="'.$textcolor[3].'"><INPUT type="text" name="textcolor[3]" value="'.$textcolor[3].'" size="10" maxlength="10" onBlur="textcolor3.bgColor=value;"></td>';
  252. $HTML.='</tr>';
  253. $HTML.='<tr class="texto1">';
  254. $HTML.='<td colspan="2" align="center" valign="middle">|--'.$_Button_.'--|</td>';
  255. $HTML.='<td colspan="2" align="center" valign="middle">|--'.$_MiniButton_.'--|</td>';
  256. $HTML.='<td align="right" valign="middle">'.$_BackGrounds_.'&gt;&gt;</td>';
  257. $HTML.='<td id="background3" title="BODY.background" align="center" valign="middle" bgcolor="'.$background[3].'"><INPUT type="text" name="background[3]" value="'.$background[3].'" size="10" maxlength="10" onBlur="background3.bgColor=value;"></td>';
  258. $HTML.='<td id="background0" title=".0" align="center" valign="middle" bgcolor="'.$background[0].'"><INPUT type="text" name="background[0]" value="'.$background[0].'" size="10" maxlength="10" onBlur="background0.bgColor=value;"></td>';
  259. $HTML.='<td align="left" valign="middle">&lt;&lt;'.$_BackGrounds_.'</td>';
  260. $HTML.='</tr>';
  261. $HTML.='<tr class="texto1">';
  262. $HTML.='<td id="textcolor7" title="INPUT.boton" align="center" valign="middle" bgcolor="'.$textcolor[7].'"><INPUT type="text" name="textcolor[7]" value="'.$textcolor[7].'" size="10" maxlength="10" onBlur="textcolor7.bgColor=value;"></td>';
  263. $HTML.='<td id="background7" title="INPUT.boton" align="center" valign="middle" bgcolor="'.$background[7].'"><INPUT type="text" name="background[7]" value="'.$background[7].'" size="10" maxlength="10" onBlur="background7.bgColor=value;"></td>';
  264. $HTML.='<td id="textcolor8" title="INPUT.miniboton" align="center" valign="middle" bgcolor="'.$textcolor[8].'"><INPUT type="text" name="textcolor[8]" value="'.$textcolor[8].'" size="10" maxlength="10" onBlur="textcolor8.bgColor=value;"></td>';
  265. $HTML.='<td id="background8" title="INPUT.miniboton" align="center" valign="middle" bgcolor="'.$background[8].'"><INPUT type="text" name="background[8]" value="'.$background[8].'" size="10" maxlength="10" onBlur="background8.bgColor=value;"></td>';
  266. $HTML.='<td align="right" valign="middle">'.$_BackGrounds_.'&gt;&gt;</td>';
  267. $HTML.='<td id="background1" title=".1" align="center" valign="middle" bgcolor="'.$background[1].'"><INPUT type="text" name="background[1]" value="'.$background[1].'" size="10" maxlength="10" onBlur="background1.bgColor=value;"></td>';
  268. $HTML.='<td id="background2" title=".2" align="center" valign="middle" bgcolor="'.$background[2].'"><INPUT type="text" name="background[2]" value="'.$background[2].'" size="10" maxlength="10" onBlur="background2.bgColor=value;"></td>';
  269. $HTML.='<td align="left" valign="middle">&lt;&lt;'.$_BackGrounds_.'</td>';
  270. $HTML.='</tr>';
  271. $HTML.='<tr><td colspan="9" align="center">';
  272. $HTML.='<INPUT class="boton" type="submit" name="modo" value="'.$_Preview_.'">';
  273. $HTML.='&nbsp;<INPUT class="boton" type="submit" name="modo" value="'.$_Load_.'">';
  274. if($fileCSS!='topo.css') $HTML.='&nbsp;<INPUT class="boton" type="submit" name="modo" value="'.$_Save_.'">';
  275. $HTML.='&nbsp;<INPUT class="boton" type="submit" name="modo" value="'.$_SaveAs_.'">';
  276. if($fileCSS!='topo.css') $HTML.='&nbsp;<INPUT class="boton" type="submit" name="modo" value="'.$_Delete_.'">';
  277. $HTML.='</td></tr>';
  278. $HTML.='<INPUT TYPE="HIDDEN" name="fileCSS" value="'.$fileCSS.'">';
  279. $HTML.='<INPUT TYPE="HIDDEN" name="login" value="'.$login.'">';
  280. $HTML.='<INPUT TYPE="HIDDEN" name="pass" value="'.$pass.'">';
  281. $HTML.='</form></table>';
  282. }
  283.  
  284. if($modo==$_Preview_) {
  285. echo '<html><head>';
  286. echo '<STYLE>'.$CSS.'</STYLE></head>';
  287. echo '<table align="center" border="0" bgcolor="Black" cellspacing="1" cellpadding="5">';
  288. echo '<tr>';
  289. echo '<td class="2"><INPUT type="text" value="INPUT" size="10"></td>';
  290. echo '<td class="2"><TEXTAREA row="3" col="10"></TEXTAREA></td>';
  291. echo '<td class="1"><INPUT type="text" value="INPUT" size="10"></td>';
  292. echo '<td class="1"><TEXTAREA row="3" col="10"></TEXTAREA></td>';
  293. echo '<td class="0"><INPUT type="text" value="INPUT" size="10"></td>';
  294. echo '<td class="0"><TEXTAREA row="3" col="10"></TEXTAREA></td>';
  295. echo '</tr>';
  296. echo '<tr>';
  297. echo '<td colspan="2" align="center" class="2"><INPUT type="button" class="boton" value=".boton">&nbsp;<INPUT type="button" class="miniboton" value=".miniboton"></td>';
  298. echo '<td colspan="2" align="center" class="1"><INPUT type="button" class="boton" value=".boton">&nbsp;<INPUT type="button" class="miniboton" value=".miniboton"></td>';
  299. echo '<td colspan="2" align="center" class="0"><INPUT type="button" class="boton" value=".boton">&nbsp;<INPUT type="button" class="miniboton" value=".miniboton"></td>';
  300. echo '</tr>';
  301. echo '</table>';
  302. echo '<span class="titulo"><center>'.$_Preview_.'</center></span>';
  303. include('html/top1.htm');
  304. foreach($background as $value) echo '<br>'.$value;
  305. foreach($textcolor as $value) echo '<br>'.$value;
  306. echo '</body></html>';
  307. exit();
  308. }
  309.  
  310. if($modo==$_Load_) {
  311. $directorio=opendir('css');
  312. if($file=readdir($directorio)) {
  313. do {
  314. $ext=strrchr($file,'.');
  315. $aux=explode('.',$file);
  316. if ($file != "." AND $file != ".." AND ($ext==".css" OR $ext==".CSS")) {
  317. $css[$i++]=$file;
  318. }
  319. } while ($file = readdir($directorio));
  320. closedir($directorio);
  321. } else {
  322. $css[0]="Donґt found CSS files";
  323. }
  324. $HTML.='<table width="50%" class="texto0" align="center" border="0" bgcolor="Black" cellspacing="1" cellpadding="5">';
  325. $HTML.='<form action="topocolors.php" method="post" target="_top">';
  326. $HTML.='<caption><span class="titulo">'.$_TOPoColorsEditor_.'</span></caption>';
  327. $HTML.='<tr class="2"><td class="texto1" align="center" valign="middle">'.$_Load_.'</td></tr>';
  328. $HTML.='<tr class="0"><td align="center"><SELECT name="fileCSS">';
  329. foreach($css as $value) {
  330. $HTML.='<OPTION value="'.$value.'"';
  331. if($value==$fileCSS) $HTML.=' selected';
  332. $HTML.='>'.$value.'</OPTION>';
  333. }
  334. $HTML.='</SELECT></td></tr>';
  335. $HTML.='<tr class="2"><td align="center" valign="middle"><input type="button" class="boton" value="'.$_Return_.'" onClick="history.go(-1)">&nbsp;<INPUT type="submit" class="boton" value="'.$_Load_.'"></td></tr>';
  336. $HTML.='<INPUT TYPE="HIDDEN" name="modo" value="frames">';
  337. $HTML.='<INPUT TYPE="HIDDEN" name="login" value="'.$login.'">';
  338. $HTML.='<INPUT TYPE="HIDDEN" name="pass" value="'.$pass.'">';
  339. $HTML.='</form></table>';
  340. }
  341.  
  342. if($modo==$_Save_) {
  343. $fp=fopen('css/'.$fileCSS,"w");
  344. $ok=fwrite($fp,$CSS);
  345. fclose($fp);
  346. $HTML='ERROR:<br>File: TOPoColors.php<br>modo=save';
  347. if($ok) {
  348. $HTML.='<table width="50%" class="texto0" align="center" border="0" bgcolor="Black" cellspacing="1" cellpadding="5">';
  349. $HTML='<form action="topocolors.php" method="post">';
  350. $HTML.='<caption><span class="titulo">'.$_TOPoColorsEditor_.'</span></caption>';
  351. $HTML.='<tr class="0"><td align="center" valign="middle"><br>'.$_UpdateData_.'<br>&nbsp;</td></tr>';
  352. $HTML.='<tr class="1"><td align="center" valign="middle"><br><INPUT TYPE="SUBMIT" class="boton" value="'.$_Return_.'"><br>&nbsp;</td></tr>';
  353. $HTML.='<INPUT TYPE="HIDDEN" name="modo" value="'.$_Preview_.'">';
  354. $HTML.='<INPUT TYPE="HIDDEN" name="fileCSS" value="'.$fileCSS.'">';
  355. $HTML.='<INPUT TYPE="HIDDEN" name="login" value="'.$login.'">';
  356. $HTML.='<INPUT TYPE="HIDDEN" name="pass" value="'.$pass.'">';
  357. $HTML.='</form></table>';
  358. }
  359. }
  360.  
  361. if($modo==$_SaveAs_) {
  362. if(isset($nombre)) {
  363. if($nombre=='topo') $nombre.=rand(1,9);
  364. $fp=fopen('css/'.$nombre.'.css',"w");
  365. $ok=fwrite($fp,$CSSdata);
  366. fclose($fp);
  367. $HTML='ERROR:<br>File: TOPoColors.php<br>modo=saveas';
  368. if($ok) {
  369. $HTML.='<table width="50%" class="texto0" align="center" border="0" bgcolor="Black" cellspacing="1" cellpadding="5">';
  370. $HTML='<form action="topocolors.php" method="post" target="_top">';
  371. $HTML.='<caption><span class="titulo">'.$_TOPoColorsEditor_.'</span></caption>';
  372. $HTML.='<tr class="0"><td align="center" valign="middle"><br>'.$_UpdateData_.'<br>&nbsp;</td></tr>';
  373. $HTML.='<tr class="1"><td align="center" valign="middle"><br><INPUT TYPE="SUBMIT" class="boton" value="'.$_Return_.'"><br>&nbsp;</td></tr>';
  374. $HTML.='<INPUT TYPE="HIDDEN" name="modo" value="frames">';
  375. $HTML.='<INPUT TYPE="HIDDEN" name="fileCSS" value="'.$nombre.'.css">';
  376. $HTML.='<INPUT TYPE="HIDDEN" name="login" value="'.$login.'">';
  377. $HTML.='<INPUT TYPE="HIDDEN" name="pass" value="'.$pass.'">';
  378. $HTML.='</form></table>';
  379. }
  380. } else {
  381. $nombre=time();
  382. $HTML='<form action="topocolors.php" method="post" target="_top">';
  383. $HTML.='<table width="50%" class="texto0" align="center" border="0" bgcolor="Black" cellspacing="1" cellpadding="5">';
  384. $HTML.='<caption><span class="titulo">'.$_TOPoColorsEditor_.'</span></caption>';
  385. $HTML.='<tr class="2"><td class="texto1" align="center">'.$_SaveAs_.'</td></tr>';
  386. $HTML.='<tr class="0"><td align="center">'.$_NewDesign_.'&nbsp;<INPUT type="text" name="nombre" value="'.$nombre.'"></td></tr>';
  387. $HTML.='<tr class="2"><td align="center"><INPUT TYPE="button" class="boton" value="'.$_Return_.'" onClick="window.history.back()">&nbsp;<INPUT TYPE="SUBMIT" class="boton" value="'.$_Save_.'"></td></tr>';
  388. $HTML.='<INPUT TYPE="HIDDEN" name="modo" value="'.$_SaveAs_.'">';
  389. $HTML.='<INPUT TYPE="HIDDEN" name="CSSdata" value="'.$CSS.'">';
  390. $HTML.='<INPUT TYPE="HIDDEN" name="login" value="'.$login.'">';
  391. $HTML.='<INPUT TYPE="HIDDEN" name="pass" value="'.$pass.'">';
  392. $HTML.='</table></form>';
  393. }
  394. }
  395.  
  396.  
  397. if($modo==$_Delete_) {
  398. if($confirmado) {
  399. $ok=unlink('css/'.$fileCSS);
  400. $HTML='ERROR:<br>File: TOPoColors.php<br>modo=delete';
  401. if($ok) {
  402. $HTML='<form action="topocolors.php" method="post" target="_top">';
  403. $HTML.='<table width="50%" class="texto0" align="center" border="0" bgcolor="Black" cellspacing="1" cellpadding="5">';
  404. $HTML.='<caption><span class="titulo">'.$_TOPoColorsEditor_.'</span></caption>';
  405. $HTML.='<tr class="0"><td align="center" valign="middle"><br>'.$_UpdateData_.'<br>&nbsp;</td></tr>';
  406. $HTML.='<tr class="1"><td align="center" valign="middle"><br><INPUT TYPE="SUBMIT" class="boton" value="'.$_Return_.'"><br>&nbsp;</td></tr>';
  407. $HTML.='<INPUT TYPE="HIDDEN" name="modo" value="frames">';
  408. $HTML.='<INPUT TYPE="HIDDEN" name="fileCSS" value="topo.css">';
  409. $HTML.='<INPUT TYPE="HIDDEN" name="login" value="'.$login.'">';
  410. $HTML.='<INPUT TYPE="HIDDEN" name="pass" value="'.$pass.'">';
  411. $HTML.='</table></form>';
  412. }
  413. } else {
  414. $HTML='<form action="topocolors.php" method="post" target="_top">';
  415. $HTML.='<table width="50%" class="texto0" align="center" border="0" bgcolor="Black" cellspacing="1" cellpadding="5">';
  416. $HTML.='<caption><span class="titulo">'.$_TOPoColorsEditor_.'</span></caption>';
  417. $HTML.='<tr class="2"><td class="texto1" align="center">'.$_Delete_.'</td></tr>';
  418. $HTML.='<tr class="0"><td align="center" class="texto0">'.$_Confirm_.'</td></tr>';
  419. $HTML.='<tr class="2"><td align="center"><input type="button" class="boton" value="'.$_Return_.'" onClick="history.go(-1)">&nbsp;<input type="submit" class="boton" value=" '.$_Yes_.' "></td></tr>';
  420. $HTML.='<INPUT TYPE="HIDDEN" name="modo" value="'.$_Delete_.'">';
  421. $HTML.='<INPUT TYPE="HIDDEN" name="confirmado" value="1">';
  422. $HTML.='<INPUT TYPE="HIDDEN" name="fileCSS" value="'.$fileCSS.'">';
  423. $HTML.='<INPUT TYPE="HIDDEN" name="login" value="'.$login.'">';
  424. $HTML.='<INPUT TYPE="HIDDEN" name="pass" value="'.$pass.'">';
  425. $HTML.='</table></form>';
  426. }
  427. }
  428.  
  429. include('html/header.php');
  430. echo $HTML;
  431. echo '</body></html>';
  432. ?>