code:
The recommended way to use the Material Icons font is hosted by Google Fonts,
available here:

```
<link href="https://fonts.googleapis.com/icon?family=Material+Icons"
      rel="stylesheet">
```

Read more in our full usage guide:
http://google.github.io/material-design-icons/#icon-font-for-the-web

license: mit


code:
3d_rotation e84d
access_alarm e190
access_alarms e191
access_time e192
accessibility e84e
account_balance e84f
account_balance_wallet e850
account_box e851
account_circle e853
adb e60e
add e145
add_alarm e193
add_alert e003
add_box e146
add_circle e147
add_circle_outline e148
add_shopping_cart e854
add_to_photos e39d
adjust e39e
airline_seat_flat e630
airline_seat_flat_angled e631
airline_seat_individual_suite e632
airline_seat_legroom_extra e633
airline_seat_legroom_normal e634
airline_seat_legroom_reduced e635
airline_seat_recline_extra e636
airline_seat_recline_normal e637
airplanemode_active e195
airplanemode_inactive e194
airplay e055
alarm e855
alarm_add e856
alarm_off e857
alarm_on e858
album e019
android e859
announcement e85a
apps e5c3
archive e149
arrow_back e5c4
arrow_drop_down e5c5
arrow_drop_down_circle e5c6
arrow_drop_up e5c7
arrow_forward e5c8
aspect_ratio e85b
assessment e85c
assignment e85d
assignment_ind e85e
assignment_late e85f
assignment_return e860
assignment_returned e861
assignment_turned_in e862
assistant e39f
assistant_photo e3a0
attach_file e226
attach_money e227
attachment e2bc
audiotrack e3a1
autorenew e863
av_timer e01b
backspace e14a
backup e864
battery_alert e19c
battery_charging_full e1a3
battery_full e1a4
battery_std e1a5
battery_unknown e1a6
beenhere e52d
block e14b
bluetooth e1a7
bluetooth_audio e60f
bluetooth_connected e1a8
bluetooth_disabled e1a9
bluetooth_searching e1aa
blur_circular e3a2
blur_linear e3a3
blur_off e3a4
blur_on e3a5
book e865
bookmark e866
bookmark_border e867
border_all e228
border_bottom e229
border_clear e22a
border_color e22b
border_horizontal e22c
border_inner e22d
border_left e22e
border_outer e22f
border_right e230
border_style e231
border_top e232
border_vertical e233
brightness_1 e3a6
brightness_2 e3a7
brightness_3 e3a8
brightness_4 e3a9
brightness_5 e3aa
brightness_6 e3ab
brightness_7 e3ac
brightness_auto e1ab
brightness_high e1ac
brightness_low e1ad
brightness_medium e1ae
broken_image e3ad
brush e3ae
bug_report e868
build e869
business e0af
cached e86a
cake e7e9
call e0b0
call_end e0b1
call_made e0b2
call_merge e0b3
call_missed e0b4
call_received e0b5
call_split e0b6
camera e3af
camera_alt e3b0
camera_enhance e8fc
camera_front e3b1
camera_rear e3b2
camera_roll e3b3
cancel e5c9
card_giftcard e8f6
card_membership e8f7
card_travel e8f8
cast e307
cast_connected e308
center_focus_strong e3b4
center_focus_weak e3b5
change_history e86b
chat e0b7
chat_bubble e0ca
chat_bubble_outline e0cb
check e5ca
check_box e834
check_box_outline_blank e835
check_circle e86c
chevron_left e5cb
chevron_right e5cc
chrome_reader_mode e86d
class e86e
clear e14c
clear_all e0b8
close e5cd
closed_caption e01c
cloud e2bd
cloud_circle e2be
cloud_done e2bf
cloud_download e2c0
cloud_off e2c1
cloud_queue e2c2
cloud_upload e2c3
code e86f
collections e3b6
collections_bookmark e431
color_lens e3b7
colorize e3b8
comment e0b9
compare e3b9
computer e30a
confirmation_number e638
contact_phone e0cf
contacts e0ba
content_copy e14d
content_cut e14e
content_paste e14f
control_point e3ba
control_point_duplicate e3bb
create e150
credit_card e870
crop e3be
crop_16_9 e3bc
crop_3_2 e3bd
crop_5_4 e3bf
crop_7_5 e3c0
crop_din e3c1
crop_free e3c2
crop_landscape e3c3
crop_original e3c4
crop_portrait e3c5
crop_square e3c6
dashboard e871
data_usage e1af
dehaze e3c7
delete e872
description e873
desktop_mac e30b
desktop_windows e30c
details e3c8
developer_board e30d
developer_mode e1b0
device_hub e335
devices e1b1
dialer_sip e0bb
dialpad e0bc
directions e52e
directions_bike e52f
directions_boat e532
directions_bus e530
directions_car e531
directions_railway e534
directions_run e566
directions_subway e533
directions_transit e535
directions_walk e536
disc_full e610
dns e875
do_not_disturb e612
do_not_disturb_alt e611
dock e30e
domain e7ee
done e876
done_all e877
drafts e151
drive_eta e613
dvr e1b2
edit e3c9
eject e8fb
email e0be
equalizer e01d
error e000
error_outline e001
event e878
event_available e614
event_busy e615
event_note e616
event_seat e903
exit_to_app e879
expand_less e5ce
expand_more e5cf
explicit e01e
explore e87a
exposure e3ca
exposure_neg_1 e3cb
exposure_neg_2 e3cc
exposure_plus_1 e3cd
exposure_plus_2 e3ce
exposure_zero e3cf
extension e87b
face e87c
fast_forward e01f
fast_rewind e020
favorite e87d
favorite_border e87e
feedback e87f
file_download e2c4
file_upload e2c6
filter e3d3
filter_1 e3d0
filter_2 e3d1
filter_3 e3d2
filter_4 e3d4
filter_5 e3d5
filter_6 e3d6
filter_7 e3d7
filter_8 e3d8
filter_9 e3d9
filter_9_plus e3da
filter_b_and_w e3db
filter_center_focus e3dc
filter_drama e3dd
filter_frames e3de
filter_hdr e3df
filter_list e152
filter_none e3e0
filter_tilt_shift e3e2
filter_vintage e3e3
find_in_page e880
find_replace e881
flag e153
flare e3e4
flash_auto e3e5
flash_off e3e6
flash_on e3e7
flight e539
flight_land e904
flight_takeoff e905
flip e3e8
flip_to_back e882
flip_to_front e883
folder e2c7
folder_open e2c8
folder_shared e2c9
folder_special e617
font_download e167
format_align_center e234
format_align_justify e235
format_align_left e236
format_align_right e237
format_bold e238
format_clear e239
format_color_fill e23a
format_color_reset e23b
format_color_text e23c
format_indent_decrease e23d
format_indent_increase e23e
format_italic e23f
format_line_spacing e240
format_list_bulleted e241
format_list_numbered e242
format_paint e243
format_quote e244
format_size e245
format_strikethrough e246
format_textdirection_l_to_r e247
format_textdirection_r_to_l e248
format_underlined e249
forum e0bf
forward e154
forward_10 e056
forward_30 e057
forward_5 e058
fullscreen e5d0
fullscreen_exit e5d1
functions e24a
gamepad e30f
games e021
gesture e155
get_app e884
gif e908
gps_fixed e1b3
gps_not_fixed e1b4
gps_off e1b5
grade e885
gradient e3e9
grain e3ea
graphic_eq e1b8
grid_off e3eb
grid_on e3ec
group e7ef
group_add e7f0
group_work e886
hd e052
hdr_off e3ed
hdr_on e3ee
hdr_strong e3f1
hdr_weak e3f2
headset e310
headset_mic e311
healing e3f3
hearing e023
help e887
help_outline e8fd
high_quality e024
highlight_off e888
history e889
home e88a
hotel e53a
hourglass_empty e88b
hourglass_full e88c
http e902
https e88d
image e3f4
image_aspect_ratio e3f5
import_export e0c3
inbox e156
indeterminate_check_box e909
info e88e
info_outline e88f
input e890
insert_chart e24b
insert_comment e24c
insert_drive_file e24d
insert_emoticon e24e
insert_invitation e24f
insert_link e250
insert_photo e251
invert_colors e891
invert_colors_off e0c4
iso e3f6
keyboard e312
keyboard_arrow_down e313
keyboard_arrow_left e314
keyboard_arrow_right e315
keyboard_arrow_up e316
keyboard_backspace e317
keyboard_capslock e318
keyboard_hide e31a
keyboard_return e31b
keyboard_tab e31c
keyboard_voice e31d
label e892
label_outline e893
landscape e3f7
language e894
laptop e31e
laptop_chromebook e31f
laptop_mac e320
laptop_windows e321
launch e895
layers e53b
layers_clear e53c
leak_add e3f8
leak_remove e3f9
lens e3fa
library_add e02e
library_books e02f
library_music e030
link e157
list e896
live_help e0c6
live_tv e639
local_activity e53f
local_airport e53d
local_atm e53e
local_bar e540
local_cafe e541
local_car_wash e542
local_convenience_store e543
local_dining e556
local_drink e544
local_florist e545
local_gas_station e546
local_grocery_store e547
local_hospital e548
local_hotel e549
local_laundry_service e54a
local_library e54b
local_mall e54c
local_movies e54d
local_offer e54e
local_parking e54f
local_pharmacy e550
local_phone e551
local_pizza e552
local_play e553
local_post_office e554
local_printshop e555
local_see e557
local_shipping e558
local_taxi e559
location_city e7f1
location_disabled e1b6
location_off e0c7
location_on e0c8
location_searching e1b7
lock e897
lock_open e898
lock_outline e899
looks e3fc
looks_3 e3fb
looks_4 e3fd
looks_5 e3fe
looks_6 e3ff
looks_one e400
looks_two e401
loop e028
loupe e402
loyalty e89a
mail e158
map e55b
markunread e159
markunread_mailbox e89b
memory e322
menu e5d2
merge_type e252
message e0c9
mic e029
mic_none e02a
mic_off e02b
mms e618
mode_comment e253
mode_edit e254
money_off e25c
monochrome_photos e403
mood e7f2
mood_bad e7f3
more e619
more_horiz e5d3
more_vert e5d4
mouse e323
movie e02c
movie_creation e404
music_note e405
my_location e55c
nature e406
nature_people e407
navigate_before e408
navigate_next e409
navigation e55d
network_cell e1b9
network_locked e61a
network_wifi e1ba
new_releases e031
nfc e1bb
no_sim e0cc
not_interested e033
note_add e89c
notifications e7f4
notifications_active e7f7
notifications_none e7f5
notifications_off e7f6
notifications_paused e7f8
offline_pin e90a
ondemand_video e63a
open_in_browser e89d
open_in_new e89e
open_with e89f
pages e7f9
pageview e8a0
palette e40a
panorama e40b
panorama_fish_eye e40c
panorama_horizontal e40d
panorama_vertical e40e
panorama_wide_angle e40f
party_mode e7fa
pause e034
pause_circle_filled e035
pause_circle_outline e036
payment e8a1
people e7fb
people_outline e7fc
perm_camera_mic e8a2
perm_contact_calendar e8a3
perm_data_setting e8a4
perm_device_information e8a5
perm_identity e8a6
perm_media e8a7
perm_phone_msg e8a8
perm_scan_wifi e8a9
person e7fd
person_add e7fe
person_outline e7ff
person_pin e55a
personal_video e63b
phone e0cd
phone_android e324
phone_bluetooth_speaker e61b
phone_forwarded e61c
phone_in_talk e61d
phone_iphone e325
phone_locked e61e
phone_missed e61f
phone_paused e620
phonelink e326
phonelink_erase e0db
phonelink_lock e0dc
phonelink_off e327
phonelink_ring e0dd
phonelink_setup e0de
photo e410
photo_album e411
photo_camera e412
photo_library e413
photo_size_select_actual e432
photo_size_select_large e433
photo_size_select_small e434
picture_as_pdf e415
picture_in_picture e8aa
pin_drop e55e
place e55f
play_arrow e037
play_circle_filled e038
play_circle_outline e039
play_for_work e906
playlist_add e03b
plus_one e800
poll e801
polymer e8ab
portable_wifi_off e0ce
portrait e416
power e63c
power_input e336
power_settings_new e8ac
present_to_all e0df
print e8ad
public e80b
publish e255
query_builder e8ae
question_answer e8af
queue e03c
queue_music e03d
radio e03e
radio_button_checked e837
radio_button_unchecked e836
rate_review e560
receipt e8b0
recent_actors e03f
redeem e8b1
redo e15a
refresh e5d5
remove e15b
remove_circle e15c
remove_circle_outline e15d
remove_red_eye e417
reorder e8fe
repeat e040
repeat_one e041
replay e042
replay_10 e059
replay_30 e05a
replay_5 e05b
reply e15e
reply_all e15f
report e160
report_problem e8b2
restaurant_menu e561
restore e8b3
ring_volume e0d1
room e8b4
rotate_90_degrees_ccw e418
rotate_left e419
rotate_right e41a
router e328
satellite e562
save e161
scanner e329
schedule e8b5
school e80c
screen_lock_landscape e1be
screen_lock_portrait e1bf
screen_lock_rotation e1c0
screen_rotation e1c1
sd_card e623
sd_storage e1c2
search e8b6
security e32a
select_all e162
send e163
settings e8b8
settings_applications e8b9
settings_backup_restore e8ba
settings_bluetooth e8bb
settings_brightness e8bd
settings_cell e8bc
settings_ethernet e8be
settings_input_antenna e8bf
settings_input_component e8c0
settings_input_composite e8c1
settings_input_hdmi e8c2
settings_input_svideo e8c3
settings_overscan e8c4
settings_phone e8c5
settings_power e8c6
settings_remote e8c7
settings_system_daydream e1c3
settings_voice e8c8
share e80d
shop e8c9
shop_two e8ca
shopping_basket e8cb
shopping_cart e8cc
shuffle e043
signal_cellular_4_bar e1c8
signal_cellular_connected_no_internet_4_bar e1cd
signal_cellular_no_sim e1ce
signal_cellular_null e1cf
signal_cellular_off e1d0
signal_wifi_4_bar e1d8
signal_wifi_4_bar_lock e1d9
signal_wifi_off e1da
sim_card e32b
sim_card_alert e624
skip_next e044
skip_previous e045
slideshow e41b
smartphone e32c
sms e625
sms_failed e626
snooze e046
sort e164
sort_by_alpha e053
space_bar e256
speaker e32d
speaker_group e32e
speaker_notes e8cd
speaker_phone e0d2
spellcheck e8ce
star e838
star_border e83a
star_half e839
stars e8d0
stay_current_landscape e0d3
stay_current_portrait e0d4
stay_primary_landscape e0d5
stay_primary_portrait e0d6
stop e047
storage e1db
store e8d1
store_mall_directory e563
straighten e41c
strikethrough_s e257
style e41d
subject e8d2
subtitles e048
supervisor_account e8d3
surround_sound e049
swap_calls e0d7
swap_horiz e8d4
swap_vert e8d5
swap_vertical_circle e8d6
switch_camera e41e
switch_video e41f
sync e627
sync_disabled e628
sync_problem e629
system_update e62a
system_update_alt e8d7
tab e8d8
tab_unselected e8d9
tablet e32f
tablet_android e330
tablet_mac e331
tag_faces e420
tap_and_play e62b
terrain e564
text_format e165
textsms e0d8
texture e421
theaters e8da
thumb_down e8db
thumb_up e8dc
thumbs_up_down e8dd
time_to_leave e62c
timelapse e422
timer e425
timer_10 e423
timer_3 e424
timer_off e426
toc e8de
today e8df
toll e8e0
tonality e427
toys e332
track_changes e8e1
traffic e565
transform e428
translate e8e2
trending_down e8e3
trending_flat e8e4
trending_up e8e5
tune e429
turned_in e8e6
turned_in_not e8e7
tv e333
undo e166
unfold_less e5d6
unfold_more e5d7
usb e1e0
verified_user e8e8
vertical_align_bottom e258
vertical_align_center e259
vertical_align_top e25a
vibration e62d
video_library e04a
videocam e04b
videocam_off e04c
view_agenda e8e9
view_array e8ea
view_carousel e8eb
view_column e8ec
view_comfy e42a
view_compact e42b
view_day e8ed
view_headline e8ee
view_list e8ef
view_module e8f0
view_quilt e8f1
view_stream e8f2
view_week e8f3
vignette e435
visibility e8f4
visibility_off e8f5
voice_chat e62e
voicemail e0d9
volume_down e04d
volume_mute e04e
volume_off e04f
volume_up e050
vpn_key e0da
vpn_lock e62f
wallpaper e1bc
warning e002
watch e334
wb_auto e42c
wb_cloudy e42d
wb_incandescent e42e
wb_iridescent e436
wb_sunny e430
wc e63d
web e051
whatshot e80e
widgets e1bd
wifi e63e
wifi_lock e1e1
wifi_tethering e1e2
work e8f9
wrap_text e25b
youtube_searched_for e8fa
zoom_in e8ff
zoom_out e900

path: fonts/iconfont/codepoints


code:
#!/usr/bin/env node

var fileSystem = require('fs');
var readLine = require('readline');
var path = require('path');

// Output file path
var MAP_FILE_NAME = 'MaterialIcons-Regular.ijmap';

// Create a file streaming interface
var readLineHandle = readLine.createInterface({
  input: fileSystem.createReadStream('codepoints'),
  output: process.stdout,
  terminal: false
});

// Read each line by line from the file codepoints file
var json = {icons: {}};
readLineHandle.on('line', function(line) {
  // Match the name, space then any unicode after it
  var nameCodepointPair = line.split(' ');

  // Titleize the glyph name
  var codepoint = nameCodepointPair[1];
  var name = nameCodepointPair[0].toLowerCase().trim()
      .replace(/[^0-9a-z]+/gi, ' ')
      .replace(/\b[a-z]/g, function(char) {
        return char.toUpperCase();
      });

  // Assign the codepoint to the name for IconJar
  json.icons[codepoint] = {name: name};
});

readLineHandle.on('close', function() {
  // Once reading has finished here we can write the file
  fileSystem.writeFileSync(MAP_FILE_NAME, JSON.stringify(json));
});


code:
<?xml version="1.0" standalone="no"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd" > <svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%">
<defs >
<font id="socialfoundicons" horiz-adv-x="933" ><font-face
    font-family="Social Foundicons"
    units-per-em="1000"
    panose-1="0 0 0 0 0 0 0 0 0 0"
    ascent="1000"
    descent="0"
    alphabetic="0" />
<missing-glyph horiz-adv-x="250" />
<glyph unicode=" " glyph-name="space" horiz-adv-x="250" />
<glyph unicode="~" glyph-name="asciitilde" horiz-adv-x="1000" />
</font>
</defs>
</svg>


code:
# Source Sans Pro

Source Sans Pro is a set of OpenType fonts that have been designed to work well
in user interface (UI) environments. In addition to a functional OpenType font, this open
source project provides all of the source files that were used to build this OpenType font
by using the AFDKO makeotf tool.

## Font installation instructions

* [Mac OS X](http://support.apple.com/kb/HT2509)
* [Windows](http://windows.microsoft.com/en-us/windows-vista/install-or-uninstall-fonts)
* [Linux/Unix-based systems](https://github.com/adobe-fonts/source-code-pro/issues/17#issuecomment-8967116)

## Getting Involved

Send suggestions for changes to the Source Sans OpenType font project maintainer, [Paul D. Hunt](mailto:opensourcefonts@adobe.com?subject=[GitHub] Source Sans Pro), for consideration.

## Further information

For information about the design and background of Source Sans, please refer to the [official font readme file](http://www.adobe.com/products/type/font-information/source-sans-pro-readme.html).


source-sans-pro

type: git

description: Source Sans Pro font family by Adobe

license: SIL OFL 1.1

keywords:
font
sourcesans
sourcesanspro
source sans
source sans pro


code:
@font-face{
    font-family: 'Source Sans Pro';
    font-weight: 200;
    font-style: normal;
    font-stretch: normal;
    src: url('EOT/SourceSansPro-ExtraLight.eot') format('embedded-opentype'),
         url('WOFF2/TTF/SourceSansPro-ExtraLight.ttf.woff2') format('woff2'),
         url('WOFF/OTF/SourceSansPro-ExtraLight.otf.woff') format('woff'),
         url('OTF/SourceSansPro-ExtraLight.otf') format('opentype'),
         url('TTF/SourceSansPro-ExtraLight.ttf') format('truetype');
}

@font-face{
    font-family: 'Source Sans Pro';
    font-weight: 200;
    font-style: italic;
    font-stretch: normal;
    src: url('EOT/SourceSansPro-ExtraLightIt.eot') format('embedded-opentype'),
         url('WOFF2/TTF/SourceSansPro-ExtraLightIt.ttf.woff2') format('woff2'),
         url('WOFF/OTF/SourceSansPro-ExtraLightIt.otf.woff') format('woff'),
         url('OTF/SourceSansPro-ExtraLightIt.otf') format('opentype'),
         url('TTF/SourceSansPro-ExtraLightIt.ttf') format('truetype');
}

@font-face{
    font-family: 'Source Sans Pro';
    font-weight: 300;
    font-style: normal;
    font-stretch: normal;
    src: url('EOT/SourceSansPro-Light.eot') format('embedded-opentype'),
         url('WOFF2/TTF/SourceSansPro-Light.ttf.woff2') format('woff2'),
         url('WOFF/OTF/SourceSansPro-Light.otf.woff') format('woff'),
         url('OTF/SourceSansPro-Light.otf') format('opentype'),
         url('TTF/SourceSansPro-Light.ttf') format('truetype');
}

@font-face{
    font-family: 'Source Sans Pro';
    font-weight: 300;
    font-style: italic;
    font-stretch: normal;
    src: url('EOT/SourceSansPro-LightIt.eot') format('embedded-opentype'),
         url('WOFF2/TTF/SourceSansPro-LightIt.ttf.woff2') format('woff2'),
         url('WOFF/OTF/SourceSansPro-LightIt.otf.woff') format('woff'),
         url('OTF/SourceSansPro-LightIt.otf') format('opentype'),
         url('TTF/SourceSansPro-LightIt.ttf') format('truetype');
}

@font-face{
    font-family: 'Source Sans Pro';
    font-weight: 400;
    font-style: normal;
    font-stretch: normal;
    src: url('EOT/SourceSansPro-Regular.eot') format('embedded-opentype'),
         url('WOFF2/TTF/SourceSansPro-Regular.ttf.woff2') format('woff2'),
         url('WOFF/OTF/SourceSansPro-Regular.otf.woff') format('woff'),
         url('OTF/SourceSansPro-Regular.otf') format('opentype'),
         url('TTF/SourceSansPro-Regular.ttf') format('truetype');
}

@font-face{
    font-family: 'Source Sans Pro';
    font-weight: 400;
    font-style: italic;
    font-stretch: normal;
    src: url('EOT/SourceSansPro-It.eot') format('embedded-opentype'),
         url('WOFF2/TTF/SourceSansPro-It.ttf.woff2') format('woff2'),
         url('WOFF/OTF/SourceSansPro-It.otf.woff') format('woff'),
         url('OTF/SourceSansPro-It.otf') format('opentype'),
         url('TTF/SourceSansPro-It.ttf') format('truetype');
}

@font-face{
    font-family: 'Source Sans Pro';
    font-weight: 600;
    font-style: normal;
    font-stretch: normal;
    src: url('EOT/SourceSansPro-Semibold.eot') format('embedded-opentype'),
         url('WOFF2/TTF/SourceSansPro-Semibold.ttf.woff2') format('woff2'),
         url('WOFF/OTF/SourceSansPro-Semibold.otf.woff') format('woff'),
         url('OTF/SourceSansPro-Semibold.otf') format('opentype'),
         url('TTF/SourceSansPro-Semibold.ttf') format('truetype');
}

@font-face{
    font-family: 'Source Sans Pro';
    font-weight: 600;
    font-style: italic;
    font-stretch: normal;
    src: url('EOT/SourceSansPro-SemiboldIt.eot') format('embedded-opentype'),
         url('WOFF2/TTF/SourceSansPro-SemiboldIt.ttf.woff2') format('woff2'),
         url('WOFF/OTF/SourceSansPro-SemiboldIt.otf.woff') format('woff'),
         url('OTF/SourceSansPro-SemiboldIt.otf') format('opentype'),
         url('TTF/SourceSansPro-SemiboldIt.ttf') format('truetype');
}

@font-face{
    font-family: 'Source Sans Pro';
    font-weight: 700;
    font-style: normal;
    font-stretch: normal;
    src: url('EOT/SourceSansPro-Bold.eot') format('embedded-opentype'),
         url('WOFF2/TTF/SourceSansPro-Bold.ttf.woff2') format('woff2'),
         url('WOFF/OTF/SourceSansPro-Bold.otf.woff') format('woff'),
         url('OTF/SourceSansPro-Bold.otf') format('opentype'),
         url('TTF/SourceSansPro-Bold.ttf') format('truetype');
}

@font-face{
    font-family: 'Source Sans Pro';
    font-weight: 700;
    font-style: italic;
    font-stretch: normal;
    src: url('EOT/SourceSansPro-BoldIt.eot') format('embedded-opentype'),
         url('WOFF2/TTF/SourceSansPro-BoldIt.ttf.woff2') format('woff2'),
         url('WOFF/OTF/SourceSansPro-BoldIt.otf.woff') format('woff'),
         url('OTF/SourceSansPro-BoldIt.otf') format('opentype'),
         url('TTF/SourceSansPro-BoldIt.ttf') format('truetype');
}

@font-face{
    font-family: 'Source Sans Pro';
    font-weight: 900;
    font-style: normal;
    font-stretch: normal;
    src: url('EOT/SourceSansPro-Black.eot') format('embedded-opentype'),
         url('WOFF2/TTF/SourceSansPro-Black.ttf.woff2') format('woff2'),
         url('WOFF/OTF/SourceSansPro-Black.otf.woff') format('woff'),
         url('OTF/SourceSansPro-Black.otf') format('opentype'),
         url('TTF/SourceSansPro-Black.ttf') format('truetype');
}

@font-face{
    font-family: 'Source Sans Pro';
    font-weight: 900;
    font-style: italic;
    font-stretch: normal;
    src: url('EOT/SourceSansPro-BlackIt.eot') format('embedded-opentype'),
         url('WOFF2/TTF/SourceSansPro-BlackIt.ttf.woff2') format('woff2'),
         url('WOFF/OTF/SourceSansPro-BlackIt.otf.woff') format('woff'),
         url('OTF/SourceSansPro-BlackIt.otf') format('opentype'),
         url('TTF/SourceSansPro-BlackIt.ttf') format('truetype');
}


code:
-- phpMyAdmin SQL Dump
-- version 3.2.2.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: May 20, 2015 at 05:58 AM
-- Server version: 5.1.41
-- PHP Version: 5.4.39-0+deb7u1

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

--
-- Database: `haruko`
--

-- --------------------------------------------------------

--
-- Table structure for table `ads`
--

CREATE TABLE IF NOT EXISTS `ads` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `board` varchar(10) NOT NULL,
  `position` varchar(10) NOT NULL,
  `text` text NOT NULL,
  `show` int(1) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ;

-- --------------------------------------------------------

--
-- Table structure for table `announcements`
--

CREATE TABLE IF NOT EXISTS `announcements` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `date` int(30) NOT NULL,
  `who` varchar(40) NOT NULL,
  `title` varchar(80) NOT NULL,
  `text` text NOT NULL,
  `mod_id` int(10) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

--
-- Dumping data for table `announcements`
--

-- --------------------------------------------------------

--
-- Table structure for table `appeals`
--

CREATE TABLE IF NOT EXISTS `appeals` (
  `id` int(30) NOT NULL AUTO_INCREMENT,
  `created` int(30) NOT NULL,
  `ban_id` int(30) NOT NULL,
  `ip` varchar(50) NOT NULL,
  `msg` text NOT NULL,
  `email` varchar(70) NOT NULL,
  `rangeban` int(1) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `ban` (`ban_id`,`rangeban`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

--
-- Dumping data for table `appeals`
--

-- --------------------------------------------------------

--
-- Table structure for table `bans`
--

CREATE TABLE IF NOT EXISTS `bans` (
  `id` int(30) NOT NULL AUTO_INCREMENT,
  `ip` varchar(50) NOT NULL,
  `mod_id` int(10) NOT NULL,
  `reason` text NOT NULL,
  `note` text NOT NULL,
  `created` int(30) NOT NULL,
  `expires` int(30) NOT NULL,
  `appeal` int(30) NOT NULL,
  `boards` text NOT NULL,
  `seen` int(1) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

--
-- Dumping data for table `bans`
--

-- --------------------------------------------------------

--
-- Table structure for table `ban_requests`
--

CREATE TABLE IF NOT EXISTS `ban_requests` (
  `id` int(30) NOT NULL AUTO_INCREMENT,
  `ip` varchar(50) NOT NULL,
  `mod_id` int(10) NOT NULL,
  `reason` varchar(80) NOT NULL,
  `note` text NOT NULL,
  `created` int(30) NOT NULL,
  `board` varchar(10) NOT NULL,
  `post` int(20) NOT NULL,
  `append` int(1) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

--
-- Dumping data for table `ban_requests`
--

-- --------------------------------------------------------

--
-- Table structure for table `bbcodes`
--

CREATE TABLE IF NOT EXISTS `bbcodes` (
  `name` varchar(100) NOT NULL,
  `code` text NOT NULL,
  UNIQUE KEY `name` (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `bbcodes`
--

INSERT INTO `bbcodes` (`name`, `code`) VALUES
('spoiler', '<s>{param}</s>');

-- --------------------------------------------------------

--
-- Table structure for table `boards`
--

CREATE TABLE IF NOT EXISTS `boards` (
  `short` varchar(10) NOT NULL,
  `type` varchar(60) NOT NULL,
  `name` varchar(100) NOT NULL,
  `des` varchar(100) NOT NULL,
  `message` text NOT NULL,
  `bumplimit` int(9) NOT NULL,
  `spoilers` int(1) NOT NULL,
  `noname` int(1) NOT NULL,
  `ids` int(1) NOT NULL,
  `embeds` int(1) NOT NULL,
  `bbcode` int(1) NOT NULL,
  `time_between_posts` int(20) NOT NULL,
  `time_between_threads` int(20) NOT NULL,
  `time_to_delete` int(20) NOT NULL,
  `filesize` bigint(20) NOT NULL,
  `pages` int(4) NOT NULL,
  `hidden` int(1) NOT NULL,
  `unlisted` int(1) NOT NULL,
  `nodup` int(1) NOT NULL,
  `nofile` int(1) NOT NULL,
  `maxchars` int(8) NOT NULL,
  `multifile` int(2) NOT NULL,
  `anonymous` varchar(60) NOT NULL,
  `extensions` text NOT NULL,
  `catalog` int(1) NOT NULL,
  `captcha` int(1) NOT NULL,
  `overboard_boards` text NOT NULL,
  `allow_replies` int(1) NOT NULL,
  `file_replies` int(1) NOT NULL,
  `links` text NOT NULL,
  `files` int(4) NOT NULL,
  `allow_all_sites` int(1) NOT NULL,
  PRIMARY KEY (`short`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `bruteforce_tries`
--

CREATE TABLE IF NOT EXISTS `bruteforce_tries` (
  `ip` varchar(50) NOT NULL,
  `mod_id` int(10) NOT NULL,
  `tries` int(30) NOT NULL,
  `lasttry` int(30) NOT NULL,
  PRIMARY KEY (`ip`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `bruteforce_tries`
--

-- --------------------------------------------------------

--
-- Table structure for table `config`
--

CREATE TABLE IF NOT EXISTS `config` (
  `name` varchar(100) NOT NULL,
  `value` text NOT NULL,
  UNIQUE KEY `name` (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `config`
--

INSERT INTO `config` (`name`, `value`) VALUES
('boardLinks', ''),
('boardLinks_board', ''),
('boardLinks_thread', ''),
('frontpage_menu_url', 'menu.html'),
('frontpage_style', 'yotsubalike.php'),
('frontpage_url', 'index.html'),
('global_message', 'This is a Haruko based Imageboard!'),
('news_url', 'news.html'),
('sitename', 'Haruko'),
('enable_api', '1'),
('enable_rss', '0'),
('enable_meny', '0'),
('keep_hours', '6'),
('caching_mode', '1');

-- --------------------------------------------------------

--
-- Table structure for table `embeds`
--

CREATE TABLE IF NOT EXISTS `embeds` (
  `name` varchar(50) NOT NULL,
  `regex` varchar(100) NOT NULL,
  `code` text NOT NULL,
  UNIQUE KEY `name` (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `embeds`
--

INSERT INTO `embeds` (`name`, `regex`, `code`) VALUES
('dailymotion', '/http(s)?:\\/\\/(www\\.)?dailymotion\\.com\\/video\\/([^&]+)/', ''),
('liveleak', '/http(s)?:\\/\\/(www\\.)?liveleak\\.com\\/view\\?i=([^&]+)/', ''),
('vimeo', '/http(s)?:\\/\\/(www\\.)?vimeo\\.com\\/([0-9]+)/', ''),
('youtube', '/http(s)?:\\/\\/(www\\.)?youtube\\.com\\/watch\\?v=([^&]+)/', ''),
('youtu.be', '/http(s)?:\\/\\/(www\\.)?youtu\\.be\\/([^&]+)/', '');

-- --------------------------------------------------------

--
-- Table structure for table `extensions`
--

CREATE TABLE IF NOT EXISTS `extensions` (
  `ext` varchar(8) NOT NULL,
  `name` varchar(100) NOT NULL,
  `mimetype` varchar(100) NOT NULL,
  `image` text NOT NULL,
  `default` int(1) NOT NULL,
  UNIQUE KEY `mimetype` (`mimetype`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `extensions`
--

INSERT INTO `extensions` (`ext`, `name`, `mimetype`, `image`, `default`) VALUES
('jpg', 'JPEG Image', 'image/jpeg', '1', 1),
('png', 'PNG Image', 'image/png', '1', 1),
('gif', 'GIF Image', 'image/gif', '1', 1),
('mp3', 'MP3 Audio File', 'audio/mpeg', '0', 0),
('mp3', 'MP3 Audio File', 'audio/mp3', '0', 0),
('mp3', 'MP3 Audio File', 'audio/mpg', '0', 0),
('wav', 'WAV Audio File', 'audio/wav', '0', 0),
('mp3', 'MP3 Audio File', 'audio/x-mpeg', '0', 0),
('mp3', 'MP3 Audio File', 'audio/x-mp3', '0', 0),
('mp3', 'MP3 Audio File', 'audio/x-mpg', '0', 0),
('wav', 'WAV Audio File', 'audio/x-wav', '0', 0),
('swf', 'Flash Application', 'application/x-shockwave-flash', '0', 0),
('mp4', 'MP4 Video File', 'video/mp4', '0', 0),
('webm', 'WEBM Video File', 'video/webm', '0', 0);

-- --------------------------------------------------------

--
-- Table structure for table `groups`
--

CREATE TABLE IF NOT EXISTS `groups` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `name` varchar(60) NOT NULL,
  `capcode` varchar(60) NOT NULL,
  `capcode_style` varchar(60) NOT NULL,
  `capcode_icon` varchar(100) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `name` (`name`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;

--
-- Dumping data for table `groups`
--

INSERT INTO `groups` (`id`, `name`, `capcode`, `capcode_style`, `capcode_icon`) VALUES
(1, 'Janitor', '', '', ''),
(2, 'Moderator', 'Mod', 'color:#800080', './img/mod.png'),
(3, 'Administrator', 'Admin', 'color:#FF0000', './img/admin.png'),
(4, 'Disabled', '', '', '');

-- --------------------------------------------------------

--
-- Table structure for table `group_permissions`
--

CREATE TABLE IF NOT EXISTS `group_permissions` (
  `gid` int(10) NOT NULL,
  `pid` int(10) NOT NULL,
  UNIQUE KEY `rule` (`gid`,`pid`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `group_permissions`
--

INSERT INTO `group_permissions` (`gid`, `pid`) VALUES
(1, 10),
(1, 14),
(1, 38),
(1, 41),
(1, 54),
(1, 66),
(1, 70),
(1, 71),
(1, 75),
(1, 88),
(1, 89),
(1, 90),
(1, 105),
(2, 10),
(2, 11),
(2, 12),
(2, 13),
(2, 14),
(2, 15),
(2, 16),
(2, 38),
(2, 39),
(2, 4),
(2, 40),
(2, 41),
(2, 48),
(2, 50),
(2, 51),
(2, 53),
(2, 54),
(2, 55),
(2, 56),
(2, 57),
(2, 58),
(2, 59),
(2, 6),
(2, 61),
(2, 62),
(2, 63),
(2, 65),
(2, 66),
(2, 67),
(2, 69),
(2, 7),
(2, 70),
(2, 71),
(2, 72),
(2, 73),
(2, 74),
(2, 75),
(2, 76),
(2, 77),
(2, 78),
(2, 88),
(2, 89),
(2, 9),
(2, 90),
(2, 95),
(2, 96),
(2, 97),
(2, 105),
(2, 106),
(2, 107),
(2, 108),
(2, 109),
(2, 110),
(2, 111),
(2, 112),
(2, 113),
(2, 114),
(2, 115),
(3, 0),
(3, 1),
(3, 10),
(3, 100),
(3, 101),
(3, 102),
(3, 103),
(3, 104),
(3, 105),
(3, 11),
(3, 12),
(3, 13),
(3, 14),
(3, 15),
(3, 16),
(3, 17),
(3, 18),
(3, 19),
(3, 2),
(3, 20),
(3, 21),
(3, 22),
(3, 23),
(3, 24),
(3, 25),
(3, 26),
(3, 27),
(3, 28),
(3, 29),
(3, 3),
(3, 30),
(3, 31),
(3, 32),
(3, 33),
(3, 34),
(3, 35),
(3, 36),
(3, 37),
(3, 38),
(3, 39),
(3, 4),
(3, 40),
(3, 41),
(3, 42),
(3, 43),
(3, 44),
(3, 45),
(3, 46),
(3, 47),
(3, 48),
(3, 49),
(3, 5),
(3, 50),
(3, 51),
(3, 52),
(3, 53),
(3, 54),
(3, 55),
(3, 56),
(3, 57),
(3, 58),
(3, 59),
(3, 6),
(3, 60),
(3, 61),
(3, 62),
(3, 63),
(3, 64),
(3, 65),
(3, 66),
(3, 67),
(3, 68),
(3, 69),
(3, 7),
(3, 70),
(3, 71),
(3, 72),
(3, 73),
(3, 74),
(3, 75),
(3, 76),
(3, 77),
(3, 78),
(3, 8),
(3, 80),
(3, 81),
(3, 82),
(3, 83),
(3, 84),
(3, 85),
(3, 86),
(3, 87),
(3, 88),
(3, 89),
(3, 9),
(3, 90),
(3, 91),
(3, 92),
(3, 93),
(3, 94),
(3, 95),
(3, 96),
(3, 97),
(3, 98),
(3, 99),
(3, 106),
(3, 107),
(3, 108),
(3, 109),
(3, 110),
(3, 111),
(3, 112),
(3, 113),
(3, 114),
(3, 115),
(3, 116),
(3, 117),
(3, 118),
(3, 119),
(3, 120),
(3, 121),
(3, 122),
(3, 123),
(3, 124),
(3, 125);

-- --------------------------------------------------------

--
-- Table structure for table `ip_notes`
--

CREATE TABLE IF NOT EXISTS `ip_notes` (
  `id` int(30) NOT NULL AUTO_INCREMENT,
  `ip` varchar(50) NOT NULL,
  `text` text NOT NULL,
  `created` int(30) NOT NULL,
  `mod_id` int(10) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;

-- --------------------------------------------------------

--
-- Table structure for table `link`
--

CREATE TABLE IF NOT EXISTS `link` (
  `name` varchar(50) NOT NULL,
  `regex` varchar(200) NOT NULL,
  `parser` varchar(200) NOT NULL,
  UNIQUE KEY `name` (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `link`
--

INSERT INTO `link` (`name`, `regex`, `parser`) VALUES
('dailymotion', '/http(s)?:\\/\\/(www\\.)?dailymotion\\.com\\/video\\/([^&]+)/', 'dailymotion.php'),
('liveleak', '/http(s)?:\\/\\/(www\\.)?liveleak\\.com\\/view\\?i=([^&]+)/', 'liveleak.php'),
('vimeo', '/http(s)?:\\/\\/(www\\.)?vimeo\\.com\\/([0-9]+)/', 'vimeo.php'),
('youtube', '/http(s)?:\\/\\/(www\\.)?youtube\\.com\\/watch\\?v=([^&]+)/', 'youtube.php'),
('youtu.be', '/http(s)?:\\/\\/(www\\.)?youtu\\.be\\/([^&]+)/', 'youtube.php'),
('rapidshare_link', '/http(s)?:\\/\\/rapidshare.com\\/files\\/([0-9]+)\\/(\w+)/', 'rapidshare.php');

-- --------------------------------------------------------

--
-- Table structure for table `links`
--

CREATE TABLE IF NOT EXISTS `links` (
  `id` int(5) NOT NULL AUTO_INCREMENT,
  `parent` int(5) NOT NULL,
  `url` varchar(100) NOT NULL,
  `relative` int(1) NOT NULL,
  `title` varchar(40) NOT NULL,
  `short` varchar(10) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;

-- --------------------------------------------------------

--
-- Table structure for table `log`
--

CREATE TABLE IF NOT EXISTS `log` (
  `id` int(50) NOT NULL AUTO_INCREMENT,
  `date` int(30) NOT NULL,
  `event` varchar(300) NOT NULL,
  `mod_id` int(10) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=181 ;

-- --------------------------------------------------------

--
-- Table structure for table `modules`
--

CREATE TABLE IF NOT EXISTS `modules` (
  `namespace` varchar(100) NOT NULL,
  `name` varchar(200) NOT NULL,
  `description` text NOT NULL,
  `author` varchar(100) NOT NULL,
  `version` varchar(50) NOT NULL,
  PRIMARY KEY (`namespace`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `modules`
--

-- --------------------------------------------------------

--
-- Table structure for table `module_boardconfig`
--

CREATE TABLE IF NOT EXISTS `module_boardconfig` (
  `namespace` varchar(100) NOT NULL,
  `name` varchar(200) NOT NULL,
  `description` text NOT NULL,
  `default_value` text NOT NULL,
  `value` text NOT NULL,
  PRIMARY KEY (`namespace`,`name`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `module_boardconfig`
--

-- --------------------------------------------------------

--
-- Table structure for table `module_classes`
--

CREATE TABLE IF NOT EXISTS `module_classes` (
  `namespace` varchar(200) NOT NULL,
  `name` varchar(200) NOT NULL,
  `file` varchar(200) NOT NULL,
  `class` varchar(200) NOT NULL,
  PRIMARY KEY (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `module_classes`
--

-- --------------------------------------------------------

--
-- Table structure for table `module_config`
--

CREATE TABLE IF NOT EXISTS `module_config` (
  `namespace` varchar(100) NOT NULL,
  `name` varchar(200) NOT NULL,
  `description` text NOT NULL,
  `default_value` text NOT NULL,
  `value` text NOT NULL,
  PRIMARY KEY (`namespace`,`name`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `module_config`
--

-- --------------------------------------------------------

--
-- Table structure for table `module_events`
--

CREATE TABLE IF NOT EXISTS `module_events` (
  `namespace` varchar(100) NOT NULL,
  `event` varchar(200) NOT NULL,
  `file` varchar(200) NOT NULL,
  `class` varchar(200) NOT NULL,
  `method` varchar(200) NOT NULL,
  PRIMARY KEY (`namespace`,`event`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `module_events`
--

-- --------------------------------------------------------

--
-- Table structure for table `module_fields`
--

CREATE TABLE IF NOT EXISTS `module_fields` (
  `namespace` varchar(100) NOT NULL,
  `name` varchar(200) NOT NULL,
  `type` varchar(200) NOT NULL,
  PRIMARY KEY (`namespace`,`name`,`type`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `module_fields`
--

-- --------------------------------------------------------

--
-- Table structure for table `module_pages`
--

CREATE TABLE IF NOT EXISTS `module_pages` (
  `namespace` varchar(100) NOT NULL,
  `url` varchar(200) NOT NULL,
  `file` varchar(200) NOT NULL,
  `class` varchar(200) NOT NULL,
  `method` varchar(200) NOT NULL,
  PRIMARY KEY (`url`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `module_pages`
--

-- --------------------------------------------------------

--
-- Table structure for table `news`
--

CREATE TABLE IF NOT EXISTS `news` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `date` int(30) NOT NULL,
  `who` varchar(40) NOT NULL,
  `title` varchar(80) NOT NULL,
  `text` text NOT NULL,
  `mod_id` int(10) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

--
-- Dumping data for table `news`
--

-- --------------------------------------------------------

--
-- Table structure for table `notes`
--

CREATE TABLE IF NOT EXISTS `notes` (
  `id` int(15) NOT NULL AUTO_INCREMENT,
  `mod_id` int(10) NOT NULL,
  `note` text NOT NULL,
  `created` int(30) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

--
-- Dumping data for table `notes`
--

-- --------------------------------------------------------

--
-- Table structure for table `pages`
--

CREATE TABLE IF NOT EXISTS `pages` (
  `name` varchar(60) NOT NULL,
  `title` varchar(200) NOT NULL,
  `text` text NOT NULL,
  `raw` int(1) NOT NULL,
  PRIMARY KEY (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `pages`
--

-- --------------------------------------------------------

--
-- Table structure for table `permissions`
--

CREATE TABLE IF NOT EXISTS `permissions` (
  `id` int(10) NOT NULL,
  `name` varchar(60) NOT NULL,
  `description` varchar(60) NOT NULL,
  `category` int(10) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `name` (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `permissions`
--

INSERT INTO `permissions` (`id`, `name`, `description`, `category`) VALUES
(0, 'ads.add', 'Create advertisements', 0),
(1, 'ads.delete', 'Delete advertisements', 0),
(2, 'ads.list', 'List advertisements', 0),
(3, 'ads.update', 'Update advertisements', 0),
(4, 'announcements.add', 'Add announcements', 1),
(5, 'announcements.delete', 'Delete announcements', 1),
(6, 'announcements.delete.own', 'Delete own announcements', 1),
(7, 'announcements.manage', 'Manage announcements', 1),
(8, 'announcements.update', 'Update announcements', 1),
(9, 'announcements.update.own', 'Update own annoucements', 1),
(10, 'announcements.view', 'View announcements', 1),
(11, 'appeals.clear.all', 'Clear all appeals', 2),
(12, 'appeals.clear.single', 'Clear single appeal', 2),
(13, 'appeals.view', 'View appeals', 2),
(14, 'bans.add', 'Add bans', 3),
(15, 'bans.delete', 'Delete bans', 3),
(16, 'bans.view', 'View bans', 3),
(17, 'bbcodes.add', 'Add BBCodes', 4),
(18, 'bbcodes.delete', 'Delete BBCodes', 4),
(19, 'bbcodes.edit', 'Edit BBCodes', 4),
(20, 'bbcodes.view', 'View BBCodes', 4),
(21, 'boards.add', 'Add boards', 5),
(22, 'boards.delete', 'Delete boards', 5),
(23, 'boards.move', 'Move boards', 5),
(24, 'boards.rebuild', 'Rebuild boards', 5),
(25, 'boards.update', 'Update boards', 5),
(26, 'boards.view', 'View boards', 5),
(27, 'config.cleaner', 'Use cleaner', 6),
(28, 'config.extras', 'Use config extras', 6),
(29, 'config.global_message', 'Change global message', 6),
(30, 'config.reset', 'Reset configuration', 6),
(31, 'config.rebuild', 'Rebuild cache', 6),
(32, 'config.update', 'Update configuration', 6),
(33, 'config.view', 'View configuration', 6),
(34, 'embeds.add', 'Add embeds', 7),
(35, 'embeds.delete', 'Delete embeds', 7),
(36, 'embeds.edit', 'Update embeds', 7),
(37, 'embeds.view', 'View embeds', 7),
(38, 'info.view', 'View IP information', 8),
(39, 'ipnotes.add', 'Add IP notes', 9),
(40, 'ipnotes.delete', 'Delete IP notes', 9),
(41, 'ipnotes.view', 'View IP notes', 9),
(42, 'links.add', 'Add board links', 10),
(43, 'links.delete', 'Delete board links', 10),
(44, 'links.move', 'Change board links position', 10),
(45, 'links.update', 'Update board links', 10),
(46, 'links.view', 'View board links', 10),
(47, 'logs.view', 'View action logs', 11),
(48, 'news.add', 'Add news', 12),
(49, 'news.delete', 'Delete news', 12),
(50, 'news.delete.own', 'Delete own news', 12),
(51, 'news.manage', 'Manage news', 12),
(52, 'news.update', 'Update news', 12),
(53, 'news.update.own', 'Update own news', 12),
(54, 'news.view', 'View news', 12),
(55, 'notes.add', 'Add notes', 13),
(56, 'notes.delete', 'Delete notes', 13),
(57, 'notes.view', 'View notes', 13),
(58, 'post.antibump', 'Enable antibump on posts', 14),
(59, 'post.capcode', 'Use capcode', 14),
(60, 'post.customcapcode', 'Use custom capcode', 14),
(61, 'post.closed', 'Close threads', 14),
(62, 'post.delete.ip', 'Delete posts from IP', 14),
(63, 'post.delete.single', 'Delete single post', 14),
(64, 'post.edit', 'Edit posts', 14),
(65, 'post.sticky', 'Sticky threads', 14),
(66, 'post.viewip', 'View IP', 14),
(67, 'range.add', 'Add range bans', 15),
(68, 'range.delete', 'Delete range bans', 15),
(69, 'range.view', 'View range bans', 15),
(70, 'recent.files', 'View recent files', 16),
(71, 'recent.posts', 'View recent posts', 16),
(72, 'reports.clear.all', 'Clear all reports', 17),
(73, 'reports.clear.multiple', 'Clear multiple reports (D_WTIP, D_WTR)', 17),
(74, 'reports.clear.single', 'Clear single report', 17),
(75, 'reports.view', 'View reporst', 17),
(76, 'requests.delete', 'Delete ban requests', 18),
(77, 'requests.view', 'View ban requests', 18),
(78, 'search.ip', 'Search by IP', 19),
(79, 'search.text', 'Search by text', 19),
(80, 'spamfilter.add', 'Add spamfilter', 20),
(81, 'spamfilter.delete', 'Delete spamfilter', 20),
(82, 'spamfilter.update', 'Update spamfilter', 20),
(83, 'spamfilter.view', 'View spamfilter', 20),
(84, 'styles.delete', 'Delete styles', 21),
(85, 'styles.update', 'Update styles', 21),
(86, 'styles.upload', 'Upload styles', 21),
(87, 'styles.view', 'View styles', 21),
(88, 'user.change_password', 'Change own password', 22),
(89, 'user.inbox', 'Inbox', 22),
(90, 'user.login', 'Log in', 22),
(91, 'users.add', 'Add users', 23),
(92, 'users.delete', 'Delete users', 23),
(93, 'users.update', 'Update users', 23),
(94, 'users.view', 'View users', 23),
(95, 'warnings.add', 'Add warnings', 24),
(96, 'warnings.delete', 'Delete warnings', 24),
(97, 'warnings.view', 'View warnings', 24),
(98, 'whitelist.add', 'Add whitelist', 25),
(99, 'whitelist.delete', 'Delete whitelist', 25),
(100, 'whitelist.view', 'View whitelist', 25),
(101, 'wordfilter.add', 'Add wordfilter', 26),
(102, 'wordfilter.delete', 'Delete wordfilter', 26),
(103, 'wordfilter.update', 'Update wordfilter', 26),
(104, 'wordfilter.view', 'View wordfilter', 26),
(105, 'bans.add.request', 'Add ban requests', 3),
(106, 'post.ignorespamfilter', 'Ignore spamfilter', 14),
(107, 'post.ignorebumplimit', 'Ignore bumplimit', 14),
(108, 'post.ignoresizelimit', 'Ignore size limit', 14),
(109, 'post.raw', 'Raw HTML', 14),
(110, 'post.nofile', 'No file', 14),
(111, 'post.fakeid', 'Fake ID', 14),
(112, 'post.ignorespamlimits', 'Ignore spamlimits', 14),
(113, 'post.ignorenoname', 'Ignore noname', 14),
(114, 'post.ignorenodup', 'Ignore nodup', 14),
(115, 'post.ignorecaptcha', 'Ignore CAPTCHA', 14),
(116, 'pages.view', 'View pages', 27),
(117, 'pages.update', 'Update pages', 27),
(118, 'pages.delete', 'Delete pages', 27),
(119, 'pages.add', 'Add pages', 27),
(120, 'modules.view', 'View modules', 28),
(121, 'modules.upload', 'Upload modules', 28),
(122, 'modules.install', 'Install modules', 28),
(123, 'modules.uninstall', 'Uninstall modules', 28),
(124, 'modules.delete', 'Delete modules', 28),
(125, 'modules.config', 'Configure modules', 28);

-- --------------------------------------------------------

--
-- Table structure for table `permissions_categories`
--

CREATE TABLE IF NOT EXISTS `permissions_categories` (
  `id` int(10) NOT NULL,
  `name` varchar(60) NOT NULL,
  `description` varchar(60) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `name` (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `permissions_categories`
--

INSERT INTO `permissions_categories` (`id`, `name`, `description`) VALUES
(0, 'ads', 'Advertisements'),
(1, 'announcements', 'Announcements'),
(2, 'appeals', 'Appeals'),
(3, 'bans', 'Bans'),
(4, 'bbcodes', 'BBCodes'),
(5, 'boards', 'Boards'),
(6, 'config', 'Configuration'),
(7, 'embeds', 'Embed management'),
(8, 'info', 'IP information'),
(9, 'ipnotes', 'IP Notes'),
(10, 'links', 'Links'),
(11, 'logs', 'Logs'),
(12, 'news', 'News'),
(13, 'notes', 'Notes'),
(14, 'post', 'Post management'),
(15, 'range', 'Range bans'),
(16, 'recent', 'Recent'),
(17, 'reports', 'Reports'),
(18, 'requests', 'Requests'),
(19, 'search', 'Search'),
(20, 'spamfilter', 'Spamfilter'),
(21, 'styles', 'Styles'),
(22, 'user', 'Account'),
(23, 'users', 'Users'),
(24, 'warnings', 'Warnings'),
(25, 'whitelist', 'Whitelist'),
(26, 'wordfilter', 'Wordfilter'),
(27, 'pages', 'Pages'),
(28, 'modules', 'Modules'),
(29, 'module', 'Module permissions');

-- --------------------------------------------------------

--
-- Table structure for table `pm`
--

CREATE TABLE IF NOT EXISTS `pm` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `created` int(30) NOT NULL,
  `from_user` int(10) NOT NULL,
  `to_user` int(10) NOT NULL,
  `title` varchar(70) NOT NULL,
  `text` text NOT NULL,
  `read_msg` int(1) NOT NULL,
  `resto` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

--
-- Dumping data for table `pm`
--

-- --------------------------------------------------------

--
-- Table structure for table `posts`
--

CREATE TABLE IF NOT EXISTS `posts` (
  `board` varchar(10) NOT NULL,
  `id` int(20) NOT NULL AUTO_INCREMENT,
  `date` int(30) NOT NULL,
  `name` varchar(60) NOT NULL,
  `trip` varchar(30) NOT NULL,
  `strip` varchar(11) NOT NULL,
  `poster_id` varchar(8) NOT NULL,
  `email` varchar(60) NOT NULL,
  `subject` varchar(100) NOT NULL,
  `comment` text NOT NULL,
  `password` varchar(100) NOT NULL,
  `orig_filename` text NOT NULL,
  `filename` text NOT NULL,
  `resto` int(20) NOT NULL,
  `ip` varchar(50) NOT NULL,
  `lastbumped` int(20) NOT NULL,
  `filehash` text NOT NULL,
  `orig_filesize` text NOT NULL,
  `filesize` text NOT NULL,
  `imagesize` text NOT NULL,
  `mimetype` text NOT NULL,
  `t_w` text NOT NULL,
  `t_h` text NOT NULL,
  `sticky` int(1) NOT NULL,
  `sage` int(1) NOT NULL,
  `locked` int(1) NOT NULL,
  `raw` int(1) NOT NULL,
  `capcode_style` varchar(60) NOT NULL,
  `capcode_text` varchar(60) NOT NULL,
  `capcode_icon` varchar(100) NOT NULL,
  `deleted` int(30) NOT NULL,
  PRIMARY KEY (`board`,`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- Table structure for table `rangebans`
--

CREATE TABLE IF NOT EXISTS `rangebans` (
  `id` int(30) NOT NULL AUTO_INCREMENT,
  `ip` varchar(50) NOT NULL,
  `mod_id` int(10) NOT NULL,
  `reason` text NOT NULL,
  `note` text NOT NULL,
  `created` int(30) NOT NULL,
  `expires` int(30) NOT NULL,
  `appeal` int(30) NOT NULL,
  `boards` text NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

--
-- Dumping data for table `rangebans`
--

-- --------------------------------------------------------

--
-- Table structure for table `reports`
--

CREATE TABLE IF NOT EXISTS `reports` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `reporter_ip` varchar(50) NOT NULL,
  `reported_post` int(20) NOT NULL,
  `reason` text NOT NULL,
  `created` int(30) NOT NULL,
  `board` varchar(6) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

--
-- Dumping data for table `reports`
--

-- --------------------------------------------------------

--
-- Table structure for table `spamfilter`
--

CREATE TABLE IF NOT EXISTS `spamfilter` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `search` varchar(100) NOT NULL,
  `reason` varchar(100) NOT NULL,
  `boards` text NOT NULL,
  `expires` varchar(90) NOT NULL,
  `active` int(1) NOT NULL,
  `regex` int(1) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

--
-- Dumping data for table `spamfilter`
--

-- --------------------------------------------------------

--
-- Table structure for table `styles`
--

CREATE TABLE IF NOT EXISTS `styles` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(20) NOT NULL,
  `path` varchar(60) NOT NULL,
  `relative` int(1) NOT NULL,
  `default` int(1) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=12 ;

--
-- Dumping data for table `styles`
--

INSERT INTO `styles` (`id`, `name`, `path`, `relative`, `default`) VALUES
(6, 'Mitsuba', './css/mitsuba.css', 1, 0),
(7, 'Mitsuba Blue', './css/mitsubablue.css', 1, 0),
(8, 'Dark Roach', './css/dark roach.css', 1, 0),
(9, 'Yotsuba', './css/yotsuba.css', 1, 1),
(10, 'Yotsuba Blue', './css/yotsubablue.css', 1, 0),
(11, 'Photon', './css/photon.css', 1, 0);

-- --------------------------------------------------------

--
-- Table structure for table `tripcodes`
--

CREATE TABLE IF NOT EXISTS `tripcodes` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `hash` varchar(11) NOT NULL,
  `replace` varchar(30) NOT NULL,
  `secure` int(1) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `hash` (`hash`,`secure`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=9 ;

-- --------------------------------------------------------

--
-- Table structure for table `users`
--

CREATE TABLE IF NOT EXISTS `users` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `username` varchar(40) NOT NULL,
  `password` varchar(130) NOT NULL,
  `salt` varchar(20) NOT NULL,
  `group` int(10) NOT NULL,
  `boards` text NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `username` (`username`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;

-- --------------------------------------------------------

--
-- Table structure for table `warnings`
--

CREATE TABLE IF NOT EXISTS `warnings` (
  `id` int(30) NOT NULL AUTO_INCREMENT,
  `ip` varchar(50) NOT NULL,
  `mod_id` int(10) NOT NULL,
  `reason` text NOT NULL,
  `note` text NOT NULL,
  `created` int(30) NOT NULL,
  `seen` int(1) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

--
-- Dumping data for table `warnings`
--

-- --------------------------------------------------------

--
-- Table structure for table `whitelist`
--

CREATE TABLE IF NOT EXISTS `whitelist` (
  `id` int(30) NOT NULL AUTO_INCREMENT,
  `ip` varchar(50) NOT NULL,
  `mod_id` int(10) NOT NULL,
  `note` text NOT NULL,
  `nolimits` int(1) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

--
-- Dumping data for table `whitelist`
--

-- --------------------------------------------------------

--
-- Table structure for table `wordfilter`
--

CREATE TABLE IF NOT EXISTS `wordfilter` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `search` varchar(100) NOT NULL,
  `replace` varchar(100) NOT NULL,
  `boards` text NOT NULL,
  `active` int(1) NOT NULL,
  `regex` int(1) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

--
-- Dumping data for table `wordfilter`
--


code:
<?php
$servLoad = sys_getloadavg();
$maxServLoad = 50;
if ($servLoad[0] >= $maxServLoad) {
    header('HTTP/1.1 503 Service Temporarily Unavailable');
    header('Status: 503 Service Temporarily Unavailable');
    header('Retry-After: 60');
    include 'error/503.php';
    exit(503);
}
ob_start();

session_start();

if (empty($_POST['mode'])) {

    die("Sorry.1");

}

if ((empty($_POST['board'])) && (empty($_POST['delete'])) && (empty($_POST['report'])) && (empty($_POST['msg']))) {

    die("Sorry.2");

}

if (!file_exists("./config.php")) {

    header("Location: ./install.php");

    die();

}

require "config.php";

require "inc/mitsuba.php";

require "inc/strings/imgboard.strings.php";

if (!empty($_POST['mode'])) {

    $return_url = "./";

    if (!empty($_POST['board'])) {

        $return_url = "./" . $_POST['board'] . "/";

    }

    $conn = new mysqli($db_host, $db_username, $db_password, $db_database);

    $mitsuba = new Mitsuba($conn);

    $e = array("requestdata" => & $_POST);

    $mitsuba->emitEvent("imgboard.begin", $e);

    $mod = 0;

    if ((!empty($_GET['mod'])) && ($_GET['mod'] >= 1)) {

        if ((!empty($_POST['board'])) && ($mitsuba->common->isBoard($_POST['board']))) {

            $mitsuba->admin->canBoard($_POST['board']);

            $mod = 1;

            if ($_GET['mod'] == 1) {

                $return_url = "mod.php?/board&b=" . $_POST['board'];

            } else {

                $mod = 2;

            }

        } else {

            $mod = 1;

            if ($_GET['mod'] == 1) {

                $return_url = "mod.php";

            } else {

                $mod = 2;

            }

        }

    }

    $mode = $_POST['mode'];

    switch ($mode) {

    case "regist":

        $filename = null;

        if (empty($_POST['board'])) {

            $mitsuba->common->showMsg($lang['img/error'], $lang['img/no_board']);

            exit;

        }

        $board = $_POST['board'];

        if (($mod == 0) && ($mitsuba->common->isWhitelisted($mitsuba->common->getIP()) < 1)) {

            $mitsuba->common->banMessage($board);

            $mitsuba->common->warningMessage();

        }

        $ignoresizelimit = 0;

        if ($mod >= 1) {

            if ((!empty($_POST['ignoresizelimit'])) && ($_POST['ignoresizelimit'] == 1) && ($mitsuba->admin->checkPermission("post.ignoresizelimit"))) {

                $ignoresizelimit = 1;

            }

        }

        if (!$mitsuba->common->isBoard($_POST['board'])) {

            $mitsuba->common->showMsg($lang['img/error'], $lang['img/board_no_exists']);

            exit;

        }

        if (!empty($_POST['wewlad'])) {
            $mitsuba->common->showMsg($lang['img/error'], "Your post looks automated. To prevent spam and other malicous actions, your post was rejected.");

            exit;
        }
        if (($mitsuba->common->isLocked(isset($_POST['resto']))) && !($_GET['mod'] >= 1)) {
            $mitsuba->common->showMsg($lang['img/error'], $lang['img/thread_locked']);
            exit;
        }

        $md5 = "";

        $bdata = $mitsuba->common->getBoardData($_POST['board']);

        if ($bdata['type'] == "overboard") {

            $mitsuba->common->showMsg($lang['img/error'], $lang['img/board_no_exists']);

            exit;

        }

        if (($bdata['allow_replies'] == 0) && ($_POST['resto'] != 0)) {

            $mitsuba->common->showMsg($lang['img/error'], $lang['img/replies_not_allowed']);

            exit;

        }

        if ($bdata['hidden'] == 1) {

            if ($mod >= 1) {

                $mitsuba->admin->canBoard($bdata['short']);

            } else {

                $mitsuba->common->showMsg($lang['img/error'], $lang['img/board_no_exists']);

                exit;

            }

        }
        $time = new DateTime();
        $ignoresCaptcha = $mitsuba->admin->checkPermission("post.ignorecaptcha");
        $captchaOn = $bdata['captcha'];
        $notExpired = $time->getTimestamp() <= $_POST['captcha'] + 120;
      if ((!$ignoresCaptcha) && ($captchaOn == 1) && (!($notExpired))) {
            $mitsuba->common->showMsg($lang['img/error'], $lang['img/wrong_captcha']);
            exit;
        }

        $_SESSION['captcha'] = "";

        $wfresult = $conn->query("SELECT * FROM wordfilter WHERE active=1");

        $replace_array = array();

        while ($row = $wfresult->fetch_assoc()) {

            if ($row['boards'] != "%") {

                $boards = explode(",", $row['boards']);

                if (in_array($bdata['short'], $boards)) {

                    $replace_array[$row['search']] = $row['replace'];

                }

            } else {

                $replace_array[$row['search']] = $row['replace'];

            }

        }

        if (strlen(strtr($_POST['com'], $replace_array)) > $bdata['maxchars']) {

            $mitsuba->common->showMsg($lang['img/error'], sprintf($lang['img/comment_too_long'], strlen($_POST['com']), $bdata['maxchars']));

            exit;

        }

        if (!$mitsuba->admin->checkPermission("post.ignorespamfilter")) {
            $mitsuba->board->checkSpam($_POST['name'], $_POST['board']);
            $mitsuba->board->checkSpam($_POST['email'], $_POST['board']);
            $mitsuba->board->checkSpam($_POST['sub'], $_POST['board']);
            /*if (isset($_FILES)) {
              include 'inc/TesseractOCR.php';
              $tocr = (new TesseractOCR($_FILES['upfile']["tmp_name"]))->psm(6)->run();
              echo($tocr);
              exit();
            }*/
            $mitsuba->board->checkSpam($_POST['com'], $_POST['board']);
        }

        if ((!empty($_POST['embed'])) && (!empty($_FILES['upfile']['tmp_name']))) {

            $mitsuba->common->showMsg($lang['img/error'], $lang['img/choose_one']);

            exit;

        }

        $raw = 0;

        $sticky = 0;

        $lock = 0;

        $nolimit = 0;

        $nofile = 0;

        $fake_id = "";

        $cc_text = "";

        $cc_style = "";

        $cc_icon = "";

        if ((!empty($_POST['nofile'])) && ($_POST['nofile'] == 1) && ($bdata['nofile'] == 1)) {

            $nofile = 1;

        }

        if ($mod >= 1) {

            if ((!empty($_POST['nolimit'])) && ($_POST['nolimit'] == 1) && ($mitsuba->admin->checkPermission("post.ignorebumplimit"))) {

                $nolimit = 1;

            }

            if ((!empty($_POST['capcode'])) && ($_POST['capcode'] == 1) && ($mitsuba->admin->checkPermission("post.capcode"))) {
                if(($mitsuba->admin->canBoard("%"))) {
                    $cc_text = "Global Staff";
                    $cc_style = "color: #0048FF";
                }elseif(($mitsuba->admin->canBoard("$"))) {
                  echo("\u{1696}");
                  //die();
                    $cc_text = "\u{1696} Developer";
                    $cc_style = "color: #4B088A";
                }else{
                    $cc_text = "/".$_SESSION['boards']."/ ".$_SESSION['capcode_text'];
                    $cc_style = $_SESSION['capcode_style'];
                    //$cc_icon = $_SESSION['capcode_icon'];
                }
            } elseif ((!empty($_POST['capcode'])) && ($_POST['capcode'] == 2) && (!empty($_POST['cc_text'])) && (!empty($_POST['cc_color'])) && ($mitsuba->admin->checkPermission("post.customcapcode"))) {

                $cc_text = $_POST['cc_text'];

                $cc_style = $_POST['cc_style'];

            }

            if ((!empty($_POST['raw'])) && ($_POST['raw'] == 1) && ($mitsuba->admin->checkPermission("post.raw"))) {

                $raw = 1;

            }

            if ((!empty($_POST['nofile'])) && ($_POST['nofile'] == 1) && ($mitsuba->admin->checkPermission("post.nofile"))) {

                $nofile = 1;

            }

            if ((!empty($_POST['sticky'])) && ($_POST['sticky'] == 1) && ($mitsuba->admin->checkPermission("post.sticky"))) {

                $sticky = 1;

            }

            if ((!empty($_POST['lock'])) && ($_POST['lock'] == 1) && ($mitsuba->admin->checkPermission("post.closed"))) {

                $lock = 1;

            }

            if (!empty($_POST['fake_id']) && ($mitsuba->admin->checkPermission("post.fakeid"))) {

                $fake_id = $_POST['fake_id'];

            }

        }

        if (($mitsuba->common->isWhitelisted($mitsuba->common->getIP()) != 2) && (($mod == 0) || (!$mitsuba->admin->checkPermission("post.ignorespamlimits")))) {

            if ((empty($_POST['resto'])) || ($_POST['resto'] == 0)) {

                $mitsuba->board->checkThreadDate($bdata, $return_url);

            }

            $mitsuba->board->checkPostDate($bdata, $return_url);

        }

        $mime = "";

        $url = "";

        $url_title = "";

        $gen_thumb = 0;

        if (($bdata['type'] == "linkboard")) {

            if (!empty($_POST['url'])) {

                //Links

                $postUrl = $mitsuba->linkshare->prepareUrl($_POST['url']);

                if ($postUrl) {

                    $check = $mitsuba->linkshare->getStatus($postUrl);

                    if ($bdata['allow_all_sites'] == 0) {

                        $parser = $mitsuba->linkshare->checkUrl($postUrl);

                    } else {

                        $parser = 'defaultParser.php'; //this file doesn't have to exist

                    }

                } else {

                    $check = false;

                    $parser = false;

                }

                if (($check) && ($parser)) {

                    $linksize = "";

                    $serviceName = "Other";

                    $parserOpened = $mitsuba->linkshare->openLinkParser($parser);

                    $name = $mitsuba->linkshare->getTitle($postUrl, $parserOpened);

                    $linksize = $mitsuba->linkshare->getSize($postUrl, $parserOpened);

                    $serviceName = $mitsuba->linkshare->getServiceName($postUrl, $parserOpened);

                    $url = htmlspecialchars(stripslashes($postUrl));

                    if ($linksize) {

                        $url_title = htmlspecialchars(stripslashes("{$name} - [{$linksize} - {$serviceName}]"));

                    } else {

                        $url_title = htmlspecialchars(stripslashes("{$name} [{$serviceName}]"));

                    }

                } else {

                    if ((!$parser) && ($check)) {

                        $mitsuba->common->showMsg($lang['img/error'], $lang['img/badhostlink']);

                        exit;

                    }

                    if (!$check) {

                        $mitsuba->common->showMsg($lang['img/error'], $lang['img/badlink']);

                        exit;

                    }

                }

            } else {

                $mitsuba->common->showMsg($lang['img/error'], $lang['img/nolink']);

                exit;

            }

        } elseif ((!empty($_POST['embed'])) && ($nofile == 0) && ($bdata['embeds'] == 1)) {

            if (($bdata['file_replies'] == 0) && ($_POST['resto'] != 0)) {

                $mitsuba->common->showMsg($lang['img/error'], $lang['img/file_replies_not_allowed']);

                exit;

            }

            $filename = $mitsuba->board->checkEmbed($bdata, $_POST['embed'], $return_url);

        } elseif (($nofile == 0) && ($bdata['type'] != "textboard")) {

            if (($bdata['file_replies'] == 0) && ($_POST['resto'] != 0)) {

                $mitsuba->common->showMsg($lang['img/error'], $lang['img/file_replies_not_allowed']);

                exit;

            }

            if ((empty($_FILES['upfile']['tmp_name'])) && (!empty($_FILES['upfile']['name']))) {
                $mitsuba->common->showMsg($lang['img/error'], $lang['img/file_too_big']." 1");

                exit;

            }

            if (!empty($_FILES['upfile']['tmp_name'])) {

                $target_path = "./" . $board . "/src/";

                $file_size = $_FILES['upfile']['size'];

                if (($file_size > $bdata['filesize']) && ($ignoresizelimit != 1)) {

                    $mitsuba->common->showMsg($lang['img/error'], $lang['img/file_too_big']."2");

                    exit;

                }

                if (!($nfo = $mitsuba->common->isFile($_FILES['upfile']['tmp_name'], $bdata['extensions']))) {

                    $mitsuba->common->showMsg($lang['img/error'], $lang['img/file_too_big']."3");

                    exit;

                }

                $mime = $nfo['mimetype'];

                $ext = "." . $nfo['extension'];

                $fileid = time();

                $filename = $fileid . $ext;

                $target_path.= $filename;

                $md5 = md5_file($_FILES['upfile']['tmp_name']);

                if (($bdata['nodup'] == 1) && (($mod == 0) || (!$mitsuba->admin->checkPermission("post.ignorenodup")))) {

                    $isit = $conn->query("SELECT * FROM posts WHERE filehash='" . $md5 . "' AND board='" . $_POST['board'] . "'");

                    if ($isit->num_rows >= 1) {

                        $row6 = $isit->fetch_assoc();

                        $postlink = "";

                        if ($row6['resto'] == 0) {

                            $postlink = "./" . $_POST['board'] . "/res/" . $row6['id'] . ".html#p" . $row6['id'];

                        } else {

                            $postlink = "./" . $_POST['board'] . "/res/" . $row6['resto'] . ".html#p" . $row6['id'];

                        }

                        $mitsuba->common->showMsg($lang['img/error'], sprintf($lang['img/file_duplicate'], $postlink));

                        exit;

                    }

                }

                if (move_uploaded_file($_FILES['upfile']['tmp_name'], $target_path)) {

                    if ($nfo['image'] == 1 || $nfo['extension'] == "webm") {

                        $gen_thumb = 1;

                    }

                    //printf($lang['img/file_uploaded'], basename( $_FILES['upfile']['name']));

                } else {

                    echo $lang['img/upload_error'];

                    $filename = "";

                }

            }

        }

        $name = $lang['img/anonymous'];

        if (!empty($bdata['anonymous'])) {

            $name = $bdata['anonymous'];

        }

        if ((!empty($_POST['name'])) && (($bdata['noname'] == 0) || (($mod >= 1) && ($mitsuba->admin->checkPermission("post.ignorenoname"))))) {

            $name = $_POST['name'];

        }

        $resto = 0;

        if (isset($_POST['resto'])) {

            $resto = $_POST['resto'];

        }

        $password = "";

        if (empty($_POST['pwd'])) {

            if (isset($_COOKIE['password'])) {

                $password = $_COOKIE['password'];

            } else {

                $password = $mitsuba->common->randomPassword();

            }

        } else {

            $password = $_POST['pwd'];

        }

        $thumb_w = 0;

        $thumb_h = 0;

        if ((substr($filename, 0, 6) != "embed:") && ($gen_thumb == 1)) {

            if (!empty($_FILES['upfile']['tmp_name'])) {

                if ($resto != 0) {

                    $returned = $mitsuba->common->thumb($board, $fileid, $ext, 125);

                    if ((empty($returned['width'])) || (empty($returned['height']))) {

                        unlink($target_path);

                        $mitsuba->common->showMsg($lang['img/error'], $lang['img/no_thumb']."1");

                        exit;

                    }

                    $thumb_w = $returned['width'];

                    $thumb_h = $returned['height'];

                } else {

                    $returned = $mitsuba->common->thumb($board, $fileid, $ext);

                    if ((empty($returned['width'])) || (empty($returned['height']))) {

                        unlink($target_path);

                        $mitsuba->common->showMsg($lang['img/error'], $lang['img/no_thumb']."2");

                        exit;

                    }

                    $thumb_w = $returned['width'];

                    $thumb_h = $returned['height'];

                }

            }

        }

        if (!empty($_POST['name'])) {

            setcookie("mitsuba_name", $_POST['name'], time() + 86400 * 256);

        } else {

            setcookie("mitsuba_name", "", time() + 86400 * 256);

        }

        if ((!empty($_POST['email'])) && (strtolower($_POST['email']) != "sage")) {

            setcookie("mitsuba_email", $_POST['email'], time() + 86400 * 256);

        } else {

            setcookie("mitsuba_email", "", time() + 86400 * 256);

        }

        if (!empty($_POST['fake_id'])) {

            setcookie("mitsuba_fakeid", $_POST['fake_id'], time() + 86400 * 256);

        } else {

            setcookie("mitsuba_fakeid", "", time() + 86400 * 256);

        }

        $spoiler = 0;

        if ((!empty($_POST['spoiler'])) && ($_POST['spoiler'] == 1) && ($bdata['spoilers'] == 1) && (substr($filename, 0, 6) != "embed:")) {

            $spoiler = 1;

        }

        setcookie("password", $password, time() + 86400 * 256);

        $embed = 0;

        $fname = "";

        if (!empty($filename)) {

            if (substr($filename, 0, 6) != "embed:") {

                $fname = $_FILES['upfile']['name'];

                $filename = "";

                if (empty($_FILES['upfile']['tmp_name'])) {

                    $fname = "";

                } else {

                    $filename = $fileid . $ext;

                }

            } else {

                $embed = 1;

                $fname = "embed";

            }

        }

        $redirect = 0;

        if ($mod == 1) {

            $redirect = 1;

        }

        if (!empty($url)) {

            $filename = "url:" . $conn->real_escape_string($url);

            $fname = $conn->real_escape_string($url_title);

        }

        //$mitsuba->common->showMsg($lang['img/updating_index'], $lang['img/updating_index']);

        //We'll remove here all "non-printable" characters

        $com = $_POST['com'];

        $is = $mitsuba->posting->addPost($_POST['board'], $name, $_POST['email'], $_POST['sub'], $com, $password, $filename, $fname, $mime, $resto, $md5, $thumb_w, $thumb_h, $spoiler, $embed, $raw, $sticky, $lock, $nolimit, $nofile, $fake_id, $cc_text, $cc_style, $cc_icon, $redirect, $_POST);

        if ($is == - 16) {

            $mitsuba->common->showMsg($lang['img/error'], $lang['img/board_no_exists']);

            exit;

        }else{
            if ($bdata['type'] == "overboard") {
                $mitsuba->caching->rebuildBoardCache($_POST['board']);
            }
            $mitsuba->common->showMsg($lang['img/updating_index'], $lang['img/updating_index']);
        }

        break;

    case "usrform":

        if (!empty($_POST['delete'])) {

            $onlyimgdel = 0;

            $password = "";

            if ($mod == 0) {

                if (isset($_COOKIE['password'])) {

                    $password = $_COOKIE['password'];

                }

                if (!empty($_POST['pwd'])) {

                    $password = $_POST['pwd'];

                }

            }

            $canDelete = false;

            if ($mod >= 1) {

                $canDelete = $mitsuba->admin->checkPermission("post.delete.single");

            }

            if ((isset($_POST['onlyimgdel']) && ($_POST['onlyimgdel'] == "on"))) {

                $onlyimgdel = 1;

            }

            foreach ($_POST as $key => $value) {

                if ($value == "delete") {

                    $keys = explode("%", $key);

                    $done = $mitsuba->posting->deletePost($keys[1], $keys[2], $password, $onlyimgdel, $canDelete);

                    if ($done == - 1) {
                        $mitsuba->common->showMsg($lang['img/error'], sprintf($lang["img/post_bad_password"], "/". $keys[1] . "/" . $keys[2]));
                        exit;
                    } elseif ($done == - 2) {
                        $mitsuba->common->showMsg($lang['img/error'], sprintf($lang["img/post_not_found"], "/" . $keys[1] . "/" . $keys[2]));
                        exit;
                    } elseif ($done == - 3) {
                        $mitsuba->common->showMsg($lang['img/error'], sprintf($lang["img/post_no_image"], "/" . $keys[1] . "/" . $keys[2]));
                        exit;
                    } elseif ($done == - 4) {
                        $mitsuba->common->showMsg($lang['img/error'], sprintf($lang["img/post_wait_more"], "/" . $keys[1] . "/" . $keys[2]));
                    } elseif ($done == 1) {
                        $mitsuba->common->showMsg(sprintf($lang["img/post_deleted_image"], "/" . $keys[1] . "/" . $keys[2]), sprintf($lang["img/post_deleted_image"], "/" . $keys[1] . "/" . $keys[2]));
                    } elseif ($done == 2) {
                        $mitsuba->common->showMsg(sprintf($lang["img/post_deleted"], "/" . $keys[1] . "/" . $keys[2]), sprintf($lang["img/post_deleted"], "/" . $keys[1] . "/" . $keys[2]));
                    }

                    if ($done == - 16) {

                        //echo "<h1>" . $lang['img/board_no_exists'] . "</h1></body></html>";
                        $mitsuba->common->showMsg($lang['img/error'], $lang['img/board_no_exists']);
                        exit;

                    }

                }

            }

            echo '<meta http-equiv="refresh" content="2;URL=' . "'" . $return_url . "index.html'" . '">';

        } elseif (!empty($_POST['report'])) {

            $board = $conn->real_escape_string($_POST['board']);

            $mitsuba->common->banMessage($board);

            foreach ($_POST as $key => $value) {

                if ($value == "delete") {

                    $keys = explode("%", $key);

                    $done = $mitsuba->posting->reportPost($keys[1], $keys[2], $_POST['reason']);

                    if ($done == 1) {

                        echo sprintf($lang['img/post_reported'], $keys[1] . "/" . $keys[2]) . "<br />";

                    }

                }

            }

            echo '<meta http-equiv="refresh" content="2;URL=' . "'./" . $board . "/index.html'" . '">';

        }

        break;

    case "usrapp":

        $board = $conn->real_escape_string($_POST['board']);

        if (!empty($_POST['msg'])) {

            $msg = $conn->real_escape_string(htmlspecialchars($_POST['msg']));

            $email = $conn->real_escape_string(htmlspecialchars($_POST['email']));

            $IPAddress = $mitsuba->common->getIP();

            if ($mitsuba->common->verifyBan($IPAddress, $_POST['banid'], $_POST['banrange'])) {

                $ban_id = $_POST['banid'];

                $range = $_POST['banrange'];

                $conn->query("INSERT INTO appeals (created, ban_id, ip, msg, email, rangeban) VALUES (" . time() . ", " . $ban_id . ", '" . $IPAddress . "', '" . $msg . "', '" . $email . "', " . $range . ") ON DUPLICATE KEY UPDATE msg='" . $msg . "', email='" . $email . "'");

                echo $lang['img/appeal_sent'];

            }

        }

        break;

    default:

        $e = array("mode" => $mode, "requestdata" => & $_POST);

        $mitsuba->emitEvent("imgboard.mode", $e);

    }

    $conn->close();

} else {

}


code:
<?php
/**
 * A wrapper to work with TesseractOCR inside PHP.
 */
class TesseractOCR
{
    /**
     * Path to the image to be recognized.
     *
     * @var string
     */
    private $image;

    /**
     * Path to tesseract executable.
     * Default value assumes it is present in the $PATH.
     *
     * @var string
     */
    private $executable = 'tesseract';

    /**
     * Path to tessdata directory.
     *
     * @var string
     */
    private $tessdataDir;

    /**
     * Path to user words file.
     *
     * @var string
     */
    private $userWords;

    /**
     * Path to user patterns file.
     *
     * @var string
     */
    private $userPatterns;

    /**
     * List of languages.
     *
     * @var array
     */
    private $languages = [];

    /**
     * Page Segmentation Mode value.
     *
     * @var integer
     */
    private $psm;

    /**
     *  List of tesseract configuration variables.
     *
     * @var array
     */
    private $configs = [];

    /**
     * Class constructor.
     *
     * @param  string $image
     * @return TesseractOCR
     */
    public function __construct($image)
    {
        $this->image = $image;
        return $this;
    }

    /**
     * Executes tesseract command and returns the generated output.
     *
     * @return string
     */
    public function run()
    {
        return trim(`{$this->buildCommand()}`);
    }

    /**
     * Sets a custom location for the tesseract executable.
     *
     * @param  string $executable
     * @return TesseractOCR
     */
    public function executable($executable)
    {
        $this->executable = $executable;
        return $this;
    }

    /**
     * Sets a custom tessdata directory.
     *
     * @param  string $dir
     * @return TesseractOCR
     */
    public function tessdataDir($dir)
    {
        $this->tessdataDir = $dir;
        return $this;
    }

    /**
     * Sets user words file path.
     *
     * @param  string $filePath
     * @return TesseractOCR
     */
    public function userWords($filePath)
    {
        $this->userWords = $filePath;
        return $this;
    }

    /**
     * Sets user patterns file path.
     *
     * @param  string $filePath
     * @return TesseractOCR
     */
    public function userPatterns($filePath)
    {
        $this->userPatterns = $filePath;
        return $this;
    }

    /**
     * Sets the language(s).
     *
     * @param  string ...$languages
     * @return TesseractOCR
     */
    public function lang()
    {
        $this->languages = func_get_args();
        return $this;
    }

    /**
     * Sets the Page Segmentation Mode value.
     *
     * @param  integer $psm
     * @return TesseractOCR
     */
    public function psm($psm)
    {
        $this->psm = $psm;
        return $this;
    }

    /**
     * Sets a tesseract configuration value.
     *
     * @param  string $key
     * @param  string $value
     * @return TesseractOCR
     */
    public function config($key, $value)
    {
        $this->configs[$key] = $value;
        return $this;
    }

    /**
     * Shortcut to set tessedit_char_whitelist values in a more convenient way.
     * Example:
     *
     *     (new WrapTesseractOCR('image.png'))
     *         ->whitelist(range(0, 9), range('A', 'F'), '-_@')
     *
     * @param  mixed ...$charlists
     * @return TesseractOCR
     */
    public function whitelist()
    {
        $concatenate = function ($carry, $item) {
            return $carry . join('', (array)$item);
        };
        $whitelist = array_reduce(func_get_args(), $concatenate, '');
        $this->config('tessedit_char_whitelist', $whitelist);
        return $this;
    }

    /**
     * Builds the tesseract command with all its options.
     * This method is 'protected' instead of 'private' to make testing easier.
     *
     * @return string
     */
    protected function buildCommand()
    {
        return $this->executable.' '.escapeshellarg($this->image).' stdout'
            .$this->buildTessdataDirParam()
            .$this->buildUserWordsParam()
            .$this->buildUserPatternsParam()
            .$this->buildLanguagesParam()
            .$this->buildPsmParam()
            .$this->buildConfigurationsParam();
    }

    /**
     * If tessdata directory is defined, return the correspondent command line
     * argument to the tesseract command.
     *
     * @return string
     */
    private function buildTessdataDirParam()
    {
        return $this->tessdataDir ? " --tessdata-dir $this->tessdataDir" : '';
    }

    /**
     * If user words file is defined, return the correspondent command line
     * argument to the tesseract command.
     *
     * @return string
     */
    private function buildUserWordsParam()
    {
        return $this->userWords ? " --user-words $this->userWords" : '';
    }

    /**
     * If user patterns file is defined, return the correspondent command line
     * argument to the tesseract command.
     *
     * @return string
     */
    private function buildUserPatternsParam()
    {
        return $this->userPatterns ? " --user-patterns $this->userPatterns" : '';
    }

    /**
     * If one (or more) languages are defined, return the correspondent command
     * line argument to the tesseract command.
     *
     * @return string
     */
    private function buildLanguagesParam()
    {
        return $this->languages ? ' -l '.join('+', $this->languages) : '';
    }

    /**
     * If a page segmentation mode is defined, return the correspondent command
     * line argument to the tesseract command.
     *
     * @return string
     */
    private function buildPsmParam()
    {
        return $this->psm ? ' -psm '.$this->psm : '';
    }

    /**
     * Return tesseract command line arguments for every custom configuration.
     *
     * @return string
     */
    private function buildConfigurationsParam()
    {
        $buildParam = function ($config, $value) {
            return ' -c '.escapeshellarg("$config=$value");
        };
        return join(
            '', array_map(
                $buildParam,
                array_keys($this->configs),
                array_values($this->configs)
            )
        );
    }
}


code:
<?php

namespace Mitsuba\Admin;

/**
 * Bans
 * Handles system bans.
 *
 * @category
 * @package
 * @author
 * @copyright
 * @license
 * @version
 * @link
 * @see
 * @since
 */
class Bans
{

    private $conn;

    private $mitsuba;

    /**
     * __construct
     * Insert description here
     *
     * @param $connection
     * @param $mitsuba
     *
     * @return
     *
     * @access
     * @static
     * @see
     * @since
     */
    function __construct($connection, &$mitsuba)
    {

        $this->conn = $connection;

        $this->mitsuba = $mitsuba;

    }

    /**
     * addBan
     * Inserts a ban into the `bans` table
     *
     * @param $IPAddress The IP address of the banned user
     * @param $reason The reason the user was banned
     * @param $note A note only staff members can see (if it exists)
     * @param $expires The amout of time (in seconds) the user is banned
     * @param $boards Comma-separated (or % if all) list of boards the user is banned from
     * @param $appeal The appeal message the banned user sends to staff
     *
     * @return int 1 Only if user ban was successful | int -2 if ban is unsuccessful
     *
     * @access
     * @static
     * @see
     * @since
     */
    function addBan($IPAddress, $reason, $note, $expires, $boards, $appeal = 0)
    {

        if (!empty($IPAddress)) {

            $IPAddress = $this->conn->real_escape_string($IPAddress);

            $reason = $this->conn->real_escape_string($reason);

            $note = $this->conn->real_escape_string($note);

            $boards = $this->conn->real_escape_string($boards);

            $created = time();

            $perma = 1;

            $noappeal = 1;

            if (($expires == "0") || ($expires == "never") || ($expires == "") || ($expires == "perm") || ($expires == "permaban")) {

                $expires = 0;

                $perma = 1;

            } else {

                $expires = $this->mitsuba->common->parse_time($expires);

                $perma = 0;

            }

            if (($expires == false) && ($perma == 0)) {

                return -2;

            }

            if (($appeal == "0") || ($appeal == "never") || ($appeal == "")) {

                $appeal = 0;

                $noappeal = 1;

            } else {

                $appeal = $this->mitsuba->common->parse_time($appeal);

                $noappeal = 0;

            }

            if (($appeal == false) && ($noappeal == 0)) {

                return -2;

            }

            $this->conn->query("INSERT INTO bans (ip, mod_id, reason, note, created, expires, appeal, boards, seen) VALUES ('" . $IPAddress . "', " . $_SESSION['id'] . ", '" . $reason . "', '" . $note . "', " . $created . ", " . $expires . ", " . $appeal . ", '" . $boards . "', 0);");

            return 1;

        }

    }

    /**
     * addRangeBan
     * Inserts a ranged ban into the `rangebans` table
     *
     * @param $IPAddress The IP address of the banned user
     * @param $reason The reason the user was banned
     * @param $note A note only staff members can see (if it exists)
     * @param $expires The amout of time (in seconds) the user is banned
     * @param $boards Comma-separated (or % if all) list of boards the user is banned from
     *
     * @return int 1 Only if user ban was successful | int -2 if ban is unsuccessful
     *
     * @access
     * @static
     * @see
     * @since
     */
    function addRangeBan($IPAddress, $reason, $note, $expires, $boards)
    {

        if (!empty($IPAddress)) {

            $IPAddress = $this->conn->real_escape_string($IPAddress);

            $reason = $this->conn->real_escape_string($reason);

            $note = $this->conn->real_escape_string($note);

            $boards = $this->conn->real_escape_string($boards);

            $created = time();

            $perma = 1;

            if (($expires == "0") || ($expires == "never") || ($expires == "") || ($expires == "perm") || ($expires == "permaban")) {

                $expires = 0;

                $perma = 1;

            } else {

                $expires = $this->mitsuba->common->parse_time($expires);

                $perma = 0;

            }

            if (($expires == false) && ($perma == 0)) {

                return -2;

            }

            $this->conn->query("INSERT INTO rangebans (ip, mod_id, reason, note, created, expires, boards) VALUES ('" . $IPAddress . "', " . $_SESSION['id'] . ", '" . $reason . "', '" . $note . "', " . $created . ", " . $expires . ", '" . $boards . "');");

            return 1;

        }

    }

    /**
     * addWarning
     * Inserts warning into the `warnings` table
     *
     * @param $IPAddress The IP address of the user getting the warning
     * @param $reason The reason the user was warned
     * @param $note A note only staff members can see (if it exists)
     *
     * @return int 1
     *
     * @access
     * @static
     * @see
     * @since
     */
    function addWarning($IPAddress, $reason, $note)
    {

        if (!empty($IPAddress)) {

            $IPAddress = $this->conn->real_escape_string($IPAddress);

            $reason = $this->conn->real_escape_string($reason);

            $note = $this->conn->real_escape_string($note);

            $created = time();

            $this->conn->query("INSERT INTO warnings (ip, mod_id, reason, note, created, seen) VALUES ('" . $IPAddress . "', " . $_SESSION['id'] . ", '" . $reason . "', '" . $note . "', " . $created . ", 0);");

            return 1;

        }

    }

    /**
     * addBanRequest
     * Inserts ban request into `ban_request` table
     *
     * @param $IPAddress The IP address of the user getting the warning
     * @param $reason The reason the user was warned
     * @param $note A note only staff members can see (if it exists)
     * @param $board Board the staff member wishes the user be banned from
     * @param $post
     * @param $append
     *
     * @return
     *
     * @access
     * @static
     * @see
     * @since
     */
    function addBanRequest($IPAddress, $reason, $note, $board = "", $post = 0, $append = 0)
    {

        if (!empty($IPAddress)) {

            $IPAddress = $this->conn->real_escape_string($IPAddress);

            $reason = $this->conn->real_escape_string($reason);

            $note = $this->conn->real_escape_string($note);

            if (is_numeric($post)) {

            }

            $created = time();

            $this->conn->query("INSERT INTO ban_requests (ip, mod_id, reason, note, created, board, post, append) VALUES ('" . $IPAddress . "', " . $_SESSION['id'] . ", '" . $reason . "', '" . $note . "', " . $created . ", '" . $board . "', " . $post . ", " . $append . ");");

            return 1;

        }

    }

}

?>