Skip to content

Commit ba07284

Browse files
committed
Importing Znote AAC 1.5_SVN rev 168 to github.
1 parent 78b1a42 commit ba07284

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+5406
-0
lines changed

Diff for: .htaccess

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Options +FollowSymLinks
2+
RewriteEngine On
3+
RewriteCond %{REQUEST_FILENAME} !-f
4+
RewriteCond %{REQUEST_FILENAME} !-d
5+
RewriteRule ^(.*)$ /characterprofile.php?name=$1

Diff for: Znote AAC license.txt

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Meeh... I don't bother this. Its practically yours, do whatever you fucking want with it.
2+
I am Znote from otland.net, I created this acc. Please love me :D
3+
4+
Enjoy!

Diff for: admin.php

+260
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,260 @@
1+
<?php require_once 'engine/init.php'; include 'layout/overall/header.php';
2+
protect_page();
3+
admin_only($user_data);
4+
// Encryption (if select field has $key 0, it will return false, so add $enc + $key will return 100, subtract and you get 0, not false).
5+
$enc = 100;
6+
// Don't bother to think about cross site scripting here, since they can't access the page unless they are admin anyway.
7+
8+
// start
9+
if (empty($_POST) === false) {
10+
// BAN system!
11+
if (!empty($_POST['ban_char']) && !empty($_POST['ban_type']) && !empty($_POST['ban_action']) && !empty($_POST['ban_reason']) && !empty($_POST['ban_time']) && !empty($_POST['ban_comment'])) {
12+
if (user_character_exist($_POST['ban_char'])) {
13+
14+
// Decrypt and store values
15+
$charname = $_POST['ban_char'];
16+
$typeid = (int)$_POST['ban_type'] - $enc;
17+
$actionid = (int)$_POST['ban_action'] - $enc;
18+
$reasonid = (int)$_POST['ban_type'] - $enc;
19+
$time = (int)$_POST['ban_time'] - $enc;
20+
$comment = $_POST['ban_comment'];
21+
//var_dump($charname, $typeid, $actionid, $reasonid, $time, $comment);
22+
23+
if (set_rule_violation($charname, $typeid, $actionid, $reasonid, $time, $comment)) {
24+
$errors[] = 'Violation entry has been set for '. $charname .'.';
25+
} else {
26+
$errors[] = 'Website character name: '. $config['website_char'] .' does not exist. Create this character name or configure another name in config.php';
27+
$errors[] = 'Website failed to recognize a character it can represent while inserting a rule violation.';
28+
}
29+
30+
} else {
31+
$errors[] = 'Character '. $_POST['ban_char'] .' does not exist.';
32+
}
33+
}
34+
35+
36+
// delete character:
37+
if (empty($_POST['del_name']) === false) {
38+
if (user_character_exist($_POST['del_name'])) {
39+
user_delete_character(user_character_id($_POST['del_name']));
40+
$errors[] = 'Character '. $_POST['del_name'] .' permanently deleted.';
41+
} else {
42+
$errors[] = 'Character '. $_POST['del_name'] .' does not exist.';
43+
}
44+
}
45+
46+
// Reset password for char name
47+
if (empty($_POST['reset_pass']) === false && empty($_POST['new_pass']) === false) {
48+
// reset_pass = character name
49+
if (user_character_exist($_POST['reset_pass'])) {
50+
$acc_id = user_character_account_id($_POST['reset_pass']);
51+
52+
if ($acc_id != $session_user_id) {
53+
if ($config['TFSVersion'] == 'TFS_02') {
54+
user_change_password($acc_id, $_POST['new_pass']);
55+
} else if ($config['TFSVersion'] == 'TFS_03') {
56+
user_change_password03($acc_id, $_POST['new_pass']);
57+
}
58+
$errors[] = 'The password to the account of character name: '. $_POST['reset_pass'] .' has been set to: '. $_POST['new_pass'] .'.';
59+
} else {
60+
header('Location: changepassword.php');
61+
exit();
62+
}
63+
}
64+
}
65+
66+
/* Give points to character
67+
if (empty($_POST['points_char']) === false && empty($_POST['points_value']) === false) {
68+
// fetch account id
69+
$char = $_POST['points_char'];
70+
$points = $_POST['points_value'];
71+
$accid = user_character_account_id($char);
72+
if ($points > 0) {
73+
if ($accid > 0) {
74+
$new_points = $points;
75+
$old_points = mysql_result(mysql_query("SELECT `points` FROM `znote_accounts` WHERE `account_id`='$accid';"), 0, 'points');
76+
$new_points += $old_points;
77+
$update_account = mysql_query("UPDATE `znote_accounts` SET `points`='$new_points' WHERE `account_id`='$accid'");
78+
$errors[] = 'Success! Character '. $char .' has recieved '. $points .' premium points.';
79+
} else $errors[] = 'Account id is invalid. (Did you write correct character name?)'. $accid;
80+
} else $errors[] = 'Why the heck give a character 0 points?!';
81+
}*/
82+
83+
// Give points to character
84+
if (empty($_POST['points_char']) === false && empty($_POST['points_value']) === false) {
85+
$char = sanitize($_POST['points_char']);
86+
$points = (int)$_POST['points_value'];
87+
data_dump($_POST, false, "post data");
88+
$account = mysql_select_single("SELECT `account_id` FROM `players` WHERE `name`='$char' LIMIT 1;");
89+
data_dump($account, false, "fetching account id from players table");
90+
$znote_account = mysql_select_single("SELECT `id`, `points` FROM `znote_accounts` WHERE `account_id`='". $account['account_id'] ."';");
91+
data_dump($znote_account, false, "Fetching existing points from znote_accounts");
92+
93+
data_dump(
94+
array(
95+
'Old:' => $znote_account['points'],
96+
'New:' => $points,
97+
'Total:' => ($znote_account['points'] + $points)
98+
),
99+
false,
100+
"Points calculation:");
101+
$points += $znote_account['points'];
102+
mysql_update("UPDATE `znote_accounts` SET `points`='$points' WHERE `account_id`='". $account['account_id'] ."';");
103+
}
104+
105+
// Set character position
106+
if (empty($_POST['position_name']) === false && empty($_POST['position_type']) === false) {
107+
if (user_character_exist($_POST['position_name'])) {
108+
if (array_key_exists($_POST['position_type'], $config['ingame_positions'])) {
109+
if ($config['TFSVersion'] == 'TFS_02' || $config['TFSVersion'] == 'TFS_10') {
110+
set_ingame_position($_POST['position_name'], $_POST['position_type']);
111+
} else if ($config['TFSVersion'] == 'TFS_03') {
112+
set_ingame_position03($_POST['position_name'], $_POST['position_type']);
113+
}
114+
$pos = 'Undefined';
115+
foreach ($config['ingame_positions'] as $key=>$value) {
116+
if ($key == $_POST['position_type']) {
117+
$pos = $value;
118+
}
119+
}
120+
$errors[] = 'Character '. $_POST['position_name'] .' recieved the ingame position: '. $pos .'.';
121+
}
122+
} else {
123+
$errors[] = 'Character '. $_POST['position_name'] .' does not exist.';
124+
}
125+
}
126+
127+
// If empty post
128+
}
129+
130+
// Display whatever output we figure out to add
131+
if (empty($errors) === false){
132+
echo '<font color="red"><b>';
133+
echo output_errors($errors);
134+
echo '</b></font>';
135+
}
136+
// end
137+
?>
138+
<h1>Admin Page.</h1>
139+
<p>
140+
<?php
141+
$basic = user_znote_data('version', 'installed', 'cached');
142+
if ($basic['version'] !== $version) {
143+
mysql_query("UPDATE `znote` SET `version`='$version';") or die(mysql_error());
144+
$basic = user_znote_data('version', 'installed', 'cached');
145+
}
146+
echo "Running Znote AAC Version: ". $basic['version'] .".<br>";
147+
echo "Last cached on: ". getClock($basic['cached'], true) .".<br>";
148+
?>
149+
</p>
150+
<ul>
151+
<li>
152+
<b>Permanently Delete/erase character from database:</b>
153+
<form type="submit" action="" method="post">
154+
<input type="text" name="del_name" placeholder="Character name...">
155+
</form>
156+
</li>
157+
<li>
158+
<b>Ban/violate :3 character and/or his account:</b>
159+
<form action="" method="post">
160+
<table style="background-color:lightblue;">
161+
<!-- row 1 -->
162+
<tr>
163+
<td>
164+
<input type="text" name="ban_char" placeholder="Character name...">
165+
</td>
166+
</tr>
167+
168+
<!-- row 2 -->
169+
<tr>
170+
<td>
171+
<select name="ban_type">
172+
<?php
173+
foreach ($config['ban_type'] as $key=>$value) {
174+
echo "<option value=\"". ($enc + $key) ."\">". $value ."</option>";
175+
}
176+
?>
177+
</select>
178+
<select name="ban_action">
179+
<?php
180+
foreach ($config['ban_action'] as $key=>$value) {
181+
echo "<option value=\"". ($enc + $key) ."\">". $value ."</option>";
182+
}
183+
?>
184+
</select>
185+
<select name="ban_time">
186+
<?php
187+
foreach ($config['ban_time'] as $key=>$value) {
188+
echo "<option value=\"". ($enc + $key) ."\">". $value ."</option>";
189+
}
190+
?>
191+
</select>
192+
</td>
193+
</tr>
194+
195+
<!-- row 3 -->
196+
<tr>
197+
<td>
198+
Ban reason:
199+
<select name="ban_reason">
200+
<?php
201+
foreach ($config['ban_reason'] as $key=>$value) {
202+
echo "<option value=\"". ($enc + $key) ."\">". $value ."</option>";
203+
}
204+
?>
205+
</select>
206+
</td>
207+
</tr>
208+
209+
<!-- row 4 -->
210+
<tr>
211+
<td>
212+
Violation comment: (max 60 cols).
213+
<input type="text" name="ban_comment" maxlength="60" placeholder="Ban for botting rotworms.">
214+
<input type="submit" value="Set Violation">
215+
</td>
216+
</tr>
217+
</table>
218+
</form>
219+
</li>
220+
<li>
221+
<b>Reset password to the account of character name:</b>
222+
<form action="" method="post">
223+
<input type="text" name="reset_pass" placeholder="Character name">
224+
<input type="text" name="new_pass" placeholder="New password">
225+
<input type="submit" value="Change Password">
226+
</form>
227+
</li>
228+
<li>
229+
<b>Set character name to position:</b>
230+
<?php
231+
if ($config['TFSVersion'] == 'TFS_03' && count($config['ingame_positions']) == 5) {
232+
?>
233+
<font color="red">ERROR: You forgot to add (Senior Tutor) rank in config.php!</font>
234+
<?php
235+
}
236+
?>
237+
<form action="" method="post">
238+
<input type="text" name="position_name" placeholder="Character name">
239+
<select name="position_type">
240+
<?php
241+
foreach ($config['ingame_positions'] as $key=>$value) {
242+
echo "<option value=\"". $key ."\">". $value ."</option>";
243+
}
244+
?>
245+
</select>
246+
<input type="submit" value="Set Position">
247+
</form>
248+
</li>
249+
<li>
250+
<b>Give shop points to character:</b>
251+
<form action="" method="post">
252+
<input type="text" name="points_char" placeholder="Character name">
253+
<input type="text" name="points_value" placeholder="Points">
254+
<input type="submit" value="Give Points">
255+
</form>
256+
</li>
257+
</ul>
258+
<div id="twitter"><?php include 'twtrNews.php'; ?></div>
259+
260+
<?php include 'layout/overall/footer.php'; ?>

Diff for: admin_gallery.php

+122
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
<?php require_once 'engine/init.php'; include 'layout/overall/header.php';
2+
protect_page();
3+
admin_only($user_data);
4+
// start
5+
6+
// Delete
7+
if (isset($_POST['delete'])) {
8+
$data = explode(":", $_POST['delete']);
9+
echo 'Image '. $data[0] .' deleted.';
10+
updateImage($data[0], 3);
11+
}
12+
13+
// Accept
14+
if (isset($_POST['accept'])) {
15+
$data = explode(":", $_POST['accept']);
16+
echo 'Image '. $data[0] .' accepted and is now public.';
17+
updateImage($data[0], 2);
18+
}
19+
20+
// Wether we accept or delete, re-create the cache
21+
if (isset($_POST['accept']) || isset($_POST['delete'])) {
22+
$cache = new Cache('engine/cache/gallery');
23+
$images = fetchImages(2);
24+
if ($images != false) {
25+
$data = array();
26+
foreach ($images as $image) {
27+
$row['title'] = $image['title'];
28+
$row['desc'] = $image['desc'];
29+
$row['date'] = $image['date'];
30+
$row['image'] = $image['image'];
31+
$data[] = $row;
32+
}
33+
} else $data = "";
34+
$cache->setContent($data);
35+
$cache->save();
36+
}
37+
38+
?><h1>Images in need of moderation:</h1><?php
39+
$images = fetchImages(1);
40+
if ($images != false) {
41+
foreach($images as $image) {
42+
$pw = explode("!", $image['image']);
43+
?>
44+
<table>
45+
<tr class="yellow">
46+
<td><h2><?php echo $image['title']; ?><form action="" method="post"><input type="submit" name="accept" value="<?php echo $image['id']; ?>:Accept Image"/></form><form action="" method="post"><input type="submit" name="delete" value="<?php echo $image['id']; ?>:Delete Image"/></form></h2></td>
47+
</tr>
48+
<tr>
49+
<td>
50+
<a href="<?php echo 'http://'. $pw[0] .'.imgland.net/'. $pw[1] .'.'. $pw[2]; ?>"><img src="<?php echo 'http://'. $pw[0] .'.imgland.net/'. $pw[1] .'.'. $pw[2]; ?>" width="650"/></a>
51+
</td>
52+
</tr>
53+
<tr>
54+
<td>
55+
<?php
56+
$descr = str_replace("\\r", "", $image['desc']);
57+
$descr = str_replace("\\n", "<br />", $descr);
58+
?>
59+
<p><?php echo $descr; ?></p>
60+
</td>
61+
</tr>
62+
</table>
63+
<?php }
64+
} else echo '<h2>All good, no new images to moderate.</h2>';
65+
66+
?><h1>Public Images:</h1><?php
67+
$images = fetchImages(2);
68+
if ($images != false) {
69+
foreach($images as $image) {
70+
$pw = explode("!", $image['image']);
71+
?>
72+
<table>
73+
<tr class="yellow">
74+
<td><h2><?php echo $image['title']; ?><form action="" method="post"><input type="submit" name="delete" value="<?php echo $image['id']; ?>:Delete Image"/></form></h2></td>
75+
</tr>
76+
<tr>
77+
<td>
78+
<a href="<?php echo 'http://'. $pw[0] .'.imgland.net/'. $pw[1] .'.'. $pw[2]; ?>"><img src="<?php echo 'http://'. $pw[0] .'.imgland.net/'. $pw[1] .'.'. $pw[2]; ?>" width="650"/></a>
79+
</td>
80+
</tr>
81+
<tr>
82+
<td>
83+
<?php
84+
$descr = str_replace("\\r", "", $image['desc']);
85+
$descr = str_replace("\\n", "<br />", $descr);
86+
?>
87+
<p><?php echo $descr; ?></p>
88+
</td>
89+
</tr>
90+
</table>
91+
<?php }
92+
} else echo '<h2>There are currently no public images.</h2>';
93+
94+
?><h1>Deleted Images:</h1><?php
95+
$images = fetchImages(3);
96+
if ($images != false) {
97+
foreach($images as $image) {
98+
$pw = explode("!", $image['image']);
99+
?>
100+
<table>
101+
<tr class="yellow">
102+
<td><h2><?php echo $image['title']; ?><form action="" method="post"><input type="submit" name="accept" value="<?php echo $image['id']; ?>:Recover Image"/></form></h2></td>
103+
</tr>
104+
<tr>
105+
<td>
106+
<a href="<?php echo 'http://'. $pw[0] .'.imgland.net/'. $pw[1] .'.'. $pw[2]; ?>"><img src="<?php echo 'http://'. $pw[0] .'.imgland.net/'. $pw[1] .'.'. $pw[2]; ?>" width="650"/></a>
107+
</td>
108+
</tr>
109+
<tr>
110+
<td>
111+
<?php
112+
$descr = str_replace("\\r", "", $image['desc']);
113+
$descr = str_replace("\\n", "<br />", $descr);
114+
?>
115+
<p><?php echo $descr; ?></p>
116+
</td>
117+
</tr>
118+
</table>
119+
<?php }
120+
} else echo '<h2>There are currently no deleted images.</h2>';
121+
// end
122+
include 'layout/overall/footer.php'; ?>

0 commit comments

Comments
 (0)