-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontrollore.php
More file actions
54 lines (42 loc) · 1.73 KB
/
Copy pathcontrollore.php
File metadata and controls
54 lines (42 loc) · 1.73 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
<?php
/**
* CONTROLLORE
*/
require('inc/inc_db.php');
////////////////////
/// VARIABILI
////////////////////
$conf = array(
'db_host' => 'localhost',
'db_name' => 'xxxxxxx',
'db_user' => 'xxxxxxx',
'db_pwd' => 'xxxxxxx',
);
$db = db_connect();
if (isset($_GET['advanced'])) {
// AUTOMATISMI AGGIUNTIVI, CARICATI A RICHIESTA
// ELIMINA DOPPIONI MAIL
$res = db_query("SELECT a.id FROM collezionatore a
join collezionatore b on (a.testo = b.testo and a.mail = b.mail and a.id < b.id) where a.testo <> '' and a.spam = 0");
while ($row=db_fetch($res)) {
db_query("delete from collezionatore where id = :id", array(':id'=>$row['id']));
}
// ELIMINA DOPPIONI SEARCH
$res = db_query("SELECT a.id FROM collezionatore_search a
join collezionatore_search b on (a.testo = b.testo and a.data = b.data and a.id < b.id) where a.testo <> ''");
while ($row=db_fetch($res)) {
db_query("delete from collezionatore_search where id = :id", array(':id'=>$row['id']));
}
// PULIZIA SEARCH
db_query("delete from collezionatore_search where testo like '{search_term%' or testo = 4");
echo '<h2>Pulizia effettuata, grazie!</h2>';
} else {
// AUTOMATISMI CARICATI SILENZIOSAMENTE SEMPRE
$id_max_spam = db_getone("select max(id) from collezionatore where spam = 1");
$cond_spam = (is_numeric($id_max_spam)) ? ' id > '.$id_max_spam.' and ' : '';
// CONTROLLA LINK NEL CAMPO "TELEFONO"
db_query("update collezionatore set spam = 1 where $cond_spam (tel like '%www%' or tel like '%http%' or tel like '%href%' or tel like '%url%') ");
// CONTROLLA LINK NEL CAMPO "TESTO"
db_query("update collezionatore set spam = 1 where $cond_spam (testo like '%href%' or testo like '%http%' or testo like '%url=%') ");
}
die;