summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDominique Martinet <asmadeus@codewreck.org>2020-05-08 11:33:42 +0000
committerDominique Martinet <asmadeus@codewreck.org>2020-05-08 11:33:42 +0000
commit0c5d10dab3a8c35dab9e8db61a8a426eff25ef3f (patch)
tree23d1d27a50d85ca9b5fa1d447d07275690cd1ace
parent9a336858626d2465b52b976d11a70e36a566b23d (diff)
remove old site
-rw-r--r--old/._listmembers.phpbin4096 -> 0 bytes
-rw-r--r--old/._login.phpbin4096 -> 0 bytes
-rw-r--r--old/COPYING263
-rw-r--r--old/ChangeLog209
-rw-r--r--old/INSTALL186
-rw-r--r--old/LICENSE16
-rw-r--r--old/README121
-rw-r--r--old/admin/DAoC.php130
-rw-r--r--old/admin/Everquest.php99
-rw-r--r--old/admin/Everquest2-german.sql131
-rw-r--r--old/admin/Everquest2.php141
-rw-r--r--old/admin/WoW-english.php92
-rw-r--r--old/admin/WoW-german.php64
-rw-r--r--old/admin/WoW.php92
-rw-r--r--old/admin/addadj.php330
-rw-r--r--old/admin/addevent.php338
-rw-r--r--old/admin/addiadj.php424
-rw-r--r--old/admin/additem.php677
-rw-r--r--old/admin/addnews.php320
-rw-r--r--old/admin/addraid.php1303
-rw-r--r--old/admin/addturnin.php252
-rw-r--r--old/admin/backup.php288
-rw-r--r--old/admin/config.php512
-rw-r--r--old/admin/fix_negative.php93
-rw-r--r--old/admin/index.php680
-rw-r--r--old/admin/listadj.php130
-rw-r--r--old/admin/listevents.php71
-rw-r--r--old/admin/listitems.php90
-rw-r--r--old/admin/listnews.php74
-rw-r--r--old/admin/listraids.php78
-rw-r--r--old/admin/logs.php246
-rw-r--r--old/admin/lua.php634
-rw-r--r--old/admin/lua_config.php295
-rw-r--r--old/admin/manage_members.php151
-rw-r--r--old/admin/manage_users.php865
-rw-r--r--old/admin/mm/index.html0
-rw-r--r--old/admin/mm/mm_addmember.php559
-rw-r--r--old/admin/mm/mm_addmember.php.NEW.gzbin3893 -> 0 bytes
-rw-r--r--old/admin/mm/mm_listmembers.php129
-rw-r--r--old/admin/mm/mm_ranks.php150
-rw-r--r--old/admin/mm/mm_transfer.php249
-rw-r--r--old/admin/mysql_info.php131
-rw-r--r--old/admin/parse_Everquest.php587
-rw-r--r--old/admin/parse_Everquest2-german.php515
-rw-r--r--old/admin/parse_Everquest2.php546
-rw-r--r--old/admin/parse_Everquest2German.php515
-rw-r--r--old/admin/parse_Vanguard-SoH.php449
-rw-r--r--old/admin/parse_WoW.php484
-rw-r--r--old/admin/parse_log.php467
-rw-r--r--old/admin/plugins.php103
-rw-r--r--old/admin/soap/addraid.php39
-rw-r--r--old/admin/soap/addraidattendee.php52
-rw-r--r--old/admin/soap/delraidattendee.php52
-rw-r--r--old/admin/soap/dkpsoap.php665
-rw-r--r--old/admin/soap/doloot.php39
-rw-r--r--old/admin/soap/findevent.php39
-rw-r--r--old/admin/soap/getlastraid.php32
-rw-r--r--old/admin/soap/getrp.php39
-rw-r--r--old/admin/styles.php561
-rw-r--r--old/common.php210
-rw-r--r--old/config.php24
-rw-r--r--old/dbal/index.html0
-rw-r--r--old/dbal/mysql.php412
-rw-r--r--old/dbal/structure/index.html0
-rw-r--r--old/dbal/structure/mysql_data.sql183
-rw-r--r--old/dbal/structure/mysql_data_german.sql129
-rw-r--r--old/dbal/structure/mysql_structure.sql293
-rw-r--r--old/games/.htaccess1
-rw-r--r--old/games/DAoC.php130
-rw-r--r--old/games/Everquest.php99
-rw-r--r--old/games/Everquest2.php141
-rw-r--r--old/games/Vanguard-SoH.php114
-rw-r--r--old/games/WoW-german.php64
-rw-r--r--old/games/WoW.php97
-rw-r--r--old/games/index.html0
-rw-r--r--old/images/arrow.gifbin49 -> 0 bytes
-rw-r--r--old/images/error.gifbin963 -> 0 bytes
-rw-r--r--old/images/glyphs/edit.gifbin924 -> 0 bytes
-rw-r--r--old/images/glyphs/plugin.gifbin988 -> 0 bytes
-rw-r--r--old/images/glyphs/plugin.pngbin591 -> 0 bytes
-rw-r--r--old/images/glyphs/view.gifbin993 -> 0 bytes
-rw-r--r--old/images/index.html0
-rw-r--r--old/images/statbox.jpgbin5292 -> 0 bytes
-rw-r--r--old/images/view.gifbin1039 -> 0 bytes
-rw-r--r--old/includes/._functions.phpbin4096 -> 0 bytes
-rw-r--r--old/includes/.htaccess1
-rw-r--r--old/includes/class_email.php224
-rw-r--r--old/includes/class_template.php912
-rw-r--r--old/includes/dbal.php33
-rw-r--r--old/includes/eqdkp.php1241
-rw-r--r--old/includes/eqdkp.php.bak1241
-rw-r--r--old/includes/eqdkp_plugins.php1265
-rw-r--r--old/includes/file_upload.php123
-rw-r--r--old/includes/functions.php752
-rw-r--r--old/includes/index.html0
-rw-r--r--old/includes/lib/.htaccess1
-rw-r--r--old/includes/lib/changelog339
-rw-r--r--old/includes/lib/class.nusoap_base.php734
-rw-r--r--old/includes/lib/class.soap_fault.php65
-rw-r--r--old/includes/lib/class.soap_parser.php579
-rw-r--r--old/includes/lib/class.soap_server.php777
-rw-r--r--old/includes/lib/class.soap_transport_http.php999
-rw-r--r--old/includes/lib/class.soap_val.php58
-rw-r--r--old/includes/lib/class.soapclient.php787
-rw-r--r--old/includes/lib/class.wsdl.php1639
-rw-r--r--old/includes/lib/class.wsdlcache.php168
-rw-r--r--old/includes/lib/class.xmlschema.php885
-rw-r--r--old/includes/lib/nusoap.php6501
-rw-r--r--old/includes/lib/nusoapmime.php245
-rw-r--r--old/includes/nusoap.php6505
-rw-r--r--old/includes/session.php493
-rw-r--r--old/index.php39
-rw-r--r--old/install.php906
-rw-r--r--old/language/.htaccess1
-rw-r--r--old/language/chinese/.htaccess1
-rw-r--r--old/language/chinese/email/index.html0
-rw-r--r--old/language/chinese/email/register_activation_admin.txt13
-rw-r--r--old/language/chinese/email/register_activation_admin_activate.txt10
-rw-r--r--old/language/chinese/email/register_activation_none.txt13
-rw-r--r--old/language/chinese/email/register_activation_self.txt17
-rw-r--r--old/language/chinese/email/user_new_password.txt17
-rw-r--r--old/language/chinese/lang_admin.php462
-rw-r--r--old/language/chinese/lang_main.php368
-rw-r--r--old/language/english/.htaccess1
-rw-r--r--old/language/english/email/index.html0
-rw-r--r--old/language/english/email/register_activation_admin.txt13
-rw-r--r--old/language/english/email/register_activation_admin_activate.txt10
-rw-r--r--old/language/english/email/register_activation_none.txt13
-rw-r--r--old/language/english/email/register_activation_self.txt17
-rw-r--r--old/language/english/email/user_new_password.txt17
-rw-r--r--old/language/english/index.html0
-rw-r--r--old/language/english/lang_admin.php471
-rw-r--r--old/language/english/lang_install.php156
-rw-r--r--old/language/english/lang_main.php394
-rw-r--r--old/language/french/.htaccess1
-rw-r--r--old/language/french/lang_admin.php371
-rw-r--r--old/language/french/lang_main.php371
-rw-r--r--old/language/german/.htaccess1
-rw-r--r--old/language/german/email/index.html0
-rw-r--r--old/language/german/email/register_activation_admin.txt18
-rw-r--r--old/language/german/email/register_activation_admin_activate.txt12
-rw-r--r--old/language/german/email/register_activation_none.txt18
-rw-r--r--old/language/german/email/register_activation_self.txt23
-rw-r--r--old/language/german/email/user_new_password.txt21
-rw-r--r--old/language/german/lang_admin.php463
-rw-r--r--old/language/german/lang_install.php154
-rw-r--r--old/language/german/lang_main.php373
-rw-r--r--old/language/index.html0
-rw-r--r--old/listevents.php70
-rw-r--r--old/listitems.php143
-rw-r--r--old/listmembers.php495
-rw-r--r--old/listraids.php77
-rw-r--r--old/login.php93
-rw-r--r--old/plugins/index.html0
-rw-r--r--old/register.php530
-rw-r--r--old/settings.php269
-rw-r--r--old/stats.php339
-rw-r--r--old/summary.php320
-rw-r--r--old/templates/cache/default/admin/addadj.html.php52
-rw-r--r--old/templates/cache/default/admin/addevent.html.php56
-rw-r--r--old/templates/cache/default/admin/additem.html.php279
-rw-r--r--old/templates/cache/default/admin/addnews.html.php115
-rw-r--r--old/templates/cache/default/admin/addraid.html.php194
-rw-r--r--old/templates/cache/default/admin/addturnin.html.php109
-rw-r--r--old/templates/cache/default/admin/admin_index.html.php116
-rw-r--r--old/templates/cache/default/admin/config.html.php286
-rw-r--r--old/templates/cache/default/admin/confirm_delete.html.php24
-rw-r--r--old/templates/cache/default/admin/listadj.html.php82
-rw-r--r--old/templates/cache/default/admin/listnews.html.php46
-rw-r--r--old/templates/cache/default/admin/listusers.html.php92
-rw-r--r--old/templates/cache/default/admin/logs.html.php97
-rw-r--r--old/templates/cache/default/admin/mm_addmember.html.php121
-rw-r--r--old/templates/cache/default/admin/mm_menu.html.php36
-rw-r--r--old/templates/cache/default/admin/mm_ranks.html.php47
-rw-r--r--old/templates/cache/default/admin/parse_Everquest.html.php122
-rw-r--r--old/templates/cache/default/listevents.html.php42
-rw-r--r--old/templates/cache/default/listitems.html.php56
-rw-r--r--old/templates/cache/default/listmembers.html.php128
-rw-r--r--old/templates/cache/default/listraids.html.php46
-rw-r--r--old/templates/cache/default/login.html.php70
-rw-r--r--old/templates/cache/default/message.html.php21
-rw-r--r--old/templates/cache/default/page_header.html.php139
-rw-r--r--old/templates/cache/default/page_tail.html.php57
-rw-r--r--old/templates/cache/default/settings.html.php210
-rw-r--r--old/templates/cache/default/settings_menu.html.php43
-rw-r--r--old/templates/cache/default/stats.html.php91
-rw-r--r--old/templates/cache/default/summary.html.php113
-rw-r--r--old/templates/cache/default/upgrade.html.php37
-rw-r--r--old/templates/cache/default/viewevent.html.php97
-rw-r--r--old/templates/cache/default/viewitem.html.php50
-rw-r--r--old/templates/cache/default/viewmember.html.php157
-rw-r--r--old/templates/cache/default/viewnews.html.php46
-rw-r--r--old/templates/cache/default/viewraid.html.php137
-rw-r--r--old/templates/default/admin/addadj.html38
-rw-r--r--old/templates/default/admin/addevent.html42
-rw-r--r--old/templates/default/admin/addiadj.html54
-rw-r--r--old/templates/default/admin/additem.html237
-rw-r--r--old/templates/default/admin/additem_search.html47
-rw-r--r--old/templates/default/admin/addnews.html97
-rw-r--r--old/templates/default/admin/addraid.html161
-rw-r--r--old/templates/default/admin/addstyle.html287
-rw-r--r--old/templates/default/admin/addturnin.html74
-rw-r--r--old/templates/default/admin/admin_index.html87
-rw-r--r--old/templates/default/admin/backup.html23
-rw-r--r--old/templates/default/admin/config.html229
-rw-r--r--old/templates/default/admin/confirm_delete.html16
-rw-r--r--old/templates/default/admin/index.html0
-rw-r--r--old/templates/default/admin/listadj.html54
-rw-r--r--old/templates/default/admin/listnews.html31
-rw-r--r--old/templates/default/admin/listusers.html63
-rw-r--r--old/templates/default/admin/logs.html71
-rw-r--r--old/templates/default/admin/lua.html104
-rw-r--r--old/templates/default/admin/menu.html23
-rw-r--r--old/templates/default/admin/mm_addmember.html86
-rw-r--r--old/templates/default/admin/mm_menu.html28
-rw-r--r--old/templates/default/admin/mm_ranks.html32
-rw-r--r--old/templates/default/admin/mm_transfer.html35
-rw-r--r--old/templates/default/admin/mysql_info.html28
-rw-r--r--old/templates/default/admin/parse_Everquest.html94
-rw-r--r--old/templates/default/admin/parse_Everquest2.html94
-rw-r--r--old/templates/default/admin/parse_Vanguard-SoH.html95
-rw-r--r--old/templates/default/admin/parse_WoW.html94
-rw-r--r--old/templates/default/admin/parse_log-template.html94
-rw-r--r--old/templates/default/admin/parse_log.html94
-rw-r--r--old/templates/default/admin/plugins.html21
-rw-r--r--old/templates/default/admin/styles.html20
-rw-r--r--old/templates/default/images/aallix_logo.gifbin2536 -> 0 bytes
-rw-r--r--old/templates/default/images/blueish_logo.gifbin2533 -> 0 bytes
-rw-r--r--old/templates/default/images/collab_logo.gifbin2547 -> 0 bytes
-rw-r--r--old/templates/default/images/dkpua_logo.gifbin2515 -> 0 bytes
-rw-r--r--old/templates/default/images/index.html0
-rw-r--r--old/templates/default/images/invision_logo.gifbin2540 -> 0 bytes
-rw-r--r--old/templates/default/images/items_logo.gifbin1607 -> 0 bytes
-rw-r--r--old/templates/default/images/lime_logo.gifbin1604 -> 0 bytes
-rw-r--r--old/templates/default/images/logo.gifbin1601 -> 0 bytes
-rw-r--r--old/templates/default/images/midnight_logo.gifbin1604 -> 0 bytes
-rw-r--r--old/templates/default/images/old_school_logo.gifbin1604 -> 0 bytes
-rw-r--r--old/templates/default/images/penguin_logo.gifbin1606 -> 0 bytes
-rw-r--r--old/templates/default/images/subsilver_logo.gifbin1585 -> 0 bytes
-rw-r--r--old/templates/default/images/vb_logo.gifbin1606 -> 0 bytes
-rw-r--r--old/templates/default/index.html0
-rw-r--r--old/templates/default/listevents.html27
-rw-r--r--old/templates/default/listitems.html33
-rw-r--r--old/templates/default/listmembers.html92
-rw-r--r--old/templates/default/listraids.html31
-rw-r--r--old/templates/default/login.html58
-rw-r--r--old/templates/default/message.html13
-rw-r--r--old/templates/default/page_header.html115
-rw-r--r--old/templates/default/page_tail.html33
-rw-r--r--old/templates/default/settings.html152
-rw-r--r--old/templates/default/settings_menu.html21
-rw-r--r--old/templates/default/stats.html69
-rw-r--r--old/templates/default/summary.html79
-rw-r--r--old/templates/default/upgrade.html22
-rw-r--r--old/templates/default/viewevent.html75
-rw-r--r--old/templates/default/viewitem.html31
-rw-r--r--old/templates/default/viewmember.html121
-rw-r--r--old/templates/default/viewnews.html25
-rw-r--r--old/templates/default/viewraid.html77
-rw-r--r--old/templates/install/install_css.html57
-rw-r--r--old/templates/install/install_header.html25
-rw-r--r--old/templates/install/install_message.html13
-rw-r--r--old/templates/install/install_step1.html58
-rw-r--r--old/templates/install/install_step2.html104
-rw-r--r--old/templates/install/install_step3.html46
-rw-r--r--old/templates/install/install_step4.html47
-rw-r--r--old/templates/install/install_tail.html10
-rw-r--r--old/upgrade.php363
-rw-r--r--old/viewevent.php205
-rw-r--r--old/viewitem.php121
-rw-r--r--old/viewmember.php362
-rw-r--r--old/viewnews.php74
-rw-r--r--old/viewraid.php247
273 files changed, 0 insertions, 60135 deletions
diff --git a/old/._listmembers.php b/old/._listmembers.php
deleted file mode 100644
index e0e2a5a..0000000
--- a/old/._listmembers.php
+++ /dev/null
Binary files differ
diff --git a/old/._login.php b/old/._login.php
deleted file mode 100644
index d0f865c..0000000
--- a/old/._login.php
+++ /dev/null
Binary files differ
diff --git a/old/COPYING b/old/COPYING
deleted file mode 100644
index d1b3101..0000000
--- a/old/COPYING
+++ /dev/null
@@ -1,263 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
-Copyright (C) 1989, 1991 Free Software Foundation, Inc.
-59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
-
-Everyone is permitted to copy and distribute verbatim copies
-of this license document, but changing it is not allowed.
-
- Preamble
-
-The licenses for most software are designed to take away your freedom to share
-and change it. By contrast, the GNU General Public License is intended to
-guarantee your freedom to share and change free software--to make sure the
-software is free for all its users. This General Public License applies to
-most of the Free Software Foundation's software and to any other program whose
-authors commit to using it. (Some other Free Software Foundation software is
-covered by the GNU Library General Public License instead.) You can apply it to
-your programs, too.
-
-When we speak of free software, we are referring to freedom, not price. Our
-General Public Licenses are designed to make sure that you have the freedom to
-distribute copies of free software (and charge for this service if you wish),
-that you receive source code or can get it if you want it, that you can change
-the software or use pieces of it in new free programs; and that you know you
-can do these things.
-
-To protect your rights, we need to make restrictions that forbid anyone to deny
-you these rights or to ask you to surrender the rights. These restrictions
-translate to certain responsibilities for you if you distribute copies of the
-software, or if you modify it.
-
-For example, if you distribute copies of such a program, whether gratis or for
-a fee, you must give the recipients all the rights that you have. You must make
-sure that they, too, receive or can get the source code. And you must show them
-these terms so they know their rights.
-
-We protect your rights with two steps: (1) copyright the software, and (2)
-offer you this license which gives you legal permission to copy, distribute
-and/or modify the software.
-
-Also, for each author's protection and ours, we want to make certain that
-everyone understands that there is no warranty for this free software. If the
-software is modified by someone else and passed on, we want its recipients to
-know that what they have is not the original, so that any problems introduced
-by others will not reflect on the original authors' reputations.
-
-Finally, any free program is threatened constantly by software patents. We wish
-to avoid the danger that redistributors of a free program will individually
-obtain patent licenses, in effect making the program proprietary. To prevent
-this, we have made it clear that any patent must be licensed for everyone's
-free use or not licensed at all.
-
-The precise terms and conditions for copying, distribution and modification
-follow.
-
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains a notice
-placed by the copyright holder saying it may be distributed under the terms of
-this General Public License. The "Program", below, refers to any such program
-or work, and a "work based on the Program" means either the Program or any
-derivative work under copyright law: that is to say, a work containing the
-Program or a portion of it, either verbatim or with modifications and/or
-translated into another language. (Hereinafter, translation is included without
-limitation in the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not covered by
-this License; they are outside its scope. The act of running the Program is
-not restricted, and the output from the Program is covered only if its contents
-constitute a work based on the Program (independent of having been made by
-running the Program). Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's source code
-as you receive it, in any medium, provided that you conspicuously and
-appropriately publish on each copy an appropriate copyright notice and
-disclaimer of warranty; keep intact all the notices that refer to this
-License and to the absence of any warranty; and give any other recipients of
-the Program a copy of this License along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and you may
-at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion of it,
-thus forming a work based on the Program, and copy and distribute such
-modifications or work under the terms of Section 1 above, provided that you
-also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices stating
-that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in whole
-or in part contains or is derived from the Program or any part thereof, to be
-licensed as a whole at no charge to all third parties under the terms of this
-License.
-
- c) If the modified program normally reads commands interactively when run,
-you must cause it, when started running for such interactive use in the most
-ordinary way, to print or display an announcement including an appropriate
-copyright notice and a notice that there is no warranty (or else, saying that
-you provide a warranty) and that users may redistribute the program under these
-conditions, and telling the user how to view a copy of this License.
-(Exception: if the Program itself is interactive but does not normally print
-such an announcement, your work based on the Program is not required to print
-an announcement.)
-
-These requirements apply to the modified work as a whole. If identifiable
-sections of that work are not derived from the Program, and can be reasonably
-considered independent and separate works in themselves, then this License,
-and its terms, do not apply to those sections when you distribute them as
-separate works. But when you distribute the same sections as part of a whole
-which is a work based on the Program, the distribution of the whole must be on
-the terms of this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest your
-rights to work written entirely by you; rather, the intent is to exercise the
-right to control the distribution of derivative or collective works based on
-the Program.
-
-In addition, mere aggregation of another work not based on the Program with
-the Program (or with a work based on the Program) on a volume of a storage or
-distribution medium does not bring the other work under the scope of this
-License.
-
- 3. You may copy and distribute the Program (or a work based on it, under
-Section 2) in object code or executable form under the terms of Sections 1 and
-2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable source
-code, which must be distributed under the terms of Sections 1 and 2 above on a
-medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three years, to
-give any third party, for a charge no more than your cost of physically
-performing source distribution, a complete machine-readable copy of the
-corresponding source code, to be distributed under the terms of Sections 1 and
-2 above on a medium customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer to
-distribute corresponding source code. (This alternative is allowed only for
-noncommercial distribution and only if you received the program in object code
-or executable form with such an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for making
-modifications to it. For an executable work, complete source code means all
-the source code for all modules it contains, plus any associated interface
-definition files, plus the scripts used to control compilation and installation
-of the executable. However, as a special exception, the source code distributed
-need not include anything that is normally distributed (in either source or
-binary form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component itself
-accompanies the executable.
-
-If distribution of executable or object code is made by offering access to copy
-from a designated place, then offering equivalent access to copy the source
-code from the same place counts as distribution of the source code, even
-though third parties are not compelled to copy the source along with the
-object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program except as
-expressly provided under this License. Any attempt otherwise to copy, modify,
-sublicense or distribute the Program is void, and will automatically terminate
-your rights under this License. However, parties who have received copies, or
-rights, from you under this License will not have their licenses terminated so
-long as such parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not signed it.
-However, nothing else grants you permission to modify or distribute the Program
-or its derivative works. These actions are prohibited by law if you do not
-accept this License. Therefore, by modifying or distributing the Program (or
-any work based on the Program), you indicate your acceptance of this License
-to do so, and all its terms and conditions for copying, distributing or
-modifying the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the Program),
-the recipient automatically receives a license from the original licensor to
-copy, distribute or modify the Program subject to these terms and conditions.
-You may not impose any further restrictions on the recipients' exercise of the
-rights granted herein. You are not responsible for enforcing compliance by
-third parties to this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues), conditions
-are imposed on you (whether by court order, agreement or otherwise) that
-contradict the conditions of this License, they do not excuse you from the
-conditions of this License. If you cannot distribute so as to satisfy
-simultaneously your obligations under this License and any other pertinent
-obligations, then as a consequence you may not distribute the Program at all.
-For example, if a patent license would not permit royalty-free redistribution
-of the Program by all those who receive copies directly or indirectly through
-you, then the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under any
-particular circumstance, the balance of the section is intended to apply and
-the section as a whole is intended to apply in other circumstances.
-
-It is not the purpose of this section to induce you to infringe any patents or
-other property right claims or to contest validity of any such claims; this
-section has the sole purpose of protecting the integrity of the free software
-distribution system, which is implemented by public license practices. Many
-people have made generous contributions to the wide range of software
-distributed through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing to
-distribute software through any other system and a licensee cannot impose that
-choice.
-
-This section is intended to make thoroughly clear what is believed to be a
-consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in certain
-countries either by patents or by copyrighted interfaces, the original
-copyright holder who places the Program under this License may add an explicit
-geographical distribution limitation excluding those countries, so that
-distribution is permitted only in or among countries not thus excluded. In such
-case, this License incorporates the limitation as if written in the body of
-this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions of
-the General Public License from time to time. Such new versions will be similar
-in spirit to the present version, but may differ in detail to address new
-problems or concerns.
-
-Each version is given a distinguishing version number. If the Program specifies
-a version number of this License which applies to it and "any later version",
-you have the option of following the terms and conditions either of that
-version or of any later version published by the Free Software Foundation. If
-the Program does not specify a version number of this License, you may choose
-any version ever published by the Free Software Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free programs
-whose distribution conditions are different, write to the author to ask for
-permission. For software which is copyrighted by the Free Software Foundation,
-write to the Free Software Foundation; we sometimes make exceptions for this.
-Our decision will be guided by the two goals of preserving the free status of
-all derivatives of our free software and of promoting the sharing and reuse of
-software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR
-THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE
-STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE
-PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
-INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
-FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND
-PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU
-ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO
-LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR
-THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
-EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGES.
-
-
- END OF TERMS AND CONDITIONS
- \ No newline at end of file
diff --git a/old/ChangeLog b/old/ChangeLog
deleted file mode 100644
index d4bf1bb..0000000
--- a/old/ChangeLog
+++ /dev/null
@@ -1,209 +0,0 @@
-Version 1.3.2 - March 9, 2007
------------------------------
-[+] Added game support for the World of Warcraft: The Burning Crusade
-[+] Added game support for Vanguard: Saga of Heroes
-[*] Fixed a security issue in the database backup script
-[+] Improved functionality in the database backup script
-[ ] Game support moved to a new directory
-[*] Admin panel links are now relative to the EQdkp root path.
-[*] Fixed an issue where menu links would disappear upon installing a plugin (for PHP versions > 5)
-[*] Altered the glyph images. They should be valid GIF files now
-[*] Fixed the "date() expects parameter 2 to be long" in viewnews.php
-[ ] English is now the default language during the second step of the install process
-[ ] Removed the Import LUA feature temporarily
-[*] Removed admin/mm/mm_addmembers.php.NEW.gz
-[ ] Merged all previous patches for the 1.3 branch
-
-Version 1.3.0p2 - October 19, 2005
-------------------------------------
-[*] [1.3.0p1] Fixed the new (again) addraid
-[*] [1.3.0p1] Fixed a problem with install.php
-[*] [1.3.0p1] Fixed the parse_Everquest.php file to return all values
-[*] [1.3.0p1] We now correctly pass the class name for stats filtering
-[*] [1.3.0p1] Subversion directories in the plugin directory fixed
-
-Version 1.3.0p1 - September 15, 2005
-------------------------------------
-[*] [1.3] Column wraps around if value is too long
-[*] [1.3] [WoW] Armor types wrong :: "cloth and chain", not "silk and mail"
-[*] [1.3] Edited member name not updated everywhere adjustment table not updated correctly
-[*] [1.3] [Everquest] Problems with Shadow Knights
-[*] [1.3] Item prices getting truncated or corrupted
-
-Version 1.3.0 - August 1, 2005
-------------------------------
-[+] Moved Race, Class, and Faction data to the database
-[*] Fixed a bug related to files from FrontPage that contain an underscore.
-[*] Fixed sort order of items in listitems.php
-[+] Added parse_{DEFAULT_GAME}.php files for raid dump parsing across games
-[+] Modularized the population of game information via config.php line
-[*] Fixed a session.php security bug.
-[*] Fixed the dbal.php file
-[+] upgrade.php works for going from 1.2 -> 1.3
-[+] Made InnoDB the standard MySQL database
-[+] Added Armor Type to standings page
-[+] Check and fix all names for proper name capitalization
-[*] Added SOAP interface to the database
-[*] Added perliminary support for CTRaidTracker
-[ ] Requires MySQL version 4.x and PHP 4.3.10 or higher
-[ ] Next release will require PHP 5.x and MySql 5.x
-[+] Added German language SQL info for races/classes (thx Esmeroth)
-
-
-
-Version 1.2.0 - Oct 4, 2003
----------------------------
-[*] Fixed a bug in viewmember.php that might have resulted in a miscalculated percentage for attendance-by-event.
-[*] Fixed a language error in User::check_auth()
-[ ] Consolidated page_header.php and page_tail.php into the EQdkp class.
-[ ] Moved Session and User classes to session.php.
-[*] We believe we've isolated the bug that only let users log in while using cookies. Please test this before the final release to make sure.
-[*] The newest admin actions in the admin index are now only viewable by admins with permission to view logs.
-[*] Improved efficiency in viewevent.php
-[*] Improved efficiency in summary.php
-[+] New base class EQdkp_Admin to be extended by admin scripts.
-[*] Improved efficiency in addadj.php
-[*] Improved efficiency in addiadj.php
-[*] Improved efficiency in additem.php
-[*] Improved efficiency in addraid.php
-[*] Fixed eqdkp_start being replaced by (table prefix)start during install [ #714246 ].
-[+] Added a config option to let the admin set which page acts as the index. Useful for guilds that didn't make use of the news page and wanted to go straight to the member listings, for example.
-[+] The username field is auto-focused on login.php to make logging in faster.
-[+] Added logging for all fields when adding/updating/deleting members [ #714986 and #714320 ].
-[+] A notice is displayed on the admin index page if a new version of EQdkp is available.
-[+] Added a small admin page to display information about the EQdkp database tables.
-[+] Added a small pop-up window to let admins search for items by name rather than using the drop-down list on additem.php. Search results can also be populated by the stats database if the Item Stats plugin is installed.
-[+] Added a checkbox to the addnews page to let the user choose whether or not the post's date is updated along with the rest of the post [ #705786 ].
-[+] Added a field to the plugin table and plugin classes to show the version of the plugin.
-[+] Added options to parse_log that lets the admin select which members to include or exclude based on their membership flag [ #724043 ].
-[+] Added a nice feature to addraid and additem that lets you type in a partial member or item name and it matches the closest name in a drop-down list for easy selection [ #722884 ].
-[+] The "Location" field of the "Who's Online" list on the admin index page now outputs more cleanly.
-[+] When adding a new member, the earned, spent, and adjustment fields automatically fill in as 0.00 to speed up adding guild members [ #726078 ].
-[*] Logging errors were created when adding data with apostrophes in certain fields [ #726141 ].
-[*] When adding a member with no previous firstraid to a raid, the firstraid date was computed improperly [ #705206 ].
-[+] Added the user-to-member association table used in the Magelo and Guild Flags plugin to the core of EQdkp to make installing and using these plugins easier.
-[*] An error occurred if the user tried to 'Deleted Selected Member(s)' with no members selected.
-[+] Added a 'Mass Update' area to the Manage Users panel that allows the administrator to update many users' account permissions at one time.
-[+] User accounts can now be deleted en-masse using the above addition [ #731002 ].
-[*] Resolved all IIS-specific errors for IIS 5. Please make us aware of any remaining errors.
-[+] Added quick-links to add another new member and to list existing members after a new member was successfully added.
-[+] Listmembers can now be filtered and the resulting list can then be sorted [ #739589 ].
-[+] On viewevent, all items obtained from the viewed event are listed.
-[*] A template wasn't selected correctly on the Manage Styles page.
-[+] Updated all templates to be XHTML 1.0-compliant.
-[+] No more frames in the admin panel!
-[+] Members can now be hidden based on their membership flag - go to the Manage Members / Edit Flags panel to define which flags are hidden.
-[+] When showing all members on the Standings page, members that are inactive have their names in italics. Similarly, flags that would normally be hidden are displayed in italics as well.
-[+] On the Manage Styles page, administrators can now easily preview each style before selecting one to edit.
-[+] Style configuration fields now default to acceptable values when creating a new style.
-[*] When adding/updating/deleting raids, members' first and last raids are finally calculated correctly in all situations [ #749201 ].
-[*] If Hide Inactive Members was set to off, inactive members still wouldn't be shown [ #756747 ].
-[ ] Renamed Membership flags to Membership Ranks to avoid confusion with the Planes of Power flags.
-[*] Members with no flag (rank!) were ignored when parsing a log; thanks ryunosuke.
-[*] Members added during addraid were set to inactive; thanks ryunosuke.
-[*] Fixed a minor security flaw in the CVS versions of the administrative list pages; thanks ryunosuke.
-[+] Member flags can now have HTML prefixes and suffixes so you can, for example, color-code members based on their flags.
-[*] Fixed a bug where some members would be individually updated for no reason when processing a raid; thanks ryunosuke.
-[+] Items on the main menus and administrative menu are not shown to users that don't have permission to access their linked pages.
-[*] When editing a raid that occurred between after noon using a 24-hour format, the time would be reset to its 12-hour format (10:00 PM would become 10:00 AM); thanks ryunosuke.
-[ ] When viewing a member, attendance percentages are only shown for events that still exist in the database.
-[+] Added a class distribution breakdown to the viewraid page; thanks ryunosuke.
-[*] Users can now log in without the use of cookies [ #752542 and #749108 ]; thanks ryunosuke.
-[*] Undefined index: member_rank in mm_addmember.php.
-[*] When upgrading, eqdkp_member_user table wasn't created correctly.
-[*] member_raidcount wasn't updated correctly if the member was added manually rather than through a raid.
-[+] Added a 60-day and a lifetime percentage for raid attendance to the viewmember page.
-[*] Fixed an uninitialized var error in login.php after using an incorrect username/password.
-[*] Fixed an undefined index error in styles.php when a valid style id was not provided.
-[*] Fixed query syntax errors in upgrade.php that prevented some queries from running.
-[*] Fixed user accounts not being activated when user registration was set to none.
-[+] Event names in the Attendance by Event table on the viewmember page are now linked to their respective events.
-[*] Fixed the resulting page URL containing ?s=?s= after being redirected from index.php. (tsigo)
-[*] On the configuration page, field values wouldn't be saved if they were blank. This could have prevented users from removing their site description, for example. (tsigo)
-[*] Class filtering was ignored if hiding inactive members was disabled [ #776348 ]. (tsigo)
-[*] Hidden member ranks weren't hidden if hiding inactive members was disabled [ #776343 ]. (tsigo)
-[*] Fixed a deprecated call-time pass-by-reference in several admin pages [ #774135 ]. (tsigo, rillaith)
-[*] The "To" date for summaries is now inclusive, meaning raids occurring on that date will be included [ #781819 ]. (tsigo)
-[*] Output a message if no raids are present in the given range for summaries [ #781819 ]. (tsigo)
-[*] Fixed an infinite loop bug in upgrade.php [ #776335 ]. (tsigo)
-[*] Created a primary key index on the eqdkp_config table to prevent duplicate entries [ #776335 ]. (tsigo)
-[*] Added the Froglok race as an option in the addmember page [ #776220 ]. (tsigo)
-[*] Member active/inactive status was only updated after adding a new raid, not updating/deleting an old raid [ #776396 ]. (tsigo)
-[*] A member's first and last raid dates may not have been reset if they were removed from their only attended raid [ #776396 and #777984 ]. (tsigo)
-[*] Class names at the end of a summary now link correctly to listmembers.php with a filter [ #783903 ]. (tsigo)
-[*] Fixed apostrophe errors in addraid.php [ #785528 and #785683 ]. (tsigo)
-[*] Quotes in item names were being escaped twice after changes in 1.2 [ #785685 ]. (tsigo)
-[*] Fixed a rare bug that occurred if there was data in the raid_attendees table, but not in the members table.
-[*] News pagination was pointing to index.php instead of viewnews.php [ #789563 ]. (tsigo)
-[*] Added a 5-second timeout in waiting for eqdkp.com to respond with the latest version information. (tsigo)
-[*] Fixed yet another quote-related error, this time in manage_users [ #789808 ]. (tsigo)
-[*] When a user is deleted, any associated members are now disassociated [ #805250 ]. (tsigo)
-[*] Added a 5-second timeout to contacting EQdkp.com in install.php [ #805250 ]. (tsigo)
-[*] Reduced error output if EQdkp.com could not be contacted in install.php and admin/index.php. (tsigo)
-[*] Fixed several errors that occurred when a member's name has an apostrophe in it[ #808308 ]. (tsigo)
-[*] Added rank formatting to stats.php [ #813307 ]. (tsigo)
-
-Version 1.1.0 - Mar 22, 2003
-----------------------------
-[*] If a log was pasted directly from notepad, any roleplay members wouldn't be found because EverQuest inserts two spaces between the name and the guildtag. Added a check for either 1 or 2 spaces. Thanks Fenicks.
-[*] #679701
-[+] parse_log now displays how many log lines were parsed and how many members were found.
-[+] Member comparison can now be sorted like listmembers
-[ ] Did away with 'magic numbers' for auth_options and replaced them with constants as defined in common.php and individually by each plugin that uses its own permissions.
-[*] Fixed a bug that ocurred with log pagination and searching.
-[*] Fixed two more bugs relating to irregular spacing in EverQuest logs.
-[+] Added membership flags. They're completely customizable and can be assigned to members of your guild. See Feature Request #683599.
-[*] Database Size calculation now only applies to EQdkp tables.
-[+] Admin Panel menu is now dynamic and has a hook 'admin_menu' for plugins to use.
-[+] Added hook log_actions to admin/logs.php.
-[+] Added hook user_permissions_update to admin/manage_users.php.
-[+] Added an attendance by event breakdown on the viewmember page.
-[+] Added a filter drop-down to the listmembers page. Thanks Draelon.
-[*] Added error-checking to redirect() to make sure the URL exists.
-[ ] The guildtag option in the Configuration panel has been changed. The field that must match a /who GUILD log is now the second field, 'Guildtags to parse' (see below).
-[+] To support guild alliances wanting to use EQdkp and allow greater flexibility when parsing logs, the log parser now supports various options at run-time, including whether or not to include roleplay members, and which guildtag(s) to parse for.
-[*] If account validation was set to admin, the administrator wouldn't be able to validate accounts without first logging out.
-[ ] Checkbox generation for permissions on Configuration and Manage Users is now dynamic to allow easier integration for plugins.
-[ ] User::check_auth now stores permission settings for the previous call to itself if $user_id is set. This lowers the query count on certain pages by as much as 40.
-[*] Improved query efficiency in stats.php and summary.php.
-[ ] Settings menus are now array-driven.
-[+] Implemented a new, entirely object-oriented plugin system. Draelon did a ton of work on this, so many thanks to him for contributing to making this work. Aside from being very easy to utilize in plugins, it also vastly improved the efficiency of EQdkp's plugin foundation.
-[*] #705213
-[+] Multiple events can now be selected when adding a raid. This will enter one raid per event selected.
-[*] Fixed a bug in the Location field for the "Who's Online" list on the admin index.
-[*] Fixed a bug in settings.php that occurred if no plugins were installed.
-[*] Fixed a bug in install.php with the admin's e-mail address.
-
-Version 1.0.0 - Feb 01, 2003
-----------------------------
-[*] #664038
-[*] #664105
-[*] Fixed a bug that stopped getting item stats if only one mirror existed.
-[*] #664046
-[+] An automatic individual adjustment can now be made when a member becomes active or inactive.
-[+] Added the plugin management control panel.
-[+] Added a plugin foundation.
-[+] Added the preview link for styles to the configuration panel.
-[+] Added control panels to manage and create styles.
-[*] Fixed a major bug that occurred when magic_quotes_gpc was off.
-[+] Added a 'Last 90 days' column to viewmember and listmembers (compare) to get a better overview of raid attendance.
-[+] Added a verbose list of the last 10 administrative actions to the admin index page.
-[+] Added a color preview next to the style color settings.
-[+] Added the raid note to a Summary view.
-[+] Added a check for the GET variable 'class' to listmembers. If set the one of the valid EverQuest classes, only members of that class will be displayed.
-[+] Added a stats and summary table for classes. Shows how many items that class got, the percentage of items, the number of members who are that class, and the percentage of members. Clicking on a class name will find all members of that class.
-[+] Users with administrative permissions now show up in bold on the Manage Users list.
-[+] Added a tag for text to be centered on the addnews page.
-[+] Install script now presents the user with EQdkp requirements and their server settings, to see if they meet the requirements.
-[+] Added a 'Loot Factor' to the class stats - see Feature Request #672751
-[+] Added a 'Last Loot' column when comparing members. This indicates when the member last purchased an item, if ever.
-[ ] Restructured manage_members.php.
-[+] Added a form to add/edit/delete individual members. Permissions are based off of a_members_man.
-[+] Added logging for adding, updating and deleting members.
-
-Legend
-------
-[+] New Feature
-[-] Removed Feature
-[ ] Note
-[*] Bugfix
diff --git a/old/INSTALL b/old/INSTALL
deleted file mode 100644
index 2c1964f..0000000
--- a/old/INSTALL
+++ /dev/null
@@ -1,186 +0,0 @@
-EQdkp OpenSource DKP
-Copyright (C) 2002-2005 The EQdkp Project Team
-
-Installation:
--------------
-Pre-install:
- Create, or have ready a MySQL database that EQdkp can use. It
- should already have a username and password assigned to it.
-
-Step 1:
- Making sure to keep the directory structure intact, move the
- unzipped files to a web-accessible directory.
-
-Step 2:
- All files and directories should be owned by your webserver's user/group
- (Example: chown apache.apache -R *). All .php files should be
- readable/executable
-
- $ chmod a+rx -R *.php
-
-Step 3:
- Make sure the directory 'templates/cache' exists and that all sub-directories
- are readable/writable/executable
-
- Note: The installer will attempt to do this for you, but should an error occurr,
- you will need to do this manually:
-
- $ mkdir templates/cache ; chmod -R 777 templates/cache
-
-Step 4:
- If you want the installation script to automatically set up your config.php file for
- you, it should be readable/writeable
-
- Note: The installer will attempt to do this for you, but should an error occurr,
- you will need to do this manually:
-
- $ chmod 666 config.php
-
-Step 5:
- Browse to http://www.yourserver.com/eqdkp/install.php
-
- You should be presented with a page describing your server's settings and information.
- Once you are sure that your server meets EQdkp's requirements, you can click the
- 'Start Install' button.
-
- Step 5-1:
- Database Host:
- Your MySQL server name. If it resides on the same server as the web server,
- you should enter 'localhost'
- Database Name:
- The name of the database you created for EQdkp, usually 'eqdkp'.
- Database Username:
- The username with permission to access the database. If you didn't
- create the database yourself, your host should have given you this
- information.
- Database Password:
- The password used with the username from above.
- Prefix for EQdkp tables:
- Simply prefixes the name of each table that EQdkp creates and uses.
- The default of 'eqdkp_' should be sufficient for most installations.
-
- Domain Name:
- Should be detected automatically by the installation script, but if not
- just put the domain name of your server here (ex: mydomain.com, www.myhost.com).
- Webserver port:
- Unless the web server is running on a port other than the default (80), just leave
- the setting as-is.
- Script path:
- The path following the domain name where the script is located. Example: If the full
- path to the install script is http://mydomain.com/user/eqdkp/, you would enter
- '/user/eqdkp/', if the full path was http://mydomain.com/eqdkp/', the path would be
- '/eqdkp/'.
-
- Step 5-2:
- Administrator Username:
- This should be a username of your choosing. It will be your administrative account
- for your EQdkp installation.
- Administrator Password:
- A password of your choosing.
- Administrator Password [ confirm ]:
- Simply re-type the password to verify it.
- Administrator Email Address:
- Your (valid) e-mail address.
-
- After you're satisfied with the values for the above fields, click the button to proceed. The
- installer will automatically fill your config.php file and present you with a login field.
-
- You will be notified if your passwords didn't match, and it will be reset to a default of "admin" -
- change this later by going to Settings.
-
- Log in to automatically be redirected to the EQdkp configuration panel where you can configure all
- aspects of EQdkp. After that, you're ready to begin using EQdkp.
-
-You should now have a functional installation of EQdkp. Remove the install.php file for extra security.
-
-Upgrading:
-----------
-Step 1:
- BACK UP YOUR DATABASE. This cannot be stressed enough. Because some tables in EQdkp can
- get to be VERY large (eqdkp_raid_attendees, eqdkp_logs), you should consider using
- phpMyAdmin (http://www.phpmyadmin.net) which can use Completed Inserts that will be
- necessary if you need to restore the database.
-
-Step 2:
- Seriously, go back up your database since you skipped step 1.
-
-Step 3:
- Back up your config.php file. You will not need to change any values in this file and you'll
- want to be sure that unzipping the new version of EQdkp won't overwrite your old settings. 1.3.0
- doesn't have a new config.php file, so you shouldn't have an issue here - but back it up anyway.
-
-Step 4:
- Unzip the new EQdkp version. Copy your old config.php file from Step 2, overwriting the
- new version's config.php file into the unzipped directory to retain your old settings.
-
-Step 5:
- Access http://www.yourserver.com/eqdkp/upgrade.php and select the version you're upgrading
- from. The script will perform all the necessary changes to upgrade from the version you selected
- to the newest version.
-
-Step 5:
- Delete everything in the templates/cache directory ( rm ./templates/cache/* ).
-
-Step 6:
- Seriously, delete everything in the templates/cache directory. Your new install may
- not work right until you do this.
-
-Remove the upgrade.php file (or rename it to something else).
-
-Configuration:
---------------
-Once you've logged in to your administrator account, your next step should be changing
-the EQdkp configuration settings. Click on the 'Administration Panel' link in the top
-menu, and then on the 'Configuration' link in the left frame. This is where you can
-control all of EQdkp's settings.
-
-Most of the fields have descriptions where appropriate, but some need to be reinforced.
-
- Site Name:
- Optional, appears in a large font above the menu of each page. Usually it's something like
- 'Guild Point System'.
-
- Site Description:
- Also optional, appears below the site name in a smaller font. Usually a short tagline or a
- URL to the guild's official web site.
-
- Point Name:
- Some guilds may find the use of the 'DKP' acronym archaic (or even stupid) and may wish to change
- their point system name to something else.
-
- Enable Account Activation:
- None - Everyone who registers is given an account and automatically set up with the default
- permissions (see below).
- User - A user must validate their e-mail address in order for the account to become active.
- Admin - The administrator must approve the account personally for it to become active.
-
- Enable Gzip Compression:
- If your PHP installation supports Zlib, you may consider using this option. It compresses
- the output of pages to save you some bandwidth, but may use slightly more processing power.
-
- Default Permissions:
- Probably the MOST important thing you'll set up here. When a person comes to your EQdkp site and
- isn't logged in, you may not want them seeing what your guild has killed in the last couple of
- days, or who got what item.
-
- These default permissions are also given to people when they register and can only be changed by
- an administrator with the 'Manage Users' permission. Items in bold text should only be given
- to trusted members of your guild who will be responsible for maintaining the point system.
-
- Cookie Settings:
- For 99% of the installations, the default values should be sufficient.
-
-
- Default Game:
- If you are running something other than EverQuest for your game, you'll need to change it
- now. Select WoW, Everquest2, or any of the other games available.
-
- Backup Database:
- This will take you to an add-on that will let you back-up your eqdkp database without having to
- use phpMyAdmin - very useful if you don't have access to the box after the admin leaves the
- guild, no? Can also be used to restore a database - so be very careful as there are no
- special permissions needed for this functionality - admin access allows access to backup (this
- is intentional)
-
-Have Fun!
-
diff --git a/old/LICENSE b/old/LICENSE
deleted file mode 100644
index be7d985..0000000
--- a/old/LICENSE
+++ /dev/null
@@ -1,16 +0,0 @@
-EQdkp
-Copyright (C) 2002-2005 The EQdkp Project Team
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
diff --git a/old/README b/old/README
deleted file mode 100644
index 8ee0c63..0000000
--- a/old/README
+++ /dev/null
@@ -1,121 +0,0 @@
-EQdkp OpenSource DKP
-Copyright (C) 2002-2005 The EQdkp Project Team
-
-Introduction:
--------------
- What is DKP?
- ------------
- DKP, short for Dragon Kill Points, is a concept originally created by Thott of Afterlife.
- These points are awarded to each guild member as they attend a guild raid. The current DKP
- of each member reflects his or her priority for loot. When a member 'wins' an item, they
- lose a DKP amount that reflects the value of that item.
-
- DKP allows for an unbiased comparison between guild members when decisions about loot are to
- be made based on attendance and recent items that have been awarded.
-
- What is EQdkp?
- --------------
- EQdkp is an OpenSource DKP system created out of necessity. Many guilds wanted to use the
- point system but didn't have the means or time or will to create their own set of scripts
- for managing it. The main focus of EQdkp is to make loot distribution as easy as possible for
- guild leaders while still allowing it to be easy to maintain.
-
- EQdkp was originally created with the notion that one closed-source installation of it would
- support many guilds' point systems. It was later changed to an OpenSource orientation so
- that it would much more customizable for each guild.
-
-Contact:
---------
- Bug reports and feature requests should be directed to the SourceForge tracker:
- http://sourceforge.net/projects/eqdkp/
-
- Installation issues, general discussion - just about anything that's not a bug
- report or feature request can be directed to the forums:
- http://forums.eqdkp.com/
-
- If you're using EQdkp, we'd love to hear from you. If you have a moment, post your site in
- the 'Examples' forum.
-
-Donations:
-----------
-
- If you and your guild use and enjoy EQdkp and want to see it continue to be developed, donating
- whatever money you can is a good way to show your appreciation for all of the work that's gone into the
- development and maintenance of the EQdkp project.
-
- Why do you need donations?
- --------------------------
- A lot of time went into creating EQdkp, and still goes into maintaining it by fixing bugs and adding requested
- features - in general, making it better.
-
- In addition to that, hosting fees for EQdkp.com need to be paid on a monthly basis, and donations would help greatly
- with that.
-
- If half of the guilds currently using EQdkp had around half of its members donate 50 cents one time,
- that would probably cover the cost of the EQdkp.com server for one year. Additional money would go
- to the developers of EQdkp for donating their time.
-
- For more information and for instructions on how to donate, please see: http://eqdkp.com/?p=donate
-
-Installation:
--------------
- See the INSTALL file for detailed information.
-
-Licensing:
-----------
- EQdkp is distributed under the GPL. Please read through the files COPYING and LICENSE
- for more information.
-
-Credits:
---------
- DKP Concept: Thott of Afterlife [ www.afterlifeguild.org ]
-
- Developers:
- Rob Speicher [ tsigo@eqdkp.com ]
- Adam Wasserman [ draelon@eqdkp.com ]
- TJ [thundarr@gmail.com]
-
- Translators:
- If you fluently speak a language other than English and want to contribute a language
- pack, please contact tsigo@eqdkp.com
-
- Thanks to Taleth for doing some translation of the WoW information to German.
- http://forums.eqdkp.com/index.php?showtopic=1374
-
- Thanks to Esmeroth for the German SQL for races/classes for EQ2
-
- Thanks:
- SourceForge [ www.sourceforge.net ]
-
- Nathan Codding, Paul Owen and The phpBB Group [ www.phpbb.com ]
- - Template class, Session class foundation
- Chris Monson
- - XMLFile class (deprecated)
- Imex - Developer, EQCPS [ www.akanon.org ]
- - Item and Spell database (EQdkp plugin)
- Zeller, Ansar, and Landiin @ crusadersvalorous.org
- - SOAP class definitions and assistance
- The Beta Test Crew @ forums.eqdkp.com
- - countless bug fixes for the 1.3 release
- - Loopi of Dark Ritual guild (Stormreaver guild, WoW)
-
- Blood of the Spider Guild
- - [ www.drow.org ]
-
- Crusaders Valorous of Tholuxe Paells
- - [ www.crusadersvalorous.org]
- - Ansar and Zeller for the SOAP help
-
- Necessary Evil Guild
- - [ www.wickedintentions.com ]
-
- Science of War Guild
- - [ www.scienceofwar.net ]
- (now known as Precision Strike @ www.precisionstrike.com)
-
-
-
- Robert Brisson
- - 'What is DKP?'
-
- Everyone who reported bugs and posted feature requests at SF, and even discussed EQdkp in the forums.
diff --git a/old/admin/DAoC.php b/old/admin/DAoC.php
deleted file mode 100644
index d8ba544..0000000
--- a/old/admin/DAoC.php
+++ /dev/null
@@ -1,130 +0,0 @@
-<?php
-/******************************
- * EQdkp
- * Copyright 2002-2003
- * Licensed under the GNU GPL. See COPYING for full terms.
- * ------------------
- * DAoC.php
- * Began: Fri May 13 2005
- *
- * $Id: DAoC.php 6 2006-05-08 17:11:35Z tsigo $
- *
- ******************************/
-
-if ( !defined('EQDKP_INC') )
-{
- die('Hacking attempt');
-}
-
-class Manage_Game extends EQdkp_Admin
-{
-
- function do_it()
- {
-
- global $db, $eqdkp, $user;
- global $SID, $dbname, $table_prefix;
-
-
- parent::eqdkp_admin();
-
-
-$queries = array(
-
-"DELETE FROM ". $table_prefix ."classes;",
-"INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type) VALUES (0, 'Unknown', 'Unknown');",
-"INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type) VALUES (1, 'Animist', 'Plate');",
-"INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type) VALUES (2, 'Armsman', 'Plate');",
-"INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type) VALUES (3, 'Bainshee', 'Plate');",
-"INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type) VALUES (4, 'Bard', 'Plate');",
-"INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type) VALUES (5, 'Berserker', 'Plate');",
-"INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type) VALUES (6, 'Blademaster', 'Plate');",
-"INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type) VALUES (7, 'Bonedancer', 'Plate');",
-"INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type) VALUES (8, 'Cabalist', 'Plate');",
-"INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type) VALUES (9, 'Champion', 'Plate');",
-"INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type) VALUES (10, 'Cleric', 'Plate');",
-"INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type) VALUES (11, 'Druid', 'Plate');",
-"INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type) VALUES (12, 'Eldritch', 'Plate');",
-"INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type) VALUES (13, 'Enchanter', 'Plate');",
-"INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type) VALUES (14, 'Friar', 'Plate');",
-"INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type) VALUES (15, 'Healer', 'Plate');",
-"INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type) VALUES (16, 'Heretic', 'Plate');",
-"INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type) VALUES (17, 'Hero', 'Plate');",
-"INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type) VALUES (18, 'Hunter', 'Plate');",
-"INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type) VALUES (19, 'Infiltrator', 'Plate');",
-"INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type) VALUES (20, 'Mentalist', 'Plate');",
-"INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type) VALUES (21, 'Mercenary', 'Plate');",
-"INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type) VALUES (22, 'Minstrel', 'Plate');",
-"INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type) VALUES (23, 'Necromancer', 'Plate');",
-"INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type) VALUES (24, 'Nightshade', 'Plate');",
-"INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type) VALUES (25, 'Paladin', 'Plate');",
-"INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type) VALUES (26, 'Ranger', 'Plate');",
-"INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type) VALUES (27, 'Reaver', 'Plate');",
-"INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type) VALUES (28, 'Runemaster', 'Plate');",
-"INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type) VALUES (29, 'Savage', 'Plate');",
-"INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type) VALUES (30, 'Scout', 'Plate');",
-"INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type) VALUES (31, 'Shadowblade', 'Plate');",
-"INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type) VALUES (32, 'Shaman', 'Plate');",
-"INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type) VALUES (33, 'Skald', 'Plate');",
-"INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type) VALUES (34, 'Sorcerer', 'Plate');",
-"INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type) VALUES (35, 'Spiritmaster', 'Plate');",
-"INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type) VALUES (36, 'Thane', 'Plate');",
-"INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type) VALUES (37, 'Theurgist', 'Plate');",
-"INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type) VALUES (38, 'Valewalker', 'Plate');",
-"INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type) VALUES (39, 'Valkyrie', 'Plate');",
-"INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type) VALUES (40, 'Vampiir', 'Plate');",
-"INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type) VALUES (41, 'Warden', 'Plate');",
-"INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type) VALUES (42, 'Warlock', 'Plate');",
-"INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type) VALUES (43, 'Warrior', 'Plate');",
-"INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type) VALUES (44, 'Wizard', 'Plate');",
-
-"DELETE FROM ". $table_prefix ."races;",
-
-"INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (0, 'Unknown');",
-"INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (1, 'Valonian');",
-"INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (2, 'Briton');",
-"INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (3, 'Half Ogre');",
-"INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (4, 'Highlander');",
-"INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (5, 'Inconnu');",
-"INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (6, 'Saracen');",
-"INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (7, 'Celt');",
-"INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (8, 'Elf');",
-"INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (9, 'Firbolg');",
-"INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (10, 'Lurikeen');",
-"INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (11, 'Shar');",
-"INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (12, 'Sylvan');",
-"INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (13, 'Dwarf');",
-"INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (14, 'Frostalf');",
-"INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (15, 'Kobold');",
-"INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (16, 'Norse');",
-"INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (17, 'Troll');",
-"INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (18, 'Valkyn');",
-
-"DELETE FROM ". $table_prefix ."factions;",
-
-"INSERT INTO ". $table_prefix ."factions (faction_id, faction_name) VALUES (1, 'Albion');",
-"INSERT INTO ". $table_prefix ."factions (faction_id, faction_name) VALUES (2, 'Hibernia');",
-"INSERT INTO ". $table_prefix ."factions (faction_id, faction_name) VALUES (3, 'Midgard');",
-
-);
-
-
- foreach ( $queries as $sql )
- {
- $db->query($sql);
- }
-
-
- $redir = "admin/config.php";
- redirect($redir);
-
- }
-
-}
-
-$manage = new Manage_Game;
-$manage->do_it();
-
-
-?>
-
diff --git a/old/admin/Everquest.php b/old/admin/Everquest.php
deleted file mode 100644
index 3d0665d..0000000
--- a/old/admin/Everquest.php
+++ /dev/null
@@ -1,99 +0,0 @@
-<?php
-/******************************
- * EQdkp
- * Copyright 2002-2003
- * Licensed under the GNU GPL. See COPYING for full terms.
- * ------------------
- * Everquest.php
- * Began: Fri May 13 2005
- *
- * $Id: Everquest.php 6 2006-05-08 17:11:35Z tsigo $
- *
- ******************************/
-
-if ( !defined('EQDKP_INC') )
-{
- die('Hacking attempt');
-}
-
-
-
-class Manage_Game extends EQdkp_Admin
-{
-
- function do_it()
- {
-
- global $db, $eqdkp, $user;
- global $SID, $dbname, $table_prefix;
-
- parent::eqdkp_admin();
-
- $queries = array(
-
- "DELETE FROM ". $table_prefix ."classes;",
- "ALTER TABLE " . $table_prefix . "members MODIFY member_level tinyint(2) NOT NULL default '70';",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type) VALUES (0, 'Unknown', 'Plate');",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type) VALUES (1, 'Warrior', 'Plate');",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type) VALUES (2, 'Rogue', 'Chain');",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type) VALUES (3, 'Monk', 'Leather');",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type) VALUES (4, 'Ranger', 'Chain');",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type) VALUES (5, 'Paladin', 'Plate');",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type) VALUES (6, 'Shadow Knight', 'Plate');",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type) VALUES (7, 'Bard', 'Plate');",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type) VALUES (8, 'Beastlord', 'Leather');",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type) VALUES (9, 'Cleric', 'Plate');",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type) VALUES (10, 'Druid', 'Leather');",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type) VALUES (11, 'Shaman', 'Chain');",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type) VALUES (12, 'Enchanter', 'Silk');",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type) VALUES (13, 'Wizard', 'Silk');",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type) VALUES (14, 'Necromancer', 'Silk');",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type) VALUES (15, 'Magician', 'Silk');",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type) VALUES (16, 'Berserker', 'Leather');",
-
- "DELETE FROM ". $table_prefix ."races;",
-
- "INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (0, 'Unknown');",
- "INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (1, 'Gnome');",
- "INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (2, 'Human');",
- "INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (3, 'Barbarian');",
- "INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (4, 'Dwarf');",
- "INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (5, 'High Elf');",
- "INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (6, 'Dark Elf');",
- "INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (7, 'Wood Elf');",
- "INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (8, 'Half Elf');",
- "INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (9, 'Vah Shir');",
- "INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (10, 'Troll');",
- "INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (11, 'Ogre');",
- "INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (12, 'Frog');",
- "INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (13, 'Iksar');",
- "INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (14, 'Erudite');",
- "INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (15, 'Halfling');",
-
- "DELETE FROM ". $table_prefix ."factions;",
-
- "INSERT INTO ". $table_prefix ."factions (faction_id, faction_name) VALUES (1, 'Good');",
- "INSERT INTO ". $table_prefix ."factions (faction_id, faction_name) VALUES (2, 'Evil');",
-
-
- );
-
-
- foreach ( $queries as $sql )
- {
- $db->query($sql);
- }
-
- $redir = "admin/config.php";
- redirect($redir);
-
- }
-
-}
-
-
-$manage = new Manage_Game;
-$manage->do_it();
-
-
-?>
diff --git a/old/admin/Everquest2-german.sql b/old/admin/Everquest2-german.sql
deleted file mode 100644
index f0679e7..0000000
--- a/old/admin/Everquest2-german.sql
+++ /dev/null
@@ -1,131 +0,0 @@
--- phpMyAdmin SQL Dump
--- version 2.6.0-beta3
--- http://www.phpmyadmin.net
---
--- Host: localhost
--- Erstellungszeit: 28. Juli 2005 um 01:28
--- Server Version: 4.0.18
--- PHP-Version: 4.3.4
---
--- Datenbank: `db0`
---
--- Use this for EQdkp 1.3.0 if you are German and using EQ2.
--- The nice WoW folks actually made a install script like
--- the others, but for this one you'll need to manually
--- change your database
---
-
--- --------------------------------------------------------
-
---
--- Tabellenstruktur für Tabelle `eqdkp_classes`
---
-
-DROP TABLE IF EXISTS `eqdkp_classes`;
-CREATE TABLE IF NOT EXISTS `eqdkp_classes` (
- `c_index` smallint(3) unsigned NOT NULL auto_increment,
- `class_id` smallint(3) unsigned NOT NULL default '0',
- `class_name` varchar(50) NOT NULL default '',
- `class_min_level` smallint(3) NOT NULL default '0',
- `class_max_level` smallint(3) NOT NULL default '999',
- `class_armor_type` varchar(50) NOT NULL default '',
- `class_hide` enum('0','1') NOT NULL default '0',
- PRIMARY KEY (`c_index`)
-) TYPE=MyISAM;
-
---
--- Daten für Tabelle `eqdkp_classes`
---
-
-INSERT INTO `eqdkp_classes` (`c_index`, `class_id`, `class_name`, `class_min_level`, `class_max_level`, `class_armor_type`, `class_hide`) VALUES (18, 0, 'Unknown', 1, 99, 'Heavy', '0'),
-(19, 1, 'Kämpfer', 1, 9, 'Heavy', '0'),
-(20, 2, 'Kundschafter', 1, 9, 'Medium', '0'),
-(21, 3, 'Magier', 1, 9, 'VeryLight', '0'),
-(22, 4, 'Priester', 1, 9, 'Heavy', '0'),
-(23, 5, 'Krieger', 10, 19, 'Heavy', '0'),
-(24, 6, 'Kreuzritter', 10, 19, 'Heavy', '0'),
-(25, 7, 'Schläger', 10, 19, 'Light', '0'),
-(26, 8, 'Raufbold', 20, 99, 'Light', '0'),
-(27, 9, 'Mönch', 20, 99, 'Light', '0'),
-(28, 10, 'Berserker', 20, 99, 'Heavy', '0'),
-(29, 11, 'Wächter', 20, 99, 'Heavy', '0'),
-(30, 12, 'Paladin', 20, 99, 'Heavy', '0'),
-(31, 13, 'Schattenritter', 20, 99, 'Heavy', '0'),
-(32, 14, 'Thaumaturge', 10, 19, 'VeryLight', '0'),
-(33, 15, 'Hexer', 10, 19, 'VeryLight', '0'),
-(34, 16, 'Beschwörer', 10, 19, 'VeryLight', '0'),
-(35, 17, 'Illusionist', 20, 99, 'VeryLight', '0'),
-(36, 18, 'Erzwinger', 20, 99, 'VeryLight', '0'),
-(37, 19, 'Zauberer', 20, 99, 'VeryLight', '0'),
-(38, 20, 'Hexenmeister', 20, 99, 'VeryLight', '0'),
-(39, 21, 'Nekromant', 20, 99, 'VeryLight', '0'),
-(40, 22, 'Elementalist', 20, 99, 'VeryLight', '0'),
-(41, 23, 'Kleriker', 10, 19, 'Heavy', '0'),
-(42, 24, 'Druide', 10, 19, 'Light', '0'),
-(43, 25, 'Schamane', 10, 19, 'Medium', '0'),
-(44, 26, 'Templer', 20, 99, 'Heavy', '0'),
-(45, 27, 'Inquisitor', 20, 99, 'Heavy', '0'),
-(46, 28, 'Wärter', 20, 99, 'Light', '0'),
-(47, 29, 'Furie', 20, 99, 'Light', '0'),
-(48, 30, 'Schänder', 20, 99, 'Medium', '0'),
-(49, 31, 'Mystiker', 20, 99, 'Medium', '0'),
-(50, 32, 'Dieb', 10, 19, 'Medium', '0'),
-(51, 33, 'Barde', 10, 19, 'Medium', '0'),
-(52, 34, 'Raubtier', 10, 19, 'Medium', '0'),
-(53, 35, 'Abenteurer', 20, 99, 'Medium', '0'),
-(54, 36, 'Brigand', 20, 99, 'Medium', '0'),
-(55, 37, 'Klagesänger', 20, 99, 'Medium', '0'),
-(56, 38, 'Troubadour', 20, 99, 'Medium', '0'),
-(57, 39, 'Assassine', 20, 99, 'Medium', '0'),
-(58, 40, 'Waldläufer', 20, 99, 'Medium', '0'),
-(59, 41, 'Craftsmen', 1, 99, 'Heavy', '0'),
-(60, 42, 'Scholar', 1, 99, 'Heavy', '0'),
-(61, 43, 'Outfitter', 1, 99, 'Heavy', '0'),
-(62, 44, 'Provisioner', 1, 99, 'Heavy', '0'),
-(63, 45, 'Woodworker', 1, 99, 'Heavy', '0'),
-(64, 46, 'Carpenter', 1, 99, 'Heavy', '0'),
-(65, 47, 'Armorer', 1, 99, 'Heavy', '0'),
-(66, 48, 'Weaponsmith', 1, 99, 'Heavy', '0'),
-(67, 49, 'Tailor', 1, 99, 'Heavy', '0'),
-(68, 50, 'Jeweler', 1, 99, 'Heavy', '0'),
-(69, 51, 'Sage', 1, 99, 'Heavy', '0'),
-(70, 52, 'Alchemist', 1, 99, 'Heavy', '0');
-
--- --------------------------------------------------------
-
---
--- Tabellenstruktur für Tabelle `eqdkp_races`
---
-
-DROP TABLE IF EXISTS `eqdkp_races`;
-CREATE TABLE IF NOT EXISTS `eqdkp_races` (
- `race_id` smallint(3) unsigned NOT NULL default '0',
- `race_name` varchar(50) NOT NULL default '',
- `race_faction_id` smallint(3) NOT NULL default '0',
- `race_hide` enum('0','1') NOT NULL default '0',
- PRIMARY KEY (`race_id`),
- UNIQUE KEY `race_id` (`race_id`)
-) TYPE=MyISAM;
-
---
--- Daten für Tabelle `eqdkp2_races`
---
-
-INSERT INTO `eqdkp_races` (`race_id`, `race_name`, `race_faction_id`, `race_hide`) VALUES (0, 'Unknown', 0, '0'),
-(1, 'Gnom', 0, '0'),
-(2, 'Mensch', 0, '0'),
-(3, 'Barbar', 0, '0'),
-(4, 'Zwerg', 0, '0'),
-(5, 'Hochelf', 0, '0'),
-(6, 'Dunkelelf', 0, '0'),
-(7, 'Waldelf', 0, '0'),
-(8, 'Halbelf', 0, '0'),
-(9, 'Kerraner', 0, '0'),
-(10, 'Troll', 0, '0'),
-(11, 'Oger', 0, '0'),
-(12, 'Froschlog', 0, '0'),
-(13, 'Erudit', 0, '0'),
-(14, 'Iksar', 0, '0'),
-(15, 'Ratonga', 0, '0'),
-(16, 'Halbling', 0, '0');
-
diff --git a/old/admin/Everquest2.php b/old/admin/Everquest2.php
deleted file mode 100644
index 8755cde..0000000
--- a/old/admin/Everquest2.php
+++ /dev/null
@@ -1,141 +0,0 @@
-<?php
-/******************************
- * EQdkp
- * Copyright 2002-2003
- * Licensed under the GNU GPL. See COPYING for full terms.
- * ------------------
- * Everquest2.php
- * Began: Fri May 13 2005
- *
- * $Id: Everquest2.php 6 2006-05-08 17:11:35Z tsigo $
- *
- ******************************/
-
-if ( !defined('EQDKP_INC') )
-{
- die('Hacking attempt');
-}
-
-class Manage_Game extends EQdkp_Admin
-{
-
- function do_it()
- {
-
- global $db, $eqdkp, $user;
- global $SID, $dbname, $table_prefix;
-
-
- parent::eqdkp_admin();
-
- $queries = array(
- "UPDATE " . $table_prefix . "members SET member_level = 50 WHERE member_level > 50;",
- "ALTER TABLE " . $table_prefix . "members MODIFY member_level tinyint(2) NOT NULL default '50';",
- "DELETE FROM ". $table_prefix ."classes;",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (0, 'Unknown', 'Heavy',1,99);",
-
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (1, 'Fighter', 'Heavy',1,9);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (2, 'Scout', 'Medium',1,9);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (3, 'Mage', 'VeryLight',1,9);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (4, 'Priest', 'Heavy',1,9);",
-
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (5, 'Warrior', 'Heavy',10,19);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (6, 'Crusader', 'Heavy',10,19);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (7, 'Brawler', 'Light',10,19);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (8, 'Bruiser', 'Light',20,99);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (9, 'Monk', 'Light',20,99);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (10, 'Berserker', 'Heavy',20,99);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (11, 'Guardian', 'Heavy',20,99);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (12, 'Paladin', 'Heavy',20,99);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (13, 'Shadowknight', 'Heavy',20,99);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (14, 'Enchanter', 'VeryLight',10,19);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (15, 'Sorcerer', 'VeryLight',10,19);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (16, 'Summoner', 'VeryLight',10,19);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (17, 'Illusionist', 'VeryLight',20,99);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (18, 'Coercer', 'VeryLight',20,99);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (19, 'Wizard', 'VeryLight',20,99);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (20, 'Warlock', 'VeryLight',20,99);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (21, 'Necromancer', 'VeryLight',20,99);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (22, 'Conjuror', 'VeryLight',20,99);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (23, 'Cleric', 'Heavy',10,19);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (24, 'Druid', 'Light',10,19);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (25, 'Shaman', 'Medium',10,19);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (26, 'Templar', 'Heavy',20,99);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (27, 'Inquisitor', 'Heavy',20,99);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (28, 'Warden', 'Light',20,99);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (29, 'Fury', 'Light',20,99);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (30, 'Defiler', 'Medium',20,99);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (31, 'Mystic', 'Medium',20,99);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (32, 'Rogue', 'Medium',10,19);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (33, 'Bard', 'Medium',10,19);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (34, 'Predator', 'Medium',10,19);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (35, 'Swashbuckler', 'Medium',20,99);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (36, 'Brigand', 'Medium',20,99);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (37, 'Dirge', 'Medium',20,99);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (38, 'Troubador', 'Medium',20,99);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (39, 'Assassin', 'Medium',20,99);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (40, 'Ranger', 'Medium',20,99);",
-
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (41, 'Craftsmen', 'Heavy',1,99);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (42, 'Scholar', 'Heavy',1,99);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (43, 'Outfitter', 'Heavy',1,99);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (44, 'Provisioner', 'Heavy',1,99);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (45, 'Woodworker', 'Heavy',1,99);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (46, 'Carpenter', 'Heavy',1,99);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (47, 'Armorer', 'Heavy',1,99);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (48, 'Weaponsmith', 'Heavy',1,99);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (49, 'Tailor', 'Heavy',1,99);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (50, 'Jeweler', 'Heavy',1,99);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (51, 'Sage', 'Heavy',1,99);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (52, 'Alchemist', 'Heavy',1,99);",
-
-
- "DELETE FROM ". $table_prefix ."races;",
-
- "INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (0, 'Unknown');",
- "INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (1, 'Gnome');",
- "INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (2, 'Human');",
- "INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (3, 'Barbarian');",
- "INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (4, 'Dwarf');",
- "INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (5, 'High Elf');",
- "INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (6, 'Dark Elf');",
- "INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (7, 'Wood Elf');",
- "INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (8, 'Half Elf');",
- "INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (9, 'Kerra');",
- "INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (10, 'Troll');",
- "INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (11, 'Ogre');",
- "INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (12, 'Frog');",
- "INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (13, 'Erudite');",
- "INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (14, 'Iksar');",
- "INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (15, 'Ratonga');",
- "INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (16, 'Halfling');",
-
- "DELETE FROM ". $table_prefix ."factions;",
-
- "INSERT INTO ". $table_prefix ."factions (faction_id, faction_name) VALUES (1, 'Good');",
- "INSERT INTO ". $table_prefix ."factions (faction_id, faction_name) VALUES (2, 'Evil');",
- "INSERT INTO ". $table_prefix ."factions (faction_id, faction_name) VALUES (3, 'Neutral');",
-
-
-
- );
-
-
- foreach ( $queries as $sql )
- {
- $db->query($sql);
- }
-
-
- $redir = "admin/config.php";
- redirect($redir);
-
- }
-
-}
-
-$manage = new Manage_Game;
-$manage->do_it();
-
-
-?>
diff --git a/old/admin/WoW-english.php b/old/admin/WoW-english.php
deleted file mode 100644
index 436b35f..0000000
--- a/old/admin/WoW-english.php
+++ /dev/null
@@ -1,92 +0,0 @@
-<?php
-/******************************
- * EQdkp
- * Copyright 2002-2003
- * Licensed under the GNU GPL. See COPYING for full terms.
- * ------------------
- * WoW.php
- * Began: Fri May 13 2005
- *
- * $Id: WoW-english.php 8 2006-05-08 17:15:20Z tsigo $
- *
- ******************************/
-
-if ( !defined('EQDKP_INC') )
-{
- die('Hacking attempt');
-}
-
-class Manage_Game extends EQdkp_Admin
-{
-
- function do_it()
- {
-
-
- global $db, $eqdkp, $user;
- global $SID, $dbname, $table_prefix;
-
-
- parent::eqdkp_admin();
-
- $queries = array(
-
- "DELETE FROM ". $table_prefix ."classes;",
-
- "UPDATE " . $table_prefix . "members SET member_level = 60 WHERE member_level >60;",
-
- "ALTER TABLE " . $table_prefix . "members MODIFY member_level tinyint(2) NOT NULL default '60';",
-
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (0, 'Unknown', 'Plate',0,60);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (1, 'Warrior', 'Mail',0,39);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (2, 'Rogue', 'Leather',0,60);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (3, 'Hunter', 'Leather',0,39);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (4, 'Hunter', 'Mail',40,60);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (5, 'Paladin', 'Mail',0,39);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (6, 'Priest', 'Silk',0,60);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (7, 'Druid', 'Leather',0,60);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (8, 'Shaman', 'Leather',0,39);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (9, 'Shaman', 'Mail',40,60);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (10, 'Warlock', 'Silk',0,60);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (11, 'Mage', 'Silk',0,60);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (12, 'Warrior', 'Plate',40,60);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (13, 'Paladin', 'Plate',40,60);",
-
- "DELETE FROM ". $table_prefix ."races;",
- "INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (0, 'Unknown');",
- "INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (1, 'Gnome');",
- "INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (2, 'Human');",
- "INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (3, 'Dwarf');",
- "INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (4, 'Night Elf');",
- "INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (5, 'Troll');",
- "INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (6, 'Undead');",
- "INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (7, 'Orc');",
- "INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (8, 'Tauren');",
-
- "DELETE FROM ". $table_prefix ."factions;",
- "INSERT INTO ". $table_prefix ."factions (faction_id, faction_name) VALUES (1, 'Alliance');",
- "INSERT INTO ". $table_prefix ."factions (faction_id, faction_name) VALUES (2, 'Horde');",
-
- "UPDATE ". $table_prefix ."config SET config_value = 'WoW' WHERE config_name = 'default_game';",
-
- );
-
-
- foreach ( $queries as $sql )
- {
- $db->query($sql);
- }
-
-
- $redir = "admin/config.php";
- redirect($redir);
-
- }
-
-}
-
-$manage = new Manage_Game;
-$manage->do_it();
-
-
-?>
diff --git a/old/admin/WoW-german.php b/old/admin/WoW-german.php
deleted file mode 100644
index 1e87ec2..0000000
--- a/old/admin/WoW-german.php
+++ /dev/null
@@ -1,64 +0,0 @@
-<?php
-/******************************
- * EQdkp
- * Copyright 2002-2003
- * Licensed under the GNU GPL. See COPYING for full terms.
- * ------------------
- * WoW.php
- * Began: Fri May 13 2005
- *
- * $Id: WoW-german.php 6 2006-05-08 17:11:35Z tsigo $
- *
- ******************************/
-if ( !defined('EQDKP_INC') )
-{
- die('Hacking attempt');
-}
-class Manage_Game extends EQdkp_Admin
-{
- function do_it()
- {
- global $db, $eqdkp, $user;
- global $SID, $dbname, $table_prefix;
- parent::eqdkp_admin();
- $queries = array(
- "DELETE FROM ". $table_prefix ."classes;",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (0, 'Unknown', 'Platte',0,60);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (1, 'Krieger', 'Platte',0,60);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (2, 'Schurke', 'Leder',0,60);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (3, 'Jäger', 'Leder',0,39);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (4, 'Jäger', 'Schwere Rüstung',40,60);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (5, 'Paladin', 'Platte',0,60);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (6, 'Priester', 'Stoff',0,60);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (7, 'Druide', 'Stoff',0,60);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (8, 'Schamane', 'Leder',0,39);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (9, 'Schamane', 'Schwere Rüstung',40,60);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (10, 'Hexenmeister', 'Stoff',0,60);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (11, 'Magier', 'Stoff',0,60);",
- "DELETE FROM ". $table_prefix ."races;",
- "INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (0, 'Unknown');",
- "INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (1, 'Gnom');",
- "INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (2, 'Mensch');",
- "INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (3, 'Zwerg');",
- "INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (4, 'Nachtelf');",
- "INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (5, 'Troll');",
- "INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (6, 'Untoter');",
- "INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (7, 'Ork');",
- "INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (8, 'Taure');",
- "DELETE FROM ". $table_prefix ."factions;",
- "INSERT INTO ". $table_prefix ."factions (faction_id, faction_name) VALUES (1, 'Allianz');",
- "INSERT INTO ". $table_prefix ."factions (faction_id, faction_name) VALUES (2, 'Horde');",
- "UPDATE ". $table_prefix ."config SET (config_value = 'WoW') WHERE (config_name = 'default_game');",
- );
- foreach ( $queries as $sql )
- {
- $db->query($sql);
- }
- $redir = "admin/config.php";
- redirect($redir);
- }
-}
-$manage = new Manage_Game;
-$manage->do_it();
-
-?>
diff --git a/old/admin/WoW.php b/old/admin/WoW.php
deleted file mode 100644
index afb34f9..0000000
--- a/old/admin/WoW.php
+++ /dev/null
@@ -1,92 +0,0 @@
-<?php
-/******************************
- * EQdkp
- * Copyright 2002-2003
- * Licensed under the GNU GPL. See COPYING for full terms.
- * ------------------
- * WoW.php
- * Began: Fri May 13 2005
- *
- * $Id: WoW.php 8 2006-05-08 17:15:20Z tsigo $
- *
- ******************************/
-
-if ( !defined('EQDKP_INC') )
-{
- die('Hacking attempt');
-}
-
-class Manage_Game extends EQdkp_Admin
-{
-
- function do_it()
- {
-
-
- global $db, $eqdkp, $user;
- global $SID, $dbname, $table_prefix;
-
-
- parent::eqdkp_admin();
-
- $queries = array(
-
- "DELETE FROM ". $table_prefix ."classes;",
-
- "UPDATE " . $table_prefix . "members SET member_level = 60 WHERE member_level > 60;",
-
- "ALTER TABLE " . $table_prefix . "members MODIFY member_level tinyint(2) NOT NULL default '60';",
-
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (0, 'Unknown', 'Plate',0,60);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (1, 'Warrior', 'Mail',0,39);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (2, 'Rogue', 'Leather',0,60);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (3, 'Hunter', 'Leather',0,39);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (4, 'Hunter', 'Mail',40,60);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (5, 'Paladin', 'Mail',0,39);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (6, 'Priest', 'Cloth',0,60);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (7, 'Druid', 'Leather',0,60);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (8, 'Shaman', 'Leather',0,39);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (9, 'Shaman', 'Mail',40,60);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (10, 'Warlock', 'Cloth',0,60);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (11, 'Mage', 'Cloth',0,60);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (12, 'Warrior', 'Plate',40,60);",
- "INSERT INTO ". $table_prefix ."classes (class_id, class_name, class_armor_type, class_min_level, class_max_level) VALUES (13, 'Paladin', 'Plate',40,60);",
-
- "DELETE FROM ". $table_prefix ."races;",
- "INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (0, 'Unknown');",
- "INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (1, 'Gnome');",
- "INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (2, 'Human');",
- "INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (3, 'Dwarf');",
- "INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (4, 'Night Elf');",
- "INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (5, 'Troll');",
- "INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (6, 'Undead');",
- "INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (7, 'Orc');",
- "INSERT INTO ". $table_prefix ."races (race_id, race_name) VALUES (8, 'Tauren');",
-
- "DELETE FROM ". $table_prefix ."factions;",
- "INSERT INTO ". $table_prefix ."factions (faction_id, faction_name) VALUES (1, 'Alliance');",
- "INSERT INTO ". $table_prefix ."factions (faction_id, faction_name) VALUES (2, 'Horde');",
-
- "UPDATE ". $table_prefix ."config SET config_value = 'WoW' WHERE config_name = 'default_game';",
-
- );
-
-
- foreach ( $queries as $sql )
- {
- $db->query($sql);
- }
-
-
- $redir = "admin/config.php";
- redirect($redir);
-
- }
-
-}
-
-$manage = new Manage_Game;
-$manage->do_it();
-
-
-?>
diff --git a/old/admin/addadj.php b/old/admin/addadj.php
deleted file mode 100644
index 81c0561..0000000
--- a/old/admin/addadj.php
+++ /dev/null
@@ -1,330 +0,0 @@
-<?php
-/******************************
- * EQdkp
- * Copyright 2002-2003
- * Licensed under the GNU GPL. See COPYING for full terms.
- * ------------------
- * addadj.php
- * Began: Sat January 4 2003
- *
- * $Id: addadj.php 46 2007-06-19 07:29:11Z tsigo $
- *
- ******************************/
-
-define('EQDKP_INC', true);
-define('IN_ADMIN', true);
-$eqdkp_root_path = './../';
-include_once($eqdkp_root_path . 'common.php');
-
-class Add_GroupAdj extends EQdkp_Admin
-{
- var $adjustment = array(); // Holds adjustment data if URI_ADJUSTMENT is set @var adjustment
- var $old_adjustment = array(); // Holds adjustment data from before POST @var old_adjustment
-
- function add_groupadj()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $eqdkp_root_path;
-
- parent::eqdkp_admin();
-
- $this->adjustment = array(
- 'adjustment_value' => post_or_db('adjustment_value')
- );
-
- // Vars used to confirm deletion
- $this->set_vars(array(
- 'confirm_text' => $user->lang['confirm_delete_adj'],
- 'uri_parameter' => URI_ADJUSTMENT)
- );
-
- $this->assoc_buttons(array(
- 'add' => array(
- 'name' => 'add',
- 'process' => 'process_add',
- 'check' => 'a_groupadj_add'),
- 'update' => array(
- 'name' => 'update',
- 'process' => 'process_update',
- 'check' => 'a_groupadj_upd'),
- 'delete' => array(
- 'name' => 'delete',
- 'process' => 'process_delete',
- 'check' => 'a_groupadj_del'),
- 'form' => array(
- 'name' => '',
- 'process' => 'display_form',
- 'check' => 'a_groupadj_'))
- );
-
- // Build the adjustment aray
- // -----------------------------------------------------
- if ( $this->url_id )
- {
- $sql = 'SELECT adjustment_value, member_name
- FROM ' . ADJUSTMENTS_TABLE . "
- WHERE adjustment_id='".$this->url_id."'";
- $result = $db->query($sql);
- if ( !$row = $db->fetch_record($result) )
- {
- message_die($user->lang['error_invalid_adjustment']);
- }
- $db->free_result($result);
-
- // If member name is set, it's an individual adjustment - put them back on that script
- if ( isset($row['member_name']) )
- {
- redirect('addiadj.php' . $SID . '&' . URI_ADJUSTMENT . '='.$this->url_id);
- }
-
- $this->adjustment = array(
- 'adjustment_value' => post_or_db('adjustment_value', $row)
- );
- }
- }
-
- function error_check()
- {
- global $user;
-
- if ( sizeof($_POST) > 0 )
- {
- $this->fv->is_number('adjustment_value', $user->lang['fv_number_adjustment']);
- $this->fv->is_filled('adjustment_value', $user->lang['fv_required_adjustment']);
- }
-
- return $this->fv->is_error();
- }
-
- // ---------------------------------------------------------
- // Process Add
- // ---------------------------------------------------------
- function process_add()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $eqdkp_root_path, $SID;
-
- //
- // Change member's adjustment column
- //
- $sql = 'UPDATE ' . MEMBERS_TABLE . '
- SET member_adjustment = member_adjustment + ' . $db->escape($_POST['adjustment_value']);
- $db->query($sql);
-
- //
- // Insert adjustment
- //
- $query = $db->build_query('INSERT', array(
- 'adjustment_value' => $_POST['adjustment_value'],
- 'adjustment_date' => $this->time,
- 'adjustment_added_by' => $this->admin_user)
- );
- $db->query('INSERT INTO ' . ADJUSTMENTS_TABLE . $query);
- $this_adjustment_id = $db->insert_id();
-
- //
- // Logging
- //
- $log_action = array(
- 'header' => '{L_ACTION_GROUPADJ_ADDED}',
- 'id' => $this_adjustment_id,
- '{L_ADJUSTMENT}' => $_POST['adjustment_value'],
- '{L_ADDED_BY}' => $this->admin_user);
- $this->log_insert(array(
- 'log_type' => $log_action['header'],
- 'log_action' => $log_action)
- );
-
- //
- // Success message
- //
- $success_message = sprintf($user->lang['admin_add_adj_success'], $eqdkp->config['dkp_name'], $_POST['adjustment_value']);
- $link_list = array(
- $user->lang['list_groupadj'] => 'listadj.php' . $SID,
- $user->lang['list_members'] => $eqdkp_root_path . 'listmembers.php' . $SID);
- $this->admin_die($success_message, $link_list);
- }
-
- // ---------------------------------------------------------
- // Process Update
- // ---------------------------------------------------------
- function process_update()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $eqdkp_root_path, $SID;
-
- //
- // Get the old data
- //
- $this->get_old_data();
-
- //
- // Remove the old adjustment from members that received it
- // If their first raid was before/on the adjustment date, then they
- // would have received a group adjustment
- //
- $sql = 'UPDATE ' . MEMBERS_TABLE . '
- SET member_adjustment = member_adjustment - ' . $this->old_adjustment['adjustment_value'] . '
- WHERE member_firstraid <= ' . $this->old_adjustment['adjustment_date'];
- $db->query($sql);
-
- //
- // Add the new adjustment
- //
- $sql = 'UPDATE ' . MEMBERS_TABLE . '
- SET member_adjustment = member_adjustment + ' . $db->escape($_POST['adjustment_value']);
- $db->query($sql);
-
- //
- // Update the adjustment table
- //
- $query = $db->build_query('UPDATE', array(
- 'adjustment_value' => $_POST['adjustment_value'],
- 'adjustment_updated_by' => $this->admin_user)
- );
- $sql = 'UPDATE ' . ADJUSTMENTS_TABLE . ' SET ' . $query . " WHERE adjustment_id='" . $this->url_id . "'";
- $db->query($sql);
-
- //
- // Logging
- //
- $log_action = array(
- 'header' => '{L_ACTION_GROUPADJ_UPDATED}',
- 'id' => $this->url_id,
- '{L_ADJUSTMENT_BEFORE}' => $this->old_adjustment['adjustment_value'],
- '{L_ADJUSTMENT_AFTER}' => $this->find_difference($this->old_adjustment['adjustment_value'], $_POST['adjustment_value']),
- '{L_UPDATED_BY}' => $this->admin_user);
- $this->log_insert(array(
- 'log_type' => $log_action['header'],
- 'log_action' => $log_action)
- );
-
- //
- // Success message
- //
- $success_message = sprintf($user->lang['admin_update_adj_success'], $eqdkp->config['dkp_name'], $_POST['adjustment_value']);
- $link_list = array(
- $user->lang['list_groupadj'] => 'listadj.php' . $SID,
- $user->lang['list_members'] => $eqdkp_root_path . 'listmembers.php' . $SID);
- $this->admin_die($success_message, $link_list);
- }
-
- // ---------------------------------------------------------
- // Process Delete (confirmed)
- // ---------------------------------------------------------
- function process_confirm()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $eqdkp_root_path, $SID;
-
- //
- // Get the old data
- //
- $this->get_old_data();
-
- //
- // Remove the old adjustment from members that received it
- // If their first raid was before/on the adjustment date, then they
- // would have received a group adjustment
- //
- $sql = 'UPDATE ' . MEMBERS_TABLE . '
- SET member_adjustment = member_adjustment - ' . $this->old_adjustment['adjustment_value'] . '
- WHERE member_firstraid <= ' . $this->old_adjustment['adjustment_date'];
- $db->query($sql);
-
- //
- // Remove the adjustment from members
- //
- $sql = 'DELETE FROM ' . ADJUSTMENTS_TABLE . "
- WHERE adjustment_id = '" . $this->url_id . "'";
- $db->query($sql);
-
- //
- // Logging
- //
- $log_action = array(
- 'header' => '{L_ACTION_GROUPADJ_DELETED}',
- 'id' => $this->url_id,
- '{L_ADJUSTMENT}' => $this->old_adjustment['adjustment_value']);
- $this->log_insert(array(
- 'log_type' => $log_action['header'],
- 'log_action' => $log_action)
- );
-
- //
- // Success message
- //
- $success_message = sprintf($user->lang['admin_delete_adj_success'], $eqdkp->config['dkp_name'], $this->old_adjustment['adjustment_value']);
- $link_list = array(
- $user->lang['list_groupadj'] => 'listadj.php' . $SID,
- $user->lang['list_members'] => $eqdkp_root_path . 'listmembers.php' . $SID);
- $this->admin_die($success_message, $link_list);
- }
-
- // ---------------------------------------------------------
- // Process helper methods
- // ---------------------------------------------------------
- function get_old_data()
- {
- global $db;
-
- $sql = 'SELECT adjustment_value, adjustment_date
- FROM ' . ADJUSTMENTS_TABLE . "
- WHERE adjustment_id='" . $this->url_id . "'";
- $result = $db->query($sql);
- while ( $row = $db->fetch_record($result) )
- {
- $this->old_adjustment = array(
- 'adjustment_value' => addslashes($row['adjustment_value']),
- 'adjustment_date' => addslashes($row['adjustment_date'])
- );
- }
- $db->free_result($result);
- }
-
- // ---------------------------------------------------------
- // Display form
- // ---------------------------------------------------------
- function display_form()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $eqdkp_root_path, $SID;
-
- $tpl->assign_vars(array(
- // Form vars
- 'F_ADD_ADJUSTMENT' => 'addadj.php' . $SID,
- 'ADJUSTMENT_ID' => $this->url_id,
-
- // Form values
- 'ADJUSTMENT' => $this->adjustment['adjustment_value'],
-
- // Language
- 'L_ADD_ADJ_TITLE' => $user->lang['addadj_title'],
- 'L_ADJUSTMENT_VALUE' => $user->lang['adjustment_value'],
- 'L_ADJUSTMENT_VALUE_NOTE' => '(' . strtolower($user->lang['adjustment_value_note']) . ')',
- 'L_ADD_ADJUSTMENT' => $user->lang['add_adjustment'],
- 'L_RESET' => $user->lang['reset'],
- 'L_UPDATE_ADJUSTMENT' => $user->lang['update_adjustment'],
- 'L_DELETE_ADJUSTMENT' => $user->lang['delete_adjustment'],
-
- // Form validation
- 'FV_ADJUSTMENT' => $this->fv->generate_error('adjustment_value'),
-
- // Javascript messages
- 'MSG_VALUE_EMPTY' => $user->lang['fv_required_adjustment'],
-
- // Buttons
- 'S_ADD' => ( !$this->url_id ) ? true : false)
- );
-
- $eqdkp->set_vars(array(
- 'page_title' => sprintf($user->lang['admin_title_prefix'], $eqdkp->config['guildtag'], $eqdkp->config['dkp_name']).': '.$user->lang['addadj_title'],
- 'template_file' => 'admin/addadj.html',
- 'display' => true)
- );
- }
-}
-
-$add_groupadj = new Add_GroupAdj;
-$add_groupadj->process();
-?>
diff --git a/old/admin/addevent.php b/old/admin/addevent.php
deleted file mode 100644
index b69c1d8..0000000
--- a/old/admin/addevent.php
+++ /dev/null
@@ -1,338 +0,0 @@
-<?php
-/******************************
- * EQdkp
- * Copyright 2002-2003
- * Licensed under the GNU GPL. See COPYING for full terms.
- * ------------------
- * addevent.php
- * Began: Mon December 30 2002
- *
- * $Id: addevent.php 46 2007-06-19 07:29:11Z tsigo $
- *
- ******************************/
-
-define('EQDKP_INC', true);
-define('IN_ADMIN', true);
-$eqdkp_root_path = './../';
-include_once($eqdkp_root_path . 'common.php');
-
-class Add_Event extends EQdkp_Admin
-{
- var $event = array(); // Holds event data if URI_EVENT Is set @var event
- var $old_event = array(); // Holds event data from before POST @var old_event
-
- function add_event()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $eqdkp_root_path;
-
- parent::eqdkp_admin();
-
- $this->event = array(
- 'event_name' => post_or_db('event_name'),
- 'event_value' => post_or_db('event_value')
- );
-
- // Vars used to confirm deletion
- $this->set_vars(array(
- 'confirm_text' => $user->lang['confirm_delete_event'],
- 'uri_parameter' => URI_EVENT)
- );
-
- $this->assoc_buttons(array(
- 'add' => array(
- 'name' => 'add',
- 'process' => 'process_add',
- 'check' => 'a_event_add'),
- 'update' => array(
- 'name' => 'update',
- 'process' => 'process_update',
- 'check' => 'a_event_upd'),
- 'delete' => array(
- 'name' => 'delete',
- 'process' => 'process_delete',
- 'check' => 'a_event_del'),
- 'form' => array(
- 'name' => '',
- 'process' => 'display_form',
- 'check' => 'a_event_'))
- );
-
- $cur_hash = hash_filename("addevent.php");
- //print"HASH::$cur_hash::<br>";
-
-
- // Build the event array
- // ---------------------------------------------------------
- if ( $this->url_id )
- {
- $sql = 'SELECT event_name, event_value
- FROM ' . EVENTS_TABLE . "
- WHERE event_id = '" . $this->url_id . "'";
- $result = $db->query($sql);
- if ( !$row = $db->fetch_record($result) )
- {
- message_die($user->lang['error_invalid_event_provided']);
- }
- $db->free_result($result);
-
- $this->event = array(
- 'event_name' => post_or_db('event_name', $row),
- 'event_value' => post_or_db('event_value', $row)
- );
- }
- }
-
- function error_check()
- {
- global $user;
-
- $this->fv->is_number('event_value', $user->lang['fv_number_value']);
-
- $this->fv->is_filled(array(
- 'event_name' => $user->lang['fv_required_name'],
- 'event_value' => $user->lang['fv_required_value'])
- );
-
- return $this->fv->is_error();
- }
-
- // ---------------------------------------------------------
- // Process Add
- // ---------------------------------------------------------
- function process_add()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $eqdkp_root_path, $SID;
-
- //
- // Insert event
- // New for 1.3 - stripslashes out of event names.
- //
-
- $clean_event_name = str_replace("'","", $_POST['event_name']);
- $clean_event_name = str_replace("`","", $clean_event_name);
-
- $query = $db->build_query('INSERT', array(
- 'event_name' => ($clean_event_name),
- 'event_value' => $_POST['event_value'],
- 'event_added_by' => $this->admin_user)
- );
- $db->query('INSERT INTO ' . EVENTS_TABLE . $query);
- $this_event_id = $db->insert_id();
-
- //
- // Call plugin update hooks
- //
- $pm->do_hooks('/admin/addevent.php?action=add');
-
-
- //
- // Logging
- //
- $log_action = array(
- 'header' => '{L_ACTION_EVENT_ADDED}',
- 'id' => $this_event_id,
- '{L_NAME}' => ($clean_event_name),
- '{L_VALUE}' => $_POST['event_value'],
- '{L_ADDED_BY}' => $this->admin_user);
- $this->log_insert(array(
- 'log_type' => $log_action['header'],
- 'log_action' => $log_action)
- );
-
- //
- // Success message
- //
- $success_message = sprintf($user->lang['admin_add_event_success'], $_POST['event_value'], $clean_event_name);
- $link_list = array(
- $user->lang['list_events'] => 'listevents.php' . $SID,
- $user->lang['add_event'] => 'addevent.php' . $SID,
- $user->lang['add_raid'] => 'addraid.php' . $SID);
- $this->admin_die($success_message, $link_list);
- }
-
- // ---------------------------------------------------------
- // Process Update
- // ---------------------------------------------------------
- function process_update()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $eqdkp_root_path, $SID;
-
- //
- // Get the old data
- //
- $this->get_old_data();
- $clean_event_name = stripslashes($_POST['event_name']);
-
- //
- // Update any raids with the old name
- //
- if ( $this->old_event['event_name'] != $clean_event_name )
- {
- $sql = 'UPDATE ' . RAIDS_TABLE . "
- SET raid_name='" . $clean_event_name . "'
- WHERE raid_name='" . $this->old_event['event_name'] . "'";
- $db->query($sql);
- }
-
- //
- // Update the event
- //
- $query = $db->build_query('UPDATE', array(
- 'event_name' => $clean_event_name,
- 'event_value' => $_POST['event_value'])
- );
- $sql = 'UPDATE ' . EVENTS_TABLE . ' SET ' . $query . " WHERE event_id='" . $this->url_id . "'";
- $db->query($sql);
-
- //
- // Call plugin update hooks
- //
- $pm->do_hooks('/admin/addevent.php?action=update');
-
- //
- // Logging
- //
- $log_action = array(
- 'header' => '{L_ACTION_EVENT_UPDATED}',
- 'id' => $this->url_id,
- '{L_NAME_BEFORE}' => $this->old_event['event_name'],
- '{L_VALUE_BEFORE}' => $this->old_event['event_value'],
- '{L_NAME_AFTER}' => $this->find_difference($this->old_event['event_name'], $clean_event_name),
- '{L_VALUE_AFTER}' => $this->find_difference($this->old_event['event_value'], $_POST['event_value']),
- '{L_UPDATED_BY}' => $this->admin_user);
- $this->log_insert(array(
- 'log_type' => $log_action['header'],
- 'log_action' => $log_action)
- );
-
- //
- // Success message
- //
- $success_message = sprintf($user->lang['admin_update_event_success'], $_POST['event_value'], $clean_event_name);
- $link_list = array(
- $user->lang['list_events'] => 'listevents.php' . $SID,
- $user->lang['add_event'] => 'addevent.php' . $SID,
- $user->lang['add_raid'] => 'addraid.php' . $SID);
- $this->admin_die($success_message, $link_list);
- }
-
- // ---------------------------------------------------------
- // Process Delete (confirmed)
- // ---------------------------------------------------------
- function process_confirm()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $eqdkp_root_path, $SID;
-
- //
- // Get the old data
- //
- $this->get_old_data();
-
- //
- // Delete the event
- //
- $sql = 'DELETE FROM ' . EVENTS_TABLE . "
- WHERE event_id = '" . $this->url_id . "'";
- $db->query($sql);
-
- //
- // Logging
- //
-
- $clean_event_name = str_replace("'","", $this->old_event['event_name']);
-
- $log_action = array(
- 'header' => '{L_ACTION_EVENT_DELETED}',
- 'id' => $this->url_id,
- '{L_NAME}' => $clean_event_name,
- '{L_VALUE}' => $this->old_event['event_value']);
- $this->log_insert(array(
- 'log_type' => $log_action['header'],
- 'log_action' => $log_action)
- );
-
- //
- // Success message
- //
- $success_message = sprintf($user->lang['admin_delete_event_success'], $this->old_event['event_value'], $this->old_event['event_name']);
- $link_list = array(
- $user->lang['list_events'] => 'listevents.php' . $SID,
- $user->lang['add_event'] => 'addevent.php' . $SID,
- $user->lang['add_raid'] => 'addraid.php' . $SID);
- $this->admin_die($success_message, $link_list);
- }
-
- // ---------------------------------------------------------
- // Process helper methods
- // ---------------------------------------------------------
- function get_old_data()
- {
- global $db;
-
- $sql = 'SELECT event_name, event_value
- FROM ' . EVENTS_TABLE . "
- WHERE event_id='" . $this->url_id . "'";
- $result = $db->query($sql);
- while ( $row = $db->fetch_record($result) )
- {
- $this->old_event = array(
- 'event_name' => str_replace("'","",$row['event_name']),
- 'event_value' => addslashes($row['event_value'])
- );
- }
- $db->free_result($result);
- }
-
- // ---------------------------------------------------------
- // Display form
- // ---------------------------------------------------------
- function display_form()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $eqdkp_root_path, $SID;
-
- $tpl->assign_vars(array(
- // Form vars
- 'F_ADD_EVENT' => 'addevent.php' . $SID,
- 'EVENT_ID' => $this->url_id,
-
- // Form values
- 'EVENT_NAME' => stripslashes($this->event['event_name']),
- 'EVENT_VALUE' => stripslashes($this->event['event_value']),
-
- // Language
- 'L_ADD_EVENT_TITLE' => $user->lang['addevent_title'],
- 'L_NAME' => $user->lang['name'],
- 'L_DKP_VALUE' => sprintf($user->lang['dkp_value'], $eqdkp->config['dkp_name']),
- 'L_ADD_EVENT' => $user->lang['add_event'],
- 'L_RESET' => $user->lang['reset'],
- 'L_UPDATE_EVENT' => $user->lang['update_event'],
- 'L_DELETE_EVENT' => $user->lang['delete_event'],
-
- // Form validation
- 'FV_NAME' => $this->fv->generate_error('event_name'),
- 'FV_VALUE' => $this->fv->generate_error('event_value'),
-
- // Javascript messages
- 'MSG_NAME_EMPTY' => $user->lang['fv_required_name'],
- 'MSG_VALUE_EMPTY' => $user->lang['fv_required_value'],
-
- // Buttons
- 'S_ADD' => ( !$this->url_id ) ? true : false)
- );
-
- $eqdkp->set_vars(array(
- 'page_title' => sprintf($user->lang['admin_title_prefix'], $eqdkp->config['guildtag'], $eqdkp->config['dkp_name']).': '.$user->lang['addevent_title'],
- 'template_file' => 'admin/addevent.html',
- 'display' => true)
- );
- }
-}
-
-$add_event = new Add_Event;
-$add_event->process();
-?>
diff --git a/old/admin/addiadj.php b/old/admin/addiadj.php
deleted file mode 100644
index b768200..0000000
--- a/old/admin/addiadj.php
+++ /dev/null
@@ -1,424 +0,0 @@
-<?php
-/******************************
- * EQdkp
- * Copyright 2002-2003
- * Licensed under the GNU GPL. See COPYING for full terms.
- * ------------------
- * addiadj.php
- * Began: Sun January 5 2003
- *
- * $Id: addiadj.php 46 2007-06-19 07:29:11Z tsigo $
- *
- ******************************/
-
-define('EQDKP_INC', true);
-define('IN_ADMIN', true);
-$eqdkp_root_path = './../';
-include_once($eqdkp_root_path . 'common.php');
-
-class Add_IndivAdj extends EQdkp_Admin
-{
- var $adjustment = array(); // Holds adjustment data if URI_ADJUSTMENT is set @var adjustment
- var $old_adjustment = array(); // Holds adjustment data from before POST @var old_adjustment
-
- function add_indivadj()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $eqdkp_root_path, $SID;
-
- parent::eqdkp_admin();
-
- $this->adjustment = array(
- 'adjustment_value' => post_or_db('adjustment_value'),
- 'adjustment_reason' => post_or_db('adjustment_reason'),
- 'member_names' => post_or_db('member_names')
- );
-
- // Vars used to confirm deletion
- $this->set_vars(array(
- 'confirm_text' => $user->lang['confirm_delete_iadj'],
- 'uri_parameter' => URI_ADJUSTMENT)
- );
-
- $this->assoc_buttons(array(
- 'add' => array(
- 'name' => 'add',
- 'process' => 'process_add',
- 'check' => 'a_indivadj_add'),
- 'update' => array(
- 'name' => 'update',
- 'process' => 'process_update',
- 'check' => 'a_indivadj_upd'),
- 'delete' => array(
- 'name' => 'delete',
- 'process' => 'process_delete',
- 'check' => 'a_indivadj_del'),
- 'form' => array(
- 'name' => '',
- 'process' => 'display_form',
- 'check' => 'a_indivadj_'))
- );
-
- $cur_hash = hash_filename("addiadj.php");
- //print"HASH::$cur_hash::<br>";
-
-
- // Build the adjustment aray
- // -----------------------------------------------------
- if ( $this->url_id )
- {
- $sql = 'SELECT adjustment_value, adjustment_date, adjustment_reason, member_name, adjustment_group_key
- FROM ' . ADJUSTMENTS_TABLE . "
- WHERE adjustment_id='" . $this->url_id . "'";
- $result = $db->query($sql);
- if ( !$row = $db->fetch_record($result) )
- {
- message_die($user->lang['error_invalid_adjustment']);
- }
- $db->free_result($result);
-
- // If member name isn't set, it's a group adjustment - put them back on that script
- if ( !isset($row['member_name']) )
- {
- redirect('addadj.php' . $SID . '&' . URI_ADJUSTMENT . '='.$adjustment_id);
- }
-
- $this->time = $row['adjustment_date'];
- $this->adjustment = array(
- 'adjustment_value' => post_or_db('adjustment_value', $row),
- 'adjustment_reason' => post_or_db('adjustment_reason', $row)
- );
-
- $members = array();
- $sql = 'SELECT member_name
- FROM ' . ADJUSTMENTS_TABLE . "
- WHERE adjustment_group_key='".$row['adjustment_group_key']."'";
- $result = $db->query($sql);
- while ( $row = $db->fetch_record($result) )
- {
- $members[] = $row['member_name'];
- }
- $db->free_result($result);
-
- $this->adjustment['member_names'] = ( !empty($_POST['member_names']) ) ? $_POST['member_names'] : $members;
- unset($row, $members, $sql);
- }
- }
-
- function error_check()
- {
- global $user;
-
- if ( (!isset($_POST['member_names'])) || (!is_array($_POST['member_names'])) )
- {
- $this->fv->errors['member_names'] = $user->lang['fv_required_members'];
- }
-
- $this->fv->is_number('adjustment_value', $user->lang['fv_number_adjustment']);
- $this->fv->is_filled('adjustment_value', $user->lang['fv_required_adjustment']);
- $this->fv->is_within_range('mo', 1, 12, $user->lang['fv_range_month']);
- $this->fv->is_within_range('d', 1, 31, $user->lang['fv_range_day']);
- $this->fv->is_within_range('y', 1998, 2010, $user->lang['fv_range_year']);
-
- $this->time = mktime(0, 0, 0, $_POST['mo'], $_POST['d'], $_POST['y']);
-
- return $this->fv->is_error();
- }
-
- // ---------------------------------------------------------
- // Process Add
- // ---------------------------------------------------------
- function process_add()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $eqdkp_root_path, $SID;
-
- //
- // Generate our group key
- //
- $group_key = $this->gen_group_key($this->time, stripslashes($_POST['adjustment_reason']), $_POST['adjustment_value']);
-
- //
- // Add adjustment to selected members
- //
- foreach ( $_POST['member_names'] as $member_name )
- {
- $this->add_new_adjustment($member_name, $group_key);
- }
-
- //
- // Logging
- //
- $log_action = array(
- 'header' => '{L_ACTION_INDIVADJ_ADDED}',
- '{L_ADJUSTMENT}' => $_POST['adjustment_value'],
- '{L_REASON}' => stripslashes($_POST['adjustment_reason']),
- '{L_MEMBERS}' => implode(', ', $_POST['member_names']),
- '{L_ADDED_BY}' => $this->admin_user);
- $this->log_insert(array(
- 'log_type' => $log_action['header'],
- 'log_action' => $log_action)
- );
-
- //
- // Success message
- //
- $success_message = sprintf($user->lang['admin_add_iadj_success'], $eqdkp->config['dkp_name'], $_POST['adjustment_value'], implode(', ', $_POST['member_names']));
- $link_list = array(
- $user->lang['list_indivadj'] => 'listadj.php' . $SID . '&amp;' . URI_PAGE . '=individual',
- $user->lang['list_members'] => $eqdkp_root_path . 'listmembers.php' . $SID);
- $this->admin_die($success_message, $link_list);
- }
-
- // ---------------------------------------------------------
- // Process Update
- // ---------------------------------------------------------
- function process_update()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $eqdkp_root_path, $SID;
-
- //
- // Remove the old adjustment from members that received it
- // and then remove the adjustment itself
- //
- $this->remove_old_adjustment();
-
- //
- // Generate a new group key
- //
- $group_key = $this->gen_group_key($this->time, stripslashes($_POST['adjustment_reason']), $_POST['adjustment_value']);
-
- //
- // Add the new adjustment to selected members
- //
- foreach ( $_POST['member_names'] as $member_name )
- {
- $this->add_new_adjustment($member_name, $group_key);
- }
-
- //
- // Logging
- //
- $log_action = array(
- 'header' => '{L_ACTION_INDIVADJ_UPDATED}',
- 'id' => $this->url_id,
- '{L_ADJUSTMENT_BEFORE}' => $this->old_adjustment['adjustment_value'],
- '{L_REASON_BEFORE}' => $this->old_adjustment['adjustment_reason'],
- '{L_MEMBERS_BEFORE}' => implode(', ', $this->old_adjustment['member_names']),
- '{L_ADJUSTMENT_AFTER}' => $this->find_difference($this->old_adjustment['adjustment_value'], $_POST['adjustment_value']),
- '{L_REASON_AFTER}' => $this->find_difference($this->old_adjustment['adjustment_reason'], $_POST['adjustment_reason']),
- '{L_MEMBERS_AFTER}' => implode(', ', $this->find_difference($this->old_adjustment['member_names'], $_POST['member_names'])),
- '{L_UPDATED_BY}' => $this->admin_user);
- $this->log_insert(array(
- 'log_type' => $log_action['header'],
- 'log_action' => $log_action)
- );
-
- //
- // Success message
- //
- $success_message = sprintf($user->lang['admin_update_iadj_success'], $eqdkp->config['dkp_name'], $_POST['adjustment_value'], implode(', ', $_POST['member_names']));
- $link_list = array(
- $user->lang['list_indivadj'] => 'listadj.php' . $SID . '&amp;' . URI_PAGE . '=individual',
- $user->lang['list_members'] => $eqdkp_root_path . 'listmembers.php' . $SID);
- $this->admin_die($success_message, $link_list);
- }
-
- // ---------------------------------------------------------
- // Process Delete (confirmed)
- // ---------------------------------------------------------
- function process_confirm()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $eqdkp_root_path, $SID;
-
- //
- // Remove the old adjustment from members that received it
- // and then remove the adjustment itself
- //
- $this->remove_old_adjustment();
-
- //
- // Logging
- //
- $log_action = array(
- 'header' => '{L_ACTION_INDIVADJ_DELETED}',
- 'id' => $this->url_id,
- '{L_ADJUSTMENT}' => $this->old_adjustment['adjustment_value'],
- '{L_REASON}' => $this->old_adjustment['adjustment_reason'],
- '{L_MEMBERS}' => implode(', ', $this->old_adjustment['member_names']));
- $this->log_insert(array(
- 'log_type' => $log_action['header'],
- 'log_action' => $log_action)
- );
-
- //
- // Success messages
- //
- $success_message = sprintf($user->lang['admin_delete_iadj_success'], $eqdkp->config['dkp_name'], $this->old_adjustment['adjustment_value'], implode(', ', $this->old_adjustment['member_names']));
- $link_list = array(
- $user->lang['list_indivadj'] => 'listadj.php' . $SID . '&amp;' . URI_PAGE . '=individual',
- $user->lang['list_members'] => $eqdkp_root_path . 'listmembers.php' . $SID);
- $this->admin_die($success_message, $link_list);
- }
-
- // ---------------------------------------------------------
- // Process helper methods
- // ---------------------------------------------------------
- function remove_old_adjustment()
- {
- global $db;
-
- $adjustment_ids = array();
- $old_members = array();
-
- $sql = 'SELECT a2.*
- FROM (' . ADJUSTMENTS_TABLE . ' a1
- LEFT JOIN ' . ADJUSTMENTS_TABLE . " a2
- ON a1.adjustment_group_key = a2.adjustment_group_key)
- WHERE a1.adjustment_id='" . $this->url_id . "'";
- $result = $db->query($sql);
- while ( $row = $db->fetch_record($result) )
- {
- $adjustment_ids[] = $row['adjustment_id'];
-
- $old_members[] = addslashes($row['member_name']);
- $this->old_adjustment = array(
- 'adjustment_value' => addslashes($row['adjustment_value']),
- 'adjustment_date' => addslashes($row['adjustment_date']),
- 'member_names' => $old_members,
- 'adjustment_reason' => addslashes($row['adjustment_reason'])
- );
- }
-
- //
- // Remove the adjustment value from adjustments table
- //
- $sql = 'DELETE FROM ' . ADJUSTMENTS_TABLE . '
- WHERE adjustment_id IN (' . implode(', ', $adjustment_ids) . ')';
- $db->query($sql);
-
- //
- // Remove the adjustment value from members
- //
- $sql = 'UPDATE ' . MEMBERS_TABLE . '
- SET member_adjustment = member_adjustment - ' . stripslashes($this->old_adjustment['adjustment_value']) . '
- WHERE member_name IN (\'' . implode("', '", $this->old_adjustment['member_names']) . '\')';
- $db->query($sql);
- }
-
- function add_new_adjustment($member_name, $group_key)
- {
- global $db;
-
- //
- // Add the adjustment to the member
- //
- $sql = 'UPDATE ' . MEMBERS_TABLE . '
- SET member_adjustment = member_adjustment + ' . $db->escape($_POST['adjustment_value']) . "
- WHERE member_name='" . $member_name . "'";
- $db->query($sql);
- unset($sql);
-
- //
- // Add the adjustment to the database
- //
- $query = $db->build_query('INSERT', array(
- 'adjustment_value' => $_POST['adjustment_value'],
- 'adjustment_date' => $this->time,
- 'member_name' => $member_name,
- 'adjustment_reason' => $_POST['adjustment_reason'],
- 'adjustment_group_key' => $group_key,
- 'adjustment_added_by' => $this->admin_user)
- );
- $db->query('INSERT INTO ' . ADJUSTMENTS_TABLE . $query);
- }
-
- // ---------------------------------------------------------
- // Display form
- // ---------------------------------------------------------
- function display_form()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $eqdkp_root_path, $SID;
-
- //
- // Build member drop-down
- //
- $sql = 'SELECT member_name
- FROM ' . MEMBERS_TABLE . '
- ORDER BY member_name';
- $result = $db->query($sql);
- while ( $row = $db->fetch_record($result) )
- {
- if ( $this->url_id )
- {
- $selected = ( @in_array($row['member_name'], $this->adjustment['member_names']) ) ? ' selected="selected"' : '';
- }
- else
- {
- $selected = ( @in_array($row['member_name'], $_POST['member_names']) ) ? ' selected="selected"' : '';
- }
-
- $tpl->assign_block_vars('members_row', array(
- 'VALUE' => $row['member_name'],
- 'SELECTED' => $selected,
- 'OPTION' => $row['member_name'])
- );
- }
- $db->free_result($result);
-
- $tpl->assign_vars(array(
- // Form vars
- 'F_ADD_ADJUSTMENT' => 'addiadj.php' . $SID,
- 'ADJUSTMENT_ID' => $this->url_id,
-
- // Form values
- 'ADJUSTMENT_VALUE' => $this->adjustment['adjustment_value'],
- 'ADJUSTMENT_REASON' => stripslashes(htmlspecialchars($this->adjustment['adjustment_reason'])),
- 'MO' => date('m', stripslashes($this->time)),
- 'D' => date('d', stripslashes($this->time)),
- 'Y' => date('Y', stripslashes($this->time)),
- 'H' => date('h', stripslashes($this->time)),
- 'MI' => date('i', stripslashes($this->time)),
- 'S' => date('s', stripslashes($this->time)),
-
- // Language
- 'L_ADD_IADJ_TITLE' => $user->lang['addiadj_title'],
- 'L_MEMBERS' => $user->lang['members'],
- 'L_HOLD_CTRL_NOTE' => '(' . $user->lang['hold_ctrl_note'] . ')<br />',
- 'L_REASON' => $user->lang['reason'],
- 'L_VALUE' => $user->lang['value'],
- 'L_ADJUSTMENT_VALUE_NOTE' => strtolower($user->lang['adjustment_value_note']),
- 'L_DATE' => $user->lang['date'],
- 'L_ADD_ADJUSTMENT' => $user->lang['add_adjustment'],
- 'L_RESET' => $user->lang['reset'],
- 'L_UPDATE_ADJUSTMENT' => $user->lang['update_adjustment'],
- 'L_DELETE_ADJUSTMENT' => $user->lang['delete_adjustment'],
-
- // Form validation
- 'FV_MEMBERS' => $this->fv->generate_error('member_names'),
- 'FV_ADJUSTMENT' => $this->fv->generate_error('adjustment_value'),
- 'FV_MO' => $this->fv->generate_error('mo'),
- 'FV_D' => $this->fv->generate_error('d'),
- 'FV_Y' => $this->fv->generate_error('y'),
-
- // Javascript messages
- 'MSG_VALUE_EMPTY' => $user->lang['fv_required_adjustment'],
-
- // Buttons
- 'S_ADD' => ( !$this->url_id ) ? true : false)
- );
-
- $eqdkp->set_vars(array(
- 'page_title' => sprintf($user->lang['admin_title_prefix'], $eqdkp->config['guildtag'], $eqdkp->config['dkp_name']).': '.$user->lang['addiadj_title'],
- 'template_file' => 'admin/addiadj.html',
- 'display' => true)
- );
- }
-}
-
-$add_indivadj = new Add_IndivAdj;
-$add_indivadj->process();
-?>
diff --git a/old/admin/additem.php b/old/admin/additem.php
deleted file mode 100644
index afae707..0000000
--- a/old/admin/additem.php
+++ /dev/null
@@ -1,677 +0,0 @@
-<?php
-/******************************
- * EQdkp
- * Copyright 2002-2003
- * Licensed under the GNU GPL. See COPYING for full terms.
- * ------------------
- * additem.php
- * Began: Fri December 27 2002
- *
- * $Id: additem.php 46 2007-06-19 07:29:11Z tsigo $
- *
- ******************************/
-
-define('EQDKP_INC', true);
-define('IN_ADMIN', true);
-$eqdkp_root_path = './../';
-include_once($eqdkp_root_path . 'common.php');
-
-class Add_Item extends EQdkp_Admin
-{
- var $item = array(); // Holds item data if URI_ITEM is set @var item
- var $old_item = array(); // Holds item data from before POST @var old_item
-
- function add_item()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $eqdkp_root_path, $SID;
-
- parent::eqdkp_admin();
-
- $this->item = array(
- 'select_item_name' => post_or_db('select_item_name'),
- 'item_name' => post_or_db('item_name'),
- 'item_buyers' => post_or_db('item_buyers'),
- 'raid_id' => post_or_db('raid_id'),
- 'item_value' => post_or_db('item_value')
- );
-
- // Vars used to confirm deletion
- $this->set_vars(array(
- 'confirm_text' => $user->lang['confirm_delete_item'],
- 'uri_parameter' => URI_ITEM)
- );
-
- $this->assoc_buttons(array(
- 'add' => array(
- 'name' => 'add',
- 'process' => 'process_add',
- 'check' => 'a_item_add'),
- 'update' => array(
- 'name' => 'update',
- 'process' => 'process_update',
- 'check' => 'a_item_upd'),
- 'delete' => array(
- 'name' => 'delete',
- 'process' => 'process_delete',
- 'check' => 'a_item_del'),
- 'form' => array(
- 'name' => '',
- 'process' => 'display_form',
- 'check' => 'a_item_'))
- );
-
- // Build the item array
- // ---------------------------------------------------------
- if ( $this->url_id )
- {
- $sql = 'SELECT item_name, item_buyer, raid_id, item_value, item_date, item_group_key
- FROM ' . ITEMS_TABLE . "
- WHERE item_id='" . $this->url_id . "'";
- $result = $db->query($sql);
- if ( !$row = $db->fetch_record($result) )
- {
- message_die($user->lang['error_invalid_item_provided']);
- }
- $db->free_result($result);
-
- $this->time = $row['item_date'];
- $this->item = array(
- 'select_item_name' => post_or_db('select_item_name'),
- 'item_name' => post_or_db('item_name', $row),
- 'raid_id' => post_or_db('raid_id', $row),
- 'item_value' => post_or_db('item_value', $row)
- );
-
- $buyers = array();
- $sql = 'SELECT item_buyer
- FROM ' . ITEMS_TABLE . "
- WHERE item_group_key='" . $row['item_group_key'] . "'";
- $result = $db->query($sql);
- while ( $row = $db->fetch_record($result) )
- {
- $buyers[] = $row['item_buyer'];
- }
- $this->item['item_buyers'] = ( !empty($_POST['item_buyers']) ) ? $_POST['item_buyers'] : $buyers;
- unset($buyers);
- }
- }
-
- function error_check()
- {
- global $user;
-
- if ( (!isset($_POST['item_buyers'])) || (!is_array($_POST['item_buyers'])) )
- {
- $this->fv->errors['item_buyers'] = $user->lang['fv_required_buyers'];
- }
- $this->fv->is_number('item_value', $user->lang['fv_number_value']);
- $this->fv->is_filled(array(
- 'raid_id' => $user->lang['fv_required_raidid'],
- 'item_value' => $user->lang['fv_required_value'])
- );
-
- if ( !empty($_POST['item_name']) )
- {
- $this->item['item_name'] = $_POST['item_name'];
- }
- elseif ( !empty($_POST['select_item_name']) )
- {
- $this->item['item_name'] = $_POST['select_item_name'];
- }
- else
- {
- $this->fv->errors['item_name'] = $user->lang['fv_required_item_name'];
- }
-
- return $this->fv->is_error();
- }
-
- // ---------------------------------------------------------
- // Process Add
- // ---------------------------------------------------------
- function process_add()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $eqdkp_root_path, $SID;
-
- // Get item name from the appropriate field
- $this->item['item_name'] = ( !empty($_POST['item_name']) ) ? $_POST['item_name'] : $_POST['select_item_name'];
-
- // Find out the item's date based on the raid it's associated with
- $this->time = $db->query_first('SELECT raid_date FROM ' . RAIDS_TABLE . " WHERE raid_id='" . $_POST['raid_id'] . "'");
-
- //
- // Generate our group key
- //
- $group_key = $this->gen_group_key($this->item['item_name'], $this->time, $_POST['raid_id']);
-
- //
- // Add item to selected members
- //
- $this->add_new_item($group_key);
-
- //
- // Logging
- //
- $item_buyers = implode(', ', $_POST['item_buyers']);
- $log_action = array(
- 'header' => '{L_ACTION_ITEM_ADDED}',
- '{L_NAME}' => $this->item['item_name'],
- '{L_BUYERS}' => $item_buyers,
- '{L_RAID_ID}' => $_POST['raid_id'],
- '{L_VALUE}' => $_POST['item_value'],
- '{L_ADDED_BY}' => $this->admin_user);
- $this->log_insert(array(
- 'log_type' => $log_action['header'],
- 'log_action' => $log_action)
- );
-
- //
- // Success message
- //
- $success_message = sprintf($user->lang['admin_add_item_success'], $this->item['item_name'], $item_buyers, $_POST['item_value']);
- $link_list = array(
- $user->lang['add_item'] => 'additem.php' . $SID,
- $user->lang['list_items'] => 'listitems.php' . $SID);
- $this->admin_die($success_message, $link_list);
- }
-
- // ---------------------------------------------------------
- // Process Update
- // ---------------------------------------------------------
- function process_update()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $eqdkp_root_path, $SID;
-
- //
- // Remove the old item
- //
- $this->remove_old_item();
-
- // Get item name from the appropriate field
- $this->item['item_name'] = ( !empty($_POST['item_name']) ) ? $_POST['item_name'] : $_POST['select_item_name'];
-
- // Find out the item's date based on the raid it's associated with
- $this->time = $db->query_first('SELECT raid_date FROM ' . RAIDS_TABLE . " WHERE raid_id='" . $_POST['raid_id'] . "'");
-
- //
- // Generate our group key
- //
- $group_key = $this->gen_group_key($this->item['item_name'], $this->time, $_POST['raid_id']);
-
- //
- // Add item to selected members
- //
- $this->add_new_item($group_key);
-
- //
- // Logging
- //
- $item_buyers = implode(', ', $_POST['item_buyers']);
- $log_action = array(
- 'header' => '{L_ACTION_ITEM_UPDATED}',
- '{L_NAME_BEFORE}' => $this->old_item['item_name'],
- '{L_BUYERS_BEFORE}' => implode(', ', $this->old_item['item_buyers']),
- '{L_RAID_ID_BEFORE}' => $this->old_item['raid_id'],
- '{L_VALUE_BEFORE}' => $this->old_item['item_value'],
- '{L_NAME_AFTER}' => $this->find_difference($this->old_item['item_name'], $this->item['item_name']),
- '{L_BUYERS_AFTER}' => implode(', ', $this->find_difference($this->old_item['item_buyers'], $_POST['item_buyers'])),
- '{L_RAID_ID_AFTER}' => $this->find_difference($this->old_item['raid_id'], $_POST['raid_id']),
- '{L_VALUE_AFTER}' => $this->find_difference($this->old_item['item_value'], $_POST['item_value']),
- '{L_UPDATED_BY}' => $this->admin_user);
- $this->log_insert(array(
- 'log_type' => $log_action['header'],
- 'log_action' => $log_action)
- );
-
- //
- // Success message
- //
- $success_message = sprintf($user->lang['admin_update_item_success'], $this->old_item['item_name'], implode(', ', $this->old_item['item_buyers']), $this->old_item['item_value']);
- $link_list = array(
- $user->lang['add_item'] => 'additem.php' . $SID,
- $user->lang['list_items'] => 'listitems.php' . $SID);
- $this->admin_die($success_message, $link_list);
- }
-
- // ---------------------------------------------------------
- // Process Delete (confirmed)
- // ---------------------------------------------------------
- function process_confirm()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $eqdkp_root_path, $SID;
-
- //
- // Remove the old item
- //
- $this->remove_old_item();
-
- //
- // Logging
- //
- $item_buyers = implode(', ', $this->old_item['item_buyers']);
- $log_action = array(
- 'header' => '{L_ACTION_ITEM_DELETED}',
- '{L_NAME}' => $this->old_item['item_name'],
- '{L_BUYERS}' => $item_buyers,
- '{L_RAID_ID}' => $this->old_item['raid_id'],
- '{L_VALUE}' => $this->old_item['item_value']);
- $this->log_insert(array(
- 'log_type' => $log_action['header'],
- 'log_action' => $log_action)
- );
-
- //
- // Success message
- //
- $success_message = sprintf($user->lang['admin_delete_item_success'], $this->old_item['item_name'], $item_buyers, $this->old_item['item_value']);
- $link_list = array(
- $user->lang['add_item'] => 'additem.php' . $SID,
- $user->lang['list_items'] => 'listitems.php' . $SID);
- $this->admin_die($success_message, $link_list);
- }
-
- // ---------------------------------------------------------
- // Process helper methods
- // ---------------------------------------------------------
- function remove_old_item()
- {
- global $db;
-
- $item_ids = array();
- $old_buyers = array();
-
- //
- // Build the item_ids, old_buyers and old_item arrays
- //
- $sql = 'SELECT i2.*
- FROM (' . ITEMS_TABLE . ' i1
- LEFT JOIN ' . ITEMS_TABLE . " i2
- ON i1.item_group_key = i2.item_group_key)
- WHERE i1.item_id='" . $this->url_id . "'";
- $result = $db->query($sql);
- while ( $row = $db->fetch_record($result) )
- {
- $item_ids[] = $row['item_id'];
-
- $old_buyers[] = addslashes($row['item_buyer']);
- $this->old_item = array(
- 'item_name' => addslashes($row['item_name']),
- 'item_buyers' => $old_buyers,
- 'raid_id' => addslashes($row['raid_id']),
- 'item_date' => addslashes($row['item_date']),
- 'item_value' => addslashes($row['item_value'])
- );
- }
-
- //
- // Remove the item purchase from the items table
- //
- $sql = 'DELETE FROM ' . ITEMS_TABLE . '
- WHERE item_id IN (' . implode(', ', $item_ids) . ')';
- $db->query($sql);
-
- //
- // Remove the purchase value from members
- //
- $sql = 'UPDATE ' . MEMBERS_TABLE . '
- SET member_spent = member_spent - ' . stripslashes($this->old_item['item_value']) . '
- WHERE member_name IN (\'' . implode("', '", $this->old_item['item_buyers']) . '\')';
- $db->query($sql);
- }
-
- function add_new_item($group_key)
- {
- global $db;
-
- $query = array();
-
- foreach ( $_POST['item_buyers'] as $member_name )
- {
- $query[] = $db->build_query('INSERT', array(
- 'item_name' => stripslashes($this->item['item_name']),
- 'item_buyer' => $member_name,
- 'raid_id' => $_POST['raid_id'],
- 'item_value' => $_POST['item_value'],
- 'item_date' => $this->time,
- 'item_group_key' => $group_key,
- 'item_added_by' => $this->admin_user)
- );
- }
-
- //
- // Add charge to members
- //
- $sql = 'UPDATE ' . MEMBERS_TABLE . '
- SET member_spent = member_spent + ' . $_POST['item_value'] . '
- WHERE member_name IN (\'' . implode("', '", $_POST['item_buyers']) . '\')';
- $db->query($sql);
-
- //
- // Add purchase(s) to items table
- //
- // Remove the field names from our built queries
- foreach ( $query as $key => $sql )
- {
- $query[$key] = preg_replace('#^.+\) VALUES (\(.+\))#', '\1', $sql);
- }
-
- $sql = 'INSERT INTO ' . ITEMS_TABLE . '
- (item_name, item_buyer, raid_id, item_value, item_date, item_group_key, item_added_by)
- VALUES ' . implode(', ', $query);
- $db->query($sql);
- }
-
- // ---------------------------------------------------------
- // Display form
- // ---------------------------------------------------------
- function display_form()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $eqdkp_root_path, $SID;
-
- //
- // Build member and buyer drop-downs
- //
- $buyer_source = ( $this->url_id ) ? $this->item['item_buyers'] : (( isset($_POST['item_buyers']) ) ? $_POST['item_buyers'] : '');
-
- $sql = 'SELECT member_name
- FROM ' . MEMBERS_TABLE . '
- ORDER BY member_name';
- $result = $db->query($sql);
- while ( $row = $db->fetch_record($result) )
- {
- $tpl->assign_block_vars('members_row', array(
- 'VALUE' => $row['member_name'],
- 'OPTION' => $row['member_name'])
- );
-
- if ( @in_array($row['member_name'], $buyer_source) )
- {
- $tpl->assign_block_vars('buyers_row', array(
- 'VALUE' => $row['member_name'],
- 'OPTION' => $row['member_name'])
- );
- }
- }
- $db->free_result($result);
-
- //
- // Build raid drop-down
- //
- // Show all raids?
- $show_all = ( (!empty($_GET['show'])) && ($_GET['show'] == 'all') ) ? true : false;
-
- // Make two_weeks two weeks before the date the item was purchased
- $two_weeks = mktime(0, 0, 0, date('m', $this->time), date('d', $this->time)-14, date('y', $this->time));
-
- $sql_where_clause = ( $show_all ) ? '' : ' WHERE (raid_date >= ' . $two_weeks . ')';
- $sql = 'SELECT raid_id, raid_name, raid_date
- FROM ' . RAIDS_TABLE .
- $sql_where_clause . '
- ORDER BY raid_date DESC';
- $result = $db->query($sql);
- $raid_id = ( isset($_GET['raid_id']) ) ? $_GET['raid_id'] : '0'; // 'Add items from this raid' link
- while ( $row = $db->fetch_record($result) )
- {
- $tpl->assign_block_vars('raids_row', array(
- 'VALUE' => $row['raid_id'],
- 'SELECTED' => ( ($raid_id == $row['raid_id']) || ($this->item['raid_id'] == $row['raid_id']) ) ? ' selected="selected"' : '',
- 'OPTION' => date($user->style['date_notime_short'], $row['raid_date']) . ' - ' . stripslashes($row['raid_name']))
- );
- }
- $db->free_result($result);
-
- //
- // Build item drop-down
- //
- $max_value = $db->query_first('SELECT max(item_value) FROM ' . ITEMS_TABLE);
- $float = @explode('.', $max_value);
- $floatlen = @strlen($float[0]);
- $format = '%0' . $floatlen . '.2f';
-
- $previous_item = '';
- $sql = 'SELECT item_value, item_name
- FROM ' . ITEMS_TABLE . '
- ORDER BY item_name, item_date DESC';
- $result = $db->query($sql);
- while ( $row = $db->fetch_record($result) )
- {
- $item_select_name = stripslashes(trim($row['item_name']));
- $item_name = stripslashes(trim($this->item['item_name']));
- $item_value = $row['item_value'];
-
- if ( $previous_item != $item_select_name )
- {
- $tpl->assign_block_vars('items_row', array(
- 'VALUE' => $item_select_name,
- 'SELECTED' => ( ($item_select_name == $item_name) || ($item_select_name == $this->item['select_item_name']) ) ? ' selected="selected"' : '',
- // 'OPTION' => '(' . sprintf($format, $row['item_value']) . ') - ' . $item_select_name)
- 'OPTION' => $item_select_name . ' - ( ' . sprintf($format, $row['item_value']) . ' )' )
-
- );
-
- $previous_item = $item_select_name;
- }
- }
- $db->free_result($result);
-
- $tpl->assign_vars(array(
- // Form vars
- 'F_ADD_ITEM' => 'additem.php' . $SID,
- 'ITEM_ID' => $this->url_id,
- 'U_ADD_RAID' => 'addraid.php'.$SID,
- 'S_MULTIPLE_BUYERS' => ( !$this->url_id ) ? true : false,
-
- // Form values
- 'ITEM_NAME' => stripslashes($this->item['item_name']),
- 'ITEM_VALUE' => $this->item['item_value'],
-
- // Language
- 'L_ADD_ITEM_TITLE' => $user->lang['additem_title'],
- 'L_BUYERS' => $user->lang['buyers'],
- 'L_HOLD_CTRL_NOTE' => '('.$user->lang['hold_ctrl_note'].')<br />',
- 'L_SEARCH_MEMBERS' => $user->lang['search_members'],
- 'L_RAID' => $user->lang['raid'],
- 'L_ADD_RAID' => strtolower($user->lang['add_raid']),
- 'L_NOTE' => $user->lang['note'],
- 'L_ADDITEM_RAIDID_NOTE' => ( !$show_all ) ? sprintf($user->lang['additem_raidid_note'], '<a href="additem.php'.$SID.'&amp;show=all'.(( $this->url_id ) ? '&amp;' . URI_ITEM . '=' . $this->url_id : '').'">')
- : $user->lang['additem_raidid_showall_note'],
- 'L_ITEM' => $user->lang['item'],
- 'L_SEARCH' => strtolower($user->lang['search']),
- 'L_SEARCH_EXISTING' => $user->lang['search_existing'],
- 'L_SELECT_EXISTING' => $user->lang['select_existing'],
- 'L_OR' => strtolower($user->lang['or']),
- 'L_ENTER_NEW' => $user->lang['enter_new'],
- 'L_VALUE' => $user->lang['value'],
- 'L_ADD_ITEM' => $user->lang['add_item'],
- 'L_RESET' => $user->lang['reset'],
- 'L_UPDATE_ITEM' => $user->lang['update_item'],
- 'L_DELETE_ITEM' => $user->lang['delete_item'],
-
- // Form validation
- 'FV_ITEM_BUYERS' => $this->fv->generate_error('item_buyers'),
- 'FV_RAID_ID' => $this->fv->generate_error('raid_id'),
- 'FV_ITEM_NAME' => $this->fv->generate_error('item_name'),
- 'FV_ITEM_VALUE' => $this->fv->generate_error('item_value'),
-
- // Javascript messages
- 'MSG_NAME_EMPTY' => $user->lang['fv_required_item_name'],
- 'MSG_RAID_ID_EMPTY' => $user->lang['fv_required_raidid'],
- 'MSG_VALUE_EMPTY' => $user->lang['fv_required_value'],
- 'ITEM_VALUE_LENGTH' => ($floatlen + 3), // The first three digits plus '.00';
-
- // Buttons
- 'S_ADD' => ( !$this->url_id ) ? true : false)
- );
-
- $eqdkp->set_vars(array(
- 'page_title' => sprintf($user->lang['admin_title_prefix'], $eqdkp->config['guildtag'], $eqdkp->config['dkp_name']).': '.$user->lang['additem_title'],
- 'template_file' => 'admin/additem.html',
- 'display' => true)
- );
- }
-}
-
-class Item_Search extends EQdkp_Admin
-{
- function item_search()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID;
-
- parent::eqdkp_admin();
-
- $this->assoc_buttons(array(
- 'search' => array(
- 'name' => 'search',
- 'process' => 'process_search',
- 'check' => 'a_item_'),
- 'form' => array(
- 'name' => '',
- 'process' => 'display_form',
- 'check' => 'a_item_'))
- );
- }
-
- function error_check()
- {
- $this->fv->is_filled('query');
- if ( strlen($_POST['query']) < 2 )
- {
- $this->fv->errors['query'] = '';
- }
-
- return $this->fv->is_error();
- }
-
- // ---------------------------------------------------------
- // Process item search
- // ---------------------------------------------------------
- function process_search()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID;
-
- $items_array = array();
- if ( !empty($_POST['query']) )
- {
- $eqdkp_items = array();
- $eqdkp_item_stats = array();
-
- //
- // Get item names from our standard items table
- //
- $sql = 'SELECT item_name
- FROM ' . ITEMS_TABLE . "
- WHERE item_name LIKE '%" . $_POST['query'] . "%'
- ORDER BY item_name";
- $result = $db->query($sql);
- while ( $row = $db->fetch_record($result) )
- {
- $eqdkp_items[] = $row['item_name'];
- }
- $db->free_result($result);
-
- //
- // Get item names from our stats table if the stats plugin is installed
- //
-
- // #######################################
- // Alteration sumbitted by Tam
- // #######################################
- if ( $pm->check(PLUGIN_INSTALLED, 'stats') )
- {
- $sql = 'SELECT name
- FROM ' . ITEM_STATS_TABLE . "
- WHERE name LIKE '%" . $_POST['query'] . "%'
- ORDER BY name";
- $result = $db->query($sql);
- while ( $row = $db->fetch_record($result) )
- {
- // Add the item if we don't have it already
- if ( !in_array($row['item_name'], $eqdkp_items) )
- {
- $eqdkp_item_stats[] = $row['name'];
- }
- }
- $db->free_result($result);
- }
- //#######################################
-
- //
- // Build the drop-down
- //
- $items_array = array_merge($eqdkp_items, $eqdkp_item_stats);
- $items_array = array_unique($items_array);
- sort($items_array);
- reset($items_array);
-
- foreach ( $items_array as $item_name )
- {
- $tpl->assign_block_vars('items_row', array(
- 'VALUE' => stripslashes($item_name),
- 'OPTION' => stripslashes($item_name))
- );
- }
- }
-
- $tpl->assign_vars(array(
- 'S_STEP1' => false,
-
- 'L_RESULTS' => sprintf($user->lang['results'], sizeof($items_array), stripslashes($_POST['query'])),
- 'L_SELECT' => $user->lang['select'])
- );
-
- $eqdkp->set_vars(array(
- 'page_title' => sprintf($user->lang['admin_title_prefix'], $eqdkp->config['guildtag'], $eqdkp->config['dkp_name']).': '.$user->lang['additem_title'],
- 'gen_simple_header' => true,
- 'template_file' => 'admin/additem_search.html',
- 'display' => true)
- );
- }
-
- // ---------------------------------------------------------
- // Display item search
- // ---------------------------------------------------------
- function display_form()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID;
-
- $tpl->assign_vars(array(
- 'F_SEARCH_ITEM' => 'additem.php' . $SID . '&amp;mode=search',
- 'S_STEP1' => true,
- 'ONLOAD' => ' onload="javascript:document.post.query.focus()"',
-
- 'L_ITEM_SEARCH' => $user->lang['item_search'],
- 'L_SEARCH' => $user->lang['search'],
- 'L_CLOSE_WINDOW' => $user->lang['close_window'])
- );
-
- $eqdkp->set_vars(array(
- 'page_title' => sprintf($user->lang['admin_title_prefix'], $eqdkp->config['guildtag'], $eqdkp->config['dkp_name']).': '.$user->lang['additem_title'],
- 'gen_simple_header' => true,
- 'template_file' => 'admin/additem_search.html',
- 'display' => true)
- );
- }
-}
-
-$mode = ( isset($_GET['mode']) ) ? $_GET['mode'] : 'additem';
-switch ( $mode )
-{
- case 'additem':
- $add_item = new Add_Item;
- $add_item->process();
- break;
-
- case 'search':
- $item_search = new Item_Search;
- $item_search->process();
- break;
-}
-?>
diff --git a/old/admin/addnews.php b/old/admin/addnews.php
deleted file mode 100644
index c39195f..0000000
--- a/old/admin/addnews.php
+++ /dev/null
@@ -1,320 +0,0 @@
-<?php
-/******************************
- * EQdkp
- * Copyright 2002-2003
- * Licensed under the GNU GPL. See COPYING for full terms.
- * ------------------
- * addnews.php
- * Began: Wed December 25 2002
- *
- * $Id: addnews.php 46 2007-06-19 07:29:11Z tsigo $
- *
- ******************************/
-
-define('EQDKP_INC', true);
-define('IN_ADMIN', true);
-$eqdkp_root_path = './../';
-include_once($eqdkp_root_path . 'common.php');
-
-class Add_News extends EQdkp_Admin
-{
- var $news = array(); // Holds news data if URI_NEWS is set @var news
- var $old_news = array(); // Holds news data from before POST @var old_news
-
- function add_news()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID;
-
- parent::eqdkp_admin();
-
- $this->news = array(
- 'news_headline' => post_or_db('news_headline'),
- 'news_message' => post_or_db('news_message')
- );
-
- // Vars used to confirm deletion
- $this->set_vars(array(
- 'confirm_text' => $user->lang['confirm_delete_news'],
- 'uri_parameter' => URI_NEWS)
- );
-
- $this->assoc_buttons(array(
- 'add' => array(
- 'name' => 'add',
- 'process' => 'process_add',
- 'check' => 'a_news_add'),
- 'update' => array(
- 'name' => 'update',
- 'process' => 'process_update',
- 'check' => 'a_news_upd'),
- 'delete' => array(
- 'name' => 'delete',
- 'process' => 'process_delete',
- 'check' => 'a_news_del'),
- 'form' => array(
- 'name' => '',
- 'process' => 'display_form',
- 'check' => 'a_news_'))
- );
-
- // Build the news array
- // ---------------------------------------------------------
- if ( $this->url_id )
- {
- $sql = 'SELECT news_headline, news_message
- FROM ' . NEWS_TABLE . "
- WHERE news_id='" . $this->url_id . "'";
- $result = $db->query($sql);
- if ( !$row = $db->fetch_record($result) )
- {
- message_die($user->lang['error_invalid_news_provided']);
- }
- $db->free_result($result);
-
- $this->time = time();
- $this->news = array(
- 'news_headline' => post_or_db('news_headline', $row),
- 'news_message' => post_or_db('news_message', $row)
- );
- }
- }
-
- function error_check()
- {
- global $user;
-
- $this->fv->is_filled(array(
- 'news_headline' => $user->lang['fv_required_headline'],
- 'news_message' => $user->lang['fv_required_message'])
- );
-
- return $this->fv->is_error();
- }
-
- // ---------------------------------------------------------
- // Process Add
- // ---------------------------------------------------------
- function process_add()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID;
-
- //
- // Insert the news
- //
- $query = $db->build_query('INSERT', array(
- 'news_headline' => stripslashes($_POST['news_headline']),
- 'news_message' => stripslashes($_POST['news_message']),
- 'news_date' => $this->time,
- 'user_id' => $user->data['user_id'])
- );
- $db->query('INSERT INTO ' . NEWS_TABLE . $query);
- $this_news_id = $db->insert_id();
-
- //
- // Logging
- //
- $log_action = array(
- 'header' => '{L_ACTION_NEWS_ADDED}',
- 'id' => $this_news_id,
- '{L_HEADLINE}' => $_POST['news_headline'],
- '{L_MESSAGE_BODY}' => nl2br($_POST['news_message']),
- '{L_ADDED_BY}' => $this->admin_user);
- $this->log_insert(array(
- 'log_type' => $log_action['header'],
- 'log_action' => $log_action)
- );
-
- //
- // Success message
- //
- $success_message = $user->lang['admin_add_news_success'];
- $link_list = array(
- $user->lang['add_news'] => 'addnews.php' . $SID,
- $user->lang['list_news'] => 'listnews.php' . $SID);
- $this->admin_die($success_message, $link_list);
- }
-
- // ---------------------------------------------------------
- // Process Update
- // ---------------------------------------------------------
- function process_update()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID;
-
- //
- // Get the old data
- //
- $this->get_old_data();
-
- //
- // Update the news table
- //
- if ( isset($_POST['update_date']) )
- {
- $query = $db->build_query('UPDATE', array(
- 'news_headline' => stripslashes($_POST['news_headline']),
- 'news_message' => stripslashes($_POST['news_message']),
- 'news_date' => $this->time)
- );
- }
- else
- {
- $query = $db->build_query('UPDATE', array(
- 'news_headline' => stripslashes($_POST['news_headline']),
- 'news_message' => stripslashes($_POST['news_message']))
- );
- }
- $db->query('UPDATE ' . NEWS_TABLE . ' SET ' . $query . " WHERE news_id='" . $this->url_id . "'");
-
- //
- // Logging
- //
- $log_action = array(
- 'header' => '{L_ACTION_NEWS_UPDATED}',
- 'id' => $this->url_id,
- '{L_HEADLINE_BEFORE}' => $this->old_news['news_headline'],
- '{L_MESSAGE_BEFORE}' => nl2br($this->old_news['news_message']),
- '{L_HEADLINE_AFTER}' => $this->find_difference($this->old_news['news_headline'], $_POST['news_headline']),
- '{L_MESSAGE_AFTER}' => nl2br($_POST['news_message']),
- '{L_UPDATED_BY}' => $this->admin_user);
- $this->log_insert(array(
- 'log_type' => $log_action['header'],
- 'log_action' => $log_action)
- );
-
- //
- // Success message
- //
- $success_message = $user->lang['admin_update_news_success'];
- $link_list = array(
- $user->lang['add_news'] => 'addnews.php' . $SID,
- $user->lang['list_news'] => 'listnews.php' . $SID);
- $this->admin_die($success_message, $link_list);
- }
-
- // ---------------------------------------------------------
- // Process Delete (confirmed)
- // ---------------------------------------------------------
- function process_confirm()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID;
-
- //
- // Get the old data
- //
- $this->get_old_data();
-
- //
- // Remove the news entry
- //
- $sql = 'DELETE FROM ' . NEWS_TABLE . "
- WHERE news_id='" . $this->url_id . "'";
- $db->query($sql);
-
- //
- // Logging
- //
- $log_action = array(
- 'header' => '{L_ACTION_NEWS_DELETED}',
- 'id' => $this->url_id,
- '{L_HEADLINE}' => $this->old_news['news_headline'],
- '{L_MESSAGE_BODY}' => nl2br($this->old_news['news_message']));
- $this->log_insert(array(
- 'log_type' => $log_action['header'],
- 'log_action' => $log_action)
- );
-
- //
- // Success message
- //
- $success_message = $user->lang['admin_delete_news_success'];
- $link_list = array(
- $user->lang['add_news'] => 'addnews.php' . $SID,
- $user->lang['list_news'] => 'listnews.php' . $SID);
- $this->admin_die($success_message, $link_list);
- }
-
- // ---------------------------------------------------------
- // Process helper methods
- // ---------------------------------------------------------
- function get_old_data()
- {
- global $db;
-
- $sql = 'SELECT news_headline, news_message
- FROM ' . NEWS_TABLE . "
- WHERE news_id='" . $this->url_id . "'";
- $result = $db->query($sql);
- while ( $row = $db->fetch_record($result) )
- {
- $this->old_news = array(
- 'news_headline' => addslashes($row['news_headline']),
- 'news_message' => addslashes($row['news_message'])
- );
- }
- $db->free_result($result);
- }
-
- // ---------------------------------------------------------
- // Display form
- // ---------------------------------------------------------
- function display_form()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID;
-
- $tpl->assign_vars(array(
- // Form vars
- 'F_ADD_NEWS' => 'addnews.php' . $SID,
- 'NEWS_ID' => $this->url_id,
- 'S_UPDATE' => ( $this->url_id ) ? true : false,
-
- // Form values
- 'HEADLINE' => stripslashes(htmlspecialchars($this->news['news_headline'])),
- 'MESSAGE' => stripmultslashes($this->news['news_message']),
-
- // Language (General)
- 'L_HEADLINE' => $user->lang['headline'],
- 'L_MESSAGE_BODY' => $user->lang['message_body'],
- 'L_ADD_NEWS' => $user->lang['add_news'],
- 'L_RESET' => $user->lang['reset'],
- 'L_UPDATE_NEWS' => $user->lang['update_news'],
- 'L_DELETE_NEWS' => $user->lang['delete_news'],
- 'L_UPDATE_DATE_TO' => sprintf($user->lang['update_date_to'], date('m/d/y h:ia T', time())),
-
- // Language (Help messages)
- 'L_B_HELP' => $user->lang['b_help'],
- 'L_I_HELP' => $user->lang['i_help'],
- 'L_U_HELP' => $user->lang['u_help'],
- 'L_Q_HELP' => $user->lang['q_help'],
- 'L_C_HELP' => $user->lang['c_help'],
- 'L_P_HELP' => $user->lang['p_help'],
- 'L_W_HELP' => $user->lang['w_help'],
-
- // Form validation
- 'FV_HEADLINE' => $this->fv->generate_error('news_headline'),
- 'FV_MESSAGE' => $this->fv->generate_error('news_message'),
-
- // Javascript messages
- 'MSG_HEADLINE_EMPTY' => $user->lang['fv_required_headline'],
- 'MSG_MESSAGE_EMPTY' => $user->lang['fv_required_message'],
-
- // Buttons
- 'S_ADD' => ( !$this->url_id ) ? true : false)
- );
-
- $eqdkp->set_vars(array(
- 'page_title' => sprintf($user->lang['admin_title_prefix'], $eqdkp->config['guildtag'], $eqdkp->config['dkp_name']).': '.$user->lang['addnews_title'],
- 'template_file' => 'admin/addnews.html',
- 'display' => true)
- );
- }
-}
-
-$add_news = new Add_News;
-$add_news->process();
-?>
diff --git a/old/admin/addraid.php b/old/admin/addraid.php
deleted file mode 100644
index a8cf5db..0000000
--- a/old/admin/addraid.php
+++ /dev/null
@@ -1,1303 +0,0 @@
-<?php
-/******************************
- * EQdkp
- * Copyright 2002-2003
- * Licensed under the GNU GPL. See COPYING for full terms.
- * ------------------
- * addraid.php
- * Began: Mon December 23 2002
- *
- * $Id: addraid.php 46 2007-06-19 07:29:11Z tsigo $
- *
- ******************************/
-
-define('EQDKP_INC', true);
-define('IN_ADMIN', true);
-$eqdkp_root_path = './../';
-include_once($eqdkp_root_path . 'common.php');
-
-class Add_Raid extends EQdkp_Admin
-{
- var $raid = array(); // Holds raid data if URI_RAID is set @var raid
- var $old_raid = array(); // Holds raid data from before POST @var old_raid
-
- function add_raid()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID;
-
- parent::eqdkp_admin();
-
- $this->raid = array(
- 'raid_date' => ( !$this->url_id ) ? $this->time : '',
- 'raid_attendees' => post_or_db('raid_attendees'),
- 'raid_name' => post_or_db('raid_name'),
- 'raid_note' => post_or_db('raid_note'),
- 'raid_value' => post_or_db('raid_value')
- );
-
- // Vars used to confirm deletion
- $this->set_vars(array(
- 'confirm_text' => $user->lang['confirm_delete_raid'],
- 'uri_parameter' => URI_RAID)
- );
-
- $this->assoc_buttons(array(
- 'add' => array(
- 'name' => 'add',
- 'process' => 'process_add',
- 'check' => 'a_raid_add'),
- 'update' => array(
- 'name' => 'update',
- 'process' => 'process_update',
- 'check' => 'a_raid_upd'),
- 'delete' => array(
- 'name' => 'delete',
- 'process' => 'process_delete',
- 'check' => 'a_raid_del'),
- 'form' => array(
- 'name' => '',
- 'process' => 'display_form',
- 'check' => 'a_raid_'))
- );
-
- // Build the raid array
- // ---------------------------------------------------------
- if ( $this->url_id )
- {
- $sql = 'SELECT raid_id, raid_name, raid_date, raid_note, raid_value
- FROM ' . RAIDS_TABLE . "
- WHERE raid_id='" . $this->url_id . "'";
- $result = $db->query($sql);
- if ( !$row = $db->fetch_record($result) )
- {
- message_die($user->lang['error_invalid_raid_provided']);
- }
- $db->free_result($result);
-
- $this->time = $row['raid_date'];
- $this->raid = array(
- 'raid_name' => post_or_db('raid_name', $row),
- 'raid_note' => post_or_db('raid_note', $row),
- 'raid_value' => post_or_db('raid_value', $row)
- );
-
- $attendees = array();
- $sql = 'SELECT member_name
- FROM ' . RAID_ATTENDEES_TABLE . "
- WHERE raid_id='" . $this->url_id . "'
- ORDER BY member_name";
- $result = $db->query($sql);
- while ( $row = $db->fetch_record($result) )
- {
- $attendees[] = $row['member_name'];
- }
- $this->raid['raid_attendees'] = ( !empty($_POST['raid_attendees']) ) ? $_POST['raid_attendees'] : implode(',', $attendees);
- unset($attendees);
- }
- }
-
- function error_check()
- {
- global $user;
-
- setlocale(LC_ALL, 'de_DE');
- $this->fv->is_alpha('raid_attendees', $user->lang['fv_alpha_attendees']);
- $this->fv->is_filled('raid_attendees', $user->lang['fv_required_attendees']);
-
- $this->fv->is_within_range('mo', 1, 12, $user->lang['fv_range_month']);
- $this->fv->is_within_range('d', 1, 31, $user->lang['fv_range_day']);
- $this->fv->is_within_range('y', 1998, 2010, $user->lang['fv_range_year']); // How ambitious
- $this->fv->is_within_range('h', 0, 23, $user->lang['fv_range_hour']);
- $this->fv->is_within_range('mi', 0, 59, $user->lang['fv_range_minute']);
- $this->fv->is_within_range('s', 0, 59, $user->lang['fv_range_second']);
-
- if ( !empty($_POST['raid_value']) )
- {
- $this->fv->is_number('raid_value', $user->lang['fv_number_value']);
- }
-
- if ( (@empty($_POST['raid_name'])) || (@sizeof($_POST['raid_name']) == 0) )
- {
- $this->fv->errors['raid_name'] = $user->lang['fv_required_event_name'];
- }
-
- $this->time = mktime($_POST['h'], $_POST['mi'], $_POST['s'], $_POST['mo'], $_POST['d'], $_POST['y']);
-
- return $this->fv->is_error();
- }
-
- // ---------------------------------------------------------
- // Process Add
- // ---------------------------------------------------------
- function process_add()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID;
-
- $success_message = '';
-
- //
- // Raid loop for multiple events
- //
- foreach ( $_POST['raid_name'] as $raid_name )
- {
- //
- // Get the raid value
- //
- $raid_value = $this->get_raid_value($raid_name);
-
- //
- // Insert the raid
- //
- $query = $db->build_query('INSERT', array(
- 'raid_name' => stripslashes($raid_name),
- 'raid_date' => $this->time,
- 'raid_note' => stripslashes($_POST['raid_note']),
- 'raid_value' => $raid_value,
- 'raid_added_by' => $this->admin_user)
- );
- $db->query('INSERT INTO ' . RAIDS_TABLE . $query);
- $this_raid_id = $db->insert_id();
-
- //
- // Attendee handling
- //
- // Make sure that each member's name is properly capitalized
- $raid_attendees = strtolower(preg_replace('/[[:space:]]/i', ' ', $_POST['raid_attendees']));
- $raid_attendees = ucwords($raid_attendees);
-
- // Make the array unique and sort it by name
- $members_array = explode(' ', $raid_attendees);
- $members_array = array_unique($members_array);
- sort($members_array);
- reset($members_array);
-
- //
- // Handle members
- //
- $this->handle_members($members_array, $raid_value, 'process_add');
-
- //
- // Insert the attendees
- //
- // Get rid of the 'blank' member bug
- $raid_attendees = implode(',', $members_array);
- $raid_attendees = preg_replace('/^\,(.+)/', '\1', $raid_attendees);
- $members_array = explode(',', $raid_attendees);
- $this->add_attendees($members_array, $this_raid_id);
-
- //
- // Call plugin add hooks
- //
- $pm->do_hooks('/admin/addraid.php?action=add');
-
- //
- // Logging
- //
- $log_action = array(
- 'header' => '{L_ACTION_RAID_ADDED}',
- 'id' => $this_raid_id,
- '{L_EVENT}' => $raid_name,
- '{L_ATTENDEES}' => implode(', ', $members_array),
- '{L_NOTE}' => $_POST['raid_note'],
- '{L_VALUE}' => $raid_value,
- '{L_ADDED_BY}' => $this->admin_user);
- $this->log_insert(array(
- 'log_type' => $log_action['header'],
- 'log_action' => $log_action)
- );
-
- //
- // Append success message
- //
- $success_message .= sprintf($user->lang['admin_add_raid_success'], $_POST['mo'], $_POST['d'], $_POST['y'], $raid_name) . '<br />';
-
- unset($raid_value, $raid_name);
- } // Raid loop
-
- //
- // Update player status if needed
- //
- if ( $eqdkp->config['hide_inactive'] == 1 )
- {
- $success_message .= '<br /><br />' . $user->lang['admin_raid_success_hideinactive'];
- $success_message .= ' ' . (( $this->update_player_status() ) ? strtolower($user->lang['done']) : strtolower($user->lang['error']));
- }
-
- //
- // Success message
- //
- $link_list = array(
- $user->lang['add_items_from_raid'] => 'additem.php' . $SID . '&amp;raid_id=' . $this_raid_id,
- $user->lang['add_raid'] => 'addraid.php' . $SID,
- $user->lang['list_raids'] => 'listraids.php' . $SID);
- $this->admin_die($success_message, $link_list);
-
- }
-
- // ---------------------------------------------------------
- // Process Update
- // ---------------------------------------------------------
- function process_update()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID;
-
- //
- // Get the old data
- //
- $this->get_old_data();
-
- //
- // Remove the attendees from the old raid
- //
- $db->query('DELETE FROM ' . RAID_ATTENDEES_TABLE . " WHERE raid_id='" . $this->url_id . "'");
-
- //
- // Get the raid value
- //
- $raid_value = $this->get_raid_value($_POST['raid_name']);
-
- //
- // Remove the value of the old raid from the attendees' earned
- //
- $sql = 'UPDATE ' . MEMBERS_TABLE . "
- SET member_earned = member_earned - " . $this->old_raid['raid_value'] . ",
- member_raidcount = member_raidcount - 1
- WHERE member_name IN ('" . str_replace(',', "', '", $this->old_raid['raid_attendees']) . '\')';
- $db->query($sql);
-
- //
- // Update the raid
- //
- $query = $db->build_query('UPDATE', array(
- 'raid_date' => $this->time,
- 'raid_note' => stripslashes($_POST['raid_note']),
- 'raid_value' => $raid_value,
- 'raid_name' => stripslashes($_POST['raid_name']),
- 'raid_updated_by' => $this->admin_user)
- );
- $db->query('UPDATE ' . RAIDS_TABLE . ' SET ' . $query . " WHERE raid_id='" . $this->url_id . "'");
-
- //
- // Add the new, updated raid to attendees' earned
- //
- $raid_attendees = strtolower(preg_replace('/[[:space:]]/i', ' ', $_POST['raid_attendees']));
- $raid_attendees = ucwords($raid_attendees);
-
- $n_members_array = explode(' ', $raid_attendees);
- $n_members_array = array_unique($n_members_array);
- sort($n_members_array);
- reset($n_members_array);
-
- //
- // Handle members
- //
- $this->handle_members($n_members_array, $raid_value, 'process_update');
-
- //
- // Insert the attendees
- //
- // Get rid of the 'blank' member bug
- $raid_attendees = implode(',', $n_members_array);
- $raid_attendees = preg_replace('/^\,(.+)/', '\1', $raid_attendees);
- $n_members_array = explode(',', $raid_attendees);
- $this->add_attendees($n_members_array, $this->url_id);
-
- //
- // Update firstraid / lastraid [ #749201 ]
- //
- $update_firstraid = array(); // Members who need their firstraid updated
- $update_lastraid = array(); // Members who need their lastraid updated
-
- $sql = 'SELECT member_name, member_firstraid, member_lastraid, member_raidcount
- FROM ' . MEMBERS_TABLE . "
- WHERE member_name IN ('" . str_replace(',', "', '", $this->old_raid['raid_attendees']) . '\')';
- $result = $db->query($sql);
- while ( $row = $db->fetch_record($result) )
- {
- // If the raid's date changed...
- if ( $this->time != $this->old_raid['raid_date'] )
- {
- // If the raid's old date is their firstraid, update their firstraid
- if ( $row['member_firstraid'] == $this->old_raid['raid_date'] )
- {
- $update_firstraid[] = $row['member_name'];
- }
-
- // If the raid's old date is their lastraid, update their lastraid
- if ( $row['member_lastraid'] == $this->old_raid['raid_date'] )
- {
- $update_lastraid[] = $row['member_name'];
- }
- }
- }
- $db->free_result($result);
-
- // Find members who were deleted from this raid and revert their first/last
- $old_attendees = explode(',', $this->old_raid['raid_attendees']);
- foreach ( $old_attendees as $member_name )
- {
- if ( !in_array($member_name, $n_members_array) )
- {
- $update_firstraid[] = $member_name;
- $update_lastraid[] = $member_name;
- }
- }
- $update_firstraid = array_unique($update_firstraid);
- $update_lastraid = array_unique($update_lastraid);
-
- sort($update_firstraid);
- sort($update_lastraid);
-
- reset($update_firstraid);
- reset($update_lastraid);
-
- $queries = array();
- // Update selected firstraids if needed
- if ( sizeof($update_firstraid) > 0 )
- {
- $sql = 'SELECT MIN(r.raid_date) AS member_firstraid, ra.member_name
- FROM ' . RAIDS_TABLE . ' r, ' . RAID_ATTENDEES_TABLE . " ra
- WHERE ra.raid_id = r.raid_id
- AND ra.member_name IN ('" . implode("', '", $update_firstraid) . '\')
- AND r.raid_date > 0
- GROUP BY ra.member_name';
- $result = $db->query($sql);
- while ( $row = $db->fetch_record($result) )
- {
- $queries[] = 'UPDATE ' . MEMBERS_TABLE . "
- SET member_firstraid = '" . $row['member_firstraid'] . "'
- WHERE member_name = '" . $row['member_name'] . "'";
- }
- $db->free_result($result);
- }
- // Updated selected lastraids if needed
- if ( sizeof($update_lastraid) > 0 )
- {
- $sql = 'SELECT MAX(r.raid_date) AS member_lastraid, ra.member_name
- FROM ' . RAIDS_TABLE . ' r, ' . RAID_ATTENDEES_TABLE . " ra
- WHERE ra.raid_id = r.raid_id
- AND ra.member_name IN ('" . implode("', '", $update_lastraid) . '\')
- AND r.raid_date > 0
- GROUP BY ra.member_name';
- $result = $db->query($sql);
- while ( $row = $db->fetch_record($result) )
- {
- $queries[] = 'UPDATE ' . MEMBERS_TABLE . "
- SET member_lastraid = '" . $row['member_lastraid'] . "'
- WHERE member_name = '" . $row['member_name'] . "'";
- }
- $db->free_result($result);
- }
- foreach ( $queries as $sql )
- {
- $db->query($sql);
- }
- unset($queries, $sql);
-
- //
- // Call plugin update hooks
- //
- $pm->do_hooks('/admin/addraid.php?action=update');
-
- //
- // Logging
- //
- $old_attendees_array = explode(',', $this->old_raid['raid_attendees']);
- $new_attendees_array = $n_members_array;
-
- $log_action = array(
- 'header' => '{L_ACTION_RAID_UPDATED}',
- 'id' => $this->url_id,
- '{L_EVENT_BEFORE}' => $this->old_raid['raid_name'],
- '{L_ATTENDEES_BEFORE}' => implode(', ', $this->find_difference($new_attendees_array, $old_attendees_array)),
- '{L_NOTE_BEFORE}' => $this->old_raid['raid_note'],
- '{L_VALUE_BEFORE}' => $this->old_raid['raid_value'],
- '{L_EVENT_AFTER}' => $this->find_difference($this->old_raid['raid_name'], $_POST['raid_name']),
- '{L_ATTENDEES_AFTER}' => implode(', ', $this->find_difference($old_attendees_array, $new_attendees_array)),
- '{L_NOTE_AFTER}' => $this->find_difference($this->old_raid['raid_note'], $_POST['raid_note']),
- '{L_VALUE_AFTER}' => $this->find_difference($this->old_raid['raid_value'], $raid_value),
- '{L_UPDATED_BY}' => $this->admin_user);
- $this->log_insert(array(
- 'log_type' => $log_action['header'],
- 'log_action' => $log_action)
- );
-
- //
- // Success message
- //
- $success_message = sprintf($user->lang['admin_update_raid_success'], $_POST['mo'], $_POST['d'], $_POST['y'], $_POST['raid_name']);
-
- // Update player status if needed
- if ( $eqdkp->config['hide_inactive'] == 1 )
- {
- $success_message .= '<br /><br />' . $user->lang['admin_raid_success_hideinactive'];
- $success_message .= ' ' . (( $this->update_player_status() ) ? strtolower($user->lang['done']) : strtolower($user->lang['error']));
- }
-
- $link_list = array(
- $user->lang['add_items_from_raid'] => 'additem.php' . $SID . '&amp;raid_id=' . $this->url_id,
- $user->lang['add_raid'] => 'addraid.php' . $SID,
- $user->lang['list_raids'] => 'listraids.php' . $SID);
- $this->admin_die($success_message, $link_list);
-
- }
-
- // ---------------------------------------------------------
- // Process Delete (confirmed)
- // ---------------------------------------------------------
- function process_confirm()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID;
-
- //
- // Get the old data
- //
- $this->get_old_data();
-
- //
- // Take the value away from the attendees
- //
- $sql = 'UPDATE ' . MEMBERS_TABLE . "
- SET member_earned = member_earned - " . $this->old_raid['raid_value'] . ",
- member_raidcount = member_raidcount - 1
- WHERE member_name IN ('" . str_replace(',', "', '", $this->old_raid['raid_attendees']) . '\')';
- $db->query($sql);
-
- //
- // Remove cost of items from this raid from buyers
- //
- $sql = 'SELECT item_id, item_buyer, item_value
- FROM ' . ITEMS_TABLE . "
- WHERE raid_id='" . $this->url_id . "'";
- $result = $db->query($sql);
- while ( $row = $db->fetch_record($result) )
- {
- $item_value = ( !empty($row['item_value']) ) ? $row['item_value'] : '0.00';
- $sql = 'UPDATE ' . MEMBERS_TABLE . "
- SET member_spent = member_spent - " . $item_value . "
- WHERE member_name='" . $row['item_buyer'] . "'";
- $db->query($sql);
- }
- $db->free_result($result);
-
- //
- // Delete associated items
- //
- $db->query('DELETE FROM ' . ITEMS_TABLE . " WHERE raid_id='" . $this->url_id . "'");
-
- //
- // Delete attendees
- //
- $db->query('DELETE FROM ' . RAID_ATTENDEES_TABLE . " WHERE raid_id='" . $this->url_id . "'");
-
- //
- // Remove the raid itself
- //
- $db->query('DELETE FROM ' . RAIDS_TABLE . " WHERE raid_id='" . $this->url_id . "'");
-
- //
- // Update firstraid / lastraid [ #749201 ]
- //
- $update_firstraid = array(); // Members who need their firstraid updated
- $update_lastraid = array(); // Members who need their lastraid updated
- $zero_firstlast = array(); // Members who only attended one raid: this one - reset their first/last raid
-
- $sql = 'SELECT member_name, member_firstraid, member_lastraid, member_raidcount
- FROM ' . MEMBERS_TABLE . "
- WHERE member_name IN ('" . str_replace(',', "', '", $this->old_raid['raid_attendees']) . '\')';
- $result = $db->query($sql);
- while ( $row = $db->fetch_record($result) )
- {
- // We already updated their raidcount to reflect this deleted raid; so if it's 0, this was their only raid
- if ( $row['member_raidcount'] == '0' )
- {
- $zero_firstlast[] = $row['member_name'];
- }
- else
- {
- // If the raid's old date is their firstraid, update their firstraid
- if ( $row['member_firstraid'] == $this->old_raid['raid_date'] )
- {
- $update_firstraid[] = $row['member_name'];
- }
-
- // If the raid's old date is their lastraid, update their lastraid
- if ( $row['member_lastraid'] == $this->old_raid['raid_date'] )
- {
- $update_lastraid[] = $row['member_name'];
- }
- }
- }
- $db->free_result($result);
-
- // Zero the first/last raids if this was their only raid
- if ( sizeof($zero_firstlast) > 0 )
- {
- $sql = 'UPDATE ' . MEMBERS_TABLE . "
- SET member_firstraid = 0,
- member_lastraid = 0
- WHERE member_name IN ('" . implode("', '", $zero_firstlast) . '\')';
- $db->query($sql);
- }
-
- $queries = array();
- // Update selected firstraids if needed
- if ( sizeof($update_firstraid) > 0 )
- {
- $sql = 'SELECT MIN(r.raid_date) AS member_firstraid, ra.member_name
- FROM ' . RAIDS_TABLE . ' r, ' . RAID_ATTENDEES_TABLE . " ra
- WHERE ra.raid_id = r.raid_id
- AND ra.member_name IN ('" . implode("', '", $update_firstraid) . '\')
- AND r.raid_date > 0
- GROUP BY ra.member_name';
- $result = $db->query($sql);
- while ( $row = $db->fetch_record($result) )
- {
- $queries[] = 'UPDATE ' . MEMBERS_TABLE . "
- SET member_firstraid = '" . $row['member_firstraid'] . "'
- WHERE member_name = '" . $row['member_name'] . "'";
- }
- $db->free_result($result);
- }
- // Updated selected lastraids if needed
- if ( sizeof($update_lastraid) > 0 )
- {
- $sql = 'SELECT MAX(r.raid_date) AS member_lastraid, ra.member_name
- FROM ' . RAIDS_TABLE . ' r, ' . RAID_ATTENDEES_TABLE . " ra
- WHERE ra.raid_id = r.raid_id
- AND ra.member_name IN ('" . implode("', '", $update_lastraid) . '\')
- AND r.raid_date > 0
- GROUP BY ra.member_name';
- $result = $db->query($sql);
- while ( $row = $db->fetch_record($result) )
- {
- $queries[] = 'UPDATE ' . MEMBERS_TABLE . "
- SET member_lastraid = '" . $row['member_lastraid'] . "'
- WHERE member_name = '" . $row['member_name'] . "'";
- }
- $db->free_result($result);
- }
- foreach ( $queries as $sql )
- {
- $db->query($sql);
- }
- unset($queries, $sql);
-
- //
- // Call plugin delete hooks
- //
- $pm->do_hooks('/admin/addraid.php?action=delete');
-
- //
- // Logging
- //
- $log_action = array(
- 'header' => '{L_ACTION_RAID_DELETED}',
- 'id' => $this->url_id,
- '{L_EVENT}' => $this->old_raid['raid_name'],
- '{L_ATTENDEES}' => str_replace(',', ', ', $this->old_raid['raid_attendees']),
- '{L_NOTE}' => $this->old_raid['raid_note'],
- '{L_VALUE}' => $this->old_raid['raid_value']);
- $this->log_insert(array(
- 'log_type' => $log_action['header'],
- 'log_action' => $log_action)
- );
-
- //
- // Success message
- //
- $success_message = $user->lang['admin_delete_raid_success'];
-
- // Update player status if needed
- if ( $eqdkp->config['hide_inactive'] == 1 )
- {
- $success_message .= '<br /><br />' . $user->lang['admin_raid_success_hideinactive'];
- $success_message .= ' ' . (( $this->update_player_status() ) ? strtolower($user->lang['done']) : strtolower($user->lang['error']));
- }
-
- $link_list = array(
- $user->lang['add_raid'] => 'addraid.php' . $SID,
- $user->lang['list_raids'] => 'listraids.php' . $SID);
- $this->admin_die($success_message, $link_list);
- }
-
- // ---------------------------------------------------------
- // Process helper methods
- // ---------------------------------------------------------
- /**
- * Populate the old_raid array
- */
- function get_old_data()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID;
-
- $sql = 'SELECT raid_name, raid_value, raid_note, raid_date
- FROM ' . RAIDS_TABLE . "
- WHERE raid_id='" . $this->url_id . "'";
- $result = $db->query($sql);
- while ( $row = $db->fetch_record($result) )
- {
- $this->old_raid = array(
- 'raid_name' => addslashes($row['raid_name']),
- 'raid_value' => addslashes($row['raid_value']),
- 'raid_note' => addslashes($row['raid_note']),
- 'raid_date' => addslashes($row['raid_date'])
- );
- }
- $db->free_result($result);
-
- $sql = 'SELECT r.member_name
- FROM ' . RAID_ATTENDEES_TABLE . " r, " . MEMBERS_TABLE . " m
- WHERE m.member_name = r.member_name AND raid_id='" . $this->url_id . "'
- ORDER BY member_name";
- $result = $db->query($sql);
- while ( $row = $db->fetch_record($result) )
- {
- $attendees[] = $row['member_name'];
- }
- $this->old_raid['raid_attendees'] = @implode(',', $attendees);
- unset($attendees);
- }
-
- /**
- * Determine this raid's value
- *
- * @param $raid_name
- * @return string Raid value
- */
- function get_raid_value($raid_name)
- {
- global $db;
-
- // Check if they entered a one-time value; Get the preset value of the raid(s) if not
- if ( empty($_POST['raid_value']) )
- {
- $raid_value = $db->query_first('SELECT event_value FROM ' . EVENTS_TABLE . " WHERE event_name='" . addslashes($raid_name) . "'");
-
- if (!isset($raid_value)) {
- $raid_value = 0;
- }
-
- }
- else
- {
- $raid_value = $_POST['raid_value'];
- }
-
- // Still no post value?
- if ( empty($raid_value) )
- {
- $raid_value = '0.00';
- }
-
- return $raid_value;
- }
-
- /**
- * Get member level/race/class from database or SESSION data
- *
- * @param $member_name
- * @return Array
- */
- function get_member_info($member_name)
- {
- global $db, $eqdkp;
-
- if ($_SESSION[$member_name]['class'] == "") {
- unset($_SESSION[$member_name]['class']);
- }
-
- if ($_SESSION[$member_name]['level'] == "") {
- unset($_SESSION[$member_name]['level']);
- }
-
- if ($_SESSION[$member_name]['race'] == "") {
- unset($_SESSION[$member_name]['race']);
- }
-
- if ( isset($_SESSION[$member_name]['level']) && isset($_SESSION[$member_name]['class']) ) {
-
- $sql = "SELECT race_name FROM " . RACE_TABLE . " WHERE race_name = '" . $_SESSION[$member_name]['race'] . "'";
- $race_name = $db->query_first($sql);
-
- if (!isset($race_name)) {
- $race_name = "Unknown";
- }
-
- $retval = array(
- 'name' => $_SESSION[$member_name],
- 'level' => ( isset($_SESSION[$member_name]['level']) ) ? $_SESSION[$member_name]['level'] : false,
- 'race' => $race_name,
- 'class' => ( isset($_SESSION[$member_name]['class']) ) ? $_SESSION[$member_name]['class'] : false);
-
- unset($_SESSION[$member_name]);
-
-
- } else {
-
-
- $sql = "SELECT member_name, member_race_id, member_class_id, member_level FROM " . MEMBERS_TABLE . "
- WHERE member_name = '" . $member_name . "'";
- $result = $db->query($sql);
- $info = $db->fetch_record($result);
-
- if (!isset($info['member_level'])) {
- $member_level = "1";
- }
-
- $sql = "SELECT race_name FROM " . RACE_TABLE . " WHERE race_id = '" . $info['member_race_id'] . "'";
- $race_name = $db->query_first($sql);
-
- if (!isset($race_name)) {
- $race_name = "Unknown";
- }
-
- $sql = "SELECT class_name FROM " . CLASS_TABLE . " WHERE class_id = '" . $info['member_class_id'] . "'";
- $class_name = $db->query_first($sql);
-
- if (!isset($class_name)) {
- $class_name = "Unknown";
- }
-
- $retval = array(
- 'name' => $member_name,
- 'race' => $race_name,
- 'level' => $member_level,
- 'class' => $class_name);
- }
-
- return $retval;
- }
-
- /**
- * Insert members into raid attendees table
- *
- * @param $members_array Array of members
- * @param $raid_id
- */
- function add_attendees(&$members_array, $raid_id)
- {
- global $db;
-
- $query = array();
- foreach ( $members_array as $member_name )
- {
- $query[] = "($raid_id, '" . $member_name . "')";
- }
-
- $sql = 'INSERT INTO ' . RAID_ATTENDEES_TABLE . ' (raid_id, member_name)
- VALUES ' . implode(', ', $query);
- $db->query($sql);
- }
-
- /**
- * Update existing members / add new members
- *
- * @param $members_array
- * @param $raid_value
- * @param $time_check
- */
- function handle_members(&$members_array, $raid_value, $process)
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID;
-
- // Grab our array of name => class/level/race
- session_start();
-
- //
- // Handle existing members
- //
- $update_sql_members = array();
- $updated_members = array();
- $raid_attendees = array();
-
- $sql = 'SELECT m.member_name, m.member_firstraid, m.member_lastraid, m.member_level, r.race_name AS member_race,
- c.class_name AS member_class, m.member_raidcount
- FROM ' . MEMBERS_TABLE .' m, '. CLASS_TABLE .' c, '.RACE_TABLE.' r
- WHERE r.race_id = m.member_race_id
- AND c.class_id = m.member_class_id';
- $result = $db->query($sql);
- while ( $row = $db->fetch_record($result) )
- {
- $member_name = trim(str_replace(' ', '', $row['member_name']));
-
- // Make sure the member is in the attendees list before proceeding
- if ( (!in_array($member_name, $members_array)) || (empty($member_name)) )
- {
- continue;
- }
-
- $raid_attendees[] = $member_name;
-
- // raidcount and/or firstraid is 0 - they exist but we need to set their firstraid to this date [ #705206 ]
- if ( ($row['member_raidcount'] == '0') || ($row['member_firstraid'] == '0') )
- {
- $sql = 'UPDATE ' . MEMBERS_TABLE . '
- SET member_earned = member_earned + ' . $raid_value . ",
- member_firstraid = '" . $this->time . "',
- member_lastraid = '" . $this->time . "',
- member_raidcount = member_raidcount + 1
- WHERE member_name = '" . $member_name . "'";
- $db->query($sql);
-
- $updated_members[] = $member_name;
- continue;
- }
- else
- {
- $updated_members[] = $member_name;
- }
-
- // Check for race/class/level data for this member
- $member_data = $this->get_member_info($member_name);
-
- if ( (!(isset($member_data['race']) )) || $member_data['race'] == 'Unknown' )
- {
- $member_data['race'] = $row['member_race'];
- }
-
- if ( (!(isset($member_data['class']) )) || $member_data['class'] == 'Unknown' )
- {
- $member_data['class'] = $row['member_class'];
- }
-
- $member_level = ( is_numeric($member_data['level']) ) ? trim($member_data['level']) : 'member_level';
- $member_race = ( is_string($member_data['race']) ) ? trim($member_data['race']) : 'member_race';
- $member_class = ( is_string($member_data['class']) ) ? trim($member_data['class']) : 'member_class';
- unset($member_data);
-
- // Update this member's race/class/level if they changed
- $time_check = ( $process == 'process_add' ) ? ($this->time > $row['member_lastraid']) : ($this->time <= $row['member_lastraid']);
- $level_check = ( ($member_level != $row['member_level']) && ($member_level != 'member_level') ) ? true : false;
- $race_check = ( ($member_race != $row['member_race']) && ($member_race != 'member_race') ) ? true : false;
- $class_check = ( ($member_class != $row['member_class']) && ($member_class != 'member_class') ) ? true : false;
-
- if ( ($time_check) && ($level_check || $race_check || $class_check) )
- {
- // For comparison, quotes need to be added after the if statement above
- $member_level = ( $member_level != 'member_level' ) ? '\'' . $member_level . '\'' : $member_level;
- $member_race = ( $member_race != 'member_race' ) ? '\'' . $member_race . '\'' : $member_race;
- $member_class = ( $member_class != 'member_class' ) ? '\'' . $member_class . '\'' : $member_class;
-
-
- // Process the update
- $sql = 'UPDATE ' . MEMBERS_TABLE . ' m, ' . CLASS_TABLE . ' c, ' . RACE_TABLE . ' r
- SET m.member_earned = m.member_earned + ' . $raid_value . ',';
-
- // Do not update their lastraid if it's greater than this raid's date [ #749201 ]
- if ( $row['member_lastraid'] < $this->time )
- {
- $sql .= "m.member_lastraid = '" . $this->time . "',";
- }
-
- $sql .= ' m.member_raidcount = m.member_raidcount + 1,
- m.member_level = ' . $member_level . ',
- m.member_race_id = r.race_id,
- m.member_class_id = c.class_id
- WHERE r.race_name = '.$member_race.'
- AND c.class_name = '.$member_class.'
- AND m.member_name = "' . $member_name . '"';
- $db->query($sql);
- }
- // If they didn't, their update is lumped into $update_sql (below)
- else
- {
- $update_sql_members[] = $member_name;
- }
- }
- $db->free_result($result);
- session_destroy();
-
- // Run the lump update if we need to
- if ( sizeof($update_sql_members) > 0 )
- {
- $sql = 'UPDATE ' . MEMBERS_TABLE . '
- SET member_raidcount = member_raidcount + 1,
- member_earned = member_earned + ' . $raid_value . "
- WHERE member_name IN ('" . implode("', '", $update_sql_members) . '\')';
- $db->query($sql);
- }
-
- //
- // Update firstraid / lastraid [ #749201 ]
- //
- $this->update_member_firstraid($raid_attendees, $this->time);
- $this->update_member_lastraid($raid_attendees, $this->time);
-
- //
- // Handle new members
- //
- $new_members = array_diff($members_array, $updated_members);
- foreach ( $new_members as $member_name )
- {
- $member_name = trim($member_name);
- if ( $member_name != '' )
- {
- $member_data2 = $this->get_member_info($member_name);
-
- $class = $member_data2['class'];
- $race = $member_data2['race'];
-
- if ( ! ( isset($class) ) || ($class == "") ) {
- $class = "Unknown";
- }
-
-
- $class_id_number = $db->query_first('SELECT class_id FROM ' . CLASS_TABLE . ' WHERE class_name = "'.$class.'"');
- $race_id_number = $db->query_first('SELECT race_id FROM ' . RACE_TABLE . ' WHERE race_name = "'.$race.'"');
-
- if (!isset($race_id_number)) {
- $race_id_number = 0;
- }
-
- if (!isset($class_id_number)) {
- $class_id_number = 0;
- }
-
- $query = $db->build_query('INSERT', array(
- 'member_name' => $member_name,
- 'member_earned' => $raid_value,
- 'member_status' => '1',
- 'member_firstraid' => $this->time,
- 'member_lastraid' => $this->time,
- 'member_raidcount' => '1',
- 'member_level' => $member_data2['level'],
- 'member_race_id' => $race_id_number,
- 'member_class_id' => $class_id_number,
- 'member_rank_id' => '0')
- );
- $db->query('INSERT INTO ' . MEMBERS_TABLE . $query);
- }
- }
-
- // For any member who has a 0 raidcount, reset their first/last raid to 0
- $sql = 'UPDATE ' . MEMBERS_TABLE . "
- SET member_firstraid = '0', member_lastraid='0'
- WHERE member_raidcount='0'";
- $db->query($sql);
- }
-
- /**
- * Update members' firstraid
- *
- * @param array $members_array
- * @param string $time_check Time to check
- */
- function update_member_firstraid(&$members_array, $time_check)
- {
- global $db;
-
- if ( sizeof($members_array) > 0 )
- {
- $sql = 'UPDATE ' . MEMBERS_TABLE . "
- SET member_firstraid = '" . $time_check . "'
- WHERE member_name IN ('" . implode("', '", $members_array) . '\')
- AND member_firstraid > ' . $time_check;
- $db->query($sql);
- }
- }
-
- /**
- * Update members' lastraid
- *
- * @param array $members_array
- * @param string $time_check Time to check
- */
- function update_member_lastraid(&$members_array, $time_check)
- {
- global $db;
-
- if ( sizeof($members_array) > 0 )
- {
- $sql = 'UPDATE ' . MEMBERS_TABLE . "
- SET member_lastraid = '" . $time_check . "'
- WHERE member_name IN ('" . implode("', '", $members_array) . '\')
- AND member_lastraid < ' . $time_check;
- $db->query($sql);
- }
- }
-
-
-
-
- /**
- * Update active/inactive player status
- *
- * @return bool
- */
- function update_player_status()
- {
- global $db, $eqdkp, $user;
-
- $inactive_time = mktime(0, 0, 0, date('m'), date('d')-$eqdkp->config['inactive_period'], date('Y'));
-
- $active_members = array();
- $inactive_members = array();
-
- // Don't go through this whole thing of active/inactive adjustments if we don't need to.
- if ( ($eqdkp->config['active_point_adj'] != '0.00') || ($eqdkp->config['inactive_point_adj'] != '0.00') )
- {
- $time = time();
- $sql = 'SELECT member_name, member_status, member_lastraid
- FROM ' . MEMBERS_TABLE;
- $result = $db->query($sql);
- while ( $row = $db->fetch_record($result) )
- {
- unset($adj_value);
- unset($adj_reason);
-
- // Active -> Inactive
- if ( ($eqdkp->config['inactive_point_adj'] != '0.00') && ($row['member_status'] == '1') && ($row['member_lastraid'] < $inactive_time) )
- {
- $adj_value = $eqdkp->config['inactive_point_adj'];
- $adj_reason = 'Inactive adjustment';
-
- $inactive_members[] = $row['member_name'];
- }
- // Inactive -> Active
- elseif ( ($eqdkp->config['active_point_adj'] != '0.00') && ($row['member_status'] == '0') && ($row['member_lastraid'] >= $inactive_time) )
- {
- $adj_value = $eqdkp->config['active_point_adj'];
- $adj_reason = 'Active adjustment';
-
- $active_members[] = $row['member_name'];
- }
-
- //
- // Insert individual adjustment
- //
- if ( (isset($adj_value)) && (isset($adj_reason)) )
- {
- $group_key = $this->gen_group_key($time, $adj_reason, $adj_value);
-
- $query = $db->build_query('INSERT', array(
- 'adjustment_value' => $adj_value,
- 'adjustment_date' => $time,
- 'member_name' => $row['member_name'],
- 'adjustment_reason' => $adj_reason,
- 'adjustment_group_key' => $group_key,
- 'adjustment_added_by' => $user->data['username'])
- );
- $db->query('INSERT INTO ' . ADJUSTMENTS_TABLE . $query);
- }
- }
-
- // Update inactive members' adjustment
- if ( sizeof($inactive_members) > 0 )
- {
- $adj_value = $eqdkp->config['inactive_point_adj'];
- $adj_reason = 'Inactive adjustment';
-
- $sql = 'UPDATE ' . MEMBERS_TABLE . "
- SET member_status='0', member_adjustment = member_adjustment + " . $eqdkp->config['inactive_point_adj'] . "
- WHERE member_name IN ('" . implode("', '", $inactive_members) . '\')';
-
- $log_action = array(
- 'header' => '{L_ACTION_INDIVADJ_ADDED}',
- '{L_ADJUSTMENT}' => $eqdkp->config['inactive_point_adj'],
- '{L_MEMBERS}' => implode(', ', $inactive_members),
- '{L_REASON}' => 'Inactive adjustment',
- '{L_ADDED_BY}' => $user->data['username']);
- $this->log_insert(array(
- 'log_type' => $log_action['header'],
- 'log_action' => $log_action)
- );
- }
-
- // Update active members' adjustment
- if ( sizeof($active_members) > 0 )
- {
- $sql = 'UPDATE ' . MEMBERS_TABLE . "
- SET member_status='1', member_adjustment = member_adjustment + " . $eqdkp->config['active_point_adj'] . "
- WHERE member_name IN ('" . implode("', '", $active_members) . '\')';
- $db->query($sql);
-
- $log_action = array(
- 'header' => '{L_ACTION_INDIVADJ_ADDED}',
- '{L_ADJUSTMENT}' => $eqdkp->config['active_point_adj'],
- '{L_MEMBERS}' => implode(', ', $active_members),
- '{L_REASON}' => 'Active adjustment',
- '{L_ADDED_BY}' => $user->data['username']);
- $this->log_insert(array(
- 'log_type' => $log_action['header'],
- 'log_action' => $log_action)
- );
- }
- }
- else
- {
- // Active -> Inactive
- $db->query('UPDATE ' . MEMBERS_TABLE . " SET member_status='0' WHERE (member_lastraid < " . $inactive_time . ") AND (member_status='1')");
-
- // Inactive -> Active
- $db->query('UPDATE ' . MEMBERS_TABLE . " SET member_status='1' WHERE (member_lastraid >= " . $inactive_time . ") AND (member_status='0')");
- }
-
-
- // If your class_id doesn't match your level, update your class ID to the one that has
- // the same class_name, but the correct min and max level.
- $sql = "SELECT m.member_name, m.member_level, c.class_name, c.class_id, c.class_min_level, c.class_max_level
- FROM " . MEMBERS_TABLE ." m, " . CLASS_TABLE . " c
- WHERE m.member_class_id = c.class_id";
- $result = $db->query($sql);
-
- while ( $row = $db->fetch_record($result) ) {
-
- if ( isset($row['member_level']) && ($row['member_level'] > $row['class_max_level'] || $row['member_level'] < $row['class_min_level'])) {
-
- $sql = "SELECT class_id
- FROM " . CLASS_TABLE . "
- WHERE class_name = '" . $row['class_name'] ."'
- AND class_min_level < '" . $row['member_level'] ."'
- AND class_max_level >= '" . $row['member_level'] ."'";
- $new_class_id = $db->query_first($sql);
-
- if (!isset($new_class_id)) {
- $new_class_id = 0;
- }
-
- $sql = "UPDATE " . MEMBERS_TABLE . "
- SET member_class_id = '" . $new_class_id . "'
- WHERE member_name = '" . $row['member_name'] . "'";
- $db->query($sql);
-
- }
- }
-
-
- return true;
- }
-
- // ---------------------------------------------------------
- // Display form
- // ---------------------------------------------------------
- function display_form()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID;
-
- //
- // Find the value of the event, or use the one-time value from the form
- //
- $raid_name = ( is_array($this->raid['raid_name']) ) ? (( isset($this->raid['raid_name'][0]) ) ? $this->raid['raid_name'][0] : '' ) : $this->raid['raid_name'];
- $preset_value = $db->query_first('SELECT event_value FROM ' . EVENTS_TABLE . " WHERE event_name='" . addslashes($raid_name) . "'");
- $raid_value = ( $this->raid['raid_value'] == 0 ) ? '' : $this->raid['raid_value'];
- $raid_value = ( $this->raid['raid_value'] == $preset_value ) ? '' : $this->raid['raid_value'];
-
- //
- // Build member drop-down
- //
- $sql = 'SELECT member_name
- FROM ' . MEMBERS_TABLE . '
- ORDER BY member_name';
- $result = $db->query($sql);
- while ( $row = $db->fetch_record($result) )
- {
- $tpl->assign_block_vars('members_row', array(
- 'VALUE' => $row['member_name'],
- 'OPTION' => $row['member_name'])
- );
- }
- $db->free_result($result);
-
- //
- // Build event drop-down
- //
- $max_value = $db->query_first('SELECT max(event_value) FROM ' . EVENTS_TABLE);
-
- if (!isset($max_value)) {
- $max_value = 0;
- }
-
- $float = @explode('.', $max_value);
- $format = '%0' . @strlen($float[0]) . '.2f';
-
- $sql = 'SELECT event_id, event_name, event_value
- FROM ' . EVENTS_TABLE . '
- ORDER BY event_name';
- $result = $db->query($sql);
- while ( $row = $db->fetch_record($result) )
- {
- $select_check = ( is_array($this->raid['raid_name']) ) ? in_array(stripslashes($row['event_name']), $this->raid['raid_name']) : stripslashes($row['event_name']) == $this->raid['raid_name'];
-
- $tpl->assign_block_vars('events_row', array(
- 'VALUE' => stripslashes($row['event_name']),
- 'SELECTED' => ( $select_check ) ? ' selected="selected"' : '',
- 'OPTION' => '(' . sprintf($format, $row['event_value']) . ') - ' . stripslashes($row['event_name']))
- );
- }
- $db->free_result($result);
-
- $tpl->assign_vars(array(
- // Form vars
- 'F_ADD_RAID' => 'addraid.php' . $SID,
- 'RAID_ID' => $this->url_id,
- 'U_ADD_EVENT' => 'addevent.php'.$SID,
- 'S_EVENT_MULTIPLE' => ( !$this->url_id ) ? true : false,
-
- // Form values
- 'RAID_ATTENDEES' => str_replace(',', "\n", $this->raid['raid_attendees']),
- 'RAID_VALUE' => stripslashes($raid_value),
- 'RAID_NOTE' => stripslashes(htmlspecialchars($this->raid['raid_note'])),
- 'MO' => date('m', $this->time),
- 'D' => date('d', $this->time),
- 'Y' => date('Y', $this->time),
- 'H' => date('H', $this->time),
- 'MI' => date('i', $this->time),
- 'S' => date('s', $this->time),
-
- // Language
- 'L_ADD_RAID_TITLE' => $user->lang['addraid_title'],
- 'L_ATTENDEES' => $user->lang['attendees'],
- 'L_PARSE_LOG' => $user->lang['parse_log'],
- 'L_SEARCH_MEMBERS' => $user->lang['search_members'],
- 'L_EVENT' => $user->lang['event'],
- 'L_ADD_EVENT' => strtolower($user->lang['add_event']),
- 'L_VALUE' => $user->lang['value'],
- 'L_ADDRAID_VALUE_NOTE' => $user->lang['addraid_value_note'],
- 'L_DATE' => $user->lang['date'],
- 'L_TIME' => $user->lang['time'],
- 'L_ADDRAID_DATETIME_NOTE' => $user->lang['addraid_datetime_note'],
- 'L_NOTE' => $user->lang['note'],
- 'L_ADD_RAID' => $user->lang['add_raid'],
- 'L_RESET' => $user->lang['reset'],
- 'L_UPDATE_RAID' => $user->lang['update_raid'],
- 'L_DELETE_RAID' => $user->lang['delete_raid'],
-
- // Form validation
- 'FV_ATTENDEES' => $this->fv->generate_error('raid_attendees'),
- 'FV_EVENT_NAME' => $this->fv->generate_error('raid_name'),
- 'FV_VALUE' => $this->fv->generate_error('raid_value'),
- 'FV_MO' => $this->fv->generate_error('mo'),
- 'FV_D' => $this->fv->generate_error('d'),
- 'FV_Y' => $this->fv->generate_error('y'),
- 'FV_H' => $this->fv->generate_error('h'),
- 'FV_MI' => $this->fv->generate_error('mi'),
- 'FV_S' => $this->fv->generate_error('s'),
-
- // Javascript messages
- 'MSG_ATTENDEES_EMPTY' => $user->lang['fv_required_attendees'],
- 'MSG_NAME_EMPTY' => $user->lang['fv_required_event_name'],
- 'MSG_GAME_NAME' => $eqdkp->config['default_game'],
-
- // Buttons
- 'S_ADD' => ( !$this->url_id ) ? true : false)
- );
-
- $eqdkp->set_vars(array(
- 'page_title' => sprintf($user->lang['admin_title_prefix'], $eqdkp->config['guildtag'], $eqdkp->config['dkp_name']).': '.$user->lang['addraid_title'],
- 'template_file' => 'admin/addraid.html',
- 'display' => true)
- );
- }
-}
-
-$add_raid = new Add_Raid;
-$add_raid->process();
-?>
diff --git a/old/admin/addturnin.php b/old/admin/addturnin.php
deleted file mode 100644
index 5f4088f..0000000
--- a/old/admin/addturnin.php
+++ /dev/null
@@ -1,252 +0,0 @@
-<?php
-/******************************
- * EQdkp
- * Copyright 2002-2003
- * Licensed under the GNU GPL. See COPYING for full terms.
- * ------------------
- * addturnin.php
- * Began: Sat January 4 2003
- *
- * $Id: addturnin.php 46 2007-06-19 07:29:11Z tsigo $
- *
- ******************************/
-
-define('EQDKP_INC', true);
-define('IN_ADMIN', true);
-$eqdkp_root_path = './../';
-include_once($eqdkp_root_path . 'common.php');
-
-class Add_Turnin extends EQdkp_Admin
-{
- var $turnin = array(); // Holds turnin data @var turnin
-
- function add_turnin()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID;
-
- parent::eqdkp_admin();
-
- $this->turnin = array(
- 'from' => post_or_db('turnin_from'),
- 'to' => post_or_db('turnin_to')
- );
-
- $this->assoc_buttons(array(
- 'add' => array(
- 'name' => 'add',
- 'process' => 'process_add',
- 'check' => 'a_turnin_add'),
- 'proceed' => array(
- 'name' => 'proceed',
- 'process' => 'display_step2',
- 'check' => 'a_turnin_add'),
- 'form' => array(
- 'name' => '',
- 'process' => 'display_form',
- 'check' => 'a_raid_'))
- );
- }
-
- function error_check()
- {
- global $user;
-
- if ( isset($_POST['turnin_from']) )
- {
- if ( ($_POST['turnin_from'] == $_POST['turnin_to']) || (empty($_POST['turnin_from'])) || (empty($_POST['turnin_to'])) )
- {
- $this->fv->errors['turnin_from'] = $user->lang['fv_difference_turnin'];
- $this->fv->errors['turnin_to'] = $user->lang['fv_difference_turnin'];
- }
-
- $this->turnin = array(
- 'from' => post_or_db('turnin_from'),
- 'to' => post_or_db('turnin_to')
- );
- }
-
- return $this->fv->is_error();
- }
-
- // ---------------------------------------------------------
- // Process Add
- // ---------------------------------------------------------
- function process_add()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID;
-
- //
- // Get item information
- //
- $sql = 'SELECT item_value, item_name
- FROM ' . ITEMS_TABLE . "
- WHERE item_id='" . $_POST['item_id'] . "'";
- $result = $db->query($sql);
- $row = $db->fetch_record($result);
-
- $item_value = ( !empty($row['item_value']) ) ? $row['item_value'] : '0.00';
-
- //
- // Remove price from the 'From' member
- //
- $sql = 'UPDATE ' . MEMBERS_TABLE . '
- SET member_spent = member_spent - ' . $item_value . "
- WHERE member_name='" . $_POST['from'] . "'";
- $db->query($sql);
-
- //
- // Add the price to the 'To' member
- //
- $sql = 'UPDATE ' . MEMBERS_TABLE . '
- SET member_spent = member_spent + ' . $item_value . "
- WHERE member_name='" . $_POST['to'] . "'";
- $db->query($sql);
-
- //
- // Change the buyer
- //
- $sql = 'UPDATE ' . ITEMS_TABLE . "
- SET item_buyer='" . $_POST['to'] . "'
- WHERE item_id='" . $_POST['item_id'] . "'";
- $db->query($sql);
-
- //
- // Logging
- //
- $log_action = array(
- 'header' => '{L_ACTION_TURNIN_ADDED}',
- '{L_ITEM}' => addslashes($row['item_name']),
- '{L_VALUE}' => $item_value,
- '{L_FROM}' => $_POST['from'],
- '{L_TO}' => $_POST['to'],
- '{L_ADDED_BY}' => $this->admin_user);
- $this->log_insert(array(
- 'log_type' => $log_action['header'],
- 'log_action' => $log_action)
- );
-
- $success_message = sprintf($user->lang['admin_add_turnin_success'], $row['item_name'], $_POST['from'], $_POST['to']);
- $this->admin_die($success_message);
- }
-
- // ---------------------------------------------------------
- // Process Step 2
- // ---------------------------------------------------------
- function display_step2()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID;
-
- $max_value = $db->query_first('SELECT max(item_value) FROM ' . ITEMS_TABLE . " WHERE item_buyer='" . $_POST['turnin_from'] . "'");
- $float = @explode('.', $max_value);
- $format = '%0'.@strlen($float[0]).'.2f';
-
- $sql = 'SELECT item_id, item_name, item_value
- FROM ' . ITEMS_TABLE . "
- WHERE item_buyer='" . $_POST['turnin_from'] . "'
- ORDER BY item_name";
- $result = $db->query($sql);
- while ( $row = $db->fetch_record($result) )
- {
- $tpl->assign_block_vars('items_row', array(
- 'VALUE' => $row['item_id'],
- 'OPTION' => '(' . sprintf($format, $row['item_value']) . ') - ' . stripslashes($row['item_name']))
- );
- }
-
- $tpl->assign_vars(array(
- // Form vars
- 'F_ADD_TURNIN' => 'addturnin.php' . $SID,
- 'S_STEP1' => false,
-
- // Form values
- 'FROM' => $this->turnin['from'],
- 'TO' => $this->turnin['to'],
- 'TURNIN_FROM' => $this->turnin['from'],
- 'TURNIN_TO' => $this->turnin['to'],
-
- // Language
- 'L_ADD_TURNIN_TITLE' => sprintf($user->lang['addturnin_title'], '2'),
- 'L_FROM' => $user->lang['from'],
- 'L_TO' => $user->lang['to'],
- 'L_ADD_TURNIN' => $user->lang['add_turnin'],
- 'L_ITEM' => $user->lang['item'],
-
- // Form validation
- 'FV_TURNIN_FROM' => $this->fv->generate_error('turnin_from'),
- 'FV_TURNIN_TO' => $this->fv->generate_error('turnin_to'),
-
- // Javascript messages
- 'MSG_FROM_TO_SAME' => $user->lang['fv_difference_turnin'])
- );
-
- $eqdkp->set_vars(array(
- 'page_title' => sprintf($user->lang['admin_title_prefix'], $eqdkp->config['guildtag'], $eqdkp->config['dkp_name']).': '.sprintf($user->lang['addturnin_title'], '2'),
- 'template_file' => 'admin/addturnin.html',
- 'display' => true)
- );
- }
-
- // ---------------------------------------------------------
- // Display form
- // ---------------------------------------------------------
- function display_form()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID;
-
- $sql = 'SELECT member_name
- FROM ' . MEMBERS_TABLE . '
- ORDER BY member_name';
- $result = $db->query($sql);
- while ( $row = $db->fetch_record($result) )
- {
- $tpl->assign_block_vars('turnin_from_row', array(
- 'VALUE' => $row['member_name'],
- 'SELECTED' => ( $this->turnin['from'] == $row['member_name'] ) ? ' selected="selected"' : '',
- 'OPTION' => $row['member_name'])
- );
-
- $tpl->assign_block_vars('turnin_to_row', array(
- 'VALUE' => $row['member_name'],
- 'SELECTED' => ( $this->turnin['to'] == $row['member_name'] ) ? ' selected="selected"' : '',
- 'OPTION' => $row['member_name'])
- );
- }
-
- $tpl->assign_vars(array(
- // Form vars
- 'F_ADD_TURNIN' => 'addturnin.php' . $SID,
- 'S_STEP1' => true,
-
- // Form values
- 'FROM' => $this->turnin['from'],
- 'TO' => $this->turnin['to'],
-
- // Language
- 'L_ADD_TURNIN_TITLE' => sprintf($user->lang['addturnin_title'], '1'),
- 'L_FROM' => $user->lang['from'],
- 'L_TO' => $user->lang['to'],
- 'L_PROCEED' => $user->lang['proceed'],
-
- // Form validation
- 'FV_TURNIN_FROM' => $this->fv->generate_error('turnin_from'),
- 'FV_TURNIN_TO' => $this->fv->generate_error('turnin_to'),
-
- // Javascript messages
- 'MSG_FROM_TO_SAME' => $user->lang['fv_difference_turnin'])
- );
-
- $eqdkp->set_vars(array(
- 'page_title' => sprintf($user->lang['admin_title_prefix'], $eqdkp->config['guildtag'], $eqdkp->config['dkp_name']).': '.sprintf($user->lang['addturnin_title'], '1'),
- 'template_file' => 'admin/addturnin.html',
- 'display' => true)
- );
- }
-}
-
-$add_turnin = new Add_Turnin;
-$add_turnin->process();
-?> \ No newline at end of file
diff --git a/old/admin/backup.php b/old/admin/backup.php
deleted file mode 100644
index 2a656c6..0000000
--- a/old/admin/backup.php
+++ /dev/null
@@ -1,288 +0,0 @@
-<?php
-/******************************
- * EQdkp
- * Copyright 2002-2003
- * Licensed under the GNU GPL. See COPYING for full terms.
- * ------------------
- * manage_members.php
- * Began: Sun January 5 2003
- *
- * $Id: manage_members.php 4 2006-05-08 17:01:47Z tsigo $
- *
- ******************************/
-
-// Notice: Since 'Manage Members' function as a whole handles a lot of form and
-// processing code, this script will serve only as a framework for other processing
-// scripts (found in the mm directory)
-
-define('EQDKP_INC', true);
-define('IN_ADMIN', true);
-$eqdkp_root_path = './../';
-include_once($eqdkp_root_path . 'common.php');
-
-class Backup extends EQdkp_Admin
-{
- function backup()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID;
-
- parent::eqdkp_admin();
-
- $this->assoc_buttons(array(
- 'form' => array(
- 'name' => '',
- 'process' => 'display_menu',
- 'check' => 'a_backup'),
- 'backup' => array(
- 'name' => 'backup',
- 'process' => 'do_backup',
- 'check' => 'a_backup'))
- );
- }
-
- function error_check()
- {
- return $this->fv->is_error();
- }
-
- // ---------------------------------------------------------
- // Display menu
- // ---------------------------------------------------------
- function display_menu()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID;
- $tpl->assign_vars(array(
- 'F_BACKUP' => 'backup.php' . $SID,
- 'L_BACKUP_TITLE' => $user->lang['backup_title'],
- 'L_CREATE_TABLE' => $user->lang['create_table'],
- 'L_SKIP_NONESSENTIAL' => $user->lang['skip_nonessential'],
- 'L_GZIP_CONTENT' => $user->lang['gzip_content'],
- 'L_BACKUP_DATABASE' => $user->lang['backup_database'],
- 'L_YES' => $user->lang['yes'],
- 'L_NO' => $user->lang['no'])
- );
-
- $eqdkp->set_vars(array(
- 'page_title' => sprintf($user->lang['admin_title_prefix'], $eqdkp->config['guildtag'], $eqdkp->config['dkp_name']).': '.$user->lang['backup'],
- 'template_file' => 'admin/backup.html',
- 'display' => true)
- );
- }
-
- // ---------------------------------------------------------
- // Main Backup Script
- // ---------------------------------------------------------
- function do_backup()
- {
- global $db, $eqdkp, $user, $tpl, $pm, $dbhost;
- global $SID;
-
- $tables = array(
- ADJUSTMENTS_TABLE,
- AUTH_OPTIONS_TABLE,
- AUTH_USERS_TABLE,
- CONFIG_TABLE,
- EVENTS_TABLE,
- ITEMS_TABLE,
- LOGS_TABLE,
- MEMBERS_TABLE,
- MEMBER_RANKS_TABLE,
- MEMBER_USER_TABLE,
- NEWS_TABLE,
- PLUGINS_TABLE,
- RAIDS_TABLE,
- SESSIONS_TABLE,
- STYLES_CONFIG_TABLE,
- STYLES_TABLE,
- USERS_TABLE,
- CLASS_TABLE,
- RACE_TABLE,
- FACTION_TABLE
- );
-
- $do_gzip = false;
-
- if($phpver >= "4.0")
- {
- if( extension_loaded("zlib") && $_POST['gzip'] == 'Y')
- {
- $do_gzip = true;
- }
- }
-
- if( $do_gzip )
- {
- die('gzip');
- @ob_start();
- @ob_implicit_flush(0);
- header("Content-Type: text/x-delimtext; name=\"eqdkpbackup.sql.gz\"");
- header("Content-disposition: attachment; filename=eqdkpbackup.sql.gz");
- }
- else
- {
- header("Content-Type: text/x-delimtext; name=\"eqdkpbackup.sql\"");
- header("Content-disposition: attachment; filename=eqdkpbackup.sql");
- }
-
- //Lets echo out our header
- echo "-- EQDKP SQL Dump\n-- version ".EQDKP_VERSION."\n-- http://www.eqdkp.com\n-- \n-- Host: ".$dbhost."\n-- Generation Time: ".date('M d, Y \a\t g:iA')."\n\n-- --------------------------------------------------------\n\n";
-
- foreach ( $tables as $table )
- {
- $table_sql_string = "";
- $data_sql_string = "";
-
- if ( $_POST['create_table'] == 'Y' )
- {
- echo "\n-- \n-- Table structure for table `".$table."`\n-- \n\n";
- echo $this->_create_table_sql_string($table) . "\n";
- }
- echo "\n-- \n-- Dumping data for table `".$table."`\n-- \n\n";
- if ( $table != SESSIONS_TABLE ) echo $this->_create_data_sql_string($table) . "\n";
- }
-
- @header("Pragma: no-cache");
-
- if( $do_gzip )
- {
- $size = ob_get_length();
- $crc = crc32(ob_get_contents());
- $contents = gzcompress(ob_get_contents());
- ob_end_clean();
- echo '\x1f\x8b\x08\x00\x00\x00\x00\x00'
- .substr($contents, 0, strlen($contents) - 4)
- .$this->_gzip_four_chars($crc)
- .$this->_gzip_four_chars($size);
- }
- }
-
- function _create_table_sql_string($tablename)
- {
- global $db;
- // Start the SQL string for this table
- // EQDKP_CHANGE: We always drop tables by default. You may not like this.
- // This is what we need for our app, so don't expect this to work for everything.
- $sql_string = "DROP TABLE IF EXISTS $tablename;\n";
- $sql_string .= "CREATE TABLE $tablename";
-
- // Get the field info and output to a string in the correct MySQL syntax
- $result = $db->query("DESCRIBE $tablename");
- while ($field_info = $db->fetch_record($result))
- {
- $field_name = $field_info[0];
- $field_type = $field_info[1];
- $field_not_null = ($field_info[2] == "YES") ? "" : " NOT NULL";
- $field_default = ($field_info[4] == NULL) ? "" : sprintf(" default '%s'", $field_info[4]);;
- $field_auto_increment = ($field_info[5] == NULL) ? "" : sprintf(" %s", $field_info[5]);
-
- $field_string = sprintf("%s,\n `%s` %s%s%s%s", $field_string, $field_name, $field_type, $field_not_null, $field_auto_increment, $field_default);
- }
- // Get the index info and output to a string in the correct MySQL syntax
- $result = $db->query("SHOW INDEX FROM $tablename");
- while ($index_info = $db->fetch_record($result))
- {
-
- $index_name = $index_info[2];
- $index_unique = $index_info[1];
- $index_field_name = $index_info[4];
- $index_type = $index_info[10];
-
- if ($index_name == "PRIMARY") $index_name = "PRIMARY KEY";
-
- if ($index_unique == "1" && $index_type != "FULLTEXT") $index_name = sprintf("KEY %s", $index_name);
-
- if ($index_unique == "0" && $index_name != "PRIMARY KEY") $index_name = sprintf("UNIQUE KEY %s", $index_name);
-
- if ($index_type == "FULLTEXT") $index_name = sprintf("FULLTEXT KEY %s", $index_name);
-
- $index_string = sprintf("%s,\n %s (`%s`)", $index_string, $index_name, $index_field_name);
- }
- // Get the table type and output it to a string in the correct MySQL syntax
- $result = $db->query("SHOW TABLE STATUS");
- while ($status_info = $db->fetch_record($result))
- {
- for ($i = 0; $i < count($status_info); $i++)
- {
- // add a semicolon to the end of the line so this tools output will be usable
- if ($status_info[0] == $tablename) $table_type = sprintf("TYPE=%s ;", $status_info[1]);
- }
- }
-
- // Remove the first 2 characters (", ") from the field string
- $field_string = "\n" . substr($field_string, 2);
-
- // Append the index string to the field string
- $field_string = sprintf("%s%s", $field_string, $index_string);
-
- // Put the field string in parantheses
- $field_string = sprintf("(%s\n)", $field_string);
-
- // Finalise the MySQL create table string
- $sql_string = sprintf("%s %s %s", $sql_string, $field_string, $table_type);
-
- return $sql_string;
- }
-
- function _create_data_sql_string($tablename)
- {
- global $db;
-
- // Initialise the field string
- $field_string = "";
-
- // Get field names from MySQL and output to a string in the correct MySQL syntax
- $result = $db->query("SELECT * FROM $tablename");
-
- for ($i = 0; $i < @mysql_num_fields($result); $i++) {
- $meta = @mysql_fetch_field($result, $i);
-
- $field_string = sprintf("%s, %s", $field_string, $meta->name);
- }
-
- // Remove the first 2 characters (", ") from the field string
- $field_string = substr($field_string, 2);
-
- // Put the field string in parantheses
- $field_string = sprintf("(%s)", $field_string);
-
- // Get table data from MySQL and output to a string in the correct MySQL syntax
- while ($row = $db->fetch_record($result)) {
- // Initialise the data string
- $data_string = "";
-
- // Loop through the records and append data to the string after escaping
- for ($i = 0; $i < mysql_num_fields($result); $i++) {
- $data_string = sprintf("%s, '%s'", $data_string, mysql_escape_string($row[$i]));
- }
-
- // Remove the first 2 characters (", ") from the data string
- $data_string = substr($data_string, 2);
-
- // Put the data string in parantheses and prepend "VALUES "
- $data_string = sprintf("VALUES (%s)", $data_string);
-
- // Finalise the MySQL insert into string for this record
- // add a semicolon to the end of the line so this tools output will be usable
- $sql_string = sprintf("%sINSERT INTO %s %s %s ;\n", $sql_string, $tablename, $field_string, $data_string);
- }
-
- return $sql_string;
- }
-
- function _gzip_four_chars($val)
- {
- for ($i = 0; $i < 4; $i ++)
- {
- $return .= chr($val % 256);
- $val = floor($val / 256);
- }
-
- return $return;
- }
-}
-
-$backup = new Backup;
-$backup->process();
-?> \ No newline at end of file
diff --git a/old/admin/config.php b/old/admin/config.php
deleted file mode 100644
index c9121b4..0000000
--- a/old/admin/config.php
+++ /dev/null
@@ -1,512 +0,0 @@
-<?php
-/******************************
- * EQdkp
- * Copyright 2002-2003
- * Licensed under the GNU GPL. See COPYING for full terms.
- * ------------------
- * config.php
- * Began: Sat December 28 2002
- *
- * $Id: config.php 46 2007-06-19 07:29:11Z tsigo $
- *
- ******************************/
-
-define('EQDKP_INC', true);
-define('IN_ADMIN', true);
-$eqdkp_root_path = './../';
-include_once($eqdkp_root_path . 'common.php');
-
-class EQdkp_Config extends EQdkp_Admin
-{
- function eqdkp_config()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID;
-
- parent::eqdkp_admin();
-
- $this->assoc_buttons(array(
- 'submit' => array(
- 'name' => 'submit',
- 'process' => 'process_submit',
- 'check' => 'a_config_man'),
- 'form' => array(
- 'name' => '',
- 'process' => 'display_form',
- 'check' => 'a_config_man'))
- );
- }
-
- function error_check()
- {
- global $user;
-
- $this->fv->is_number(array(
- 'default_alimit' => $user->lang['fv_number'],
- 'default_elimit' => $user->lang['fv_number'],
- 'default_ilimit' => $user->lang['fv_number'],
- 'default_nlimit' => $user->lang['fv_number'],
- 'default_rlimit' => $user->lang['fv_number'],
- 'active_point_adj' => $user->lang['fv_number'],
- 'inactive_point_adj' => $user->lang['fv_number'])
- );
-
- $this->fv->is_within_range('default_alimit', 1, 1000);
- $this->fv->is_within_range('default_elimit', 1, 1000);
- $this->fv->is_within_range('default_ilimit', 1, 1000);
- $this->fv->is_within_range('default_nlimit', 1, 1000);
- $this->fv->is_within_range('default_rlimit', 1, 1000);
-
- return $this->fv->is_error();
- }
-
- // ---------------------------------------------------------
- // Process submit
- // ---------------------------------------------------------
- function process_submit()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID;
-
- // Remove < > from guildtags if we need to
- $_POST['parsetags'] = preg_replace('#<(.+)>([[:space:]])?#', "\\1", $_POST['parsetags']);
- $_POST = htmlspecialchars_array($_POST);
-
- $current_game = $eqdkp->config['default_game'];
-
-
- // Update each config setting
- $eqdkp->config_set(array(
- 'guildtag' => $_POST['guildtag'],
- 'parsetags' => $_POST['parsetags'],
- 'server_name' => $_POST['server_name'],
- 'server_port' => intval($_POST['server_port']),
- 'server_path' => $_POST['server_path'],
- 'main_title' => $_POST['main_title'],
- 'sub_title' => $_POST['sub_title'],
- 'dkp_name' => $_POST['dkp_name'],
- 'default_game' => $_POST['default_game'],
- 'default_locale' => $_POST['default_locale'],
- 'account_activation' => ( isset($_POST['account_activation']) ) ? $_POST['account_activation'] : '0',
- 'default_alimit' => intval($_POST['default_alimit']),
- 'default_elimit' => intval($_POST['default_elimit']),
- 'default_ilimit' => intval($_POST['default_ilimit']),
- 'default_nlimit' => intval($_POST['default_nlimit']),
- 'default_rlimit' => intval($_POST['default_rlimit']),
- 'default_lang' => $_POST['default_lang'],
- 'default_style' => intval($_POST['default_style']),
- 'hide_inactive' => ( isset($_POST['hide_inactive']) ) ? $_POST['hide_inactive'] : '0',
- 'inactive_period' => intval($_POST['inactive_period']),
- 'active_point_adj' => $_POST['active_point_adj'],
- 'inactive_point_adj' => $_POST['inactive_point_adj'],
- 'enable_gzip' => ( isset($_POST['enable_gzip']) ) ? $_POST['enable_gzip'] : '0',
- 'cookie_domain' => $_POST['cookie_domain'],
- 'cookie_name' => $_POST['cookie_name'],
- 'cookie_path' => $_POST['cookie_path'],
- 'session_length' => intval($_POST['session_length']),
- 'admin_email' => $_POST['admin_email'],
- 'start_page' => $_POST['start_page'])
- );
-
- // New for 1.3 - game selection
- if (( $_POST['default_game'] != $current_game ))
- {
-
- include($eqdkp->root_path . 'games/' . $_POST['default_game'] . '.php');
-
- $game_extension = new Manage_Game;
- $game_extension->process();
-
- }
-
- // end 1.3 game selection change
-
- // Permissions
- $sql = 'SELECT auth_id, auth_value
- FROM ' . AUTH_OPTIONS_TABLE . '
- ORDER BY auth_id';
- $result = $db->query($sql);
- while ( $row = $db->fetch_record($result) )
- {
- $this->update_auth_default($row['auth_value'], ( isset($_POST[$row['auth_value']]) ) ? 'Y' : 'N');
- }
-
- header('Location: config.php' . $SID);
- }
-
- // ---------------------------------------------------------
- // Process helper methods
- // ---------------------------------------------------------
- function update_auth_default($auth_value, $auth_default='N')
- {
- global $db;
-
- if ( empty($auth_value) )
- {
- return false;
- }
-
- $sql = 'UPDATE ' . AUTH_OPTIONS_TABLE . "
- SET auth_default='" . strip_tags(htmlspecialchars($auth_default)) . "'
- WHERE auth_value='" . $auth_value . "'";
- if ( !($result = $db->query($sql)) )
- {
- return false;
- }
-
- return true;
- }
-
- // ---------------------------------------------------------
- // Display form
- // ---------------------------------------------------------
- function display_form()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID, $auth_defaults;
-
- $cur_hash = hash_filename("config.php");
- //print"HASH::$cur_hash::<br>";
-
- //
- // Find default auth settings
- //
- $sql = 'SELECT auth_id, auth_default
- FROM ' . AUTH_OPTIONS_TABLE . '
- ORDER BY auth_id';
- $result = $db->query($sql);
- while ( $row = $db->fetch_record($result) )
- {
- $auth_defaults[$row['auth_id']] = $row['auth_default'];
- }
- $db->free_result($result);
-
- //
- // Build the config permissions
- //
- $config_permissions = array(
- // Events
- $user->lang['events'] => array(
- array('CBNAME' => 'a_event_add', 'CBCHECKED' => A_EVENT_ADD, 'TEXT' => '<b>' . $user->lang['add'] . '</b>'),
- array('CBNAME' => 'a_event_upd', 'CBCHECKED' => A_EVENT_UPD, 'TEXT' => '<b>' . $user->lang['update'] . '</b>'),
- array('CBNAME' => 'a_event_del', 'CBCHECKED' => A_EVENT_DEL, 'TEXT' => '<b>' . $user->lang['delete'] . '</b>'),
- array('CBNAME' => 'u_event_list', 'CBCHECKED' => U_EVENT_LIST, 'TEXT' => $user->lang['list']),
- array('CBNAME' => 'u_event_view', 'CBCHECKED' => U_EVENT_VIEW, 'TEXT' => $user->lang['view'])
- ),
- // Group adjustments
- $user->lang['group_adjustments'] => array(
- array('CBNAME' => 'a_groupadj_add', 'CBCHECKED' => A_GROUPADJ_ADD, 'TEXT' => '<b>' . $user->lang['add'] . '</b>'),
- array('CBNAME' => 'a_groupadj_upd', 'CBCHECKED' => A_GROUPADJ_UPD, 'TEXT' => '<b>' . $user->lang['update'] . '</b>'),
- array('CBNAME' => 'a_groupadj_del', 'CBCHECKED' => A_GROUPADJ_DEL, 'TEXT' => '<b>' . $user->lang['delete'] . '</b>')
- ),
- // Individual adjustments
- $user->lang['individual_adjustments'] => array(
- array('CBNAME' => 'a_indivadj_add', 'CBCHECKED' => A_INDIVADJ_ADD, 'TEXT' => '<b>' . $user->lang['add'] . '</b>'),
- array('CBNAME' => 'a_indivadj_upd', 'CBCHECKED' => A_INDIVADJ_UPD, 'TEXT' => '<b>' . $user->lang['update'] . '</b>'),
- array('CBNAME' => 'a_indivadj_del', 'CBCHECKED' => A_INDIVADJ_DEL, 'TEXT' => '<b>' . $user->lang['delete'] . '</b>')
- ),
- // Items
- $user->lang['items'] => array(
- array('CBNAME' => 'a_item_add', 'CBCHECKED' => A_ITEM_ADD, 'TEXT' => '<b>' . $user->lang['add'] . '</b>'),
- array('CBNAME' => 'a_item_upd', 'CBCHECKED' => A_ITEM_UPD, 'TEXT' => '<b>' . $user->lang['update'] . '</b>'),
- array('CBNAME' => 'a_item_del', 'CBCHECKED' => A_ITEM_DEL, 'TEXT' => '<b>' . $user->lang['delete'] . '</b>'),
- array('CBNAME' => 'u_item_list', 'CBCHECKED' => U_ITEM_LIST, 'TEXT' => $user->lang['list']),
- array('CBNAME' => 'u_item_view', 'CBCHECKED' => U_ITEM_VIEW, 'TEXT' => $user->lang['view'])
- ),
- // News
- $user->lang['news'] => array(
- array('CBNAME' => 'a_news_add', 'CBCHECKED' => A_NEWS_ADD, 'TEXT' => '<b>' . $user->lang['add'] . '</b>'),
- array('CBNAME' => 'a_news_upd', 'CBCHECKED' => A_NEWS_UPD, 'TEXT' => '<b>' . $user->lang['update'] . '</b>'),
- array('CBNAME' => 'a_news_del', 'CBCHECKED' => A_NEWS_DEL, 'TEXT' => '<b>' . $user->lang['delete'] . '</b>')
- ),
- // Raids
- $user->lang['raids'] => array(
- array('CBNAME' => 'a_raid_add', 'CBCHECKED' => A_RAID_ADD, 'TEXT' => '<b>' . $user->lang['add'] . '</b>'),
- array('CBNAME' => 'a_raid_upd', 'CBCHECKED' => A_RAID_UPD, 'TEXT' => '<b>' . $user->lang['update'] . '</b>'),
- array('CBNAME' => 'a_raid_del', 'CBCHECKED' => A_RAID_DEL, 'TEXT' => '<b>' . $user->lang['delete'] . '</b>'),
- array('CBNAME' => 'u_raid_list', 'CBCHECKED' => U_RAID_LIST, 'TEXT' => $user->lang['list']),
- array('CBNAME' => 'u_raid_view', 'CBCHECKED' => U_RAID_VIEW, 'TEXT' => $user->lang['view'])
- ),
- // Turn-ins
- $user->lang['turn_ins'] => array(
- array('CBNAME' => 'a_turnin_add', 'CBCHECKED' => A_TURNIN_ADD, 'TEXT' => '<b>' . $user->lang['add'] . '</b>')
- ),
- // Members
- $user->lang['members'] => array(
- array('CBNAME' => 'a_members_man', 'CBCHECKED' => A_MEMBERS_MAN, 'TEXT' => '<b>' . $user->lang['manage'] . '</b>'),
- array('CBNAME' => 'u_member_list', 'CBCHECKED' => U_MEMBER_LIST, 'TEXT' => $user->lang['list']),
- array('CBNAME' => 'u_member_view', 'CBCHECKED' => U_MEMBER_VIEW, 'TEXT' => $user->lang['view'])
- ),
- // Manage
- $user->lang['manage'] => array(
- array('CBNAME' => 'a_config_man', 'CBCHECKED' => A_CONFIG_MAN, 'TEXT' => '<b>' . $user->lang['configuration'] . '</b>'),
- array('CBNAME' => 'a_plugins_man', 'CBCHECKED' => A_PLUGINS_MAN, 'TEXT' => '<b>' . $user->lang['plugins'] . '</b>'),
- array('CBNAME' => 'a_styles_man', 'CBCHECKED' => A_STYLES_MAN, 'TEXT' => '<b>' . $user->lang['styles'] . '</b>'),
- array('CBNAME' => 'a_users_man', 'CBCHECKED' => A_USERS_MAN, 'TEXT' => '<b>' . $user->lang['users'] . '</b>')
- ),
- // Logs
- $user->lang['logs'] => array(
- array('CBNAME' => 'a_logs_view', 'CBCHECKED' => A_LOGS_VIEW, 'TEXT' => '<b>' . $user->lang['view'] . '</b>')
- ),
- // Backup Database
- $user->lang['backup'] => array(
- array('CBNAME' => 'a_backup', 'CBCHECKED' => A_BACKUP, 'TEXT' => '<b>' . $user->lang['backup_database'] . '</b>')
- )
- );
-
- // Add plugin checkboxes to our array
- $pm->generate_permission_boxes($config_permissions);
-
- foreach ( $config_permissions as $group => $checks )
- {
- $tpl->assign_block_vars('permissions_row', array(
- 'GROUP' => $group)
- );
-
- foreach ( $checks as $data )
- {
- $tpl->assign_block_vars('permissions_row.check_group', array(
- 'CBNAME' => $data['CBNAME'],
- 'CBCHECKED' => ( $auth_defaults[$data['CBCHECKED']] == 'Y' ) ? ' checked="checked"' : '',
- 'TEXT' => $data['TEXT'])
- );
- }
- }
- unset($config_permissions);
-
- $tpl->assign_vars(array(
- // Form vars
- 'F_CONFIG' => 'config.php' . $SID,
-
- // Form values
- 'GUILDTAG' => $eqdkp->config['guildtag'],
- 'PARSETAGS' => $eqdkp->config['parsetags'],
- 'SERVER_NAME' => $eqdkp->config['server_name'],
- 'SERVER_PORT' => $eqdkp->config['server_port'],
- 'SERVER_PATH' => $eqdkp->config['server_path'],
- 'MAIN_TITLE' => $eqdkp->config['main_title'],
- 'SUB_TITLE' => $eqdkp->config['sub_title'],
- 'DKP_NAME' => $eqdkp->config['dkp_name'],
- 'ACTIVATION_NONE_CHECKED' => ( $eqdkp->config['account_activation'] == USER_ACTIVATION_NONE ) ? ' checked="checked"' : '',
- 'ACTIVATION_USER_CHECKED' => ( $eqdkp->config['account_activation'] == USER_ACTIVATION_SELF ) ? ' checked="checked"' : '',
- 'ACTIVATION_ADMIN_CHECKED' => ( $eqdkp->config['account_activation'] == USER_ACTIVATION_ADMIN ) ? ' checked="checked"' : '',
- 'DEFAULT_ALIMIT' => $eqdkp->config['default_alimit'],
- 'DEFAULT_ELIMIT' => $eqdkp->config['default_elimit'],
- 'DEFAULT_ILIMIT' => $eqdkp->config['default_ilimit'],
- 'DEFAULT_NLIMIT' => $eqdkp->config['default_nlimit'],
- 'DEFAULT_RLIMIT' => $eqdkp->config['default_rlimit'],
- 'HIDE_INACTIVE_YES_CHECKED' => ( $eqdkp->config['hide_inactive'] == '1' ) ? ' checked="checked"' : '',
- 'HIDE_INACTIVE_NO_CHECKED' => ( $eqdkp->config['hide_inactive'] == '0' ) ? ' checked="checked"' : '',
- 'INACTIVE_PERIOD' => $eqdkp->config['inactive_period'],
- 'ACTIVE_POINT_ADJ' => $eqdkp->config['active_point_adj'],
- 'INACTIVE_POINT_ADJ' => $eqdkp->config['inactive_point_adj'],
- 'GZIP_YES_CHECKED' => ( $eqdkp->config['enable_gzip'] == '1' ) ? ' checked="checked"' : '',
- 'GZIP_NO_CHECKED' => ( $eqdkp->config['enable_gzip'] == '0' ) ? ' checked="checked"' : '',
- 'COOKIE_DOMAIN' => $eqdkp->config['cookie_domain'],
- 'COOKIE_NAME' => $eqdkp->config['cookie_name'],
- 'COOKIE_PATH' => $eqdkp->config['cookie_path'],
- 'SESSION_LENGTH' => $eqdkp->config['session_length'],
- 'ADMIN_EMAIL' => $eqdkp->config['admin_email'],
- 'DEFAULT_GAME' => $eqdkp->config['default_game'],
-
-
- // Language (General Settings)
- 'L_GENERAL_SETTINGS' => $user->lang['general_settings'],
- 'L_GUILDTAG' => $user->lang['guildtag'],
- 'L_GUILDTAG_NOTE' => $user->lang['guildtag_note'],
- 'L_PARSETAGS' => $user->lang['parsetags'],
- 'L_PARSETAGS_NOTE' => $user->lang['parsetags_note'],
- 'L_DOMAIN_NAME' => $user->lang['domain_name'],
- 'L_SERVER_PORT' => $user->lang['server_port'],
- 'L_SERVER_PORT_NOTE' => $user->lang['server_port_note'],
- 'L_SCRIPT_PATH' => $user->lang['script_path'],
- 'L_SCRIPT_PATH_NOTE' => $user->lang['script_path_note'],
- 'L_SITE_NAME' => $user->lang['site_name'],
- 'L_SITE_DESCRIPTION' => $user->lang['site_description'],
- 'L_POINT_NAME' => $user->lang['point_name'],
- 'L_POINT_NAME_NOTE' => $user->lang['point_name_note'],
- 'L_ENABLE_ACCOUNT_ACTIVATION' => $user->lang['enable_account_activation'],
- 'L_NONE' => $user->lang['none'],
- 'L_USER' => $user->lang['user'],
- 'L_ADMIN' => $user->lang['admin'],
- 'L_ADJUSTMENTS_PER_PAGE' => $user->lang['adjustments_per_page'],
- 'L_EVENTS_PER_PAGE' => $user->lang['events_per_page'],
- 'L_ITEMS_PER_PAGE' => $user->lang['items_per_page'],
- 'L_NEWS_PER_PAGE' => $user->lang['news_per_page'],
- 'L_RAIDS_PER_PAGE' => $user->lang['raids_per_page'],
- 'L_DEFAULT_LANGUAGE' => $user->lang['default_language'],
- 'L_DEFAULT_GAME' => $user->lang['default_game'],
- 'L_DEFAULT_GAME_WARN' => $user->lang['default_game_warn'],
- 'L_DEFAULT_STYLE' => $user->lang['default_style'],
- 'L_DEFAULT_PAGE' => $user->lang['default_page'],
- 'L_DEFAULT_LOCALE' => $user->lang['default_locale'],
- 'L_PREVIEW' => $user->lang['preview'],
- 'L_HIDE_INACTIVE' => $user->lang['hide_inactive'],
- 'L_HIDE_INACTIVE_NOTE' => $user->lang['hide_inactive_note'],
- 'L_INACTIVE_PERIOD' => $user->lang['inactive_period'],
- 'L_INACTIVE_PERIOD_NOTE' => $user->lang['inactive_period_note'],
- 'L_ACTIVE_POINT_ADJ' => $user->lang['active_point_adj'],
- 'L_ACTIVE_POINT_ADJ_NOTE' => $user->lang['active_point_adj_note'],
- 'L_INACTIVE_POINT_ADJ' => $user->lang['inactive_point_adj'],
- 'L_INACTIVE_POINT_ADJ_NOTE' => $user->lang['inactive_point_adj_note'],
- 'L_ENABLE_GZIP' => $user->lang['enable_gzip'],
-
- // Language (Default Permissions)
- 'L_DEFAULT_PERMISSIONS' => $user->lang['default_permissions'],
- 'L_DEFAULT_PERMISSIONS_NOTE' => $user->lang['default_permissions_note'],
-
- // Language (Cookie Settings)
- 'L_COOKIE_SETTINGS' => $user->lang['cookie_settings'],
- 'L_COOKIE_DOMAIN' => $user->lang['cookie_domain'],
- 'L_COOKIE_NAME' => $user->lang['cookie_name'],
- 'L_COOKIE_PATH' => $user->lang['cookie_path'],
- 'L_SESSION_LENGTH' => $user->lang['session_length'],
-
- // Language (E-mail Settings)
- 'L_EMAIL_SETTINGS' => $user->lang['email_settings'],
- 'L_ADMIN_EMAIL' => $user->lang['admin_email'],
-
- // Language
- 'L_YES' => $user->lang['yes'],
- 'L_NO' => $user->lang['no'],
- 'L_SUBMIT' => $user->lang['submit'],
- 'L_RESET' => $user->lang['reset'])
- );
-
- //
- // Build language drop-down
- //
- if ( $dir = @opendir($eqdkp->root_path . 'language/') )
- {
- while ( $file = @readdir($dir) )
- {
- if ( (!is_file($eqdkp->root_path . 'language/' . $file)) && (!is_link($eqdkp->root_path . 'language/' . $file)) && ($file != '.') && ($file != '..') && ($file != 'CVS') && ($file != '.svn') )
- {
- $tpl->assign_block_vars('lang_row', array(
- 'VALUE' => $file,
- 'SELECTED' => ( $eqdkp->config['default_lang'] == $file ) ? ' selected="selected"' : '',
- 'OPTION' => ucfirst($file))
- );
- }
- }
- }
-
- //
- // Build style drop-down
- //
- $sql = 'SELECT style_id, style_name
- FROM ' . STYLES_TABLE . '
- ORDER BY style_name';
- $result = $db->query($sql);
- while ( $row = $db->fetch_record($result) )
- {
- $tpl->assign_block_vars('style_row', array(
- 'VALUE' => $row['style_id'],
- 'SELECTED' => ( $eqdkp->config['default_style'] == $row['style_id'] ) ? ' selected="selected"' : '',
- 'OPTION' => $row['style_name'])
- );
- }
- $db->free_result($result);
-
-
- //
- // Build game option drop-down
- // New for 1.3
- // Total hack job - I moved the class, race, and faction
- // info to the db, but I'm hardcoding what games I support
- // for the "button push" - what a tard I am :-)
- // To add a new game option, just copy the 4 lines below,
- // add them to the botton, increase the value of VALUE by 1,
- // and be sure to set OPTION to the EXACT SAME THING you put
- // in the == check in the SELECTED line and there must be
- // no spaces in the name, since the value below gets changed
- // to name.php and ran when you change it: for example,
- // if you change to WoW, this program will redirect you to
- // WoW.php and use that file to populate the database.
- //
- // Cheesy, but extensible and effective.
- //
-
- $tpl->assign_block_vars('game_row', array(
- 'VALUE' => "Everquest",
- 'SELECTED' => ( $eqdkp->config['default_game'] == "Everquest" ) ? ' selected="selected"' : '',
- 'OPTION' => "Everquest") );
-
- $tpl->assign_block_vars('game_row', array(
- 'VALUE' => "Everquest2",
- 'SELECTED' => ( $eqdkp->config['default_game'] == "Everquest2" ) ? ' selected="selected"' : '',
- 'OPTION' => "Everquest2") );
-
- $tpl->assign_block_vars('game_row', array(
- 'VALUE' => "WoW",
- 'SELECTED' => ( $eqdkp->config['default_game'] == "WoW" ) ? ' selected="selected"' : '',
- 'OPTION' => "WoW") );
-
- $tpl->assign_block_vars('game_row', array(
- 'VALUE' => "DAoC",
- 'SELECTED' => ( $eqdkp->config['default_game'] == "DAoC" ) ? ' selected="selected"' : '',
- 'OPTION' => "DAoC") );
-
- $tpl->assign_block_vars('game_row', array(
- 'VALUE' => "Vanguard-SoH",
- 'SELECTED' => ( $eqdkp->config['default_game'] == "Vanguard-SoH" ) ? ' selected="selected"' : '',
- 'OPTION' => "Vanguard-SoH") );
-
- // Default locale drop-down
- // new for 1.3
- // Dont forget to change the install script -- maybe query the system for all supported
- // locales? that would break the "pretty" name of the locale (english, french, etc)
- // but would provide greater support
-
- $tpl->assign_block_vars('locale_row', array(
- 'VALUE' => 'en_US',
- 'SELECTED' => ( $eqdkp->config['default_locale'] == "en_US" ) ? ' selected="selected"' : '',
- 'OPTION' => 'English'
- ));
-
- $tpl->assign_block_vars('locale_row', array(
- 'VALUE' => 'de_DE',
- 'SELECTED' => ( $eqdkp->config['default_locale'] == "de_DE" ) ? ' selected="selected"' : '',
- 'OPTION' => 'German'
- ));
-
- $tpl->assign_block_vars('locale_row', array(
- 'VALUE' => 'fr_FR',
- 'SELECTED' => ( $eqdkp->config['default_locale'] == "fr_FR" ) ? ' selected="selected"' : '',
- 'OPTION' => 'French'
- ));
-
-
- //
- // Build start page drop-down
- //
- $menus = $eqdkp->gen_menus();
- $pages = array_merge($menus['menu1'], $menus['menu2']);
- unset($menus);
-
- foreach ( $pages as $page )
- {
- $link = preg_replace('#\?' . URI_SESSION . '\=([0-9A-Za-z]{1,32})?#', '', $page['link']);
- $link = preg_replace('#\.php&amp;#', '.php?', $link);
-
- $text = ( isset($user->data['username']) ) ? str_replace($user->data['username'], $user->lang['username'], $page['text']) : $page['text'];
-
- $tpl->assign_block_vars('page_row', array(
- 'VALUE' => $link,
- 'SELECTED' => ( $eqdkp->config['start_page'] == $link ) ? ' selected="selected"' : '',
- 'OPTION' => $text)
- );
- unset($link, $text);
- }
-
- $eqdkp->set_vars(array(
- 'page_title' => sprintf($user->lang['admin_title_prefix'], $eqdkp->config['guildtag'], $eqdkp->config['dkp_name']).': '.$user->lang['config_title'],
- 'template_file' => 'admin/config.html',
- 'display' => true)
- );
- }
-}
-
-$eqdkp_config = new EQdkp_Config;
-$eqdkp_config->process();
-?>
diff --git a/old/admin/fix_negative.php b/old/admin/fix_negative.php
deleted file mode 100644
index 9b3a3c7..0000000
--- a/old/admin/fix_negative.php
+++ /dev/null
@@ -1,93 +0,0 @@
-<?php
-/******************************
- * EQdkp
- * Copyright 2002-2005
- * Licensed under the GNU GPL. See COPYING for full terms.
- * ------------------
- * fix_negative.php
- *
- ******************************/
-
-define('EQDKP_INC', true);
-$eqdkp_root_path = './';
-include_once($eqdkp_root_path . 'common.php');
-
-$sql = "SELECT m.member_name, m.member_raidcount, count(ra.raid_id) AS cnt, sum(r.raid_value), m.member_earned
- FROM " . RAIDS_TABLE . " r, " . RAID_ATTENDEES_TABLE . " ra, " . MEMBERS_TABLE . " m
- WHERE ra.raid_id = r.raid_id
- AND ra.member_name = m.member_name
- GROUP BY m.member_name
- HAVING m.member_raidcount <> cnt";
-
-if ( !($members_result = $db->query($sql)) )
-{
- message_die('Could not obtain requested information', '', __FILE__, __LINE__, $sql);
-}
-
-while ( $row = $db->fetch_record($members_result) )
-{
-
- print "Member: " . $row['member_name'] . " has " . $row['cnt'] . "
- recorded raids in the raid_attendees table, but is only
- accounted for in " . $row['member_raidcount'] . " raids
- in him member table entry.<BR>";
-
- $sql = "UPDATE ". MEMBERS_TABLE ." SET member_raidcount = ".$row['cnt']." WHERE member_name = '".$row['member_name']."'";
- print $sql . "<BR><BR>";
- $db->query($sql);
-}
-
-$sql = "DROP TABLE IF EXISTS tempqw_fixearned";
-
-if (!($return_code = $db->query($sql)))
-{
- message_die('Could not run tha big command ', '', __FILE__, __LINE__, $sql);
-}
-
-$sql = "CREATE TABLE tempqw_fixearned (
-member_name varchar(30) NOT NULL UNIQUE,
-member_earned float(11,2) NOT NULL default '0.00',
-member_raidcount smallint(5) NOT NULL DEFAULT 0,
-PRIMARY KEY (member_name)
-)TYPE=InnoDB";
-
-if (!($return_code = $db->query($sql)))
-{
- message_die('Could not run tha big command ', '', __FILE__, __LINE__, $sql);
-}
-
-
-$sql = "INSERT INTO tempqw_fixearned
-SELECT m.member_name, sum(r.raid_value), count(ra.raid_id)
-FROM " . MEMBERS_TABLE . " m, " . RAIDS_TABLE . " r, " . RAID_ATTENDEES_TABLE . " ra
-WHERE ra.raid_id = r.raid_id AND ra.member_name = m.member_name
-GROUP BY ra.member_name";
-
-if (!($return_code = $db->query($sql)))
-{
- message_die('Could not run tha big command ', '', __FILE__, __LINE__, $sql);
-}
-
-
-$sql = "UPDATE " . MEMBERS_TABLE . " m, tempqw_fixearned f
-SET m.member_earned = f.member_earned
-WHERE m.member_name = f.member_name";
-
-if (!($return_code = $db->query($sql)))
-{
- message_die('Could not run tha big command ', '', __FILE__, __LINE__, $sql);
-}
-
-
-$sql = "UPDATE " . MEMBERS_TABLE . " m, tempqw_fixearned f
-SET m.member_raidcount = f.member_raidcount
-WHERE m.member_name = f.member_name";
-
-if (!($return_code = $db->query($sql)))
-{
- message_die('Could not run tha big command ', '', __FILE__, __LINE__, $sql);
-}
-
-
-
-?>
diff --git a/old/admin/index.php b/old/admin/index.php
deleted file mode 100644
index 0f84580..0000000
--- a/old/admin/index.php
+++ /dev/null
@@ -1,680 +0,0 @@
-<?php
-/******************************
- * EQdkp
- * Copyright 2002-2003
- * Licensed under the GNU GPL. See COPYING for full terms.
- * ------------------
- * index.php
- * Began: Tue December 24 2002
- *
- * $Id: index.php 46 2007-06-19 07:29:11Z tsigo $
- *
- ******************************/
-
-// IN_ADMIN not yet defined, display the main admin page
-if ( !defined('IN_ADMIN') )
-{
- // ---------------------------------------------------------
- // Function definitions
- // ---------------------------------------------------------
- /**
- * 'Pretty-up' the Location field of the Who's Online list
- * If we recognize the script they're on, return a more friendly
- * location (like most modern forums do), otherwise just return the path
- *
- * @param string $page Page URL
- * @return string
- */
- function resolve_eqdkp_page($page)
- {
- global $db, $eqdkp, $user, $SID;
-
- $matches = explode('&', $page);
-
- if ( !empty($matches[0]) )
- {
- // See if we recognize the page/script we're on
- switch ( $matches[0] )
- {
- // ---------------------------------------------------------
- // Admin
- // ---------------------------------------------------------
- case 'addadj':
- $page = $user->lang['adding_groupadj'];
- if ( (!empty($matches[1])) && (preg_match('/^' . URI_ADJUSTMENT . '=([0-9]{1,})/', $matches[1], $adjustment_id)) )
- {
- $page = $user->lang['editing_groupadj'] . ': ';
- $page .= '<a href="addadj.php' . $SID . '&amp;' . URI_ADJUSTMENT . '=' . $adjustment_id[1] . '">' . $adjustment_id[1] . '</a>';
- }
- break;
- // ---------------------------------------------------------
- case 'addiadj':
- $page = $user->lang['adding_indivadj'];
- if ( (!empty($matches[1])) && (preg_match('/^' . URI_ADJUSTMENT . '=([0-9]{1,})/', $matches[1], $adjustment_id)) )
- {
- $page = $user->lang['editing_indivadj'] . ': ';
- $page .= '<a href="addiadj.php' . $SID . '&amp;' . URI_ADJUSTMENT . '=' . $adjustment_id[1] . '">' . $adjustment_id[1] . '</a>';
- }
- break;
- // ---------------------------------------------------------
- case 'additem':
- $page = $user->lang['adding_item'];
- if ( (!empty($matches[1])) && (preg_match('/^' . URI_ITEM . '=([0-9]{1,})/', $matches[1], $item_id)) )
- {
- $item_name = get_item_name($item_id[1]);
- $page = $user->lang['editing_item'] . ': ';
- $page .= '<a href="additem.php' . $SID . '&amp;' . URI_ITEM . '=' . $item_id[1] . '">' . $item_name . '</a>';
- }
- break;
- // ---------------------------------------------------------
- case 'addnews':
- $page = $user->lang['adding_news'];
- if ( (!empty($matches[1])) && (preg_match('/^' . URI_NEWS . '=([0-9]{1,})/', $matches[1], $news_id)) )
- {
- $news_name = get_news_name($news_id[1]);
- $page = $user->lang['editing_item'] . ': ';
- $page .= '<a href="addnews.php' . $SID . '&amp;' . URI_NEWS . '=' . $news_id[1] . '">' . $news_name . '</a>';
- }
- break;
- // ---------------------------------------------------------
- case 'addraid':
- $page = $user->lang['adding_raid'];
-
- if ( (!empty($matches[1])) && (preg_match('/^' . URI_RAID . '=([0-9]{1,})/', $matches[1], $raid_id)) )
- {
- $raid_name = get_raid_name($raid_id[1]);
- $page = $user->lang['editing_raid'] . ': ';
- $page .= '<a href="addraid.php' . $SID . '&amp;' . URI_RAID . '=' . $raid_id[1] . '">' . $raid_name . '</a>';
- }
- break;
- // ---------------------------------------------------------
- case 'addturnin':
- $page = $user->lang['adding_turnin'];
- break;
- // ---------------------------------------------------------
- case 'config':
- $page = $user->lang['managing_config'];
- break;
- // ---------------------------------------------------------
- case 'index':
- $page = $user->lang['viewing_admin_index'];
- break;
- // ---------------------------------------------------------
- case 'logs':
- $page = $user->lang['viewing_logs'];
- break;
- // ---------------------------------------------------------
- case 'manage_members':
- $page = $user->lang['managing_members'];
- break;
- // ---------------------------------------------------------
- case 'manage_users':
- $page = $user->lang['managing_users'];
- break;
- // ---------------------------------------------------------
- case 'mysql_info':
- $page = $user->lang['viewing_mysql_info'];
- break;
- // ---------------------------------------------------------
- case 'plugins':
- $page = $user->lang['managing_plugins'];
- break;
- // ---------------------------------------------------------
- case 'styles':
- $page = $user->lang['managing_styles'];
- break;
-
- // ---------------------------------------------------------
- // Listing
- // ---------------------------------------------------------
- case 'listadj':
- if ( (empty($matches[1])) || ($matches[1] == 'group') )
- {
- $page = $user->lang['listing_groupadj'];
- }
- else
- {
- $page = $user->lang['listing_indivadj'];
- }
- break;
- // ---------------------------------------------------------
- case 'listevents':
- $page = $user->lang['listing_events'];
- break;
- // ---------------------------------------------------------
- case 'listitems':
- if ( (empty($matches[1])) || ($matches[1] == 'values') )
- {
- $page = $user->lang['listing_itemvals'];
- }
- else
- {
- $page = $user->lang['listing_itemhist'];
- }
- break;
- // ---------------------------------------------------------
- case 'listmembers':
- $page = $user->lang['listing_members'];
- break;
- // ---------------------------------------------------------
- case 'listraids':
- $page = $user->lang['listing_raids'];
- break;
-
- // ---------------------------------------------------------
- // Misc
- // ---------------------------------------------------------
- case 'parse_log':
- $page = $user->lang['parsing_log'];
- break;
-
- case 'stats':
- $page = $user->lang['viewing_stats'];
- break;
-
- case 'summary':
- $page = $user->lang['viewing_summary'];
- break;
-
- // ---------------------------------------------------------
- // Viewing
- // ---------------------------------------------------------
- case 'viewevent':
- $page = $user->lang['viewing_event'] . ': ';
- if ( !empty($matches[1]) )
- {
- preg_match('/^' . URI_EVENT . '=([0-9]{1,})/', $matches[1], $event_id);
- $event_name = get_event_name($event_id[1]);
- $page .= '<a href="../viewevent.php' . $SID . '&amp;' . URI_EVENT . '=' . $event_id[1] . '" target="_top">' . $event_name . '</a>';
- }
- break;
- // ---------------------------------------------------------
- case 'viewitem':
- $page = $user->lang['viewing_item'] . ': ';
- if ( !empty($matches[1]) )
- {
- preg_match('/^' . URI_ITEM . '=([0-9]{1,})/', $matches[1], $item_id);
- $item_name = get_item_name($item_id[1]);
- $page .= '<a href="../viewitem.php' . $SID . '&amp;' . URI_ITEM . '=' . $item_id[1] . '" target="_top">' . $item_name . '</a>';
- }
- break;
- // ---------------------------------------------------------
- case 'viewnews':
- $page = $user->lang['viewing_news'];
- break;
- // ---------------------------------------------------------
- case 'viewmember':
- $page = $user->lang['viewing_member'] . ': ';
- if ( !empty($matches[1]) )
- {
- preg_match('/^' . URI_NAME . '=([A-Za-z]{1,})/', $matches[1], $member_name);
- $page .= '<a href="../viewmember.php' . $SID . '&amp;' . URI_NAME . '=' . $member_name[1] . '" target="_top">' . $member_name[1] . '</a>';
- }
- break;
- // ---------------------------------------------------------
- case 'viewraid':
- $page = $user->lang['viewing_raid'] . ': ';
- if ( !empty($matches[1]) )
- {
- preg_match('/^' . URI_RAID . '=([0-9]{1,})/', $matches[1], $raid_id);
- $raid_name = get_raid_name($raid_id[1]);
- $page .= '<a href="../viewraid.php' . $SID . '&amp;' . URI_RAID . '=' . $raid_id[1] . '" target="_top">' . $raid_name . '</a>';
- }
- break;
- }
- }
-
- return $page;
- }
-
- function get_event_name($event_id)
- {
- global $db;
-
- $event_id = intval($event_id);
-
- $sql = 'SELECT event_name FROM ' . EVENTS_TABLE . " WHERE event_id='" . $event_id . "'";
- $event_name = $db->query_first($sql);
-
- return ( !empty($event_name) ) ? $event_name : 'Unknown';
- }
-
- function get_item_name($item_id)
- {
- global $db;
-
- $item_id = intval($item_id);
-
- $sql = 'SELECT item_name FROM ' . ITEMS_TABLE . " WHERE item_id='" . $item_id . "'";
- $item_name = $db->query_first($sql);
-
- return ( !empty($item_name) ) ? $item_name : 'Unknown';
- }
-
- function get_news_name($news_id)
- {
- global $db;
-
- $news_id = intval($news_id);
-
- $sql = 'SELECT news_headline FROM ' . NEWS_TABLE . " WHERE news_id='" . $news_id . "'";
- $news_name = $db->query_first($sql);
-
- return ( !empty($news_name) ) ? $news_name : 'Unknown';
- }
-
- function get_raid_name($raid_id)
- {
- global $db;
-
- $raid_id = intval($raid_id);
-
- $sql = 'SELECT raid_name FROM ' . RAIDS_TABLE . " WHERE raid_id='" . $raid_id . "'";
- $raid_name = $db->query_first($sql);
-
- return ( !empty($raid_name) ) ? $raid_name : 'Unknown';
- }
-
- function get_eqdkp_version()
- {
- // Try and get the latest EQdkp version from EQdkp.com
- $sh = @fsockopen('eqdkp.com', 80, $errno, $error, 5);
- if ( !$sh )
- {
- return EQDKP_VERSION;
- }
- else
- {
- @fputs($sh, "GET /version.php HTTP/1.1\r\nHost: eqdkp.com\r\nConnection: close\r\n\r\n");
- while ( !feof($sh) )
- {
- $content = @fgets($sh, 512);
- if ( preg_match('/<version>(.*)<\/version>/', $content, $version) )
- {
- return $version[1];
- }
- }
- }
- @fclose($sh);
-
- return EQDKP_VERSION;
- }
-
- // ---------------------------------------------------------
- // Display the main admin page
- // ---------------------------------------------------------
-
- define('EQDKP_INC', true);
- define('IN_ADMIN', true);
- $eqdkp_root_path = './../';
- include_once($eqdkp_root_path . 'common.php');
-
- $user->check_auth('a_');
-
- $days = ((time() - $eqdkp->config['eqdkp_start']) / 86400);
-
- $total_members_inactive = $db->query_first('SELECT count(*) FROM ' . MEMBERS_TABLE . " where member_status='0'");
- $total_members_active = $db->query_first('SELECT count(*) FROM ' . MEMBERS_TABLE . " where member_status='1'");
- $total_members = $total_members_active . ' / ' . $total_members_inactive;
-
- $total_raids = $db->query_first('SELECT count(*) FROM ' . RAIDS_TABLE);
- $raids_per_day = sprintf("%.2f", ($total_raids / $days));
-
- $total_items = $db->query_first('SELECT count(*) FROM ' . ITEMS_TABLE);
- $items_per_day = sprintf("%.2f", ($total_items / $days));
-
- $total_logs = $db->query_first('SELECT count(*) FROM ' . LOGS_TABLE);
-
- if ( $raids_per_day > $total_raids )
- {
- $raids_per_day = $total_raids;
- }
- if ( $items_per_day > $total_items )
- {
- $items_per_day = $total_items;
- }
-
- // DB Size - MySQL Only
- if ( DBTYPE == 'mysql' )
- {
- $result = $db->query('SELECT VERSION() AS mysql_version');
-
- if ( $row = $db->fetch_record($result) )
- {
- $version = $row['mysql_version'];
-
- if ( preg_match('/^(3\.23|4\.)/', $version) )
- {
- $db_name = ( preg_match('/^(3\.23\.[6-9])|(3\.23\.[1-9][1-9])|(4\.)/', $version) ) ? "`$dbname`" : $dbname;
-
- $sql = 'SHOW TABLE STATUS
- FROM ' . $db_name;
- $result = $db->query($sql);
-
- $dbsize = 0;
- while ( $row = $db->fetch_record($result) )
- {
- if ( $row['Type'] != 'MRG_MyISAM' )
- {
- if ( $table_prefix != '' )
- {
- if ( strstr($row['Name'], $table_prefix) )
- {
- $dbsize += $row['Data_length'] + $row['Index_length'];
- }
- }
- else
- {
- $dbsize += $row['Data_length'] + $row['Index_length'];
- }
- }
- }
- }
- else
- {
- $dbsize = $user->lang['not_available'];
- }
- }
- else
- {
- $dbsize = $user->lang['not_available'];
- }
- }
- else
- {
- $dbsize = $user->lang['not_available'];
- }
-
- if ( is_int($dbsize) )
- {
- $dbsize = ( $dbsize >= 1048576 ) ? sprintf('%.2f MB', ($dbsize / 1048576)) : (($dbsize >= 1024) ? sprintf('%.2f KB', ($dbsize / 1024)) : sprintf('%.2f Bytes', $dbsize));
- }
-
- //
- // Who's Online
- //
- $sql = 'SELECT s.*, u.username
- FROM ( ' . SESSIONS_TABLE . ' s
- LEFT JOIN ' . USERS_TABLE . ' u
- ON u.user_id = s.session_user_id )
- GROUP BY u.username, s.session_ip
- ORDER BY u.username, s.session_current DESC';
- $result = $db->query($sql);
- while ( $row = $db->fetch_record($result) )
- {
- $session_page = resolve_eqdkp_page($row['session_page']);
-
- $tpl->assign_block_vars('online_row', array(
- 'ROW_CLASS' => $eqdkp->switch_row_class(),
- 'USERNAME' => ( !empty($row['username']) ) ? $row['username'] : $user->lang['anonymous'],
- 'LOGIN' => date($user->style['date_time'], $row['session_start']),
- 'LAST_UPDATE' => date($user->style['date_time'], $row['session_current']),
- 'LOCATION' => $session_page,
- 'IP_ADDRESS' => $row['session_ip'])
- );
- }
- $online_count = $db->num_rows($result);
-
- // Log Actions
- $s_logs = false;
- if ( $user->check_auth('a_logs_view', false) )
- {
- if ( $total_logs > 0 )
- {
- $sql = 'SELECT l.*, u.username
- FROM ' . LOGS_TABLE . ' l, ' . USERS_TABLE . ' u
- WHERE u.user_id=l.admin_id
- ORDER BY l.log_date DESC
- LIMIT 10';
- $result = $db->query($sql);
- while ( $row = $db->fetch_record($result) )
- {
- eval($row['log_action']);
-
- switch ( $row['log_type'] )
- {
- case '{L_ACTION_EVENT_ADDED}':
- $logline = sprintf($user->lang['vlog_event_added'], $row['username'], $log_action['{L_NAME}'], $log_action['{L_VALUE}']);
- break;
- case '{L_ACTION_EVENT_UPDATED}':
- $logline = sprintf($user->lang['vlog_event_updated'], $row['username'], $log_action['{L_NAME_BEFORE}']);
- break;
- case '{L_ACTION_EVENT_DELETED}':
- $logline = sprintf($user->lang['vlog_event_deleted'], $row['username'], $log_action['{L_NAME}']);
- break;
- case '{L_ACTION_GROUPADJ_ADDED}':
- $logline = sprintf($user->lang['vlog_groupadj_added'], $row['username'], $log_action['{L_ADJUSTMENT}']);
- break;
- case '{L_ACTION_GROUPADJ_UPDATED}':
- $logline = sprintf($user->lang['vlog_groupadj_updated'], $row['username'], $log_action['{L_ADJUSTMENT_BEFORE}']);
- break;
- case '{L_ACTION_GROUPADJ_DELETED}':
- $logline = sprintf($user->lang['vlog_groupadj_deleted'], $row['username'], $log_action['{L_ADJUSTMENT}']);
- break;
- case '{L_ACTION_HISTORY_TRANSFER}':
- $logline = sprintf($user->lang['vlog_history_transfer'], $row['username'], $log_action['{L_FROM}'], $log_action['{L_TO}']);
- break;
- case '{L_ACTION_INDIVADJ_ADDED}':
- $logline = sprintf($user->lang['vlog_indivadj_added'], $row['username'], $log_action['{L_ADJUSTMENT}'], count(explode(', ', $log_action['{L_MEMBERS}'])));
- break;
- case '{L_ACTION_INDIVADJ_UPDATED}':
- $logline = sprintf($user->lang['vlog_indivadj_updated'], $row['username'], $log_action['{L_ADJUSTMENT_BEFORE}'], $log_action['{L_MEMBERS_BEFORE}']);
- break;
- case '{L_ACTION_INDIVADJ_DELETED}':
- $logline = sprintf($user->lang['vlog_indivadj_deleted'], $row['username'], $log_action['{L_ADJUSTMENT}'], $log_action['{L_MEMBERS}']);
- break;
- case '{L_ACTION_ITEM_ADDED}':
- $logline = sprintf($user->lang['vlog_item_added'], $row['username'], $log_action['{L_NAME}'], count(explode(', ', $log_action['{L_BUYERS}'])), $log_action['{L_VALUE}']);
- break;
- case '{L_ACTION_ITEM_UPDATED}':
- $logline = sprintf($user->lang['vlog_item_updated'], $row['username'], $log_action['{L_NAME_BEFORE}'], count(explode(', ', $log_action['{L_BUYERS_BEFORE}'])));
- break;
- case '{L_ACTION_ITEM_DELETED}':
- $logline = sprintf($user->lang['vlog_item_deleted'], $row['username'], $log_action['{L_NAME}'], count(explode(', ', $log_action['{L_BUYERS}'])));
- break;
- case '{L_ACTION_MEMBER_ADDED}':
- $logline = sprintf($user->lang['vlog_member_added'], $row['username'], $log_action['{L_NAME}']);
- break;
- case '{L_ACTION_MEMBER_UPDATED}':
- $logline = sprintf($user->lang['vlog_member_updated'], $row['username'], $log_action['{L_NAME_BEFORE}']);
- break;
- case '{L_ACTION_MEMBER_DELETED}':
- $logline = sprintf($user->lang['vlog_member_deleted'], $row['username'], $log_action['{L_NAME}']);
- break;
- case '{L_ACTION_NEWS_ADDED}':
- $logline = sprintf($user->lang['vlog_news_added'], $row['username'], $log_action['{L_HEADLINE}']);
- break;
- case '{L_ACTION_NEWS_UPDATED}':
- $logline = sprintf($user->lang['vlog_news_updated'], $row['username'], $log_action['{L_HEADLINE_BEFORE}']);
- break;
- case '{L_ACTION_NEWS_DELETED}':
- $logline = sprintf($user->lang['vlog_news_deleted'], $row['username'], $log_action['{L_HEADLINE}']);
- break;
- case '{L_ACTION_RAID_ADDED}':
- $logline = sprintf($user->lang['vlog_raid_added'], $row['username'], $log_action['{L_EVENT}']);
- break;
- case '{L_ACTION_RAID_UPDATED}':
- $logline = sprintf($user->lang['vlog_raid_updated'], $row['username'], $log_action['{L_EVENT_BEFORE}']);
- break;
- case '{L_ACTION_RAID_DELETED}':
- $logline = sprintf($user->lang['vlog_raid_deleted'], $row['username'], $log_action['{L_EVENT}']);
- break;
- case '{L_ACTION_TURNIN_ADDED}':
- $logline = sprintf($user->lang['vlog_turnin_added'], $row['username'], $log_action['{L_FROM}'], $log_action['{L_TO}'], $log_action['{L_ITEM}']);
- break;
- }
- unset($log_action);
-
- // Show the log if we have a valid line for it
- if ( isset($logline) )
- {
- $tpl->assign_block_vars('actions_row', array(
- 'ROW_CLASS' => $eqdkp->switch_row_class(),
- 'U_VIEW_LOG' => 'logs.php?' . URI_LOG . '='.$row['log_id'],
- 'ACTION' => stripslashes($logline))
- );
- }
- unset($logline);
- }
- $db->free_result($result);
-
- $s_logs = true;
- }
- }
-
- $eqdkp_com_version = EQDKP_VERSION;
-
- $tpl->assign_vars(array(
- 'S_NEW_VERSION' => ( $eqdkp_com_version != EQDKP_VERSION ) ? true : false,
- 'S_LOGS' => $s_logs,
-
- 'L_VERSION_UPDATE' => $user->lang['version_update'],
- 'L_NEW_VERSION_NOTICE' => sprintf($user->lang['new_version_notice'], $eqdkp_com_version),
- 'L_STATISTICS' => $user->lang['statistics'],
- 'L_NUMBER_OF_MEMBERS' => $user->lang['number_of_members'],
- 'L_NUMBER_OF_RAIDS' => $user->lang['number_of_raids'],
- 'L_NUMBER_OF_ITEMS' => $user->lang['number_of_items'],
- 'L_DATABASE_SIZE' => $user->lang['database_size'],
- 'L_NUMBER_OF_LOGS' => $user->lang['number_of_logs'],
- 'L_RAIDS_PER_DAY' => $user->lang['raids_per_day'],
- 'L_ITEMS_PER_DAY' => $user->lang['items_per_day'],
- 'L_EQDKP_STARTED' => $user->lang['eqdkp_started'],
-
- 'NUMBER_OF_MEMBERS' => $total_members,
- 'NUMBER_OF_RAIDS' => $total_raids,
- 'NUMBER_OF_ITEMS' => $total_items,
- 'DATABASE_SIZE' => $dbsize,
- 'NUMBER_OF_LOGS' => $total_logs,
- 'RAIDS_PER_DAY' => $raids_per_day,
- 'ITEMS_PER_DAY' => $items_per_day,
- 'EQDKP_STARTED' => date($user->style['date_time'], $eqdkp->config['eqdkp_start']),
-
- 'L_WHO_ONLINE' => $user->lang['who_online'],
- 'L_USERNAME' => $user->lang['username'],
- 'L_LOGIN' => $user->lang['login'],
- 'L_LAST_UPDATE' => $user->lang['last_update'],
- 'L_LOCATION' => $user->lang['location'],
- 'L_IP_ADDRESS' => $user->lang['ip_address'],
-
- 'L_NEW_ACTIONS' => $user->lang['new_actions'],
-
- 'ONLINE_FOOTCOUNT' => sprintf($user->lang['online_footcount'], $online_count))
- );
-
- $eqdkp->set_vars(array(
- 'page_title' => $user->lang['admin_index_title'],
- 'template_file' => 'admin/admin_index.html',
- 'display' => true)
- );
-}
-// IN_ADMIN already defined, just output the menu
-else
-{
- // Build a dynamic admin menu
- // Credit to draelon for the idea and original implementation
- // 0 = header
- // 1 - n = array(link, text, auth_check)
- $admin_menu = array(
- 'events' => array(
- 0 => $user->lang['events'],
- 1 => array('link' => 'admin/addevent.php' . $SID, 'text' => $user->lang['add'], 'check' => 'a_event_add'),
- 2 => array('link' => 'admin/listevents.php' . $SID, 'text' => $user->lang['list'], 'check' => 'a_event_')
- ),
- 'groupadj' => array(
- 0 => $user->lang['group_adjustments'],
- 1 => array('link' => 'admin/addadj.php' . $SID, 'text' => $user->lang['add'], 'check' => 'a_groupadj_add'),
- 2 => array('link' => 'admin/listadj.php' . $SID, 'text' => $user->lang['list'], 'check' => 'a_groupadj_')
- ),
- 'indivadj' => array(
- 0 => $user->lang['individual_adjustments'],
- 1 => array('link' => 'admin/addiadj.php' . $SID, 'text' => $user->lang['add'], 'check' => 'a_indivadj_add'),
- 2 => array('link' => 'admin/listadj.php' . $SID . '&amp;' . URI_PAGE . '=individual', 'text' => $user->lang['list'], 'check' => 'a_indivadj_')
- ),
- 'items' => array(
- 0 => $user->lang['items'],
- 1 => array('link' => 'admin/additem.php' . $SID, 'text' => $user->lang['add'], 'check' => 'a_item_add'),
- 2 => array('link' => 'admin/listitems.php' . $SID, 'text' => $user->lang['list'], 'check' => 'a_item_')
- ),
- 'mysql' => array(
- 0 => $user->lang['mysql'],
- 1 => array('link' => 'admin/mysql_info.php' . $SID, 'text' => $user->lang['mysql_info'], 'check' => ''),
- 2 => array('link' => 'admin/backup.php' . $SID, 'text' => $user->lang['backup'], 'check' => 'a_backup')
- ),
- 'news' => array(
- 0 => $user->lang['news'],
- 1 => array('link' => 'admin/addnews.php' . $SID, 'text' => $user->lang['add'], 'check' => 'a_news_add'),
- 2 => array('link' => 'admin/listnews.php' . $SID, 'text' => $user->lang['list'], 'check' => 'a_news_')
- ),
- 'raids' => array(
- 0 => $user->lang['raids'],
- 1 => array('link' => 'admin/addraid.php' . $SID, 'text' => $user->lang['add'], 'check' => 'a_raid_add'),
- 2 => array('link' => 'admin/listraids.php' . $SID, 'text' => $user->lang['list'], 'check' => 'a_raid_'),
- ),
- 'turnin' => array(
- 0 => $user->lang['turn_ins'],
- 1 => array('link' => 'admin/addturnin.php' . $SID, 'text' => $user->lang['add'], 'check' => 'a_turnin_add')
- ),
- 'general' => array(
- 0 => $user->lang['general_admin'],
- 1 => array('link' => 'admin/config.php' . $SID, 'text' => $user->lang['configuration'], 'check' => 'a_config_man'),
- 2 => array('link' => 'admin/manage_members.php' . $SID, 'text' => $user->lang['manage_members'], 'check' => 'a_members_man'),
- 3 => array('link' => 'admin/plugins.php' . $SID, 'text' => $user->lang['manage_plugins'], 'check' => 'a_plugins_man'),
- 4 => array('link' => 'admin/manage_users.php' . $SID, 'text' => $user->lang['manage_users'], 'check' => 'a_users_man'),
- 5 => array('link' => 'admin/logs.php' . $SID, 'text' => $user->lang['view_logs'], 'check' => 'a_logs_view')
- ),
- 'styles' => array(
- 0 => $user->lang['styles'],
- 1 => array('link' => 'admin/styles.php' . $SID . '&amp;mode=create', 'text' => $user->lang['create'], 'check' => 'a_styles_man'),
- 2 => array('link' => 'admin/styles.php' . $SID, 'text' => $user->lang['manage'], 'check' => 'a_styles_man')
- )
- );
-
- // Now get plugin hooks for the menu
- $admin_menu = (is_array($pm->get_menus('admin_menu'))) ? array_merge($admin_menu, $pm->get_menus('admin_menu')) : $admin_menu;
-
- // Sort the array by the keys to make it alphabetical by header (essentially)
- // Note: I considered using the header as the key itself, but this could
- // possibly break PHP if non-standard characters were used when another language
- // was in use.
- ksort($admin_menu);
- reset($admin_menu);
-
- foreach ( $admin_menu as $k => $v )
- {
- // Restart next loop if the element isn't an array we can use
- if ( !is_array($v) )
- {
- continue;
- }
-
- // Set the header with the first element
- $tpl->assign_block_vars('header_row', array(
- 'HEADER' => $v[0])
- );
-
- foreach ( $v as $k2 => $row )
- {
- // Ignore the first element (header)
- if ( $k2 == 0 )
- {
- continue;
- }
-
- // Show the link if they have permission to use it
- if ( ($row['check'] == '') || ($user->check_auth($row['check'], false)) )
- {
- $tpl->assign_block_vars('header_row.menu_row', array(
- 'ROW_CLASS' => $eqdkp->switch_row_class(),
- 'LINK' => '<a href="' . $eqdkp_root_path . $row['link'] . '">' . $row['text'] . '</a>')
- );
- }
- }
- }
-
- $tpl->assign_vars(array(
- 'L_ADMINISTRATION' => $user->lang['administration'],
- 'L_ADMIN_INDEX' => $user->lang['admin_index'],
- 'L_EQDKP_INDEX' => $user->lang['eqdkp_index'])
- );
-}
-?>
diff --git a/old/admin/listadj.php b/old/admin/listadj.php
deleted file mode 100644
index d1e4618..0000000
--- a/old/admin/listadj.php
+++ /dev/null
@@ -1,130 +0,0 @@
-<?php
-/******************************
- * EQdkp
- * Copyright 2002-2003
- * Licensed under the GNU GPL. See COPYING for full terms.
- * ------------------
- * listadj.php
- * Began: Fri December 27 2002
- *
- * $Id: listadj.php 46 2007-06-19 07:29:11Z tsigo $
- *
- ******************************/
-
-define('EQDKP_INC', true);
-define('IN_ADMIN', true);
-$eqdkp_root_path = './../';
-include_once($eqdkp_root_path . 'common.php');
-
-$sort_order = array(
- 0 => array('adjustment_date desc', 'adjustment_date'),
- 1 => array('member_name', 'member_name desc'),
- 2 => array('adjustment_reason', 'adjustment_reason desc'),
- 3 => array('adjustment_value desc', 'adjustment_value'),
- 4 => array('adjustment_added_by', 'adjustment_added_by desc')
-);
-
-$current_order = switch_order($sort_order);
-
-//
-// Group Adjustments
-//
-if ( (!isset($_GET[URI_PAGE])) || ($_GET[URI_PAGE] == 'group') )
-{
- $user->check_auth('a_groupadj_');
-
- $u_list_adjustments = 'listadj.php'.$SID.'&amp;';
-
- $page_title = sprintf($user->lang['admin_title_prefix'], $eqdkp->config['guildtag'], $eqdkp->config['dkp_name']).': '.$user->lang['listadj_title'];
-
- $total_adjustments = $db->query_first('SELECT count(*) FROM ' . ADJUSTMENTS_TABLE . ' WHERE member_name IS NULL');
- $start = ( isset($_GET['start']) ) ? $_GET['start'] : 0;
-
- $s_group_adj = true;
-
- $sql = 'SELECT adjustment_id, adjustment_value, adjustment_date, adjustment_added_by
- FROM ' . ADJUSTMENTS_TABLE . '
- WHERE member_name IS NULL
- ORDER BY '.$current_order['sql'].'
- LIMIT '.$start.','.$user->data['user_alimit'];
-
- $listadj_footcount = sprintf($user->lang['listadj_footcount'], $total_adjustments, $user->data['user_alimit']);
- $pagination = generate_pagination('listadj.php'.$SID.'&amp;o='.$current_order['uri']['current'],
- $total_adjustments, $user->data['user_alimit'], $start);
-}
-
-//
-// Individual Adjustments
-//
-elseif ( $_GET[URI_PAGE] == 'individual' )
-{
- $user->check_auth('a_indivadj_');
-
- $u_list_adjustments = 'listadj.php'.$SID.'&amp;' . URI_PAGE . '=individual&amp;';
-
- $page_title = sprintf($user->lang['admin_title_prefix'], $eqdkp->config['guildtag'], $eqdkp->config['dkp_name']).': '.$user->lang['listiadj_title'];
-
- $total_adjustments = $db->query_first('SELECT count(*) FROM ' . ADJUSTMENTS_TABLE . ' WHERE member_name IS NOT NULL');
- $start = ( isset($_GET['start']) ) ? $_GET['start'] : 0;
-
- $s_group_adj = false;
-
- $sql = 'SELECT adjustment_id, adjustment_value, member_name, adjustment_reason, adjustment_date, adjustment_added_by
- FROM ' . ADJUSTMENTS_TABLE . '
- WHERE member_name IS NOT NULL
- ORDER BY '.$current_order['sql'].'
- LIMIT '.$start.','.$user->data['user_alimit'];
-
- $listadj_footcount = sprintf($user->lang['listiadj_footcount'], $total_adjustments, $user->data['user_alimit']);
- $pagination = generate_pagination('listadj.php'.$SID.'&amp;' . URI_PAGE . '=individual&amp;o='.$current_order['uri']['current'],
- $total_adjustments, $user->data['user_alimit'], $start);
-}
-
-if ( !($adj_result = $db->query($sql)) )
-{
- message_die('Could not obtain adjustment information', '', __FILE__, __LINE__, $sql);
-}
-
-while ( $adj = $db->fetch_record($adj_result) )
-{
- $tpl->assign_block_vars('adjustments_row', array(
- 'ROW_CLASS' => $eqdkp->switch_row_class(),
- 'U_ADD_ADJUSTMENT' => (( $s_group_adj ) ? 'addadj.php' : 'addiadj.php') . $SID.'&amp;' . URI_ADJUSTMENT . '='.$adj['adjustment_id'],
- 'DATE' => date($user->style['date_notime_short'], $adj['adjustment_date']),
- 'U_VIEW_MEMBER' => ( isset($adj['member_name']) ) ? $eqdkp_root_path.'viewmember.php'.$SID.'&amp;' . URI_NAME . '='.$adj['member_name'] : '',
- 'MEMBER' => ( isset($adj['member_name']) ) ? $adj['member_name'] : '',
- 'REASON' => ( isset($adj['adjustment_reason']) ) ? stripslashes($adj['adjustment_reason']) : '',
- 'ADJUSTMENT' => $adj['adjustment_value'],
- 'C_ADJUSTMENT' => color_item($adj['adjustment_value']),
- 'ADDED_BY' => ( isset($adj['adjustment_added_by']) ) ? $adj['adjustment_added_by'] : '')
- );
-}
-$db->free_result($adj_result);
-
-$tpl->assign_vars(array(
- 'L_DATE' => $user->lang['date'],
- 'L_MEMBER' => $user->lang['member'],
- 'L_REASON' => $user->lang['reason'],
- 'L_ADJUSTMENT' => $user->lang['adjustment'],
- 'L_ADDED_BY' => $user->lang['added_by'],
-
- 'O_DATE' => $current_order['uri'][0],
- 'O_MEMBER' => $current_order['uri'][1],
- 'O_REASON' => $current_order['uri'][2],
- 'O_ADJUSTMENT' => $current_order['uri'][3],
- 'O_ADDED_BY' => $current_order['uri'][4],
-
- 'U_LIST_ADJUSTMENTS' => $u_list_adjustments,
-
- 'START' => $start,
- 'S_GROUP_ADJ' => $s_group_adj,
- 'LISTADJ_FOOTCOUNT' => $listadj_footcount,
- 'ADJUSTMENT_PAGINATION' => $pagination)
-);
-
-$eqdkp->set_vars(array(
- 'page_title' => $page_title,
- 'template_file' => 'admin/listadj.html',
- 'display' => true)
-);
-?> \ No newline at end of file
diff --git a/old/admin/listevents.php b/old/admin/listevents.php
deleted file mode 100644
index 139081e..0000000
--- a/old/admin/listevents.php
+++ /dev/null
@@ -1,71 +0,0 @@
-<?php
-/******************************
- * EQdkp
- * Copyright 2002-2003
- * Licensed under the GNU GPL. See COPYING for full terms.
- * ------------------
- * listevents.php
- * Began: Fri December 27 2002
- *
- * $Id: listevents.php 46 2007-06-19 07:29:11Z tsigo $
- *
- ******************************/
-
-define('EQDKP_INC', true);
-define('IN_ADMIN', true);
-$eqdkp_root_path = './../';
-include_once($eqdkp_root_path . 'common.php');
-
-$user->check_auth('a_event_');
-
-$sort_order = array(
- 0 => array('event_name', 'event_name desc'),
- 1 => array('event_value desc', 'event_value')
-);
-
-$current_order = switch_order($sort_order);
-
-$total_events = $db->query_first('SELECT count(*) FROM ' . EVENTS_TABLE);
-
-$start = ( isset($_GET['start']) ) ? $_GET['start'] : 0;
-
-$sql = 'SELECT event_id, event_name, event_value
- FROM ' . EVENTS_TABLE . '
- ORDER BY '.$current_order['sql']. '
- LIMIT '.$start.','.$user->data['user_elimit'];
-
-if ( !($events_result = $db->query($sql)) )
-{
- message_die('Could not obtain event information', '', __FILE__, __LINE__, $sql);
-}
-while ( $event = $db->fetch_record($events_result) )
-{
- $tpl->assign_block_vars('events_row', array(
- 'ROW_CLASS' => $eqdkp->switch_row_class(),
- 'U_VIEW_EVENT' => 'addevent.php'.$SID . '&amp;' . URI_EVENT . '='.$event['event_id'],
- 'NAME' => stripslashes($event['event_name']),
- 'VALUE' => $event['event_value'])
- );
-}
-$db->free_result($events_result);
-
-$tpl->assign_vars(array(
- 'L_NAME' => $user->lang['name'],
- 'L_VALUE' => $user->lang['value'],
-
- 'O_NAME' => $current_order['uri'][0],
- 'O_VALUE' => $current_order['uri'][1],
-
- 'U_LIST_EVENTS' => 'listevents.php'.$SID.'&amp;',
-
- 'START' => $start,
- 'LISTEVENTS_FOOTCOUNT' => sprintf($user->lang['listevents_footcount'], $total_events, $user->data['user_elimit']),
- 'EVENT_PAGINATION' => generate_pagination('listevents.php'.$SID.'&amp;o='.$current_order['uri']['current'], $total_events, $user->data['user_elimit'], $start))
-);
-
-$eqdkp->set_vars(array(
- 'page_title' => sprintf($user->lang['admin_title_prefix'], $eqdkp->config['guildtag'], $eqdkp->config['dkp_name']).': '.$user->lang['listevents_title'],
- 'template_file' => 'listevents.html',
- 'display' => true)
-);
-?> \ No newline at end of file
diff --git a/old/admin/listitems.php b/old/admin/listitems.php
deleted file mode 100644
index 8acf0b5..0000000
--- a/old/admin/listitems.php
+++ /dev/null
@@ -1,90 +0,0 @@
-<?php
-/******************************
- * EQdkp
- * Copyright 2002-2003
- * Licensed under the GNU GPL. See COPYING for full terms.
- * ------------------
- * listitems.php
- * Began: Fri December 27 2002
- *
- * $Id: listitems.php 46 2007-06-19 07:29:11Z tsigo $
- *
- ******************************/
-
-define('EQDKP_INC', true);
-define('IN_ADMIN', true);
-$eqdkp_root_path = './../';
-include_once($eqdkp_root_path . 'common.php');
-
-$user->check_auth('a_item_');
-
-$sort_order = array(
- 0 => array('item_date desc', 'item_date'),
- 1 => array('item_buyer', 'item_buyer desc'),
- 2 => array('item_name', 'item_name desc'),
- 3 => array('raid_name', 'raid_name desc'),
- 4 => array('item_value desc', 'item_value')
-);
-
-$current_order = switch_order($sort_order);
-
-$total_items = $db->query_first('SELECT count(*) FROM ' . ITEMS_TABLE);
-$start = ( isset($_GET['start']) ) ? $_GET['start'] : 0;
-
-$sql = 'SELECT i.item_id, i.item_name, i.item_buyer, i.item_date, i.raid_id, i.item_value, r.raid_name
- FROM ' . ITEMS_TABLE . ' i, ' . RAIDS_TABLE . ' r
- WHERE r.raid_id=i.raid_id
- ORDER BY '.$current_order['sql']. '
- LIMIT '.$start.','.$user->data['user_ilimit'];
-
-$listitems_footcount = sprintf($user->lang['listpurchased_footcount'], $total_items, $user->data['user_ilimit']);
-$pagination = generate_pagination('listitems.php'.$SID.'&amp;o='.$current_order['uri']['current'], $total_items, $user->data['user_ilimit'], $start);
-
-if ( !($items_result = $db->query($sql)) )
-{
- message_die('Could not obtain item information', 'Database error', __FILE__, __LINE__, $sql);
-}
-
-while ( $item = $db->fetch_record($items_result) )
-{
- $tpl->assign_block_vars('items_row', array(
- 'ROW_CLASS' => $eqdkp->switch_row_class(),
- 'DATE' => ( !empty($item['item_date']) ) ? date($user->style['date_notime_short'], $item['item_date']) : '&nbsp;',
- 'BUYER' => ( !empty($item['item_buyer']) ) ? $item['item_buyer'] : '&lt;<i>Not Found</i>&gt;',
- 'U_VIEW_BUYER' => ( !empty($item['item_buyer']) ) ? '../viewmember.php'.$SID.'&amp;' . URI_NAME . '='.$item['item_buyer'] : '',
- 'NAME' => stripslashes($item['item_name']),
- 'U_VIEW_ITEM' => 'additem.php'.$SID.'&amp;' . URI_ITEM . '='.$item['item_id'],
- 'RAID' => ( !empty($item['raid_name']) ) ? stripslashes($item['raid_name']) : '&lt;<i>Not Found</i>&gt;',
- 'U_VIEW_RAID' => ( !empty($item['raid_name']) ) ? 'addraid.php'.$SID.'&amp;' . URI_RAID . '='.$item['raid_id'] : '',
- 'VALUE' => $item['item_value'])
- );
-}
-$db->free_result($items_result);
-
-$tpl->assign_vars(array(
- 'L_DATE' => $user->lang['date'],
- 'L_BUYER' => $user->lang['buyer'],
- 'L_ITEM' => $user->lang['item'],
- 'L_RAID' => $user->lang['raid'],
- 'L_VALUE' => $user->lang['value'],
-
- 'O_DATE' => $current_order['uri'][0],
- 'O_BUYER' => $current_order['uri'][1],
- 'O_NAME' => $current_order['uri'][2],
- 'O_RAID' => $current_order['uri'][3],
- 'O_VALUE' => $current_order['uri'][4],
-
- 'U_LIST_ITEMS' => 'listitems.php'.$SID.'&amp;',
-
- 'START' => $start,
- 'S_HISTORY' => true,
- 'LISTITEMS_FOOTCOUNT' => $listitems_footcount,
- 'ITEM_PAGINATION' => $pagination)
-);
-
-$eqdkp->set_vars(array(
- 'page_title' => sprintf($user->lang['admin_title_prefix'], $eqdkp->config['guildtag'], $eqdkp->config['dkp_name']).': '.$user->lang['listpurchased_title'],
- 'template_file' => 'listitems.html',
- 'display' => true)
-);
-?> \ No newline at end of file
diff --git a/old/admin/listnews.php b/old/admin/listnews.php
deleted file mode 100644
index 311ae95..0000000
--- a/old/admin/listnews.php
+++ /dev/null
@@ -1,74 +0,0 @@
-<?php
-/******************************
- * EQdkp
- * Copyright 2002-2003
- * Licensed under the GNU GPL. See COPYING for full terms.
- * ------------------
- * listnews.php
- * Began: Fri December 27 2002
- *
- * $Id: listnews.php 46 2007-06-19 07:29:11Z tsigo $
- *
- ******************************/
-
-define('EQDKP_INC', true);
-define('IN_ADMIN', true);
-$eqdkp_root_path = './../';
-include_once($eqdkp_root_path . 'common.php');
-
-$user->check_auth('a_news_');
-
-$sort_order = array(
- 0 => array('news_date desc', 'news_date'),
- 1 => array('news_headline', 'news_headline desc'),
- 2 => array('username', 'username desc')
-);
-
-$current_order = switch_order($sort_order);
-
-$total_news = $db->query_first('SELECT count(*) FROM ' . NEWS_TABLE);
-$start = ( isset($_GET['start']) ) ? $_GET['start'] : 0;
-
-$sql = 'SELECT n.news_id, n.news_date, n.news_headline, n.news_message, u.username
- FROM ' . NEWS_TABLE . ' n, ' . USERS_TABLE . ' u
- WHERE (n.user_id = u.user_id)
- ORDER BY '.$current_order['sql'].'
- LIMIT '.$start.',50';
-
-if ( !($result = $db->query($sql)) )
-{
- message_die('Could not obtain news information', '', __FILE__, __LINE__, $sql);
-}
-while ( $news = $db->fetch_record($result) )
-{
- $tpl->assign_block_vars('news_row', array(
- 'ROW_CLASS' => $eqdkp->switch_row_class(),
- 'DATE' => date($user->style['date_time'], $news['news_date']),
- 'USERNAME' => $news['username'],
- 'U_VIEW_NEWS' => 'addnews.php'.$SID.'&amp;' . URI_NEWS . '='.$news['news_id'],
- 'HEADLINE' => stripslashes($news['news_headline']))
- );
-}
-
-$tpl->assign_vars(array(
- 'L_DATE' => $user->lang['date'],
- 'L_USERNAME' => $user->lang['username'],
- 'L_HEADLINE' => $user->lang['headline'],
-
- 'O_DATE' => $current_order['uri'][0],
- 'O_USERNAME' => $current_order['uri'][2],
- 'O_HEADLINE' => $current_order['uri'][1],
-
- 'U_LIST_NEWS' => 'listnews.php'.$SID,
-
- 'START' => $start,
- 'LISTNEWS_FOOTCOUNT' => sprintf($user->lang['listnews_footcount'], $total_news, 50),
- 'NEWS_PAGINATION' => generate_pagination('listnews.php'.$SID.'&amp;o='.$current_order['uri']['current'], $total_news, 50, $start))
-);
-
-$eqdkp->set_vars(array(
- 'page_title' => sprintf($user->lang['admin_title_prefix'], $eqdkp->config['guildtag'], $eqdkp->config['dkp_name']).': '.$user->lang['listnews_title'],
- 'template_file' => 'admin/listnews.html',
- 'display' => true)
-);
-?> \ No newline at end of file
diff --git a/old/admin/listraids.php b/old/admin/listraids.php
deleted file mode 100644
index 6eee6dc..0000000
--- a/old/admin/listraids.php
+++ /dev/null
@@ -1,78 +0,0 @@
-<?php
-/******************************
- * EQdkp
- * Copyright 2002-2003
- * Licensed under the GNU GPL. See COPYING for full terms.
- * ------------------
- * listraids.php
- * Began: Tue December 24 2002
- *
- * $Id: listraids.php 46 2007-06-19 07:29:11Z tsigo $
- *
- ******************************/
-
-define('EQDKP_INC', true);
-define('IN_ADMIN', true);
-$eqdkp_root_path = './../';
-include_once($eqdkp_root_path . 'common.php');
-
-$user->check_auth('a_raid_');
-
-$sort_order = array(
- 0 => array('raid_date desc', 'raid_date'),
- 1 => array('raid_name', 'raid_name desc'),
- 2 => array('raid_note', 'raid_note desc'),
- 3 => array('raid_value desc', 'raid_value')
-);
-
-$current_order = switch_order($sort_order);
-
-$total_raids = $db->query_first('SELECT count(*) FROM ' . RAIDS_TABLE);
-
-$start = ( isset($_GET['start']) ) ? $_GET['start'] : 0;
-
-$sql = 'SELECT raid_id, raid_name, raid_date, raid_note, raid_value
- FROM ' . RAIDS_TABLE . '
- ORDER BY '.$current_order['sql']. '
- LIMIT '.$start.','.$user->data['user_rlimit'];
-
-if ( !($raids_result = $db->query($sql)) )
-{
- message_die('Could not obtain raid information', '', __FILE__, __LINE__, $sql);
-}
-while ( $row = $db->fetch_record($raids_result) )
-{
- $tpl->assign_block_vars('raids_row', array(
- 'ROW_CLASS' => $eqdkp->switch_row_class(),
- 'DATE' => ( !empty($row['raid_date']) ) ? date($user->style['date_notime_short'], $row['raid_date']) : '&nbsp;',
- 'U_VIEW_RAID' => 'addraid.php'.$SID.'&amp;' . URI_RAID . '='.$row['raid_id'],
- 'NAME' => stripslashes($row['raid_name']),
- 'NOTE' => ( !empty($row['raid_note']) ) ? stripslashes($row['raid_note']) : '&nbsp;',
- 'VALUE' => $row['raid_value'])
- );
-}
-
-$tpl->assign_vars(array(
- 'L_DATE' => $user->lang['date'],
- 'L_NAME' => $user->lang['name'],
- 'L_NOTE' => $user->lang['note'],
- 'L_VALUE' => $user->lang['value'],
-
- 'O_DATE' => $current_order['uri'][0],
- 'O_NAME' => $current_order['uri'][1],
- 'O_NOTE' => $current_order['uri'][2],
- 'O_VALUE' => $current_order['uri'][3],
-
- 'U_LIST_RAIDS' => 'listraids.php'.$SID.'&amp;',
-
- 'START' => $start,
- 'LISTRAIDS_FOOTCOUNT' => sprintf($user->lang['listraids_footcount'], $total_raids, $user->data['user_rlimit']),
- 'RAID_PAGINATION' => generate_pagination('listraids.php'.$SID.'&amp;o='.$current_order['uri']['current'], $total_raids, $user->data['user_rlimit'], $start))
-);
-
-$eqdkp->set_vars(array(
- 'page_title' => sprintf($user->lang['admin_title_prefix'], $eqdkp->config['guildtag'], $eqdkp->config['dkp_name']).': '.$user->lang['listraids_title'],
- 'template_file' => 'listraids.html',
- 'display' => true)
-);
-?> \ No newline at end of file
diff --git a/old/admin/logs.php b/old/admin/logs.php
deleted file mode 100644
index 09f9e1b..0000000
--- a/old/admin/logs.php
+++ /dev/null
@@ -1,246 +0,0 @@
-<?php
-/******************************
- * EQdkp
- * Copyright 2002-2003
- * Licensed under the GNU GPL. See COPYING for full terms.
- * ------------------
- * logs.php
- * Began: Tues December 24 2002
- *
- * $Id: logs.php 46 2007-06-19 07:29:11Z tsigo $
- *
- ******************************/
-
-define('EQDKP_INC', true);
-define('IN_ADMIN', true);
-$eqdkp_root_path = './../';
-include_once($eqdkp_root_path . 'common.php');
-
-$sort_order = array(
- 0 => array('log_date desc', 'log_date'),
- 1 => array('log_type', 'log_type desc'),
- 2 => array('username', 'username dsec'),
- 3 => array('log_ipaddress', 'log_ipaddress desc'),
- 4 => array('log_result', 'log_result desc')
-);
-
-$current_order = switch_order($sort_order);
-
-// Obtain var settings
-$log_id = ( !empty($_GET[URI_LOG]) ) ? intval($_REQUEST[URI_LOG]) : false;
-$search = ( !empty($_GET['search']) ) ? true : false;
-
-if ( $log_id )
-{
- $action = 'view';
-}
-else
-{
- $action = 'list';
-}
-
-$user->check_auth('a_logs_view');
-
-//
-// Processing
-//
-$valid_action_types = array(
- '{L_ACTION_EVENT_ADDED}' => $user->lang['action_event_added'],
- '{L_ACTION_EVENT_UPDATED}' => $user->lang['action_event_updated'],
- '{L_ACTION_EVENT_DELETED}' => $user->lang['action_event_deleted'],
- '{L_ACTION_GROUPADJ_ADDED}' => $user->lang['action_groupadj_added'],
- '{L_ACTION_GROUPADJ_UPDATED}' => $user->lang['action_groupadj_updated'],
- '{L_ACTION_GROUPADJ_DELETED}' => $user->lang['action_groupadj_deleted'],
- '{L_ACTION_INDIVADJ_ADDED}' => $user->lang['action_indivadj_added'],
- '{L_ACTION_INDIVADJ_UPDATED}' => $user->lang['action_indivadj_updated'],
- '{L_ACTION_INDIVADJ_DELETED}' => $user->lang['action_indivadj_deleted'],
- '{L_ACTION_ITEM_ADDED}' => $user->lang['action_item_added'],
- '{L_ACTION_ITEM_UPDATED}' => $user->lang['action_item_updated'],
- '{L_ACTION_ITEM_DELETED}' => $user->lang['action_item_deleted'],
- '{L_ACTION_MEMBER_ADDED}' => $user->lang['action_member_added'],
- '{L_ACTION_MEMBER_UPDATED}' => $user->lang['action_member_updated'],
- '{L_ACTION_MEMBER_DELETED}' => $user->lang['action_member_deleted'],
- '{L_ACTION_NEWS_ADDED}' => $user->lang['action_news_added'],
- '{L_ACTION_NEWS_UPDATED}' => $user->lang['action_news_updated'],
- '{L_ACTION_NEWS_DELETED}' => $user->lang['action_news_deleted'],
- '{L_ACTION_RAID_ADDED}' => $user->lang['action_raid_added'],
- '{L_ACTION_RAID_UPDATED}' => $user->lang['action_raid_updated'],
- '{L_ACTION_RAID_DELETED}' => $user->lang['action_raid_deleted'],
- '{L_ACTION_TURNIN_ADDED}' => $user->lang['action_turnin_added']);
-
-$valid_action_types = array_merge($valid_action_types, $pm->get_log_actions());
-
-switch ( $action )
-{
- case 'view':
- // Get log info
- $sql = 'SELECT l.*, u.username FROM (' . LOGS_TABLE . ' l
- LEFT JOIN ' . USERS_TABLE . " u
- ON u.user_id=l.admin_id )
- WHERE log_id='".$log_id."'";
- $result = $db->query($sql);
- $log = $db->fetch_record($result);
- $db->free_result($result);
-
- eval($log['log_action']);
-
- if ( !empty($log_action['header']) )
- {
- $log_header = lang_replace($log_action['header']);
- }
-
- $eqdkp->switch_row_class();
-
- foreach ( $log_action as $k => $v )
- {
- if ( $k != 'header' )
- {
- $k = lang_replace($k);
- $v = lang_replace($v);
-
- $tpl->assign_block_vars('log_row', array(
- 'ROW_CLASS' => $eqdkp->switch_row_class(),
- 'KEY' => stripslashes($k).':',
- 'VALUE' => stripslashes($v))
- );
- }
- }
-
- $tpl->assign_vars(array(
- 'S_LIST' => false,
-
- 'L_LOG_VIEWER' => $user->lang['viewlogs_title'],
- 'L_DATE' => $user->lang['date'],
- 'L_USERNAME' => $user->lang['username'],
- 'L_IP_ADDRESS' => $user->lang['ip_address'],
- 'L_SESSION_ID' => $user->lang['session_id'],
-
- 'LOG_DATE' => ( !empty($log['log_date']) ) ? date($user->style['date_time'], $log['log_date']) : '&nbsp;',
- 'LOG_USERNAME' => ( !empty($log['username']) ) ? $log['username'] : '&nbsp;',
- 'LOG_IP_ADDRESS' => $log['log_ipaddress'],
- 'LOG_SESSION_ID' => $log['log_sid'],
- 'LOG_ACTION' => ( !empty($log_header) ) ? $log_header : '&nbsp;')
- );
-
- break;
- case 'list':
- $sql = 'SELECT l.*, u.username FROM (' . LOGS_TABLE . ' l
- LEFT JOIN ' . USERS_TABLE . ' u
- ON u.user_id=l.admin_id )';
-
- $addon_sql = '';
- $search_term = '';
-
- // If they're looking for something specific, we have to
- // figure out what that is
- if ( $search )
- {
- $search_term = urldecode($_GET['search']);
-
- // Check if it's an action
- if ( in_array($search_term, $valid_action_types) )
- {
- foreach ( $valid_action_types as $k => $v )
- {
- if ( $v == $search_term )
- {
- $addon_sql = " WHERE l.log_type='".$k."'";
- }
- }
- }
- // Check it's an IP
- elseif ( preg_match("/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/", $search_term) )
- {
- $addon_sql = " WHERE l.log_ipaddress='".$search_term."'";
- }
- // Still going? It's a username
- else
- {
- $addon_sql = " WHERE u.username='".$search_term."'";
- }
- }
-
- $total_sql = 'SELECT count(*)
- FROM ( ' . LOGS_TABLE . ' l
- LEFT JOIN ' . USERS_TABLE . ' u
- ON u.user_id=l.admin_id )';
- $total_logs = $db->query_first($total_sql . $addon_sql);
-
- $start = ( isset($_GET['start']) ) ? $_GET['start'] : 0;
-
- $result = $db->query($sql . $addon_sql . ' ORDER BY ' . $current_order['sql'] . ' LIMIT '.$start.',100');
- while ( $log = $db->fetch_record($result) )
- {
- $log['log_type'] = lang_replace($log['log_type']);
- $log['log_result'] = lang_replace($log['log_result']);
-
- $tpl->assign_block_vars('logs_row', array(
- 'ROW_CLASS' => $eqdkp->switch_row_class(),
- 'DATE' => ( !empty($log['log_date']) ) ? date($user->style['date_time'], $log['log_date']) : '&nbsp;',
- 'TYPE' => ( !empty($log['log_type']) ) ? $log['log_type'] : '&nbsp;',
- 'U_VIEW_LOG' => 'logs.php?' . URI_LOG . '='.$log['log_id'],
- 'USER' => $log['username'],
- 'IP' => $log['log_ipaddress'],
- 'RESULT' => $log['log_result'],
- 'C_RESULT' => ( $log['log_result'] == $user->lang['success'] ) ? 'positive' : 'negative',
- 'ENCODED_TYPE' => urlencode($log['log_type']),
- 'ENCODED_USER' => urlencode($log['username']),
- 'ENCODED_IP' => urlencode($log['log_ipaddress']))
- );
- }
-
- $tpl->assign_vars(array(
- 'S_LIST' => true,
-
- 'L_DATE' => $user->lang['date'],
- 'L_TYPE' => $user->lang['type'],
- 'L_VIEW_ACTION' => $user->lang['view_action'],
- 'L_USER' => $user->lang['user'],
- 'L_IP_ADDRESS' => $user->lang['ip_address'],
- 'L_RESULT' => $user->lang['result'],
- 'L_VIEW' => $user->lang['view'],
-
- 'O_DATE' => $current_order['uri'][0],
- 'O_TYPE' => $current_order['uri'][1],
- 'O_USER' => $current_order['uri'][2],
- 'O_IP' => $current_order['uri'][3],
- 'O_RESULT' => $current_order['uri'][4],
-
- 'U_LOGS' => 'logs.php'.$SID.'&amp;search='.$search_term.'&amp;start='.$start.'&amp;',
- 'U_LOGS_SEARCH' => 'logs.php'.$SID.'&amp;',
-
- 'CURRENT_ORDER' => $current_order['uri']['current'],
- 'START' => $start,
- 'VIEWLOGS_FOOTCOUNT' => sprintf($user->lang['viewlogs_footcount'], $total_logs, 100),
- 'VIEWLOGS_PAGINATION' => generate_pagination('logs.php'.$SID.'&amp;search='.$search_term.'&amp;o='.$current_order['uri']['current'],
- $total_logs, '100', $start))
- );
- break;
-}
-
-$eqdkp->set_vars(array(
- 'page_title' => sprintf($user->lang['title_prefix'], $eqdkp->config['guildtag'], $eqdkp->config['dkp_name']).': '.$user->lang['viewlogs_title'],
- 'template_file' => 'admin/logs.html',
- 'display' => true)
-);
-
-/**
-* Returns the language value of a variable in the format "{L_<LANG_KEY>}"
-* Allows use of template-style variables outside of templates
-*
-* @param $variable Variable to replace language keys for
-* @return string Translated variable
-*/
-function lang_replace($variable)
-{
- global $user;
-
- preg_match("/\{L_(.+)\}/", $variable, $to_replace);
- if ( (isset($to_replace[1])) && (isset($user->lang[strtolower($to_replace[1])])) )
- {
- $variable = str_replace('{L_'.$to_replace[1].'}', $user->lang[strtolower($to_replace[1])], $variable);
- }
-
- return $variable;
-}
-?> \ No newline at end of file
diff --git a/old/admin/lua.php b/old/admin/lua.php
deleted file mode 100644
index 4f42859..0000000
--- a/old/admin/lua.php
+++ /dev/null
@@ -1,634 +0,0 @@
-<?php
- /******************************
- * EQdkp
- * Copyright 2005
- * Licensed under the GNU GPL. See COPYING for full terms.
- * ------------------
- * lua.php
- * Began: Mon Sept 19 2005
- *
- * $Id: lua.php 8 2006-05-08 17:15:20Z tsigo $
- *
- ******************************/
-
- // EQdkp required files/vars
- define('EQDKP_INC', true);
- define('IN_ADMIN', true);
- $eqdkp_root_path = './../';
-
- include_once($eqdkp_root_path . 'common.php');
- include_once($eqdkp_root_path . 'admin/lua_config.php');
-
- $lua_set_OnlySimulate = false;
- $user->check_auth('u_lua_import');
-
- if(!function_exists("html_entity_decode")) {
-
- function html_entity_decode($string)
- {
- $string = preg_replace('~&#x([0-9a-f]+);~ei', 'chr(hexdec("\\1"))', $string);
- $string = preg_replace('~&#([0-9]+);~e', 'chr(\\1)', $string);
- $trans_tbl = get_html_translation_table(HTML_ENTITIES);
- $trans_tbl = array_flip($trans_tbl);
- return strtr($string, $trans_tbl);
- }
- }
-
-class LUA_Import extends EQdkp_Admin {
-
- function lua_import()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID;
- parent::eqdkp_admin();
- $this->assoc_buttons(Array(
- 'parse' => Array('name' => 'parse',
- 'process' => 'process_parse',
- 'check' => 'u_lua_import'),
- 'form' => Array('name' => '',
- 'process' => 'display_form',
- 'check' => 'u_lua_import'),
- 'insert' => Array('name' => 'insertraids',
- 'process' => 'insert_log',
- 'check' => 'u_lua_import'), ));
- }
-
- function xml2Array($xml)
- {
- $xml = trim($xml);
- $xml = '<?
- xml version = "1 . 0" encoding = "ISO - 8859 - 1"?>
-
-'.$xml;
- $xp = xml_parser_create();
- xml_parser_set_option($xp, XML_OPTION_CASE_FOLDING, false);
- xml_parser_set_option($xp, XML_OPTION_SKIP_WHITE, false);
- xml_parser_set_option($xp, XML_OPTION_TARGET_ENCODING, "ISO-8859-1");
- xml_parse_into_struct($xp,trim($xml),$vals,$index);
- xml_parser_free($xp);
- $_data = NULL;
- $temp = $depth = array();
- $dc = array();
-
- foreach($vals as $value)
- {
- $p = join('::', $depth);
- $key = $value['tag'];
- switch ($value['type'])
- {
- case 'open':
- array_push($depth, $key);
- array_push($depth, (int)$dc[$p]++);
- break;
- case 'complete':
- array_pop($depth);
- array_push($depth, $key);
- $p = join('::',$depth);
- $temp[$p] = $value['value'];
- array_pop($depth);
- array_push($depth, (int)$dc[$p]);
- break;
- case 'close':
- array_pop($depth);
- array_pop($depth);
- break;
- }
- }
-
- foreach($temp as $key=>$value)
- {
- $levels = explode('::',$key);
- $num_levels = count($levels);
- if ($num_levels==1)
- {
- $_data[$levels[0]] = $value;
- }
- else
- {
- $pointer = &$_data;
- for ($i = 0; $i < $num_levels; $i++)
- {
- if (!isset($pointer[$levels[$i]]))
- {
- $pointer[$levels[$i]] = array();
- }
- $pointer = &$pointer[$levels[$i]];
- }
- $pointer = $value;
- }
-
- }
- return ($_data);
- }
-
-function process_parse()
-{
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID;
- global $lua_set_MinItemQuality, $lua_set_IgnoredLooter, $lua_set_ConvertNames;
- global $lua_set_LootNoteEventTriggerCheck, $lua_set_PlayerAliases, $lua_set_AddLootDkpValuesCheckbox;
- global $lua_set_ignoritems, $lua_set_ownraids, $itemidtoname;
-
- $_POST['log'] = trim(str_replace("&", "and", html_entity_decode($_POST['log'])));
-
- if(!preg_match("/<RaidInfo><key>.*?<\/key>.*?<Join>.*?<\/Join><Leave>.*?<\/Leave><Loot>.*?<\/Loot><\/RaidInfo>/s", $_POST['log']))
- {
- message_die($user->lang['lua_step1_invalidstring_msg'], $user->lang['lua_step1_invalidstring_titel']);
- }
-
- $allraids = array();
- $allevents = array();
- $allraidattendees = array();
- $itemidtoname = array();
-
- $adata = $this->xml2array($_POST['log']);
- $globalevent = $this->GetRaidEventFromString($adata['RaidInfo']['note']);
- $globalraidnote = $this->GetRaidNoteFromString($adata['RaidInfo']['note']);
-
- if(!isset($lua_set_ignoritems)) { $lua_set_ignoritems = array(); }
-
- if($allforeachdata = @array_shift($adata['RaidInfo'][0]['Join'])) foreach($allforeachdata as $playerdata)
- {
- $playerdata['time'] = $this->ConvertTimestringToTimestamp($playerdata['time']);
-
- if(!empty($lua_set_PlayerAliases[$playerdata['player']]))
- {
- $playerdata['player'] = $lua_set_PlayerAliases[$playerdata['player']];
- }
-
- if($lua_set_ConvertNames)
- {
- $playerdata['player'] = $this->StripSpecialChars($playerdata['player']);
- }
-
- if(!isset($allattendees[$playerdata['player']]))
- {
- $allattendees[$playerdata['player']] = array("firstjoin" => 0, "lastjoin" => 0, "lastleave" => 0, "race" => 0, "class" => 0, "level" => 0);
- }
-
- if($playerdata['time'] < $allattendees[$playerdata['player']]['firstjoin'] || empty($allattendees[$playerdata['player']]['firstjoin']))
- {
- $allattendees[$playerdata['player']]['firstjoin'] = $playerdata['time'];
- }
-
- if($playerdata['time'] > $allattendees[$playerdata['player']]['lastjoin'] || empty($allattendees[$playerdata['player']]['lastjoin']))
- {
- $allattendees[$playerdata['player']]['lastjoin'] = $playerdata['time'];
- }
-
- if(!empty($playerdata['race']) && empty($allattendees[$playerdata['player']]['race']))
- {
- $allattendees[$playerdata['player']]['race'] = $this->GetRaceIdByRaceName($playerdata['race']);
- }
-
- if(!empty($playerdata['class']) && empty($allattendees[$playerdata['player']]['class']))
- {
- $allattendees[$playerdata['player']]['class'] = $this->GetClassIdByClassNameLevel($playerdata['class'], $playerdata['level']);
- }
-
- if(!empty($playerdata['level']) && $allattendees[$playerdata['player']]['level'] < $playerdata['level'])
- {
- $allattendees[$playerdata['player']]['level'] = $playerdata['level'];
- }
-
- }
-
- if($allforeachdata = @array_shift($adata['RaidInfo'][0]['Leave'])) foreach($allforeachdata as $playerdata)
- {
- $playerdata['time'] = $this->ConvertTimestringToTimestamp($playerdata['time']);
- if(!empty($lua_set_PlayerAliases[$playerdata['player']]))
- {
- $playerdata['player'] = $lua_set_PlayerAliases[$playerdata['player']];
- }
-
- if($lua_set_ConvertNames)
- {
- $playerdata['player'] = $this->StripSpecialChars($playerdata['player']);
- }
-
- if($playerdata['time'] > $allattendees[$playerdata['player']]['lastjoin'])
- {
- $allattendees[$playerdata['player']]['lastleave'] = $playerdata['time'];
- }
- }
-
- $i = 0;
- $allforeachdata = @array_shift($adata['RaidInfo'][0]['Loot']);
-
- if(!empty($allforeachdata)) foreach($allforeachdata as $lootdata)
- {
- if(!empty($lua_set_PlayerAliases[$playerdata['Player']]))
- {
- $playerdata['Player'] = $lua_set_PlayerAliases[$playerdata['Player']];
- }
-
- if($lua_set_ConvertNames)
- {
- $lootdata['Player'] = $this->StripSpecialChars($lootdata['Player']);
- }
-
- $itemid = $this->GetMainItemId($lootdata['ItemID']);
- $itemidtoname[$itemid] = str_replace("\\'", "'", $lootdata['ItemName']);
- $allloot[$i]['itemid'] = $itemid;
- $allloot[$i]['name'] = $this->GetItemName($itemid);
- $allloot[$i]['quality'] = $this->GetItemQualityByColor($lootdata['Color']);
- $allloot[$i]['looter'] = $lootdata['Player'];
- $allloot[$i]['time'] = $this->ConvertTimestringToTimestamp($lootdata['Time']);
- $lootraidnote = $this->GetRaidNoteFromString($lootdata['Note']);
- $lootraidevent = $this->GetRaidEventFromString($lootdata['Note']);
-
- if(!empty($lootraidnote) && $lootraidnote != "Unknown")
- {
- $alllootraidnote = $lootraidnote;
- } else {
- $alllootraidnote = $globalraidnote;
- }
-
- if(!empty($lootraidevent) && $lootraidevent != "Unknown Event" && $lua_set_LootNoteEventTriggerCheck)
- {
- $alllootraidevent = $lootraidevent;
- } else {
- $alllootraidevent = $globalevent;
- }
-
- if(!in_array($alllootraidevent, $allevents))
- {
- $allevents[] = $alllootraidevent;
- }
-
- if(in_array($alllootraidnote, $lua_set_ownraids))
- {
- $alllootraidnote = $alllootraidnote."-".$this->GenerateUniqId()."-";
- }
-
- $allloot[$i]['raidnote'] = $alllootraidnote;
- $allloot[$i]['raidevent'] = $alllootraidevent;
-
- if(!isset($allraids[$alllootraidnote]))
- {
- $allraids[$alllootraidnote] = array();
- }
-
- if(!isset($allraids[$alllootraidevent][$alllootraidnote]))
- {
- $allraids[$alllootraidevent][$alllootraidnote] = $allloot[$i]['time'];
- }
-
- if(!empty($lootdata['Note']))
- {
- preg_match("/([\d\.]+) DKP/", $lootdata['Note'], $dkpinfo);
- if(!empty($dkpinfo[1]))
- {
- $allloot[$i]['dkp'] = $dkpinfo[1];
- }
- }
-
- foreach($allattendees as $player => $times)
- {
- if($allloot[$i]['time'] > $times['firstjoin'] && ($times['lastleave'] > $allloot[$i]['time'] || empty($times['lastleave'])))
- {
- $allloot[$i]['attendees'][] = $player;
- $allraidattendees[$alllootraidevent][$alllootraidnote][] = $player;
- }
- }
- $allraidattendees[$alllootraidevent][$alllootraidnote] = array_unique($allraidattendees[$alllootraidevent][$alllootraidnote]);
- sort($allraidattendees[$alllootraidevent][$alllootraidnote]);
- $i++;
- }
-
- if(empty($allforeachdata))
- {
- if(!in_array($globalevent, $allevents))
- {
- $allevents[] = $globalevent;
- }
-
- if(!isset($allraids[$globalraidnote]))
- {
- $allraids[$globalraidnote] = array();
- }
-
- foreach($allattendees as $player => $times)
- {
- $allraidattendees[$globalevent][$globalraidnote][] = $player;
- }
-
- $allraidattendees[$globalevent][$globalraidnote] = array_unique($allraidattendees[$globalevent][$globalraidnote]);
- sort($allraidattendees[$globalevent][$globalraidnote]);
-
- if(!isset($allraids[$globalevent][$globalraidnote]))
- {
- $allraids[$globalevent][$globalraidnote] = $this->ConvertTimestringToTimestamp($adata['RaidInfo']['key']);
- }
- }
- #print_r($allraidattendees);
- #print_r($allattendees);
- #print_r($allevents);
- #print_r($allraids);
- #print_r($allloot);
-
- $tpl->assign_vars(array(
- 'S_STEP1' => false,
- 'L_FOUND_RAIDS' => $user->lang['lua_step2_foundraids'],
- 'L_RAIDS_DROPS_DETAILS' => $user->lang['lua_step2_raidsdropsdetails'],
- 'L_RAIDS_INSERT' => $user->lang['lua_step2_insertraids'],
- 'L_DKP_VALUE_TIP' => $user->lang['lua_step2_dkpvaluetip'],
- 'S_ADDLOOTDKPVALUES' => (($lua_set_AddLootDkpValuesCheckbox) ? true : false),
- )
- );
- foreach($allattendees as $playername => $playerdata)
- {
- $tpl->assign_block_vars('allplayers_row', array(
- 'ALLPLAYERNAME' => $playername,
- 'ALLPLAYERRACE' => $playerdata['race'],
- 'ALLPLAYERCLASS' => $playerdata['class'],
- 'ALLPLAYERLEVEL' => $playerdata['level'],
- ));
- }
-
- foreach($allevents as $hevent)
- {
- $tpl->assign_block_vars('events_row', array(
- 'HEVENT' => $hevent,
- 'STRIPPEDHEVENT' => $this->StripUniqIdFromString($hevent),
- ));
-
- foreach($allraids[$hevent] as $hraidnote => $hraidtime)
- {
- $eventvalue = $db->query("SELECT `event_value` FROM ".EVENTS_TABLE." WHERE event_name = '".mysql_escape_string($hevent)."' LIMIT 1");
- $eventvalue = $db->fetch_record($eventvalue);
- $eventvalue = $eventvalue['event_value'];
- if($eventvalue <= 0)
- {
- $eventvalue = "";
- }
- $STRIPPEDHRAIDNOTE = $this->StripUniqIdFromString($hraidnote);
- $tpl->assign_block_vars('events_row.raids_row', array(
- 'ROW_CLASS' => $eqdkp->switch_row_class(),
- 'HRAIDNOTE' => $hraidnote,
- 'HRAIDTIME' => $hraidtime,
- 'HRAIDTIME_MO' => date("m", $hraidtime),
- 'HRAIDTIME_D' => date("d", $hraidtime),
- 'HRAIDTIME_Y' => date("Y", $hraidtime),
- 'HRAIDTIME_H' => date("H", $hraidtime),
- 'HRAIDTIME_MI' => date("i", $hraidtime),
- 'HRAIDTIME_S' => date("s", $hraidtime),
- 'STRIPPEDHRAIDNOTE' => (($STRIPPEDHRAIDNOTE == "Unknown") ? "" : $STRIPPEDHRAIDNOTE),
- 'RAIDDKPVALUE' => $eventvalue,
- 'ATTENDEES' => @implode("\n", $allraidattendees[$hevent][$hraidnote]),
- 'ATTENDEESCOUNT' => @count($allraidattendees[$hevent][$hraidnote]),
- ));
-
- $i = 0;
- $hraidattendees = array();
-
- if(!isset($allloot))
- {
- $allloot = array();
- }
-
- foreach($allloot as $hlootid => $hlootdata)
- {
- if($hlootdata['raidnote'] == $hraidnote && $hlootdata['raidevent'] == $hevent)
- {
- if($hlootdata['quality'] >= $lua_set_MinItemQuality && !in_array($hlootdata['itemid'], $lua_set_ignoritems) && strtolower($hlootdata['looter']) != strtolower($lua_set_IgnoredLooter))
- {
- $tpl->assign_block_vars('events_row.raids_row.loot_row', array(
- 'HNR' => $i,
- 'HNAME' => $hlootdata['name'],
- 'HID' => $hlootdata['itemid'],
- 'HLOOTER' => $hlootdata['looter'],
- 'HDKP' => ((!empty($hlootdata['dkp'])) ? $hlootdata['dkp'] : $this->GetDkpValue($hlootdata['name'])),
- 'STRIPPEDHRAIDNOTE' => $this->StripUniqIdFromString($hraidnote),
- ));
- }
- }
- $i++;
- }
- }
- }
-
- $eqdkp->set_vars(array(
- 'page_title' => sprintf($user->lang['admin_title_prefix'], $eqdkp->config['guildtag'], $eqdkp->config['dkp_name']).': '.$user->lang['lua_step2_pagetitel'],
- 'template_file' => 'admin/lua.html',
- 'display' => true,
- )
- );
-}
-
-function insert_log()
-{
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID;
- global $lua_set_MinItemQuality, $lua_set_OnlySimulate, $lua_set_NewMemberDefaultRank, $lua_set_ignoritems, $lua_set_ownraids;
- $a = 0;
- foreach($_POST['events'] as $ievent)
- {
- $inewevent = $_POST['newevents'][$ievent];
- foreach($_POST['raids'][$ievent] as $iraid => $iraidtime)
- {
- $inewraidtime = mktime($_POST['raidtimes'][$ievent][$iraid]['h'], $_POST['raidtimes'][$ievent][$iraid]['mi'], $_POST['raidtimes'][$ievent][$iraid]['s'], $_POST['raidtimes'][$ievent][$iraid]['mo'], $_POST['raidtimes'][$ievent][$iraid]['d'], $_POST['raidtimes'][$ievent][$iraid]['y']);
- $inewraidnote = $_POST['newraidnotes'][$ievent][$iraid];
- $inewraidattendees = trim($_POST['newraidattendees'][$ievent][$iraid]);
- $iallraids[$a]['event'] = $inewevent;
- $iallraids[$a]['raidnote'] = $inewraidnote;
- $iallraids[$a]['time'] = $inewraidtime;
- $iallraids[$a]['dkp'] = 0;
- $iallraids[$a]['attendees'] = explode("\n", $inewraidattendees);
- if(empty($inewraidattendees))
- {
- $iallraids[$a]['donotadd'] = true;
- }
- else
- {
- $iallraids[$a]['donotadd'] = false;
- }
- $iallraids[$a]['loots'] = array();
- $i = 0;
- if(!isset($_POST['loots'][$ievent][$iraid])) { $_POST['loots'][$ievent][$iraid] = array(); }
- foreach($_POST['loots'][$ievent][$iraid] as $ilootdata)
- {
- if(!empty($ilootdata['dkp']) || $ilootdata['dkp'] == "0")
- {
- $iallraids[$a]['loots'][$i]['name'] = str_replace("\\'", "'", $ilootdata['name']);
- $iallraids[$a]['loots'][$i]['id'] = $ilootdata['id'];
- $iallraids[$a]['loots'][$i]['looter'] = $ilootdata['looter'];
- $iallraids[$a]['loots'][$i]['dkp'] = $ilootdata['dkp'];
- $iallraids[$a]['dkp'] += $ilootdata['dkp'];
- }
- $i++;
- }
- $iallraids[$a]['dkp'] = round($iallraids[$a]['dkp'] / count($iallraids[$a]['attendees']), 2);
- if($_POST['addlootdkpvalues'][$ievent][$iraid] == 1)
- {
- $iallraids[$a]['dkp'] += $_POST['raiddkpvalues'][$ievent][$iraid];
- }
- else
- {
- $iallraids[$a]['dkp'] = $_POST['raiddkpvalues'][$ievent][$iraid];
- }
- foreach($iallraids[$a]['attendees'] as $attendeeid => $attendeename)
- {
- $attendeename = trim($attendeename);
- if(!empty($attendeename))
- {
- $iallraids[$a]['attendees'][$attendeeid] = $attendeename;
- }
- else
- {
- unset($iallraids[$a]['attendees'][$attendeeid]);
- }
- }
- $a++;
- }
- }
- $text == "";
- foreach($iallraids as $iraid)
- {
- if(!$iraid['donotadd'])
- {
- $newraidid = $db->query("SELECT MAX(`raid_id`) as id FROM ".RAIDS_TABLE.";");
- $newraidid = $db->fetch_record($newraidid);
- $newraidid = $newraidid['id'] + 1;
- $alreadyexistscheck = $db->query("SELECT `raid_name`, `raid_date`, `raid_note`, `raid_value` FROM ".RAIDS_TABLE." WHERE raid_name = '".mysql_escape_string($iraid['event'])."' AND raid_date >= '".mysql_escape_string($iraid['time']-1800)."' AND raid_date <= '".mysql_escape_string($iraid['time']+1800)."' AND raid_note = '".mysql_escape_string($iraid['raidnote'])."' LIMIT 1");
- if($db->num_rows($alreadyexistscheck) == 1 && !$lua_set_OnlySimulate)
- {
- $text .= sprintf($user->lang['lua_step3_alreadyexist'], $iraid['raidnote'], $iraid['event'], $iraid['dkp'])."<br>\n";
- }
- elseif(!empty($iraid['event']))
- {
- if(!$lua_set_OnlySimulate) $db->query("INSERT INTO ".RAIDS_TABLE." (`raid_id`, `raid_name`, `raid_date`, `raid_note`, `raid_value`, `raid_added_by`) VALUES ('".mysql_escape_string($newraidid)."', '".mysql_escape_string($iraid['event'])."', '".mysql_escape_string($iraid['time'])."', '".mysql_escape_string($iraid['raidnote'])."', '".mysql_escape_string($iraid['dkp'])."', 'RaidTracker (by ".mysql_escape_string($user->data['username']).")');");
- $text .= sprintf($user->lang['lua_step3_raidadded'], $iraid['raidnote'], $iraid['event'], $iraid['dkp']);
- $log_action = array(
- 'header' => '{L_ACTION_RAID_ADDED}',
- 'id' => $newraidid,
- '{L_EVENT}' => $iraid['event'],
- '{L_ATTENDEES}' => trim(implode(', ', $iraid['attendees']), ', '),
- '{L_NOTE}' => $iraid['raidnote'],
- '{L_VALUE}' => $iraid['dkp'],
- '{L_ADDED_BY}' => 'RaidTracker (by '.$user->data['username'].')',
- );
- if(!$lua_set_OnlySimulate)
- {
- $this->log_insert(array('log_type' => $log_action['header'], 'log_action' => $log_action));
- }
-
- foreach($iraid['attendees'] as $iattendee)
- {
- $memberexistscheck = $db->query("SELECT `member_name` FROM ".MEMBERS_TABLE." WHERE member_name = '".mysql_escape_string($iattendee)."';");
- if($db->num_rows($memberexistscheck) == 0)
- {
- $iattendeerace = $this->GetRaceNameByRaceId($_POST['allplayers'][$iattendee]['race']);
- $iattendeeclass = $this->GetClassNameByClassId($_POST['allplayers'][$iattendee]['class']);
- $iattendeelevel = ((!empty($_POST['allplayers'][$iattendee]['level'])) ? $_POST['allplayers'][$iattendee]['level'] : "Unknown" ) ;
- $iattendeerank = $this->GetRankIdByRankName($lua_set_NewMemberDefaultRank) ;
-
- if(!$lua_set_OnlySimulate)
- {
- $db->query("INSERT INTO ".MEMBERS_TABLE."
- (`member_name`, `member_status`, `member_firstraid`, `member_level`, `member_rank_id`, `member_class_id`, `member_race_id`)
- VALUES ('".mysql_escape_string($iattendee)."', '1', '".mysql_escape_string($iraid['time'])."',
- '".mysql_escape_string($_POST['allplayers'][$iattendee]['level'])."',
- '".mysql_escape_string($iattendeerank)."', '".mysql_escape_string($_POST['allplayers'][$iattendee]['class'])."',
- '".mysql_escape_string($_POST['allplayers'][$iattendee]['race'])."');");
- }
-
- $text .= sprintf($user->lang['lua_step3_memberadded'], $iattendee, $iattendeerace, $iattendeeclass, $iattendeelevel, $this->GetRankNameByRankId($iattendeerank));
- $log_action = array(
- 'header' => '{L_ACTION_MEMBER_ADDED}',
- '{L_NAME}' => $iattendee,
- '{L_EARNED}' => 0,
- '{L_SPENT}' => 0,
- '{L_ADJUSTMENT}' => 0,
- '{L_LEVEL}' => $iattendeelevel,
- '{L_RACE}' => $iattendeerace,
- '{L_CLASS}' => $iattendeeclass,
- '{L_ADDED_BY}' => 'RaidTracker (by '.$user->data['username'].')',
- );
- if(!$lua_set_OnlySimulate) $this->log_insert(array('log_type' => $log_action['header'],'log_action' => $log_action));
- }
- if(!$lua_set_OnlySimulate)
- {
- $db->query("INSERT INTO ".RAID_ATTENDEES_TABLE." (`raid_id`, `member_name`)
- VALUES ('".mysql_escape_string($newraidid)."', '".mysql_escape_string($iattendee)."');");
- }
-
- if(!$lua_set_OnlySimulate)
- {
- $db->query("UPDATE ".MEMBERS_TABLE."
- SET member_earned = member_earned + ".mysql_escape_string($iraid['dkp']).",
- member_status = '1', member_lastraid = '".mysql_escape_string($iraid['time'])."',
- member_raidcount = member_raidcount + 1
- WHERE member_name = '".mysql_escape_string($iattendee)."';");
- }
-
- $text .= sprintf($user->lang['lua_step3_attendeesadded'], count($iraid['attendees']));
- foreach($iraid['loots'] as $iloot)
- {
- if(!$lua_set_OnlySimulate)
- {
- $db->query("INSERT INTO ".ITEMS_TABLE."
- (`item_name`, `item_buyer`, `raid_id`, `item_value`, `item_date`, `item_added_by`, `item_group_key`)
- VALUES ('".mysql_escape_string($iloot['name'])."', '".mysql_escape_string($iloot['looter'])."',
- '".mysql_escape_string($newraidid)."', '".mysql_escape_string($iloot['dkp'])."',
- '".mysql_escape_string($iraid['time'])."', 'RaidTracker (by ".mysql_escape_string($user->data['username']).")',
- '".mysql_escape_string($this->gen_group_key($iloot['name'], $iraid['time'], $newraidid))."');");
- }
-
- if(!$lua_set_OnlySimulate)
- {
- $db->query("UPDATE ".MEMBERS_TABLE."
- SET member_spent = member_spent + ".mysql_escape_string($iloot['dkp'])."
- WHERE member_name = '".mysql_escape_string($iloot['looter'])."';");
- }
-
- $text .= sprintf($user->lang['lua_step3_lootadded'], $iloot['name'], $iloot['dkp'], $iloot['looter']);
- $log_action = array(
- 'header' => '{L_ACTION_ITEM_ADDED}',
- '{L_NAME}' => $iloot['name'],
- '{L_BUYERS}' => $iloot['looter'],
- '{L_RAID_ID}' => $newraidid,
- '{L_VALUE}' => $iloot['dkp'],
- '{L_ADDED_BY}' => 'RaidTracker (by '.$user->data['username'].')',
- );
- if(!$lua_set_OnlySimulate) $this->log_insert(array('log_type' => $log_action['header'],'log_action' => $log_action));
- }
- $text .= "<br>\n";
- }
- }
- }
- message_die($text, $user->lang['lua_step3_titel']);
-
- $eqdkp->set_vars(array(
- 'page_title' => sprintf($user->lang['admin_title_prefix'], $eqdkp->config['guildtag'], $eqdkp->config['dkp_name']).': '.$user->lang['lua_step3_pagetitel'],
- 'template_file' => 'admin/lua.html',
- 'display' => true,
- )
- );
-}
-
-function display_form()
-{
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID;
-
- $tpl->assign_vars(array(
- 'F_PARSE_LOG' => 'index.php' . $SID,
- 'S_STEP1' => true,
- 'L_PASTE_LOG' => $user->lang['lua_step1_th'],
- 'L_PARSE_LOG' => $user->lang['lua_step1_button_parselog'],
- )
- );
-
- $eqdkp->set_vars(array(
- 'page_title' => sprintf($user->lang['admin_title_prefix'], $eqdkp->config['guildtag'], $eqdkp->config['dkp_name']).': '.$user->lang['lua_step1_pagetitel'],
- 'template_file' => 'admin/lua.html',
- 'display' => true,
- )
- );
-}
-}
-
-$LUA_Import = new LUA_Import;
-$LUA_Import->process();
-?>
diff --git a/old/admin/lua_config.php b/old/admin/lua_config.php
deleted file mode 100644
index a3e8584..0000000
--- a/old/admin/lua_config.php
+++ /dev/null
@@ -1,295 +0,0 @@
-<?php
-/******************************
- * EQdkp
- * Copyright 2005
- * Licensed under the GNU GPL. See COPYING for full terms.
- * ------------------
- * lua_config.php
- * Began: Mon Sept 19 2005
- *
- * $Id: lua_config.php 8 2006-05-08 17:15:20Z tsigo $
- ******************************/
-
-// Sets the minimum Item Quality of Items to get parsed (4 = Epic, 3 = Rare, 2 = uncommon)
-$lua_set_MinItemQuality = 4;
-
-// Set a "Looter" which should be ignored
-$lua_set_IgnoredLooter = "disenchanted";
-
-// Here you can set the default status of the "Add Item value/attendees" Checkbox
-$lua_set_AddLootDkpValuesCheckbox = true;
-
-// Setting it to true will convert e.g. "Âvâtâr" to "Avatar".
-$lua_set_ConvertNames = false;
-
-// Will Check for Event Triggers in the Loot Notes
-// (e.g. if you have events called "MC (Lucifron), MC (Magmadar), ..." and only want to log one raid.
-$lua_set_LootNoteEventTriggerCheck = false;
-
-// Here you can set the default Rank of new Members (e.g. Member).
-$lua_set_NewMemberDefaultRank = "";
-
-// Here you can set a list of item IDs which should be ignored
-// Mature Blue Dragon Sinew (From Azuregos)
-#$lua_set_ignoritems[] = 18704;
-
-// Here You can Set all the Raid notes which should be handled as a own raid everytime
-// e.g. Random Drops are normaly added to an own Raid (Not all Random Drops to one Raid)
-$lua_set_ownraids[] = "Random Drop";
-
-// Here you can set the triggers for the eqDKP Event
-// (CT_RaidRracker Raid note will be parsed (Loot Notes only when $lua_set_LootNoteEventTriggerCheck is set))
-$lua_set_EventTriggers["Molten Core"] = "Molten Core";
-$lua_set_EventTriggers["MC"] = "Molten Core";
-$lua_set_EventTriggers["Azuregos"] = "Azuregos";
-$lua_set_EventTriggers["Kazzak"] = "Kazzak";
-$lua_set_EventTriggers["Onyxia"] = "Onyxia";
-$lua_set_EventTriggers["Blackwing Lair"] = "Blackwing Lair";
-$lua_set_EventTriggers["Blackwinglair"] = "Blackwing Lair";
-$lua_set_EventTriggers["BWL"] = "Blackwing Lair";
-
-// Here you can set the triggers for the eqDKP Raid Note
-// (CT_RaidRracker Raid note and the Loots Notes will be parsed (Loot Notes will override the Raid Note))
-$lua_set_RaidNoteTriggers["Azuregos"] = "Azuregos";
-$lua_set_RaidNoteTriggers["Kazzak"] = "Kazzak";
-$lua_set_RaidNoteTriggers["Onyxia"] = "Onyxia";
-$lua_set_RaidNoteTriggers["Lucifron"] = "Lucifron";
-$lua_set_RaidNoteTriggers["Magmadar"] = "Magmadar";
-$lua_set_RaidNoteTriggers["Gehennas"] = "Gehennas";
-$lua_set_RaidNoteTriggers["Garr"] = "Garr";
-$lua_set_RaidNoteTriggers["Geddon"] = "Baron Geddon";
-$lua_set_RaidNoteTriggers["Shazzrah"] = "Shazzrah";
-$lua_set_RaidNoteTriggers["Sulfuron"] = "Sulfuron";
-$lua_set_RaidNoteTriggers["Golemagg"] = "Golemagg";
-$lua_set_RaidNoteTriggers["Majordomo"] = "Majordomo";
-$lua_set_RaidNoteTriggers["Ragnaros"] = "Ragnaros";
-$lua_set_RaidNoteTriggers["Razorgore"] = "Razorgore";
-$lua_set_RaidNoteTriggers["Vaelastrasz"] = "Vaelastrasz";
-$lua_set_RaidNoteTriggers["Broodlord"] = "Broodlord";
-$lua_set_RaidNoteTriggers["Firemaw"] = "Firemaw";
-$lua_set_RaidNoteTriggers["Ebonroc"] = "Ebonroc";
-$lua_set_RaidNoteTriggers["Flamegor"] = "Flamegor";
-$lua_set_RaidNoteTriggers["Chromaggus"] = "Chromaggus";
-$lua_set_RaidNoteTriggers["Nefarius"] = "Lord Nefarius";
-$lua_set_RaidNoteTriggers["Random"] = "Random Drop";
-
-// Here you can set Player aliases, if one of the players is in the attende List it will be replaced
-// (e.g. if a Twink of the Mainchar helps out, but the Mainchar should get the DKP Points)
-
-#$lua_set_PlayerAliases["Twink1ofMainChar1"] = "MainChar1";
-#$lua_set_PlayerAliases["Twink2ofMainChar1"] = "MainChar1";
-
- function GetRaidNoteFromString($string) {
- global $lua_set_RaidNoteTriggers;
- foreach($lua_set_RaidNoteTriggers as $trigger => $value) {
- if($this->in_string($trigger, $string, true)) {
- return $value;
- }
- }
- return "Unknown";
- }
-
- function GetRaidEventFromString($string) {
- global $lua_set_EventTriggers;
- foreach($lua_set_EventTriggers as $trigger => $value) {
- if($this->in_string($trigger, $string, true)) {
- return $value;
- }
- }
- return "Unknown Event";
- }
-
- function GetItemName($itemid) {
- global $gitemlist, $itemidtoname;
- if(empty($gitemlist) && file_exists("itemlist.xml")) {
- $itemlisthandle = fopen("itemlist.xml", "r");
- while(!feof($itemlisthandle)) {
- $itemlistbuffer = fgets($itemlisthandle, 1024);
- preg_match_all("/<wowitem name=\"(.+?)\" id=\"(\d+)\" \/>/s", $itemlistbuffer, $itemlista, PREG_SET_ORDER);
- foreach($itemlista as $itemlistdata) {
- $gitemlist[$itemlistdata[2]] = $itemlistdata[1];
- }
- }
- fclose($itemlisthandle);
- }
- if(function_exists("GetItemName"))// Just ignore this, it's my part to get the itemname from my database
- { $altitemname = @GetItemName($itemid, $lang = "en");
- }
- if(!empty($altitemname)) {
- return $altitemname;
- } elseif(!empty($gitemlist[$itemid])) {
- return $gitemlist[$itemid];
- } elseif(!empty($itemidtoname[$itemid])) {
- return $itemidtoname[$itemid];
- } else {
- return false;
- }
- }
-
- function ConvertTimestringToTimestamp($timestring) {
- $parts = preg_split('/[\/ :]/', $timestring);
- return mktime($parts[3], $parts[4], $parts[5], $parts[0], $parts[1], $parts[2]);
- }
-
- function in_string($needle, $haystack, $insensitive = false) {
- if($insensitive) {
- $haystack = strtolower($haystack);
- $needle = strtolower($needle);
- }
- return(false !== strpos($haystack, $needle)) ? true : false;
- }
-
- function GetMainItemId($itemid)
- {
- $itemid = trim($itemid, "item:");
- $itemid = preg_split("/:/", $itemid);
- return $itemid[0];
- }
-
- function GetItemQualityByColor($color)
- {
- $color = strtolower($color);
- if($color == "ffa335ee") { return 4; }
- elseif($color == "ff0070dd") { return 3; }
- elseif($color == "ff1eff00") { return 2; }
- elseif($color == "ffffffff") { return 1; }
- elseif($color == "ff9d9d9d") { return 0; }
- else { return -1; }
- }
-
- function GetDkpValue($item)
- {
- global $db;
- $value = $db->query("SELECT MIN(`item_value`) as minval FROM ".ITEMS_TABLE." WHERE `item_name` = '".mysql_escape_string($item)."';");
- $value = $db->fetch_record($value);
- return $value['minval'];
- }
-
- function GetClassIdByClassNameLevel($classname, $level)
- {
- global $db;
- $value = $db->query("SELECT `class_id` FROM ".CLASS_TABLE." WHERE `class_name` = '".mysql_escape_string($classname)."' AND `class_min_level` <= '".mysql_escape_string($level)."' AND `class_max_level` >= '".mysql_escape_string($level)."' ORDER by class_min_level DESC;");
- if($db->num_rows($value) >= 1)
- {
- $value = $db->fetch_record($value);
- return $value['class_id'];
- }
- else
- {
- return 0;
- }
- }
-
-
- function GetRaceIdByRaceName($racename)
- {
- global $db;
- if($racename == "Scourge")
- {
- $racename = "Undead";
- }
- elseif($racename == "NightElf")
- {
- $racename = "Night Elf";
- }
- $value = $db->query("SELECT `race_id` FROM ".RACE_TABLE." WHERE `race_name` = '".mysql_escape_string($racename)."';");
- if($db->num_rows($value) >= 1)
- {
- $value = $db->fetch_record($value);
- return $value['race_id'];
- }
- else
- {
- return 0;
- }
- }
-
- function GetRankIdByRankName($rankname)
- {
- global $db;
- $value = $db->query("SELECT `rank_id` FROM ".MEMBER_RANKS_TABLE." WHERE `rank_name` = '".mysql_escape_string($rankname)."';");
- if($db->num_rows($value) >= 1)
- {
- $value = $db->fetch_record($value);
- return $value['rank_id'];
- }
- else
- {
- return 0;
- }
- }
-
-
-
-
- function GetClassNameByClassId($classid)
- {
- global $db;
- $value = $db->query("SELECT `class_name` FROM ".CLASS_TABLE." WHERE `class_id` = '".mysql_escape_string($classid)."';");
- if($db->num_rows($value) >= 1)
- {
- $value = $db->fetch_record($value);
- return $value['class_name'];
- }
- else
- {
- return "Unknown";
- }
- }
-
- function GetRaceNameByRaceId($raceid)
- {
- global $db;
- $value = $db->query("SELECT `race_name` FROM ".RACE_TABLE." WHERE `race_id` = '".mysql_escape_string($raceid)."';");
- if($db->num_rows($value) >= 1)
- {
- $value = $db->fetch_record($value);
- return $value['race_name'];
- }
- else
- {
- return "Unknown";
- }
- }
-
- function GetRankNameByRankId($rankid)
- {
- global $db;
- $value = $db->query("SELECT `rank_name` FROM ".MEMBER_RANKS_TABLE." WHERE `rank_id` = '".mysql_escape_string($rankid)."';");
- if($db->num_rows($value) >= 1)
- {
- $value = $db->fetch_record($value);
- if(!empty($value['rank_name']))
- {
- return $value['rank_name'];
- }
- else
- {
- return "None";
- }
- }
- else
- {
- return "None";
- }
- }
-
-
- function GenerateUniqId()
- {
- return md5(uniqid(rand(), true));
- }
-
- function StripUniqIdFromString($string)
- {
- return preg_replace("/(.*?)-[a-z0-9]{32}-(.*?)/", "\\1\\2", $string);
- }
-
- function StripSpecialChars($string)
- {
- $string = strtr($string, "\xA1\xAA\xBA\xBF\xC0\xC1\xC2\xC3\xC5\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD8\xD9\xDA\xDB\xDD\xE0\xE1\xE2\xE3\xE5\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF8\xF9\xFA\xFB\xFD\xFF", "!ao?AAAAACEEEEIIIIDNOOOOOUUUYaaaaaceeeeiiiidnooooouuuyy");
- $string = strtr($string, array("\xC4"=>"Ae", "\xC6"=>"AE", "\xD6"=>"Oe", "\xDC"=>"Ue", "\xDE"=>"TH", "\xDF"=>"ss", "\xE4"=>"ae", "\xE6"=>"ae", "\xF6"=>"oe", "\xFC"=>"ue", "\xFE"=>"th"));
- return($string);
- }
-
-?>
diff --git a/old/admin/manage_members.php b/old/admin/manage_members.php
deleted file mode 100644
index 71a6829..0000000
--- a/old/admin/manage_members.php
+++ /dev/null
@@ -1,151 +0,0 @@
-<?php
-/******************************
- * EQdkp
- * Copyright 2002-2003
- * Licensed under the GNU GPL. See COPYING for full terms.
- * ------------------
- * manage_members.php
- * Began: Sun January 5 2003
- *
- * $Id: manage_members.php 46 2007-06-19 07:29:11Z tsigo $
- *
- ******************************/
-
-// Notice: Since 'Manage Members' function as a whole handles a lot of form and
-// processing code, this script will serve only as a framework for other processing
-// scripts (found in the mm directory)
-
-define('EQDKP_INC', true);
-define('IN_ADMIN', true);
-$eqdkp_root_path = './../';
-include_once($eqdkp_root_path . 'common.php');
-
-class Manage_Members extends EQdkp_Admin
-{
- function manage_members()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID;
-
- parent::eqdkp_admin();
-
- $this->assoc_buttons(array(
- 'form' => array(
- 'name' => '',
- 'process' => 'display_menu',
- 'check' => 'a_members_man'))
- );
-
- $this->assoc_params(array(
- 'transfer' => array(
- 'name' => 'mode',
- 'value' => 'transfer',
- 'process' => 'mm_transfer',
- 'check' => 'a_members_man'),
- 'addmember' => array(
- 'name' => 'mode',
- 'value' => 'addmember',
- 'process' => 'mm_addmember',
- 'check' => 'a_members_man'),
- 'list' => array(
- 'name' => 'mode',
- 'value' => 'list',
- 'process' => 'mm_listmembers',
- 'check' => 'a_members_man'),
- 'ranks' => array(
- 'name' => 'mode',
- 'value' => 'ranks',
- 'process' => 'mm_ranks',
- 'check' => 'a_members_man'))
- );
- }
-
- function error_check()
- {
- return $this->fv->is_error();
- }
-
- // ---------------------------------------------------------
- // Display menu
- // ---------------------------------------------------------
- function display_menu()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID;
-
- $tpl->assign_vars(array(
- 'L_MANAGE_MEMBERS' => $user->lang['manage_members'],
- 'L_ADD_MEMBER' => $user->lang['add_member'],
- 'L_LIST_EDIT_DEL_MEMBERS' => $user->lang['list_edit_del_member'],
- 'L_EDIT_RANKS' => $user->lang['edit_ranks'],
- 'L_TRANSFER_HISTORY' => $user->lang['transfer_history'],
-
- 'U_ADD_MEMBER' => 'manage_members.php' . $SID . '&amp;mode=addmember',
- 'U_LIST_MEMBERS' => 'manage_members.php' . $SID . '&amp;mode=list',
- 'U_EDIT_RANKS' => 'manage_members.php' . $SID . '&amp;mode=ranks',
- 'U_TRANSFER_HISTORY' => 'manage_members.php' . $SID . '&amp;mode=transfer')
- );
-
- $eqdkp->set_vars(array(
- 'page_title' => sprintf($user->lang['admin_title_prefix'], $eqdkp->config['guildtag'], $eqdkp->config['dkp_name']).': '.$user->lang['manage_members_title'],
- 'template_file' => 'admin/mm_menu.html',
- 'display' => true)
- );
- }
-
- // ---------------------------------------------------------
- // Transfer history
- // ---------------------------------------------------------
- function mm_transfer()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID;
-
- include('mm/mm_transfer.php');
- $mm_extension = new MM_Transfer;
- $mm_extension->process();
- }
-
- // ---------------------------------------------------------
- // Add member
- // ---------------------------------------------------------
- function mm_addmember()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID;
-
- include('mm/mm_addmember.php');
- $mm_extension = new MM_Addmember;
- $mm_extension->process();
- }
-
- // ---------------------------------------------------------
- // List members
- // ---------------------------------------------------------
- function mm_listmembers()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID;
-
- include('mm/mm_listmembers.php');
- $mm_extension = new MM_Listmembers;
- $mm_extension->process();
- }
-
- // ---------------------------------------------------------
- // Ranks
- // ---------------------------------------------------------
- function mm_ranks()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID;
-
- include('mm/mm_ranks.php');
- $mm_extension = new MM_Ranks;
- $mm_extension->process();
- }
-}
-
-$manage_members = new Manage_Members;
-$manage_members->process();
-?> \ No newline at end of file
diff --git a/old/admin/manage_users.php b/old/admin/manage_users.php
deleted file mode 100644
index 8546fb6..0000000
--- a/old/admin/manage_users.php
+++ /dev/null
@@ -1,865 +0,0 @@
-<?php
-/******************************
- * EQdkp
- * Copyright 2002-2003
- * Licensed under the GNU GPL. See COPYING for full terms.
- * ------------------
- * manage_users.php
- * Began: Sun December 29 2002
- *
- * $Id: manage_users.php 46 2007-06-19 07:29:11Z tsigo $
- *
- ******************************/
-
-define('EQDKP_INC', true);
-define('IN_ADMIN', true);
-$eqdkp_root_path = './../';
-include_once($eqdkp_root_path . 'common.php');
-
-class Manage_Users extends EQdkp_Admin
-{
- var $change_username = false; // Was the username changed? @var change_username
- var $change_password = false; // Was the password changed? @var change_password
- var $user_data = array(); // Holds user data if URI_NAME is set @var user_data
-
- function manage_users()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID;
-
- parent::eqdkp_admin();
-
- // Vars used to confirm deletion
- $confirm_text = $user->lang['confirm_delete_users'];
- $usernames = array();
- if ( isset($_POST['delete']) )
- {
- if ( isset($_POST['user_id']) )
- {
- foreach ( $_POST['user_id'] as $user_id )
- {
- $username = $db->query_first('SELECT username FROM ' . USERS_TABLE . " WHERE user_id='" . $user_id . "'");
- $usernames[] = $username;
- }
-
- $names = implode(', ', $usernames);
-
- $confirm_text .= '<br /><br />' . $names;
- }
- else
- {
- message_die('No users were selected for deletion.');
- }
- }
-
- $this->set_vars(array(
- 'confirm_text' => $confirm_text,
- 'uri_parameter' => 'username',
- 'url_id' => ( sizeof($usernames) > 0 ) ? $names : (( isset($_GET['username']) ) ? $_GET['username'] : ''),
- 'script_name' => 'manage_users.php' . $SID)
- );
-
- $this->assoc_buttons(array(
- 'submit' => array(
- 'name' => 'submit',
- 'process' => 'process_submit',
- 'check' => 'a_users_man'),
- 'update' => array(
- 'name' => 'update',
- 'process' => 'process_update',
- 'check' => 'a_users_man'),
- 'delete' => array(
- 'name' => 'delete',
- 'process' => 'process_delete',
- 'check' => 'a_users_man'),
- 'form' => array(
- 'name' => '',
- 'process' => 'display_list',
- 'check' => 'a_users_man'))
- );
-
- $this->assoc_params(array(
- 'name' => array(
- 'name' => URI_NAME,
- 'process' => 'display_form',
- 'check' => 'a_users_man'))
- );
- }
-
- function error_check()
- {
- global $db, $user;
-
- // Singular Update
- if ( isset($_POST['submit']) )
- {
- // See if the user exists
- $sql = 'SELECT au.*, u.*
- FROM ' . USERS_TABLE . ' u
- LEFT JOIN ' . AUTH_USERS_TABLE . " au
- ON (u.user_id = au.user_id)
- WHERE u.username='" . $_POST[URI_NAME] . "'";
- $result = $db->query($sql);
- if ( !$this->user_data = $db->fetch_record($result) )
- {
- message_die($user->lang['error_user_not_found']);
- }
- $db->free_result($result);
-
- // Error-check the form
- $this->change_username = false;
- if ( $_POST['username'] != $_POST[URI_NAME] )
- {
- // They changed the username, see if it's already registered
- $sql = 'SELECT user_id
- FROM ' . USERS_TABLE . "
- WHERE username='".$_POST['username']."'";
- if ( $db->num_rows($db->query($sql)) > 0 )
- {
- $this->fv->errors['username'] = $user->lang['fv_already_registered_username'];
- }
- $this->change_username = true;
- }
- $this->change_password = false;
- if ( (!empty($_POST['new_user_password1'])) || (!empty($_POST['new_user_password2'])) )
- {
- $this->fv->matching_passwords('new_user_password1', 'new_user_password2', $user->lang['fv_match_password']);
- $this->change_password = true;
- }
- $this->fv->is_number(array(
- 'user_alimit' => $user->lang['fv_number'],
- 'user_elimit' => $user->lang['fv_number'],
- 'user_ilimit' => $user->lang['fv_number'],
- 'user_nlimit' => $user->lang['fv_number'],
- 'user_rlimit' => $user->lang['fv_number'])
- );
-
- // Make sure any members associated with this account aren't associated with another account
- if ( (isset($_POST['member_id'])) && (is_array($_POST['member_id'])) )
- {
- // Build array of member_id => member_name
- $member_names = array();
- $sql = 'SELECT member_id, member_name
- FROM ' . MEMBERS_TABLE . '
- ORDER BY member_name';
- $result = $db->query($sql);
- while ( $row = $db->fetch_record($result) )
- {
- $member_names[ $row['member_id'] ] = $row['member_name'];
- }
- $db->free_result($result);
-
- $sql = 'SELECT member_id
- FROM ' . MEMBER_USER_TABLE . '
- WHERE member_id IN (' . implode(', ', $_POST['member_id']) . ')
- AND user_id != ' . $this->user_data['user_id'];
- $result = $db->query($sql);
-
- $fv_member_id = '';
- while ( $row = $db->fetch_record($result) )
- {
- // This member's associated with another account
- $fv_member_id .= sprintf($user->lang['fv_member_associated'], $member_names[ $row['member_id'] ]) . '<br />';
- }
- $db->free_result($result);
-
- if ( $fv_member_id != '' )
- {
- $this->fv->errors['member_id'] = $fv_member_id;
- }
- }
- }
- // Mass Update
- elseif ( isset($_POST['update']) )
- {
- }
- // Mass Delete
- elseif ( isset($_POST['delete']) )
- {
- }
- elseif ( isset($_GET[URI_NAME]) )
- {
- // See if the user exists
- $sql = 'SELECT au.*, u.*
- FROM ' . USERS_TABLE . ' u
- LEFT JOIN ' . AUTH_USERS_TABLE . " au
- ON (u.user_id = au.user_id)
- WHERE u.username='" . $_GET[URI_NAME] . "'";
- $result = $db->query($sql);
- if ( !$this->user_data = $db->fetch_record($result) )
- {
- message_die($user->lang['error_user_not_found']);
- }
- $db->free_result($result);
- }
-
- return $this->fv->is_error();
- }
-
- // ---------------------------------------------------------
- // Process Submit
- // ---------------------------------------------------------
- function process_submit()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID, $user_id;
-
- $user_id = $this->user_data['user_id'];
-
- //
- // Build the query
- //
- // User settings
- $sql = 'UPDATE ' . USERS_TABLE . "
- SET";
- if ( $this->change_username )
- {
- $sql .= " username='".$_POST['username']."', ";
- }
- if ( $this->change_password )
- {
- $sql .= " user_password='".md5($_POST['new_user_password1'])."', ";
- }
- $sql .= " user_email='".$_POST['user_email']."', ";
-
- $sql .= " user_alimit='".$_POST['user_alimit']."', user_elimit='".$_POST['user_elimit']."', user_ilimit='".$_POST['user_ilimit']."',
- user_nlimit='".$_POST['user_nlimit']."', user_rlimit='".$_POST['user_rlimit']."', ";
-
- $sql .= " user_lang='".$_POST['user_lang']."', user_style='".$_POST['user_style']."',
- user_active='".$_POST['user_active']."'";
-
- $sql .= " WHERE user_id='".$this->user_data['user_id']."'";
-
- if ( !($result = $db->query($sql)) )
- {
- message_die('Could not update user information', '', __FILE__, __LINE__, $sql);
- }
-
- // Permissions
- $sql = 'SELECT auth_id, auth_value
- FROM ' . AUTH_OPTIONS_TABLE . '
- ORDER BY auth_id';
- $result = $db->query($sql);
- while ( $row = $db->fetch_record($result) )
- {
- $r_auth_id = $row['auth_id'];
- $r_auth_value = $row['auth_value'];
-
- $chk_auth_value = ( $user->check_auth($r_auth_value, false, $user_id) ) ? 'Y' : 'N';
- $db_auth_value = ( isset($_POST[$r_auth_value]) ) ? 'Y' : 'N';
-
- if ( $chk_auth_value != $db_auth_value )
- {
- $this->update_auth_users($r_auth_id, $db_auth_value);
- }
- }
- $db->free_result($result);
-
- // Users -> Members associations
- $sql = 'DELETE FROM ' . MEMBER_USER_TABLE . '
- WHERE user_id = ' . $this->user_data['user_id'];
- $db->query($sql);
-
- if ( (isset($_POST['member_id'])) && (is_array($_POST['member_id'])) )
- {
- $sql = 'INSERT INTO ' . MEMBER_USER_TABLE . '
- (member_id, user_id)
- VALUES ';
-
- $query = array();
- foreach ( $_POST['member_id'] as $member_id )
- {
- $query[] = '(' . $member_id . ', ' . $this->user_data['user_id'] . ')';
- }
-
- $sql .= implode(', ', $query);
- $db->query($sql);
- }
-
- // See if any plugins need to update the DB
- $pm->do_hooks('/admin/manage_users.php?action=update');
-
- $this->admin_die($user->lang['update_settings_success']);
- }
-
- // ---------------------------------------------------------
- // Process Mass Update
- // ---------------------------------------------------------
- function process_update()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID;
-
- if ( isset($_POST['user_id']) )
- {
- $user_ids = $_POST['user_id'];
-
- // Delete existing permissions for these users
- $sql = 'DELETE FROM ' . AUTH_USERS_TABLE . '
- WHERE user_id IN (' . implode(', ', $user_ids) . ')';
- $db->query($sql);
-
- // Permissions
- $sql = 'SELECT auth_id, auth_value
- FROM ' . AUTH_OPTIONS_TABLE . '
- ORDER BY auth_id';
- $result = $db->query($sql);
- while ( $row = $db->fetch_record($result) )
- {
- $permissions[ $row['auth_id'] ] = $row['auth_value'];
- }
- $db->free_result($result);
-
- foreach ( $user_ids as $user_id )
- {
- $query = array();
- $sql = 'INSERT INTO ' . AUTH_USERS_TABLE . '
- (user_id, auth_id, auth_setting)
- VALUES ';
- foreach ( $permissions as $auth_id => $auth_value )
- {
- $query[] = "('" . $user_id . "', '" . $auth_id . "', " . (( isset($_POST[$auth_value]) ) ? "'Y'" : "'N'") . ')';
- }
- $db->query($sql . implode(', ', $query));
- }
-
- $this->admin_die($user->lang['admin_set_perms_success']);
- }
- else
- {
- message_die('No users were selected for updating.');
- }
- }
-
- // ---------------------------------------------------------
- // Process (Mass) Delete
- // ---------------------------------------------------------
- function process_confirm()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID;
-
- if ( isset($_POST['username']) )
- {
- $usernames = explode(', ', $_POST['username']);
-
- // Find user IDs
- $user_ids = array();
- $sql = 'SELECT user_id, username
- FROM ' . USERS_TABLE . "
- WHERE username IN ('" . implode("', '", $usernames) . "')";
- $result = $db->query($sql);
- while ( $row = $db->fetch_record($result) )
- {
- $user_ids[ $row['username'] ] = $row['user_id'];
- }
- $db->free_result($result);
-
- // Delete from auth_user
- $sql = 'DELETE FROM ' . AUTH_USERS_TABLE . '
- WHERE user_id IN (' . implode(', ', $user_ids) . ')';
- $db->query($sql);
-
- // Delete from users
- $sql = 'DELETE FROM ' . USERS_TABLE . '
- WHERE user_id IN (' . implode(', ', $user_ids) . ')';
- $db->query($sql);
-
- // Delete from member users
- $sql = 'DELETE FROM ' . MEMBER_USER_TABLE . '
- WHERE user_id IN (' . implode(', ', $user_ids) . ')';
- $db->query($sql);
-
- // Success message
- $success_message = '';
- foreach ( $usernames as $username )
- {
- $success_message .= sprintf($user->lang['admin_delete_user_success'], $username) . '<br />';
- }
-
- $link_list = array(
- $user->lang['manage_users'] => 'manage_users.php' . $SID);
-
- $this->admin_die($success_message, $link_list);
- }
- else
- {
- message_die('No users were selected for deleting.');
- }
- }
-
- // ---------------------------------------------------------
- // Process helper methods
- // ---------------------------------------------------------
- function update_auth_users($auth_id, $auth_setting = 'N', $check_query_type = true)
- {
- global $db, $user_id;
-
- $upd_ins = ( $check_query_type ) ? $this->switch_upd_ins($auth_id, $user_id) : 'upd';
-
- if ( (empty($auth_id)) || (empty($user_id)) )
- {
- return false;
- }
-
- if ( $upd_ins == 'upd' )
- {
- $sql = 'UPDATE ' . AUTH_USERS_TABLE . "
- SET auth_setting='".$auth_setting."'
- WHERE auth_id='".$auth_id."'
- AND user_id='".$user_id."'";
- }
- else
- {
- $sql = 'INSERT INTO ' . AUTH_USERS_TABLE . "
- (user_id, auth_id, auth_setting)
- VALUES ('".$user_id."','".$auth_id."','".$auth_setting."')";
- }
-
- if ( !($result = $db->query($sql)) )
- {
- return false;
- }
- return true;
- }
-
- function switch_upd_ins($auth_id, $user_id)
- {
- global $db;
-
- $sql = 'SELECT o.auth_value
- FROM ' . AUTH_OPTIONS_TABLE . ' o, ' . AUTH_USERS_TABLE . " u
- WHERE (u.auth_id = o.auth_id)
- AND (u.user_id='".$user_id."')
- AND u.auth_id='".$auth_id."'";
- if ( $db->num_rows($db->query($sql)) > 0 )
- {
- return 'upd';
- }
- return 'ins';
- }
-
- // ---------------------------------------------------------
- // Display
- // ---------------------------------------------------------
- function display_list()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID;
-
- $sort_order = array(
- 0 => array('u.username', 'u.username desc'),
- 1 => array('u.user_email', 'u.user_email desc'),
- 2 => array('u.user_lastvisit desc', 'u.user_lastvisit'),
- 3 => array('u.user_active desc', 'u.user_active'),
- 4 => array('s.session_id desc', 's.session_id')
- );
-
- $current_order = switch_order($sort_order);
-
- $total_users = $db->query_first('SELECT count(*) FROM ' . USERS_TABLE);
- $start = ( isset($_GET['start']) ) ? $_GET['start'] : 0;
-
- $sql = 'SELECT u.user_id, u.username, u.user_email, u.user_lastvisit, u.user_active, s.session_id
- FROM (' . USERS_TABLE . ' u
- LEFT JOIN ' . SESSIONS_TABLE . ' s
- ON u.user_id = s.session_user_id)
- GROUP BY u.username
- ORDER BY ' . $current_order['sql'] . '
- LIMIT ' . $start . ',100';
- if ( !($result = $db->query($sql)) )
- {
- message_die('Could not obtain user information', '', __FILE__, __LINE__, $sql);
- }
- while ( $row = $db->fetch_record($result) )
- {
- $user_online = ( !empty($row['session_id']) ) ? $user->lang['yes'] : $user->lang['no'];
- $user_active = ( $row['user_active'] == '1' ) ? $user->lang['yes'] : $user->lang['no'];
-
- $tpl->assign_block_vars('users_row', array(
- 'ROW_CLASS' => $eqdkp->switch_row_class(),
- 'U_MANAGE_USER' => 'manage_users.php'.$SID.'&amp;' . URI_NAME . '='.$row['username'],
- 'USER_ID' => $row['user_id'],
- 'NAME_STYLE' => ( $user->check_auth('a_', false, $row['user_id']) ) ? 'font-weight: bold' : 'font-weight: none',
- 'USERNAME' => $row['username'],
- 'U_MAIL_USER' => ( !empty($row['user_email']) ) ? 'mailto:'.$row['user_email'] : '',
- 'EMAIL' => ( !empty($row['user_email']) ) ? $row['user_email'] : '&nbsp;',
- 'LAST_VISIT' => date($user->style['date_time'], $row['user_lastvisit']),
- 'ACTIVE' => $user_active,
- 'ONLINE' => $user_online)
- );
- }
- $db->free_result($result);
-
- //
- // Build the user permissions
- //
- $user_permissions = array(
- // Events
- $user->lang['events'] => array(
- array('CBNAME' => 'a_event_add', 'CBCHECKED' => A_EVENT_ADD, 'TEXT' => '<b>' . $user->lang['add'] . '</b>'),
- array('CBNAME' => 'a_event_upd', 'CBCHECKED' => A_EVENT_UPD, 'TEXT' => '<b>' . $user->lang['update'] . '</b>'),
- array('CBNAME' => 'a_event_del', 'CBCHECKED' => A_EVENT_DEL, 'TEXT' => '<b>' . $user->lang['delete'] . '</b>'),
- array('CBNAME' => 'u_event_list', 'CBCHECKED' => U_EVENT_LIST, 'TEXT' => $user->lang['list']),
- array('CBNAME' => 'u_event_view', 'CBCHECKED' => U_EVENT_VIEW, 'TEXT' => $user->lang['view'])
- ),
- // Group adjustments
- $user->lang['group_adjustments'] => array(
- array('CBNAME' => 'a_groupadj_add', 'CBCHECKED' => A_GROUPADJ_ADD, 'TEXT' => '<b>' . $user->lang['add'] . '</b>'),
- array('CBNAME' => 'a_groupadj_upd', 'CBCHECKED' => A_GROUPADJ_UPD, 'TEXT' => '<b>' . $user->lang['update'] . '</b>'),
- array('CBNAME' => 'a_groupadj_del', 'CBCHECKED' => A_GROUPADJ_DEL, 'TEXT' => '<b>' . $user->lang['delete'] . '</b>')
- ),
- // Individual adjustments
- $user->lang['individual_adjustments'] => array(
- array('CBNAME' => 'a_indivadj_add', 'CBCHECKED' => A_INDIVADJ_ADD, 'TEXT' => '<b>' . $user->lang['add'] . '</b>'),
- array('CBNAME' => 'a_indivadj_upd', 'CBCHECKED' => A_INDIVADJ_UPD, 'TEXT' => '<b>' . $user->lang['update'] . '</b>'),
- array('CBNAME' => 'a_indivadj_del', 'CBCHECKED' => A_INDIVADJ_DEL, 'TEXT' => '<b>' . $user->lang['delete'] . '</b>')
- ),
- // Items
- $user->lang['items'] => array(
- array('CBNAME' => 'a_item_add', 'CBCHECKED' => A_ITEM_ADD, 'TEXT' => '<b>' . $user->lang['add'] . '</b>'),
- array('CBNAME' => 'a_item_upd', 'CBCHECKED' => A_ITEM_UPD, 'TEXT' => '<b>' . $user->lang['update'] . '</b>'),
- array('CBNAME' => 'a_item_del', 'CBCHECKED' => A_ITEM_DEL, 'TEXT' => '<b>' . $user->lang['delete'] . '</b>'),
- array('CBNAME' => 'u_item_list', 'CBCHECKED' => U_ITEM_LIST, 'TEXT' => $user->lang['list']),
- array('CBNAME' => 'u_item_view', 'CBCHECKED' => U_ITEM_VIEW, 'TEXT' => $user->lang['view'])
- ),
- // News
- $user->lang['news'] => array(
- array('CBNAME' => 'a_news_add', 'CBCHECKED' => A_NEWS_ADD, 'TEXT' => '<b>' . $user->lang['add'] . '</b>'),
- array('CBNAME' => 'a_news_upd', 'CBCHECKED' => A_NEWS_UPD, 'TEXT' => '<b>' . $user->lang['update'] . '</b>'),
- array('CBNAME' => 'a_news_del', 'CBCHECKED' => A_NEWS_DEL, 'TEXT' => '<b>' . $user->lang['delete'] . '</b>')
- ),
- // Raids
- $user->lang['raids'] => array(
- array('CBNAME' => 'a_raid_add', 'CBCHECKED' => A_RAID_ADD, 'TEXT' => '<b>' . $user->lang['add'] . '</b>'),
- array('CBNAME' => 'a_raid_upd', 'CBCHECKED' => A_RAID_UPD, 'TEXT' => '<b>' . $user->lang['update'] . '</b>'),
- array('CBNAME' => 'a_raid_del', 'CBCHECKED' => A_RAID_DEL, 'TEXT' => '<b>' . $user->lang['delete'] . '</b>'),
- array('CBNAME' => 'u_raid_list', 'CBCHECKED' => U_RAID_LIST, 'TEXT' => $user->lang['list']),
- array('CBNAME' => 'u_raid_view', 'CBCHECKED' => U_RAID_VIEW, 'TEXT' => $user->lang['view'])
- ),
- // Turn-ins
- $user->lang['turn_ins'] => array(
- array('CBNAME' => 'a_turnin_add', 'CBCHECKED' => A_TURNIN_ADD, 'TEXT' => '<b>' . $user->lang['add'] . '</b>')
- ),
- // Members
- $user->lang['members'] => array(
- array('CBNAME' => 'a_members_man', 'CBCHECKED' => A_MEMBERS_MAN, 'TEXT' => '<b>' . $user->lang['manage'] . '</b>'),
- array('CBNAME' => 'u_member_list', 'CBCHECKED' => U_MEMBER_LIST, 'TEXT' => $user->lang['list']),
- array('CBNAME' => 'u_member_view', 'CBCHECKED' => U_MEMBER_VIEW, 'TEXT' => $user->lang['view'])
- ),
- // Manage
- $user->lang['manage'] => array(
- array('CBNAME' => 'a_config_man', 'CBCHECKED' => A_CONFIG_MAN, 'TEXT' => '<b>' . $user->lang['configuration'] . '</b>'),
- array('CBNAME' => 'a_plugins_man', 'CBCHECKED' => A_PLUGINS_MAN, 'TEXT' => '<b>' . $user->lang['plugins'] . '</b>'),
- array('CBNAME' => 'a_styles_man', 'CBCHECKED' => A_STYLES_MAN, 'TEXT' => '<b>' . $user->lang['styles'] . '</b>'),
- array('CBNAME' => 'a_users_man', 'CBCHECKED' => A_USERS_MAN, 'TEXT' => '<b>' . $user->lang['users'] . '</b>')
- ),
- // Logs
- $user->lang['logs'] => array(
- array('CBNAME' => 'a_logs_view', 'CBCHECKED' => A_LOGS_VIEW, 'TEXT' => '<b>' . $user->lang['view'] . '</b>')
- ),
- // Backup Database
- $user->lang['backup'] => array(
- array('CBNAME' => 'a_backup', 'CBCHECKED' => A_BACKUP, 'TEXT' => '<b>' . $user->lang['backup_database'] . '</b>')
- )
- );
-
- // Add plugin checkboxes to our array
- $pm->generate_permission_boxes($user_permissions);
-
- // Find out our auth defaults
- $auth_defaults = array();
- $sql = 'SELECT auth_id, auth_value, auth_default
- FROM ' . AUTH_OPTIONS_TABLE . '
- ORDER BY auth_id';
- $result = $db->query($sql);
- while ( $row = $db->fetch_record($result) )
- {
- $auth_defaults[ $row['auth_id'] ] = array(
- 'auth_id' => $row['auth_id'],
- 'auth_value' => $row['auth_value'],
- 'auth_default' => $row['auth_default']);
- }
- $db->free_result($result);
-
- foreach ( $user_permissions as $group => $checks )
- {
- $tpl->assign_block_vars('permissions_row', array(
- 'GROUP' => $group)
- );
-
- foreach ( $checks as $data )
- {
- $auth_setting = ( isset($auth_defaults[ $data['CBCHECKED'] ]) ) ? $auth_defaults[ $data['CBCHECKED'] ] : null;
- $tpl->assign_block_vars('permissions_row.check_group', array(
- 'CBNAME' => $data['CBNAME'],
- 'CBCHECKED' => ( (!is_null($auth_setting)) && ($auth_setting['auth_default'] == 'Y') ) ? ' checked="checked"' : '',
- 'TEXT' => $data['TEXT'])
- );
- }
- }
- unset($user_permissions);
-
- $tpl->assign_vars(array(
- // Language
- 'L_MANAGE_USERS' => $user->lang['manage_users'],
- 'L_USERNAME' => $user->lang['username'],
- 'L_EMAIL' => $user->lang['email_address'],
- 'L_LAST_VISIT' => $user->lang['last_visit'],
- 'L_ACTIVE' => $user->lang['active'],
- 'L_ONLINE' => $user->lang['online'],
- 'L_MASS_UPDATE' => $user->lang['mass_update'],
- 'L_MASS_UPDATE_NOTE' => $user->lang['mass_update_note'],
- 'L_ACCOUNT_ENABLED' => $user->lang['account_enabled'],
- 'L_YES' => $user->lang['yes'],
- 'L_NO' => $user->lang['no'],
- 'L_MASS_DELETE' => $user->lang['mass_delete'],
-
- // Sorting
- 'O_USERNAME' => $current_order['uri'][0],
- 'O_EMAIL' => $current_order['uri'][1],
- 'O_LAST_VISIT' => $current_order['uri'][2],
- 'O_ACTIVE' => $current_order['uri'][3],
- 'O_ONLINE' => $current_order['uri'][4],
-
- // Page vars
- 'U_MANAGE_USERS' => 'manage_users.php' . $SID . '&amp;',
- 'F_MASS_UPDATE' => 'manage_users.php' . $SID,
- 'START' => $start,
- 'LISTUSERS_FOOTCOUNT' => sprintf($user->lang['listusers_footcount'], $total_users, 100),
- 'USER_PAGINATION' => generate_pagination('manage_users.php'.$SID.'&amp;o='.$current_order['uri']['current'], $total_users, 100, $start))
- );
-
- $eqdkp->set_vars(array(
- 'page_title' => sprintf($user->lang['title_prefix'], $eqdkp->config['guildtag'], $eqdkp->config['dkp_name']).': '.$user->lang['manage_users_title'],
- 'template_file' => 'admin/listusers.html',
- 'display' => true)
- );
- }
-
- function display_form()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID;
-
- $user_id = $this->user_data['user_id'];
-
- //
- // Build the user permissions
- //
- $user_permissions = array(
- // Events
- $user->lang['events'] => array(
- array('CBNAME' => 'a_event_add', 'CBCHECKED' => A_EVENT_ADD, 'TEXT' => '<b>' . $user->lang['add'] . '</b>'),
- array('CBNAME' => 'a_event_upd', 'CBCHECKED' => A_EVENT_UPD, 'TEXT' => '<b>' . $user->lang['update'] . '</b>'),
- array('CBNAME' => 'a_event_del', 'CBCHECKED' => A_EVENT_DEL, 'TEXT' => '<b>' . $user->lang['delete'] . '</b>'),
- array('CBNAME' => 'u_event_list', 'CBCHECKED' => U_EVENT_LIST, 'TEXT' => $user->lang['list']),
- array('CBNAME' => 'u_event_view', 'CBCHECKED' => U_EVENT_VIEW, 'TEXT' => $user->lang['view'])
- ),
- // Group adjustments
- $user->lang['group_adjustments'] => array(
- array('CBNAME' => 'a_groupadj_add', 'CBCHECKED' => A_GROUPADJ_ADD, 'TEXT' => '<b>' . $user->lang['add'] . '</b>'),
- array('CBNAME' => 'a_groupadj_upd', 'CBCHECKED' => A_GROUPADJ_UPD, 'TEXT' => '<b>' . $user->lang['update'] . '</b>'),
- array('CBNAME' => 'a_groupadj_del', 'CBCHECKED' => A_GROUPADJ_DEL, 'TEXT' => '<b>' . $user->lang['delete'] . '</b>')
- ),
- // Individual adjustments
- $user->lang['individual_adjustments'] => array(
- array('CBNAME' => 'a_indivadj_add', 'CBCHECKED' => A_INDIVADJ_ADD, 'TEXT' => '<b>' . $user->lang['add'] . '</b>'),
- array('CBNAME' => 'a_indivadj_upd', 'CBCHECKED' => A_INDIVADJ_UPD, 'TEXT' => '<b>' . $user->lang['update'] . '</b>'),
- array('CBNAME' => 'a_indivadj_del', 'CBCHECKED' => A_INDIVADJ_DEL, 'TEXT' => '<b>' . $user->lang['delete'] . '</b>')
- ),
- // Items
- $user->lang['items'] => array(
- array('CBNAME' => 'a_item_add', 'CBCHECKED' => A_ITEM_ADD, 'TEXT' => '<b>' . $user->lang['add'] . '</b>'),
- array('CBNAME' => 'a_item_upd', 'CBCHECKED' => A_ITEM_UPD, 'TEXT' => '<b>' . $user->lang['update'] . '</b>'),
- array('CBNAME' => 'a_item_del', 'CBCHECKED' => A_ITEM_DEL, 'TEXT' => '<b>' . $user->lang['delete'] . '</b>'),
- array('CBNAME' => 'u_item_list', 'CBCHECKED' => U_ITEM_LIST, 'TEXT' => $user->lang['list']),
- array('CBNAME' => 'u_item_view', 'CBCHECKED' => U_ITEM_VIEW, 'TEXT' => $user->lang['view'])
- ),
- // News
- $user->lang['news'] => array(
- array('CBNAME' => 'a_news_add', 'CBCHECKED' => A_NEWS_ADD, 'TEXT' => '<b>' . $user->lang['add'] . '</b>'),
- array('CBNAME' => 'a_news_upd', 'CBCHECKED' => A_NEWS_UPD, 'TEXT' => '<b>' . $user->lang['update'] . '</b>'),
- array('CBNAME' => 'a_news_del', 'CBCHECKED' => A_NEWS_DEL, 'TEXT' => '<b>' . $user->lang['delete'] . '</b>')
- ),
- // Raids
- $user->lang['raids'] => array(
- array('CBNAME' => 'a_raid_add', 'CBCHECKED' => A_RAID_ADD, 'TEXT' => '<b>' . $user->lang['add'] . '</b>'),
- array('CBNAME' => 'a_raid_upd', 'CBCHECKED' => A_RAID_UPD, 'TEXT' => '<b>' . $user->lang['update'] . '</b>'),
- array('CBNAME' => 'a_raid_del', 'CBCHECKED' => A_RAID_DEL, 'TEXT' => '<b>' . $user->lang['delete'] . '</b>'),
- array('CBNAME' => 'u_raid_list', 'CBCHECKED' => U_RAID_LIST, 'TEXT' => $user->lang['list']),
- array('CBNAME' => 'u_raid_view', 'CBCHECKED' => U_RAID_VIEW, 'TEXT' => $user->lang['view'])
- ),
- // Turn-ins
- $user->lang['turn_ins'] => array(
- array('CBNAME' => 'a_turnin_add', 'CBCHECKED' => A_TURNIN_ADD, 'TEXT' => '<b>' . $user->lang['add'] . '</b>')
- ),
- // Members
- $user->lang['members'] => array(
- array('CBNAME' => 'a_members_man', 'CBCHECKED' => A_MEMBERS_MAN, 'TEXT' => '<b>' . $user->lang['manage'] . '</b>'),
- array('CBNAME' => 'u_member_list', 'CBCHECKED' => U_MEMBER_LIST, 'TEXT' => $user->lang['list']),
- array('CBNAME' => 'u_member_view', 'CBCHECKED' => U_MEMBER_VIEW, 'TEXT' => $user->lang['view'])
- ),
- // Manage
- $user->lang['manage'] => array(
- array('CBNAME' => 'a_config_man', 'CBCHECKED' => A_CONFIG_MAN, 'TEXT' => '<b>' . $user->lang['configuration'] . '</b>'),
- array('CBNAME' => 'a_plugins_man', 'CBCHECKED' => A_PLUGINS_MAN, 'TEXT' => '<b>' . $user->lang['plugins'] . '</b>'),
- array('CBNAME' => 'a_styles_man', 'CBCHECKED' => A_STYLES_MAN, 'TEXT' => '<b>' . $user->lang['styles'] . '</b>'),
- array('CBNAME' => 'a_users_man', 'CBCHECKED' => A_USERS_MAN, 'TEXT' => '<b>' . $user->lang['users'] . '</b>')
- ),
- // Logs
- $user->lang['logs'] => array(
- array('CBNAME' => 'a_logs_view', 'CBCHECKED' => A_LOGS_VIEW, 'TEXT' => '<b>' . $user->lang['view'] . '</b>')
- ),
- // Backup Database
- $user->lang['backup'] => array(
- array('CBNAME' => 'a_backup', 'CBCHECKED' => A_BACKUP, 'TEXT' => '<b>' . $user->lang['backup_database'] . '</b>')
- )
- );
-
- // Add plugin checkboxes to our array
- $pm->generate_permission_boxes($user_permissions);
-
- foreach ( $user_permissions as $group => $checks )
- {
- $tpl->assign_block_vars('permissions_row', array(
- 'GROUP' => $group)
- );
-
- foreach ( $checks as $data )
- {
- $tpl->assign_block_vars('permissions_row.check_group', array(
- 'CBNAME' => $data['CBNAME'],
- 'CBCHECKED' => ( $user->check_auth($data['CBNAME'], false, $user_id) ) ? ' checked="checked"' : '',
- 'TEXT' => $data['TEXT'])
- );
- }
- }
- unset($user_permissions);
-
- // Build member drop-down
- $sql = 'SELECT m.member_id, m.member_name, mu.user_id
- FROM ' . MEMBERS_TABLE . ' m
- LEFT JOIN ' . MEMBER_USER_TABLE . ' mu
- ON m.member_id = mu.member_id
- GROUP BY m.member_name
- ORDER BY m.member_name';
- $result = $db->query($sql);
- while ( $row = $db->fetch_record($result) )
- {
- $tpl->assign_block_vars('member_row', array(
- 'VALUE' => $row['member_id'],
- 'SELECTED' => ( (isset($row['user_id'])) && ($row['user_id'] == $this->user_data['user_id']) ) ? ' selected="selected"' : '',
- 'OPTION' => $row['member_name'])
- );
- }
- $db->free_result($result);
-
- $tpl->assign_vars(array(
- // Form vars
- 'F_SETTINGS' => 'manage_users.php' . $SID,
- 'S_CURRENT_PASSWORD' => false,
- 'S_NEW_PASSWORD' => true,
- 'S_SETTING_ADMIN' => true,
- 'S_MU_TABLE' => true,
-
- // Form values
- 'NAME' => stripslashes($_REQUEST[URI_NAME]),
- 'USER_ID' => $this->user_data['user_id'],
- 'USERNAME' => $this->user_data['username'],
- 'USER_EMAIL' => $this->user_data['user_email'],
- 'USER_ALIMIT' => $this->user_data['user_alimit'],
- 'USER_ELIMIT' => $this->user_data['user_elimit'],
- 'USER_ILIMIT' => $this->user_data['user_ilimit'],
- 'USER_NLIMIT' => $this->user_data['user_nlimit'],
- 'USER_RLIMIT' => $this->user_data['user_rlimit'],
- 'USER_ACTIVE_YES_CHECKED' => ( $this->user_data['user_active'] == '1' ) ? ' checked="checked"' : '',
- 'USER_ACTIVE_NO_CHECKED' => ( $this->user_data['user_active'] == '0' ) ? ' checked="checked"' : '',
-
- // Language
- 'L_REGISTRATION_INFORMATION' => $user->lang['registration_information'],
- 'L_REQUIRED_FIELD_NOTE' => $user->lang['required_field_note'],
- 'L_USERNAME' => $user->lang['username'],
- 'L_EMAIL_ADDRESS' => $user->lang['email_address'],
- 'L_NEW_PASSWORD' => $user->lang['new_password'],
- 'L_NEW_PASSWORD_NOTE' => $user->lang['new_password_note'],
- 'L_CONFIRM_PASSWORD' => $user->lang['confirm_password'],
- 'L_CONFIRM_PASSWORD_NOTE' => $user->lang['confirm_password_note'],
- 'L_PREFERENCES' => $user->lang['preferences'],
- 'L_ADJUSTMENTS_PER_PAGE' => $user->lang['adjustments_per_page'],
- 'L_EVENTS_PER_PAGE' => $user->lang['events_per_page'],
- 'L_ITEMS_PER_PAGE' => $user->lang['items_per_page'],
- 'L_NEWS_PER_PAGE' => $user->lang['news_per_page'],
- 'L_RAIDS_PER_PAGE' => $user->lang['raids_per_page'],
- 'L_LANGUAGE' => $user->lang['language'],
- 'L_STYLE' => $user->lang['style'],
- 'L_PREVIEW' => $user->lang['preview'],
- 'L_PERMISSIONS' => $user->lang['permissions'],
- 'L_S_ADMIN_NOTE' => $user->lang['s_admin_note'],
- 'L_ACCOUNT_ENABLED' => $user->lang['account_enabled'],
- 'L_YES' => $user->lang['yes'],
- 'L_NO' => $user->lang['no'],
- 'L_ASSOCIATED_MEMBERS' => $user->lang['associated_members'],
- 'L_MEMBERS' => $user->lang['members'],
- 'L_SUBMIT' => $user->lang['submit'],
- 'L_RESET' => $user->lang['reset'],
-
- // Form validation
- 'FV_USERNAME' => $this->fv->generate_error('username'),
- 'FV_NEW_PASSWORD' => $this->fv->generate_error('new_user_password1'),
- 'FV_USER_ALIMIT' => $this->fv->generate_error('user_alimit'),
- 'FV_USER_ELIMIT' => $this->fv->generate_error('user_elimit'),
- 'FV_USER_ILIMIT' => $this->fv->generate_error('user_ilimit'),
- 'FV_USER_NLIMIT' => $this->fv->generate_error('user_nlimit'),
- 'FV_USER_RLIMIT' => $this->fv->generate_error('user_rlimit'),
- 'FV_MEMBER_ID' => $this->fv->generate_error('member_id'))
- );
-
- $pm->do_hooks('/admin/manage_users.php?action=settings');
-
- //
- // Build the language drop-down
- //
- if ( $dir = @opendir($eqdkp->root_path . 'language/') )
- {
- while ( $file = @readdir($dir) )
- {
- if ( (!is_file($eqdkp->root_path . 'language/' . $file)) && (!is_link($eqdkp->root_path . 'language/' . $file)) && ($file != '.') && ($file != '..') && ($file != 'CVS') )
- {
- $tpl->assign_block_vars('lang_row', array(
- 'VALUE' => $file,
- 'SELECTED' => ( $this->user_data['user_lang'] == $file ) ? ' selected="selected"' : '',
- 'OPTION' => ucfirst($file))
- );
- }
- }
- }
-
- //
- // Build the style drop-down
- //
- $sql = 'SELECT style_id, style_name
- FROM ' . STYLES_TABLE . '
- ORDER BY style_name';
- $result = $db->query($sql);
- while ( $row = $db->fetch_record($result) )
- {
- $tpl->assign_block_vars('style_row', array(
- 'VALUE' => $row['style_id'],
- 'SELECTED' => ( $this->user_data['user_style'] == $row['style_id'] ) ? ' selected="selected"' : '',
- 'OPTION' => $row['style_name'])
- );
- }
- $db->free_result($result);
-
- $eqdkp->set_vars(array(
- 'page_title' => sprintf($user->lang['title_prefix'], $eqdkp->config['guildtag'], $eqdkp->config['dkp_name']).': Manage Users',
- 'template_file' => 'settings.html',
- 'display' => true)
- );
- }
-}
-
-$manage_users = new Manage_users;
-$manage_users->process();
-?>
diff --git a/old/admin/mm/index.html b/old/admin/mm/index.html
deleted file mode 100644
index e69de29..0000000
--- a/old/admin/mm/index.html
+++ /dev/null
diff --git a/old/admin/mm/mm_addmember.php b/old/admin/mm/mm_addmember.php
deleted file mode 100644
index 90dbaa1..0000000
--- a/old/admin/mm/mm_addmember.php
+++ /dev/null
@@ -1,559 +0,0 @@
-<?php
-/******************************
- * EQdkp
- * Copyright 2002-2003
- * Licensed under the GNU GPL. See COPYING for full terms.
- * ------------------
- * mm_addmember.php
- * Began: Thu January 30 2003
- *
- * $Id: mm_addmember.php 46 2007-06-19 07:29:11Z tsigo $
- *
- ******************************/
-
-// This script handles adding, updating or deleting a member.
-// NOTE: This script will also process deleting multiple members through the
-// mm_listmembers interface
-
-if ( !defined('EQDKP_INC') )
-{
- die('Hacking attempt');
-}
-
-class MM_Addmember extends EQdkp_Admin
-{
- var $member = array(); // Holds member data if URI_NAME is set @var member
- var $old_member = array(); // Holds member data from before POST @var old_member
-
- function mm_addmember()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID;
-
- parent::eqdkp_admin();
-
- $defaults = array(
- 'member_earned' => '0.00',
- 'member_spent' => '0.00',
- 'member_adjustment' => '0.00');
-
- $this->member = array(
- 'member_id' => 0,
- 'member_name' => post_or_db('member_name'),
- 'member_earned' => post_or_db('member_earned', $defaults),
- 'member_spent' => post_or_db('member_spent', $defaults),
- 'member_adjustment' => post_or_db('member_adjustment', $defaults),
- 'member_current' => '0.00',
- 'member_race_id' => post_or_db('member_race_id'),
- 'member_class_id' => post_or_db('member_class_id'),
- 'member_level' => post_or_db('member_level'),
- 'member_rank_id' => post_or_db('member_rank_id')
- );
-
- // Vars used to confirm deletion
- $confirm_text = $user->lang['confirm_delete_members'];
- $member_names = array();
- if ( isset($_POST['delete']) )
- {
- if ( isset($_POST['compare_ids']) )
- {
- foreach ( $_POST['compare_ids'] as $id )
- {
- $member_name = $db->query_first('SELECT member_name FROM ' . MEMBERS_TABLE . " WHERE member_id='" . $id . "'");
- $member_names[] = $member_name;
- }
-
- $names = implode(', ', $member_names);
-
- $confirm_text .= '<br /><br />' . $names;
- }
- else
- {
- message_die('No members were selected for deletion.');
- }
- }
-
- $this->set_vars(array(
- 'confirm_text' => $confirm_text,
- 'uri_parameter' => URI_NAME,
- 'url_id' => ( sizeof($member_names) > 0 ) ? $names : (( isset($_GET[URI_NAME]) ) ? $_GET[URI_NAME] : ''),
- 'script_name' => 'manage_members.php' . $SID . '&amp;mode=addmember')
- );
-
- $this->assoc_buttons(array(
- 'add' => array(
- 'name' => 'add',
- 'process' => 'process_add',
- 'check' => 'a_members_man'),
- 'update' => array(
- 'name' => 'update',
- 'process' => 'process_update',
- 'check' => 'a_members_man'),
- 'delete' => array(
- 'name' => 'delete',
- 'process' => 'process_delete',
- 'check' => 'a_members_man'),
- 'form' => array(
- 'name' => '',
- 'process' => 'display_form',
- 'check' => 'a_members_man'))
- );
-
- // Build the member array
- // ---------------------------------------------------------
- if ( !empty($this->url_id) )
- {
- $sql = 'SELECT m.*, (m.member_earned - m.member_spent + m.member_adjustment) AS member_current,
- c.class_name AS member_class, r.race_name AS member_race
- FROM ' . MEMBERS_TABLE . ' m, ' . CLASS_TABLE . ' c, ' . RACE_TABLE . " r
- WHERE r.race_id = m.member_race_id
- AND c.class_id = m.member_class_id
- AND member_name='" . $this->url_id . "'";
- $result = $db->query($sql);
- $row = $db->fetch_record($result);
- $db->free_result($result);
-
- $this->member = array(
- 'member_id' => $row['member_id'],
- 'member_name' => post_or_db('member_name', $row),
- 'member_earned' => post_or_db('member_earned', $row),
- 'member_spent' => post_or_db('member_spent', $row),
- 'member_adjustment' => post_or_db('member_adjustment', $row),
- 'member_current' => $row['member_current'],
- 'member_race_id' => post_or_db('member_race_id', $row),
- 'member_race' => $row['member_race'],
- 'member_class_id' => post_or_db('member_class_id', $row),
- 'member_class' => $row['member_class'],
- 'member_level' => post_or_db('member_level', $row),
- 'member_rank_id' => post_or_db('member_rank_id', $row)
- );
- }
- }
-
- function error_check()
- {
- global $user, $SID;
-
- if ( (isset($_POST['add'])) || (isset($_POST['update'])) )
- {
- $this->fv->is_filled('member_name', $user->lang['fv_required_name']);
- $this->fv->is_number(array(
- 'member_earned' => $user->lang['fv_number'],
- 'member_spent' => $user->lang['fv_number'],
- 'member_adjustment' => $user->lang['fv_number'])
- );
- }
-
- return $this->fv->is_error();
- }
-
- // ---------------------------------------------------------
- // Process Add
- // ---------------------------------------------------------
- function process_add()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID;
-
- //
- // Insert the member
- //
-
- // Make sure that each member's name is properly capitalized
- $member_name = strtolower(preg_replace('/[[:space:]]/i', ' ', $_POST['member_name']));
- $member_name = ucwords($member_name);
-
- // Check for existing member name
- $sql = "SELECT member_id FROM " . MEMBERS_TABLE ." WHERE member_name = '".$member_name."'";
- $member_id = $db->query_first($sql);
-
-
- // Error out if member name exists
- if ( isset($member_id) && $member_id > 0 ) {
-
- $failure_message = "Failed to add $member_name; member exists as ID $member_id";
- $link_list = array(
- $user->lang['add_member'] => 'manage_members.php' . $SID . '&amp;mode=addmember',
- $user->lang['list_edit_del_member'] => 'manage_members.php' . $SID . '&amp;mode=list');
-
- message_die($failure_message, $link_list);
-
- }
-
-
- $query = $db->build_query('INSERT', array(
- 'member_name' => $member_name,
- 'member_earned' => $_POST['member_earned'],
- 'member_spent' => $_POST['member_spent'],
- 'member_adjustment' => $_POST['member_adjustment'],
- 'member_firstraid' => 0,
- 'member_lastraid' => 0,
- 'member_raidcount' => 0,
- 'member_level' => $_POST['member_level'],
- 'member_race_id' => $_POST['member_race_id'],
- 'member_class_id' => $_POST['member_class_id'],
- 'member_rank_id' => $_POST['member_rank_id'])
- );
- $db->query('INSERT INTO ' . MEMBERS_TABLE . $query);
-
- //
- // Logging
- //
- $log_action = array(
- 'header' => '{L_ACTION_MEMBER_ADDED}',
- '{L_NAME}' => $member_name,
- '{L_EARNED}' => $_POST['member_earned'],
- '{L_SPENT}' => $_POST['member_spent'],
- '{L_ADJUSTMENT}' => $_POST['member_adjustment'],
- '{L_LEVEL}' => $_POST['member_level'],
- '{L_RACE}' => $_POST['member_race_id'],
- '{L_CLASS}' => $_POST['member_class_id'],
- '{L_ADDED_BY}' => $this->admin_user);
- $this->log_insert(array(
- 'log_type' => $log_action['header'],
- 'log_action' => $log_action)
- );
-
- //
- // Success message
- //
- $success_message = sprintf($user->lang['admin_add_member_success'], $member_name);
- $link_list = array(
- $user->lang['add_member'] => 'manage_members.php' . $SID . '&amp;mode=addmember',
- $user->lang['list_edit_del_member'] => 'manage_members.php' . $SID . '&amp;mode=list');
- $this->admin_die($success_message, $link_list);
- }
-
- // ---------------------------------------------------------
- // Process Update
- // ---------------------------------------------------------
- function process_update()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID;
-
- //
- // Get old member data
- //
- $this->get_old_data($_POST[URI_NAME]);
- $member_id = $this->old_member['member_id'];
- $old_member_name = $this->old_member['member_name'];
-
- // Make sure that each member's name is properly capitalized
- $member_name = strtolower(preg_replace('/[[:space:]]/i', ' ', $_POST['member_name']));
- $member_name = ucwords($member_name);
-
- //
- // Update the member
- //
- $query = $db->build_query('UPDATE', array(
- 'member_name' => $member_name,
- 'member_earned' => $_POST['member_earned'],
- 'member_spent' => $_POST['member_spent'],
- 'member_adjustment' => $_POST['member_adjustment'],
- 'member_level' => $_POST['member_level'],
- 'member_race_id' => $_POST['member_race_id'],
- 'member_class_id' => $_POST['member_class_id'],
- 'member_rank_id' => $_POST['member_rank_id'])
- );
- $db->query('UPDATE ' . MEMBERS_TABLE . ' SET ' . $query . " WHERE member_name='" . $old_member_name . "'");
-
- if ( !($member_name == $old_member_name) ) {
-
- $sql = "UPDATE " . RAID_ATTENDEES_TABLE . " SET member_name = '" . $member_name ."' WHERE member_name = '". $old_member_name . "'";
- $db->query_first($sql);
-
- $sql = "UPDATE " . ITEMS_TABLE . " SET item_buyer = '" . $member_name ."' WHERE item_buyer = '". $old_member_name . "'";
- $db->query_first($sql);
-
- $sql = "UPDATE " . ADJUSTMENT_TABLE . " SET member_name = '" . $member_name ."' WHERE member_name = '". $old_member_name . "'";
- $db->query_first($sql);
-
- }
-
-
- //
- // Logging
- //
- $log_action = array(
- 'header' => '{L_ACTION_MEMBER_UPDATED}',
- '{L_NAME_BEFORE}' => $this->old_member['member_name'],
- '{L_EARNED_BEFORE}' => $this->old_member['member_earned'],
- '{L_SPENT_BEFORE}' => $this->old_member['member_spent'],
- '{L_ADJUSTMENT_BEFORE}' => $this->old_member['member_adjustment'],
- '{L_LEVEL_BEFORE}' => $this->old_member['member_level'],
- '{L_RACE_BEFORE}' => $this->old_member['member_race_id'],
- '{L_CLASS_BEFORE}' => $this->old_member['member_class_id'],
- '{L_NAME_AFTER}' => $this->find_difference($this->old_member['member_name'], $member_name),
- '{L_EARNED_AFTER}' => $this->find_difference($this->old_member['member_earned'], $_POST['member_earned']),
- '{L_SPENT_AFTER}' => $this->find_difference($this->old_member['member_spent'], $_POST['member_spent']),
- '{L_ADJUSTMENT_AFTER}' => $this->find_difference($this->old_member['member_adjustment'], $_POST['member_adjustment']),
- '{L_LEVEL_AFTER}' => $this->find_difference($this->old_member['member_level'], $_POST['member_level']),
- '{L_RACE_AFTER}' => $this->find_difference($this->old_member['member_race_id'], $_POST['member_race_id']),
- '{L_CLASS_AFTER}' => $this->find_difference($this->old_member['member_class_id'], $_POST['member_class_id']),
- '{L_UPDATED_BY}' => $this->admin_user);
- $this->log_insert(array(
- 'log_type' => $log_action['header'],
- 'log_action' => $log_action)
- );
-
- //
- // Success message
- //
- $success_message = sprintf($user->lang['admin_update_member_success'], $this->old_member['member_name']);
- $this->admin_die($success_message);
- }
-
- // ---------------------------------------------------------
- // Process Delete (confirmed)
- // ---------------------------------------------------------
- function process_confirm()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID;
-
- $success_message = '';
- $members = explode(', ', $_POST[URI_NAME]);
- foreach ( $members as $member_name )
- {
- if ( empty($member_name) )
- {
- continue;
- }
-
- //
- // Get old member data
- //
- $this->get_old_data($member_name);
-
- //
- // Delete attendance
- //
- $sql = 'DELETE FROM ' . RAID_ATTENDEES_TABLE . "
- WHERE member_name='" . $member_name . "'";
- $db->query($sql);
-
- //
- // Delete items
- //
- $sql = 'DELETE FROM ' . ITEMS_TABLE . "
- WHERE item_buyer='" . $member_name . "'";
- $db->query($sql);
-
- //
- // Delete adjustments
- //
- $sql = 'DELETE FROM ' . ADJUSTMENTS_TABLE . "
- WHERE member_name='" . $member_name . "'";
- $db->query($sql);
-
- //
- // Delete member
- //
- $sql = 'DELETE FROM ' . MEMBERS_TABLE . "
- WHERE member_name='" . $member_name . "'";
- $db->query($sql);
-
- //
- // Logging
- //
- $log_action = array(
- 'header' => '{L_ACTION_MEMBER_DELETED}',
- '{L_NAME}' => $this->old_member['member_name'],
- '{L_EARNED}' => $this->old_member['member_earned'],
- '{L_SPENT}' => $this->old_member['member_spent'],
- '{L_ADJUSTMENT}' => $this->old_member['member_adjustment'],
- '{L_LEVEL}' => $this->old_member['member_level'],
- '{L_RACE}' => $this->old_member['member_race_id'],
- '{L_CLASS}' => $this->old_member['member_class_id']);
- $this->log_insert(array(
- 'log_type' => $log_action['header'],
- 'log_action' => $log_action)
- );
-
- //
- // Append success message
- //
- $success_message .= sprintf($user->lang['admin_delete_members_success'], $member_name) . '<br />';
- }
-
- //
- // Success message
- //
- $this->admin_die($success_message);
- }
-
- // ---------------------------------------------------------
- // Process helper methods
- // ---------------------------------------------------------
- function get_old_data($member_name)
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID;
-
- $sql = 'SELECT *
- FROM ' . MEMBERS_TABLE . "
- WHERE member_name='" . $member_name . "'";
- $result = $db->query($sql);
- while ( $row = $db->fetch_record($result) )
- {
- $this->old_member = array(
- 'member_name' => addslashes($row['member_name']),
- 'member_id' => $row['member_id'],
- 'member_earned' => $row['member_earned'],
- 'member_spent' => $row['member_spent'],
- 'member_adjustment' => $row['member_adjustment'],
- 'member_level' => $row['member_level'],
- 'member_race_id' => $row['member_race_id'],
- 'member_class_id' => $row['member_class_id']);
- }
- $db->free_result($result);
- }
-
- // ---------------------------------------------------------
- // Display form
- // ---------------------------------------------------------
- function display_form()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID;
-
- // New for 1.3 - get class and race information from the database
- // This section populates $eq_classes for the form. They are not
- // populated in a multidimensional array anymore.
-
- $eq_classes = array();
-
- $sql = 'SELECT class_id, class_name, class_min_level, class_max_level FROM ' . CLASS_TABLE .' GROUP BY class_id';
- $result = $db->query($sql);
-
- while ( $row = $db->fetch_record($result) )
- {
-
- if ( $row['class_min_level'] == '0' ) {
- $option = ( !empty($row['class_name']) ) ? stripslashes($row['class_name'])." Level (".$row['class_min_level']." - ".$row['class_max_level'].")" : '(None)';
- } else {
- $option = ( !empty($row['class_name']) ) ? stripslashes($row['class_name'])." Level ".$row['class_min_level']."+" : '(None)';
- }
-
- $tpl->assign_block_vars('class_row', array(
- 'VALUE' => $row['class_id'],
- 'SELECTED' => ( $this->member['member_class_id'] == $row['class_id'] ) ? ' selected="selected"' : '',
- 'OPTION' => $option )
- );
-
- $eq_classes[] = $row[0];
- }
-
- $db->free_result($result);
-
- // New for 1.3 - get race information from the database
-
- $eq_races = array();
-
- $sql = 'SELECT race_id, race_name FROM ' . RACE_TABLE .' GROUP BY race_name';
- $result = $db->query($sql);
-
- while ( $row = $db->fetch_record($result) )
- {
- $tpl->assign_block_vars('race_row', array(
- 'VALUE' => $row['race_id'],
- 'SELECTED' => ( $this->member['member_race_id'] == $row['race_id'] ) ? ' selected="selected"' : '',
- 'OPTION' => ( !empty($row['race_name']) ) ? stripslashes($row['race_name']) : '(None)')
- );
-
- $eq_races[] = $row[0];
- }
-
- $db->free_result($result);
-
- // end 1.3 changes
-
- if ( !empty($this->member['member_name']) )
- {
- // Get their correct earned/spent
- $correct_earned = $db->query_first('SELECT sum(r.raid_value)
- FROM ' . RAIDS_TABLE . ' r, ' . RAID_ATTENDEES_TABLE . " ra
- WHERE ra.raid_id = r.raid_id
- AND ra.member_name='" . addslashes($this->member['member_name']) . "'");
-
- $correct_spent = $db->query_first('SELECT sum(item_value)
- FROM ' . ITEMS_TABLE . "
- WHERE item_buyer='" . addslashes($this->member['member_name']) . "'");
- }
-
- //
- // Build rank drop-down
- //
- $sql = 'SELECT rank_id, rank_name
- FROM ' . MEMBER_RANKS_TABLE . '
- ORDER BY rank_id';
- $result = $db->query($sql);
-
- while ( $row = $db->fetch_record($result) )
- {
- $tpl->assign_block_vars('rank_row', array(
- 'VALUE' => $row['rank_id'],
- 'SELECTED' => ( $this->member['member_rank_id'] == $row['rank_id'] ) ? ' selected="selected"' : '',
- 'OPTION' => ( !empty($row['rank_name']) ) ? stripslashes($row['rank_name']) : '(None)')
- );
- }
- $db->free_result($result);
-
- $tpl->assign_vars(array(
- // Form vars
- 'F_ADD_MEMBER' => 'manage_members.php' . $SID . '&amp;mode=addmember',
-
- // Form values
- 'MEMBER_NAME' => $this->member['member_name'],
- 'V_MEMBER_NAME' => ( isset($_POST['add']) ) ? '' : $this->member['member_name'],
- 'MEMBER_ID' => $this->member['member_id'],
- 'MEMBER_EARNED' => $this->member['member_earned'],
- 'MEMBER_SPENT' => $this->member['member_spent'],
- 'MEMBER_ADJUSTMENT' => $this->member['member_adjustment'],
- 'MEMBER_CURRENT' => ( !empty($this->member['member_current']) ) ? $this->member['member_current'] : '0.00',
- 'MEMBER_LEVEL' => $this->member['member_level'],
- 'CORRECT_MEMBER_EARNED' => ( !empty($correct_earned) ) ? $correct_earned : '0.00',
- 'CORRECT_MEMBER_SPENT' => ( !empty($correct_spent) ) ? $correct_spent : '0.00',
- 'C_MEMBER_CURRENT' => color_item($this->member['member_current']),
-
- // Language
- 'L_ADD_MEMBER_TITLE' => $user->lang['addmember_title'],
- 'L_NAME' => $user->lang['name'],
- 'L_RACE' => $user->lang['race'],
- 'L_CLASS' => $user->lang['class'],
- 'L_LEVEL' => $user->lang['level'],
- 'L_EARNED' => $user->lang['earned'],
- 'L_SPENT' => $user->lang['spent'],
- 'L_ADJUSTMENT' => $user->lang['adjustment'],
- 'L_CURRENT' => $user->lang['current'],
- 'L_SHOULD_BE' => $user->lang['should_be'],
- 'L_MEMBER_RANK' => $user->lang['member_rank'],
- 'L_ADD_MEMBER' => $user->lang['add_member'],
- 'L_RESET' => $user->lang['reset'],
- 'L_UPDATE_MEMBER' => $user->lang['update_member'],
- 'L_DELETE_MEMBER' => $user->lang['delete_member'],
-
- // Form validation
- 'FV_MEMBER_NAME' => $this->fv->generate_error('member_name'),
- 'FV_MEMBER_LEVEL' => $this->fv->generate_error('member_level'),
- 'FV_MEMBER_EARNED' => $this->fv->generate_error('member_earned'),
- 'FV_MEMBER_SPENT' => $this->fv->generate_error('member_spent'),
- 'FV_MEMBER_ADJUSTMENT' => $this->fv->generate_error('member_adjustment'),
- 'FV_MEMBER_CURRENT' => $this->fv->generate_error('member_current'),
-
- // Javascript messages
- 'MSG_NAME_EMPTY' => $user->lang['fv_required_name'],
-
- // Buttons
- 'S_ADD' => ( !empty($this->url_id) ) ? false : true)
- );
-
- $eqdkp->set_vars(array(
- 'page_title' => sprintf($user->lang['admin_title_prefix'], $eqdkp->config['guildtag'], $eqdkp->config['dkp_name']).': '.$user->lang['manage_members_title'],
- 'template_file' => 'admin/mm_addmember.html',
- 'display' => true)
- );
- }
-}
-?>
diff --git a/old/admin/mm/mm_addmember.php.NEW.gz b/old/admin/mm/mm_addmember.php.NEW.gz
deleted file mode 100644
index 17295ed..0000000
--- a/old/admin/mm/mm_addmember.php.NEW.gz
+++ /dev/null
Binary files differ
diff --git a/old/admin/mm/mm_listmembers.php b/old/admin/mm/mm_listmembers.php
deleted file mode 100644
index a2b59bf..0000000
--- a/old/admin/mm/mm_listmembers.php
+++ /dev/null
@@ -1,129 +0,0 @@
-<?php
-/******************************
- * EQdkp
- * Copyright 2002-2003
- * Licensed under the GNU GPL. See COPYING for full terms.
- * ------------------
- * mm_listmembers.php
- * Began: Thu January 30 2003
- *
- * $Id: mm_listmembers.php 46 2007-06-19 07:29:11Z tsigo $
- *
- ******************************/
-
-// Shows a list of members, basically just an admin-themed version of
-// /listmembers.php
-
-if ( !defined('EQDKP_INC') )
-{
- die('Hacking attempt');
-}
-
-$sort_order = array(
- 0 => array('member_name', 'member_name desc'),
- 1 => array('member_earned desc', 'member_earned'),
- 2 => array('member_spent desc', 'member_spent'),
- 3 => array('member_adjustment desc', 'member_adjustment'),
- 4 => array('member_current desc', 'member_current'),
- 5 => array('member_lastraid desc', 'member_lastraid'),
- 6 => array('member_level desc', 'member_level'),
- 7 => array('member_class', 'member_class desc'),
- 8 => array('rank_name', 'rank_name desc'),
- 9 => array('class_armor_type', 'class_armor_type desc')
-
-);
-
-$current_order = switch_order($sort_order);
-
-$member_count = 0;
-$previous_data = '';
-
-// Figure out what data we're comparing from member to member
-// in order to rank them
-$sort_index = explode('.', $current_order['uri']['current']);
-$previous_source = preg_replace('/( (asc|desc))?/i', '', $sort_order[$sort_index[0]][$sort_index[1]]);
-
-$show_all = ( (!empty($_GET['show'])) && ($_GET['show'] == 'all') ) ? true : false;
-
-$sql = 'SELECT m.*, (m.member_earned-m.member_spent+m.member_adjustment) AS member_current,
- c.class_name AS member_class,
- r.rank_name, r.rank_prefix, r.rank_suffix,
- c.class_armor_type AS armor_type
- FROM ' . MEMBERS_TABLE . ' m, ' . MEMBER_RANKS_TABLE . ' r, ' .CLASS_TABLE. ' c
- WHERE (m.member_rank_id = r.rank_id)
- AND (m.member_class_id = c.class_id)
- ORDER BY ' . $current_order['sql'];
-if ( !($members_result = $db->query($sql)) )
-{
- message_die('Could not obtain member information', '', __FILE__, __LINE__, $sql);
-}
-while ( $row = $db->fetch_record($members_result) )
-{
- $member_count++;
- $tpl->assign_block_vars('members_row', array(
- 'ROW_CLASS' => $eqdkp->switch_row_class(),
- 'ID' => $row['member_id'],
- 'COUNT' => ($row[$previous_source] == $previous_data) ? '&nbsp;' : $member_count,
- 'NAME' => $row['rank_prefix'] . $row['member_name'] . $row['rank_suffix'],
- 'RANK' => stripslashes($row['rank_name']),
- 'LEVEL' => ( $row['member_level'] > 0 ) ? $row['member_level'] : '&nbsp;',
- 'ARMOR' => ( !empty($row['armor_type']) ) ? $row['armor_type'] : '&nbsp;',
- 'CLASS' => ( $row['member_class'] != 'NULL' ) ? $row['member_class'] : '&nbsp;',
- 'EARNED' => $row['member_earned'],
- 'SPENT' => $row['member_spent'],
- 'ADJUSTMENT' => $row['member_adjustment'],
- 'CURRENT' => $row['member_current'],
- 'LASTRAID' => ( !empty($row['member_lastraid']) ) ? date($user->style['date_notime_short'], $row['member_lastraid']) : '&nbsp;',
- 'C_ADJUSTMENT' => color_item($row['member_adjustment']),
- 'C_CURRENT' => color_item($row['member_current']),
- 'C_LASTRAID' => 'neutral',
- 'U_VIEW_MEMBER' => 'manage_members.php'.$SID . '&amp;mode=addmember&amp;' . URI_NAME . '='.$row['member_name'])
- );
-
- // So that we can compare this member to the next member,
- // set the value of the previous data to the source
- $previous_data = $row[$previous_source];
-}
-$footcount_text = sprintf($user->lang['listmembers_footcount'], $db->num_rows($members_result));
-
-$tpl->assign_vars(array(
- 'F_MEMBERS' => 'manage_members.php' . $SID . '&amp;mode=addmember',
-
- 'L_NAME' => $user->lang['name'],
- 'L_RANK' => $user->lang['rank'],
- 'L_LEVEL' => $user->lang['level'],
- 'L_CLASS' => $user->lang['class'],
- 'L_EARNED' => $user->lang['earned'],
- 'L_SPENT' => $user->lang['spent'],
- 'L_ARMOR' => $user->lang['armor'],
- 'L_ADJUSTMENT' => $user->lang['adjustment'],
- 'L_CURRENT' => $user->lang['current'],
- 'L_LASTRAID' => $user->lang['lastraid'],
- 'BUTTON_NAME' => 'delete',
- 'BUTTON_VALUE' => $user->lang['delete_selected_members'],
-
- 'O_NAME' => $current_order['uri'][0],
- 'O_RANK' => $current_order['uri'][8],
- 'O_LEVEL' => $current_order['uri'][6],
- 'O_CLASS' => $current_order['uri'][7],
- 'O_ARMOR' => $current_order['uri'][9],
- 'O_EARNED' => $current_order['uri'][1],
- 'O_SPENT' => $current_order['uri'][2],
- 'O_ADJUSTMENT' => $current_order['uri'][3],
- 'O_CURRENT' => $current_order['uri'][4],
- 'O_LASTRAID' => $current_order['uri'][5],
-
- 'U_LIST_MEMBERS' => 'manage_members.php'.$SID.'&amp;mode=list&amp;',
-
- 'S_COMPARE' => false,
- 'S_NOTMM' => false,
-
- 'LISTMEMBERS_FOOTCOUNT' => $footcount_text)
-);
-
-$eqdkp->set_vars(array(
- 'page_title' => sprintf($user->lang['title_prefix'], $eqdkp->config['guildtag'], $eqdkp->config['dkp_name']).': '.$user->lang['listmembers_title'],
- 'template_file' => 'listmembers.html',
- 'display' => true)
-);
-?>
diff --git a/old/admin/mm/mm_ranks.php b/old/admin/mm/mm_ranks.php
deleted file mode 100644
index 082e784..0000000
--- a/old/admin/mm/mm_ranks.php
+++ /dev/null
@@ -1,150 +0,0 @@
-<?php
-/******************************
- * EQdkp
- * Copyright 2002-2003
- * Licensed under the GNU GPL. See COPYING for full terms.
- * ------------------
- * mm_ranks.php
- * Began: Fri February 14 2003
- *
- * $Id: mm_ranks.php 46 2007-06-19 07:29:11Z tsigo $
- *
- ******************************/
-
-// This script handles editing membership ranks
-if ( !defined('EQDKP_INC') )
-{
- die('Hacking attempt');
-}
-
-class MM_Ranks extends EQdkp_Admin
-{
- function mm_ranks()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID;
-
- parent::eqdkp_admin();
-
- $this->assoc_buttons(array(
- 'submit' => array(
- 'name' => 'submit',
- 'process' => 'process_submit',
- 'check' => 'a_members_man'),
- 'form' => array(
- 'name' => '',
- 'process' => 'display_form',
- 'check' => 'a_members_man'))
- );
- }
-
- function error_check()
- {
- return $this->fv->is_error();
- }
-
- // ---------------------------------------------------------
- // Process submit
- // ---------------------------------------------------------
- function process_submit()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID;
-
- foreach ( $_POST['ranks'] as $rank_id => $rank_name )
- {
- $sql = 'DELETE FROM ' . MEMBER_RANKS_TABLE . "
- WHERE rank_id='" . $rank_id . "'";
- $db->query($sql);
-
- // If the rank's been removed, NULL the member_rank for users that have it
- if ( $rank_name == '' )
- {
- $sql = 'UPDATE ' . MEMBERS_TABLE . "
- SET member_rank_id = NULL
- WHERE member_rank_id='" . $rank_id . "'";
- $db->query($sql);
- }
- // Otherwise re-add the rank to the table
- else
- {
- $rank_prefix = ( isset($_POST['prefix'][$rank_id]) ) ? $_POST['prefix'][$rank_id] : '';
- $rank_suffix = ( isset($_POST['suffix'][$rank_id]) ) ? $_POST['suffix'][$rank_id] : '';
-
- $rank_prefix = undo_sanitize_tags(stripslashes($rank_prefix));
- $rank_suffix = undo_sanitize_tags(stripslashes($rank_suffix));
-
- $query = $db->build_query('INSERT', array(
- 'rank_id' => $rank_id,
- 'rank_name' => $rank_name,
- 'rank_hide' => ( isset($_POST['hide'][$rank_id]) ) ? '1' : '0',
- 'rank_prefix' => $rank_prefix,
- 'rank_suffix' => $rank_suffix)
- );
- $db->query('INSERT INTO ' . MEMBER_RANKS_TABLE . $query);
- }
- }
-
- header('Location: manage_members.php' . $SID . '&mode=ranks');
- }
-
- // ---------------------------------------------------------
- // Display form
- // ---------------------------------------------------------
- function display_form()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID;
-
- //
- // Populate the fields
- //
- $max_id = 0;
- $sql = 'SELECT rank_id, rank_name, rank_hide, rank_prefix, rank_suffix
- FROM ' . MEMBER_RANKS_TABLE . '
- WHERE rank_id > 0
- ORDER BY rank_id';
- $result = $db->query($sql);
- while ( $row = $db->fetch_record($result) )
- {
- $prefix = htmlspecialchars($row['rank_prefix']);
- $suffix = htmlspecialchars($row['rank_suffix']);
-
- $tpl->assign_block_vars('ranks_row', array(
- 'ROW_CLASS' => $eqdkp->switch_row_class(),
- 'RANK_ID' => $row['rank_id'],
- 'RANK_NAME' => stripslashes($row['rank_name']),
- 'RANK_PREFIX' => stripslashes($prefix),
- 'RANK_SUFFIX' => stripslashes($suffix),
- 'HIDE_CHECKED' => ( $row['rank_hide'] == '1' ) ? 'checked="checked"' : '')
- );
- $max_id = ( $max_id < $row['rank_id'] ) ? $row['rank_id'] : $max_id;
- }
- $db->free_result($result);
-
- $tpl->assign_vars(array(
- // Form vars
- 'F_EDIT_RANKS' => 'manage_members.php' . $SID . '&amp;mode=ranks',
-
- // Form values
- 'ROW_CLASS' => $eqdkp->switch_row_class(),
- 'RANK_ID' => ($max_id * 2),
-
- // Language
- 'L_EDIT_RANKS_TITLE' => $user->lang['edit_ranks'],
- 'L_TITLE' => $user->lang['title'],
- 'L_HIDE' => $user->lang['hide'],
- 'L_LIST_PREFIX' => $user->lang['list_prefix'],
- 'L_LIST_SUFFIX' => $user->lang['list_suffix'],
- 'L_EDIT_RANKS' => $user->lang['edit_ranks'],
- 'L_RESET' => $user->lang['reset'])
- );
-
- $eqdkp->set_vars(array(
- 'page_title' => sprintf($user->lang['admin_title_prefix'], $eqdkp->config['guildtag'], $eqdkp->config['dkp_name']).': '.$user->lang['manage_members_title'],
- 'template_file' => 'admin/mm_ranks.html',
- 'display' => true)
- );
- }
-}
-?> \ No newline at end of file
diff --git a/old/admin/mm/mm_transfer.php b/old/admin/mm/mm_transfer.php
deleted file mode 100644
index 9342fc1..0000000
--- a/old/admin/mm/mm_transfer.php
+++ /dev/null
@@ -1,249 +0,0 @@
-<?php
-/******************************
- * EQdkp
- * Copyright 2002-2003
- * Licensed under the GNU GPL. See COPYING for full terms.
- * ------------------
- * mm_transfer.php
- * Began: Thu January 30 2003
- *
- * $Id: mm_transfer.php 46 2007-06-19 07:29:11Z tsigo $
- *
- ******************************/
-
-// This script handles processing of a member history transfer
-// Also displays the form to do so
-
-if ( !defined('EQDKP_INC') )
-{
- die('Hacking attempt');
-}
-
-class MM_Transfer extends EQdkp_Admin
-{
- var $transfer = array();
-
- function mm_transfer()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID;
-
- parent::eqdkp_admin();
-
- $this->transfer = array(
- 'from' => post_or_db('turnin_from'),
- 'to' => post_or_db('turnin_to')
- );
-
- $this->assoc_buttons(array(
- 'transfer' => array(
- 'name' => 'transfer',
- 'process' => 'process_transfer',
- 'check' => 'a_members_man'),
- 'form' => array(
- 'name' => '',
- 'process' => 'display_form',
- 'check' => 'a_members_man'))
- );
- }
-
- function error_check()
- {
- global $user;
-
- if ( (!isset($_POST['transfer_from'])) || (!isset($_POST['transfer_to'])) || ($_POST['transfer_from'] == '') || ($_POST['transfer_to'] == '') )
- {
- $this->fv->errors['transfer'] = '';
- }
- if ( $_POST['transfer_from'] == $_POST['transfer_to'] )
- {
- $this->fv->errors['transfer'] = $user->lang['fv_difference_transfer'];
- }
-
- $this->transfer = array(
- 'from' => post_or_db('transfer_from'),
- 'to' => post_or_db('transfer_to')
- );
-
- return $this->fv->is_error();
- }
-
- // ---------------------------------------------------------
- // Process transfer
- // ---------------------------------------------------------
- function process_transfer()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID;
-
- // Dev note: At some point, I'd like to make this more configurable
- // ie, They can select what (raid, item, adjustment) they want to transfer
- // and maybe even select specific raids/items/adjustments - not now though
-
- $member_from = $_POST['transfer_from'];
- $member_to = $_POST['transfer_to'];
-
- // Transfer raids
- $raidcount_addon = 0; // So we know their new raidcount
- $sql = 'SELECT raid_id, member_name
- FROM ' . RAID_ATTENDEES_TABLE . "
- WHERE member_name='".$member_from."'";
- $result = $db->query($sql);
- while ( $row = $db->fetch_record($result) )
- {
- // Check if the TO attended the same raid
- $sql = 'SELECT member_name
- FROM ' . RAID_ATTENDEES_TABLE . "
- WHERE raid_id='".$row['raid_id']."'
- AND member_name='".$member_to."'";
-
- // If they didn't, replace the FROM with the TWO
- if ( $db->num_rows($db->query($sql)) == 0 )
- {
- $sql = 'UPDATE ' . RAID_ATTENDEES_TABLE . "
- SET member_name='".$member_to."'
- WHERE raid_id='".$row['raid_id']."'
- AND member_name='".$member_from."'";
- $db->query($sql);
- $raidcount_addon++;
- }
- }
-
- // Find their new earned
- $sql = 'SELECT sum(r.raid_value)
- FROM ' . RAIDS_TABLE . ' r, ' . RAID_ATTENDEES_TABLE . " ra
- WHERE (ra.raid_id = r.raid_id) AND (ra.member_name='".$member_to."')";
- $earned = $db->query_first($sql);
-
- // Transfer Items
- $sql = 'UPDATE ' . ITEMS_TABLE . "
- SET item_buyer='".$member_to."'
- WHERE item_buyer='".$member_from."'";
- $db->query($sql);
-
- // Find their new spent
- $sql = 'SELECT sum(item_value)
- FROM ' . ITEMS_TABLE . "
- WHERE item_buyer='".$member_to."'";
- $spent = $db->query_first($sql);
-
- // Transfer adjustments
- $sql = 'UPDATE ' . ADJUSTMENTS_TABLE . "
- SET member_name='".$member_to."'
- WHERE member_name='".$member_from."'";
- $db->query($sql);
-
- // Find the new total adjustment
- // We're doing this two ways
- // 1: Individual adjustments get lumped into the total no matter what
- // 2: Group adjustments are added if their first raid was (they were added)
- // on or before the adjustment date
- $sql = 'SELECT sum(adjustment_value)
- FROM ' . ADJUSTMENTS_TABLE . "
- WHERE member_name='".$member_to."'";
- $total_iadj = $db->query_first($sql);
-
- $sql = 'SELECT sum(a.adjustment_value)
- FROM ( ' . ADJUSTMENTS_TABLE . ' a
- LEFT JOIN ' . MEMBERS_TABLE . " m
- ON m.member_firstraid <= a.adjustment_date )
- WHERE m.member_name='".$member_to."'
- AND a.member_name IS NULL";
- $total_gadj = $db->query_first($sql);
-
- $adjustment = ($total_gadj + $total_iadj);
- $adjustment = ( !empty($adjustment) ) ? $adjustment : '0.00';
-
- // Update the member_to
- $sql = 'UPDATE ' . MEMBERS_TABLE . "
- SET member_earned='".$earned."',
- member_spent='".$spent."',
- member_adjustment='".$adjustment."',
- member_raidcount = member_raidcount+".$raidcount_addon."
- WHERE member_name='".$member_to."'";
- $db->query($sql);
-
- // Delete the member_from
- $sql = 'DELETE FROM ' . MEMBERS_TABLE . "
- WHERE member_name='".$member_from."'";
- $db->query($sql);
-
- // Delete any remaining raids that the FROM attended
- $sql = 'DELETE FROM ' . RAID_ATTENDEES_TABLE . "
- WHERE member_name='".$member_from."'";
- $db->query($sql);
-
- //
- // Logging
- //
- $log_action = array(
- 'header' => '{L_ACTION_HISTORY_TRANSFER}',
- '{L_FROM}' => $member_from,
- '{L_TO}' => $member_to);
- $this->log_insert(array(
- 'log_type' => $log_action['header'],
- 'log_action' => $log_action)
- );
-
- //
- // Success message
- //
- $success_message = sprintf($user->lang['admin_transfer_history_success'], $member_from, $member_to);
- $this->admin_die($success_message);
- }
-
- // ---------------------------------------------------------
- // Display form
- // ---------------------------------------------------------
- function display_form()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID;
-
- //
- // Generate to/from drop-downs
- //
- $sql = 'SELECT member_name
- FROM ' . MEMBERS_TABLE . '
- ORDER BY member_name';
- $result = $db->query($sql);
- while ( $row = $db->fetch_record($result) )
- {
- $tpl->assign_block_vars('transfer_from_row', array(
- 'VALUE' => $row['member_name'],
- 'SELECTED' => ( $this->transfer['from'] == $row['member_name'] ) ? ' selected="selected"' : '',
- 'OPTION' => $row['member_name'])
- );
-
- $tpl->assign_block_vars('transfer_to_row', array(
- 'VALUE' => $row['member_name'],
- 'SELECTED' => ( $this->transfer['to'] == $row['member_name'] ) ? ' selected="selected"' : '',
- 'OPTION' => $row['member_name'])
- );
- }
-
- $tpl->assign_vars(array(
- // Form vars
- 'F_TRANSFER' => 'manage_members.php' . $SID . '&amp;mode=transfer',
-
- // Language
- 'L_TRANSFER_MEMBER_HISTORY' => $user->lang['transfer_member_history'],
- 'L_TRANSFER_MEMBER_HISTORY_DESCRIPTION' => $user->lang['transfer_member_history_description'],
- 'L_FROM' => $user->lang['from'],
- 'L_TO' => $user->lang['to'],
- 'L_SELECT_1_OF_X_MEMBERS' => sprintf($user->lang['select_1ofx_members'], $db->num_rows($result)),
- 'L_TRANSFER_HISTORY' => $user->lang['transfer_history'],
-
- // Form validation
- 'FV_TRANSFER' => $this->fv->generate_error('transfer'))
- );
- $db->free_result($result);
-
- $eqdkp->set_vars(array(
- 'page_title' => sprintf($user->lang['admin_title_prefix'], $eqdkp->config['guildtag'], $eqdkp->config['dkp_name']).': '.$user->lang['manage_members_title'],
- 'template_file' => 'admin/mm_transfer.html',
- 'display' => true)
- );
- }
-}
-?> \ No newline at end of file
diff --git a/old/admin/mysql_info.php b/old/admin/mysql_info.php
deleted file mode 100644
index 7993cc0..0000000
--- a/old/admin/mysql_info.php
+++ /dev/null
@@ -1,131 +0,0 @@
-<?php
-/******************************
- * EQdkp
- * Copyright 2002-2003
- * Licensed under the GNU GPL. See COPYING for full terms.
- * ------------------
- * mysql_info.php
- * Began: Sat April 5 2003
- *
- * $Id: mysql_info.php 46 2007-06-19 07:29:11Z tsigo $
- *
- ******************************/
-
-define('EQDKP_INC', true);
-define('IN_ADMIN', true);
-$eqdkp_root_path = './../';
-include_once($eqdkp_root_path . 'common.php');
-
-class MySQL_Info extends EQdkp_Admin
-{
- var $mysql_version = '';
- var $table_size = 0;
- var $index_size = 0;
- var $num_tables = 0;
-
- function mysql_info()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID;
-
- parent::eqdkp_admin();
-
- $this->assoc_buttons(array(
- 'form' => array(
- 'name' => '',
- 'process' => 'display_form',
- 'check' => 'a_'))
- );
-
- $result = $db->query('SELECT VERSION() AS mysql_version');
- if ( $row = $db->fetch_record($result) )
- {
- $this->mysql_version = $row['mysql_version'];
- }
- }
-
- // ---------------------------------------------------------
- // Display form
- // ---------------------------------------------------------
- function display_form()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID, $dbname, $table_prefix;
-
- if ( preg_match('/^(3\.23|4\.)/', $this->mysql_version) )
- {
- $db_name = ( preg_match('/^(3\.23\.[6-9])|(3\.23\.[1-9][1-9])|(4\.)/', $this->mysql_version) ) ? "`$dbname`" : $dbname;
-
- // Get table status
- $sql = 'SHOW TABLE STATUS
- FROM ' . $db_name;
- $result = $db->query($sql);
-
- $dbsize = 0;
- while ( $row = $db->fetch_record($result) )
- {
- if ( $row['Type'] != 'MRG_MyISAM' )
- {
- if ( $table_prefix != '' )
- {
- // Current row is an EQdkp table, get info for it
- if ( strstr($row['Name'], $table_prefix) )
- {
- $tpl->assign_block_vars('table_row', array(
- 'ROW_CLASS' => $eqdkp->switch_row_class(),
- 'TABLE_NAME' => $row['Name'],
- 'ROWS' => number_format($row['Rows'], ','),
- 'TABLE_SIZE' => $this->db_size($row['Data_length']),
- 'INDEX_SIZE' => $this->db_size($row['Index_length']))
- );
-
- $this->num_tables++;
- $this->table_size += $row['Data_length'];
- $this->index_size += $row['Index_length'];
- } // name match
- } // table_prefix != ''
- } // type != MRG_MyISAM
- } // while
-
- $tpl->assign_vars(array(
- 'NUM_TABLES' => sprintf($user->lang['num_tables'], $this->num_tables),
- 'TOTAL_TABLE_SIZE' => $this->db_size($this->table_size),
- 'TOTAL_INDEX_SIZE' => $this->db_size($this->index_size),
- 'TOTAL_SIZE' => $this->db_size($this->table_size + $this->index_size),
-
- 'L_EQDKP_TABLES' => $user->lang['eqdkp_tables'],
- 'L_TABLE_NAME' => $user->lang['table_name'],
- 'L_ROWS' => $user->lang['rows'],
- 'L_TABLE_SIZE' => $user->lang['table_size'],
- 'L_INDEX_SIZE' => $user->lang['index_size'],
- 'L_TOTALS' => $user->lang['totals'])
- );
-
- $eqdkp->set_vars(array(
- 'page_title' => 'MySQL Info',
- 'template_file' => 'admin/mysql_info.html',
- 'display' => true)
- );
- } // version match
- }
-
- function db_size($size)
- {
- if ( $size >= 1048576 )
- {
- return sprintf('%.2f MB', ($size / 1048576));
- }
- elseif ( $size >= 1024 )
- {
- return sprintf('%.2f KB', ($size / 1024));
- }
- else
- {
- return sprintf('%.2f B', $size);
- }
- }
-}
-
-$info = new MySQL_Info;
-$info->process();
-?> \ No newline at end of file
diff --git a/old/admin/parse_Everquest.php b/old/admin/parse_Everquest.php
deleted file mode 100644
index 5d9e1ac..0000000
--- a/old/admin/parse_Everquest.php
+++ /dev/null
@@ -1,587 +0,0 @@
-<?php
-/******************************
- * EQdkp
- * Copyright 2002-2003
- * Licensed under the GNU GPL. See COPYING for full terms.
- * ------------------
- * parse_Everquest.php
- * Began: Sat March 05 2005
- *
- * $Id: parse_Everquest.php 46 2007-06-19 07:29:11Z tsigo $
- *
- ******************************/
-
-define('EQDKP_INC', true);
-define('IN_ADMIN', true);
-$eqdkp_root_path = './../';
-include_once($eqdkp_root_path . 'common.php');
-
-class Parse_Log extends EQdkp_Admin
-{
- function parse_log()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID;
-
- parent::eqdkp_admin();
-
- $this->assoc_buttons(array(
- 'parse' => array(
- 'name' => 'parse',
- 'process' => 'process_parse',
- 'check' => 'a_raid_'),
- 'form' => array(
- 'name' => '',
- 'process' => 'display_form',
- 'check' => 'a_raid_'))
- );
- }
-
- // ---------------------------------------------------------
- // Process Parse
- // ---------------------------------------------------------
- function process_parse()
- {
-
-
- /* New EQ format for /who
-
-[Fri Apr 29 20:45:08 2005] Logging to 'eqlog.txt' is now *ON*.
-[Fri Apr 29 20:45:09 2005] Players on EverQuest:
-[Fri Apr 29 20:45:09 2005] ---------------------------
-[Fri Apr 29 20:45:09 2005] [63 Warlock (Necromancer)] Volac (Dark Elf) <Storm Rider Rebellion>
-[Fri Apr 29 20:45:09 2005] [66 Maestro (Bard)] Willowwhisper (Wood Elf) <Storm Rider Rebellion>
-[Fri Apr 29 20:45:09 2005] [ANONYMOUS] Premus <Storm Rider Rebellion>
-[Fri Apr 29 20:45:09 2005] [65 Storm Warden (Druid)] Whispering (Wood Elf) <Storm Rider Rebellion>
-[Fri Apr 29 20:45:09 2005] [65 Prophet (Shaman)] Cuzak (Troll) <Storm Rider Rebellion>
-[Fri Apr 29 20:45:09 2005] [64 Virtuoso (Bard)] Case (Half Elf) <Storm Rider Rebellion>
-[Fri Apr 29 20:45:09 2005] [ANONYMOUS] Aspenelder <Storm Rider Rebellion>
-[Fri Apr 29 20:45:09 2005] [67 Forest Stalker (Ranger)] Hatteras (Wood Elf) <Storm Rider Rebellion>
-[Fri Apr 29 20:45:09 2005] [67 Archon (Cleric)] Kelee (High Elf) <Storm Rider Rebellion>
-[Fri Apr 29 20:45:09 2005] [66 Storm Warden (Druid)] Branson (Wood Elf) <Storm Rider Rebellion>
-[Fri Apr 29 20:45:09 2005] [66 Overlord (Warrior)] Damilex (Human) <Storm Rider Rebellion>
-[Fri Apr 29 20:45:09 2005] [66 Lord Protector (Paladin)] Hafgun (Human) <Storm Rider Rebellion>
-[Fri Apr 29 20:45:09 2005] [54 Primalist (Beastlord)] Sistakitty (Vah Shir) <Storm Rider Rebellion>
-[Fri Apr 29 20:45:09 2005] [66 Arch Convoker (Magician)] Torgen (High Elf) <Storm Rider Rebellion>
-[Fri Apr 29 20:45:09 2005] [63 Phantasmist (Enchanter)] Merlinycus (Erudite) <Aurora Spirits>
-[Fri Apr 29 20:45:09 2005] [66 Forest Stalker (Ranger)] Xlifex (Wood Elf) <Storm Rider Rebellion>
-[Fri Apr 29 20:45:09 2005] [ANONYMOUS] Misser <Storm Rider Rebellion>
-[Fri Apr 29 20:45:09 2005] [70 Scourge Knight (Shadow Knight)] Grosbras (Ogre) <Shadows of Doom>
-[Fri Apr 29 20:45:09 2005] [70 Herald (Bard)] Anjagi (Fire Elemental) <Guild>
-
-
-*/
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID;
-
- $usable_date = "/([a-zA-Z]{3}) ([a-zA-Z]{3}) ([0-9]{2}) ([0-9]{2})\:([0-9]{2})\:([0-9]{2}) ([0-9]{4})/";
-
- $channel_members = '';
- $line = '';
- $valid_date_found = false;
-
- $log_file = explode("\n", $_POST['log']);
- $log_file = str_replace('&lt;', '<', str_replace('&gt;', '>', $log_file));
- $log_file = str_replace('Shadow Knight', 'Shadow_Knight', $log_file);
- $line_count = sizeof($log_file);
-
- // Go through each line and
- // - Check for/get a valid member in the /who
- // - Check if there's a valid date we can use
- // - Check for/get valid members from /list <channel>
-
- $log_date = array();
- session_start(); // Hold our array of name => class/level/race
- for ( $i = 0; $i < $line_count; $i++ )
- {
- $line = '';
- if ( (isset($_POST['findall'])) || (strpos($log_file[$i], '<')) )
- {
- $member_name = $this->line_parse($log_file[$i]);
-
- // Make sure that each member's name is properly capitalized
- $mname = strtolower(preg_replace('/[[:space:]]/i', ' ', $member_name));
- $member_name = ucwords($mname);
-
- if ( trim($member_name) != '')
- {
- $member_names[] = $member_name;
- }
- }
-
- // Check if there's a usable date/time in this string
- if ( preg_match( $usable_date , $log_file[$i], $pre_log_date) )
- {
- if ( isset($pre_log_date[0]) )
- {
- $log_date = $pre_log_date;
- }
- $valid_date_found = true;
- }
-
- // Check if the log contains channel information we can use
- if (preg_match("/Channel (.+)\(([0-9]{1,5})\) members\:/", $log_file[$i], $num_members))
- {
- $first_chan_line = ($i+1);
- $channel_lines = (($num_members[2] % 10) == 0) ? $num_members[2] / 10 : floor($num_members[2] / 10) + 1;
- $last_chan_line = ($i + $channel_lines + 1);
- for ( $j = $first_chan_line; $j < $last_chan_line; $j++ )
- {
- $line = preg_replace("/\[[A-Za-z]{3} [A-Za-z]{3} [0-9]{2} [0-9]{2}\:[0-9]{2}\:[0-9]{2} [0-9]{4}\]/", '', $log_file[$j]);
- $line = preg_replace("/[^A-Za-z\,[:space:]]/", '', $line);
- if ($j != $channel_lines)
- {
- $line = str_replace("\n", ', ', $line);
- }
- $channel_members .= $line;
- }
- }
-
- if (isset ($log_file[$i]) ) {
- $line_to_read = str_replace("\t", ' ', $log_file[$i]);
- }
-
- if (preg_match("/^[0-9]{1,2} (.+) ([0-9]{1,2}) ([a-z A-Z]+)/", $line_to_read, $raid_line))
- {
- $memberName = $raid_line[1];
- $memberLevel = $raid_line[2];
- $memberClass = $raid_line[3];
- $line = preg_replace("/ Group Leader/", '', $memberClass);
- $line = preg_replace("/ Raid Leader/", '', $line);
- $memberClass = $line;
-
- if ( $memberClass == 'Shadow' ) {
- $memberClass = 'Shadow Knight';
- }
-
- if ( !($this->original_class($memberClass) == "")) {
- $memberClass = $this->original_class($memberClass);
- }
-
- $_SESSION[$memberName] = array(
- 'name' => $memberName,
- 'race' => 'Unknown',
- 'level' => $memberLevel,
- 'class' => $memberClass,
- );
-
- // add member's name to the array
- $member_names[] = $memberName;
-
-
- }
-
-
- } // for ... log_file
-
-
- // If there were channel members, join the two arrays
- if ( !empty($channel_members) )
- {
- $channel_members = explode(', ', $channel_members);
- $member_names = array_merge($member_names, $channel_members);
- }
-
- if ( $valid_date_found )
- {
- $date['mo'] = $log_date[2];
- $date['d'] = $log_date[3];
- $date['y'] = $log_date[7];
- $date['h'] = $log_date[4];
- $date['mi'] = $log_date[5];
- $date['s'] = $log_date[6];
- }
- else
- {
- $date['mo'] = date('M');
- $date['d'] = date('d');
- $date['y'] = date('Y');
- $date['h'] = date('h');
- $date['mi'] = date('i');
- $date['s'] = date('s');
- }
-
- // Process the member_names array: replaces spaces, make it unique, sort it and reset it
- if ( (isset($member_names)) && (is_array($member_names)) )
- {
- $name_count = sizeof($member_names);
- }
- else
- {
- $name_count = 0;
- $member_names = array();
- }
-
- for ( $i = 0; $i < $name_count; $i++ )
- {
- $member_names[$i] = str_replace(' ', '', $member_names[$i]);
- }
- $member_names = array_unique($member_names);
- sort($member_names);
- reset($member_names);
-
- $tpl->assign_vars(array(
- 'S_STEP1' => false,
- 'L_FOUND_MEMBERS' => sprintf($user->lang['found_members'], $line_count, sizeof($member_names)),
- 'L_LOG_DATE_TIME' => $user->lang['log_date_time'],
- 'L_LOG_ADD_DATA' => $user->lang['log_add_data'],
-
- 'FOUND_MEMBERS' => implode("\n", $member_names),
- 'MO' => $this->M_to_n($date['mo']),
- 'D' => $date['d'],
- 'Y' => $date['y'],
- 'H' => $date['h'],
- 'MI' => $date['mi'],
- 'S' => $date['s'])
- );
-
- $eqdkp->set_vars(array(
- 'page_title' => sprintf($user->lang['title_prefix'], $eqdkp->config['guildtag'], $eqdkp->config['dkp_name']).': '.$user->lang['parselog_title'],
- 'gen_simple_header' => true,
- 'template_file' => 'admin/parse_Everquest.html',
- 'display' => true)
- );
- }
-
- // ---------------------------------------------------------
- // Process helper methods
- // ---------------------------------------------------------
- function line_parse($log_line)
- {
- global $db, $eqdkp, $user;
- static $member_ranks = array();
-
- $log_line = stripslashes($log_line);
-
- // Build a clean array of guildtags we might be looking for
- $parsetags = explode("\n", $eqdkp->config['parsetags']);
- foreach ( $parsetags as $k => $v )
- {
- $parsetags[$k] = trim(stripslashes($v));
- }
-
- // Cache the member name / member rank info
- if ( @sizeof($member_ranks) == 0 )
- {
- $sql = 'SELECT r.rank_name, m.member_name
- FROM ' . MEMBER_RANKS_TABLE . ' r, ' . MEMBERS_TABLE . ' m
- WHERE (r.rank_id = m.member_rank_id)
- ORDER BY m.member_name';
- $result = $db->query($sql);
- while ( $row = $db->fetch_record($result) )
- {
- $member_ranks[ $row['member_name'] ] = 'r_' . str_replace(' ', '_', trim($row['rank_name']));
- }
- $db->free_result($result);
- }
-
- $name_check = false;
- $role_check = true;
- $rank_check = true;
-
- /* New EQ /who format
-[Fri Apr 29 20:45:08 2005] Logging to 'eqlog.txt' is now *ON*.
-[Fri Apr 29 20:45:09 2005] Players on EverQuest:
-[Fri Apr 29 20:45:09 2005] ---------------------------
-[Fri Apr 29 20:45:09 2005] [63 Warlock (Necromancer)] Volac (Dark Elf) <Storm Rider Rebellion>
-[Fri Apr 29 20:45:09 2005] [66 Maestro (Bard)] Willowwhisper (Wood Elf) <Storm Rider Rebellion>
-[Fri Apr 29 20:45:09 2005] [ANONYMOUS] Premus <Storm Rider Rebellion>
-[Fri Apr 29 20:45:09 2005] [65 Storm Warden (Druid)] Whispering (Wood Elf) <Storm Rider Rebellion>
-[Fri Apr 29 20:45:09 2005] [65 Prophet (Shaman)] Cuzak (Troll) <Storm Rider Rebellion>
-[Fri Apr 29 20:45:09 2005] [64 Virtuoso (Bard)] Case (Half Elf) <Storm Rider Rebellion>
-[Fri Apr 29 20:45:09 2005] [ANONYMOUS] Aspenelder <Storm Rider Rebellion>
-[Fri Apr 29 20:45:09 2005] [67 Forest Stalker (Ranger)] Hatteras (Wood Elf) <Storm Rider Rebellion>
-[Fri Apr 29 20:45:09 2005] [67 Archon (Cleric)] Kelee (High Elf) <Storm Rider Rebellion>
-[Fri Apr 29 20:45:09 2005] [66 Storm Warden (Druid)] Branson (Wood Elf) <Storm Rider Rebellion>
-[Fri Apr 29 20:45:09 2005] [66 Overlord (Warrior)] Damilex (Human) <Storm Rider Rebellion>
-[Fri Apr 29 20:45:09 2005] [66 Lord Protector (Paladin)] Hafgun (Human) <Storm Rider Rebellion>
-[Fri Apr 29 20:45:09 2005] [54 Primalist (Beastlord)] Sistakitty (Vah Shir) <Storm Rider Rebellion>
-[Fri Apr 29 20:45:09 2005] [66 Arch Convoker (Magician)] Torgen (High Elf) <Storm Rider Rebellion>
-[Fri Apr 29 20:45:09 2005] [63 Phantasmist (Enchanter)] Merlinycus (Erudite) <Aurora Spirits>
-[Fri Apr 29 20:45:09 2005] [66 Forest Stalker (Ranger)] Xlifex (Wood Elf) <Storm Rider Rebellion>
-[Fri Apr 29 20:45:09 2005] [ANONYMOUS] Misser <Storm Rider Rebellion>
- */
-
- // Date
- $pattern = "/\[[a-zA-Z]{3} [a-zA-Z]{3} [0-9]{2} [0-9]{2}\:[0-9]{2}\:[0-9]{2} [0-9]{4}\]";
- // AFK
- $pattern .= ".*(AFK )?";
- // Level / Class (if findall or findrole is set, we can check for ANONYMOUS people, too)
- // $pattern .= ( (isset($_POST['findall'])) || (isset($_POST['findrole'])) ) ? "\[(ANONYMOUS|([0-9]{1,2})(.+))\]" : "\[([0-9]{1,2})(.+)\]";
- $pattern .= ( (isset($_POST['findall'])) || (isset($_POST['findrole'])) ) ? "\[(ANONYMOUS|([0-9]{1,2})(.+) (.+))\]" : "\[([0-9]{1,2})(.+) (.+)\]";
- // Name
- $pattern .= " ([A-Za-z]{1,})";
- // Race
- $pattern .= "( \(.*\))?";
- // Guild (ignored if we're finding EVERYONE in the log, regardless of tag)
- if ( !isset($_POST['findall']) )
- {
- $guildtag_sep = '';
- $pattern .= ".*\<(";
- foreach ( $parsetags as $guildtag )
- {
- if ( isset($_POST[str_replace(' ', '_', $guildtag)]) )
- {
- $pattern .= $guildtag_sep . $guildtag;
- $guildtag_sep = '|';
- }
- }
- $pattern .= ")\>";
- }
- $pattern .= '/';
-
- if ( preg_match($pattern, $log_line, $log_parsed) )
- {
- // 0 = full string
- // 1 = AFK?
- // 2 = ANONYMOUS | 'XX Class (archtype)'
- // 3 = Level
- // 4 = Class
- // 5 = (Archtype)
- // 6 = Name
- // 7 = (Race)
-
- $log_parsed[5] = str_replace('_', ' ', $log_parsed[5]);
- $name = trim($log_parsed[6]);
- $level = trim($log_parsed[3]);
- $class = trim($log_parsed[4]);
- $race = ( isset($log_parsed[7]) ) ? trim(str_replace(')', '', str_replace('(', '', $log_parsed[7]))) : '';
- $archtype = ( isset($log_parsed[5]) ) ? trim(str_replace(')', '', str_replace('(', '', $log_parsed[5]))) : '';
-
- if ( $archtype == 'Shadow' ) {
- $archtype = 'Shadow Knight';
- }
-
- if ( isset($log_parsed[2]) && ($log_parsed[2] == 'ANONYMOUS')) {
-
- $class = "Unknown";
- $archtype = "Unknown";
- $race = "Unknown";
- $level = '1';
-
- $log_parsed[2] = 'Unknown' ;
-
- }
-
-
- if ( !isset($_POST['findrole']) )
- {
- if ( (isset($log_parsed[2])) && ($log_parsed[2] == 'ANONYMOUS') )
- {
- $role_check = false;
- }
- }
-
- if ( (isset($log_parsed[6])) && ($log_parsed[6] != '') )
- {
- $name_check = true;
- }
-
- // Check if we're including this member's rank
- if ( isset($member_ranks[$name]) )
- {
- // If POST[r_<rank_name>] isn't set, we're ignoring this member
- if ( !isset($_POST[ $member_ranks[$name] ]) )
- {
- $rank_check = false;
- }
- }
-
- if ( ($name_check) && ($role_check) && ($rank_check) )
- {
- $_SESSION[$name] = array(
- 'name' => $name,
- 'level' => $level,
- 'class' => $archtype,
- 'race' => $race);
-
- return $log_parsed[6];
- }
- }
- return false;
- }
-
- function M_to_n($m)
- {
- switch($m)
- {
- case 'Jan':
- return '01';
- break;
- case 'Feb':
- return '02';
- break;
- case 'Mar':
- return '03';
- break;
- case 'Apr':
- return '04';
- break;
- case 'May':
- return '05';
- break;
- case 'Jun':
- return '06';
- break;
- case 'Jul':
- return '07';
- break;
- case 'Aug':
- return '08';
- break;
- case 'Sep':
- return '09';
- break;
- case 'Oct':
- return '10';
- break;
- case 'Nov':
- return '11';
- break;
- case 'Dec':
- return '12';
- break;
- }
- }
-
- function original_class($class)
- {
- $classes = array(
- 'Bard' => array('Bard','Minstrel','Troubadour','Virtuoso','Maestro'),
- 'Beastlord' => array('Beastlord','Primalist','Animist','Savage Lord','Feral Lord'),
- 'Berserker' => array('Berserker','Brawler','Vehement','Rager','Fury'),
- 'Cleric' => array('Cleric','Vicar','Templar','High Priest','Archon'),
- 'Druid' => array('Druid','Wanderer','Preserver','Hierophant','Storm Warden'),
- 'Enchanter' => array('Enchanter','Illusionist','Beguiler','Phantasmist','Coercer'),
- 'Magician' => array('Magician','Elementalist','Conjurer','Arch Mage','Arch Convoker'),
- 'Monk' => array('Monk','Disciple','Master','Grandmaster','Transcendent'),
- 'Necromancer' => array('Necromancer','Heretic','Defiler','Warlock','Arch Lich'),
- 'Paladin' => array('Paladin','Cavalier','Knight','Crusader','Lord Protector'),
- 'Ranger' => array('Ranger','Pathfinder','Outrider','Warder','Hunter','Forest Stalker'),
- 'Rogue' => array('Rogue','Rake','Blackguard','Assassin','Deceiver'),
- 'Shadow Knight' => array('Scourge Knight','Shadow Knight','Reaver','Revenant','Grave Lord','Dread Lord'),
- 'Shaman' => array('Shaman','Mystic','Luminary','Oracle','Prophet'),
- 'Warrior' => array('Warrior','Champion','Myrmidon','Warlord','Overlord'),
- 'Wizard' => array('Wizard','Channeler','Evoker','Sorcerer','Arcanist')
- );
-
- foreach ( $classes as $k => $v)
- {
- if ( in_array($class, $v) )
- {
- return $k;
- }
- }
-
- return false;
- }
-
- // ---------------------------------------------------------
- // Display form
- // ---------------------------------------------------------
- function display_form()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID;
-
- $log_columns = ( preg_match("/Mozilla\/4\.[1-9]{1}.+/", $_SERVER['HTTP_USER_AGENT']) ) ? '50' : '90';
-
- // Options to parse
- $options = array(
- 0 => array(
- 'CBNAME' => 'findall',
- 'CBVALUE' => '1',
- 'CBCHECKED' => '',
- 'OPTION' => $user->lang['log_find_all']),
- 1 => array(
- 'CBNAME' => 'findrole',
- 'CBVALUE' => '1',
- 'CBCHECKED' => ' checked="checked"',
- 'OPTION' => 'Include Roleplay')
- );
-
- // Guildtags to parse
- if ( !empty($eqdkp->config['parsetags']) )
- {
- $parsetags = explode("\n", $eqdkp->config['parsetags']);
- foreach ( $parsetags as $index => $guildtag )
- {
- $tagoptions[] = array(
- 'CBNAME' => str_replace(' ', '_', trim($guildtag)),
- 'CBVALUE' => '1',
- 'CBCHECKED' => ' checked="checked"',
- 'OPTION' => '&lt;' . trim($guildtag) . '&gt;');
- }
- $options = array_merge($options, $tagoptions);
- }
-
- foreach ( $options as $row )
- {
- $tpl->assign_block_vars('options_row', $row);
- }
-
- // Member tags to parse
- // Find out how many members have each rank
- $rank_counts = array();
- $sql = 'SELECT member_rank_id, count(member_rank_id) as count
- FROM ' . MEMBERS_TABLE . '
- GROUP BY member_rank_id';
- $result = $db->query($sql);
- while ( $row = $db->fetch_record($result) )
- {
- $rank_counts[ $row['member_rank_id'] ] = $row['count'];
- }
- $db->free_result($result);
-
- $ranks = array();
- $sql = 'SELECT rank_id, rank_name, rank_prefix, rank_suffix
- FROM ' . MEMBER_RANKS_TABLE . '
- ORDER BY rank_name';
- $result = $db->query($sql);
- while ( $row = $db->fetch_record($result) )
- {
- // Make sure there's not a guildtag with the same name as the rank
- if ( !in_array($row['rank_name'], $options) )
- {
- $rank_count = ( isset($rank_counts[ $row['rank_id'] ]) ) ? $rank_counts[ $row['rank_id'] ] : 0;
- $format = ( $rank_count == 1 ) ? $user->lang['x_members_s'] : $user->lang['x_members_p'];
-
- $ranks[] = array(
- 'CBNAME' => 'r_' . str_replace(' ', '_', trim($row['rank_name'])),
- 'CBVALUE' => intval($row['rank_id']),
- 'CBCHECKED' => ' checked="checked"',
- 'OPTION' => $user->lang['rank'] . ': ' . (( empty($row['rank_name']) ) ? '(None)' : $row['rank_prefix'] . $row['rank_name'] . $row['rank_suffix'])
- . ' <span class="small">(' . sprintf($format, $rank_count) . ')</span>');
- }
- }
- $db->free_result($result);
-
- foreach ( $ranks as $row )
- {
- $tpl->assign_block_vars('ranks_row', $row);
- }
-
- $tpl->assign_vars(array(
- 'F_PARSE_LOG' => 'parse_Everquest.php' . $SID,
-
- 'S_STEP1' => true,
- 'L_PASTE_LOG' => $user->lang['paste_log'],
- 'L_OPTIONS' => $user->lang['options'],
- 'L_PARSE_LOG' => $user->lang['parse_log'],
- 'L_CLOSE_WINDOW' => $user->lang['close_window'],
-
- 'LOG_COLS' => $log_columns)
- );
-
- $eqdkp->set_vars(array(
- 'page_title' => sprintf($user->lang['title_prefix'], $eqdkp->config['guildtag'], $eqdkp->config['dkp_name']).': '.$user->lang['parselog_title'],
- 'gen_simple_header' => true,
- 'template_file' => 'admin/parse_Everquest.html',
- 'display' => true)
- );
- }
-}
-
-$parse_log = new Parse_Log;
-$parse_log->process();
-?>
diff --git a/old/admin/parse_Everquest2-german.php b/old/admin/parse_Everquest2-german.php
deleted file mode 100644
index 3b554f7..0000000
--- a/old/admin/parse_Everquest2-german.php
+++ /dev/null
@@ -1,515 +0,0 @@
-<?php
-/******************************
- * EQdkp
- * Copyright 2002-2003
- * Licensed under the GNU GPL. See COPYING for full terms.
- * ------------------
- * parse_Everquest2.php
- * Began: Tue December 24 2002
- *
- * $Id: parse_Everquest2-german.php 46 2007-06-19 07:29:11Z tsigo $
- *
- ******************************/
-
-define('EQDKP_INC', true);
-define('IN_ADMIN', true);
-$eqdkp_root_path = './../';
-include_once($eqdkp_root_path . 'common.php');
-
-class Parse_Log extends EQdkp_Admin
-{
- function parse_log()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID;
-
- parent::eqdkp_admin();
-
- $this->assoc_buttons(array(
- 'parse' => array(
- 'name' => 'parse',
- 'process' => 'process_parse',
- 'check' => 'a_raid_'),
- 'form' => array(
- 'name' => '',
- 'process' => 'display_form',
- 'check' => 'a_raid_'))
- );
- }
-
- // ---------------------------------------------------------
- // Process Parse
- // ---------------------------------------------------------
- function process_parse()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID;
-
- $channel_members = '';
- $line = '';
- $valid_date_found = false;
-
- $log_file = explode("\n", $_POST['log']);
- $log_file = str_replace('&lt;', '<', str_replace('&gt;', '>', $log_file));
- $line_count = sizeof($log_file);
-
- // Go through each line and
- // - Check for/get a valid member in the /who
- // - Check if there's a valid date we can use
- // - Check for/get valid members from /list <channel>
- $log_date = array();
- session_start(); // Hold our array of name => class/level/race
- for ( $i = 0; $i < $line_count; $i++ )
- {
- $line = '';
- if ( (isset($_POST['findall'])) || (strpos($log_file[$i], '<')) )
- {
- $member_name = $this->line_parse($log_file[$i]);
-
- // Make sure that each member's name is properly capitalized
- $mname = strtolower(preg_replace('/[[:space:]]/i', ' ', $member_name));
- $member_name = ucwords($mname);
-
- if ( trim($member_name) != '')
- {
- $member_names[] = $member_name;
- }
- }
-
- } // for ... log_file
-
- // If there were channel members, join the two arrays
- if ( !empty($channel_members) )
- {
- $channel_members = explode(', ', $channel_members);
- $member_names = array_merge($member_names, $channel_members);
- }
-
- $date['mo'] = date('M');
- $date['d'] = date('d');
- $date['y'] = date('Y');
- $date['h'] = date('h');
- $date['mi'] = date('i');
- $date['s'] = date('s');
-
- // Process the member_names array: replaces spaces, make it unique, sort it and reset it
- if ( (isset($member_names)) && (is_array($member_names)) )
- {
- $name_count = sizeof($member_names);
- }
- else
- {
- $name_count = 0;
- $member_names = array();
- }
-
- for ( $i = 0; $i < $name_count; $i++ )
- {
- $member_names[$i] = str_replace(' ', '', $member_names[$i]);
- }
- $member_names = array_unique($member_names);
- sort($member_names);
- reset($member_names);
-
- $tpl->assign_vars(array(
- 'S_STEP1' => false,
- 'L_FOUND_MEMBERS' => sprintf($user->lang['found_members'], $line_count, sizeof($member_names)),
- 'L_LOG_DATE_TIME' => $user->lang['log_date_time'],
- 'L_LOG_ADD_DATA' => $user->lang['log_add_data'],
-
- 'FOUND_MEMBERS' => implode("\n", $member_names),
- 'MO' => $this->M_to_n($date['mo']),
- 'D' => $date['d'],
- 'Y' => $date['y'],
- 'H' => $date['h'],
- 'MI' => $date['mi'],
- 'S' => $date['s'])
- );
-
- $eqdkp->set_vars(array(
- 'page_title' => sprintf($user->lang['title_prefix'], $eqdkp->config['guildtag'], $eqdkp->config['dkp_name']).': '.$user->lang['parselog_title'],
- 'gen_simple_header' => true,
- 'template_file' => 'admin/parse_Everquest2.html',
- 'display' => true)
- );
- }
-
- // ---------------------------------------------------------
- // Process helper methods
- // ---------------------------------------------------------
- function line_parse($log_line)
- {
- global $db, $eqdkp, $user;
- static $member_ranks = array();
-
- //$log_line = stripslashes($log_line);
-
- // First off, we don't care about afk or lfg, so remove them
- $log_line = str_replace(' (AFK)', '', $log_line);
- $log_line = str_replace(' (LFG)', '', $log_line);
-
- // Build a clean array of guildtags we might be looking for
- $parsetags = explode("\n", $eqdkp->config['parsetags']);
- foreach ( $parsetags as $k => $v )
- {
- $parsetags[$k] = trim(stripslashes($v));
- }
-
- // Cache the member name / member rank info
- if ( @sizeof($member_ranks) == 0 )
- {
- $sql = 'SELECT r.rank_name, m.member_name
- FROM ' . MEMBER_RANKS_TABLE . ' r, ' . MEMBERS_TABLE . ' m
- WHERE (r.rank_id = m.member_rank_id)
- ORDER BY m.member_name';
- $result = $db->query($sql);
- while ( $row = $db->fetch_record($result) )
- {
- $member_ranks[ $row['member_name'] ] = 'r_' . str_replace(' ', '_', trim($row['rank_name']));
- }
- $db->free_result($result);
- }
-
- $name_check = false;
- $role_check = true;
- $rank_check = true;
-
-/* Sample EQ2 log file format :: the three patterns to match are:
-
-#1 guilded normal
-#2 non-guilded normal
-#3 role (guilded; unguilded matches like /anon)
-#4 anon (guilded or not)
-
- (neither anon or role shows zone FYI)
-
-
-(1121902422)[Wed Jul 20 19:33:42 2005] [43 Guardian] Goosage (Barbarian) <The Knights of Dawn Fire> Zone: The Feerrott
-(1121902422)[Wed Jul 20 19:33:42 2005] [47 Paladin] Maskie (Barbarian) Zone: The Feerrott
-(1121907805)[Wed Jul 20 21:03:25 2005] [Anonymous] Mildew (Gnome) <The Knights of Dawn Fire>
-(1121907951)[Wed Jul 20 21:05:51 2005] [Anonymous] Greywind (Human)
-
-
-German log file looks like this :
-(1122498819)[Wed Jul 27 23:13:39 2005] [50 Inquisitor] Chryorn (Dunkelelf) <Feral Fires>ZONE: Shattered Stillness: Epic
-(1122498819)[Wed Jul 27 23:13:39 2005] [50 Brigand] Xandros (Dunkelelf) <Feral Fires>ZONE: Shattered Stillness: Epic
-(1122498819)[Wed Jul 27 23:13:39 2005] [50 Wächter] Achilless (Barbar) <Feral Fires>ZONE: Shattered Stillness: Epic
-
-*/
-
- // Date
- $pattern = "/^\([0-9]{10}\)\[[a-zA-Z]{3} [a-zA-Z]{3} [0-9]{2} [0-9]{2}\:[0-9]{2}\:[0-9]{2} [0-9]{4}\](.*)";
- $pattern1 = "/^\([0-9]{10}\)\[[a-zA-Z]{3} [a-zA-Z]{3} [0-9]{2} [0-9]{2}\:[0-9]{2}\:[0-9]{2} [0-9]{4}\](.*)";
- $pattern2 = "/^\([0-9]{10}\)\[[a-zA-Z]{3} [a-zA-Z]{3} [0-9]{2} [0-9]{2}\:[0-9]{2}\:[0-9]{2} [0-9]{4}\](.*)";
- $pattern3 = "/^\([0-9]{10}\)\[[a-zA-Z]{3} [a-zA-Z]{3} [0-9]{2} [0-9]{2}\:[0-9]{2}\:[0-9]{2} [0-9]{4}\](.*)";
-
- // Level / Class
- $pattern .= "\[([0-9]{1,2}) (.+)\]";
- $pattern1 .= "\[([0-9]{1,2}) (.+)\]";
- $pattern2 .= "\[Anonymous\]";
- $pattern3 .= "\[Anonymous\]";
-
- // Name
- $pattern .= " ([A-Za-z]{1,})";
- $pattern1 .= " ([A-Za-z]{1,})";
- $pattern2 .= " ([A-Za-z]{1,})";
- $pattern3 .= " ([A-Za-z]{1,})";
-
- // Race
- $pattern .= " \((.*)\)";
- $pattern1 .= " \((.*)\)";
- $pattern2 .= " \((.*)\)";
- $pattern3 .= " \((.*)\)";
-
- // Guild Tag
- $pattern .= " \<(.*)\>";
- $pattern2 .= " \<(.*)\>";
-
- // Zone:
- $pattern .= "ZONE: (.*)";
- $pattern1 .= "ZONE: (.*)";
-
- // End pattern regexp
- $pattern .= '/';
- $pattern1 .= '/';
- $pattern2 .= '/';
- $pattern3 .= '/';
-
-
- // unset a line match type identifier
- unset($type_line);
-
- // match things the hard way..one type of line at a time
- // crappy way to do it, but VERY easy to read and alter
-
- // Normal
- if ( preg_match($pattern, $log_line, $log_parsed) ) {
- $name = trim($log_parsed[4]);
- $race = trim($log_parsed[5]);
- $class = trim($log_parsed[3]);
- $level = trim($log_parsed[2]);
- $guildtag = trim($log_parsed[6]);
- $zone = trim($log_parsed[7]);
- $type_line = 1;
- }
-
- // Unguilded
- if ( preg_match($pattern1, $log_line, $log_parsed) ) {
- $name = trim($log_parsed[4]);
- $race = trim($log_parsed[5]);
- $class = trim($log_parsed[3]);
- $level = trim($log_parsed[2]);
- $guildtag = "";
- $zone = trim($log_parsed[6]);
- if (!isset($type_line) ){ $type_line = 2;}
- }
-
- // Roleplaying
- if ( preg_match($pattern2, $log_line, $log_parsed) ) {
- $name = trim($log_parsed[2]);
- $race = trim($log_parsed[3]);
- $class = "Unknown";
- $level = "50";
- $guildtag = trim($log_parsed[4]);
- $zone = "";
- if (!isset($type_line) ){ $type_line = 3;}
- }
-
- // Anon
- if ( preg_match($pattern3, $log_line, $log_parsed) ) {
- $name = trim($log_parsed[2]);
- $race = trim($log_parsed[3]);
- $class = "Unknown";
- $level = "50";
- $guildtag = "";
- $zone = "";
- if (!isset($type_line) ){ $type_line = 4;}
- }
-
-
- // Jeezus this is a pain in the ass, ain't it?
-
- /* Sample EQ2 log file format :: the three patterns to match are (one more time)
-
-(1121902422)[Wed Jul 20 19:33:42 2005] [43 Guardian] Goosage (Barbarian) <The Knights of Dawn Fire> Zone: The Feerrott
-(1121902422)[Wed Jul 20 19:33:42 2005] [47 Paladin] Maskie (Barbarian) Zone: The Feerrott
-(1121907805)[Wed Jul 20 21:03:25 2005] [Anonymous] Mildew (Gnome) <The Knights of Dawn Fire>
-(1121907951)[Wed Jul 20 21:05:51 2005] [Anonymous] Greywind (Human)
-
-After using the above 4, we now test with the same members in different states of anon/role/guilded
-
-(1121902422)[Wed Jul 20 19:33:42 2005] [Anonymous] Goosage (Barbarian)
-(1121902422)[Wed Jul 20 19:33:42 2005] [Anonymous] Maskie (Barbarian) <The Knights of Dawn Fire
-(1121907805)[Wed Jul 20 21:03:25 2005] [47 Cleric] Mildew (Gnome) <The Knights of Dawn Fire> Zone: The Feerrott
-(1121907951)[Wed Jul 20 21:05:51 2005] [49 Monk] Greywind (Human) Zone: The Feerrott
-
- */
-
-
- if ($type_line == 1) {
- print"Name: $name , Race: $race , Class: $class , Guild: $guildtag , Level: $level , Zone: $zone<br>";
- }
-
- if ($type_line == 2) {
- print"Name: $name , Race: $race , Class: $class , Level: $level , Zone: $zone<br>";
- }
-
- if ($type_line == 3) {
- print"Name: $name , Race: $race , Class_Guess: $class , Level_Guess: $level , Guild: $guildtag<br>";
- }
-
- if ($type_line == 4) {
- print"Name: $name , Race: $race , Class_Guess: $class , Level_Guess: $level<br>";
- }
-
-
- // Looking for roleplaying folks? Is this valid for EQ2?
- if ( !isset($_POST['findrole']) )
- {
- if ( (isset($class)) && ($class == 'Unknown') )
- {
- $role_check = false;
- }
- }
-
- if ( (isset($name)) && ($name != '') )
- {
- $name_check = true;
- }
-
- // Check if we're including this member's rank
- if ( isset($member_ranks[$name]) )
- {
- // If POST[r_<rank_name>] isn't set, we're ignoring this member
- if ( !isset($_POST[ $member_ranks[$name] ]) )
- {
- $rank_check = false;
- }
- }
-
- if ( ($name_check) && ($role_check) && ($rank_check) )
- {
- $_SESSION[$name] = array(
- 'tag' => $guildtag,
- 'name' => $name,
- 'level' => $level,
- 'class' => $class,
- 'race' => $race);
-
- return $name;
- }
- return false;
- }
-
- function M_to_n($m)
- {
- switch($m)
- {
- case 'Jan':
- return '01';
- break;
- case 'Feb':
- return '02';
- break;
- case 'Mar':
- return '03';
- break;
- case 'Apr':
- return '04';
- break;
- case 'May':
- return '05';
- break;
- case 'Jun':
- return '06';
- break;
- case 'Jul':
- return '07';
- break;
- case 'Aug':
- return '08';
- break;
- case 'Sep':
- return '09';
- break;
- case 'Oct':
- return '10';
- break;
- case 'Nov':
- return '11';
- break;
- case 'Dec':
- return '12';
- break;
- }
- }
-
- // ---------------------------------------------------------
- // Display form
- // ---------------------------------------------------------
- function display_form()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID;
-
- $log_columns = ( preg_match("/Mozilla\/4\.[1-9]{1}.+/", $_SERVER['HTTP_USER_AGENT']) ) ? '50' : '90';
-
- // Options to parse
- $options = array(
- 0 => array(
- 'CBNAME' => 'findall',
- 'CBVALUE' => '1',
- 'CBCHECKED' => '',
- 'OPTION' => $user->lang['log_find_all']),
- 1 => array(
- 'CBNAME' => 'findrole',
- 'CBVALUE' => '1',
- 'CBCHECKED' => ' checked="checked"',
- 'OPTION' => 'Include Roleplay')
- );
-
- // Guildtags to parse
- if ( !empty($eqdkp->config['parsetags']) )
- {
- $parsetags = explode("\n", $eqdkp->config['parsetags']);
- foreach ( $parsetags as $index => $guildtag )
- {
- $tagoptions[] = array(
- 'CBNAME' => str_replace(' ', '_', trim($guildtag)),
- 'CBVALUE' => '1',
- 'CBCHECKED' => ' checked="checked"',
- 'OPTION' => '&lt;' . trim($guildtag) . '&gt;');
- }
- $options = array_merge($options, $tagoptions);
- }
-
- foreach ( $options as $row )
- {
- $tpl->assign_block_vars('options_row', $row);
- }
-
- // Member tags to parse
- // Find out how many members have each rank
- $rank_counts = array();
- $sql = 'SELECT member_rank_id, count(member_rank_id) as count
- FROM ' . MEMBERS_TABLE . '
- GROUP BY member_rank_id';
- $result = $db->query($sql);
- while ( $row = $db->fetch_record($result) )
- {
- $rank_counts[ $row['member_rank_id'] ] = $row['count'];
- }
- $db->free_result($result);
-
- $ranks = array();
- $sql = 'SELECT rank_id, rank_name, rank_prefix, rank_suffix
- FROM ' . MEMBER_RANKS_TABLE . '
- ORDER BY rank_name';
- $result = $db->query($sql);
- while ( $row = $db->fetch_record($result) )
- {
- // Make sure there's not a guildtag with the same name as the rank
- if ( !in_array($row['rank_name'], $options) )
- {
- $rank_count = ( isset($rank_counts[ $row['rank_id'] ]) ) ? $rank_counts[ $row['rank_id'] ] : 0;
- $format = ( $rank_count == 1 ) ? $user->lang['x_members_s'] : $user->lang['x_members_p'];
-
- $ranks[] = array(
- 'CBNAME' => 'r_' . str_replace(' ', '_', trim($row['rank_name'])),
- 'CBVALUE' => intval($row['rank_id']),
- 'CBCHECKED' => ' checked="checked"',
- 'OPTION' => $user->lang['rank'] . ': ' . (( empty($row['rank_name']) ) ? '(None)' : $row['rank_prefix'] . $row['rank_name'] . $row['rank_suffix'])
- . ' <span class="small">(' . sprintf($format, $rank_count) . ')</span>');
- }
- }
- $db->free_result($result);
-
- foreach ( $ranks as $row )
- {
- $tpl->assign_block_vars('ranks_row', $row);
- }
-
- $tpl->assign_vars(array(
- 'F_PARSE_LOG' => 'parse_Everquest2.php' . $SID,
-
- 'S_STEP1' => true,
- 'L_PASTE_LOG' => $user->lang['paste_log'],
- 'L_OPTIONS' => $user->lang['options'],
- 'L_PARSE_LOG' => $user->lang['parse_log'],
- 'L_CLOSE_WINDOW' => $user->lang['close_window'],
-
- 'LOG_COLS' => $log_columns)
- );
-
- $eqdkp->set_vars(array(
- 'page_title' => sprintf($user->lang['title_prefix'], $eqdkp->config['guildtag'], $eqdkp->config['dkp_name']).': '.$user->lang['parselog_title'],
- 'gen_simple_header' => true,
- 'template_file' => 'admin/parse_Everquest2.html',
- 'display' => true)
- );
- }
-}
-
-$parse_log = new Parse_Log;
-$parse_log->process();
-?>
diff --git a/old/admin/parse_Everquest2.php b/old/admin/parse_Everquest2.php
deleted file mode 100644
index 180f015..0000000
--- a/old/admin/parse_Everquest2.php
+++ /dev/null
@@ -1,546 +0,0 @@
-<?php
-/******************************
- * EQdkp
- * Copyright 2002-2003
- * Licensed under the GNU GPL. See COPYING for full terms.
- * ------------------
- * parse_Everquest2.php
- * Began: Tue December 24 2002
- *
- * $Id: parse_Everquest2.php 46 2007-06-19 07:29:11Z tsigo $
- *
- ******************************/
-
-define('EQDKP_INC', true);
-define('IN_ADMIN', true);
-$eqdkp_root_path = './../';
-include_once($eqdkp_root_path . 'common.php');
-
-class Parse_Log extends EQdkp_Admin
-{
- function parse_log()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID;
-
- parent::eqdkp_admin();
-
- $this->assoc_buttons(array(
- 'parse' => array(
- 'name' => 'parse',
- 'process' => 'process_parse',
- 'check' => 'a_raid_'),
- 'form' => array(
- 'name' => '',
- 'process' => 'display_form',
- 'check' => 'a_raid_'))
- );
- }
-
- // ---------------------------------------------------------
- // Process Parse
- // ---------------------------------------------------------
-/*
-
-New log file format for EQ2
-
-(1129582778)[Mon Oct 17 22:59:38 2005] ------------------------------------------
-(1129582778)[Mon Oct 17 22:59:38 2005] [55 Shadowknight] Pentagon (Barbarian) <Nomadi> Zone: The Isle of Refuge: Darathar's Flight
-(1129582778)[Mon Oct 17 22:59:38 2005] [Anonymous] Fortunah (Erudite) <Nomadi>
-(1129582778)[Mon Oct 17 22:59:38 2005] [54 Defiler] Vanhorstmann (Dark Elf) <Nomadi> Zone: The Isle of Refuge: Darathar's Flight
-(1129582778)[Mon Oct 17 22:59:38 2005] [55 Shadowknight] Vashim (Human) <Nomadi> Zone: The Isle of Refuge: Darathar's Flight
-(1129582778)[Mon Oct 17 22:59:38 2005] [52 Templar] Syris (Dark Elf) <Progeny> Zone: The Isle of Refuge: Darathar's Flight
-(1129582778)[Mon Oct 17 22:59:38 2005] [52 Templar] Gattone (Kerra) <Nomadi> Zone: The Isle of Refuge: Darathar's Flight
-(1129582778)[Mon Oct 17 22:59:38 2005] [54 Guardian] Zappod (Troll) <Nomadi> Zone: The Isle of Refuge: Darathar's Flight
-(1129582778)[Mon Oct 17 22:59:38 2005] [50 Templar] Muayat (Dwarf) <Diablos de Hispannia> Zone: The Isle of Refuge: Darathar's Flight
-(1129582778)[Mon Oct 17 22:59:38 2005] [52 Wizard] Engel (Wood Elf) <Nomadi> Zone: The Isle of Refuge: Darathar's Flight
-(1129582778)[Mon Oct 17 22:59:38 2005] [55 Berserker] Lonlaiel (Human) <Nomadi> Zone: The Isle of Refuge: Darathar's Flight
-(1129582778)[Mon Oct 17 22:59:38 2005] [54 Paladin] Manfred (Human) <Diablos de Hispannia> Zone: The Isle of Refuge: Darathar's Flight
-(1129582778)[Mon Oct 17 22:59:38 2005] [54 Coercer] Makxx (Erudite) <Nomadi> Zone: The Isle of Refuge: Darathar's Flight
-(1129582778)[Mon Oct 17 22:59:38 2005] [53 Inquisitor] Sybelius (Barbarian) <Nomadi> Zone: The Isle of Refuge: Darathar's Flight
-(1129582778)[Mon Oct 17 22:59:38 2005] [54 Conjuror] Butano (Erudite) <Diablos de Hispannia> Zone: The Isle of Refuge: Darathar's Flight
-(1129582778)[Mon Oct 17 22:59:38 2005] [54 Fury] Zentha (Dark Elf) <Nomadi> Zone: The Isle of Refuge: Darathar's Flight
-(1129582778)[Mon Oct 17 22:59:38 2005] [57 Ranger] Asca (Wood Elf) <Forged Souls> Zone: The Isle of Refuge: Darathar's Flight
-(1129582778)[Mon Oct 17 22:59:38 2005] [54 Assassin] Zamira (Kerra) <Nomadi> Zone: The Isle of Refuge: Darathar's Flight
-(1129582778)[Mon Oct 17 22:59:38 2005] [54 Fury] Alectox (Human) <Nomadi> Zone: The Isle of Refuge: Darathar's Flight
-(1129582778)[Mon Oct 17 22:59:38 2005] [57 Assassin] Killien (Iksar) <Nomadi> Zone: The Isle of Refuge: Darathar's Flight
-(1129582778)[Mon Oct 17 22:59:38 2005] [60 Templar] Akarus (Dwarf) <Nomadi> Zone: The Isle of Refuge: Darathar's Flight
-(1129582778)[Mon Oct 17 22:59:38 2005] [57 Monk] Jarr (Barbarian) <Forged Souls> Zone: The Isle of Refuge: Darathar's Flight
-(1129582778)[Mon Oct 17 22:59:38 2005] [49 Guardian] Vittt (Barbarian) <Nomadi> Zone: The Isle of Refuge: Darathar's Flight
-(1129582778)[Mon Oct 17 22:59:38 2005] [49 Brigand] Darkhathor (Human) <Nomadi> Zone: The Isle of Refuge: Darathar's Flight
-(1129582778)[Mon Oct 17 22:59:38 2005] [54 Defiler] Malvagio (Kerra) <Nomadi> Zone: The Isle of Refuge: Darathar's Flight
-
-*/
- function process_parse()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID;
-
- $channel_members = '';
- $line = '';
- $valid_date_found = false;
-
- $log_file = explode("\n", $_POST['log']);
- $log_file = str_replace('&lt;', '<', str_replace('&gt;', '>', $log_file));
- $line_count = sizeof($log_file);
-
- // Go through each line and
- // - Check for/get a valid member in the /who
- // - Check if there's a valid date we can use
- // - Check for/get valid members from /list <channel>
- $log_date = array();
- session_start(); // Hold our array of name => class/level/race
- for ( $i = 0; $i < $line_count; $i++ )
- {
- $line = '';
- if ( (isset($_POST['findall'])) || (strpos($log_file[$i], '<')) )
- {
- $member_name = $this->line_parse($log_file[$i]);
-
- // Make sure that each member's name is properly capitalized
- $mname = strtolower(preg_replace('/[[:space:]]/i', ' ', $member_name));
- $member_name = ucwords($mname);
-
- if ( trim($member_name) != '')
- {
- $member_names[] = $member_name;
- }
- }
-
- } // for ... log_file
-
- // If there were channel members, join the two arrays
- if ( !empty($channel_members) )
- {
- $channel_members = explode(', ', $channel_members);
- $member_names = array_merge($member_names, $channel_members);
- }
-
- $date['mo'] = date('M');
- $date['d'] = date('d');
- $date['y'] = date('Y');
- $date['h'] = date('h');
- $date['mi'] = date('i');
- $date['s'] = date('s');
-
- // Process the member_names array: replaces spaces, make it unique, sort it and reset it
- if ( (isset($member_names)) && (is_array($member_names)) )
- {
- $name_count = sizeof($member_names);
- }
- else
- {
- $name_count = 0;
- $member_names = array();
- }
-
- for ( $i = 0; $i < $name_count; $i++ )
- {
- $member_names[$i] = str_replace(' ', '', $member_names[$i]);
- }
- $member_names = array_unique($member_names);
- sort($member_names);
- reset($member_names);
-
- $tpl->assign_vars(array(
- 'S_STEP1' => false,
- 'L_FOUND_MEMBERS' => sprintf($user->lang['found_members'], $line_count, sizeof($member_names)),
- 'L_LOG_DATE_TIME' => $user->lang['log_date_time'],
- 'L_LOG_ADD_DATA' => $user->lang['log_add_data'],
-
- 'FOUND_MEMBERS' => implode("\n", $member_names),
- 'MO' => $this->M_to_n($date['mo']),
- 'D' => $date['d'],
- 'Y' => $date['y'],
- 'H' => $date['h'],
- 'MI' => $date['mi'],
- 'S' => $date['s'])
- );
-
- $eqdkp->set_vars(array(
- 'page_title' => sprintf($user->lang['title_prefix'], $eqdkp->config['guildtag'], $eqdkp->config['dkp_name']).': '.$user->lang['parselog_title'],
- 'gen_simple_header' => true,
- 'template_file' => 'admin/parse_Everquest2.html',
- 'display' => true)
- );
- }
-
- // ---------------------------------------------------------
- // Process helper methods
- // ---------------------------------------------------------
- function line_parse($log_line)
- {
- global $db, $eqdkp, $user;
- static $member_ranks = array();
-
- //$log_line = stripslashes($log_line);
-
- // First off, we don't care about afk or lfg, so remove them
- $log_line = str_replace(' (AFK)', '', $log_line);
- $log_line = str_replace(' (LFG)', '', $log_line);
-
- // Build a clean array of guildtags we might be looking for
- $parsetags = explode("\n", $eqdkp->config['parsetags']);
- foreach ( $parsetags as $k => $v )
- {
- $parsetags[$k] = trim(stripslashes($v));
- }
-
- // Cache the member name / member rank info
- if ( @sizeof($member_ranks) == 0 )
- {
- $sql = 'SELECT r.rank_name, m.member_name
- FROM ' . MEMBER_RANKS_TABLE . ' r, ' . MEMBERS_TABLE . ' m
- WHERE (r.rank_id = m.member_rank_id)
- ORDER BY m.member_name';
- $result = $db->query($sql);
- while ( $row = $db->fetch_record($result) )
- {
- $member_ranks[ $row['member_name'] ] = 'r_' . str_replace(' ', '_', trim($row['rank_name']));
- }
- $db->free_result($result);
- }
-
- $name_check = false;
- $role_check = true;
- $rank_check = true;
-
-/* Sample EQ2 log file format :: the three patterns to match are:
-
-#1 guilded normal
-#2 non-guilded normal
-#3 role (guilded; unguilded matches like /anon)
-#4 anon (guilded or not)
-
- (neither anon or role shows zone FYI)
-
-
-(1121902422)[Wed Jul 20 19:33:42 2005] [43 Guardian] Goosage (Barbarian) <The Knights of Dawn Fire> Zone: The Feerrott
-(1121902422)[Wed Jul 20 19:33:42 2005] [47 Paladin] Maskie (Barbarian) Zone: The Feerrott
-(1121907805)[Wed Jul 20 21:03:25 2005] [Anonymous] Mildew (Gnome) <The Knights of Dawn Fire>
-(1121907951)[Wed Jul 20 21:05:51 2005] [Anonymous] Greywind (Human)
-
-
-German log file look slike this:
-(1122498819)[Wed Jul 27 23:13:39 2005] [50 Inquisitor] Chryorn (Dunkelelf) <Feral Fires>ZONE: Shattered Stillness: Epic
-(1122498819)[Wed Jul 27 23:13:39 2005] [50 Brigand] Xandros (Dunkelelf) <Feral Fires>ZONE: Shattered Stillness: Epic
-(1122498819)[Wed Jul 27 23:13:39 2005] [50 Wächter] Achilless (Barbar) <Feral Fires>ZONE: Shattered Stillness: Epic
-
-*/
-
- // Date
- $pattern = "/^\([0-9]{10}\)\[[a-zA-Z]{3} [a-zA-Z]{3} [0-9]{2} [0-9]{2}\:[0-9]{2}\:[0-9]{2} [0-9]{4}\](.*)";
- $pattern1 = "/^\([0-9]{10}\)\[[a-zA-Z]{3} [a-zA-Z]{3} [0-9]{2} [0-9]{2}\:[0-9]{2}\:[0-9]{2} [0-9]{4}\](.*)";
- $pattern2 = "/^\([0-9]{10}\)\[[a-zA-Z]{3} [a-zA-Z]{3} [0-9]{2} [0-9]{2}\:[0-9]{2}\:[0-9]{2} [0-9]{4}\](.*)";
- $pattern3 = "/^\([0-9]{10}\)\[[a-zA-Z]{3} [a-zA-Z]{3} [0-9]{2} [0-9]{2}\:[0-9]{2}\:[0-9]{2} [0-9]{4}\](.*)";
-
- // Level / Class
- $pattern .= "\[([0-9]{1,2}) (.+)\]";
- $pattern1 .= "\[([0-9]{1,2}) (.+)\]";
- $pattern2 .= "\[Anonymous\]";
- $pattern3 .= "\[Anonymous\]";
-
- // Name
- $pattern .= " ([A-Za-z]{1,})";
- $pattern1 .= " ([A-Za-z]{1,})";
- $pattern2 .= " ([A-Za-z]{1,})";
- $pattern3 .= " ([A-Za-z]{1,})";
-
- // Race
- $pattern .= " \((.*)\)";
- $pattern1 .= " \((.*)\)";
- $pattern2 .= " \((.*)\)";
- $pattern3 .= " \((.*)\)";
-
- // Guild Tag
- $pattern .= " \<(.*)\>";
- $pattern2 .= " \<(.*)\>";
-
- // Zone:
- $pattern .= " Zone:(.*)";
- $pattern1 .= " Zone:(.*)";
-
- // End pattern regexp
- $pattern .= '/';
- $pattern1 .= '/';
- $pattern2 .= '/';
- $pattern3 .= '/';
-
-
- // unset a line match type identifier
- unset($type_line);
-
- // match things the hard way..one type of line at a time
- // crappy way to do it, but VERY easy to read and alter
-
- // Normal
- if ( preg_match($pattern, $log_line, $log_parsed) ) {
- $name = trim($log_parsed[4]);
- $race = trim($log_parsed[5]);
- $class = trim($log_parsed[3]);
- $level = trim($log_parsed[2]);
- $guildtag = trim($log_parsed[6]);
- $zone = trim($log_parsed[7]);
- $type_line = 1;
- }
-
- // Unguilded
- if ( preg_match($pattern1, $log_line, $log_parsed) ) {
- $name = trim($log_parsed[4]);
- $race = trim($log_parsed[5]);
- $class = trim($log_parsed[3]);
- $level = trim($log_parsed[2]);
- $guildtag = "";
- $zone = trim($log_parsed[6]);
- if (!isset($type_line) ){ $type_line = 2;}
- }
-
- // Roleplaying
- if ( preg_match($pattern2, $log_line, $log_parsed) ) {
- $name = trim($log_parsed[2]);
- $race = trim($log_parsed[3]);
- $class = "Unknown";
- $level = "50";
- $guildtag = trim($log_parsed[4]);
- $zone = "";
- if (!isset($type_line) ){ $type_line = 3;}
- }
-
- // Anon
- if ( preg_match($pattern3, $log_line, $log_parsed) ) {
- $name = trim($log_parsed[2]);
- $race = trim($log_parsed[3]);
- $class = "Unknown";
- $level = "50";
- $guildtag = "";
- $zone = "";
- if (!isset($type_line) ){ $type_line = 4;}
- }
-
-
- // Jeezus this is a pain in the ass, ain't it?
-
- /* Sample EQ2 log file format :: the three patterns to match are (one more time)
-
-(1121902422)[Wed Jul 20 19:33:42 2005] [43 Guardian] Goosage (Barbarian) <The Knights of Dawn Fire> Zone: The Feerrott
-(1121902422)[Wed Jul 20 19:33:42 2005] [47 Paladin] Maskie (Barbarian) Zone: The Feerrott
-(1121907805)[Wed Jul 20 21:03:25 2005] [Anonymous] Mildew (Gnome) <The Knights of Dawn Fire>
-(1121907951)[Wed Jul 20 21:05:51 2005] [Anonymous] Greywind (Human)
-
-After using the above 4, we now test with the same members in different states of anon/role/guilded
-
-(1121902422)[Wed Jul 20 19:33:42 2005] [Anonymous] Goosage (Barbarian)
-(1121902422)[Wed Jul 20 19:33:42 2005] [Anonymous] Maskie (Barbarian) <The Knights of Dawn Fire
-(1121907805)[Wed Jul 20 21:03:25 2005] [47 Cleric] Mildew (Gnome) <The Knights of Dawn Fire> Zone: The Feerrott
-(1121907951)[Wed Jul 20 21:05:51 2005] [49 Monk] Greywind (Human) Zone: The Feerrott
-
- */
-
-
- if ($type_line == 1) {
- print"Name: $name , Race: $race , Class: $class , Guild: $guildtag , Level: $level , Zone: $zone<br>";
- }
-
- if ($type_line == 2) {
- print"Name: $name , Race: $race , Class: $class , Level: $level , Zone: $zone<br>";
- }
-
- if ($type_line == 3) {
- print"Name: $name , Race: $race , Class_Guess: $class , Level_Guess: $level , Guild: $guildtag<br>";
- }
-
- if ($type_line == 4) {
- print"Name: $name , Race: $race , Class_Guess: $class , Level_Guess: $level<br>";
- }
-
-
- // Looking for roleplaying folks? Is this valid for EQ2?
- if ( !isset($_POST['findrole']) )
- {
- if ( (isset($class)) && ($class == 'Unknown') )
- {
- $role_check = false;
- }
- }
-
- if ( (isset($name)) && ($name != '') )
- {
- $name_check = true;
- }
-
- // Check if we're including this member's rank
- if ( isset($member_ranks[$name]) )
- {
- // If POST[r_<rank_name>] isn't set, we're ignoring this member
- if ( !isset($_POST[ $member_ranks[$name] ]) )
- {
- $rank_check = false;
- }
- }
-
- if ( ($name_check) && ($role_check) && ($rank_check) )
- {
- $_SESSION[$name] = array(
- 'tag' => $guildtag,
- 'name' => $name,
- 'level' => $level,
- 'class' => $class,
- 'race' => $race);
-
- return $name;
- }
- return false;
- }
-
- function M_to_n($m)
- {
- switch($m)
- {
- case 'Jan':
- return '01';
- break;
- case 'Feb':
- return '02';
- break;
- case 'Mar':
- return '03';
- break;
- case 'Apr':
- return '04';
- break;
- case 'May':
- return '05';
- break;
- case 'Jun':
- return '06';
- break;
- case 'Jul':
- return '07';
- break;
- case 'Aug':
- return '08';
- break;
- case 'Sep':
- return '09';
- break;
- case 'Oct':
- return '10';
- break;
- case 'Nov':
- return '11';
- break;
- case 'Dec':
- return '12';
- break;
- }
- }
-
- // ---------------------------------------------------------
- // Display form
- // ---------------------------------------------------------
- function display_form()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID;
-
- $log_columns = ( preg_match("/Mozilla\/4\.[1-9]{1}.+/", $_SERVER['HTTP_USER_AGENT']) ) ? '50' : '90';
-
- // Options to parse
- $options = array(
- 0 => array(
- 'CBNAME' => 'findall',
- 'CBVALUE' => '1',
- 'CBCHECKED' => '',
- 'OPTION' => $user->lang['log_find_all']),
- 1 => array(
- 'CBNAME' => 'findrole',
- 'CBVALUE' => '1',
- 'CBCHECKED' => ' checked="checked"',
- 'OPTION' => 'Include Roleplay')
- );
-
- // Guildtags to parse
- if ( !empty($eqdkp->config['parsetags']) )
- {
- $parsetags = explode("\n", $eqdkp->config['parsetags']);
- foreach ( $parsetags as $index => $guildtag )
- {
- $tagoptions[] = array(
- 'CBNAME' => str_replace(' ', '_', trim($guildtag)),
- 'CBVALUE' => '1',
- 'CBCHECKED' => ' checked="checked"',
- 'OPTION' => '&lt;' . trim($guildtag) . '&gt;');
- }
- $options = array_merge($options, $tagoptions);
- }
-
- foreach ( $options as $row )
- {
- $tpl->assign_block_vars('options_row', $row);
- }
-
- // Member tags to parse
- // Find out how many members have each rank
- $rank_counts = array();
- $sql = 'SELECT member_rank_id, count(member_rank_id) as count
- FROM ' . MEMBERS_TABLE . '
- GROUP BY member_rank_id';
- $result = $db->query($sql);
- while ( $row = $db->fetch_record($result) )
- {
- $rank_counts[ $row['member_rank_id'] ] = $row['count'];
- }
- $db->free_result($result);
-
- $ranks = array();
- $sql = 'SELECT rank_id, rank_name, rank_prefix, rank_suffix
- FROM ' . MEMBER_RANKS_TABLE . '
- ORDER BY rank_name';
- $result = $db->query($sql);
- while ( $row = $db->fetch_record($result) )
- {
- // Make sure there's not a guildtag with the same name as the rank
- if ( !in_array($row['rank_name'], $options) )
- {
- $rank_count = ( isset($rank_counts[ $row['rank_id'] ]) ) ? $rank_counts[ $row['rank_id'] ] : 0;
- $format = ( $rank_count == 1 ) ? $user->lang['x_members_s'] : $user->lang['x_members_p'];
-
- $ranks[] = array(
- 'CBNAME' => 'r_' . str_replace(' ', '_', trim($row['rank_name'])),
- 'CBVALUE' => intval($row['rank_id']),
- 'CBCHECKED' => ' checked="checked"',
- 'OPTION' => $user->lang['rank'] . ': ' . (( empty($row['rank_name']) ) ? '(None)' : $row['rank_prefix'] . $row['rank_name'] . $row['rank_suffix'])
- . ' <span class="small">(' . sprintf($format, $rank_count) . ')</span>');
- }
- }
- $db->free_result($result);
-
- foreach ( $ranks as $row )
- {
- $tpl->assign_block_vars('ranks_row', $row);
- }
-
- $tpl->assign_vars(array(
- 'F_PARSE_LOG' => 'parse_Everquest2.php' . $SID,
-
- 'S_STEP1' => true,
- 'L_PASTE_LOG' => $user->lang['paste_log'],
- 'L_OPTIONS' => $user->lang['options'],
- 'L_PARSE_LOG' => $user->lang['parse_log'],
- 'L_CLOSE_WINDOW' => $user->lang['close_window'],
-
- 'LOG_COLS' => $log_columns)
- );
-
- $eqdkp->set_vars(array(
- 'page_title' => sprintf($user->lang['title_prefix'], $eqdkp->config['guildtag'], $eqdkp->config['dkp_name']).': '.$user->lang['parselog_title'],
- 'gen_simple_header' => true,
- 'template_file' => 'admin/parse_Everquest2.html',
- 'display' => true)
- );
- }
-}
-
-$parse_log = new Parse_Log;
-$parse_log->process();
-?>
diff --git a/old/admin/parse_Everquest2German.php b/old/admin/parse_Everquest2German.php
deleted file mode 100644
index 1e6e087..0000000
--- a/old/admin/parse_Everquest2German.php
+++ /dev/null
@@ -1,515 +0,0 @@
-<?php
-/******************************
- * EQdkp
- * Copyright 2002-2003
- * Licensed under the GNU GPL. See COPYING for full terms.
- * ------------------
- * parse_Everquest2.php
- * Began: Tue December 24 2002
- *
- * $Id: parse_Everquest2German.php 46 2007-06-19 07:29:11Z tsigo $
- *
- ******************************/
-
-define('EQDKP_INC', true);
-define('IN_ADMIN', true);
-$eqdkp_root_path = './../';
-include_once($eqdkp_root_path . 'common.php');
-
-class Parse_Log extends EQdkp_Admin
-{
- function parse_log()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID;
-
- parent::eqdkp_admin();
-
- $this->assoc_buttons(array(
- 'parse' => array(
- 'name' => 'parse',
- 'process' => 'process_parse',
- 'check' => 'a_raid_'),
- 'form' => array(
- 'name' => '',
- 'process' => 'display_form',
- 'check' => 'a_raid_'))
- );
- }
-
- // ---------------------------------------------------------
- // Process Parse
- // ---------------------------------------------------------
- function process_parse()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID;
-
- $channel_members = '';
- $line = '';
- $valid_date_found = false;
-
- $log_file = explode("\n", $_POST['log']);
- $log_file = str_replace('&lt;', '<', str_replace('&gt;', '>', $log_file));
- $line_count = sizeof($log_file);
-
- // Go through each line and
- // - Check for/get a valid member in the /who
- // - Check if there's a valid date we can use
- // - Check for/get valid members from /list <channel>
- $log_date = array();
- session_start(); // Hold our array of name => class/level/race
- for ( $i = 0; $i < $line_count; $i++ )
- {
- $line = '';
- if ( (isset($_POST['findall'])) || (strpos($log_file[$i], '<')) )
- {
- $member_name = $this->line_parse($log_file[$i]);
-
- // Make sure that each member's name is properly capitalized
- $mname = strtolower(preg_replace('/[[:space:]]/i', ' ', $member_name));
- $member_name = ucwords($mname);
-
- if ( trim($member_name) != '')
- {
- $member_names[] = $member_name;
- }
- }
-
- } // for ... log_file
-
- // If there were channel members, join the two arrays
- if ( !empty($channel_members) )
- {
- $channel_members = explode(', ', $channel_members);
- $member_names = array_merge($member_names, $channel_members);
- }
-
- $date['mo'] = date('M');
- $date['d'] = date('d');
- $date['y'] = date('Y');
- $date['h'] = date('h');
- $date['mi'] = date('i');
- $date['s'] = date('s');
-
- // Process the member_names array: replaces spaces, make it unique, sort it and reset it
- if ( (isset($member_names)) && (is_array($member_names)) )
- {
- $name_count = sizeof($member_names);
- }
- else
- {
- $name_count = 0;
- $member_names = array();
- }
-
- for ( $i = 0; $i < $name_count; $i++ )
- {
- $member_names[$i] = str_replace(' ', '', $member_names[$i]);
- }
- $member_names = array_unique($member_names);
- sort($member_names);
- reset($member_names);
-
- $tpl->assign_vars(array(
- 'S_STEP1' => false,
- 'L_FOUND_MEMBERS' => sprintf($user->lang['found_members'], $line_count, sizeof($member_names)),
- 'L_LOG_DATE_TIME' => $user->lang['log_date_time'],
- 'L_LOG_ADD_DATA' => $user->lang['log_add_data'],
-
- 'FOUND_MEMBERS' => implode("\n", $member_names),
- 'MO' => $this->M_to_n($date['mo']),
- 'D' => $date['d'],
- 'Y' => $date['y'],
- 'H' => $date['h'],
- 'MI' => $date['mi'],
- 'S' => $date['s'])
- );
-
- $eqdkp->set_vars(array(
- 'page_title' => sprintf($user->lang['title_prefix'], $eqdkp->config['guildtag'], $eqdkp->config['dkp_name']).': '.$user->lang['parselog_title'],
- 'gen_simple_header' => true,
- 'template_file' => 'admin/parse_Everquest2.html',
- 'display' => true)
- );
- }
-
- // ---------------------------------------------------------
- // Process helper methods
- // ---------------------------------------------------------
- function line_parse($log_line)
- {
- global $db, $eqdkp, $user;
- static $member_ranks = array();
-
- //$log_line = stripslashes($log_line);
-
- // First off, we don't care about afk or lfg, so remove them
- $log_line = str_replace(' (AFK)', '', $log_line);
- $log_line = str_replace(' (LFG)', '', $log_line);
-
- // Build a clean array of guildtags we might be looking for
- $parsetags = explode("\n", $eqdkp->config['parsetags']);
- foreach ( $parsetags as $k => $v )
- {
- $parsetags[$k] = trim(stripslashes($v));
- }
-
- // Cache the member name / member rank info
- if ( @sizeof($member_ranks) == 0 )
- {
- $sql = 'SELECT r.rank_name, m.member_name
- FROM ' . MEMBER_RANKS_TABLE . ' r, ' . MEMBERS_TABLE . ' m
- WHERE (r.rank_id = m.member_rank_id)
- ORDER BY m.member_name';
- $result = $db->query($sql);
- while ( $row = $db->fetch_record($result) )
- {
- $member_ranks[ $row['member_name'] ] = 'r_' . str_replace(' ', '_', trim($row['rank_name']));
- }
- $db->free_result($result);
- }
-
- $name_check = false;
- $role_check = true;
- $rank_check = true;
-
-/* Sample EQ2 log file format :: the three patterns to match are:
-
-#1 guilded normal
-#2 non-guilded normal
-#3 role (guilded; unguilded matches like /anon)
-#4 anon (guilded or not)
-
- (neither anon or role shows zone FYI)
-
-
-(1121902422)[Wed Jul 20 19:33:42 2005] [43 Guardian] Goosage (Barbarian) <The Knights of Dawn Fire> Zone: The Feerrott
-(1121902422)[Wed Jul 20 19:33:42 2005] [47 Paladin] Maskie (Barbarian) Zone: The Feerrott
-(1121907805)[Wed Jul 20 21:03:25 2005] [Anonymous] Mildew (Gnome) <The Knights of Dawn Fire>
-(1121907951)[Wed Jul 20 21:05:51 2005] [Anonymous] Greywind (Human)
-
-
-German log file looks like this :
-(1122498819)[Wed Jul 27 23:13:39 2005] [50 Inquisitor] Chryorn (Dunkelelf) <Feral Fires>ZONE: Shattered Stillness: Epic
-(1122498819)[Wed Jul 27 23:13:39 2005] [50 Brigand] Xandros (Dunkelelf) <Feral Fires>ZONE: Shattered Stillness: Epic
-(1122498819)[Wed Jul 27 23:13:39 2005] [50 Wächter] Achilless (Barbar) <Feral Fires>ZONE: Shattered Stillness: Epic
-
-*/
-
- // Date
- $pattern = "/^\([0-9]{10}\)\[[a-zA-Z]{3} [a-zA-Z]{3} [0-9]{2} [0-9]{2}\:[0-9]{2}\:[0-9]{2} [0-9]{4}\](.*)";
- $pattern1 = "/^\([0-9]{10}\)\[[a-zA-Z]{3} [a-zA-Z]{3} [0-9]{2} [0-9]{2}\:[0-9]{2}\:[0-9]{2} [0-9]{4}\](.*)";
- $pattern2 = "/^\([0-9]{10}\)\[[a-zA-Z]{3} [a-zA-Z]{3} [0-9]{2} [0-9]{2}\:[0-9]{2}\:[0-9]{2} [0-9]{4}\](.*)";
- $pattern3 = "/^\([0-9]{10}\)\[[a-zA-Z]{3} [a-zA-Z]{3} [0-9]{2} [0-9]{2}\:[0-9]{2}\:[0-9]{2} [0-9]{4}\](.*)";
-
- // Level / Class
- $pattern .= "\[([0-9]{1,2}) (.+)\]";
- $pattern1 .= "\[([0-9]{1,2}) (.+)\]";
- $pattern2 .= "\[Anonymous\]";
- $pattern3 .= "\[Anonymous\]";
-
- // Name
- $pattern .= " ([A-Za-z]{1,})";
- $pattern1 .= " ([A-Za-z]{1,})";
- $pattern2 .= " ([A-Za-z]{1,})";
- $pattern3 .= " ([A-Za-z]{1,})";
-
- // Race
- $pattern .= " \((.*)\)";
- $pattern1 .= " \((.*)\)";
- $pattern2 .= " \((.*)\)";
- $pattern3 .= " \((.*)\)";
-
- // Guild Tag
- $pattern .= " \<(.*)\>";
- $pattern2 .= " \<(.*)\>";
-
- // Zone:
- $pattern .= "ZONE: (.*)";
- $pattern1 .= "ZONE: (.*)";
-
- // End pattern regexp
- $pattern .= '/';
- $pattern1 .= '/';
- $pattern2 .= '/';
- $pattern3 .= '/';
-
-
- // unset a line match type identifier
- unset($type_line);
-
- // match things the hard way..one type of line at a time
- // crappy way to do it, but VERY easy to read and alter
-
- // Normal
- if ( preg_match($pattern, $log_line, $log_parsed) ) {
- $name = trim($log_parsed[4]);
- $race = trim($log_parsed[5]);
- $class = trim($log_parsed[3]);
- $level = trim($log_parsed[2]);
- $guildtag = trim($log_parsed[6]);
- $zone = trim($log_parsed[7]);
- $type_line = 1;
- }
-
- // Unguilded
- if ( preg_match($pattern1, $log_line, $log_parsed) ) {
- $name = trim($log_parsed[4]);
- $race = trim($log_parsed[5]);
- $class = trim($log_parsed[3]);
- $level = trim($log_parsed[2]);
- $guildtag = "";
- $zone = trim($log_parsed[6]);
- if (!isset($type_line) ){ $type_line = 2;}
- }
-
- // Roleplaying
- if ( preg_match($pattern2, $log_line, $log_parsed) ) {
- $name = trim($log_parsed[2]);
- $race = trim($log_parsed[3]);
- $class = "Unknown";
- $level = "50";
- $guildtag = trim($log_parsed[4]);
- $zone = "";
- if (!isset($type_line) ){ $type_line = 3;}
- }
-
- // Anon
- if ( preg_match($pattern3, $log_line, $log_parsed) ) {
- $name = trim($log_parsed[2]);
- $race = trim($log_parsed[3]);
- $class = "Unknown";
- $level = "50";
- $guildtag = "";
- $zone = "";
- if (!isset($type_line) ){ $type_line = 4;}
- }
-
-
- // Jeezus this is a pain in the ass, ain't it?
-
- /* Sample EQ2 log file format :: the three patterns to match are (one more time)
-
-(1121902422)[Wed Jul 20 19:33:42 2005] [43 Guardian] Goosage (Barbarian) <The Knights of Dawn Fire> Zone: The Feerrott
-(1121902422)[Wed Jul 20 19:33:42 2005] [47 Paladin] Maskie (Barbarian) Zone: The Feerrott
-(1121907805)[Wed Jul 20 21:03:25 2005] [Anonymous] Mildew (Gnome) <The Knights of Dawn Fire>
-(1121907951)[Wed Jul 20 21:05:51 2005] [Anonymous] Greywind (Human)
-
-After using the above 4, we now test with the same members in different states of anon/role/guilded
-
-(1121902422)[Wed Jul 20 19:33:42 2005] [Anonymous] Goosage (Barbarian)
-(1121902422)[Wed Jul 20 19:33:42 2005] [Anonymous] Maskie (Barbarian) <The Knights of Dawn Fire
-(1121907805)[Wed Jul 20 21:03:25 2005] [47 Cleric] Mildew (Gnome) <The Knights of Dawn Fire> Zone: The Feerrott
-(1121907951)[Wed Jul 20 21:05:51 2005] [49 Monk] Greywind (Human) Zone: The Feerrott
-
- */
-
-
- if ($type_line == 1) {
- print"Name: $name , Race: $race , Class: $class , Guild: $guildtag , Level: $level , Zone: $zone<br>";
- }
-
- if ($type_line == 2) {
- print"Name: $name , Race: $race , Class: $class , Level: $level , Zone: $zone<br>";
- }
-
- if ($type_line == 3) {
- print"Name: $name , Race: $race , Class_Guess: $class , Level_Guess: $level , Guild: $guildtag<br>";
- }
-
- if ($type_line == 4) {
- print"Name: $name , Race: $race , Class_Guess: $class , Level_Guess: $level<br>";
- }
-
-
- // Looking for roleplaying folks? Is this valid for EQ2?
- if ( !isset($_POST['findrole']) )
- {
- if ( (isset($class)) && ($class == 'Unknown') )
- {
- $role_check = false;
- }
- }
-
- if ( (isset($name)) && ($name != '') )
- {
- $name_check = true;
- }
-
- // Check if we're including this member's rank
- if ( isset($member_ranks[$name]) )
- {
- // If POST[r_<rank_name>] isn't set, we're ignoring this member
- if ( !isset($_POST[ $member_ranks[$name] ]) )
- {
- $rank_check = false;
- }
- }
-
- if ( ($name_check) && ($role_check) && ($rank_check) )
- {
- $_SESSION[$name] = array(
- 'tag' => $guildtag,
- 'name' => $name,
- 'level' => $level,
- 'class' => $class,
- 'race' => $race);
-
- return $name;
- }
- return false;
- }
-
- function M_to_n($m)
- {
- switch($m)
- {
- case 'Jan':
- return '01';
- break;
- case 'Feb':
- return '02';
- break;
- case 'Mar':
- return '03';
- break;
- case 'Apr':
- return '04';
- break;
- case 'May':
- return '05';
- break;
- case 'Jun':
- return '06';
- break;
- case 'Jul':
- return '07';
- break;
- case 'Aug':
- return '08';
- break;
- case 'Sep':
- return '09';
- break;
- case 'Oct':
- return '10';
- break;
- case 'Nov':
- return '11';
- break;
- case 'Dec':
- return '12';
- break;
- }
- }
-
- // ---------------------------------------------------------
- // Display form
- // ---------------------------------------------------------
- function display_form()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID;
-
- $log_columns = ( preg_match("/Mozilla\/4\.[1-9]{1}.+/", $_SERVER['HTTP_USER_AGENT']) ) ? '50' : '90';
-
- // Options to parse
- $options = array(
- 0 => array(
- 'CBNAME' => 'findall',
- 'CBVALUE' => '1',
- 'CBCHECKED' => '',
- 'OPTION' => $user->lang['log_find_all']),
- 1 => array(
- 'CBNAME' => 'findrole',
- 'CBVALUE' => '1',
- 'CBCHECKED' => ' checked="checked"',
- 'OPTION' => 'Include Roleplay')
- );
-
- // Guildtags to parse
- if ( !empty($eqdkp->config['parsetags']) )
- {
- $parsetags = explode("\n", $eqdkp->config['parsetags']);
- foreach ( $parsetags as $index => $guildtag )
- {
- $tagoptions[] = array(
- 'CBNAME' => str_replace(' ', '_', trim($guildtag)),
- 'CBVALUE' => '1',
- 'CBCHECKED' => ' checked="checked"',
- 'OPTION' => '&lt;' . trim($guildtag) . '&gt;');
- }
- $options = array_merge($options, $tagoptions);
- }
-
- foreach ( $options as $row )
- {
- $tpl->assign_block_vars('options_row', $row);
- }
-
- // Member tags to parse
- // Find out how many members have each rank
- $rank_counts = array();
- $sql = 'SELECT member_rank_id, count(member_rank_id) as count
- FROM ' . MEMBERS_TABLE . '
- GROUP BY member_rank_id';
- $result = $db->query($sql);
- while ( $row = $db->fetch_record($result) )
- {
- $rank_counts[ $row['member_rank_id'] ] = $row['count'];
- }
- $db->free_result($result);
-
- $ranks = array();
- $sql = 'SELECT rank_id, rank_name, rank_prefix, rank_suffix
- FROM ' . MEMBER_RANKS_TABLE . '
- ORDER BY rank_name';
- $result = $db->query($sql);
- while ( $row = $db->fetch_record($result) )
- {
- // Make sure there's not a guildtag with the same name as the rank
- if ( !in_array($row['rank_name'], $options) )
- {
- $rank_count = ( isset($rank_counts[ $row['rank_id'] ]) ) ? $rank_counts[ $row['rank_id'] ] : 0;
- $format = ( $rank_count == 1 ) ? $user->lang['x_members_s'] : $user->lang['x_members_p'];
-
- $ranks[] = array(
- 'CBNAME' => 'r_' . str_replace(' ', '_', trim($row['rank_name'])),
- 'CBVALUE' => intval($row['rank_id']),
- 'CBCHECKED' => ' checked="checked"',
- 'OPTION' => $user->lang['rank'] . ': ' . (( empty($row['rank_name']) ) ? '(None)' : $row['rank_prefix'] . $row['rank_name'] . $row['rank_suffix'])
- . ' <span class="small">(' . sprintf($format, $rank_count) . ')</span>');
- }
- }
- $db->free_result($result);
-
- foreach ( $ranks as $row )
- {
- $tpl->assign_block_vars('ranks_row', $row);
- }
-
- $tpl->assign_vars(array(
- 'F_PARSE_LOG' => 'parse_Everquest2.php' . $SID,
-
- 'S_STEP1' => true,
- 'L_PASTE_LOG' => $user->lang['paste_log'],
- 'L_OPTIONS' => $user->lang['options'],
- 'L_PARSE_LOG' => $user->lang['parse_log'],
- 'L_CLOSE_WINDOW' => $user->lang['close_window'],
-
- 'LOG_COLS' => $log_columns)
- );
-
- $eqdkp->set_vars(array(
- 'page_title' => sprintf($user->lang['title_prefix'], $eqdkp->config['guildtag'], $eqdkp->config['dkp_name']).': '.$user->lang['parselog_title'],
- 'gen_simple_header' => true,
- 'template_file' => 'admin/parse_Everquest2.html',
- 'display' => true)
- );
- }
-}
-
-$parse_log = new Parse_Log;
-$parse_log->process();
-?>
diff --git a/old/admin/parse_Vanguard-SoH.php b/old/admin/parse_Vanguard-SoH.php
deleted file mode 100644
index b69be61..0000000
--- a/old/admin/parse_Vanguard-SoH.php
+++ /dev/null
@@ -1,449 +0,0 @@
-<?php
-/******************************
- * EQdkp
- * Copyright 2002-2003
- * Licensed under the GNU GPL. See COPYING for full terms.
- * ------------------
- * parse_Everquest2.php
- * Began: Sun February 04 2007
- *
- * $Id: parse_Vanguard-SoH.php 8 2007-02-04 16:16:20 Dazza $
- *
- ******************************/
-
-define('EQDKP_INC', true);
-define('IN_ADMIN', true);
-$eqdkp_root_path = './../';
-include_once($eqdkp_root_path . 'common.php');
-
-class Parse_Log extends EQdkp_Admin
-{
- function parse_log()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID;
-
- parent::eqdkp_admin();
-
- $this->assoc_buttons(array(
- 'parse' => array(
- 'name' => 'parse',
- 'process' => 'process_parse',
- 'check' => 'a_raid_'),
- 'form' => array(
- 'name' => '',
- 'process' => 'display_form',
- 'check' => 'a_raid_'))
- );
- }
-
- // ---------------------------------------------------------
- // Process Parse
- // ---------------------------------------------------------
-/*
-
-[10:42:54]Anaryon: Level 9 Ranger - Leth Nurae
-[10:42:54] Janaar: Level 8 Paladin - Leth Nurae
-[10:42:54] Carathien: Level 8 Cleric - Leth Nurae
-[10:42:54] Stonay: Level 11 Dread Knight (The Unholy Inquisition) - Leth Nurae
-[10:42:54] Traxs: Level 14 Ranger - Leth Nurae
-[10:42:54] Kellermann: Level 11 Cleric (The Unholy Inquisition) - Leth Nurae
-[10:42:54] Aerwrynn: Level 6 Psionicist - Leth Nurae
-[10:42:54] Nexiana: Level 8 Ranger - Leth Nurae
-[10:42:54] Metis: Level 10 Psionicist - Leth Nurae
-[10:42:54] Lancevent: Level 6 Psionicist (Alliance des Seigneurs) - Leth Nurae
-[10:42:54] Arteah: Level 5 Blood Mage - Leth Nurae
-[10:42:54] Ormung: Level 9 Shaman - Leth Nurae
-[10:42:54] Schnabbo: Level 6 Bard - Leth Nurae
-[10:42:54] Taung: Level 7 Cleric - Leth Nurae
-[10:42:54] Marsosis: Level 8 Paladin - Leth Nurae
-[10:42:54] Ariam: Level 7 Bard - Leth Nurae
-[10:42:54] Nagyon: Level 6 Ranger - Leth Nurae
-[10:42:54] Lillial: Level 7 Ranger - Leth Nurae
-[10:42:54] Prook: Level 7 Sorcerer - Leth Nurae
-[10:42:54] Maleek: Level 12 Paladin - Leth Nurae
-[10:42:54] Kaeia: Level 15 Ranger - Leth Nurae
-[10:42:54] Burro: Level 21 Druid (Knights of the Tribunal) - Leth Nurae
-[10:42:54] Liadora: Level 6 Bard - Leth Nurae
-[10:42:54] Maschelie: Level 4 Psionicist - Leth Nurae
-[10:42:54] Tiltwait: Level 9 Blood Mage - Leth Nurae
-[10:42:54] Mythera: Level 11 Psionicist - Leth Nurae
-[10:42:54] Tulanthas: Level 7 Ranger - Leth Nurae
-[10:42:54] Saelnir: Level 11 Sorcerer - Leth Nurae
-[10:42:54] Wizor: Level 4 Sorcerer - Leth Nurae
-[10:42:54] Tylara: Level 6 Sorcerer - Leth Nurae
-[10:42:54] Silverana: Level 5 Psionicist - Leth Nurae
-[10:42:54] Morowind: Level 11 Psionicist - Leth Nurae
-[10:42:54] Gaddinger: Level 5 Ranger - Leth Nurae
-[10:42:54] Domulus: Level 7 Blood Mage - Leth Nurae
-[10:42:54] Emperios: Level 8 Cleric - Leth Nurae
-[10:42:54] Silanis: Level 5 Ranger - Leth Nurae
-[10:42:54] Carnon: Level 5 Paladin - Leth Nurae
-[10:42:54] Edakor: Level 3 Sorcerer - Leth Nurae
-[10:42:54] Arkanidall: Level 4 Sorcerer - Leth Nurae
-[10:42:54] Sendaran: Level 9 Sorcerer - Leth Nurae
-[10:42:54] 40 player(s) found.
-
-*/
- function process_parse()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID;
-
- $channel_members = '';
- $line = '';
- $valid_date_found = false;
-
- $log_file = explode("\n", $_POST['log']);
- $log_file = str_replace('&lt;', '<', str_replace('&gt;', '>', $log_file));
- $line_count = sizeof($log_file);
-
- // Go through each line and
- // - Check for/get a valid member in the /who
- // - Check if there's a valid date we can use
- // - Check for/get valid members from /list <channel>
- $log_date = array();
- session_start(); // Hold our array of name => class/level/race
- for ( $i = 0; $i < $line_count; $i++ )
- {
- $line = '';
-
- //Each member parse starts here
- $member_name = $this->line_parse($log_file[$i]);
-
- // Make sure that each member's name is properly capitalized
- $mname = strtolower(preg_replace('/[[:space:]]/i', ' ', $member_name));
- $member_name = ucwords($mname);
-
- if ( trim($member_name) != '')
- {
- $member_names[] = $member_name;
- }
- //End member parse
-
- } // for ... log_file
-
- // If there were channel members, join the two arrays
- if ( !empty($channel_members) )
- {
- $channel_members = explode(', ', $channel_members);
- $member_names = array_merge($member_names, $channel_members);
- }
-
- $date['mo'] = date('M');
- $date['d'] = date('d');
- $date['y'] = date('Y');
- $date['h'] = date('h');
- $date['mi'] = date('i');
- $date['s'] = date('s');
-
- // Process the member_names array: replaces spaces, make it unique, sort it and reset it
- if ( (isset($member_names)) && (is_array($member_names)) )
- {
- $name_count = sizeof($member_names);
- }
- else
- {
- $name_count = 0;
- $member_names = array();
- }
-
- for ( $i = 0; $i < $name_count; $i++ )
- {
- $member_names[$i] = str_replace(' ', '', $member_names[$i]);
- }
- $member_names = array_unique($member_names);
- sort($member_names);
- reset($member_names);
-
- $tpl->assign_vars(array(
- 'S_STEP1' => false,
- 'L_FOUND_MEMBERS' => sprintf($user->lang['found_members'], $line_count, sizeof($member_names)),
- 'L_LOG_DATE_TIME' => $user->lang['log_date_time'],
- 'L_LOG_ADD_DATA' => $user->lang['log_add_data'],
-
- 'FOUND_MEMBERS' => implode("\n", $member_names),
- 'MO' => $this->M_to_n($date['mo']),
- 'D' => $date['d'],
- 'Y' => $date['y'],
- 'H' => $date['h'],
- 'MI' => $date['mi'],
- 'S' => $date['s'])
- );
-
- $eqdkp->set_vars(array(
- 'page_title' => sprintf($user->lang['title_prefix'], $eqdkp->config['guildtag'], $eqdkp->config['dkp_name']).': '.$user->lang['parselog_title'],
- 'gen_simple_header' => true,
- 'template_file' => 'admin/parse_Everquest2.html',
- 'display' => true)
- );
- }
-
- // ---------------------------------------------------------
- // Process helper methods
- // ---------------------------------------------------------
- function line_parse($log_line)
- {
- global $db, $eqdkp, $user;
- static $member_ranks = array();
-
- //$log_line = stripslashes($log_line);
-
- // First off, we don't care about afk or lfg, so remove them
- $log_line = str_replace(' (AFK)', '', $log_line);
- $log_line = str_replace(' (LFG)', '', $log_line);
-
- // Build a clean array of guildtags we might be looking for
- $parsetags = explode("\n", $eqdkp->config['parsetags']);
- foreach ( $parsetags as $k => $v )
- {
- $parsetags[$k] = trim(stripslashes($v));
- }
-
- // Cache the member name / member rank info
- if ( @sizeof($member_ranks) == 0 )
- {
- $sql = 'SELECT r.rank_name, m.member_name
- FROM ' . MEMBER_RANKS_TABLE . ' r, ' . MEMBERS_TABLE . ' m
- WHERE (r.rank_id = m.member_rank_id)
- ORDER BY m.member_name';
- $result = $db->query($sql);
- while ( $row = $db->fetch_record($result) )
- {
- $member_ranks[ $row['member_name'] ] = 'r_' . str_replace(' ', '_', trim($row['rank_name']));
- }
- $db->free_result($result);
- }
-
- $name_check = false;
- $role_check = true;
- $rank_check = true;
-
-/* Sample SoH log file format ::
-
-[10:42:54]Anaryon: Level 9 Ranger - Leth Nurae
-[10:42:54] Janaar: Level 8 Paladin - Leth Nurae
-[10:42:54] Carathien: Level 8 Cleric - Leth Nurae
-[10:42:54] Stonay: Level 11 Dread Knight (The Unholy Inquisition) - Leth Nurae
-[10:42:54] Traxs: Level 14 Ranger - Leth Nurae
-[10:42:54] Kellermann: Level 11 Cleric (The Unholy Inquisition) - Leth Nurae
-[10:42:54] Aerwrynn: Level 6 Psionicist - Leth Nurae
-[10:42:54] Nexiana: Level 8 Ranger - Leth Nurae
-[10:42:54] Metis: Level 10 Psionicist - Leth Nurae
-[10:42:54] Lancevent: Level 6 Psionicist (Alliance des Seigneurs) - Leth Nurae
-[10:42:54] Arteah: Level 5 Blood Mage - Leth Nurae
-
-*/
-
- // Date / Time
- $pattern = "/^(?:\[[0-9]{1,2}\:[0-9]{2}\:[0-9]{2}\])";
-
- // Name
- $pattern .= "\s*?([A-Za-z]{1,}):";
-
- // Level / Class
- $pattern .= "\s*?Level ([0-9]{1,2}) ([^-\(]+)";
-
- // Guild Tag
- $pattern .= "\s*?(?:\((.*?)\))?";
-
- // Zone:
- $pattern .= "\s*?- (.*)";
-
- // End pattern regexp
- $pattern .= '/';
-
-
- // unset a line match type identifier
- unset($type_line);
-
- // match things the hard way..one type of line at a time
- // crappy way to do it, but VERY easy to read and alter
-
- // Normal
- if ( preg_match($pattern, $log_line, $log_parsed) )
- {
- $name = trim($log_parsed[1]);
- $level = trim($log_parsed[2]);
- $class = trim($log_parsed[3]);
- $guildtag = ( isset($log_parsed[5]) ? trim($log_parsed[4]) : '' );
- $zone = ( isset($log_parsed[5]) ? trim($log_parsed[5]) : trim($log_parsed[4]) );
- $type_line = 1;
- }
-
-
- if ($type_line == 1) {
- print"Name: $name , Level: $level , Class: $class , Guild: $guildtag , Zone: $zone<br>";
- }
-
-
- if ( (isset($name)) && ($name != '') )
- {
- $name_check = true;
- }
-
- // Check if we're including this member's rank
- if ( isset($member_ranks[$name]) )
- {
- // If POST[r_<rank_name>] isn't set, we're ignoring this member
- if ( !isset($_POST[ $member_ranks[$name] ]) )
- {
- $rank_check = false;
- }
- }
-
- if ( ($name_check) && ($role_check) && ($rank_check) )
- {
- $_SESSION[$name] = array(
- 'tag' => $guildtag,
- 'name' => $name,
- 'level' => $level,
- 'class' => $class,
- 'race' => $race);
-
- return $name;
- }
- return false;
- }
-
-
- function M_to_n($m)
- {
- switch($m)
- {
- case 'Jan':
- return '01';
- break;
- case 'Feb':
- return '02';
- break;
- case 'Mar':
- return '03';
- break;
- case 'Apr':
- return '04';
- break;
- case 'May':
- return '05';
- break;
- case 'Jun':
- return '06';
- break;
- case 'Jul':
- return '07';
- break;
- case 'Aug':
- return '08';
- break;
- case 'Sep':
- return '09';
- break;
- case 'Oct':
- return '10';
- break;
- case 'Nov':
- return '11';
- break;
- case 'Dec':
- return '12';
- break;
- }
- }
-
- // ---------------------------------------------------------
- // Display form
- // ---------------------------------------------------------
- function display_form()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID;
-
- $log_columns = ( preg_match("/Mozilla\/4\.[1-9]{1}.+/", $_SERVER['HTTP_USER_AGENT']) ) ? '50' : '90';
-
- $options = array();
-
- // Guildtags to parse
- if ( !empty($eqdkp->config['parsetags']) )
- {
- $parsetags = explode("\n", $eqdkp->config['parsetags']);
- foreach ( $parsetags as $index => $guildtag )
- {
- $tagoptions[] = array(
- 'CBNAME' => str_replace(' ', '_', trim($guildtag)),
- 'CBVALUE' => '1',
- 'CBCHECKED' => ' checked="checked"',
- 'OPTION' => '&lt;' . trim($guildtag) . '&gt;');
- }
- $options = array_merge($options, $tagoptions);
- }
-
- foreach ( $options as $row )
- {
- $tpl->assign_block_vars('options_row', $row);
- }
-
- // Member tags to parse
- // Find out how many members have each rank
- $rank_counts = array();
- $sql = 'SELECT member_rank_id, count(member_rank_id) as count
- FROM ' . MEMBERS_TABLE . '
- GROUP BY member_rank_id';
- $result = $db->query($sql);
- while ( $row = $db->fetch_record($result) )
- {
- $rank_counts[ $row['member_rank_id'] ] = $row['count'];
- }
- $db->free_result($result);
-
- $ranks = array();
- $sql = 'SELECT rank_id, rank_name, rank_prefix, rank_suffix
- FROM ' . MEMBER_RANKS_TABLE . '
- ORDER BY rank_name';
- $result = $db->query($sql);
- while ( $row = $db->fetch_record($result) )
- {
- // Make sure there's not a guildtag with the same name as the rank
- if ( !in_array($row['rank_name'], $options) )
- {
- $rank_count = ( isset($rank_counts[ $row['rank_id'] ]) ) ? $rank_counts[ $row['rank_id'] ] : 0;
- $format = ( $rank_count == 1 ) ? $user->lang['x_members_s'] : $user->lang['x_members_p'];
-
- $ranks[] = array(
- 'CBNAME' => 'r_' . str_replace(' ', '_', trim($row['rank_name'])),
- 'CBVALUE' => intval($row['rank_id']),
- 'CBCHECKED' => ' checked="checked"',
- 'OPTION' => $user->lang['rank'] . ': ' . (( empty($row['rank_name']) ) ? '(None)' : $row['rank_prefix'] . $row['rank_name'] . $row['rank_suffix'])
- . ' <span class="small">(' . sprintf($format, $rank_count) . ')</span>');
- }
- }
- $db->free_result($result);
-
- foreach ( $ranks as $row )
- {
- $tpl->assign_block_vars('ranks_row', $row);
- }
-
- $tpl->assign_vars(array(
- 'F_PARSE_LOG' => 'parse_Vanguard-SoH.php' . $SID,
-
- 'S_STEP1' => true,
- 'L_PASTE_LOG' => $user->lang['paste_log'],
- 'L_OPTIONS' => $user->lang['options'],
- 'L_PARSE_LOG' => $user->lang['parse_log'],
- 'L_CLOSE_WINDOW' => $user->lang['close_window'],
-
- 'LOG_COLS' => $log_columns)
- );
-
- $eqdkp->set_vars(array(
- 'page_title' => sprintf($user->lang['title_prefix'], $eqdkp->config['guildtag'], $eqdkp->config['dkp_name']).': '.$user->lang['parselog_title'],
- 'gen_simple_header' => true,
- 'template_file' => 'admin/parse_Vanguard-SoH.html',
- 'display' => true)
- );
- }
-}
-
-$parse_log = new Parse_Log;
-$parse_log->process();
-?>
diff --git a/old/admin/parse_WoW.php b/old/admin/parse_WoW.php
deleted file mode 100644
index 52b2637..0000000
--- a/old/admin/parse_WoW.php
+++ /dev/null
@@ -1,484 +0,0 @@
-<?php
-/******************************
- * EQdkp
- * Copyright 2002-2003
- * Licensed under the GNU GPL. See COPYING for full terms.
- * ------------------
- * parse_WoW.php
- * Began: Sat March 05 2005
- *
- * $Id: parse_WoW.php 46 2007-06-19 07:29:11Z tsigo $
- *
- ******************************/
-
-define('EQDKP_INC', true);
-define('IN_ADMIN', true);
-$eqdkp_root_path = './../';
-include_once($eqdkp_root_path . 'common.php');
-
-class Parse_Log extends EQdkp_Admin
-{
- function parse_log()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID;
-
- parent::eqdkp_admin();
-
- $this->assoc_buttons(array(
- 'parse' => array(
- 'name' => 'parse',
- 'process' => 'process_parse',
- 'check' => 'a_raid_'),
- 'form' => array(
- 'name' => '',
- 'process' => 'display_form',
- 'check' => 'a_raid_'))
- );
- }
-
- // ---------------------------------------------------------
- // Process Parse
- // ---------------------------------------------------------
- function process_parse()
- {
-
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID;
-
- $channel_members = '';
- $line = '';
- $valid_date_found = false;
-
- $log_file = explode("\n", $_POST['log']);
- $log_file = str_replace('&lt;', '<', str_replace('&gt;', '>', $log_file));
- $line_count = sizeof($log_file);
-
- // Go through each line and
- // - Check for/get a valid member in the /who
- // - Check if there's a valid date we can use
- // - Check for/get valid members from /list <channel>
- $log_date = array();
- session_start(); // Hold our array of name => class/level/race
- for ( $i = 0; $i < $line_count; $i++ )
- {
- $line = '';
- if ( (isset($_POST['findall'])) || (strpos($log_file[$i], '<')) )
- {
- $member_name = $this->line_parse($log_file[$i]);
-
- // Make sure that each member's name is properly capitalized
- $mname = strtolower(preg_replace('/[[:space:]]/i', ' ', $member_name));
- $member_name = ucwords($mname);
-
- if ( trim($member_name) != '')
- {
- $member_names[] = $member_name;
- }
- }
-
- // Check if there's a usable date/time in this string
- if ( preg_match("/([a-zA-Z]{3}) ([a-zA-Z]{3}) ([0-9]{2}) ([0-9]{2})\:([0-9]{2})\:([0-9]{2}) ([0-9]{4})/", $log_file[$i], $pre_log_date) )
- {
- if ( isset($pre_log_date[0]) )
- {
- $log_date = $pre_log_date;
- }
- $valid_date_found = true;
- }
-
- // Check if the log contains channel information we can use
- if (preg_match("/Channel (.+)\(([0-9]{1,5})\) members\:/", $log_file[$i], $num_members))
- {
- $first_chan_line = ($i+1);
- $channel_lines = (($num_members[2] % 10) == 0) ? $num_members[2] / 10 : floor($num_members[2] / 10) + 1;
- $last_chan_line = ($i + $channel_lines + 1);
- for ( $j = $first_chan_line; $j < $last_chan_line; $j++ )
- {
- $line = preg_replace("/\[[A-Za-z]{3} [A-Za-z]{3} [0-9]{2} [0-9]{2}\:[0-9]{2}\:[0-9]{2} [0-9]{4}\]/", '', $log_file[$j]);
- $line = preg_replace("/[^A-Za-z\,[:space:]]/", '', $line);
- if ($j != $channel_lines)
- {
- $line = str_replace("\n", ', ', $line);
- }
- $channel_members .= $line;
- }
- }
-
- if (isset ($log_file[$i]) ) {
- $line_to_read = str_replace("\t", ' ', $log_file[$i]);
- }
- if (preg_match("/^[0-9]{1,2} (.+) ([0-9]{1,2}) ([a-z A-Z]+)/", $line_to_read, $raid_line))
- {
- // Current log tool doesn't get race information - so set it to Unknown.
- $memberRace = "Unknown";
- $memberName = $raid_line[1];
- $memberLevel = $raid_line[2];
- $memberClass = ( isset($raid_line[3]) ) ? trim(preg_replace('/Officer/', '', preg_replace('/Raid Leader/', '', $raid_line[3]))) : '';
-
- //print"NAME $raid_line[1] ";
- //print"LEVEL $raid_line[2] ";
- //print"CLASS $raid_line[3]<br>";
-
- $_SESSION[$memberName] = array(
- 'name' => $memberName,
- 'level' => $memberLevel,
- 'race' => $memberRace,
- 'class' => $memberClass,
- );
-
- // add member's name to the array
- $member_names[] = $memberName;
- }
-
-
- } // for ... log_file
-
-
- // If there were channel members, join the two arrays
- if ( !empty($channel_members) )
- {
- $channel_members = explode(', ', $channel_members);
- $member_names = array_merge($member_names, $channel_members);
- }
-
- if ( $valid_date_found )
- {
- $date['mo'] = $log_date[2];
- $date['d'] = $log_date[3];
- $date['y'] = $log_date[7];
- $date['h'] = $log_date[4];
- $date['mi'] = $log_date[5];
- $date['s'] = $log_date[6];
- }
- else
- {
- $date['mo'] = date('M');
- $date['d'] = date('d');
- $date['y'] = date('Y');
- $date['h'] = date('h');
- $date['mi'] = date('i');
- $date['s'] = date('s');
- }
-
- // Process the member_names array: replaces spaces, make it unique, sort it and reset it
- if ( (isset($member_names)) && (is_array($member_names)) )
- {
- $name_count = sizeof($member_names);
- }
- else
- {
- $name_count = 0;
- $member_names = array();
- }
-
- for ( $i = 0; $i < $name_count; $i++ )
- {
- $member_names[$i] = str_replace(' ', '', $member_names[$i]);
- }
- $member_names = array_unique($member_names);
- sort($member_names);
- reset($member_names);
-
- $tpl->assign_vars(array(
- 'S_STEP1' => false,
- 'L_FOUND_MEMBERS' => sprintf($user->lang['found_members'], $line_count, sizeof($member_names)),
- 'L_LOG_DATE_TIME' => $user->lang['log_date_time'],
- 'L_LOG_ADD_DATA' => $user->lang['log_add_data'],
-
- 'FOUND_MEMBERS' => implode("\n", $member_names),
- 'MO' => $this->M_to_n($date['mo']),
- 'D' => $date['d'],
- 'Y' => $date['y'],
- 'H' => $date['h'],
- 'MI' => $date['mi'],
- 'S' => $date['s'])
- );
-
- $eqdkp->set_vars(array(
- 'page_title' => sprintf($user->lang['title_prefix'], $eqdkp->config['guildtag'], $eqdkp->config['dkp_name']).': '.$user->lang['parselog_title'],
- 'gen_simple_header' => true,
- 'template_file' => 'admin/parse_WoW.html',
- 'display' => true)
- );
- }
-
- // ---------------------------------------------------------
- // Process helper methods
- // ---------------------------------------------------------
- function line_parse($log_line)
- {
- global $db, $eqdkp, $user;
- static $member_ranks = array();
-
- $log_line = stripslashes($log_line);
-
- // Build a clean array of guildtags we might be looking for
- $parsetags = explode("\n", $eqdkp->config['parsetags']);
- foreach ( $parsetags as $k => $v )
- {
- $parsetags[$k] = trim(stripslashes($v));
- }
-
- // Cache the member name / member rank info
- if ( @sizeof($member_ranks) == 0 )
- {
- $sql = 'SELECT r.rank_name, m.member_name
- FROM ' . MEMBER_RANKS_TABLE . ' r, ' . MEMBERS_TABLE . ' m
- WHERE (r.rank_id = m.member_rank_id)
- ORDER BY m.member_name';
- $result = $db->query($sql);
- while ( $row = $db->fetch_record($result) )
- {
- $member_ranks[ $row['member_name'] ] = 'r_' . str_replace(' ', '_', trim($row['rank_name']));
- }
- $db->free_result($result);
- }
-
- $name_check = false;
- $role_check = true;
- $rank_check = true;
-
- // Date
- $pattern = "/\[[a-zA-Z]{3} [a-zA-Z]{3} [0-9]{2} [0-9]{2}\:[0-9]{2}\:[0-9]{2} [0-9]{4}\]";
- // AFK
- $pattern .= ".*(AFK )?";
- // Level / Class (if findall or findrole is set, we can check for ANONYMOUS people, too)
- // $pattern .= ( (isset($_POST['findall'])) || (isset($_POST['findrole'])) ) ? "\[(ANONYMOUS|([0-9]{1,2})(.+))\]" : "\[([0-9]{1,2})(.+)\]";
- $pattern .= ( (isset($_POST['findall'])) || (isset($_POST['findrole'])) ) ? "\[(ANONYMOUS|([0-9]{1,2})(.+) (.+))\]" : "\[([0-9]{1,2})(.+) (.+)\]";
- // Name
- $pattern .= " ([A-Za-z]{1,})";
- // Race
- $pattern .= "( \(.*\))?";
- // Guild (ignored if we're finding EVERYONE in the log, regardless of tag)
- if ( !isset($_POST['findall']) )
- {
- $guildtag_sep = '';
- $pattern .= ".*\<(";
- foreach ( $parsetags as $guildtag )
- {
- if ( isset($_POST[str_replace(' ', '_', $guildtag)]) )
- {
- $pattern .= $guildtag_sep . $guildtag;
- $guildtag_sep = '|';
- }
- }
- $pattern .= ")\>";
- }
- $pattern .= '/';
-
- if ( preg_match($pattern, $log_line, $log_parsed) )
- {
- // 0 = full string
- // 1 = AFK?
- // 2 = ANONYMOUS | 'XX Class (archtype)'
- // 3 = Level
- // 4 = Class
- // 5 = (Archtype)
- // 6 = Name
- // 7 = (Race)
-
- $name = trim($log_parsed[6]);
- $level = trim($log_parsed[3]);
- $class = trim($log_parsed[4]);
- $race = ( isset($log_parsed[7]) ) ? trim(str_replace(')', '', str_replace('(', '', $log_parsed[7]))) : '';
- $archtype = ( isset($log_parsed[5]) ) ? trim(str_replace(')', '', str_replace('(', '', $log_parsed[5]))) : '';
-
- /* Oops - left inthe debug code :-) */
- //print "Ful String: $log_parsed[0]\n<br>";
- //print "Level: $level\n<br>";
- //print "Class: $class\n<br>";
- //print "Archtype: $archtype\n<br>";
- //print "Name: $name\n<br>";
- //print "Race: $race\n<br>";
-
-
- if ( !isset($_POST['findrole']) )
- {
- if ( (isset($log_parsed[2])) && ($log_parsed[2] == 'ANONYMOUS') )
- {
- $role_check = false;
- }
- }
-
- if ( (isset($log_parsed[6])) && ($log_parsed[6] != '') )
- {
- $name_check = true;
- }
-
- // Check if we're including this member's rank
- if ( isset($member_ranks[$name]) )
- {
- // If POST[r_<rank_name>] isn't set, we're ignoring this member
- if ( !isset($_POST[ $member_ranks[$name] ]) )
- {
- $rank_check = false;
- }
- }
-
- if ( ($name_check) && ($role_check) && ($rank_check) )
- {
- $_SESSION[$name] = array(
- 'name' => $name,
- 'level' => $level,
- 'class' => $class,
- 'race' => $race);
-
- return $log_parsed[6];
- }
- }
- return false;
- }
-
- function M_to_n($m)
- {
- switch($m)
- {
- case 'Jan':
- return '01';
- break;
- case 'Feb':
- return '02';
- break;
- case 'Mar':
- return '03';
- break;
- case 'Apr':
- return '04';
- break;
- case 'May':
- return '05';
- break;
- case 'Jun':
- return '06';
- break;
- case 'Jul':
- return '07';
- break;
- case 'Aug':
- return '08';
- break;
- case 'Sep':
- return '09';
- break;
- case 'Oct':
- return '10';
- break;
- case 'Nov':
- return '11';
- break;
- case 'Dec':
- return '12';
- break;
- }
- }
-
- // ---------------------------------------------------------
- // Display form
- // ---------------------------------------------------------
- function display_form()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID;
-
- $log_columns = ( preg_match("/Mozilla\/4\.[1-9]{1}.+/", $_SERVER['HTTP_USER_AGENT']) ) ? '50' : '90';
-
- // Options to parse
- $options = array(
- 0 => array(
- 'CBNAME' => 'findall',
- 'CBVALUE' => '1',
- 'CBCHECKED' => '',
- 'OPTION' => $user->lang['log_find_all']),
- 1 => array(
- 'CBNAME' => 'findrole',
- 'CBVALUE' => '1',
- 'CBCHECKED' => ' checked="checked"',
- 'OPTION' => 'Include Roleplay')
- );
-
- // Guildtags to parse
- if ( !empty($eqdkp->config['parsetags']) )
- {
- $parsetags = explode("\n", $eqdkp->config['parsetags']);
- foreach ( $parsetags as $index => $guildtag )
- {
- $tagoptions[] = array(
- 'CBNAME' => str_replace(' ', '_', trim($guildtag)),
- 'CBVALUE' => '1',
- 'CBCHECKED' => ' checked="checked"',
- 'OPTION' => '&lt;' . trim($guildtag) . '&gt;');
- }
- $options = array_merge($options, $tagoptions);
- }
-
- foreach ( $options as $row )
- {
- $tpl->assign_block_vars('options_row', $row);
- }
-
- // Member tags to parse
- // Find out how many members have each rank
- $rank_counts = array();
- $sql = 'SELECT member_rank_id, count(member_rank_id) as count
- FROM ' . MEMBERS_TABLE . '
- GROUP BY member_rank_id';
- $result = $db->query($sql);
- while ( $row = $db->fetch_record($result) )
- {
- $rank_counts[ $row['member_rank_id'] ] = $row['count'];
- }
- $db->free_result($result);
-
- $ranks = array();
- $sql = 'SELECT rank_id, rank_name, rank_prefix, rank_suffix
- FROM ' . MEMBER_RANKS_TABLE . '
- ORDER BY rank_name';
- $result = $db->query($sql);
- while ( $row = $db->fetch_record($result) )
- {
- // Make sure there's not a guildtag with the same name as the rank
- if ( !in_array($row['rank_name'], $options) )
- {
- $rank_count = ( isset($rank_counts[ $row['rank_id'] ]) ) ? $rank_counts[ $row['rank_id'] ] : 0;
- $format = ( $rank_count == 1 ) ? $user->lang['x_members_s'] : $user->lang['x_members_p'];
-
- $ranks[] = array(
- 'CBNAME' => 'r_' . str_replace(' ', '_', trim($row['rank_name'])),
- 'CBVALUE' => intval($row['rank_id']),
- 'CBCHECKED' => ' checked="checked"',
- 'OPTION' => $user->lang['rank'] . ': ' . (( empty($row['rank_name']) ) ? '(None)' : $row['rank_prefix'] . $row['rank_name'] . $row['rank_suffix'])
- . ' <span class="small">(' . sprintf($format, $rank_count) . ')</span>');
- }
- }
- $db->free_result($result);
-
- foreach ( $ranks as $row )
- {
- $tpl->assign_block_vars('ranks_row', $row);
- }
-
- $tpl->assign_vars(array(
- 'F_PARSE_LOG' => 'parse_WoW.php' . $SID,
-
- 'S_STEP1' => true,
- 'L_PASTE_LOG' => $user->lang['paste_log'],
- 'L_OPTIONS' => $user->lang['options'],
- 'L_PARSE_LOG' => $user->lang['parse_log'],
- 'L_CLOSE_WINDOW' => $user->lang['close_window'],
-
- 'LOG_COLS' => $log_columns)
- );
-
- $eqdkp->set_vars(array(
- 'page_title' => sprintf($user->lang['title_prefix'], $eqdkp->config['guildtag'], $eqdkp->config['dkp_name']).': '.$user->lang['parselog_title'],
- 'gen_simple_header' => true,
- 'template_file' => 'admin/parse_WoW.html',
- 'display' => true)
- );
- }
-}
-
-$parse_log = new Parse_Log;
-$parse_log->process();
-?>
diff --git a/old/admin/parse_log.php b/old/admin/parse_log.php
deleted file mode 100644
index 897122f..0000000
--- a/old/admin/parse_log.php
+++ /dev/null
@@ -1,467 +0,0 @@
-<?php
-/******************************
- * EQdkp
- * Copyright 2002-2003
- * Licensed under the GNU GPL. See COPYING for full terms.
- * ------------------
- * parse_log.php
- * Began: Tue December 24 2002
- *
- * $Id: parse_log.php 46 2007-06-19 07:29:11Z tsigo $
- *
- ******************************/
-
-define('EQDKP_INC', true);
-define('IN_ADMIN', true);
-$eqdkp_root_path = './../';
-include_once($eqdkp_root_path . 'common.php');
-
-class Parse_Log extends EQdkp_Admin
-{
- function parse_log()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID;
-
- parent::eqdkp_admin();
-
- $this->assoc_buttons(array(
- 'parse' => array(
- 'name' => 'parse',
- 'process' => 'process_parse',
- 'check' => 'a_raid_'),
- 'form' => array(
- 'name' => '',
- 'process' => 'display_form',
- 'check' => 'a_raid_'))
- );
- }
-
- // ---------------------------------------------------------
- // Process Parse
- // ---------------------------------------------------------
- function process_parse()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID;
-
- $channel_members = '';
- $line = '';
- $valid_date_found = false;
-
- $log_file = explode("\n", $_POST['log']);
- $log_file = str_replace('&lt;', '<', str_replace('&gt;', '>', $log_file));
- $line_count = sizeof($log_file);
-
- // Go through each line and
- // - Check for/get a valid member in the /who
- // - Check if there's a valid date we can use
- // - Check for/get valid members from /list <channel>
- $log_date = array();
- session_start(); // Hold our array of name => class/level/race
- for ( $i = 0; $i < $line_count; $i++ )
- {
- $line = '';
- if ( (isset($_POST['findall'])) || (strpos($log_file[$i], '<')) )
- {
- $member_name = $this->line_parse($log_file[$i]);
- if ( trim($member_name) != '')
- {
- $member_names[] = $member_name;
- }
- }
-
- // Check if there's a usable date/time in this string
- if ( preg_match("/([a-zA-Z]{3}) ([a-zA-Z]{3}) ([0-9]{2}) ([0-9]{2})\:([0-9]{2})\:([0-9]{2}) ([0-9]{4})/", $log_file[$i], $pre_log_date) )
- {
- if ( isset($pre_log_date[0]) )
- {
- $log_date = $pre_log_date;
- }
- $valid_date_found = true;
- }
-
- // Check if the log contains channel information we can use
- if (preg_match("/Channel (.+)\(([0-9]{1,5})\) members\:/", $log_file[$i], $num_members))
- {
- $first_chan_line = ($i+1);
- $channel_lines = (($num_members[2] % 10) == 0) ? $num_members[2] / 10 : floor($num_members[2] / 10) + 1;
- $last_chan_line = ($i + $channel_lines + 1);
- for ( $j = $first_chan_line; $j < $last_chan_line; $j++ )
- {
- $line = preg_replace("/\[[A-Za-z]{3} [A-Za-z]{3} [0-9]{2} [0-9]{2}\:[0-9]{2}\:[0-9]{2} [0-9]{4}\]/", '', $log_file[$j]);
- $line = preg_replace("/[^A-Za-z\,[:space:]]/", '', $line);
- if ($j != $channel_lines)
- {
- $line = str_replace("\n", ', ', $line);
- }
- $channel_members .= $line;
- }
- }
- } // for ... log_file
-
- // If there were channel members, join the two arrays
- if ( !empty($channel_members) )
- {
- $channel_members = explode(', ', $channel_members);
- $member_names = array_merge($member_names, $channel_members);
- }
-
- if ( $valid_date_found )
- {
- $date['mo'] = $log_date[2];
- $date['d'] = $log_date[3];
- $date['y'] = $log_date[7];
- $date['h'] = $log_date[4];
- $date['mi'] = $log_date[5];
- $date['s'] = $log_date[6];
- }
- else
- {
- $date['mo'] = date('M');
- $date['d'] = date('d');
- $date['y'] = date('Y');
- $date['h'] = date('h');
- $date['mi'] = date('i');
- $date['s'] = date('s');
- }
-
- // Process the member_names array: replaces spaces, make it unique, sort it and reset it
- if ( (isset($member_names)) && (is_array($member_names)) )
- {
- $name_count = sizeof($member_names);
- }
- else
- {
- $name_count = 0;
- $member_names = array();