Просмотр файла includes/wap/builder/page_element_insert_2.php

Размер файла: 24.16Kb
  1. <?php
  2. $head2.=$head.$meta_nostore.cyr2utf('<card id="main" title="Вставить">'.
  3. '<do name="m" type="options" label="Страница"><go href="/?'.$id.'/pm'.$dmpage.$mpage.'/'.$editfile.'/"/></do><p>'.
  4. '<b>'.$editfile.'.wml</b>');
  5.  
  6. if (strpos(strtolower($HTTP_POST_VARS['code']),'<card')&&
  7. ($currentdir.$editfile=='./index'))
  8. die($head.$meta_nostore.cyr2utf('<card id="main" title="Вставить">'.
  9. '<do name="m" type="options" label="Страница"><go href="/?'.$id.'/pm'.$dmpage.$mpage.'/'.$editfile.'/"/></do><p>'.
  10. '<b>На этой странице запрещено использовать WML-код содержащий теги &lt;card&gt;!</b>'.
  11. '<br/><anchor>Назад<prev/></anchor><br/>'.
  12. '</p></card></wml>'));
  13.  
  14. if (strpos(strtolower($HTTP_POST_VARS['url']),'cnt.kmx.ru/')||
  15. strpos(strtolower($HTTP_POST_VARS['url1']),'cnt.kmx.ru/')||
  16. strpos(strtolower($HTTP_POST_VARS['url2']),'cnt.kmx.ru/'))
  17. die($head.$meta_nostore.cyr2utf('<card id="main" title="Вставить">'.
  18. '<do name="m" type="options" label="Страница"><go href="/?'.$id.'/pm'.$dmpage.$mpage.'/'.$editfile.'/"/></do><p>'.
  19. '<b>Недоспустимый URL!</b>'.
  20. '<br/><anchor>Назад<prev/></anchor><br/>'.
  21. '</p></card></wml>'));
  22.  
  23. $page=file($userpath.$currentdir.$editfile.'.wml');
  24. $page[0]='<?xml version="1.0" encoding="Utf-8"?><!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.2//EN" "http://www.wapforum.org/DTD/wml_1.2.xml"><wml><head><meta forua="true" http-equiv="Cache-Control" content="max-age=0,proxy-revalidate,must-revalidate"/></head>'."\n";
  25. $variables='';
  26. for ($j=0;$j<sizeof($page);$j++)
  27. {
  28. $page[$j]=trim($page[$j])."\n";
  29. $stra=explode(' ',$page[$j]);
  30. if ($stra[0]=='<input')
  31. {
  32. $stra=explode('name="',$page[$j]);
  33. $stra=explode('"',$stra[1]);
  34. $var_=$stra[0];
  35. $variables.='<postfield name="'.$var_.'" value="$('.$var_.')"/>';
  36. }
  37. elseif ($stra[0]=='<!--var')
  38. {
  39. $stra=explode('|',$page[$j]);
  40. $variables.='<postfield name="'.$stra[1].'" value="'.$stra[2].'"/>';
  41. }
  42. }
  43.  
  44. if ($HTTP_POST_VARS['cacheop']!='') $nocache=$HTTP_POST_VARS['cacheop']+0;
  45. $fp = @fopen ($userpath."opeation.cache", "r");$testcache = trim(@fgets($fp, 10));@fclose ($fp);
  46. if ($nocache==$testcache)
  47. {
  48. $param1=$param2=$param3='';
  49. include($buildpath.'page_structure.php');
  50. exit;
  51. }
  52.  
  53. $str=trim($page[$i]);
  54. $stra=explode(' ',$str);
  55. switch ($stra[0])
  56. {
  57. case '<card':
  58. if ($param3!='softkey')
  59. {
  60. $param2=$param3='';
  61. include($buildpath.'page_element.php');
  62. exit;
  63. }
  64. break;
  65. case '<!--':
  66. $param2=$param3='';
  67. include($buildpath.'page_element.php');
  68. exit;
  69. case '<p':
  70. $i++;
  71. break;
  72. }
  73.  
  74. $page[$i]=trim($page[$i])."\n<!-- insert -->\n";
  75. $page=implode("",$page);
  76.  
  77. if ($HTTP_POST_VARS['autobr']=='yes') $autobr="<br/>"; else $autobr='';
  78.  
  79. switch ($param3)
  80. {
  81. case 'softkey':
  82. if (($HTTP_POST_VARS['caption']!='')&&($HTTP_POST_VARS['url1']!=''))
  83. {
  84. $random='';
  85. for ($i=0;$i<4;$i++) $random .= round(('0.'.substr(mt_rand(),1))*9+0.5);
  86. $caption=obrab($HTTP_POST_VARS['caption']);
  87. if ($HTTP_POST_VARS['tr2cyr']=='yes') $caption=cyr2utf(tr2rus(utf2cyr(obrab($HTTP_POST_VARS['caption']))));
  88. $page=str_replace("<!-- insert -->",'<do name="sk'.$random.'" type="options" label="'.$caption.'"><go href="'.obrab($HTTP_POST_VARS['url1']).'"/></do>',$page);
  89. $fp = fopen ($userpath.$currentdir.$editfile.'.wml', "w+");
  90. fwrite ($fp, $page);
  91. fclose ($fp);
  92. $param1=$param2=$param3='';
  93. $fp = fopen ($userpath."opeation.cache", "w+");fwrite ($fp, $nocache);fclose ($fp);
  94. include($buildpath.'page_structure.php');
  95. exit;
  96. }
  97. print $head2.
  98. cyr2utf('<br/><u>Soft-кнопка</u>:'.
  99. '<br/>URL:<input name="url1'.$nocache.'" type="text" title="URL" value="http://" maxlength="128"/>'.
  100. '<br/>Подпись:<input name="caption'.$nocache.'" type="text" title="Подпись" value="" maxlength="32"/>'.
  101. '<br/><select name="tr2cyr'.$nocache.'" multiple="true" value=""><option value="yes">Транслит</option></select>'.
  102. '<br/><anchor>Вставить'.
  103. '<go href="http://wap.kmx.ru" method="post">'.
  104. '<postfield name="query" value="'.$id.'/pm'.$dmpage.$mpage.'/'.$editfile.'/edit'.$dapage.$apage.'/'.$param1.'/insert/softkey"/>'.
  105. '<postfield name="caption" value="$(caption'.$nocache.')"/>'.
  106. '<postfield name="url1" value="$(url1'.$nocache.')"/>'.
  107. '<postfield name="tr2cyr" value="$(tr2cyr'.$nocache.')"/>'.
  108. '<postfield name="cacheop" value="'.$nocache.'"/>'.
  109. '</go>'.
  110. '</anchor>');
  111. break;
  112. case 'break':
  113. $page=str_replace("<!-- insert -->","<br/>",$page);
  114. $fp = fopen ($userpath.$currentdir.$editfile.'.wml', "w+");
  115. fwrite ($fp, $page);
  116. fclose ($fp);
  117. $param1=$param2=$param3='';
  118. include($buildpath.'page_structure.php');
  119. exit;
  120. case 'align':
  121. if (($HTTP_POST_VARS['align']=='left')||($HTTP_POST_VARS['align']=='center')||($HTTP_POST_VARS['align']=='right'))
  122. {
  123. if (($HTTP_POST_VARS['wrap']=='nowrap')) $wrapmode=' mode="nowrap"';
  124. if (($HTTP_POST_VARS['wrap']=='wrap')) $wrapmode=' mode="wrap"';
  125. if (($HTTP_POST_VARS['wrap']=='null')) $wrapmode='';
  126. $page=str_replace("<!-- insert -->",'</p><p align="'.$HTTP_POST_VARS['align'].'"'.$wrapmode.'>',$page);
  127. $fp = fopen ($userpath.$currentdir.$editfile.'.wml', "w+");
  128. fwrite ($fp, $page);
  129. fclose ($fp);
  130. $param1=$param2=$param3='';
  131. $fp = fopen ($userpath."opeation.cache", "w+");fwrite ($fp, $nocache);fclose ($fp);
  132. include($buildpath.'page_structure.php');
  133. exit;
  134. }
  135. print $head2.
  136. cyr2utf('<br/><u>Выравнивать</u>:'.
  137. '<br/><select name="align'.$nocache.'" value="center"><option value="left">влево</option><option value="center">по центру</option><option value="right">вправо</option></select>'.
  138. '<br/>Строки:'.
  139. '<br/><select name="wrap'.$nocache.'" value="null"><option value="wrap">разрывные</option><option value="nowrap">неразрывные</option><option value="null">по умолчанию</option></select>'.
  140. '<br/><anchor>Вставить'.
  141. '<go href="http://wap.kmx.ru" method="post">'.
  142. '<postfield name="query" value="'.$id.'/pm'.$dmpage.$mpage.'/'.$editfile.'/edit'.$dapage.$apage.'/'.$param1.'/insert/align"/>'.
  143. '<postfield name="align" value="$(align'.$nocache.')"/>'.
  144. '<postfield name="wrap" value="$(wrap'.$nocache.')"/>'.
  145. '<postfield name="cacheop" value="'.$nocache.'"/>'.
  146. '</go>'.
  147. '</anchor>');
  148. break;
  149. case 'banner':
  150. if (($HTTP_POST_VARS['caption']!='')&&($HTTP_POST_VARS['url1']!='')&&($HTTP_POST_VARS['url2']!=''))
  151. {
  152. $caption=obrab($HTTP_POST_VARS['caption']);
  153. if ($HTTP_POST_VARS['tr2cyr']=='yes') $caption=cyr2utf(tr2rus(utf2cyr(obrab($HTTP_POST_VARS['caption']))));
  154. $page=str_replace("<!-- insert -->",'<a href="'.obrab($HTTP_POST_VARS['url1']).'"><img src="'.obrab($HTTP_POST_VARS['url2']).'" alt="'.$caption."\"/></a>".$autobr,$page);
  155. $fp = fopen ($userpath.$currentdir.$editfile.'.wml', "w+");
  156. fwrite ($fp, $page);
  157. fclose ($fp);
  158. $param1=$param2=$param3='';
  159. $fp = fopen ($userpath."opeation.cache", "w+");fwrite ($fp, $nocache);fclose ($fp);
  160. include($buildpath.'page_structure.php');
  161. exit;
  162. }
  163. print $head2.
  164. cyr2utf('<br/><u>Баннер</u>:'.
  165. '<br/>URL ссылки:<input name="url1'.$nocache.'" type="text" title="URL ссылки" value="http://" maxlength="128"/>'.
  166. '<br/>URL рисунка:<input name="url2'.$nocache.'" type="text" title="URL рисунка" value="http://" maxlength="128"/>'.
  167. '<br/>Подпись:<input name="caption'.$nocache.'" type="text" title="Подпись" value="" maxlength="32"/>'.
  168. '<br/><select name="autobr'.$nocache.'" multiple="true" value="yes"><option value="yes">Автоперенос</option></select>'.
  169. '<br/><select name="tr2cyr'.$nocache.'" multiple="true" value=""><option value="yes">Транслит</option></select>'.
  170. '<br/><anchor>Вставить'.
  171. '<go href="http://wap.kmx.ru" method="post">'.
  172. '<postfield name="query" value="'.$id.'/pm'.$dmpage.$mpage.'/'.$editfile.'/edit'.$dapage.$apage.'/'.$param1.'/insert/banner"/>'.
  173. '<postfield name="caption" value="$(caption'.$nocache.')"/>'.
  174. '<postfield name="url1" value="$(url1'.$nocache.')"/>'.
  175. '<postfield name="url2" value="$(url2'.$nocache.')"/>'.
  176. '<postfield name="autobr" value="$(autobr'.$nocache.')"/>'.
  177. '<postfield name="tr2cyr" value="$(tr2cyr'.$nocache.')"/>'.
  178. '<postfield name="cacheop" value="'.$nocache.'"/>'.
  179. '</go>'.
  180. '</anchor>');
  181. break;
  182. case 'link':
  183. if (($HTTP_POST_VARS['caption']!='')&&($HTTP_POST_VARS['url']!=''))
  184. {
  185. $caption=obrab($HTTP_POST_VARS['caption']);
  186. if ($HTTP_POST_VARS['tr2cyr']=='yes') $caption=cyr2utf(tr2rus(utf2cyr(obrab($HTTP_POST_VARS['caption']))));
  187.  
  188. $instext='<a href="'.obrab($HTTP_POST_VARS['url']).'">'.$caption.'</a>';
  189. if (strpos(' '.$HTTP_POST_VARS['atrib'],'i')) $instext='<i>'.$instext.'</i>';
  190. if (strpos(' '.$HTTP_POST_VARS['atrib'],'u')) $instext='<u>'.$instext.'</u>';
  191. if (strpos(' '.$HTTP_POST_VARS['atrib'],'b')) $instext='<b>'.$instext.'</b>';
  192. if (strpos(' '.$HTTP_POST_VARS['size'],'big')) $instext='<big>'.$instext.'</big>';
  193. if (strpos(' '.$HTTP_POST_VARS['size'],'small')) $instext='<small>'.$instext.'</small>';
  194.  
  195. $page=str_replace("<!-- insert -->",$instext.$autobr,$page);
  196. $fp = fopen ($userpath.$currentdir.$editfile.'.wml', "w+");
  197. fwrite ($fp, $page);
  198. fclose ($fp);
  199. $param1=$param2=$param3='';
  200. $fp = fopen ($userpath."opeation.cache", "w+");fwrite ($fp, $nocache);fclose ($fp);
  201. include($buildpath.'page_structure.php');
  202. exit;
  203. }
  204. print $head2.
  205. cyr2utf('<br/><u>Ссылка</u>:'.
  206. '<br/>URL:<input name="url'.$nocache.'" type="text" title="URL" value="http://" maxlength="128"/>'.
  207. '<br/>Подпись:<input name="caption'.$nocache.'" type="text" title="Подпись" value="" maxlength="64"/>'.
  208. '<br/>Атрибуты: '.
  209. '<br/><select name="atrib'.$nocache.'" multiple="true" value=""><option value="b">полужирный</option><option value="u">подчеркнутый</option><option value="i">наклонный</option></select>'.
  210. '<br/>Размер: '.
  211. '<br/><select name="size'.$nocache.'" value="normal"><option value="small">мелкий</option><option value="normal">нормальный</option><option value="big">крупный</option></select>'.
  212. '<br/><select name="autobr'.$nocache.'" multiple="true" value="yes"><option value="yes">Автоперенос</option></select>'.
  213. '<br/><select name="tr2cyr'.$nocache.'" multiple="true" value=""><option value="yes">Транслит</option></select>'.
  214. '<br/><anchor>Вставить'.
  215. '<go href="http://wap.kmx.ru" method="post">'.
  216. '<postfield name="query" value="'.$id.'/pm'.$dmpage.$mpage.'/'.$editfile.'/edit'.$dapage.$apage.'/'.$param1.'/insert/link"/>'.
  217. '<postfield name="caption" value="$(caption'.$nocache.')"/>'.
  218. '<postfield name="url" value="$(url'.$nocache.')"/>'.
  219. '<postfield name="atrib" value="$(atrib'.$nocache.')"/>'.
  220. '<postfield name="size" value="$(size'.$nocache.')"/>'.
  221. '<postfield name="autobr" value="$(autobr'.$nocache.')"/>'.
  222. '<postfield name="tr2cyr" value="$(tr2cyr'.$nocache.')"/>'.
  223. '<postfield name="cacheop" value="'.$nocache.'"/>'.
  224. '</go>'.
  225. '</anchor>');
  226. break;
  227. case 'image':
  228. if (($HTTP_POST_VARS['caption']!='')&&($HTTP_POST_VARS['url']!=''))
  229. {
  230. $caption=obrab($HTTP_POST_VARS['caption']);
  231. if ($HTTP_POST_VARS['tr2cyr']=='yes') $caption=cyr2utf(tr2rus(utf2cyr(obrab($HTTP_POST_VARS['caption']))));
  232. $page=str_replace("<!-- insert -->",'<img src="'.obrab($HTTP_POST_VARS['url']).'" alt="'.$caption."\"/>".$autobr,$page);
  233. $fp = fopen ($userpath.$currentdir.$editfile.'.wml', "w+");
  234. fwrite ($fp, $page);
  235. fclose ($fp);
  236. $param1=$param2=$param3='';
  237. $fp = fopen ($userpath."opeation.cache", "w+");fwrite ($fp, $nocache);fclose ($fp);
  238. include($buildpath.'page_structure.php');
  239. exit;
  240. }
  241. print $head2.
  242. cyr2utf('<br/><u>Рисунок</u>:'.
  243. '<br/>URL:<input name="url'.$nocache.'" type="text" title="URL" value="http://" maxlength="128"/>'.
  244. '<br/>Подпись:<input name="caption'.$nocache.'" type="text" title="Подпись" value="" maxlength="32"/>'.
  245. '<br/><select name="autobr'.$nocache.'" multiple="true" value="yes"><option value="yes">Автоперенос</option></select>'.
  246. '<br/><select name="tr2cyr'.$nocache.'" multiple="true" value=""><option value="yes">Транслит</option></select>'.
  247. '<br/><anchor>Вставить'.
  248. '<go href="http://wap.kmx.ru" method="post">'.
  249. '<postfield name="query" value="'.$id.'/pm'.$dmpage.$mpage.'/'.$editfile.'/edit'.$dapage.$apage.'/'.$param1.'/insert/image"/>'.
  250. '<postfield name="caption" value="$(caption'.$nocache.')"/>'.
  251. '<postfield name="url" value="$(url'.$nocache.')"/>'.
  252. '<postfield name="autobr" value="$(autobr'.$nocache.')"/>'.
  253. '<postfield name="tr2cyr" value="$(tr2cyr'.$nocache.')"/>'.
  254. '<postfield name="cacheop" value="'.$nocache.'"/>'.
  255. '</go>'.
  256. '</anchor>');
  257. break;
  258. case 'input':
  259. if ($HTTP_POST_VARS['var']!='')
  260. {
  261. $caption=obrab($HTTP_POST_VARS['caption']);
  262. $var_=obrab($HTTP_POST_VARS['var']);
  263. $def=obrab($HTTP_POST_VARS['def']);
  264. $size=obrab($HTTP_POST_VARS['size'])+0;
  265. if ($size<1) $size='999';
  266. if ($HTTP_POST_VARS['tr2cyr']=='yes')
  267. {
  268. $caption=cyr2utf(tr2rus(utf2cyr(obrab($HTTP_POST_VARS['caption']))));
  269. $def=cyr2utf(tr2rus(utf2cyr(obrab($HTTP_POST_VARS['def']))));
  270. }
  271. if ($HTTP_POST_VARS['type']!='password') $type='text'; else $type='password';
  272. $page=str_replace("<!-- insert -->",'<input name="'.$var_.'" type="'.$type.'" emptyok="true" title="'.$caption.'" maxlength="'.$size.'" value="'.$def.'"/>'.$autobr,$page);
  273. $fp = fopen ($userpath.$currentdir.$editfile.'.wml', "w+");
  274. fwrite ($fp, $page);
  275. fclose ($fp);
  276. $param1=$param2=$param3='';
  277. $fp = fopen ($userpath."opeation.cache", "w+");fwrite ($fp, $nocache);fclose ($fp);
  278. include($buildpath.'page_structure.php');
  279. exit;
  280. }
  281. print $head2.
  282. cyr2utf('<br/><u>Поле ввода</u>:'.
  283. '<br/>Переменная:<input name="var'.$nocache.'" type="text" title="Переменная" value="" maxlength="16"/>'.
  284. '<br/>Подпись:<input name="caption'.$nocache.'" type="text" title="Подпись" value="" maxlength="16"/>'.
  285. '<br/>Размер:<input name="size'.$nocache.'" type="text" title="Размер" value="999" format="*N" maxlength="3"/>'.
  286. '<br/>Значение:<input name="def'.$nocache.'" type="text" title="По умолчанию" value="" maxlength="32"/>'.
  287. '<br/><select name="type'.$nocache.'" value="text"><option value="text">Текст</option><option value="password">Пароль</option></select>'.
  288. '<br/><select name="autobr'.$nocache.'" multiple="true" value="yes"><option value="yes">Автоперенос</option></select>'.
  289. '<br/><select name="tr2cyr'.$nocache.'" multiple="true" value=""><option value="yes">Транслит</option></select>'.
  290. '<br/><anchor>Вставить'.
  291. '<go href="http://wap.kmx.ru" method="post">'.
  292. '<postfield name="query" value="'.$id.'/pm'.$dmpage.$mpage.'/'.$editfile.'/edit'.$dapage.$apage.'/'.$param1.'/insert/input"/>'.
  293. '<postfield name="var" value="$(var'.$nocache.')"/>'.
  294. '<postfield name="caption" value="$(caption'.$nocache.')"/>'.
  295. '<postfield name="size" value="$(size'.$nocache.')"/>'.
  296. '<postfield name="def" value="$(def'.$nocache.')"/>'.
  297. '<postfield name="type" value="$(type'.$nocache.')"/>'.
  298. '<postfield name="autobr" value="$(autobr'.$nocache.')"/>'.
  299. '<postfield name="tr2cyr" value="$(tr2cyr'.$nocache.')"/>'.
  300. '<postfield name="cacheop" value="'.$nocache.'"/>'.
  301. '</go>'.
  302. '</anchor>');
  303. break;
  304. case 'anchor':
  305. if (($HTTP_POST_VARS['url']!='')&&($HTTP_POST_VARS['caption']!=''))
  306. {
  307. $caption=obrab($HTTP_POST_VARS['caption']);
  308. if ($HTTP_POST_VARS['tr2cyr']=='yes') $caption=cyr2utf(tr2rus(utf2cyr(obrab($HTTP_POST_VARS['caption']))));
  309. $url=obrab($HTTP_POST_VARS['url']);
  310. if ($HTTP_POST_VARS['method']!='get') $method='post'; else $method='get';
  311. $page=str_replace("<!-- insert -->",'<anchor >'.$caption.'<go href="'.$url.'" method="'.$method.'">'.$variables.'</go></anchor>'.$autobr,$page);
  312. $fp = fopen ($userpath.$currentdir.$editfile.'.wml', "w+");
  313. fwrite ($fp, $page);
  314. fclose ($fp);
  315. $param1=$param2=$param3='';
  316. $fp = fopen ($userpath."opeation.cache", "w+");fwrite ($fp, $nocache);fclose ($fp);
  317. include($buildpath.'page_structure.php');
  318. exit;
  319. }
  320. print $head2.
  321. cyr2utf('<br/><u>Ссылка+</u>:'.
  322. '<br/>URL:<input name="url'.$nocache.'" type="text" title="URL" value="http://" maxlength="128"/>'.
  323. '<br/>Подпись:<input name="caption'.$nocache.'" type="text" title="Подпись" value="" maxlength="32"/>'.
  324. '<br/>Метод: '.
  325. '<br/><select name="method'.$nocache.'" value="get"><option value="get">GET</option><option value="post">POST</option></select>'.
  326. '<br/><select name="autobr'.$nocache.'" multiple="true" value="yes"><option value="yes">Автоперенос</option></select>'.
  327. '<br/><select name="tr2cyr'.$nocache.'" multiple="true" value=""><option value="yes">Транслит</option></select>'.
  328. '<br/><anchor>Вставить'.
  329. '<go href="http://wap.kmx.ru" method="post">'.
  330. '<postfield name="query" value="'.$id.'/pm'.$dmpage.$mpage.'/'.$editfile.'/edit'.$dapage.$apage.'/'.$param1.'/insert/anchor"/>'.
  331. '<postfield name="url" value="$(url'.$nocache.')"/>'.
  332. '<postfield name="caption" value="$(caption'.$nocache.')"/>'.
  333. '<postfield name="method" value="$(method'.$nocache.')"/>'.
  334. '<postfield name="autobr" value="$(autobr'.$nocache.')"/>'.
  335. '<postfield name="tr2cyr" value="$(tr2cyr'.$nocache.')"/>'.
  336. '<postfield name="cacheop" value="'.$nocache.'"/>'.
  337. '</go>'.
  338. '</anchor>');
  339. break;
  340. case 'var':
  341. if (($HTTP_POST_VARS['name']!='')&&($HTTP_POST_VARS['value']!=''))
  342. {
  343. $value=obrab($HTTP_POST_VARS['value']);
  344. if ($HTTP_POST_VARS['tr2cyr']=='yes') $value=cyr2utf(tr2rus(utf2cyr(obrab($HTTP_POST_VARS['value']))));
  345. $page=str_replace("<!-- insert -->",'<!--var |'.obrab($HTTP_POST_VARS['name']).'|'.$value."|-->",$page);
  346. $fp = fopen ($userpath.$currentdir.$editfile.'.wml', "w+");
  347. fwrite ($fp, $page);
  348. fclose ($fp);
  349. $param1=$param2=$param3='';
  350. $fp = fopen ($userpath."opeation.cache", "w+");fwrite ($fp, $nocache);fclose ($fp);
  351. include($buildpath.'page_structure.php');
  352. exit;
  353. }
  354. print $head2.
  355. cyr2utf('<br/><u>Переменная</u>:'.
  356. '<br/>Переменная:<input name="name'.$nocache.'" type="text" title="Переменная" value="" maxlength="16"/>'.
  357. '<br/>Значение:<input name="value'.$nocache.'" type="text" title="Значение" value="" maxlength="128"/>'.
  358. '<br/><select name="tr2cyr'.$nocache.'" multiple="true" value=""><option value="yes">Транслит</option></select>'.
  359. '<br/><anchor>Вставить'.
  360. '<go href="http://wap.kmx.ru" method="post">'.
  361. '<postfield name="query" value="'.$id.'/pm'.$dmpage.$mpage.'/'.$editfile.'/edit'.$dapage.$apage.'/'.$param1.'/insert/var"/>'.
  362. '<postfield name="name" value="$(name'.$nocache.')"/>'.
  363. '<postfield name="value" value="$(value'.$nocache.')"/>'.
  364. '<postfield name="tr2cyr" value="$(tr2cyr'.$nocache.')"/>'.
  365. '<postfield name="cacheop" value="'.$nocache.'"/>'.
  366. '</go>'.
  367. '</anchor>');
  368. break;
  369. case 'code':
  370. if ($HTTP_POST_VARS['code']!='')
  371. {
  372. $code=str_replace("\n",' ',str_replace("\r",' ',stripslashes($HTTP_POST_VARS['code'])));
  373. $page=str_replace("<!-- insert -->",'<!--r -->'.$code,$page);
  374. $fp = fopen ($userpath.$currentdir.$editfile.'.wml', "w+");
  375. fwrite ($fp, $page);
  376. fclose ($fp);
  377. $param1=$param2=$param3='';
  378. $fp = fopen ($userpath."opeation.cache", "w+");fwrite ($fp, $nocache);fclose ($fp);
  379. include($buildpath.'page_structure.php');
  380. exit;
  381. }
  382. print $head2.
  383. cyr2utf('<br/><u>WML-код</u>:'.
  384. '<br/><input name="code'.$nocache.'" type="text" title="WML-код" value="" maxlength="512"/>'.
  385. '<br/><anchor>Вставить'.
  386. '<go href="http://wap.kmx.ru" method="post">'.
  387. '<postfield name="query" value="'.$id.'/pm'.$dmpage.$mpage.'/'.$editfile.'/edit'.$dapage.$apage.'/'.$param1.'/insert/code"/>'.
  388. '<postfield name="code" value="$(code'.$nocache.')"/>'.
  389. '</go>'.
  390. '</anchor>');
  391. break;
  392. default :
  393. if ($HTTP_POST_VARS['text']!='')
  394. {
  395. $text=obrab($HTTP_POST_VARS['text']);
  396. if ($HTTP_POST_VARS['tr2cyr']=='yes') $text=cyr2utf(tr2rus(utf2cyr(obrab($HTTP_POST_VARS['text']))));
  397. if (strpos(' '.$HTTP_POST_VARS['atrib'],'i')) $text='<i>'.$text.'</i>';
  398. if (strpos(' '.$HTTP_POST_VARS['atrib'],'u')) $text='<u>'.$text.'</u>';
  399. if (strpos(' '.$HTTP_POST_VARS['atrib'],'b')) $text='<b>'.$text.'</b>';
  400. if (strpos(' '.$HTTP_POST_VARS['size'],'big')) $text='<big>'.$text.'</big>';
  401. if (strpos(' '.$HTTP_POST_VARS['size'],'small')) $text='<small>'.$text.'</small>';
  402. $page=str_replace("<!-- insert -->",$text.$autobr,$page);
  403. $fp = fopen ($userpath.$currentdir.$editfile.'.wml', "w+");
  404. fwrite ($fp, $page);
  405. fclose ($fp);
  406. $param1=$param2=$param3='';
  407. $fp = fopen ($userpath."opeation.cache", "w+");fwrite ($fp, $nocache);fclose ($fp);
  408. include($buildpath.'page_structure.php');
  409. exit;
  410. }
  411. $atr='';
  412. print $head2.
  413. cyr2utf('<br/><u>Текст</u>:'.
  414. '<br/><input name="text'.$nocache.'" type="text" title="Текст" value="" maxlength="2048"/>'.
  415. '<br/>Атрибуты: '.
  416. '<br/><select name="atrib'.$nocache.'" multiple="true" value=""><option value="b">полужирный</option><option value="u">подчеркнутый</option><option value="i">наклонный</option></select>'.
  417. '<br/>Размер: '.
  418. '<br/><select name="size'.$nocache.'" value="normal"><option value="small">мелкий</option><option value="normal">нормальный</option><option value="big">крупный</option></select>'.
  419. '<br/>Автоперенос: '.
  420. '<br/><select name="autobr'.$nocache.'" value="yes"><option value="yes">Включен</option><option value="no">Выключен</option></select>'.
  421. '<br/><select name="tr2cyr'.$nocache.'" multiple="true" value=""><option value="yes">Транслит</option></select>'.
  422. '<br/><anchor>Вставить'.
  423. '<go href="http://wap.kmx.ru" method="post">'.
  424. '<postfield name="query" value="'.$id.'/pm'.$dmpage.$mpage.'/'.$editfile.'/edit'.$dapage.$apage.'/'.$param1.'/insert/text"/>'.
  425. '<postfield name="text" value="$(text'.$nocache.')"/>'.
  426. '<postfield name="text" value="$(text'.$nocache.')"/>'.
  427. '<postfield name="atrib" value="$(atrib'.$nocache.')"/>'.
  428. '<postfield name="size" value="$(size'.$nocache.')"/>'.
  429. '<postfield name="autobr" value="$(autobr'.$nocache.')"/>'.
  430. '<postfield name="tr2cyr" value="$(tr2cyr'.$nocache.')"/>'.
  431. '<postfield name="cacheop" value="'.$nocache.'"/>'.
  432. '</go>'.
  433. '</anchor>');
  434. break;
  435. }
  436.  
  437. print cyr2utf('<br/><a href="http://wap.kmx.ru?'.$id.'/pm'.$dmpage.$mpage.'/'.$editfile.'/edit'.$dapage.$apage.'/'.$param1.'/insert">Отмена</a><br/>');
  438. print '</p></card></wml>';
  439. exit;
  440. ?>