Saturday, October 16, 2021

Digest for comp.programming.threads@googlegroups.com - 2 updates in 2 topics

Ua <ya12983@mail.com>: Oct 15 07:08AM -0700

C:\Users\v\Documents\talking>dir
Volume in drive C is Windows
Volume Serial Number is A8A5-1122
 
Directory of C:\Users\v\Documents\talking
 
28.09.2021 14:45 <DIR> .
28.09.2021 14:45 <DIR> ..
25.09.2021 01:04 5 749 data.php
25.09.2021 01:00 562 findlastmdate.php
25.09.2021 01:01 211 func.php
25.09.2021 01:02 1 201 ilist.php
28.09.2021 01:21 5 044 index.php
27.09.2021 05:37 17 069 index2.php
25.09.2021 01:04 382 renewing.php
7 File(s) 30 218 bytes
2 Dir(s) 449 205 985 280 bytes free
 
C:\Users\v\Documents\talking>type *.*
 
data.php
 
 
<?php
 
class Dobj {
function getNameOfClass()
{
return static::class;
}
}
 
class Data {
 
var $dtables;
 
function gettime() {
return date("d.m.Y H:i:s");
}
 
function loadobjecttables() {
$dtables = array();
foreach (glob("*.dat") as $file) {
$path_parts = pathinfo($file);
if(!class_exists($path_parts['filename'])) {
continue;
}
$file1 = file_get_contents($file, true);
$dtables[] = unserialize($file1);
}
$this->dtables=$dtables;
}
 
function deleteotable($otabname) {
if (file_exists($otabname.".dat")) {
unlink($otabname.".dat");
}
$this->loadobjecttables();
}
 
function insertobject($obj) {
$this->loadobjecttables();
$oclass=$obj->getNameOfClass();
$tabls=$this->dtables;
$oarridx=-1;
for($i=0; $i<count($tabls); $i++) {
if($tabls[$i][0]->getNameOfClass()==$oclass) {
$oarridx=$i;
}
}
if($oarridx==-1) return false;
$tabls[$oarridx][]=$obj;
unlink($oclass.".dat");
$b=serialize($tabls[$oarridx]);
$fh = fopen($oclass.".dat", "a");
fwrite($fh, $b);
fclose($fh);
chmod($oclass.".dat", 0700);
}
 
 
function saveobjecttables() {
$tabls=$this->dtables;
for($i=0; $i<count($tabls); $i++) {
$oc=$tabls[$i][0]->getNameOfClass();
if (file_exists($oc.".dat")) {
unlink($oc.".dat");
}
$b=serialize($tabls[$i]);
$fh = fopen($oc.".dat", "a");
fwrite($fh, $b);
fclose($fh);
chmod($oc.".dat", 0700);
}
return true;
}
 
function saveobjecttable($objcl) {
$tabls=$this->dtables;
$obclindex=-1;
for($i=0; $i<count($tabls); $i++) {
if($tabls[$i][0]->getNameOfClass()==$objcl) {
$obclindex=$i;
break;
}
}
if (file_exists($objcl.".dat")) {
unlink($objcl.".dat");
}
$b=serialize($tabls[$obclindex]);
$fh = fopen($objcl.".dat", "a");
fwrite($fh, $b);
fclose($fh);
chmod($objcl.".dat", 0700);
return true;
}
 
function makearrayunique($array){
$duplicate_keys = array();
$tmp = array();
 
foreach ($array as $key => $val){
if (is_object($val))
$val = (array)$val;
 
if (!in_array($val, $tmp))
$tmp[] = $val;
else $duplicate_keys[] = $key;
}
 
foreach ($duplicate_keys as $key)
unset($array[$key]);
return $array;
}
 
function deleteduplicates() {
$ob=$this->dtables;
for($i=0; $i<count($ob); $i++) {
$o12=$this->makearrayunique($ob[$i]);
$ob[$i]=$o12;
}
$this->saveobjecttables();
}
 
function deleteduplicatescl($objcl) {
$ob=$this->dtables;
$obclindex=-1;
for($i=0; $i<count($ob); $i++) {
if($ob[$i][0]->getNameOfClass()==$objcl) {
$obclindex=$i;
break;
}
}
$o12=$this->makearrayunique($ob[$obclindex]);
$ob[$obclindex]=$o12;
$this->dtables=$ob;
$this->saveobjecttable($objcl);
}
 
 
 
function objectClassestoarray($objectA,
$objectB) {
$new_object = array();
 
foreach($objectA as $property => $value) {
$new_object[$property]=$value;
}
 
foreach($objectB as $property => $value) {
$new_object[$property]=$value;
}
 
return $new_object;
}
 
 
function query($query) {
$this->loadobjecttables();
$ovars=array();
$objects=$this->dtables;
for($i=0; $i<count($objects); $i++) {
$ovars[]=array_keys(get_object_vars($objects[$i][0]));
}
$mches=array();
$results=null;
$exitf=false;
 
for($i=0; $i<count($objects); $i++) {
if($exitf) break;
for($j=0; $j<count($ovars); $j++) {
if($exitf) break;
if(!class_exists($objects[$i][0]->getNameOfClass())) continue;
if(preg_match("/^get \* from ".$objects[$i][0]->getNameOfClass().";$/",$query)) {
$objectsList = [];
foreach ($objects[$i] as $obj) {
$objectsList[] = (array)$obj;
}
return $objectsList;
$exitf=true;
}
}
}
 
for($i=0; $i<count($objects); $i++) {
if($exitf) break;
for($j=0; $j<count($ovars); $j++) {
if($exitf) break;
if(!class_exists($objects[$i][0]->getNameOfClass())) continue;
if(preg_match("/^get ".$ovars[$i][$j]." from ".$objects[$i][0]->getNameOfClass().";$/",$query)) {
return array_column($objects[$i], $ovars[$i][$j]);
$exitf=true;
}
}
}
 
$outp=array();
for($i=0; $i<count($objects); $i++) {
if($exitf) break;
for($j=0; $j<count($ovars[$i]); $j++) {
if($exitf) break;
for($k=0; $k<count($objects); $k++) {
if($exitf) break;
for($l=0; $l<count($ovars[$k]); $l++) {
if($exitf) break;
if(!class_exists($objects[$i][0]->getNameOfClass())) continue;
if(!class_exists($objects[$k][0]->getNameOfClass())) continue;
 
if(preg_match("/^get \* from ".$objects[$i][0]->getNameOfClass()." join ".$objects[$k][0]->getNameOfClass().
" on \(".$objects[$i][0]->getNameOfClass()."\.".$ovars[$i][$j]."\=".$objects[$k][0]->getNameOfClass().
"\.".$ovars[$k][$l]."\);$/",$query)) {
for($ii=0; $ii<count($objects[$i]); $ii++) {
for($ii2=0; $ii2<count($objects[$k]);$ii2++) {
if($objects[$i][$ii]->{$ovars[$i][$j]}==$objects[$k][$ii2]->{$ovars[$k][$l]}) {
$oobj = $this->objectClassestoarray($objects[$i][$ii], $objects[$k][$ii2]);
$outp[]=$oobj;
}
}
}
$exitf=true;
}
}
}
}
}
 
for($k=0; $k<count($objects); $k++) {
if($exitf) break;
for($l=0; $l<count($ovars[$k]); $l++) {
if($exitf) break;
for($l2=0; $l2<count($ovars[$k]); $l2++) {
if($exitf) break;
if(!class_exists($objects[$k][0]->getNameOfClass()))
continue;
 
if(preg_match("/^get \* from ".$objects[$k][0]->getNameOfClass()." where ".$ovars[$k][$l]."\=(.*) and ".$ovars[$k][$l2]."\=(.*);$/",$query, $matches)) {
for($ii2=0;
$ii2<count($objects[$k]); $ii2++) {
 
if($objects[$k][$ii2]->{$ovars[$k][$l]}==$matches[1]&&$objects[$k][$ii2]->{$ovars[$k][$l2]}==$matches[2]) {
 
$oobj = (array)$objects[$k][$ii2];
 
$outp[]=$oobj;
}
}
$exitf=true;
}
}
}
}
 
 
for($k=0; $k<count($objects); $k++) {
if($exitf) break;
for($l=0; $l<count($ovars[$k]); $l++) {
if($exitf) break;
if(!class_exists($objects[$k][0]->getNameOfClass())) continue;
if(preg_match("/^get \* from ".$objects[$k][0]->getNameOfClass()." where ".$ovars[$k][$l]."\=(.*);$/",$query, $matches)) {
for($ii2=0; $ii2<count($objects[$k]); $ii2++) {
if($objects[$k][$ii2]->{$ovars[$k][$l]}==$matches[1]) {
$oobj = (array)$objects[$k][$ii2];
$outp[]=$oobj;
}
}
$exitf=true;
}
}
}
 
if(count($outp)>0) {
return $outp;
}
 
 
return $mches;
}
 
}
 
?>
findlastmdate.php
 
 
<?php
 
include("../data.php");
 
class Msg extends Dbobj{
var $text;
}
 
$myd=new Data();
 
$myd->loadobjecttables();
$texists=false;
$t1=$myd->dtables;
 
$mdates=array();
 
for($i=0; $i<count($t1);$i++) {
if($t1[$i][0]->getNameOfClass()=="Msg") {
$texists=true;
break;
}
}
 
if($texists==true) {
$t2=$mydb->query("get text from Msg;");
for($i=0; $i<count($t2);$i++) {
$date12=date("d.m.Y H:i:s", strtotime(substr($t2[$i], 0, 19)));
$d_start = new DateTime($date12);
$mdates[]=$d_start;
}
echo $mdates[count($mdates)-1]->format('d.m.Y H:i:s');;
} else {
echo "";
}
 
?>
func.php
 
 
<?php
 
 
function rrmdir($dir) {
$files = array_diff(scandir($dir), array('.','..'));
foreach ($files as $file) {
(is_dir("$dir/$file")) ? rrmdir("$dir/$file") : unlink("$dir/$file");
}
return rmdir($dir);
}
 
 
?>
ilist.php
 
 
<?php
 
include("../data.php");
 
class Msg extends Dobj{
var $text;
}
 
class Inimene extends Dobj{
var $name;
var $time;
var $dpic;
}
 
 
$myd=new Data();
 
$myd->loadobjecttables();
$texists=false;
$t1=$myd->dtables;
 
$ilist=array();
 
$itidx=-1;
for($i=0; $i<count($t1);$i++) {
if($t1[$i][0]->getNameOfClass()=="Inimene") {
$texists=true;
$itidx=$i;
break;
}
}
 
$newi=array();
 
if($itidx>-1) {
for($i=0; $i<count($t1[$itidx]);$i++) {
$date12=date("d.m.Y H:i:s", strtotime($t1[$itidx][$i]->time));
$dtime = new DateTime($date12);
 
$datenow=date( 'd.m.Y H:i:s', strtotime( '+3 hour' , strtotime("now") ));
$dtimenow = new DateTime($datenow);
 
$diff = $dtimenow->getTimestamp() - $dtime->getTimestamp();
if($diff<60*15) {
$newi[]=$t1[$itidx][$i];
} else {
}
}
if(count($newi)==0) {
unset($t1[$itidx]);
unlink("Inimene.dat");
} else {
$t1[$itidx]=$newi;
$myd->dtables=$t1;
$myd->saveobjecttable("Inimene");
}
}
 
if($texists==true) {
$t2=$myd->query("get name from Inimene;");
for($i=0; $i<count($t2);$i++) {
$ilist[]=$t2[$i];
}
} else {
 
}
 
$result = array_unique($ilist);
$List = implode(', ', $result);
if(substr($List,strlen($List)-2, 2)==", ") {
$List=substr($List, 0, strlen($List)-2);
}
echo $List;
 
?>
index.php
 
<!DOCTYPE html>
<html>
<head>
<link rel="icon" style="width:15px; height=15px; background-color: #76FEFF; color: #76FEFF;"/>
 
<style>
input {
color: #76FEFF;
}
 
body {
background-image: url("img.jpg");
 
background-repeat: repeat;
background-size: 100%;
 
/*
background-color: lightgreen;
*/
}
 
.main12 {
text-decoration:none;
color: #76FEFF;
font-weight: bold;
background-color: white;
border: 1px solid white;
border-radius: 10px 10px;
padding: 5px;
font-weight:bold;
}
.main1 {
text-decoration:none;
color: white;
border-radius: 5px 5px;
padding: 5px;
font-weight:bold;
width:775px;
}
 
.main12 {
text-decoration:none;
color: #76FEFF;
border-radius: 5px 5px;
padding: 5px;
font-weight:bold;
vertical-align: middle;
width:535px;
}
 
.main2 {
color: white;
}
 
.main3 {
text-decoration:none;
color: #76FEFF;
font-weight: bold;
background-color: white;
border: 1px solid white;
border-radius: 5px 5px;
padding: 5px;
font-weight:bold;
width:100px;
display:block;
 
}
 
.w1 {
color: white;
}
.w2 {
color: white;
display:inline-block;
}
.pwd {
color: #76FEFF;
display:inline-block;
}
 
.w21 {
color: white;
display:block;
}
 
</style>
</head>
<body>
<h1 class="main1">
</h1>
<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>
<h1 class="main1">
</h1>
 
<?php
 
include("func.php");
include("data.php");
 
class Password extends Dobj{
var $content;
}
 
 
$dirs = array_filter(glob('*'), 'is_dir');
 
$cannotcreate=false;
 
 
if(count($dirs)>60) {
$cannotcreate=true;
}
 
 
if(!empty($_POST['rname'])&&($_POST['rname']!=" ")&&!empty($_POST['rname'])&$cannotcreate==false) {
$_POST['rname'] = strip_tags($_POST['rname']);
$_POST['rname'] = str_replace(' ', 'space21326', $_POST['rname']);
$_POST['rname'] = str_replace(',', 'comma21326', $_POST['rname']);
$_POST['rname'] = str_replace('?', 'q21326', $_POST['rname']);
$_POST['rname'] = str_replace('\'', 'ukom21326', $_POST['rname']);
mkdir($_POST['rname'], 0755);
 
 
if(!empty($_POST['password'])&&$_POST['password']!="") {
$myd=new Data();
$tabls=array();
$pwd1=new Password();
$pwd1->content=$_POST['password'];
$pwdt=array();
$pwdt[]=$pwd1;
$tabls[]=$pwdt;
$myd->dtables=$tabls;
$myd->saveobjecttable("Password");
 
 
$file = 'Password.dat';
$newfile = 'Password.dat';
if (!copy($file, $_POST['rname'].'/'.$newfile)) {
echo "Error\n";
}
chmod($_POST['rname'].'/'.$newfile, 0700);
 
 
unlink("Password.dat");
}
 
 
$file = 'index2.php';
$newfile = 'index.php';
if (!copy($file, $_POST['rname'].'/'.$newfile)) {
echo "Error\n";
}
chmod($_POST['rname'].'/'.$newfile, 0744);
 
$file = 'renewing.php';
$newfile = 'renewing.php';
 
if (!copy($file, $_POST['rname'].'/'.$newfile)) {
echo "Error\n";
}
 
chmod($_POST['rname'].'/'.$newfile, 0744);
 
$file = 'ilist.php';
$newfile = 'ilist.php';
 
if (!copy($file, $_POST['rname'].'/'.$newfile)) {
echo "Error\n";
}
 
chmod($_POST['rname'].'/'.$newfile, 0744);
 
$file = 'findlastmdate.php';
$newfile = 'findlastmdate.php';
 
if (!copy($file, $_POST['rname'].'/'.$newfile)) {
echo "Error\n";
}
 
chmod($_POST['rname'].'/'.$newfile, 0744);
 
$file = 'func.php';
$newfile = 'func.php';
 
if (!copy($file, $_POST['rname'].'/'.$newfile)) {
echo "Error\n";
}
 
chmod($_POST['rname'].'/'.$newfile, 0744);
 
}
 
$dirs = array_filter(glob('*'), 'is_dir');
 
if(count($dirs)>0) {
echo "<h2 class='main2'>Topics</h2>";
}
 
$dirs = array_filter(glob('*'), 'is_dir');
 
foreach ($dirs as $file) {
$file2= str_replace('space21326', '&nbsp;', $file);
$file2= str_replace('comma21326', ',', $file2);
$file2= str_replace('q21326', '?', $file2);
$file2= str_replace('ukom21326', '\'', $file2);
if($file=="files") continue;
 
$dir1='//'.$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF']);
$output = file_get_contents('http:'.$dir1.$file.'/findlastmdate.php');
if($output!="") {
$date12=date("d.m.Y H:i:s", strtotime($output));
$d_start = new DateTime($date12);
$currentdate = date('d.m.Y H:i:s', time());
$d_end = new DateTime($currentdate);
$diff = $d_start->diff($d_end);
$delete1=false;
if(!($diff->format('%d')<1000||$diff->format('%d')==1000&&$diff->format('%h')<1))
$delete1=true;
if($delete1) {
rrmdir('/'.$file);
continue;
}
}
echo '<a class="main12" href=\'http:'.$dir1.$file.'\'>'.$file2.'</a>';
echo "<p></p>";
$path_parts = pathinfo($file.'/Msg.dat');
if(!class_exists($path_parts['filename'])) {
continue;
}
}
 
 
?>
<p style="height:50px;"> </p>
 
<form method="POST">
<p class="w2">
Topic:
</p>
<input name="rname"/>
<p class="w21">
Password(optional)
</p>
<input class="pwd" name="password" type="password"/>
<p class="w">
</p>
<input type="submit" class="main3" value="Create"/>
</form>
<p class="w1" style="color: #j3k4f8; font-weight: bold;">
To access password protected topic: /index.php?code=Password</p>
<p class="w1" style="color: #j3k4f8; font-weight: bold;">Attention: Please try to behave, while in talkrooms.....</p>
<p></p>
<p></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p class="w1"></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
 
</body>
</html>
 
 
index2.php
 
 
<!DOCTYPE html>
<html>
<head>
<link rel="icon" style="width:15px; height=15px; background-color: #76FEFF; color: #76FEFF;"/>
 
<style>
input {
color: #76FEFF;
}
 
body {
background-color: #76FEFF;
}
 
.file1 {
text-decoration: none;
color: #76FEFF;
}
 
.main1 {
text-decoration:none;
color: #76FEFF;
background-color: white;
border: 1px solid white;
border-radius: 5px 5px;
padding: 5px;
font-weight:bold;
width:100px;
}
 
.main2 {
color: white;
margin-top:-15px;
}
 
.main3 {
text-decoration:none;
color: #76FEFF;
background-color: white;
border: 1px solid white;
border-radius: 5px 5px;
padding: 5px;
font-weight:bold;
width:100px;
}
 
.main4 {
color: white;
width: 140px;
}
 
.main5 {
color: white;
margin-top:-15px;
margin-bottom:1px;
}
.main6 {
color: white;
margin-top:15px;
width:600px;
overflow-wrap: break-word;
}
.main7 {
margin-bottom:1px;
}
 
.text1 {
color: #76FEFF;
width: 538px;
height: 29px;
margin-top:-15px;
overflow-wrap: break-word;
}
 
textarea {
color: black;
}
form {
line-height: 1.4;
}
 
.a1 {
line-height: 1.4;
width: 561px;
height: 357px;
overflow-y: auto;
overflow-x: hidden;
background-color: white;
overflow-wrap: break-word;
color: #76FEFF;
}
 
.a1 p {
height:0.001%;
margin-bottom:-15px;
}
.nameslist {
margin-bottom:15px;
}
</style>
<script>
function imgError(image) {
image.onerror = "";
image.src = "../noimage.jpg";
image.style="background-color: #848587;";
image.width="40px";
image.height="40px";
return true;
}
</script>
</head>
<body onload="a00000()">
 
<?php
 
include("func.php");
 
 
$size = 0;
 
$files = glob('uploads/*.*');
usort($files, function($a, $b) {
return filemtime($a) < filemtime($b);
});
$idx=0;
 
$files = array_reverse($files, true);
 
if(is_dir("uploads")) {
foreach($files as $file) {
if($idx==count($files)-1) break;
$filesize = filesize($file);
$size+=$filesize;
$idx++;
}
$idx=0;
if($size>5000000) {
foreach($files as $file) {
He <ya12983@mail.com>: Oct 15 07:07AM -0700

C:\Users\v\Documents\talking>dir
Volume in drive C is Windows
Volume Serial Number is A8A5-1122
 
Directory of C:\Users\v\Documents\talking
 
28.09.2021 14:45 <DIR> .
28.09.2021 14:45 <DIR> ..
25.09.2021 01:04 5 749 data.php
25.09.2021 01:00 562 findlastmdate.php
25.09.2021 01:01 211 func.php
25.09.2021 01:02 1 201 ilist.php
28.09.2021 01:21 5 044 index.php
27.09.2021 05:37 17 069 index2.php
25.09.2021 01:04 382 renewing.php
7 File(s) 30 218 bytes
2 Dir(s) 449 205 985 280 bytes free
 
C:\Users\v\Documents\talking>type *.*
 
data.php
 
 
<?php
 
class Dobj {
function getNameOfClass()
{
return static::class;
}
}
 
class Data {
 
var $dtables;
 
function gettime() {
return date("d.m.Y H:i:s");
}
 
function loadobjecttables() {
$dtables = array();
foreach (glob("*.dat") as $file) {
$path_parts = pathinfo($file);
if(!class_exists($path_parts['filename'])) {
continue;
}
$file1 = file_get_contents($file, true);
$dtables[] = unserialize($file1);
}
$this->dtables=$dtables;
}
 
function deleteotable($otabname) {
if (file_exists($otabname.".dat")) {
unlink($otabname.".dat");
}
$this->loadobjecttables();
}
 
function insertobject($obj) {
$this->loadobjecttables();
$oclass=$obj->getNameOfClass();
$tabls=$this->dtables;
$oarridx=-1;
for($i=0; $i<count($tabls); $i++) {
if($tabls[$i][0]->getNameOfClass()==$oclass) {
$oarridx=$i;
}
}
if($oarridx==-1) return false;
$tabls[$oarridx][]=$obj;
unlink($oclass.".dat");
$b=serialize($tabls[$oarridx]);
$fh = fopen($oclass.".dat", "a");
fwrite($fh, $b);
fclose($fh);
chmod($oclass.".dat", 0700);
}
 
 
function saveobjecttables() {
$tabls=$this->dtables;
for($i=0; $i<count($tabls); $i++) {
$oc=$tabls[$i][0]->getNameOfClass();
if (file_exists($oc.".dat")) {
unlink($oc.".dat");
}
$b=serialize($tabls[$i]);
$fh = fopen($oc.".dat", "a");
fwrite($fh, $b);
fclose($fh);
chmod($oc.".dat", 0700);
}
return true;
}
 
function saveobjecttable($objcl) {
$tabls=$this->dtables;
$obclindex=-1;
for($i=0; $i<count($tabls); $i++) {
if($tabls[$i][0]->getNameOfClass()==$objcl) {
$obclindex=$i;
break;
}
}
if (file_exists($objcl.".dat")) {
unlink($objcl.".dat");
}
$b=serialize($tabls[$obclindex]);
$fh = fopen($objcl.".dat", "a");
fwrite($fh, $b);
fclose($fh);
chmod($objcl.".dat", 0700);
return true;
}
 
function makearrayunique($array){
$duplicate_keys = array();
$tmp = array();
 
foreach ($array as $key => $val){
if (is_object($val))
$val = (array)$val;
 
if (!in_array($val, $tmp))
$tmp[] = $val;
else $duplicate_keys[] = $key;
}
 
foreach ($duplicate_keys as $key)
unset($array[$key]);
return $array;
}
 
function deleteduplicates() {
$ob=$this->dtables;
for($i=0; $i<count($ob); $i++) {
$o12=$this->makearrayunique($ob[$i]);
$ob[$i]=$o12;
}
$this->saveobjecttables();
}
 
function deleteduplicatescl($objcl) {
$ob=$this->dtables;
$obclindex=-1;
for($i=0; $i<count($ob); $i++) {
if($ob[$i][0]->getNameOfClass()==$objcl) {
$obclindex=$i;
break;
}
}
$o12=$this->makearrayunique($ob[$obclindex]);
$ob[$obclindex]=$o12;
$this->dtables=$ob;
$this->saveobjecttable($objcl);
}
 
 
 
function objectClassestoarray($objectA,
$objectB) {
$new_object = array();
 
foreach($objectA as $property => $value) {
$new_object[$property]=$value;
}
 
foreach($objectB as $property => $value) {
$new_object[$property]=$value;
}
 
return $new_object;
}
 
 
function query($query) {
$this->loadobjecttables();
$ovars=array();
$objects=$this->dtables;
for($i=0; $i<count($objects); $i++) {
$ovars[]=array_keys(get_object_vars($objects[$i][0]));
}
$mches=array();
$results=null;
$exitf=false;
 
for($i=0; $i<count($objects); $i++) {
if($exitf) break;
for($j=0; $j<count($ovars); $j++) {
if($exitf) break;
if(!class_exists($objects[$i][0]->getNameOfClass())) continue;
if(preg_match("/^get \* from ".$objects[$i][0]->getNameOfClass().";$/",$query)) {
$objectsList = [];
foreach ($objects[$i] as $obj) {
$objectsList[] = (array)$obj;
}
return $objectsList;
$exitf=true;
}
}
}
 
for($i=0; $i<count($objects); $i++) {
if($exitf) break;
for($j=0; $j<count($ovars); $j++) {
if($exitf) break;
if(!class_exists($objects[$i][0]->getNameOfClass())) continue;
if(preg_match("/^get ".$ovars[$i][$j]." from ".$objects[$i][0]->getNameOfClass().";$/",$query)) {
return array_column($objects[$i], $ovars[$i][$j]);
$exitf=true;
}
}
}
 
$outp=array();
for($i=0; $i<count($objects); $i++) {
if($exitf) break;
for($j=0; $j<count($ovars[$i]); $j++) {
if($exitf) break;
for($k=0; $k<count($objects); $k++) {
if($exitf) break;
for($l=0; $l<count($ovars[$k]); $l++) {
if($exitf) break;
if(!class_exists($objects[$i][0]->getNameOfClass())) continue;
if(!class_exists($objects[$k][0]->getNameOfClass())) continue;
 
if(preg_match("/^get \* from ".$objects[$i][0]->getNameOfClass()." join ".$objects[$k][0]->getNameOfClass().
" on \(".$objects[$i][0]->getNameOfClass()."\.".$ovars[$i][$j]."\=".$objects[$k][0]->getNameOfClass().
"\.".$ovars[$k][$l]."\);$/",$query)) {
for($ii=0; $ii<count($objects[$i]); $ii++) {
for($ii2=0; $ii2<count($objects[$k]);$ii2++) {
if($objects[$i][$ii]->{$ovars[$i][$j]}==$objects[$k][$ii2]->{$ovars[$k][$l]}) {
$oobj = $this->objectClassestoarray($objects[$i][$ii], $objects[$k][$ii2]);
$outp[]=$oobj;
}
}
}
$exitf=true;
}
}
}
}
}
 
for($k=0; $k<count($objects); $k++) {
if($exitf) break;
for($l=0; $l<count($ovars[$k]); $l++) {
if($exitf) break;
for($l2=0; $l2<count($ovars[$k]); $l2++) {
if($exitf) break;
if(!class_exists($objects[$k][0]->getNameOfClass()))
continue;
 
if(preg_match("/^get \* from ".$objects[$k][0]->getNameOfClass()." where ".$ovars[$k][$l]."\=(.*) and ".$ovars[$k][$l2]."\=(.*);$/",$query, $matches)) {
for($ii2=0;
$ii2<count($objects[$k]); $ii2++) {
 
if($objects[$k][$ii2]->{$ovars[$k][$l]}==$matches[1]&&$objects[$k][$ii2]->{$ovars[$k][$l2]}==$matches[2]) {
 
$oobj = (array)$objects[$k][$ii2];
 
$outp[]=$oobj;
}
}
$exitf=true;
}
}
}
}
 
 
for($k=0; $k<count($objects); $k++) {
if($exitf) break;
for($l=0; $l<count($ovars[$k]); $l++) {
if($exitf) break;
if(!class_exists($objects[$k][0]->getNameOfClass())) continue;
if(preg_match("/^get \* from ".$objects[$k][0]->getNameOfClass()." where ".$ovars[$k][$l]."\=(.*);$/",$query, $matches)) {
for($ii2=0; $ii2<count($objects[$k]); $ii2++) {
if($objects[$k][$ii2]->{$ovars[$k][$l]}==$matches[1]) {
$oobj = (array)$objects[$k][$ii2];
$outp[]=$oobj;
}
}
$exitf=true;
}
}
}
 
if(count($outp)>0) {
return $outp;
}
 
 
return $mches;
}
 
}
 
?>
findlastmdate.php
 
 
<?php
 
include("../data.php");
 
class Msg extends Dbobj{
var $text;
}
 
$myd=new Data();
 
$myd->loadobjecttables();
$texists=false;
$t1=$myd->dtables;
 
$mdates=array();
 
for($i=0; $i<count($t1);$i++) {
if($t1[$i][0]->getNameOfClass()=="Msg") {
$texists=true;
break;
}
}
 
if($texists==true) {
$t2=$mydb->query("get text from Msg;");
for($i=0; $i<count($t2);$i++) {
$date12=date("d.m.Y H:i:s", strtotime(substr($t2[$i], 0, 19)));
$d_start = new DateTime($date12);
$mdates[]=$d_start;
}
echo $mdates[count($mdates)-1]->format('d.m.Y H:i:s');;
} else {
echo "";
}
 
?>
func.php
 
 
<?php
 
 
function rrmdir($dir) {
$files = array_diff(scandir($dir), array('.','..'));
foreach ($files as $file) {
(is_dir("$dir/$file")) ? rrmdir("$dir/$file") : unlink("$dir/$file");
}
return rmdir($dir);
}
 
 
?>
ilist.php
 
 
<?php
 
include("../data.php");
 
class Msg extends Dobj{
var $text;
}
 
class Inimene extends Dobj{
var $name;
var $time;
var $dpic;
}
 
 
$myd=new Data();
 
$myd->loadobjecttables();
$texists=false;
$t1=$myd->dtables;
 
$ilist=array();
 
$itidx=-1;
for($i=0; $i<count($t1);$i++) {
if($t1[$i][0]->getNameOfClass()=="Inimene") {
$texists=true;
$itidx=$i;
break;
}
}
 
$newi=array();
 
if($itidx>-1) {
for($i=0; $i<count($t1[$itidx]);$i++) {
$date12=date("d.m.Y H:i:s", strtotime($t1[$itidx][$i]->time));
$dtime = new DateTime($date12);
 
$datenow=date( 'd.m.Y H:i:s', strtotime( '+3 hour' , strtotime("now") ));
$dtimenow = new DateTime($datenow);
 
$diff = $dtimenow->getTimestamp() - $dtime->getTimestamp();
if($diff<60*15) {
$newi[]=$t1[$itidx][$i];
} else {
}
}
if(count($newi)==0) {
unset($t1[$itidx]);
unlink("Inimene.dat");
} else {
$t1[$itidx]=$newi;
$myd->dtables=$t1;
$myd->saveobjecttable("Inimene");
}
}
 
if($texists==true) {
$t2=$myd->query("get name from Inimene;");
for($i=0; $i<count($t2);$i++) {
$ilist[]=$t2[$i];
}
} else {
 
}
 
$result = array_unique($ilist);
$List = implode(', ', $result);
if(substr($List,strlen($List)-2, 2)==", ") {
$List=substr($List, 0, strlen($List)-2);
}
echo $List;
 
?>
index.php
 
<!DOCTYPE html>
<html>
<head>
<link rel="icon" style="width:15px; height=15px; background-color: #76FEFF; color: #76FEFF;"/>
 
<style>
input {
color: #76FEFF;
}
 
body {
background-image: url("img.jpg");
 
background-repeat: repeat;
background-size: 100%;
 
/*
background-color: lightgreen;
*/
}
 
.main12 {
text-decoration:none;
color: #76FEFF;
font-weight: bold;
background-color: white;
border: 1px solid white;
border-radius: 10px 10px;
padding: 5px;
font-weight:bold;
}
.main1 {
text-decoration:none;
color: white;
border-radius: 5px 5px;
padding: 5px;
font-weight:bold;
width:775px;
}
 
.main12 {
text-decoration:none;
color: #76FEFF;
border-radius: 5px 5px;
padding: 5px;
font-weight:bold;
vertical-align: middle;
width:535px;
}
 
.main2 {
color: white;
}
 
.main3 {
text-decoration:none;
color: #76FEFF;
font-weight: bold;
background-color: white;
border: 1px solid white;
border-radius: 5px 5px;
padding: 5px;
font-weight:bold;
width:100px;
display:block;
 
}
 
.w1 {
color: white;
}
.w2 {
color: white;
display:inline-block;
}
.pwd {
color: #76FEFF;
display:inline-block;
}
 
.w21 {
color: white;
display:block;
}
 
</style>
</head>
<body>
<h1 class="main1">
</h1>
<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>
<h1 class="main1">
</h1>
 
<?php
 
include("func.php");
include("data.php");
 
class Password extends Dobj{
var $content;
}
 
 
$dirs = array_filter(glob('*'), 'is_dir');
 
$cannotcreate=false;
 
 
if(count($dirs)>60) {
$cannotcreate=true;
}
 
 
if(!empty($_POST['rname'])&&($_POST['rname']!=" ")&&!empty($_POST['rname'])&$cannotcreate==false) {
$_POST['rname'] = strip_tags($_POST['rname']);
$_POST['rname'] = str_replace(' ', 'space21326', $_POST['rname']);
$_POST['rname'] = str_replace(',', 'comma21326', $_POST['rname']);
$_POST['rname'] = str_replace('?', 'q21326', $_POST['rname']);
$_POST['rname'] = str_replace('\'', 'ukom21326', $_POST['rname']);
mkdir($_POST['rname'], 0755);
 
 
if(!empty($_POST['password'])&&$_POST['password']!="") {
$myd=new Data();
$tabls=array();
$pwd1=new Password();
$pwd1->content=$_POST['password'];
$pwdt=array();
$pwdt[]=$pwd1;
$tabls[]=$pwdt;
$myd->dtables=$tabls;
$myd->saveobjecttable("Password");
 
 
$file = 'Password.dat';
$newfile = 'Password.dat';
if (!copy($file, $_POST['rname'].'/'.$newfile)) {
echo "Error\n";
}
chmod($_POST['rname'].'/'.$newfile, 0700);
 
 
unlink("Password.dat");
}
 
 
$file = 'index2.php';
$newfile = 'index.php';
if (!copy($file, $_POST['rname'].'/'.$newfile)) {
echo "Error\n";
}
chmod($_POST['rname'].'/'.$newfile, 0744);
 
$file = 'renewing.php';
$newfile = 'renewing.php';
 
if (!copy($file, $_POST['rname'].'/'.$newfile)) {
echo "Error\n";
}
 
chmod($_POST['rname'].'/'.$newfile, 0744);
 
$file = 'ilist.php';
$newfile = 'ilist.php';
 
if (!copy($file, $_POST['rname'].'/'.$newfile)) {
echo "Error\n";
}
 
chmod($_POST['rname'].'/'.$newfile, 0744);
 
$file = 'findlastmdate.php';
$newfile = 'findlastmdate.php';
 
if (!copy($file, $_POST['rname'].'/'.$newfile)) {
echo "Error\n";
}
 
chmod($_POST['rname'].'/'.$newfile, 0744);
 
$file = 'func.php';
$newfile = 'func.php';
 
if (!copy($file, $_POST['rname'].'/'.$newfile)) {
echo "Error\n";
}
 
chmod($_POST['rname'].'/'.$newfile, 0744);
 
}
 
$dirs = array_filter(glob('*'), 'is_dir');
 
if(count($dirs)>0) {
echo "<h2 class='main2'>Topics</h2>";
}
 
$dirs = array_filter(glob('*'), 'is_dir');
 
foreach ($dirs as $file) {
$file2= str_replace('space21326', '&nbsp;', $file);
$file2= str_replace('comma21326', ',', $file2);
$file2= str_replace('q21326', '?', $file2);
$file2= str_replace('ukom21326', '\'', $file2);
if($file=="files") continue;
 
$dir1='//'.$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF']);
$output = file_get_contents('http:'.$dir1.$file.'/findlastmdate.php');
if($output!="") {
$date12=date("d.m.Y H:i:s", strtotime($output));
$d_start = new DateTime($date12);
$currentdate = date('d.m.Y H:i:s', time());
$d_end = new DateTime($currentdate);
$diff = $d_start->diff($d_end);
$delete1=false;
if(!($diff->format('%d')<1000||$diff->format('%d')==1000&&$diff->format('%h')<1))
$delete1=true;
if($delete1) {
rrmdir('/'.$file);
continue;
}
}
echo '<a class="main12" href=\'http:'.$dir1.$file.'\'>'.$file2.'</a>';
echo "<p></p>";
$path_parts = pathinfo($file.'/Msg.dat');
if(!class_exists($path_parts['filename'])) {
continue;
}
}
 
 
?>
<p style="height:50px;"> </p>
 
<form method="POST">
<p class="w2">
Topic:
</p>
<input name="rname"/>
<p class="w21">
Password(optional)
</p>
<input class="pwd" name="password" type="password"/>
<p class="w">
</p>
<input type="submit" class="main3" value="Create"/>
</form>
<p class="w1" style="color: #j3k4f8; font-weight: bold;">
To access password protected topic: /index.php?code=Password</p>
<p class="w1" style="color: #j3k4f8; font-weight: bold;">Attention: Please try to behave, while in talkrooms.....</p>
<p></p>
<p></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p class="w1"></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
 
</body>
</html>
 
 
index2.php
 
 
<!DOCTYPE html>
<html>
<head>
<link rel="icon" style="width:15px; height=15px; background-color: #76FEFF; color: #76FEFF;"/>
 
<style>
input {
color: #76FEFF;
}
 
body {
background-color: #76FEFF;
}
 
.file1 {
text-decoration: none;
color: #76FEFF;
}
 
.main1 {
text-decoration:none;
color: #76FEFF;
background-color: white;
border: 1px solid white;
border-radius: 5px 5px;
padding: 5px;
font-weight:bold;
width:100px;
}
 
.main2 {
color: white;
margin-top:-15px;
}
 
.main3 {
text-decoration:none;
color: #76FEFF;
background-color: white;
border: 1px solid white;
border-radius: 5px 5px;
padding: 5px;
font-weight:bold;
width:100px;
}
 
.main4 {
color: white;
width: 140px;
}
 
.main5 {
color: white;
margin-top:-15px;
margin-bottom:1px;
}
.main6 {
color: white;
margin-top:15px;
width:600px;
overflow-wrap: break-word;
}
.main7 {
margin-bottom:1px;
}
 
.text1 {
color: #76FEFF;
width: 538px;
height: 29px;
margin-top:-15px;
overflow-wrap: break-word;
}
 
textarea {
color: black;
}
form {
line-height: 1.4;
}
 
.a1 {
line-height: 1.4;
width: 561px;
height: 357px;
overflow-y: auto;
overflow-x: hidden;
background-color: white;
overflow-wrap: break-word;
color: #76FEFF;
}
 
.a1 p {
height:0.001%;
margin-bottom:-15px;
}
.nameslist {
margin-bottom:15px;
}
</style>
<script>
function imgError(image) {
image.onerror = "";
image.src = "../noimage.jpg";
image.style="background-color: #848587;";
image.width="40px";
image.height="40px";
return true;
}
</script>
</head>
<body onload="a00000()">
 
<?php
 
include("func.php");
 
 
$size = 0;
 
$files = glob('uploads/*.*');
usort($files, function($a, $b) {
return filemtime($a) < filemtime($b);
});
$idx=0;
 
$files = array_reverse($files, true);
 
if(is_dir("uploads")) {
foreach($files as $file) {
if($idx==count($files)-1) break;
$filesize = filesize($file);
$size+=$filesize;
$idx++;
}
$idx=0;
if($size>5000000) {
foreach($files as $file) {
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to comp.programming.threads+unsubscribe@googlegroups.com.

No comments: