forked from mfscripts/Joke-Site-Script-Free
/
config.inc.php
103 lines (83 loc) · 2.72 KB
/
config.inc.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
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
99
100
101
102
103
<?php
error_reporting(0);
// site details
$site_name = "Your Site Name"; // site name/title
$site_path = "http://www.yourdomain.com/"; // site url. Lowercase. Including the http://www. and the ending forward slash '/'. i.e. 'http://www.mysitename.com/'.
$site_email = "info@yourdomain.com"; // site email address. This is used on the 'contact us' pages.
$site_slogan = "Nearly 10,000 funny jokes online now!"; // appears beneath the logo on all pages.
$perpage = 30; // amount of results to display on the browsing/cat listing pages
// DO NOT MODIFY BELOW THIS LINE
// functions
function formatField($input) {
$input = strip_tags($input);
$input = str_replace(";", ":", $input);
$input = mysql_real_escape_string($input);
return trim($input);
}
function urlconvert($string) {
$replace_values = array(" ", "'", "\"", "\\", "/", "?", "|", "@", "#", "~", "!", "£", "$", "%", "^", "&", "*", "(", ")", "[", "]", "{", "}", "+", "=", "-", ":", ";");
$string = str_replace($replace_values, "_", $string);
$string = str_replace(".", "", $string);
$string = str_replace(",", "", $string);
return strtolower($string);
}
function convert_number($number) {
if (($number < 0) || ($number > 999999999))
{
return "$number";
}
$Gn = floor($number / 1000000); /* Millions (giga) */
$number -= $Gn * 1000000;
$kn = floor($number / 1000); /* Thousands (kilo) */
$number -= $kn * 1000;
$Hn = floor($number / 100); /* Hundreds (hecto) */
$number -= $Hn * 100;
$Dn = floor($number / 10); /* Tens (deca) */
$n = $number % 10; /* Ones */
$res = "";
if ($Gn)
{
$res .= convert_number($Gn) . " Million";
}
if ($kn)
{
$res .= (empty($res) ? "" : " ") .
convert_number($kn) . " Thousand";
}
if ($Hn)
{
$res .= (empty($res) ? "" : " ") .
convert_number($Hn) . " Hundred";
}
$ones = array("", "One", "Two", "Three", "Four", "Five", "Six",
"Seven", "Eight", "Nine", "Ten", "Eleven", "Twelve", "Thirteen",
"Fourteen", "Fifteen", "Sixteen", "Seventeen", "Eightteen",
"Nineteen");
$tens = array("", "", "Twenty", "Thirty", "Fourty", "Fifty", "Sixty",
"Seventy", "Eigthy", "Ninety");
if ($Dn || $n)
{
if (!empty($res))
{
$res .= " and ";
}
if ($Dn < 2)
{
$res .= $ones[$Dn * 10 + $n];
}
else
{
$res .= $tens[$Dn];
if ($n)
{
$res .= "-" . $ones[$n];
}
}
}
if (empty($res))
{
$res = "zero";
}
return $res;
}
?>