-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfindls.php
More file actions
65 lines (62 loc) · 3.54 KB
/
Copy pathfindls.php
File metadata and controls
65 lines (62 loc) · 3.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
session_start();
$emailfor = str_replace('.', '', $_SESSION['email']);
$emailfor = str_replace('@', '', $emailfor);
$conn = new mysqli('localhost', 'People', '123456', 'main');
if ($conn->connect_error) die($conn->connect_error);
$query = "SELECT * from design order by id DESC";
$result = $conn->query($query);
$rows = $result->num_rows;
$_POST['findls'] = htmlspecialchars($_POST['findls']);
$strlen = mb_strlen($_POST['findls'], 'UTF-8');
$no = 0;
$array = array();
$array2 = array();
if($strlen!=0) {
if($rows != 0) {
print('<ul><h1>Блоги</h1><hr>');
}
else {
print('<ul><h1>Поиск</h1><hr>');
}
for($j = 0;$j < $rows;$j++) {
$stop = 0;
$result->data_seek($j);
$name = $result->fetch_array()['blogname'];
$result->data_seek($j);
$avaform = $result->fetch_array()['avatarform'];
$result->data_seek($j);
$login = $result->fetch_array()['login'];
$result->data_seek($j);
$query2 = "SELECT * from users WHERE login='".$login."'";
$result2 = $conn->query($query2);
$result2->data_seek(0);
$email = $result2->fetch_array()['email'];
$email = str_replace('.', '', $email);
$email = str_replace('@', '', $email);
if(is_file('avatar/'.md5('avatar'.$email).'.jpg')) {
$img = 'avatar/'.md5('avatar'.$email).'.jpg';
}
else {
$img = 'avatar/123123.jpg';
}
$string = $result->fetch_array()['blogname'];
$string = mb_substr($string, 0, $strlen,'UTF-8');
$newname = str_ireplace($string,'<b>'.$string.'</b>',$name);
if($_POST['findls'] == $string) {
if($no >= 0) $class="style='padding-top: 5px;padding-bottom: 0;'";
if($no < 7) {
print('<a href="javascript:void(0)" onclick="location.href=\''.$login.'.php\'" id="find'.$j.'"><li '.$class.'><div class="imgfind" style="top:7px !important;border-radius:'.$avaform.';display:inline-block;background:url('.$img.');position: relative;background-size:cover;background-position:center;width:30px;height:30px;"></div><span class="findtext">'.$newname.'<br><span style="color:grey;font-size:13px;position: relative;left: 30px;bottom:5px;">https://listsend.ru/'.$login.'</span></span></li></a>');
}
$no = $no + 1;
}
if($j == ($rows-1) && $no == 1) {
print('<style>.findlsnote li{padding-top: 5px;}</style>');
}
}
if($no == 0) {
print('<a href="javascript:void(0)" onclick=""><li style="padding-top: 5px;padding-bottom: 15px;"><img src="https://png.icons8.com/search/ios7/20/cccccc" class="imgfind"><span class="findtext" style="top:0;">'.$_POST['findls'].'</span></li></a>');
}
print('</ul>');
}
?>