Skip to content

Commit 7f4c8f5

Browse files
committed
history erased. initial public commit
0 parents  commit 7f4c8f5

18 files changed

+1499
-0
lines changed

favicon.ico

1.12 KB
Binary file not shown.

favicon.xcf

2.48 KB
Binary file not shown.

images/rss-icon-28.png

1.7 KB
Loading

includes/classes/SQL.class.php

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
<?php
2+
if (!defined('IN_GGGT')) { die(); }
3+
4+
class SQL
5+
{
6+
var $db_link, $num_queries, $queries;
7+
8+
function SQL($host, $username, $password, $pconnect)
9+
{
10+
$connect_func = $pconnect ? 'mysql_pconnect' : 'mysql_connect';
11+
$this->db_link = $connect_func($host, $username, $password) or $this->die_error('SQL');
12+
$this->num_queries = 0;
13+
$this->queries = array();
14+
}
15+
16+
function select_db($database)
17+
{
18+
mysql_select_db($database, $this->db_link) or $this->die_error('select_db');
19+
}
20+
21+
function query($query)
22+
{
23+
global $_;
24+
25+
if (isset($_GET['query_detail']) && $_GET['query_detail'] == 'true')
26+
{
27+
$start_time = array_sum(explode(' ', microtime()));
28+
$result = mysql_query($query, $this->db_link) or $this->die_error('query', $query);
29+
$end_time = array_sum(explode(' ', microtime()));
30+
$this->queries[] = array('query' => $query, 'run_time' => $end_time-$start_time);
31+
}
32+
else
33+
$result = mysql_query($query, $this->db_link) or $this->die_error('query', $query);
34+
35+
$this->num_queries++;
36+
return $result;
37+
}
38+
39+
function affected_rows()
40+
{
41+
$rows = mysql_affected_rows($this->db_link);
42+
return $rows;
43+
}
44+
45+
function fetch_assoc($result)
46+
{
47+
$row = mysql_fetch_assoc($result) or array();
48+
return $row;
49+
}
50+
51+
function fetch_row($result)
52+
{
53+
$row = mysql_fetch_row($result) or array();
54+
return $row;
55+
}
56+
57+
function fetch_field($query)
58+
{
59+
$array = $this->fetch_row($this->query($query));
60+
return $array[0];
61+
}
62+
63+
function num_rows($result)
64+
{
65+
$num_rows = mysql_num_rows($result);
66+
return $num_rows;
67+
}
68+
69+
function insert_id()
70+
{
71+
$insert_id = mysql_insert_id($this->db_link);
72+
return $insert_id;
73+
}
74+
75+
function result($result, $row)
76+
{
77+
$row = mysql_result($result, $row);
78+
return $row;
79+
}
80+
81+
function compile_set_fields($array)
82+
{
83+
$output = array();
84+
85+
foreach ($array as $field_name => $data)
86+
{
87+
$output[] = "`{$field_name}` = '".$this->real_escape_string($data)."'";
88+
}
89+
90+
return implode(', ', $output);
91+
}
92+
93+
function compile_array($result, $key = null)
94+
{
95+
$array = array();
96+
97+
if (isset($key))
98+
{
99+
while ($row = $this->fetch_assoc($result))
100+
$array[$row[$key]] = $row;
101+
102+
return $array;
103+
}
104+
else
105+
{
106+
while ($row = $this->fetch_assoc($result))
107+
$array[] = $row;
108+
109+
return $array;
110+
}
111+
}
112+
113+
function escape_string($unescaped_string)
114+
{
115+
return mysql_real_escape_string($unescaped_string);
116+
}
117+
118+
function real_escape_string($unescaped_string)
119+
{
120+
return mysql_real_escape_string($unescaped_string);
121+
}
122+
123+
function die_error($function, $note = null)
124+
{
125+
global $_, $Error;
126+
127+
$error_note = $function.':'.(isset($note) ? " {$note}" : '')."\n\n".mysql_errno($this->db_link).':'.mysql_error($this->db_link);
128+
129+
define('ERROR_TYPE', 'SQL');
130+
trigger_error($error_note, E_USER_ERROR);
131+
}
132+
}
133+
?>

includes/common.inc.php

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
if (!defined('IN_GGGT')) { die(); }
3+
4+
error_reporting(E_ALL);
5+
6+
ob_start('ob_gzhandler');
7+
8+
$_ = require_once('config.inc.php');
9+
10+
$_['page']['start_time'] = array_sum(explode(' ', microtime()));
11+
$_['page']['time'] = time();
12+
13+
require_once 'functions.inc.php';
14+
require_once 'functions_ggg.inc.php';
15+
require_once 'classes/SQL.class.php';
16+
17+
set_error_handler('error_handler');
18+
19+
if ((function_exists("get_magic_quotes_gpc") && get_magic_quotes_gpc()) || ini_get('magic_quotes_sybase')) {
20+
stripslashes_deep($_GET);
21+
stripslashes_deep($_POST);
22+
stripslashes_deep($_COOKIE);
23+
stripslashes_deep($_SESSION);
24+
stripslashes_deep($_REQUEST);
25+
}
26+
27+
$SQL = new SQL($_['mysql']['host'], $_['mysql']['username'], $_['mysql']['password'], $_['mysql']['pconnect']);
28+
$SQL->select_db($_['mysql']['db_name']);
29+
?>

includes/config.inc.php

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?php
2+
if (!defined('IN_GGGT')) { die(); }
3+
4+
$config = array(
5+
6+
'page' => array(
7+
'date_format' => 'M j, Y G:i A',
8+
'time_offset' => 0,
9+
),
10+
11+
'mysql' => array(
12+
'host' => '',
13+
'username' => '',
14+
'password' => '',
15+
'db_name' => '',
16+
'pconnect' => false,
17+
),
18+
19+
'cron' => array(
20+
'secret' => '',
21+
),
22+
23+
'poe' => array(
24+
'forum_timezone' => '',
25+
'forum_sessid' => '',
26+
'news_forum_id' => 54,
27+
'forum_posters' => array(
28+
'Chris', 'Jonathan', 'Erik', 'Mark_GGG', 'Samantha', 'Rory', 'Rhys',
29+
'Qarl', 'Andrew_GGG', 'Damien_GGG', 'Russell', 'Joel_GGG', 'Ari', 'Thomas',
30+
'BrianWeissman', 'Edwin_GGG', 'Support', 'Dylan', 'MaxS', 'Ammon_GGG',
31+
'Jess_GGG', 'Robbie_GGG', 'GGG_Neon', 'Jason_GGG', 'Henry_GGG', 'Luca_GGG',
32+
'Michael_GGG', 'Bex_GGG', 'Cagan_GGG',
33+
),
34+
'twitter_name' => 'pathofexile',
35+
),
36+
37+
'twitter' => array(
38+
'consumer_key' => '',
39+
'consumer_secret' => '',
40+
'access_token' => '',
41+
'access_secret' => '',
42+
),
43+
);
44+
45+
$local = @include('local_config.inc.php');
46+
47+
return $local ? array_replace_recursive($config, $local) : $config;
48+
?>

includes/footer.inc.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
if (!defined('IN_GGGT')) { die(); }
3+
?>
4+
<script>
5+
$(function() {
6+
$('.js-time').each(function() {
7+
$(this).text($.format.date(new Date($(this).data('time') * 1000), 'MMM d, yyyy h:mm a'));
8+
});
9+
});
10+
</script>
11+
12+
<div class="footer">
13+
Page generated in <?= round(array_sum(explode(' ', microtime())) - $_['page']['start_time'], 6) ?> seconds.
14+
This site is not affiliated with Path of Exile or Grinding Gear Games in any way. <br />
15+
Please direct feedback to <a href="http://www.pathofexile.com/forum/view-thread/69448" target="_blank">this thread</a>.
16+
</div>
17+
</div>
18+
</center>
19+
</body>
20+
</html>

includes/functions.inc.php

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
<?php
2+
if (!defined('IN_GGGT')) { die(); }
3+
4+
function select_options($options, $selected = '') {
5+
$ret = '';
6+
if (is_array($options)) {
7+
if (!isset($options[$selected])) {
8+
$ret .= '<option value="'.htmlspecialchars($selected).'" selected=true> </option>';
9+
}
10+
foreach ($options as $value => $text) {
11+
$ret .= '<option value="'.htmlspecialchars($value).'"'.($value == $selected ? ' selected=true' : '').'>'.htmlspecialchars($text).'</option>';
12+
}
13+
}
14+
return $ret;
15+
}
16+
17+
function error_handler($errno, $errstr, $errfile, $errline) {
18+
if ($errno == E_USER_ERROR) {
19+
die('<title>Error!</title><b>Error:</b> A fatal error has occured. Please try again later as the problem will be fixed shortly.');
20+
}
21+
}
22+
23+
function selected($var, $option_value) {
24+
return (isset($_POST[$var]) && $_POST[$var] == $option_value ? ' selected=true' : '');
25+
}
26+
27+
function checked($var, $option_value) {
28+
return (isset($_POST[$var]) && $_POST[$var] == $option_value ? ' checked=true' : '');
29+
}
30+
31+
function field_value($post_var, $var2 = '') {
32+
if (isset($_POST[$post_var])) {
33+
return htmlspecialchars($_POST[$post_var]);
34+
} else {
35+
return $var2;
36+
}
37+
}
38+
39+
function fetch_isp() {
40+
$ip_addr = fetch_ip_addr();
41+
$domain_name = $ip_addr ? @gethostbyaddr($ip_addr) : '';
42+
$isp_name = explode('.', $domain_name);
43+
$isp_name = array_slice($isp_name, count($isp_name)-2);
44+
$isp_name = implode('.', $isp_name);
45+
if (!preg_match('#[a-zA-Z]+#', $isp_name)) {
46+
$isp_name = "Unknown";
47+
}
48+
return $isp_name;
49+
}
50+
51+
function fetch_ip_addr() {
52+
$ip_addr = $_SERVER['REMOTE_ADDR'];
53+
54+
if (strpos($ip_addr, ',')) {
55+
$ip_addr = explode(',', $ip_addr);
56+
$ip_addr = trim($ip_addr[0]);
57+
}
58+
59+
return $ip_addr;
60+
}
61+
62+
function build_simple_link($base_name, $link_title, $query) {
63+
return sprintf('<a href="%s">%s</a>', $base_name . '?' . $query, $link_title);
64+
}
65+
66+
function create_date($timestamp, $format = NULL) {
67+
global $_;
68+
69+
if ($timestamp === NULL) {
70+
$date = 'N/A';
71+
} else {
72+
$date = gmdate($format === NULL ? $_['page']['date_format'] : $format, $timestamp + $_['page']['time_offset']);
73+
}
74+
75+
return $date;
76+
}
77+
78+
function create_gmdate($timestamp, $format = NULL) {
79+
global $_;
80+
81+
if ($timestamp === NULL) {
82+
$date = 'N/A';
83+
} else {
84+
$date = gmdate($format === NULL ? $_['page']['date_format'] : $format, $timestamp);
85+
}
86+
87+
return $date;
88+
}
89+
90+
function unhtmlspecialchars($string) {
91+
$string = str_replace('&quot;', '"', $string);
92+
$string = str_replace('&lt;', '<', $string);
93+
$string = str_replace('&gt;', '>', $string);
94+
$string = str_replace('&amp;', '&', $string);
95+
96+
return $string;
97+
}
98+
99+
function stripslashes_deep(&$value) {
100+
$value = is_array($value) ?
101+
array_map('stripslashes_deep', $value) :
102+
stripslashes($value);
103+
104+
return $value;
105+
}
106+
?>

0 commit comments

Comments
 (0)