-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunctions.php
More file actions
98 lines (83 loc) · 1.99 KB
/
functions.php
File metadata and controls
98 lines (83 loc) · 1.99 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<?php
/*
(c) 2006 Reed Morse <firstname.lastname at gmail.com>
and Pau Santesmasses <firstname at lastname.net>
*/
function connect(){
global $db;
if (mysql_connect($db['server'],$db['username'],$db['password'])) {
if (@!mysql_select_db($db['database'])) {
echo "Database doesn't exist.";
return false;
} else {
return true;
}
} else {
echo "Connection failure.";
return false;
}
}
function parse_domain($link){
if(!($raw_url = parse_url($link))){ // Invalid URL
return false;
}
@preg_match("/([^\.]+\.[^\.]+$)/", $raw_url['host'], $domain);
return @strtolower($domain[1]);
}
function is_row($int){
global $main_table;
$query_check = "SELECT * FROM `".$main_table."` WHERE `key1`='".$int."'";
$result_check = mysql_query($query_check);
$rows = @mysql_num_rows($result_check);
if($rows){
return true;
} else {
return false;
}
}
function authenticate(){
$cookie = @$_COOKIE['snickerdoodle'];
if($cookie == "polarbears"){
//
} else {
exit("Not logged in.");
}
}
function verify(){
if(@$_COOKIE['snickerdoodle']){
$cookie = $_COOKIE['snickerdoodle'];
} else {
$cookie = '';
}
if($cookie == "polarbears"){
return 1;
} else {
return 0;
}
}
function getUserID(){
$cookie = @$_COOKIE['usename'];
if($cookie){
return $cookie;
}
}
function news(){
$url = 'http://get-shorty.com/news.php';
if(function_exists('curl_init')) {
$curl = @curl_init();
@curl_setopt($curl, CURLOPT_URL, $url);
@curl_setopt($curl, CURLOPT_HEADER, 0);
@curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
$output = @curl_exec($curl);
$info = @curl_getinfo($curl);
@curl_close($curl);
if($output === false || $info['http_code'] != 200)
return "Couldn't find the Shorty server for the latest news.";
else
return $output;
} else {
return '(Unable to parse Shorty news feed. Your sever does not support the cURL library. Please see <a href="http://get-shorty.com">http://get-shorty.com</a>.)';
}
}
$version = "0.7.1(a) Beta";
?>