Advertisement
Guest User

Talking portal PHP Kristjan Robam

a guest
Nov 8th, 2021
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 29.40 KB | None | 0 0
  1. 03.11.2021 12:31 5 749 data.php
  2. 03.11.2021 12:31 562 findlastmdate.php
  3. 03.11.2021 12:31 211 func.php
  4. 03.11.2021 12:31 1 201 ilist.php
  5. 03.11.2021 12:31 5 259 index.php
  6. 03.11.2021 12:31 15 839 index2.php
  7. 03.11.2021 12:31 382 renewing.php
  8.  
  9. data.php
  10.  
  11.  
  12. <?php
  13.  
  14. class Dobj {
  15. function getNameOfClass()
  16. {
  17. return static::class;
  18. }
  19. }
  20.  
  21. class Data {
  22.  
  23. var $dtables;
  24.  
  25. function gettime() {
  26. return date("d.m.Y H:i:s");
  27. }
  28.  
  29. function loadobjecttables() {
  30. $dtables = array();
  31. foreach (glob("*.dat") as $file) {
  32. $path_parts = pathinfo($file);
  33. if(!class_exists($path_parts['filename'])) {
  34. continue;
  35. }
  36. $file1 = file_get_contents($file, true);
  37. $dtables[] = unserialize($file1);
  38. }
  39. $this->dtables=$dtables;
  40. }
  41.  
  42. function deleteotable($otabname) {
  43. if (file_exists($otabname.".dat")) {
  44. unlink($otabname.".dat");
  45. }
  46. $this->loadobjecttables();
  47. }
  48.  
  49. function insertobject($obj) {
  50. $this->loadobjecttables();
  51. $oclass=$obj->getNameOfClass();
  52. $tabls=$this->dtables;
  53. $oarridx=-1;
  54. for($i=0; $i<count($tabls); $i++) {
  55. if($tabls[$i][0]->getNameOfClass()==$oclass) {
  56. $oarridx=$i;
  57. }
  58. }
  59. if($oarridx==-1) return false;
  60. $tabls[$oarridx][]=$obj;
  61. unlink($oclass.".dat");
  62. $b=serialize($tabls[$oarridx]);
  63. $fh = fopen($oclass.".dat", "a");
  64. fwrite($fh, $b);
  65. fclose($fh);
  66. chmod($oclass.".dat", 0700);
  67. }
  68.  
  69.  
  70. function saveobjecttables() {
  71. $tabls=$this->dtables;
  72. for($i=0; $i<count($tabls); $i++) {
  73. $oc=$tabls[$i][0]->getNameOfClass();
  74. if (file_exists($oc.".dat")) {
  75. unlink($oc.".dat");
  76. }
  77. $b=serialize($tabls[$i]);
  78. $fh = fopen($oc.".dat", "a");
  79. fwrite($fh, $b);
  80. fclose($fh);
  81. chmod($oc.".dat", 0700);
  82. }
  83. return true;
  84. }
  85.  
  86. function saveobjecttable($objcl) {
  87. $tabls=$this->dtables;
  88. $obclindex=-1;
  89. for($i=0; $i<count($tabls); $i++) {
  90. if($tabls[$i][0]->getNameOfClass()==$objcl) {
  91. $obclindex=$i;
  92. break;
  93. }
  94. }
  95. if (file_exists($objcl.".dat")) {
  96. unlink($objcl.".dat");
  97. }
  98. $b=serialize($tabls[$obclindex]);
  99. $fh = fopen($objcl.".dat", "a");
  100. fwrite($fh, $b);
  101. fclose($fh);
  102. chmod($objcl.".dat", 0700);
  103. return true;
  104. }
  105.  
  106. function makearrayunique($array){
  107. $duplicate_keys = array();
  108. $tmp = array();
  109.  
  110. foreach ($array as $key => $val){
  111. if (is_object($val))
  112. $val = (array)$val;
  113.  
  114. if (!in_array($val, $tmp))
  115. $tmp[] = $val;
  116. else $duplicate_keys[] = $key;
  117. }
  118.  
  119. foreach ($duplicate_keys as $key)
  120. unset($array[$key]);
  121. return $array;
  122. }
  123.  
  124. function deleteduplicates() {
  125. $ob=$this->dtables;
  126. for($i=0; $i<count($ob); $i++) {
  127. $o12=$this->makearrayunique($ob[$i]);
  128. $ob[$i]=$o12;
  129. }
  130. $this->saveobjecttables();
  131. }
  132.  
  133. function deleteduplicatescl($objcl) {
  134. $ob=$this->dtables;
  135. $obclindex=-1;
  136. for($i=0; $i<count($ob); $i++) {
  137. if($ob[$i][0]->getNameOfClass()==$objcl) {
  138. $obclindex=$i;
  139. break;
  140. }
  141. }
  142. $o12=$this->makearrayunique($ob[$obclindex]);
  143. $ob[$obclindex]=$o12;
  144. $this->dtables=$ob;
  145. $this->saveobjecttable($objcl);
  146. }
  147.  
  148.  
  149.  
  150. function objectClassestoarray($objectA,
  151. $objectB) {
  152. $new_object = array();
  153.  
  154. foreach($objectA as $property => $value) {
  155. $new_object[$property]=$value;
  156. }
  157.  
  158. foreach($objectB as $property => $value) {
  159. $new_object[$property]=$value;
  160. }
  161.  
  162. return $new_object;
  163. }
  164.  
  165.  
  166. function query($query) {
  167. $this->loadobjecttables();
  168. $ovars=array();
  169. $objects=$this->dtables;
  170. for($i=0; $i<count($objects); $i++) {
  171. $ovars[]=array_keys(get_object_vars($objects[$i][0]));
  172. }
  173. $mches=array();
  174. $results=null;
  175. $exitf=false;
  176.  
  177. for($i=0; $i<count($objects); $i++) {
  178. if($exitf) break;
  179. for($j=0; $j<count($ovars); $j++) {
  180. if($exitf) break;
  181. if(!class_exists($objects[$i][0]->getNameOfClass())) continue;
  182. if(preg_match("/^get \* from ".$objects[$i][0]->getNameOfClass().";$/",$query)) {
  183. $objectsList = [];
  184. foreach ($objects[$i] as $obj) {
  185. $objectsList[] = (array)$obj;
  186. }
  187. return $objectsList;
  188. $exitf=true;
  189. }
  190. }
  191. }
  192.  
  193. for($i=0; $i<count($objects); $i++) {
  194. if($exitf) break;
  195. for($j=0; $j<count($ovars); $j++) {
  196. if($exitf) break;
  197. if(!class_exists($objects[$i][0]->getNameOfClass())) continue;
  198. if(preg_match("/^get ".$ovars[$i][$j]." from ".$objects[$i][0]->getNameOfClass().";$/",$query)) {
  199. return array_column($objects[$i], $ovars[$i][$j]);
  200. $exitf=true;
  201. }
  202. }
  203. }
  204.  
  205. $outp=array();
  206. for($i=0; $i<count($objects); $i++) {
  207. if($exitf) break;
  208. for($j=0; $j<count($ovars[$i]); $j++) {
  209. if($exitf) break;
  210. for($k=0; $k<count($objects); $k++) {
  211. if($exitf) break;
  212. for($l=0; $l<count($ovars[$k]); $l++) {
  213. if($exitf) break;
  214. if(!class_exists($objects[$i][0]->getNameOfClass())) continue;
  215. if(!class_exists($objects[$k][0]->getNameOfClass())) continue;
  216.  
  217. if(preg_match("/^get \* from ".$objects[$i][0]->getNameOfClass()." join ".$objects[$k][0]->getNameOfClass().
  218. " on \(".$objects[$i][0]->getNameOfClass()."\.".$ovars[$i][$j]."\=".$objects[$k][0]->getNameOfClass().
  219. "\.".$ovars[$k][$l]."\);$/",$query)) {
  220. for($ii=0; $ii<count($objects[$i]); $ii++) {
  221. for($ii2=0; $ii2<count($objects[$k]);$ii2++) {
  222. if($objects[$i][$ii]->{$ovars[$i][$j]}==$objects[$k][$ii2]->{$ovars[$k][$l]}) {
  223. $oobj = $this->objectClassestoarray($objects[$i][$ii], $objects[$k][$ii2]);
  224. $outp[]=$oobj;
  225. }
  226. }
  227. }
  228. $exitf=true;
  229. }
  230. }
  231. }
  232. }
  233. }
  234.  
  235. for($k=0; $k<count($objects); $k++) {
  236. if($exitf) break;
  237. for($l=0; $l<count($ovars[$k]); $l++) {
  238. if($exitf) break;
  239. for($l2=0; $l2<count($ovars[$k]); $l2++) {
  240. if($exitf) break;
  241. if(!class_exists($objects[$k][0]->getNameOfClass()))
  242. continue;
  243.  
  244. if(preg_match("/^get \* from ".$objects[$k][0]->getNameOfClass()." where ".$ovars[$k][$l]."\=(.*) and ".$ovars[$k][$l2]."\=(.*);$/",$query, $matches)) {
  245. for($ii2=0;
  246. $ii2<count($objects[$k]); $ii2++) {
  247.  
  248. if($objects[$k][$ii2]->{$ovars[$k][$l]}==$matches[1]&&$objects[$k][$ii2]->{$ovars[$k][$l2]}==$matches[2]) {
  249.  
  250. $oobj = (array)$objects[$k][$ii2];
  251.  
  252. $outp[]=$oobj;
  253. }
  254. }
  255. $exitf=true;
  256. }
  257. }
  258. }
  259. }
  260.  
  261.  
  262. for($k=0; $k<count($objects); $k++) {
  263. if($exitf) break;
  264. for($l=0; $l<count($ovars[$k]); $l++) {
  265. if($exitf) break;
  266. if(!class_exists($objects[$k][0]->getNameOfClass())) continue;
  267. if(preg_match("/^get \* from ".$objects[$k][0]->getNameOfClass()." where ".$ovars[$k][$l]."\=(.*);$/",$query, $matches)) {
  268. for($ii2=0; $ii2<count($objects[$k]); $ii2++) {
  269. if($objects[$k][$ii2]->{$ovars[$k][$l]}==$matches[1]) {
  270. $oobj = (array)$objects[$k][$ii2];
  271. $outp[]=$oobj;
  272. }
  273. }
  274. $exitf=true;
  275. }
  276. }
  277. }
  278.  
  279. if(count($outp)>0) {
  280. return $outp;
  281. }
  282.  
  283.  
  284. return $mches;
  285. }
  286.  
  287. }
  288.  
  289. ?>
  290. findlastmdate.php
  291.  
  292.  
  293. <?php
  294.  
  295. include("../data.php");
  296.  
  297. class Msg extends Dbobj{
  298. var $text;
  299. }
  300.  
  301. $myd=new Data();
  302.  
  303. $myd->loadobjecttables();
  304. $texists=false;
  305. $t1=$myd->dtables;
  306.  
  307. $mdates=array();
  308.  
  309. for($i=0; $i<count($t1);$i++) {
  310. if($t1[$i][0]->getNameOfClass()=="Msg") {
  311. $texists=true;
  312. break;
  313. }
  314. }
  315.  
  316. if($texists==true) {
  317. $t2=$mydb->query("get text from Msg;");
  318. for($i=0; $i<count($t2);$i++) {
  319. $date12=date("d.m.Y H:i:s", strtotime(substr($t2[$i], 0, 19)));
  320. $d_start = new DateTime($date12);
  321. $mdates[]=$d_start;
  322. }
  323. echo $mdates[count($mdates)-1]->format('d.m.Y H:i:s');;
  324. } else {
  325. echo "";
  326. }
  327.  
  328. ?>
  329. func.php
  330.  
  331.  
  332. <?php
  333.  
  334.  
  335. function rrmdir($dir) {
  336. $files = array_diff(scandir($dir), array('.','..'));
  337. foreach ($files as $file) {
  338. (is_dir("$dir/$file")) ? rrmdir("$dir/$file") : unlink("$dir/$file");
  339. }
  340. return rmdir($dir);
  341. }
  342.  
  343.  
  344. ?>
  345. ilist.php
  346.  
  347.  
  348. <?php
  349.  
  350. include("../data.php");
  351.  
  352. class Msg extends Dobj{
  353. var $text;
  354. }
  355.  
  356. class Inimene extends Dobj{
  357. var $name;
  358. var $time;
  359. var $dpic;
  360. }
  361.  
  362.  
  363. $myd=new Data();
  364.  
  365. $myd->loadobjecttables();
  366. $texists=false;
  367. $t1=$myd->dtables;
  368.  
  369. $ilist=array();
  370.  
  371. $itidx=-1;
  372. for($i=0; $i<count($t1);$i++) {
  373. if($t1[$i][0]->getNameOfClass()=="Inimene") {
  374. $texists=true;
  375. $itidx=$i;
  376. break;
  377. }
  378. }
  379.  
  380. $newi=array();
  381.  
  382. if($itidx>-1) {
  383. for($i=0; $i<count($t1[$itidx]);$i++) {
  384. $date12=date("d.m.Y H:i:s", strtotime($t1[$itidx][$i]->time));
  385. $dtime = new DateTime($date12);
  386.  
  387. $datenow=date( 'd.m.Y H:i:s', strtotime( '+3 hour' , strtotime("now") ));
  388. $dtimenow = new DateTime($datenow);
  389.  
  390. $diff = $dtimenow->getTimestamp() - $dtime->getTimestamp();
  391. if($diff<60*15) {
  392. $newi[]=$t1[$itidx][$i];
  393. } else {
  394. }
  395. }
  396. if(count($newi)==0) {
  397. unset($t1[$itidx]);
  398. unlink("Inimene.dat");
  399. } else {
  400. $t1[$itidx]=$newi;
  401. $myd->dtables=$t1;
  402. $myd->saveobjecttable("Inimene");
  403. }
  404. }
  405.  
  406. if($texists==true) {
  407. $t2=$myd->query("get name from Inimene;");
  408. for($i=0; $i<count($t2);$i++) {
  409. $ilist[]=$t2[$i];
  410. }
  411. } else {
  412.  
  413. }
  414.  
  415. $result = array_unique($ilist);
  416. $List = implode(', ', $result);
  417. if(substr($List,strlen($List)-2, 2)==", ") {
  418. $List=substr($List, 0, strlen($List)-2);
  419. }
  420. echo $List;
  421.  
  422. ?>
  423. index.php
  424.  
  425.  
  426. <!DOCTYPE html>
  427. <html>
  428. <head>
  429. <link rel="icon" style="width:15px; height=15px; background-color: #76FEFF; color: #76FEFF;"/>
  430.  
  431. <style>
  432. input {
  433. color: #76FEFF;
  434. }
  435.  
  436. body {
  437. /*
  438. background-image: url("img.jpg");
  439.  
  440. background-repeat: repeat;
  441. background-size: 100%;
  442. */
  443.  
  444. background-color: #76FEFF;
  445.  
  446. }
  447.  
  448. .main12 {
  449. text-decoration:none;
  450. color: #76FEFF;
  451. font-weight: bold;
  452. background-color: white;
  453. border: 1px solid white;
  454. border-radius: 10px 10px;
  455. padding: 5px;
  456. font-weight:bold;
  457. }
  458. .main1 {
  459. text-decoration:none;
  460. color: white;
  461. border-radius: 5px 5px;
  462. padding: 5px;
  463. font-weight:bold;
  464. width:775px;
  465. }
  466.  
  467. .main12 {
  468. text-decoration:none;
  469. color: #76FEFF;
  470. border-radius: 5px 5px;
  471. padding: 5px;
  472. font-weight:bold;
  473. vertical-align: middle;
  474. width:535px;
  475. }
  476.  
  477. .main2 {
  478. color: white;
  479. }
  480.  
  481. .main3 {
  482. text-decoration:none;
  483. color: #76FEFF;
  484. font-weight: bold;
  485. background-color: white;
  486. border: 1px solid white;
  487. border-radius: 5px 5px;
  488. padding: 5px;
  489. font-weight:bold;
  490. width:100px;
  491. display:block;
  492.  
  493. }
  494.  
  495. .w1 {
  496. color: white;
  497. }
  498. .w2 {
  499. color: white;
  500. display:inline-block;
  501. }
  502. .pwd {
  503. color: #76FEFF;
  504. display:inline-block;
  505. }
  506.  
  507. .w21 {
  508. color: white;
  509. display:block;
  510. }
  511.  
  512. </style>
  513. </head>
  514. <body>
  515. <h1 class="main1">
  516. </h1>
  517. <h1 class="main12" style="line-height: 45px;">W e l c o m e . T e r e t u l e m a s t .</h1>
  518. <h1 class="main1">
  519. </h1>
  520.  
  521. <?php
  522.  
  523. include("func.php");
  524. include("data.php");
  525.  
  526. class Password extends Dobj{
  527. var $content;
  528. }
  529.  
  530.  
  531. $dirs = array_filter(glob('*'), 'is_dir');
  532.  
  533. $cannotcreate=false;
  534.  
  535.  
  536. if(count($dirs)>60) {
  537. $cannotcreate=true;
  538. }
  539.  
  540.  
  541. if(!empty($_POST['rname'])&&($_POST['rname']!=" ")&&!empty($_POST['rname'])&$cannotcreate==false) {
  542. $_POST['rname'] = strip_tags($_POST['rname']);
  543. $_POST['rname']=substr($_POST['rname'],0, 100);
  544. $_POST['rname'] = str_replace(' ', 'space21326', $_POST['rname']);
  545. $_POST['rname'] = str_replace(',', 'comma21326', $_POST['rname']);
  546. $_POST['rname'] = str_replace('?', 'q21326', $_POST['rname']);
  547. $_POST['rname'] = str_replace('\'', 'ukom21326', $_POST['rname']);
  548. mkdir($_POST['rname'], 0755);
  549.  
  550.  
  551. if(!empty($_POST['password'])&&$_POST['password']!="") {
  552. $myd=new Data();
  553. $tabls=array();
  554. $pwd1=new Password();
  555. $pwd1->content=$_POST['password'];
  556. $pwdt=array();
  557. $pwdt[]=$pwd1;
  558. $tabls[]=$pwdt;
  559. $myd->dtables=$tabls;
  560. $myd->saveobjecttable("Password");
  561.  
  562.  
  563. $file = 'Password.dat';
  564. $newfile = 'Password.dat';
  565. if (!copy($file, $_POST['rname'].'/'.$newfile)) {
  566. echo "Error\n";
  567. }
  568. chmod($_POST['rname'].'/'.$newfile, 0700);
  569.  
  570.  
  571. unlink("Password.dat");
  572. }
  573.  
  574.  
  575. $file = 'index2.php';
  576. $newfile = 'index.php';
  577. if (!copy($file, $_POST['rname'].'/'.$newfile)) {
  578. echo "Error\n";
  579. }
  580. chmod($_POST['rname'].'/'.$newfile, 0744);
  581.  
  582. $file = 'renewing.php';
  583. $newfile = 'renewing.php';
  584.  
  585. if (!copy($file, $_POST['rname'].'/'.$newfile)) {
  586. echo "Error\n";
  587. }
  588.  
  589. chmod($_POST['rname'].'/'.$newfile, 0744);
  590.  
  591. $file = 'ilist.php';
  592. $newfile = 'ilist.php';
  593.  
  594. if (!copy($file, $_POST['rname'].'/'.$newfile)) {
  595. echo "Error\n";
  596. }
  597.  
  598. chmod($_POST['rname'].'/'.$newfile, 0744);
  599.  
  600. $file = 'findlastmdate.php';
  601. $newfile = 'findlastmdate.php';
  602.  
  603. if (!copy($file, $_POST['rname'].'/'.$newfile)) {
  604. echo "Error\n";
  605. }
  606.  
  607. chmod($_POST['rname'].'/'.$newfile, 0744);
  608.  
  609. $file = 'func.php';
  610. $newfile = 'func.php';
  611.  
  612. if (!copy($file, $_POST['rname'].'/'.$newfile)) {
  613. echo "Error\n";
  614. }
  615.  
  616. chmod($_POST['rname'].'/'.$newfile, 0744);
  617.  
  618. }
  619.  
  620. $dirs = array_filter(glob('*'), 'is_dir');
  621.  
  622. if(count($dirs)>0) {
  623. echo "<h2 class='main2'>Topics</h2>";
  624. }
  625.  
  626. $dirs = array_filter(glob('*'), 'is_dir');
  627.  
  628. foreach ($dirs as $file) {
  629. $file2= str_replace('space21326', '&nbsp;', $file);
  630. $file2= str_replace('comma21326', ',', $file2);
  631. $file2= str_replace('q21326', '?', $file2);
  632. $file2= str_replace('ukom21326', '\'', $file2);
  633. if($file=="files") continue;
  634.  
  635. $dir1='//'.$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF']);
  636. $output = file_get_contents('http:'.$dir1.$file.'/findlastmdate.php');
  637. if($output!="") {
  638. $date12=date("d.m.Y H:i:s", strtotime($output));
  639. $d_start = new DateTime($date12);
  640. $currentdate = date('d.m.Y H:i:s', time());
  641. $d_end = new DateTime($currentdate);
  642. $diff = $d_start->diff($d_end);
  643. $delete1=false;
  644. if(!($diff->format('%d')<1000||$diff->format('%d')==1000&&$diff->format('%h')<1))
  645. $delete1=true;
  646. if($delete1) {
  647. rrmdir('/'.$file);
  648. continue;
  649. }
  650. }
  651. echo '<a class="main12" href=\'http:'.$dir1.$file.'\'>'.$file2.'</a>';
  652. echo "<p></p>";
  653. $path_parts = pathinfo($file.'/Msg.dat');
  654. if(!class_exists($path_parts['filename'])) {
  655. continue;
  656. }
  657. }
  658.  
  659.  
  660. ?>
  661. <p style="height:50px;"> </p>
  662.  
  663. <form method="POST">
  664. <p class="w2">
  665. Topic:
  666. </p>
  667. <input name="rname"/>
  668. <p class="w21">
  669. Password(optional)
  670. </p>
  671. <input class="pwd" name="password" type="password"/>
  672. <p class="w">
  673. </p>
  674. <input type="submit" class="main3" value="Create"/>
  675. </form>
  676. <p class="w1" style="color: #j3k4f8; font-weight: bold;">
  677. To access password protected topic: /index.php?code=Password</p>
  678. <p class="w1" style="color: #j3k4f8; font-weight: bold;">Attention: Please try to behave, while in talkrooms.....</p>
  679. <p></p>
  680. <p></p>
  681. <p>&nbsp;</p>
  682. <p>&nbsp;</p>
  683. <p class="w1"></p>
  684. <p>&nbsp;</p>
  685. <p>&nbsp;</p>
  686. <p>&nbsp;</p>
  687. <p>&nbsp;</p>
  688.  
  689. </body>
  690. </html>
  691.  
  692. index2.php
  693.  
  694.  
  695. <!DOCTYPE html>
  696. <html>
  697. <head>
  698. <link rel="icon" style="width:15px; height=15px; background-color: #76FEFF; color: #76FEFF;"/>
  699.  
  700. <style>
  701. input {
  702. color: #76FEFF;
  703. }
  704.  
  705. body {
  706. background-color: #76FEFF;
  707. }
  708.  
  709. .file1 {
  710. text-decoration: none;
  711. color: #76FEFF;
  712. }
  713.  
  714. .main1 {
  715. text-decoration:none;
  716. color: #76FEFF;
  717. background-color: white;
  718. border: 1px solid white;
  719. border-radius: 5px 5px;
  720. padding: 5px;
  721. font-weight:bold;
  722. width:100px;
  723. }
  724.  
  725. .main2 {
  726. color: white;
  727. margin-top:-15px;
  728. }
  729.  
  730. .main3 {
  731. text-decoration:none;
  732. color: #76FEFF;
  733. background-color: white;
  734. border: 1px solid white;
  735. border-radius: 5px 5px;
  736. padding: 5px;
  737. font-weight:bold;
  738. width:100px;
  739. }
  740.  
  741. .main4 {
  742. color: white;
  743. width: 140px;
  744. }
  745.  
  746. .main5 {
  747. color: white;
  748. margin-top:-15px;
  749. margin-bottom:1px;
  750. }
  751. .main6 {
  752. color: white;
  753. margin-top:15px;
  754. width:600px;
  755. overflow-wrap: break-word;
  756. }
  757. .main7 {
  758. margin-bottom:1px;
  759. }
  760.  
  761. .text1 {
  762. color: #76FEFF;
  763. width: 538px;
  764. height: 29px;
  765. margin-top:-15px;
  766. overflow-wrap: break-word;
  767. }
  768.  
  769. textarea {
  770. color: black;
  771. }
  772. form {
  773. line-height: 1.4;
  774. }
  775.  
  776. .a1 {
  777. line-height: 1.4;
  778. width: 561px;
  779. height: 357px;
  780. overflow-y: auto;
  781. overflow-x: hidden;
  782. background-color: white;
  783. overflow-wrap: break-word;
  784. color: #76FEFF;
  785. }
  786.  
  787. .a1 p {
  788. height:0.001%;
  789. margin-bottom:-15px;
  790. }
  791. .nameslist {
  792. margin-bottom:15px;
  793. }
  794. </style>
  795. <script>
  796. function imgError(image) {
  797. image.onerror = "";
  798. image.src = "../noimage.jpg";
  799. image.style="background-color: #848587;";
  800. image.width="40px";
  801. image.height="40px";
  802. return true;
  803. }
  804. </script>
  805. </head>
  806. <body onload="a00000()">
  807.  
  808. <?php
  809.  
  810. include("func.php");
  811.  
  812.  
  813. $size = 0;
  814.  
  815. $files = glob('uploads/*.*');
  816. usort($files, function($a, $b) {
  817. return filemtime($a) < filemtime($b);
  818. });
  819. $idx=0;
  820.  
  821. $files = array_reverse($files, true);
  822.  
  823. if(is_dir("uploads")) {
  824. foreach($files as $file) {
  825. if($idx==count($files)-1) break;
  826. $filesize = filesize($file);
  827. $size+=$filesize;
  828. $idx++;
  829. }
  830. $idx=0;
  831. if($size>5000000) {
  832. foreach($files as $file) {
  833. if($idx==count($files)-1) break;
  834. unlink($file);
  835. $idx++;
  836. }
  837. }
  838. }
  839.  
  840.  
  841. $size = 0;
  842.  
  843. $files = glob('dpic/*.*');
  844. usort($files, function($a, $b) {
  845. return filemtime($a) < filemtime($b);
  846. });
  847. $idx=0;
  848.  
  849. $files = array_reverse($files, true);
  850.  
  851. if(is_dir("dpic")) {
  852. foreach($files as $file) {
  853. if($idx==count($files)-1) break;
  854. $filesize = filesize($file);
  855. $size+=$filesize;
  856. $idx++;
  857. }
  858. $idx=0;
  859. if($size>5000000) {
  860. foreach($files as $file) {
  861. if($idx==count($files)-1) break;
  862. unlink($file);
  863. $idx++;
  864. }
  865. }
  866. }
  867.  
  868. include("../data.php");
  869.  
  870. class Password extends Dobj{
  871. var $content;
  872. }
  873.  
  874.  
  875. class Msg extends Dobj{
  876. var $text;
  877. var $messagenumber;
  878. }
  879.  
  880. class Inimene extends Dobj{
  881. var $name;
  882. var $time;
  883. var $dpic;
  884. var $inr;
  885. }
  886.  
  887. class Picture extends Dobj{
  888. var $name;
  889. var $time;
  890. }
  891.  
  892. $myd=new Data();
  893.  
  894. $myd->loadobjecttables();
  895.  
  896.  
  897. $itime2=$myd->gettime();
  898. $itime2=date( 'd.m.Y H:i:s', strtotime( '+3 hour' , strtotime($itime2) ) );
  899.  
  900. if(!is_dir("uploads")) {
  901. mkdir("uploads", 0777);
  902. }
  903.  
  904. if(!is_dir("dpic")) {
  905. mkdir("dpic", 0777);
  906. }
  907.  
  908. $files1 = scandir("uploads");
  909.  
  910. if(count($files1)>270) {
  911. rrmdir("uploads");
  912. mkdir("uploads", 0777);
  913. }
  914.  
  915.  
  916.  
  917. $msg=new Msg();
  918. $name1 = strip_tags($_POST['text0']);
  919.  
  920. if($name1!="") {
  921. $name1=substr($name1,0, 646);
  922. }
  923.  
  924. $addline=true;
  925.  
  926. $tabls=$myd->dtables;
  927.  
  928. $time=null;
  929. $tidx=-1;
  930. $nooutput=false;
  931. $oput="";
  932.  
  933. $pwd1="";
  934.  
  935. $newmessagenr=1;
  936. $newinumber=1;
  937.  
  938.  
  939. if($tabls!=null) {
  940. for($i=0; $i<count($tabls); $i++) {
  941. $oc=$tabls[$i][0]->getNameOfClass();
  942. if($oc=="Msg") {
  943. $biggestnr=0;
  944. for($j=0; $j<count($tabls[$i]); $j++) {
  945. if($tabls[$i][$j]->messagenumber>$biggestnr) $biggestnr=$tabls[$i][$j]->messagenumber;
  946. }
  947. $newmessagenr=$biggestnr+1;
  948. }
  949. }
  950. }
  951.  
  952.  
  953. if($tabls!=null) {
  954. for($i=0; $i<count($tabls); $i++) {
  955. $oc=$tabls[$i][0]->getNameOfClass();
  956. if($oc=="Inimene") {
  957. $biggestnr=0;
  958. for($j=0; $j<count($tabls[$i]); $j++) {
  959. if($tabls[$i][$j]->inr>$biggestnr) $biggestnr=$tabls[$i][$j]->inr;
  960. }
  961. $newinumber=$biggestnr+1;
  962. }
  963. }
  964. }
  965.  
  966.  
  967. if($tabls!=null) {
  968. for($i=0; $i<count($tabls); $i++) {
  969. $oc=$tabls[$i][0]->getNameOfClass();
  970. if ($oc=="Password") {
  971. $pwd1=$tabls[$i][0]->content;
  972. }
  973. }
  974. }
  975.  
  976. $pwdactive=0;
  977. if($pwd1!="") {
  978.  
  979. $pwdactive=1;
  980.  
  981. if($pwd1!=$_GET['code']) exit(0);
  982.  
  983. }
  984.  
  985.  
  986. $pic_uploaded=false;
  987.  
  988. $newpic1=null;
  989.  
  990. if(isset($_POST["submit"])&&$_FILES["fileToUpload"]['error']==0) {
  991.  
  992. $target_dir = "uploads/";
  993. $target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]);
  994. $uploadOk = 1;
  995. $imageFileType = strtolower(pathinfo($target_file,PATHINFO_EXTENSION));
  996.  
  997. if (file_exists($target_file)) {
  998. $uploadOk = 0;
  999. }
  1000. if ($_FILES["fileToUpload"]["size"] > 5000000) {
  1001. $uploadOk = 0;
  1002. }
  1003. if($imageFileType=="php") {
  1004. $uploadOk = 0;
  1005. }
  1006. $time1212=time();
  1007.  
  1008. if ($uploadOk == 0) {
  1009. } else {
  1010. if (move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], str_replace('.', $time1212.'.', $target_file))) {
  1011. $pic_uploaded=true;
  1012. } else {
  1013. }
  1014. }
  1015.  
  1016.  
  1017. $newpic=null;
  1018. $tabls0=null;
  1019. if($pic_uploaded==true) {
  1020. $tabls0=$myd->dtables;
  1021. $picstidx=-1;
  1022. if($tabls0!=null) {
  1023. for($i=0; $i<count($tabls0); $i++) {
  1024. $oc0=$tabls0[$i][0]->getNameOfClass();
  1025. if ($oc0=="Picture") {
  1026. $picstidx=$i;
  1027. }
  1028. }
  1029. if($picstidx==-1) {
  1030. $picstidx=count($tabls0);
  1031. $tabls0[]=array();
  1032. }
  1033. } else {
  1034. $tabls0=array();
  1035. $tabls0[]=array();
  1036. $picstidx=0;
  1037. }
  1038.  
  1039. $newpic=new Picture();
  1040. $newpic->name=basename(str_replace('.', $time1212.'.', $_FILES["fileToUpload"]["name"]));
  1041. $newpic->time=$itime2;
  1042. $newpic1=$newpic;
  1043. $tabls0[$picstidx][]=$newpic;
  1044. $myd->dtables=$tabls0;
  1045. $myd->saveobjecttable("Picture");
  1046. }
  1047.  
  1048. }
  1049.  
  1050.  
  1051. $url = isset($_SERVER['HTTPS']) ? 'https://' : 'http://';
  1052. $url .= $_SERVER['SERVER_NAME'];
  1053. $url .= $_SERVER['REQUEST_URI'];
  1054. $info = parse_url($url);
  1055. $info["path"]=dirname($info["path"]);
  1056.  
  1057. $new_url = $info["scheme"]."://".$info["host"];
  1058.  
  1059. $new_url = str_replace(' ', '', $new_url);
  1060.  
  1061. echo "<a class='main1' href='".$new_url."'>Avalehele</a><p></p>";
  1062.  
  1063. function strip($var) {
  1064. $allowed = '<font>';
  1065. return strip_tags($var, $allowed);
  1066. }
  1067.  
  1068. function closetags ( $html )
  1069. {
  1070. preg_match_all ( "#<([a-z]+)( .*)?(?!/)>#iU", $html, $result );
  1071. $openedtags = $result[1];
  1072.  
  1073. preg_match_all ( "#</([a-z]+)>#iU", $html, $result );
  1074. $closedtags = $result[1];
  1075. $len_opened = count ( $openedtags );
  1076.  
  1077. if( count ( $closedtags ) == $len_opened )
  1078. {
  1079. return $html;
  1080. }
  1081. $openedtags = array_reverse ( $openedtags );
  1082.  
  1083. for( $i = 0; $i < $len_opened; $i++ )
  1084. {
  1085. if ( !in_array ( $openedtags[$i], $closedtags ) )
  1086. {
  1087. $html .= "</" . $openedtags[$i] . ">";
  1088. }
  1089. else
  1090. {
  1091. unset ( $closedtags[array_search ( $openedtags[$i],
  1092. $closedtags)] );
  1093. }
  1094. }
  1095. return $html;
  1096. }
  1097.  
  1098.  
  1099. $ind=array();
  1100. $itidx=-1;
  1101. if($tabls!=null) {
  1102. for($i=0; $i<count($tabls); $i++) {
  1103. $oc=$tabls[$i][0]->getNameOfClass();
  1104. if ($oc=="Inimene") {
  1105. $ind=$tabls[$i];
  1106. $itidx=$i;
  1107. }
  1108. }
  1109. }
  1110.  
  1111.  
  1112.  
  1113. if($ind!=null) {
  1114. if(count($ind)>2499) {
  1115. echo "Topic full(2500).";
  1116. exit(0);
  1117. }
  1118. }
  1119.  
  1120. $iexists=false;
  1121. $currenti=null;
  1122. for($i=0; $i<count($ind); $i++) {
  1123. if($ind[$i]->name==$name1) {
  1124. $iexists=true;
  1125. $currenti=$ind[$i];
  1126. }
  1127. }
  1128.  
  1129.  
  1130. $havewritten=false;
  1131.  
  1132.  
  1133.  
  1134. $myname = strip_tags($_POST['myname']);
  1135.  
  1136.  
  1137. if($myname!="") {
  1138. $myname=substr($myname,0, 646);
  1139. }
  1140.  
  1141. if($myname!="") {
  1142. $havewritten=true;
  1143. }
  1144.  
  1145. if(count($ind)>0) {
  1146.  
  1147. if($name1!=""&&$havewritten==false&&$iexists==false) {
  1148. $curi=new Inimene();
  1149. $curi->name=$name1;
  1150. $myname=$name1;
  1151. $curi->time=$itime2;
  1152. $curi->inr=$newinumber;
  1153. $ind[]=$curi;
  1154. $tabls[$itidx]=$ind;
  1155. $myd->dtables=$tabls;
  1156. $myd->saveobjecttable("Inimene");
  1157. $currenti=$curi;
  1158. } else if($name1!=""&&$havewritten==true&&$iexists==false) {
  1159. for($i=0; $i<count($ind); $i++) {
  1160. if($ind[$i]->name==$myname) {
  1161. $currenti=$ind[$i];
  1162. }
  1163. }
  1164. $currenti->name=$name1;
  1165. $myname=$name1;
  1166. $currenti->time=$itime2;
  1167. $myd->dtables=$tabls;
  1168. $myd->saveobjecttable("Inimene");
  1169.  
  1170. }
  1171. else if($name1!=""&&$currenti->name==$name1&&$iexists==true) {
  1172. $currenti->time=$itime2;
  1173. $itime=$itime2;
  1174. $myd->dtables=$tabls;
  1175. $myd->saveobjecttable("Inimene");
  1176. }
  1177.  
  1178. } else {
  1179.  
  1180. if($name1!=""&&$iexists==false) {
  1181. $curi=new Inimene();
  1182. $curi->name=$name1;
  1183. $curi->time=$itime2;
  1184. $curi->inr=$newinumber;
  1185. $myname=$name1;
  1186. $ind12=array();
  1187. $ind12[]=$curi;
  1188. $tabls[]=$ind12;
  1189. $myd->dtables=$tabls;
  1190. $myd->saveobjecttables();
  1191. $currenti=$curi;
  1192. }
  1193. else if($name1!=""&&$iexists==true) {
  1194. echo "User exists.";
  1195. exit(0);
  1196. }
  1197. }
  1198.  
  1199. $pic_uploaded2=false;
  1200.  
  1201.  
  1202. if(isset($_POST["submit"])&&$_FILES["fileToUpload2"]['error']==0) {
  1203.  
  1204. $target_dir = "dpic/";
  1205. $target_file = $target_dir . basename($_FILES["fileToUpload2"]["name"]);
  1206. $uploadOk = 1;
  1207. $imageFileType = strtolower(pathinfo($target_file,PATHINFO_EXTENSION));
  1208.  
  1209. if (file_exists($target_file)) {
  1210. $uploadOk = 0;
  1211. }
  1212. if ($_FILES["fileToUpload2"]["size"] > 5000000) {
  1213. $uploadOk = 0;
  1214. }
  1215. if($imageFileType=="php"||!($imageFileType=="jpg"||$imageFileType=="png"||$imageFileType=="gif"||$imageFileType=="jpeg")) {
  1216. $uploadOk = 0;
  1217. }
  1218. $time1212=time();
  1219. if ($uploadOk == 0) {
  1220. } else {
  1221. if (move_uploaded_file($_FILES["fileToUpload2"]["tmp_name"], str_replace('.', $time1212.'.', $target_file))) {
  1222. chmod(str_replace('.', $time1212.'.', $target_file), 0744);
  1223. $pic_uploaded2=true;
  1224. }
  1225. }
  1226.  
  1227. $newpic2=null;
  1228. $tabls0=null;
  1229. if($pic_uploaded2==true) {
  1230. $tabls0=$myd->dtables;
  1231. $picstidx=-1;
  1232. if($tabls0!=null) {
  1233. for($i=0; $i<count($tabls0); $i++) {
  1234. $oc0=$tabls0[$i][0]->getNameOfClass();
  1235. if ($oc0=="Picture") {
  1236. $picstidx=$i;
  1237. }
  1238. }
  1239. if($picstidx==-1) {
  1240. $picstidx=count($tabls0);
  1241. $tabls0[]=array();
  1242. }
  1243. } else {
  1244. $tabls0=array();
  1245. $tabls0[]=array();
  1246. $picstidx=0;
  1247. }
  1248.  
  1249. $newpic2=new Picture();
  1250. $newpic2->name=basename(str_replace('.', $time1212.'.', $_FILES["fileToUpload2"]["name"]));
  1251. $newpic2->time=$itime2;
  1252. $tabls0[$picstidx][]=$newpic2;
  1253. $myd->dtables=$tabls0;
  1254. $myd->saveobjecttable("Picture");
  1255. $currenti->dpic=$newpic2->name;
  1256. $myd->saveobjecttable("Inimene");
  1257.  
  1258. }
  1259. }
  1260.  
  1261.  
  1262. $msg1=strip($_POST['text1']);
  1263. $msg1 = preg_replace('#<script(.*?)>(.*?)</script>#is', '', $msg1);
  1264. $msg12=$msg1;
  1265.  
  1266. if($currenti->dpic!=""||$currenti->dpic!=null) {
  1267. $msg->text=$itime2." ".$name1." <img src='dpic/".$currenti->dpic."' onerror='imgError(this);' style='width: 50px;' > : ".$msg1;
  1268. } else {
  1269. $msg->text=$itime2." ".$name1." : ".$msg1;
  1270. }
  1271. $msg->text=substr($msg->text,0, 216345);
  1272. $msg->text=closetags($msg->text);
  1273. $msg->messagenumber=$newmessagenr;
  1274.  
  1275. $texists=false;
  1276. $msgtidx=0;
  1277.  
  1278. $t1=$myd->dtables;
  1279.  
  1280.  
  1281. for($i=0; $i<count($t1);$i++) {
  1282. if($t1[$i][0]->getNameOfClass()=="Msg") {
  1283. $msgtidx=$i;
  1284. $texists=true;
  1285. if(count($t1[$i])>165) {
  1286. $arr12 = array_slice($t1[$i], -165);
  1287. $t1[$i]=$arr12;
  1288. $myd->dtables=$t1;
  1289. $myd->saveobjecttable("Msg");
  1290. break;
  1291. }
  1292. break;
  1293. }
  1294. }
  1295. $tabls=$myd->dtables;
  1296.  
  1297.  
  1298. if(!empty($_POST['text1'])&&$addline==true) {
  1299. if (strlen(trim($msg1)) != 0&&$pic_uploaded==true) {
  1300. if($texists==false) {
  1301. $aone=array();
  1302. $ftype = strtolower(pathinfo("uploads/".$newpic1->name,PATHINFO_EXTENSION));
  1303. if($ftype=="jpg"||$ftype=="png"||$ftype=="jpeg"||$ftype=="gif") {
  1304.  
  1305. $imgsize = getimagesize("uploads/".$newpic1->name);
  1306. $width=$imgsize[0];
  1307. $height=$imgsize[1];
  1308. if($width>450) {
  1309. $width=450;
  1310. }
  1311. $msg->text.="<p></p><img src='uploads/".$newpic1->name."' onerror='imgError(this);' style='width: ".$width."px;' >";
  1312. $msg->messagenumber=$newmessagenr;
  1313. } else {
  1314. $msg->text.="<p></p><a class='file1' href='uploads/".$newpic1->name."'>File: ".$newpic1->name."</a>";
  1315. }
  1316. $aone[]=$msg;
  1317. $tabls[]=$aone;
  1318. $myd->dtables=$tabls;
  1319. $myd->saveobjecttable("Msg");
  1320. } else {
  1321. $ftype = strtolower(pathinfo("uploads/".$newpic1->name,PATHINFO_EXTENSION));
  1322. if($ftype=="jpg"||$ftype=="png"||$ftype=="jpeg"||$ftype=="gif") {
  1323. $imgsize = getimagesize("uploads/".$newpic1->name);
  1324. $width=$imgsize[0];
  1325. $height=$imgsize[1];
  1326. if($width>450) {
  1327. $width=450;
  1328. }
  1329. $msg->text.="<p></p><img src='uploads/".$newpic1->name."' onerror='imgError(this);' style='width: ".$width."px;'/>";
  1330. } else {
  1331. $msg->text.="<p></p><a class='file1' href='uploads/".$newpic1->name."'>File: ".$newpic1->name."</a>";
  1332. }
  1333.  
  1334. $tabls[$msgtidx][]=$msg;
  1335. $myd->dtables=$tabls;
  1336. $myd->saveobjecttable("Msg");
  1337. }
  1338. } else if (strlen(trim($msg1)) != 0&&$pic_uploaded==false) {
  1339. if($texists==false) {
  1340. $aone=array();
  1341. $aone[]=$msg;
  1342. $tabls[]=$aone;
  1343. $myd->dtables=$tabls;
  1344. $myd->saveobjecttable("Msg");
  1345. } else {
  1346. $tabls[$msgtidx][]=$msg;
  1347. $myd->dtables=$tabls;
  1348. $myd->saveobjecttable("Msg");
  1349. }
  1350. }
  1351.  
  1352. $t2=$myd->query("get text from Msg;");
  1353. for($i=0; $i<count($t2); $i++) {
  1354. $oput.=$t2[$i]."<p></p>";
  1355. }
  1356.  
  1357. } else {
  1358. if($texists==true) {
  1359. $t2=$myd->query("get text from Msg;");
  1360. for($i=0; $i<count($t2); $i++) {
  1361. $oput.=$t2[$i]."<p></p>";
  1362. }
  1363. }
  1364. }
  1365.  
  1366.  
  1367. ?>
  1368. <div class="a1" spellcheck="false">
  1369. <?php echo $oput;
  1370. ?>
  1371. </div>
  1372. <p></p>
  1373. <form method="POST" enctype="multipart/form-data">
  1374. <input name="myname" id="myname" type="hidden" value="<?php echo $myname; ?>"/>
  1375. <p class="main2">Nimi: <input name="text0" id="text0" type="text"
  1376. style="width: 114px;" value="<?php echo $name1; ?>"> </p>
  1377. <p class="main2">S├Ąnum:</p>
  1378. <textarea class="text1" name="text1" id="text1" type="text">
  1379. </textarea>
  1380. <p></p>
  1381. <p class="main5">Pilt v├Ąi muud t├╝├╝pi fail (kuni 5 mb'd):</p>
  1382. <input type="file" class="main4" name="fileToUpload" id="fileToUpload"/>
  1383. <p></p>
  1384. <p></p>
  1385. <p></p>
  1386. <p class="main5">Mini pilt (kuni 5 mb'd):</p>
  1387. <input type="file" class="main4" name="fileToUpload2" id="fileToUpload2"/>
  1388.  
  1389. <input type="submit" name="submit" class="main3" value="Saada"/>
  1390. </form>
  1391.  
  1392. <p></p>
  1393. <p class="main2">Aktiivsed:</p>
  1394. <div class="main2" id="ilist">
  1395. </div>
  1396. <script>
  1397.  
  1398. function nl2br (str, is_xhtml) {
  1399. if (typeof str === 'undefined' || str === null) {
  1400. return '';
  1401. }
  1402. var breakTag = (is_xhtml || typeof is_xhtml === 'undefined') ? '<br />'
  1403. : '<br>';
  1404. return (str + '').replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, '$1' +
  1405. breakTag + '$2');
  1406. }
  1407.  
  1408. if (!String.prototype.unescapeHTML) {
  1409. String.prototype.unescapeHTML = function() {
  1410. return this.replace(/&[#\w]+;/g, function (s) {
  1411. var entityMap = {
  1412. "&amp;": "&",
  1413. "&lt;": "<",
  1414. "&gt;": ">",
  1415. '&quot;': '"',
  1416. '&#39;': "'",
  1417. '&#x2F;': "/",
  1418. '&nbsp;': " "
  1419. };
  1420.  
  1421. return entityMap[s];
  1422. });
  1423. };
  1424. }
  1425.  
  1426. var prevr="";
  1427. var r0="";
  1428.  
  1429. function renewing() {
  1430. var xmlhttp = new XMLHttpRequest();
  1431.  
  1432. xmlhttp.onreadystatechange = function() {
  1433. if (xmlhttp.readyState == XMLHttpRequest.DONE) {
  1434. if (xmlhttp.status == 200) {
  1435. xmlhttp.responseText=nl2br(xmlhttp.responseText);
  1436. var a111=xmlhttp.responseText;
  1437. r0=a111;
  1438. a111=a111.unescapeHTML();
  1439. document.getElementsByClassName("a1")[0].innerHTML = a111;
  1440. }
  1441. else if (xmlhttp.status == 400) {
  1442. alert('Error 400');
  1443. }
  1444. else {
  1445. alert('Not 200 returned');
  1446. }
  1447. }
  1448. };
  1449. var d765=new Date();
  1450. xmlhttp.open("GET", "renewing.php?d="+d765, false);
  1451. xmlhttp.setRequestHeader('Cache-Control', 'no-cache');
  1452. xmlhttp.send();
  1453. if(prevr!=r0) {
  1454. a00000();
  1455. }
  1456. prevr=r0;
  1457.  
  1458. }
  1459.  
  1460. function renewingilist() {
  1461. var xmlhttp = new XMLHttpRequest();
  1462.  
  1463. xmlhttp.onreadystatechange = function() {
  1464. if (xmlhttp.readyState == XMLHttpRequest.DONE) {
  1465. if (xmlhttp.status == 200) {
  1466. document.getElementById("ilist").innerHTML = xmlhttp.responseText;
  1467. }
  1468. else if (xmlhttp.status == 400) {
  1469. alert('Error 400');
  1470. }
  1471. else {
  1472. alert('Not 200 returned');
  1473. }
  1474. }
  1475. };
  1476. var d765=new Date();
  1477. xmlhttp.open("GET", "ilist.php?d="+d765, false);
  1478. xmlhttp.setRequestHeader('Cache-Control', 'no-cache');
  1479. xmlhttp.send();
  1480. }
  1481.  
  1482.  
  1483. function a00000() {
  1484. var textarea = document.getElementsByClassName("a1")[0];
  1485. textarea.scrollTop = 50000000;
  1486. }
  1487.  
  1488. setInterval(function(){
  1489. renewing();
  1490. }, 1578);
  1491.  
  1492. setInterval(function(){
  1493. renewingilist();
  1494. }, 3953);
  1495.  
  1496.  
  1497. setInterval(function(){
  1498.  
  1499. var namearea = document.getElementById("text0");
  1500. var isFocused = (document.activeElement === namearea);
  1501. if(isFocused) {
  1502. } else {
  1503. document.getElementById('text1').focus();
  1504. }
  1505. }, 6871);
  1506.  
  1507. </script>
  1508. </body>
  1509.  
  1510. </html>
  1511. renewing.php
  1512.  
  1513.  
  1514. <?php
  1515.  
  1516. include("../data.php");
  1517.  
  1518. class Msg extends Dobj{
  1519. var $text;
  1520. }
  1521.  
  1522. $myd=new Data();
  1523.  
  1524. $myd->loadobjecttables();
  1525. $texists=false;
  1526. $t1=$myd->dtables;
  1527. for($i=0; $i<count($t1);$i++) {
  1528. if($t1[$i][0]->getNameOfClass()=="Msg") {
  1529. $texists=true;
  1530. break;
  1531. }
  1532. }
  1533.  
  1534. if($texists==true) {
  1535. $t2=$myd->query("get text from Msg;");
  1536. for($i=0; $i<count($t2);$i++) {
  1537. echo $t2[$i]."<p></p>";
  1538. }
  1539. } else {
  1540.  
  1541. }
  1542. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement