-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathguitar_tips.php
71 lines (58 loc) · 1.94 KB
/
guitar_tips.php
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
66
67
68
69
70
71
<?php
if (((strpos($spell_checked, "learn") !== false || strpos($spell_checked, "tip") !== false) && strpos($spell_checked, "guitar") !== false) || $spell_checked == "lgu") {
mysql_close();
include 'lib/configdb2.php';
$query = "select * from guitar_tips where id=1";
$res = mysql_query($query);
if (mysql_num_rows($res)) {
$row = mysql_fetch_array($res);
$head = $row["head"];
$tip = $row["tip"];
$id = $row["id"];
$total_return = $head . "\n" . $tip;
}
mysql_close();
include 'lib/appconfigdb.php';
if (!empty($total_return)) {
$options_list[] = "Read next tip";
$list[] = array("content" => "__nexttip__" . $id . "__");
$source_machine = $machine_id;
$current_file = "/temp/$numbers";
file_put_contents(DATA_PATH . $current_file, $total_return);
include 'allmanip.php';
$to_logserver['source'] = 'gtip';
putOutput($total_return);
exit();
}
} elseif (preg_match("~__nexttip__(.+)__~", $req, $match)) {
$id = $match[1];
$id = $id + 1;
if ($id == "12") {
$id = 1;
}
mysql_close();
include 'lib/configdb2.php';
$query = "select * from guitar_tips where id=$id";
$res = mysql_query($query);
if (mysql_num_rows($res)) {
$row = mysql_fetch_array($res);
$head = $row["head"];
$tip = $row["tip"];
$id = $row["id"];
$total_return = $head . "\n" . $tip;
}
mysql_close();
include 'lib/appconfigdb.php';
if (!empty($total_return)) {
$options_list[] = "Read next tip";
$list[] = array("content" => "__nexttip__" . $id . "__");
$source_machine = $machine_id;
$current_file = "/temp/$numbers";
file_put_contents(DATA_PATH . $current_file, $total_return);
include 'allmanip.php';
$to_logserver['source'] = 'gtip';
putOutput($total_return);
exit();
}
}
?>