From be4f83cd2a17a0ec05f5bce50c91befaafaa6e0c Mon Sep 17 00:00:00 2001 From: jhunkeler Date: Sun, 20 Dec 2009 18:38:08 +0000 Subject: Test. git-svn-id: http://svn.3rd-infantry-division.org/testing/branches/Bayonet CMS v2@376 c5b2fb0a-d05d-0410-98c8-828840a80ff6 --- admin/admin_functions.php | 164 ++++++ admin/admins/functions.php | 147 ++++++ admin/admins/index.php | 53 ++ admin/announcements/functions.php | 70 +++ admin/announcements/index.php | 35 ++ admin/blocks/functions.php | 177 +++++++ admin/blocks/index.php | 59 +++ admin/calendar/functions.php | 426 ++++++++++++++++ admin/calendar/index.php | 91 ++++ admin/functions.php | 568 +++++++++++++++++++++ admin/header.php | 85 +++ admin/images/add.gif | Bin 0 -> 59 bytes admin/images/add.png | Bin 0 -> 3302 bytes admin/images/addnewarticle.png | Bin 0 -> 6420 bytes admin/images/addnewpage.png | Bin 0 -> 7511 bytes admin/images/announcement.png | Bin 0 -> 2361 bytes admin/images/bayonet_logo.jpg | Bin 0 -> 36192 bytes admin/images/blocks.png | Bin 0 -> 2534 bytes admin/images/box.png | Bin 0 -> 5299 bytes admin/images/box_download.png | Bin 0 -> 5888 bytes admin/images/box_upload.png | Bin 0 -> 5895 bytes admin/images/calendar.png | Bin 0 -> 4825 bytes admin/images/cancel.png | Bin 0 -> 3327 bytes admin/images/cmsadminlogo.png | Bin 0 -> 8718 bytes admin/images/cmsadminlogo2.png | Bin 0 -> 11469 bytes admin/images/delete.gif | Bin 0 -> 60 bytes admin/images/editfiles.png | Bin 0 -> 7336 bytes admin/images/editpage.png | Bin 0 -> 5125 bytes admin/images/file_doc.png | Bin 0 -> 6993 bytes admin/images/file_pdf.png | Bin 0 -> 7336 bytes admin/images/file_rtf.png | Bin 0 -> 6958 bytes admin/images/file_word.png | Bin 0 -> 9196 bytes admin/images/modules.png | Bin 0 -> 4319 bytes admin/images/navigation.png | Bin 0 -> 3382 bytes admin/images/news.png | Bin 0 -> 5401 bytes admin/images/options.png | Bin 0 -> 3989 bytes admin/images/photogallery.png | Bin 0 -> 9687 bytes admin/images/user.png | Bin 0 -> 4942 bytes admin/images/user_add.png | Bin 0 -> 5265 bytes admin/images/user_delete.png | Bin 0 -> 5270 bytes admin/images/user_two_delete.png | Bin 0 -> 6207 bytes admin/images/user_warning.png | Bin 0 -> 5317 bytes admin/images/users_two.png | Bin 0 -> 5927 bytes admin/images/users_two_add.png | Bin 0 -> 6164 bytes admin/images/users_two_warning.png | Bin 0 -> 6206 bytes admin/images/view.gif | Bin 0 -> 61 bytes admin/index.php | 130 +++++ admin/modules/functions.php | 0 admin/modules/index.php | 0 admin/navigation/functions.php | 42 ++ admin/navigation/index.php | 54 ++ admin/news/functions.php | 0 admin/news/index.php | 0 admin/operation.php | 53 ++ admin/pages/functions.php | 387 ++++++++++++++ admin/pages/index.php | 78 +++ admin/scripts/jquery.js | 19 + admin/scripts/mocha.js | 156 ++++++ admin/settings/functions.php | 77 +++ admin/settings/index.php | 53 ++ admin/style.css | 272 ++++++++++ ajax/database/New Text Document.txt | 0 ajax/database/getuser.php | 38 ++ ajax/database/index.htm | 20 + ajax/database/selectuser.js | 40 ++ ajax/form_suggestions/clienthint.js | 45 ++ ajax/form_suggestions/gethint.php | 71 +++ ajax/form_suggestions/index.htm | 14 + ajax/simple_form/index.htm | 36 ++ ajax/simple_form/time.php | 6 + blocks/donations/index.php | 13 + blocks/mini_calendar/functions.php | 301 +++++++++++ blocks/mini_calendar/index.php | 3 + blocks/mini_calendar/scripts.js | 0 blocks/mini_calendar/style.css | 96 ++++ blocks/rss_agw/index.php | 29 ++ blocks/rss_agw/rssreader.php | 161 ++++++ blocks/rss_agw/style.css | 17 + blocks/server_monitor/index.php | 16 + blocks/soldier_info/index.php | 25 + blocks/tsviewer/index.php | 18 + footer.php | 46 ++ functions.js | 8 + header.php | 50 ++ images/add.gif | Bin 0 -> 59 bytes images/addnewarticle.png | Bin 0 -> 6420 bytes images/addnewpage.png | Bin 0 -> 7511 bytes images/annoucement.png | Bin 0 -> 9409 bytes images/announcement.png | Bin 0 -> 9409 bytes images/arrowleft.png | Bin 0 -> 2861 bytes images/arrowright.png | Bin 0 -> 2867 bytes images/bayonetLogo.png | Bin 0 -> 15516 bytes images/blockbackground.jpg | Bin 0 -> 12055 bytes images/calendar.png | Bin 0 -> 10174 bytes images/delete.gif | Bin 0 -> 60 bytes images/dicon.png | Bin 0 -> 3431 bytes images/dlaxlogo.png | Bin 0 -> 34718 bytes images/editfiles.png | Bin 0 -> 7336 bytes images/editpage.png | Bin 0 -> 7775 bytes images/error.gif | Bin 0 -> 1083 bytes images/error.png | Bin 0 -> 3746 bytes images/file_doc.png | Bin 0 -> 6993 bytes images/file_pdf.png | Bin 0 -> 7336 bytes images/file_rtf.png | Bin 0 -> 6958 bytes images/file_word.png | Bin 0 -> 9196 bytes images/hgrad.png | Bin 0 -> 109 bytes images/larrow.png | Bin 0 -> 3596 bytes images/leftshadow.png | Bin 0 -> 3146 bytes images/limericklax.png | Bin 0 -> 5497 bytes images/logo.jpg | Bin 0 -> 83085 bytes images/lvgrad.png | Bin 0 -> 627 bytes images/navbackground.jpg | Bin 0 -> 11901 bytes images/navbg.png | Bin 0 -> 2880 bytes images/navigation.png | Bin 0 -> 11330 bytes images/navspacer.png | Bin 0 -> 2810 bytes images/news_header.png | Bin 0 -> 3558 bytes images/nvgrad.png | Bin 0 -> 860 bytes images/photogallery.png | Bin 0 -> 9687 bytes images/photoleft.png | Bin 0 -> 2917 bytes images/photoright.png | Bin 0 -> 2918 bytes images/rarrow.png | Bin 0 -> 3581 bytes images/rightshadow.png | Bin 0 -> 3155 bytes images/sandbackground.jpg | Bin 0 -> 523597 bytes images/spacer.png | Bin 0 -> 2904 bytes images/vgrad.png | Bin 0 -> 110 bytes images/view.gif | Bin 0 -> 61 bytes images/xoma_logo.jpg | Bin 0 -> 33996 bytes includes/debug.php | 77 +++ includes/functions.php | 559 ++++++++++++++++++++ includes/sql.class.php | 115 +++++ index.php | 65 +++ logs/error.log | 0 logs/hacks.log | 0 logs/info.log | 0 markitup/images/body.png | Bin 0 -> 29187 bytes markitup/images/jaysalvat.png | Bin 0 -> 27603 bytes markitup/images/markitup.png | Bin 0 -> 11751 bytes markitup/images/style.css | 27 + markitup/index.html | 65 +++ markitup/jquery.pack.js | 11 + markitup/markitup/jquery.markitup.js | 553 ++++++++++++++++++++ markitup/markitup/jquery.markitup.pack.js | 9 + markitup/markitup/readme.txt | 62 +++ markitup/markitup/sets/bbcode/images/bold.png | Bin 0 -> 304 bytes markitup/markitup/sets/bbcode/images/clean.png | Bin 0 -> 667 bytes markitup/markitup/sets/bbcode/images/code.png | Bin 0 -> 859 bytes markitup/markitup/sets/bbcode/images/fonts.png | Bin 0 -> 567 bytes markitup/markitup/sets/bbcode/images/italic.png | Bin 0 -> 223 bytes markitup/markitup/sets/bbcode/images/link.png | Bin 0 -> 343 bytes .../markitup/sets/bbcode/images/list-bullet.png | Bin 0 -> 344 bytes markitup/markitup/sets/bbcode/images/list-item.png | Bin 0 -> 248 bytes .../markitup/sets/bbcode/images/list-numeric.png | Bin 0 -> 357 bytes markitup/markitup/sets/bbcode/images/picture.png | Bin 0 -> 606 bytes markitup/markitup/sets/bbcode/images/preview.png | Bin 0 -> 537 bytes markitup/markitup/sets/bbcode/images/quotes.png | Bin 0 -> 743 bytes markitup/markitup/sets/bbcode/images/stroke.png | Bin 0 -> 269 bytes markitup/markitup/sets/bbcode/images/underline.png | Bin 0 -> 273 bytes markitup/markitup/sets/bbcode/readme.txt | 11 + markitup/markitup/sets/bbcode/set.js | 39 ++ markitup/markitup/sets/bbcode/style.css | 47 ++ markitup/markitup/sets/default/images/bold.png | Bin 0 -> 304 bytes markitup/markitup/sets/default/images/clean.png | Bin 0 -> 667 bytes markitup/markitup/sets/default/images/image.png | Bin 0 -> 516 bytes markitup/markitup/sets/default/images/italic.png | Bin 0 -> 223 bytes markitup/markitup/sets/default/images/link.png | Bin 0 -> 343 bytes markitup/markitup/sets/default/images/picture.png | Bin 0 -> 606 bytes markitup/markitup/sets/default/images/preview.png | Bin 0 -> 537 bytes markitup/markitup/sets/default/images/stroke.png | Bin 0 -> 269 bytes markitup/markitup/sets/default/set.js | 27 + markitup/markitup/sets/default/style.css | 27 + .../skins/markitup/images/bg-container.png | Bin 0 -> 28455 bytes .../skins/markitup/images/bg-editor-bbcode.png | Bin 0 -> 1642 bytes .../skins/markitup/images/bg-editor-dotclear.png | Bin 0 -> 1682 bytes .../skins/markitup/images/bg-editor-html.png | Bin 0 -> 1534 bytes .../skins/markitup/images/bg-editor-json.png | Bin 0 -> 1529 bytes .../skins/markitup/images/bg-editor-markdown.png | Bin 0 -> 1783 bytes .../skins/markitup/images/bg-editor-textile.png | Bin 0 -> 1659 bytes .../skins/markitup/images/bg-editor-wiki.png | Bin 0 -> 1488 bytes .../skins/markitup/images/bg-editor-xml.png | Bin 0 -> 1495 bytes .../markitup/skins/markitup/images/bg-editor.png | Bin 0 -> 1745 bytes markitup/markitup/skins/markitup/images/handle.png | Bin 0 -> 258 bytes markitup/markitup/skins/markitup/images/menu.png | Bin 0 -> 27151 bytes .../markitup/skins/markitup/images/submenu.png | Bin 0 -> 240 bytes markitup/markitup/skins/markitup/style.css | 148 ++++++ markitup/markitup/skins/simple/images/handle.png | Bin 0 -> 258 bytes markitup/markitup/skins/simple/images/menu.png | Bin 0 -> 27151 bytes markitup/markitup/skins/simple/images/submenu.png | Bin 0 -> 240 bytes markitup/markitup/skins/simple/style.css | 118 +++++ markitup/markitup/templates/preview.css | 5 + markitup/markitup/templates/preview.html | 11 + modules.php | 94 ++++ modules/admin/admin_functions.php | 151 ++++++ modules/admin/blocks/functions.php | 173 +++++++ modules/admin/blocks/index.php | 59 +++ modules/admin/images/addnewarticle.png | Bin 0 -> 6420 bytes modules/admin/images/addnewpage.png | Bin 0 -> 7511 bytes modules/admin/images/announcement.png | Bin 0 -> 9409 bytes modules/admin/images/calendar.png | Bin 0 -> 10174 bytes modules/admin/images/editfiles.png | Bin 0 -> 7336 bytes modules/admin/images/editpage.png | Bin 0 -> 7775 bytes modules/admin/images/file_doc.png | Bin 0 -> 6993 bytes modules/admin/images/file_pdf.png | Bin 0 -> 7336 bytes modules/admin/images/file_rtf.png | Bin 0 -> 6958 bytes modules/admin/images/file_word.png | Bin 0 -> 9196 bytes modules/admin/images/photogallery.png | Bin 0 -> 9687 bytes modules/admin/index.php | 73 +++ modules/admin/operation.php | 53 ++ modules/admin/pages/functions.php | 230 +++++++++ modules/admin/pages/index.php | 68 +++ modules/gallery/dynamitelax/100_2867.JPG | Bin 0 -> 151469 bytes modules/gallery/dynamitelax/100_2889.JPG | Bin 0 -> 127396 bytes modules/gallery/dynamitelax/100_2901.JPG | Bin 0 -> 162137 bytes modules/gallery/dynamitelax/100_3042.JPG | Bin 0 -> 167177 bytes modules/gallery/dynamitelax/100_3047.JPG | Bin 0 -> 197658 bytes modules/gallery/dynamitelax/100_3050.JPG | Bin 0 -> 216410 bytes modules/gallery/dynamitelax/100_3051.JPG | Bin 0 -> 120926 bytes modules/gallery/dynamitelax/100_3883.jpg | Bin 0 -> 254283 bytes modules/gallery/index.php | 0 modules/gallery/testphotos/dlogo.png | Bin 0 -> 64089 bytes modules/gallery/testphotos/logo.png | Bin 0 -> 30041 bytes modules/gallery/testphotos/player.jpg | Bin 0 -> 68566 bytes modules/gallery/testphotos/team.jpg | Bin 0 -> 1201503 bytes modules/index/index.php | 36 ++ modules/news/categories/3rdIDnews.png | Bin 0 -> 50631 bytes modules/news/categories/marnemessenger.png | Bin 0 -> 20793 bytes modules/news/functions.php | 260 ++++++++++ modules/news/images/avatar.png | Bin 0 -> 6617 bytes modules/news/images/comment_arrow.png | Bin 0 -> 264 bytes modules/news/index.php | 44 ++ modules/news/style.css | 234 +++++++++ modules/newsreel/images/slidenavbg.png | Bin 0 -> 3152 bytes modules/newsreel/images/slidenavbg2.png | Bin 0 -> 2898 bytes modules/newsreel/images/slidenavbg3.png | Bin 0 -> 2885 bytes modules/newsreel/index.php | 113 ++++ modules/newsreel/slides/arma2move.png | Bin 0 -> 409510 bytes modules/newsreel/slides/newsite.png | Bin 0 -> 251196 bytes modules/newsreel/slides/recruitmentGT.png | Bin 0 -> 277092 bytes modules/newsreel/slides/teamwork.png | Bin 0 -> 83906 bytes modules/page/index.php | 71 +++ modules/tsviewer/index.php | 43 ++ navigation.php | 23 + style.css | 389 ++++++++++++++ style_bbcode.css | 71 +++ 243 files changed, 8410 insertions(+) create mode 100644 admin/admin_functions.php create mode 100644 admin/admins/functions.php create mode 100644 admin/admins/index.php create mode 100644 admin/announcements/functions.php create mode 100644 admin/announcements/index.php create mode 100644 admin/blocks/functions.php create mode 100644 admin/blocks/index.php create mode 100644 admin/calendar/functions.php create mode 100644 admin/calendar/index.php create mode 100644 admin/functions.php create mode 100644 admin/header.php create mode 100644 admin/images/add.gif create mode 100644 admin/images/add.png create mode 100644 admin/images/addnewarticle.png create mode 100644 admin/images/addnewpage.png create mode 100644 admin/images/announcement.png create mode 100644 admin/images/bayonet_logo.jpg create mode 100644 admin/images/blocks.png create mode 100644 admin/images/box.png create mode 100644 admin/images/box_download.png create mode 100644 admin/images/box_upload.png create mode 100644 admin/images/calendar.png create mode 100644 admin/images/cancel.png create mode 100644 admin/images/cmsadminlogo.png create mode 100644 admin/images/cmsadminlogo2.png create mode 100644 admin/images/delete.gif create mode 100644 admin/images/editfiles.png create mode 100644 admin/images/editpage.png create mode 100644 admin/images/file_doc.png create mode 100644 admin/images/file_pdf.png create mode 100644 admin/images/file_rtf.png create mode 100644 admin/images/file_word.png create mode 100644 admin/images/modules.png create mode 100644 admin/images/navigation.png create mode 100644 admin/images/news.png create mode 100644 admin/images/options.png create mode 100644 admin/images/photogallery.png create mode 100644 admin/images/user.png create mode 100644 admin/images/user_add.png create mode 100644 admin/images/user_delete.png create mode 100644 admin/images/user_two_delete.png create mode 100644 admin/images/user_warning.png create mode 100644 admin/images/users_two.png create mode 100644 admin/images/users_two_add.png create mode 100644 admin/images/users_two_warning.png create mode 100644 admin/images/view.gif create mode 100644 admin/index.php create mode 100644 admin/modules/functions.php create mode 100644 admin/modules/index.php create mode 100644 admin/navigation/functions.php create mode 100644 admin/navigation/index.php create mode 100644 admin/news/functions.php create mode 100644 admin/news/index.php create mode 100644 admin/operation.php create mode 100644 admin/pages/functions.php create mode 100644 admin/pages/index.php create mode 100644 admin/scripts/jquery.js create mode 100644 admin/scripts/mocha.js create mode 100644 admin/settings/functions.php create mode 100644 admin/settings/index.php create mode 100644 admin/style.css create mode 100644 ajax/database/New Text Document.txt create mode 100644 ajax/database/getuser.php create mode 100644 ajax/database/index.htm create mode 100644 ajax/database/selectuser.js create mode 100644 ajax/form_suggestions/clienthint.js create mode 100644 ajax/form_suggestions/gethint.php create mode 100644 ajax/form_suggestions/index.htm create mode 100644 ajax/simple_form/index.htm create mode 100644 ajax/simple_form/time.php create mode 100644 blocks/donations/index.php create mode 100644 blocks/mini_calendar/functions.php create mode 100644 blocks/mini_calendar/index.php create mode 100644 blocks/mini_calendar/scripts.js create mode 100644 blocks/mini_calendar/style.css create mode 100644 blocks/rss_agw/index.php create mode 100644 blocks/rss_agw/rssreader.php create mode 100644 blocks/rss_agw/style.css create mode 100644 blocks/server_monitor/index.php create mode 100644 blocks/soldier_info/index.php create mode 100644 blocks/tsviewer/index.php create mode 100644 footer.php create mode 100644 functions.js create mode 100644 header.php create mode 100644 images/add.gif create mode 100644 images/addnewarticle.png create mode 100644 images/addnewpage.png create mode 100644 images/annoucement.png create mode 100644 images/announcement.png create mode 100644 images/arrowleft.png create mode 100644 images/arrowright.png create mode 100644 images/bayonetLogo.png create mode 100644 images/blockbackground.jpg create mode 100644 images/calendar.png create mode 100644 images/delete.gif create mode 100644 images/dicon.png create mode 100644 images/dlaxlogo.png create mode 100644 images/editfiles.png create mode 100644 images/editpage.png create mode 100644 images/error.gif create mode 100644 images/error.png create mode 100644 images/file_doc.png create mode 100644 images/file_pdf.png create mode 100644 images/file_rtf.png create mode 100644 images/file_word.png create mode 100644 images/hgrad.png create mode 100644 images/larrow.png create mode 100644 images/leftshadow.png create mode 100644 images/limericklax.png create mode 100644 images/logo.jpg create mode 100644 images/lvgrad.png create mode 100644 images/navbackground.jpg create mode 100644 images/navbg.png create mode 100644 images/navigation.png create mode 100644 images/navspacer.png create mode 100644 images/news_header.png create mode 100644 images/nvgrad.png create mode 100644 images/photogallery.png create mode 100644 images/photoleft.png create mode 100644 images/photoright.png create mode 100644 images/rarrow.png create mode 100644 images/rightshadow.png create mode 100644 images/sandbackground.jpg create mode 100644 images/spacer.png create mode 100644 images/vgrad.png create mode 100644 images/view.gif create mode 100644 images/xoma_logo.jpg create mode 100644 includes/debug.php create mode 100644 includes/functions.php create mode 100644 includes/sql.class.php create mode 100644 index.php create mode 100644 logs/error.log create mode 100644 logs/hacks.log create mode 100644 logs/info.log create mode 100644 markitup/images/body.png create mode 100644 markitup/images/jaysalvat.png create mode 100644 markitup/images/markitup.png create mode 100644 markitup/images/style.css create mode 100644 markitup/index.html create mode 100644 markitup/jquery.pack.js create mode 100644 markitup/markitup/jquery.markitup.js create mode 100644 markitup/markitup/jquery.markitup.pack.js create mode 100644 markitup/markitup/readme.txt create mode 100644 markitup/markitup/sets/bbcode/images/bold.png create mode 100644 markitup/markitup/sets/bbcode/images/clean.png create mode 100644 markitup/markitup/sets/bbcode/images/code.png create mode 100644 markitup/markitup/sets/bbcode/images/fonts.png create mode 100644 markitup/markitup/sets/bbcode/images/italic.png create mode 100644 markitup/markitup/sets/bbcode/images/link.png create mode 100644 markitup/markitup/sets/bbcode/images/list-bullet.png create mode 100644 markitup/markitup/sets/bbcode/images/list-item.png create mode 100644 markitup/markitup/sets/bbcode/images/list-numeric.png create mode 100644 markitup/markitup/sets/bbcode/images/picture.png create mode 100644 markitup/markitup/sets/bbcode/images/preview.png create mode 100644 markitup/markitup/sets/bbcode/images/quotes.png create mode 100644 markitup/markitup/sets/bbcode/images/stroke.png create mode 100644 markitup/markitup/sets/bbcode/images/underline.png create mode 100644 markitup/markitup/sets/bbcode/readme.txt create mode 100644 markitup/markitup/sets/bbcode/set.js create mode 100644 markitup/markitup/sets/bbcode/style.css create mode 100644 markitup/markitup/sets/default/images/bold.png create mode 100644 markitup/markitup/sets/default/images/clean.png create mode 100644 markitup/markitup/sets/default/images/image.png create mode 100644 markitup/markitup/sets/default/images/italic.png create mode 100644 markitup/markitup/sets/default/images/link.png create mode 100644 markitup/markitup/sets/default/images/picture.png create mode 100644 markitup/markitup/sets/default/images/preview.png create mode 100644 markitup/markitup/sets/default/images/stroke.png create mode 100644 markitup/markitup/sets/default/set.js create mode 100644 markitup/markitup/sets/default/style.css create mode 100644 markitup/markitup/skins/markitup/images/bg-container.png create mode 100644 markitup/markitup/skins/markitup/images/bg-editor-bbcode.png create mode 100644 markitup/markitup/skins/markitup/images/bg-editor-dotclear.png create mode 100644 markitup/markitup/skins/markitup/images/bg-editor-html.png create mode 100644 markitup/markitup/skins/markitup/images/bg-editor-json.png create mode 100644 markitup/markitup/skins/markitup/images/bg-editor-markdown.png create mode 100644 markitup/markitup/skins/markitup/images/bg-editor-textile.png create mode 100644 markitup/markitup/skins/markitup/images/bg-editor-wiki.png create mode 100644 markitup/markitup/skins/markitup/images/bg-editor-xml.png create mode 100644 markitup/markitup/skins/markitup/images/bg-editor.png create mode 100644 markitup/markitup/skins/markitup/images/handle.png create mode 100644 markitup/markitup/skins/markitup/images/menu.png create mode 100644 markitup/markitup/skins/markitup/images/submenu.png create mode 100644 markitup/markitup/skins/markitup/style.css create mode 100644 markitup/markitup/skins/simple/images/handle.png create mode 100644 markitup/markitup/skins/simple/images/menu.png create mode 100644 markitup/markitup/skins/simple/images/submenu.png create mode 100644 markitup/markitup/skins/simple/style.css create mode 100644 markitup/markitup/templates/preview.css create mode 100644 markitup/markitup/templates/preview.html create mode 100644 modules.php create mode 100644 modules/admin/admin_functions.php create mode 100644 modules/admin/blocks/functions.php create mode 100644 modules/admin/blocks/index.php create mode 100644 modules/admin/images/addnewarticle.png create mode 100644 modules/admin/images/addnewpage.png create mode 100644 modules/admin/images/announcement.png create mode 100644 modules/admin/images/calendar.png create mode 100644 modules/admin/images/editfiles.png create mode 100644 modules/admin/images/editpage.png create mode 100644 modules/admin/images/file_doc.png create mode 100644 modules/admin/images/file_pdf.png create mode 100644 modules/admin/images/file_rtf.png create mode 100644 modules/admin/images/file_word.png create mode 100644 modules/admin/images/photogallery.png create mode 100644 modules/admin/index.php create mode 100644 modules/admin/operation.php create mode 100644 modules/admin/pages/functions.php create mode 100644 modules/admin/pages/index.php create mode 100644 modules/gallery/dynamitelax/100_2867.JPG create mode 100644 modules/gallery/dynamitelax/100_2889.JPG create mode 100644 modules/gallery/dynamitelax/100_2901.JPG create mode 100644 modules/gallery/dynamitelax/100_3042.JPG create mode 100644 modules/gallery/dynamitelax/100_3047.JPG create mode 100644 modules/gallery/dynamitelax/100_3050.JPG create mode 100644 modules/gallery/dynamitelax/100_3051.JPG create mode 100644 modules/gallery/dynamitelax/100_3883.jpg create mode 100644 modules/gallery/index.php create mode 100644 modules/gallery/testphotos/dlogo.png create mode 100644 modules/gallery/testphotos/logo.png create mode 100644 modules/gallery/testphotos/player.jpg create mode 100644 modules/gallery/testphotos/team.jpg create mode 100644 modules/index/index.php create mode 100644 modules/news/categories/3rdIDnews.png create mode 100644 modules/news/categories/marnemessenger.png create mode 100644 modules/news/functions.php create mode 100644 modules/news/images/avatar.png create mode 100644 modules/news/images/comment_arrow.png create mode 100644 modules/news/index.php create mode 100644 modules/news/style.css create mode 100644 modules/newsreel/images/slidenavbg.png create mode 100644 modules/newsreel/images/slidenavbg2.png create mode 100644 modules/newsreel/images/slidenavbg3.png create mode 100644 modules/newsreel/index.php create mode 100644 modules/newsreel/slides/arma2move.png create mode 100644 modules/newsreel/slides/newsite.png create mode 100644 modules/newsreel/slides/recruitmentGT.png create mode 100644 modules/newsreel/slides/teamwork.png create mode 100644 modules/page/index.php create mode 100644 modules/tsviewer/index.php create mode 100644 navigation.php create mode 100644 style.css create mode 100644 style_bbcode.css diff --git a/admin/admin_functions.php b/admin/admin_functions.php new file mode 100644 index 0000000..83392a1 --- /dev/null +++ b/admin/admin_functions.php @@ -0,0 +1,164 @@ +. + */ + +if(!defined("ADMIN_FILE")) +{ + die("Access denied."); + return; +} + +function is_loggedin() +{ + $id = session_id(); + if($id == "") + { + header("location: index.php"); + return false; + } + return true; +} + +function login() +{ + global $db; + + if(isset($_SESSION['username']) || isset($_SESSION['password'])) + { + return true; + } + + if(isset($_POST['processed'])) + { + $username = addslashes($_POST['username']); + $password = addslashes($_POST['password']); + $password = crypt(md5($password),'iamnotadirtywhorebitch'); + $result = $db->Query("SELECT * FROM bayonet_users WHERE username = '$username' AND password = '$password' LIMIT 1"); + $rows = $db->Rows($result); + $row = $db->Fetch($result); + + if($rows > 0) + { + $_SESSION['username'] = stripslashes($username); + $_SESSION['password'] = stripslashes($password); + $_SESSION['level'] = $row['level']; + return true; + } + else + { + ReportError("Login incorrect."); + + //NOT CORRECT LOGIN, DEFAULT TO LOGIN PAGE + echo ""; + + return false; + } + + } + else + { + echo "
\n"; + //OpenTable(); + echo ""; + echo "
\n + \n + \n + \n + \n + \n +
Administrative Login
Username
Password
\n"; + //CloseTable(); + echo "
"; + echo "
\n"; + return false; + } +} + +function logout() +{ + session_unset(); + session_destroy(); + + echo ""; +} + +/** + * CompileAdmin() + * + * because we want to have a horizontal display of options, we need to have + * the data separated by arrays. the data is processed into single tables, and is + * echoed in realtime. we checked to make sure they were arrays, but there is no + * checking to make sure the data passed is not malicious in nature. + * + * @param mixed $head + * @param mixed $body + * @return + */ +function CompileAdmin($head,$body) +{ + /*if we were not passed arrays, then say goodbye*/ + if(!is_array($head) || !is_array($body)) + { + echo "must be array\n"; + return; + } + + echo ""; + +$num = 1; + foreach($body as $td) + { + if($num==1){ + echo ""; + } + echo "\n"; + if($num%6 == 0){ + echo ""; + $num=0; + } + $num++; + } + echo "
$td
\n"; +} + +/** + * OpenTable() + * + * The administration OpenTable() function requires an argument to define + * the header title. It may be wise to replace the standard OpenTable() function + * with this one... that's alot of code to unfuck though. + * + * @param mixed $title + * @return + */ +function OpenTable_Ex($title) +{ + echo "
{$title}
"; +} + +/** + * CloseTable() + * + * @return + */ +function CloseTable_Ex() +{ + echo "
"; +} + +?> \ No newline at end of file diff --git a/admin/admins/functions.php b/admin/admins/functions.php new file mode 100644 index 0000000..031bd05 --- /dev/null +++ b/admin/admins/functions.php @@ -0,0 +1,147 @@ +. + */ + + function ListAdmins() + { + global $db; + $result = $db->Query("SELECT `user_id`, `username`, `level` FROM `bayonet_users` ORDER BY `level` DESC"); + while(($rows = $db->fetch($result))!=false) + { + $admins[] = $rows; + } + + $num = 1; + OpenTable("300px"); + echo "UsernameLevel"; + foreach($admins as $admin) + { + echo "{$num}.{$admin['username']}{$admin['level']}"; + $num++; + } + CloseTable(); + } + + function NewAdmin() + { + $maxLevel = $_SESSION['level']; + } + + function EditAdmin($user_id) + { + global $db; + $maxLevel = $_SESSION['level']; + + if(isset($_POST['processed'])) + { + $username = addslashes($_POST['username']); + $level = addslashes($_POST['level']); + + if(empty($username)) + { + echo "You must fill everything out before proceeding."; + return; + } + + $db->Query("UPDATE `bayonet_users` SET `username` = '$username', `level` = '$level' WHERE `user_id` = '$user_id' LIMIT 1"); + + echo "Admin, '$username' level '$level' has been edited.\n

+ Please wait while you are redirected.

+ Click here if you don't feel like waiting."; + + // 3 second redirect to go back to the edit page + PageRedirect(3, "?op=admins"); + return; + } + + $result = $db->Query("SELECT * FROM `bayonet_users` WHERE `user_id` = '$user_id' LIMIT 1"); + while(($rows = $db->fetch($result))!=false) + { + $admin = $rows; + } + + if($maxLevel < $admin['level']){ + ReportError("You do not have permission to access this user."); + return; + } +?> +
+ Edit the attributes of this administrator.
+
+ + + + + + + + + +
Username:
Level: + +
+ + +
+
+
+Query("SELECT `username` FROM `bayonet_users` WHERE `user_id` = '$user_id'"); + $admin = $db->Fetch($result); + + if(isset($_POST['proceed'])) + { + echo "Admin '{$admin['username']}', was deleted."; + $db->Query("DELETE FROM `bayonet_users` WHERE `user_id` = '$user_id' LIMIT 1"); + PageRedirect(3,"?op=admins"); + return; + } + if(isset($_POST['cancel'])) + { + echo "User cancelled deletion of admin: '{$admin['username']}'"; + PageRedirect(3,"?op=admins"); + return; + } + ?> +
+
+ + + +
Are you SURE you want to delete the administrative user: ''?
   
+
+
+ \ No newline at end of file diff --git a/admin/admins/index.php b/admin/admins/index.php new file mode 100644 index 0000000..b000111 --- /dev/null +++ b/admin/admins/index.php @@ -0,0 +1,53 @@ +. + */ +?> +

- Edit Admins

+".LinkInternal('Add New Admin','?op=admins&create=true').""; + +ListAdmins(); + +?> \ No newline at end of file diff --git a/admin/announcements/functions.php b/admin/announcements/functions.php new file mode 100644 index 0000000..2e55125 --- /dev/null +++ b/admin/announcements/functions.php @@ -0,0 +1,70 @@ +. + */ + +/** + * Note to anyone feeling the need to edit this file... + * You MUST declare $db as global inside your functions in order access MySQL from here. + */ + +function EditAnnouncements() +{ + global $db; + + if(isset($_POST['announcementprocessed'])) + { + //Secure our data to prevent injection attacks. + $title = addslashes($_POST['title']); + $text = addslashes($_POST['text']); + if(empty($title) || empty($text)) + { + echo "You must fill everything out before proceeding."; + return; + } + + //Update the database with the new data. + $db->Query("UPDATE bayonet_announcements SET title = '$title', text = '$text' WHERE announcement_id = 0"); + echo "Announcement, '$title', has been edited.\n

Please wait while you are redirected.

+ Click here if you don't feel like waiting."; + + // 3 second redirect to go back to the edit page + echo ""; + + //die, because we have completed what we wanted to do. + return; + } + + + //Grab the page from the database according to the $article_id passed to the function. + $result = $db->Query("SELECT title,text FROM bayonet_announcements WHERE announcement_id = 0"); + while(($row = $db->Fetch($result))!=false) + { + //We only want one row, so we don't have to $article[]... No foreach necessary. + $announcement = $row; + } + ?> +
+ + + + +
Announcement Title:
+
+ \ No newline at end of file diff --git a/admin/announcements/index.php b/admin/announcements/index.php new file mode 100644 index 0000000..17b6003 --- /dev/null +++ b/admin/announcements/index.php @@ -0,0 +1,35 @@ +. + */ + ?> + +

- Edit Announcements

+ -Maybe see if this can go into more depth (ie. selecting whether to display announcements or not and on what pages)

+ + + + +
\ No newline at end of file diff --git a/admin/blocks/functions.php b/admin/blocks/functions.php new file mode 100644 index 0000000..2ef951c --- /dev/null +++ b/admin/blocks/functions.php @@ -0,0 +1,177 @@ +. + */ + +function ListBlocks() +{ + global $db; + $result = $db->Query("SELECT * FROM `bayonet_blocks` ORDER BY `active` DESC, `weight` ASC, `position`"); + while(($rows = $db->fetch($result))!=false) + { + $blocks[] = $rows; + } + + echo ""; + foreach($blocks as $block) + { + echo ""; + } + echo "
Existing Blocks
{$block['weight']} : {$block['dir_name']}EditDelete
"; +} + +function NewBlock() +{ + global $db; + if(isset($_POST['processed'])) + { + //Secure our data to prevent injection attacks. + $weight = addslashes($_POST['weight']); + $dir_name = addslashes($_POST['dir_name']); + $position = addslashes($_POST['position']); + $active = addslashes($_POST['active']); + $title = addslashes($_POST['title']); + + if(!is_int($weight) || empty($dir_name) || empty($title) || !is_int($position)) + { + echo "You must fill everything out before proceeding."; + return; + } + //Update the database with the new data. + $db->Query("INSERT INTO `bayonet_blocks` SET `weight` = '$weight', `dir_name` = '$dir_name', `title` = '$title', `position` = '$position', `active` = '$active'"); + //die, because we have completed what we wanted to do. + echo "New block, '$dir_name', at position '$weight' added.\n"; + return; + } + + ?> +
+ + + + + + + +
Title
Weight
Position
Directory Name
Active +
+
+ 'Yes',0 => 'No'); + foreach($options as $option => $value) + { + $selected = NULL; + if($active == $option) + { + $selected = "selected"; + } + echo "\n"; + } + + +} + +function EditBlock($block_id) +{ + global $db; + if(isset($_POST['processed'])) + { + //Secure our data to prevent injection attacks. + $weight = (int) addslashes($_POST['weight']); + $dir_name = addslashes($_POST['dir_name']); + $position = (int) addslashes($_POST['position']); + $active = addslashes($_POST['active']); + + if(!is_int($weight) || empty($dir_name) || empty($title) || !is_int($position)) + { + echo "You must fill everything out before proceeding."; + return; + } + + //Update the database with the new data. + $db->Query("UPDATE bayonet_blocks SET weight = '$weight', dir_name = '$dir_name', position = '$position', active = '$active' WHERE block_id = '$block_id'"); + //$isActive = $active ? "IS" : "IS NOT"; + echo "Block, '$dir_name', at position '$weight' has been edited.\n"; + PageRedirect(3, "?op=blocks"); + //die, because we have completed what we wanted to do. + return; + } + + //Grab the page from the database according to the $page_id passed to the function. + $result = $db->Query("SELECT weight,dir_name,position,active,title FROM bayonet_blocks WHERE block_id = '$block_id'"); + while(($row = $db->Fetch($result))!=false) + { + //We only want one row, so we don't have to $block[]... No foreach necessary. + $block = $row; + } + + ?> +
+ + + + + + + + +
Title
Weight
Position
Directory Name
Active + +
+
+ Query("SELECT dir_name FROM bayonet_blocks WHERE block_id = '$block_id'"); + $block = $db->Fetch($result); + + if(isset($_POST['proceed'])) + { + echo "Block '{$block['dir_name']}', was deleted."; + $db->Query("DELETE FROM bayonet_blocks WHERE block_id = '$block_id' LIMIT 1"); + return; + } + if(isset($_POST['cancel'])) + { + echo "User cancelled deletion of page: '{$block['dir_name']}'"; + return; + } + + ?> +
+ + + +
Are you SURE you want to delete the block titled: ''?
   
+
+ \ No newline at end of file diff --git a/admin/blocks/index.php b/admin/blocks/index.php new file mode 100644 index 0000000..8d63b6d --- /dev/null +++ b/admin/blocks/index.php @@ -0,0 +1,59 @@ +. + */ + +/** + * This file administers the site blocks. + * + * -weight + * -directory name + */ + +if(!defined("ADMIN_FILE")) +{ + die("Access denied."); +} + + +include $basedir.'blocks/functions.php'; + +if(isset($_GET['edit'])) +{ + $block_id = $_GET['edit']; + EditBlock($block_id); + return; +} + +if(isset($_GET['delete'])) +{ + $block_id = $_GET['delete']; + DeleteBlock($block_id); + return; +} + +if(isset($_GET['create'])) +{ + NewBlock(); + return; +} + +echo "
".LinkInternal('Create a Block','?load=admin&op=blocks&create=true')."
"; + +ListBlocks(); + +?> \ No newline at end of file diff --git a/admin/calendar/functions.php b/admin/calendar/functions.php new file mode 100644 index 0000000..d0c13ec --- /dev/null +++ b/admin/calendar/functions.php @@ -0,0 +1,426 @@ +. + */ + +/** + * Note to anyone feeling the need to edit this file... + * You MUST declare $db as global inside your functions in order access MySQL from here. + */ + + /** + * SelectDate($date) + * Function for outputing an html form for selecting a month day and year + * @param date - formatted date string yyyy-mm-dd (optional) + */ + function SelectDate($date = NULL){ + + //function for adding to the db in sql 'datetime' format + //$date = date("Y-m-d h:i:s", mktime(8, 30, 0, 10, 26, 2009)); + //$date = "2009-11-2"; + //echo $date."
"; + //function for parsing our date format into an array + //echo "
";
+	$date_arr = date_parse($date); //returns an associative array $array['year']
+	//print_r($date_arr);
+	//echo "
"; + //echo $date_arr['year']." ".$date_arr['month']." ".$date_arr['day']."
";; + + //List Months + echo '"; + + //List Days + echo '"; + + //List Years [CurYear, CurYear+5] + echo '"; + + } + + function ListEvents($date){ + + global $db; + +?> +
+

Events for:

+
+ Add New Event +
+"; + + $result = $db->Query("SELECT * FROM bayonet_events WHERE `date` = '$date' ORDER BY `time`"); + while(($row = $db->Fetch($result))!=false) + { + $tmp = true; + + $datetime = date_create($date.' '.$row['time']); + $time = date_format($datetime, 'g:ia'); //gets time in hour:minutes am|pm +?> + + + +      + + Edit +  |  + Delete + + + +

+ + + +
+ +There are no events posted for this day."; + + echo ""; + + } + + function EditEvent($event_id){ + + //function for adding to the db in sql 'datetime' format + //$date = date("Y-m-d h:i:s", mktime(8, 30, 0, 10, 26, 2009)); + /* + echo $date."
"; + + //function for parsing our date format into an array + echo "
";
+	$date_arr = date_parse($date); //returns an associative array $array['year']
+	print_r($date_arr);
+	echo "
"; + + echo $date_arr['year']; */ + + global $db; + $result = $db->Query("SELECT * FROM `bayonet_events` WHERE `event_id` = $event_id LIMIT 1"); + while(($row = $db->Fetch($result))!=false) + { + $event = $row; + } + ?> +

Edit Event

+
+ + + + + + +
Title
Color
Date
Text
+
+ Query("INSERT INTO `bayonet_events` (`event_id` ,`date` ,`time` ,`title` ,`text` ,`color`)VALUES (NULL , '$date', '$time', '$title', '$text', '$color')"); + + //echo ''; + } + + + echo "New event, '$title', has been added.\n"; + //die, because we have completed what we wanted to do. + return; + } + + ?> +

Add New Event

+
+ + + + + + + +
Title
Color
Date
Time
Text
+
+ Query("SELECT title FROM bayonet_events WHERE event_id = '$event_id'"); + $event = $db->Fetch($result); + + if(isset($_POST['proceed'])) + { + echo "Event '{$event['title']}', was deleted."; + $db->Query("DELETE FROM bayonet_events WHERE event_id = '$event_id' LIMIT 1"); + return; + } + if(isset($_POST['cancel'])) + { + echo "User cancelled deletion of event: '{$event['title']}'"; + return; + } + if($event_id <= 0 || !is_numeric($event_id)) { + echo "Invalid request to delete this event."; + return; + } + ?> + +
+ + + +
Are you SURE you want to delete the event titled: ''?
   
+
+ 0 && $month < 13 && $year > 1990){ + $useCurDate = false; + } + //check to see if the get variables are for todays month + if($month == date('n', $date) && $year == date('Y', $date)){ + $useCurDate = true; + } + + //use current date unless GET values are set + if($useCurDate) + { + $day = date('d', $date); + $today = date('j', $date); + $month = date('m', $date); + $monthNum = date('n', $date); + $year = date('Y', $date); + } + else + { + $monthNum = $month; + //if GET values are equal to curdate, set $today + if($year == date('Y', $date) && $monthNum == date('n', $date)) + $today = date('j', $date); + else + $today = 0; + } + + /* Accounts for the last couple days from the previous months */ + $first_day = mktime(0,0,0,$monthNum, 1, $year); + + $title = date('F', $first_day); + + $day_of_week = date('D', $first_day); + + switch($day_of_week){ + case "Sun": $blank = 0; break; + case "Mon": $blank = 1; break; + case "Tue": $blank = 2; break; + case "Wed": $blank = 3; break; + case "Thu": $blank = 4; break; + case "Fri": $blank = 5; break; + case "Sat": $blank = 6; break; + } + + /* calculates the days in the current month */ + $days_in_month = cal_days_in_month(0, $monthNum, $year); + + //makes sure that previous year is not year 0 + if($monthNum == 1){ + $previous_month = 12; + $previous_year = $year-1; + }else{ + $previous_month = $monthNum-1; + $previous_year = $year; + } + //makes sure the next year is not year 13 + if($monthNum == 12){ + $next_month = 1; + $next_year = $year+1; + }else{ + $next_month = $monthNum+1; + $next_year = $year; + } + ?> +
+ + + + + + + + + + + + 0){ + $blank = $blank-1; + $days_before = $days_monthbefore-$blank; + echo ''; //'.$days_before.''; + $day_count++; + } + + //loop printing each day of the CURRENT month ONLY + while($day_num <= $days_in_month){ + + if($day_count==1 || $day_count==7){ + echo ''; + + $day_num++; + $day_count++; + + if($day_count > 7){ + echo ''; + $day_count = 1; + } + } + + $days_after = 1; + //loop for printing the days for the next month + while($day_count > 1 && $day_count <=7){ + echo ''; //'.$days_after.''; + $days_after++; + $day_count++; + } + + ?> + + +
+ << + +      + >> +
SunMonTueWedThuFriSat
'.$days_before.''; //weekends + }else{ + echo ''; //weekdays + } + + $sqlDate = $year.'-'.$monthNum.'-'.$day_num; //old way NOT unix + + //checks to see if the current day has events + $isEvent=false; + /* $get_events = mysql_query("SELECT * FROM `mybb_events` WHERE `starttime` = $checkUnixTime "); + while($echo_events = mysql_fetch_array($get_events)){ + $isEvent=true; + } */ + global $db; + $result = $db->Query("SELECT title,color FROM bayonet_events WHERE `date` = '$sqlDate' LIMIT 1"); + while(($row = $db->Fetch($result))!=false) + { + $isEvent = true; + } + if($useCurDate) + echo ""; + else + echo ""; + + if($day_num == $today && $isEvent==true){ + echo '
'.$day_num.'
'; + }else if($day_num == $today && $isEvent==false){ + echo '
'.$day_num.'
'; + }else if($day_num != $today && $isEvent==true){ + echo '
'; + echo $day_num; + echo '
'; + }else{ + echo $day_num; + } + echo "
"; + + echo '
'.$days_after.'
+
+ \ No newline at end of file diff --git a/admin/calendar/index.php b/admin/calendar/index.php new file mode 100644 index 0000000..64798e3 --- /dev/null +++ b/admin/calendar/index.php @@ -0,0 +1,91 @@ +. + */ + ?> + +

- Manage Calendar & Events

+ -Edit events needs to be completed. + + + + + + + + + +
+ Add New Event

+ + Click on a day to add/edit/delete events +
+ +
+ diff --git a/admin/functions.php b/admin/functions.php new file mode 100644 index 0000000..07bc20b --- /dev/null +++ b/admin/functions.php @@ -0,0 +1,568 @@ +. + */ + +/** + * bbcode_format() + * + * Modified public domain code from www.phpit.net + * + * @param mixed $str + * @return + */ +function bbcode_format ($str) +{ + $str = htmlentities($str); + $str = strip_tags($str); + $str = wordwrap($str,100,"\n",true); + + $simple_search = array( + '/\[b\](.*?)\[\/b\]/is', + '/\[i\](.*?)\[\/i\]/is', + '/\[u\](.*?)\[\/u\]/is', + '/\[hr\]/is', + '/\[pi\](.*?)\[\/pi\]/is', + '/\[center\](.*?)\[\/center\]/is', + '/\[title\](.*?)\[\/title\]/is', + '/\[article\](.*?)\[\/article\]/is', + '/\[section\](.*?)\[\/section\]/is', + '/\[code\](.*?)\[\/code\]/is', + '/\[quote\](.*?)\[\/quote\]/is', + '/\[quote\=(.*?)\](.*?)\[\/quote\]/is', + '/\[url\=(.*?)\](.*?)\[\/url\]/is', + '/\[align\=(.*?)\](.*?)\[\/align\]/is', + '/\[size\=(.*?)\](.*?)\[\/size\]/is', + '/\[img\=(.*?)\](.*?)\[\/img\]/is' + ); + + $simple_replace = array( + '$1', + '$1', + '$1', + '
', + '

$1

', + '
$1
', + '

$1

', + '

$1

', + '

$1

', + '
$1
', + '
$1
', + '$1 wrote:
$2
', + '$2', + '$2', + '$2', + '$2' + ); + + $order = array("\r\n", "\n", "\r"); + $replace = "\n
"; + + $str = preg_replace ($simple_search, $simple_replace, $str); + $str = str_ireplace($order,$replace,$str); + return $str; +} + + //BBcode 2 HTML was written by WAY2WEB.net + + function BBCode($Text) + { + // Replace any html brackets with HTML Entities to prevent executing HTML or script + // Don't use strip_tags here because it breaks [url] search by replacing & with amp + $Text = str_replace("<", "<", $Text); + $Text = str_replace(">", ">", $Text); + + // Convert new line chars to html
tags + $Text = nl2br($Text); + + // Set up the parameters for a URL search string + $URLSearchString = " a-zA-Z0-9\:\/\-\?\&\.\=\_\~\#\'"; + // Set up the parameters for a MAIL search string + $MAILSearchString = $URLSearchString . " a-zA-Z0-9\.@"; + + // Perform URL Search + $Text = preg_replace("/\[url\]([$URLSearchString]*)\[\/url\]/", '$1', $Text); + $Text = preg_replace("(\[url\=([$URLSearchString]*)\](.+?)\[/url\])", '$2', $Text); + //$Text = preg_replace("(\[url\=([$URLSearchString]*)\]([$URLSearchString]*)\[/url\])", '$2', $Text); + + // Perform MAIL Search + $Text = preg_replace("(\[mail\]([$MAILSearchString]*)\[/mail\])", '$1', $Text); + $Text = preg_replace("/\[mail\=([$MAILSearchString]*)\](.+?)\[\/mail\]/", '$2', $Text); + + // Check for bold text + $Text = preg_replace("(\[b\](.+?)\[\/b])is",'$1',$Text); + + // Check for Italics text + $Text = preg_replace("(\[i\](.+?)\[\/i\])is",'$1',$Text); + + // Check for Underline text + $Text = preg_replace("(\[u\](.+?)\[\/u\])is",'$1',$Text); + + // Check for strike-through text + $Text = preg_replace("(\[s\](.+?)\[\/s\])is",'$1',$Text); + + // Check for over-line text + $Text = preg_replace("(\[o\](.+?)\[\/o\])is",'$1',$Text); + + // Check for colored text + $Text = preg_replace("(\[color=(.+?)\](.+?)\[\/color\])is","$2",$Text); + + // Check for sized text + $Text = preg_replace("(\[size=(.+?)\](.+?)\[\/size\])is","$2",$Text); + + // Check for list text + $Text = preg_replace("/\[list\](.+?)\[\/list\]/is", '' ,$Text); + $Text = preg_replace("/\[list=1\](.+?)\[\/list\]/is", '' ,$Text); + $Text = preg_replace("/\[list=i\](.+?)\[\/list\]/s", '' ,$Text); + $Text = preg_replace("/\[list=I\](.+?)\[\/list\]/s", '' ,$Text); + $Text = preg_replace("/\[list=a\](.+?)\[\/list\]/s", '' ,$Text); + $Text = preg_replace("/\[list=A\](.+?)\[\/list\]/s", '' ,$Text); + $Text = str_replace("[*]", "
  • ", $Text); + + // Check for font change text + $Text = preg_replace("(\[font=(.+?)\](.+?)\[\/font\])","$2",$Text); + + // Declare the format for [code] layout + $CodeLayout = ' + + + + + + +
    Code:
    $1
    '; + // Check for [code] text + $Text = preg_replace("/\[code\](.+?)\[\/code\]/is","$CodeLayout", $Text); + // Declare the format for [php] layout + $phpLayout = ' + + + + + + +
    Code:
    $1
    '; + // Check for [php] text + $Text = preg_replace("/\[php\](.+?)\[\/php\]/is",$phpLayout, $Text); + + // Declare the format for [quote] layout + $QuoteLayout = ' + + + + + + +
    Quote:
    $1
    '; + + // Check for [quote] text + $Text = preg_replace("/\[quote\](.+?)\[\/quote\]/is","$QuoteLayout", $Text); + + // Images + // [img]pathtoimage[/img] + $Text = preg_replace("/\[img\](.+?)\[\/img\]/", '', $Text); + + //[img=align]image source[/img] + $Text = preg_replace("(\[img align\=(.+?)\](.+?)\[\/img\])is","",$Text); + + // [img=widthxheight]image source[/img] + $Text = preg_replace("/\[img\=([0-9]*)x([0-9]*)\](.+?)\[\/img\]/", '', $Text); + + // Alignment + // [align=type]text[/align] + $Text = preg_replace("(\[align=(.+?)\](.+?)\[\/align\])is","
    $2
    ",$Text); + + return $Text; + } + +function articleHeading($text){ + + // Set the content-type + header('Content-type: image/png'); + + //$text = $_GET['text']; + + $im = imagecreatefrompng('images/news_header.png'); // open image + imagealphablending($im, true); // setting alpha blending on + imagesavealpha($im, true); // save alphablending setting (important) + + // Create some colors + $black = imagecolorallocate($im, 0, 0, 0); + + + // Replace path by your own font path + //$font = 'TrajanPro-Regular.otf'; + //$font = 'TrajanPro-Bold.otf'; + $font = 'BrushScriptStd.otf'; + //$font = 'TRATS__.TTF'; + //$text = strtoupper($text); + + // Add the text + imagettftext($im, 18, 0, 0, 17, $black, $font, $text); + + // Using imagepng() results in clearer text compared with imagejpeg() + imagepng($im); + imagedestroy($im); +} + +function LinkList($array) +{ + if(!is_array($array)) + { + ReportError("List was not an array"); + return; + } + + echo "
      "; + foreach($array as $text => $link) + { + echo "
    • $text
    • "; + } + echo "
    "; +} + +/** + * LinkModule() + * + * Helper function to link to Bayonet modules. + * + * @param mixed $module_name + * @param mixed $link_name + * @return + */ +function LinkModule($module_name,$args = NULL,$link_name) +{ + return "{$link_name}"; +} + +/** + * LinkPage() + * + * Helper function to link to Bayonet pages. + * + * @param mixed $page_id + * @param mixed $page_name + * @return + */ +function LinkPage($page_id,$page_name) +{ + return "{$page_name}"; +} + +/** + * LinkInternal() + * + * Helper function to link to a relative Bayonet path. + * + * @param mixed $name + * @param string $rel_path + * @param string $file + * @return + */ +function LinkInternal($name,$file,$rel_path = "./") +{ + return "{$name}"; +} + +if(!defined("CALLED_FROM_ADMIN")) +{ + /** + * OpenTable() + * + * Begins a Bayonet site table. + * + * @return + */ + function OpenTable($width = "100%") + { + //width="100%" is important. Otherwise all of our tables will be text width. + echo "\n"; + } + + /** + * CloseTable() + * + * Closes a Bayonet site table. + * + * @return + */ + function CloseTable() + { + echo "
    "; + } +} + +function OpenBlock($title = 'New Block') +{ + OpenTable(); + echo "
    {$title}
    "; + echo "
    "; +} + +function CloseBlock() +{ + echo "
    "; + CloseTable(); +} +/** + * ReportError() + * + * This function should be called in the event that an error has occured. + * + * @param mixed $message - automatically logged + * @return + */ +function ReportError($message) +{ + //WriteLog($message,BAYONET_LOG_ERROR); + OpenTable(); + echo "Error Message{$message}"; + CloseTable(); +} + +/** + * ReportHack() + * + * This function should be called in the event that we are confirming + * a hacking attempt. + * + * @param mixed $message - automatically logged + * @return void + */ +function ReportHack($message) +{ + //WriteLog($message,BAYONET_LOG_HACK); + OpenTable(); + echo "Hack Attempt{$message}"; + CloseTable(); +} + + +/** + * array_dump() + * + * Useful against $_POST and $_GET variables, for dumping data to + * a log file, or to stdout. The return value is a single string, + * with each array key => value pair delimited by a character. + * The default character is a pipe -> '|'. It is assumed that if + * wanted to have a newline character inserted, just replace $spacer + * with '\n'. + * + * @param mixed $array + * @param string $spacer + * @return + */ +function array_dump($array, $spacer = '|') +{ + $retval = NULL; + foreach($array as $challenge => $answer) + { + $retval .= " $challenge => $answer " . $spacer; + } + + return $retval; +} + +/** + * WriteLog() + * + * This function can be accessed directly, however, anything that is + * passed to ReportError() or ReportHack(), or decho() will be logged in their + * appropriate log file. + * + * Change made: added checks to see if the log files exist before opening + * + * @param mixed $message + * @param mixed $flag + * @return + */ +define('BAYONET_LOG_HACK','bayonet_log_hack'); +define('BAYONET_LOG_ERROR','bayonet_log_error'); +define('BAYONET_LOG_WARN','bayonet_log_warn'); +define('BAYONET_LOG_INFO','bayonet_log_info'); + +function WriteLog($message,$flag) +{ + global $config; + $enabled = $config['logs']['enabled']; + + if(!$enabled) + { + return false; + } + + $dir = $config['logs']['dir']; + date_default_timezone_set($config['logs']['timezone']); + $varstr = array_dump($_GET); + $type = NULL; + $ip = $_SERVER['REMOTE_ADDR']; + $hostname = gethostbyaddr($ip); + $executed = $_SERVER['PHP_SELF']; + $timestamp = date('Y-M-d H:i:s T'); + + + $message = str_replace("\n",'',$message); + $message = str_replace("
    ",'',$message); + + switch($flag) + { + case BAYONET_LOG_HACK: + if(!file_exists($dir.'hacks.log')){ + break; + } + $fp = fopen($dir.'hacks.log','a'); + $type = 'HACK'; + $full_message = "TIMESTAMP: {$timestamp}\n\t\tIP: {$ip}\n\t\tHOSTNAME: {$hostname}\n\t\tACTION: {$type} of {$executed}\n\t\tDEFERRAL: {$message}\n\t\tVAR: ({$varstr})\n\n"; + break; + case BAYONET_LOG_ERROR: + if(!file_exists($dir.'error.log')){ + break; + } + $fp = fopen($dir.'error.log','a'); + $type = 'ERROR'; + $full_message = "({$timestamp}) - {$type} - {$message} - ({$varstr})\n"; + break; + case BAYONET_LOG_WARN: + if(!file_exists($dir.'warn.log')){ + break; + } + $fp = fopen($dir.'warn.log','a'); + $type = 'WARN'; + $full_message = "({$timestamp}) - {$type} - {$message} - ({$varstr})\n"; + break; + case BAYONET_LOG_INFO: + if(!file_exists($dir.'info.log')){ + break; + } + $fp = fopen($dir.'info.log','a'); + $type = 'INFO'; + $full_message = "({$timestamp}) - {$type} - {$message}\n"; + break; + default: + echo 'To log something, you need to define a log to write to.
    '; + return; + } + if(file_exists($fp)){ + fwrite($fp,$full_message); + fclose($fp); + }else{ + //echo "could not write to file because file does not exist.
    "; + } +} + +/** + * UnderConstruction() + * + * Displays a site-wide message across the page header. + * + * @param mixed $message + * @param mixed $flag Acceptable flags are BAYONET_SITE, and BAYONET_SECTION + * @return + */ +define('BAYONET_SITE','bayonet_site'); +define('BAYONET_SECTION','bayonet_section'); +function UnderConstruction($message = NULL, $flag = BAYONET_SITE) +{ + $timestamp = date("Y-M-d h:m:s"); + OpenTable(); + switch($flag) + { + case BAYONET_SITE: + echo "Site is currently under construction : $timestamp"; + break; + case BAYONET_SECTION: + echo "Section currently under construction : $timestamp"; + } + + if(!is_null($message)) + { + echo "$message"; + } + + CloseTable(); + echo "
    "; +} + +/** + * GetBlocks() + * + * Includes all directories listed in blocks/ and uses the bayonet_blocks + * MySQL table to determine the order of the blocks displayed. + * + * @return + */ + +define('BLOCK_LEFT',false); +define('BLOCK_RIGHT',false); + +function GetBlocks($position = BLOCK_LEFT) +{ + global $config; + /** + * I had to reconnect to the database for some fucking reason at this point. + * I have no idea why, but I was recieving errors telling me that $db was no longer + * an object. This is/was bullshit. + */ + $db = new Bayonet_SQL(); + $db->Connect( + $config['sql']['hostname'], + $config['sql']['username'], + $config['sql']['password'] + ); + $db->Select_db($config['sql']['database']); + + $result = $db->Query("SELECT * FROM `bayonet_blocks` ORDER BY weight, position"); + //$result = mysql_query("SELECT * FROM bayonet_blocks ORDER BY weight, position"); + while(($row = $db->Fetch($result))!==false) + { + $blocks[] = $row; + } + $db->Free($result); + + foreach($blocks as $block) + { + if($block['position'] == $position && $block['active'] == true) + { + $load = 'blocks/'.$block['dir_name'].'/index.php'; + if(file_exists($load)) + { + OpenBlock($block['title']); + include $load; + CloseBlock(); + } + else + { + ReportError("Failed to load block, '{$block['dir_name']}'. Check block config."); + } + if($config['blocks']['spacer']) echo "
    "; + } + } +} + +/** + * PageRedirect() + * + * performs an http redirect + * + * @param $delay + * @param $link + */ +function PageRedirect($delay, $link) +{ + echo ""; +} +?> \ No newline at end of file diff --git a/admin/header.php b/admin/header.php new file mode 100644 index 0000000..fae70b8 --- /dev/null +++ b/admin/header.php @@ -0,0 +1,85 @@ +. + */ + +ob_start(); +$starttime = explode(' ', microtime()); +$starttime = $starttime[1] + $starttime[0]; +?> + + + + +Bayonet CMS Admin Tools + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/admin/images/add.gif b/admin/images/add.gif new file mode 100644 index 0000000..e665474 Binary files /dev/null and b/admin/images/add.gif differ diff --git a/admin/images/add.png b/admin/images/add.png new file mode 100644 index 0000000..249350d Binary files /dev/null and b/admin/images/add.png differ diff --git a/admin/images/addnewarticle.png b/admin/images/addnewarticle.png new file mode 100644 index 0000000..0e29960 Binary files /dev/null and b/admin/images/addnewarticle.png differ diff --git a/admin/images/addnewpage.png b/admin/images/addnewpage.png new file mode 100644 index 0000000..c60c68c Binary files /dev/null and b/admin/images/addnewpage.png differ diff --git a/admin/images/announcement.png b/admin/images/announcement.png new file mode 100644 index 0000000..4521309 Binary files /dev/null and b/admin/images/announcement.png differ diff --git a/admin/images/bayonet_logo.jpg b/admin/images/bayonet_logo.jpg new file mode 100644 index 0000000..d957c7d Binary files /dev/null and b/admin/images/bayonet_logo.jpg differ diff --git a/admin/images/blocks.png b/admin/images/blocks.png new file mode 100644 index 0000000..628eba2 Binary files /dev/null and b/admin/images/blocks.png differ diff --git a/admin/images/box.png b/admin/images/box.png new file mode 100644 index 0000000..4c4bf0f Binary files /dev/null and b/admin/images/box.png differ diff --git a/admin/images/box_download.png b/admin/images/box_download.png new file mode 100644 index 0000000..d1bcb2f Binary files /dev/null and b/admin/images/box_download.png differ diff --git a/admin/images/box_upload.png b/admin/images/box_upload.png new file mode 100644 index 0000000..8a453c2 Binary files /dev/null and b/admin/images/box_upload.png differ diff --git a/admin/images/calendar.png b/admin/images/calendar.png new file mode 100644 index 0000000..6e7de1c Binary files /dev/null and b/admin/images/calendar.png differ diff --git a/admin/images/cancel.png b/admin/images/cancel.png new file mode 100644 index 0000000..c2c7c10 Binary files /dev/null and b/admin/images/cancel.png differ diff --git a/admin/images/cmsadminlogo.png b/admin/images/cmsadminlogo.png new file mode 100644 index 0000000..23ee961 Binary files /dev/null and b/admin/images/cmsadminlogo.png differ diff --git a/admin/images/cmsadminlogo2.png b/admin/images/cmsadminlogo2.png new file mode 100644 index 0000000..ad54960 Binary files /dev/null and b/admin/images/cmsadminlogo2.png differ diff --git a/admin/images/delete.gif b/admin/images/delete.gif new file mode 100644 index 0000000..2095ca8 Binary files /dev/null and b/admin/images/delete.gif differ diff --git a/admin/images/editfiles.png b/admin/images/editfiles.png new file mode 100644 index 0000000..500e206 Binary files /dev/null and b/admin/images/editfiles.png differ diff --git a/admin/images/editpage.png b/admin/images/editpage.png new file mode 100644 index 0000000..42b2728 Binary files /dev/null and b/admin/images/editpage.png differ diff --git a/admin/images/file_doc.png b/admin/images/file_doc.png new file mode 100644 index 0000000..b1da1ef Binary files /dev/null and b/admin/images/file_doc.png differ diff --git a/admin/images/file_pdf.png b/admin/images/file_pdf.png new file mode 100644 index 0000000..500e206 Binary files /dev/null and b/admin/images/file_pdf.png differ diff --git a/admin/images/file_rtf.png b/admin/images/file_rtf.png new file mode 100644 index 0000000..39304c1 Binary files /dev/null and b/admin/images/file_rtf.png differ diff --git a/admin/images/file_word.png b/admin/images/file_word.png new file mode 100644 index 0000000..3011f00 Binary files /dev/null and b/admin/images/file_word.png differ diff --git a/admin/images/modules.png b/admin/images/modules.png new file mode 100644 index 0000000..fd9c45d Binary files /dev/null and b/admin/images/modules.png differ diff --git a/admin/images/navigation.png b/admin/images/navigation.png new file mode 100644 index 0000000..f4a64ed Binary files /dev/null and b/admin/images/navigation.png differ diff --git a/admin/images/news.png b/admin/images/news.png new file mode 100644 index 0000000..4955c3a Binary files /dev/null and b/admin/images/news.png differ diff --git a/admin/images/options.png b/admin/images/options.png new file mode 100644 index 0000000..b561965 Binary files /dev/null and b/admin/images/options.png differ diff --git a/admin/images/photogallery.png b/admin/images/photogallery.png new file mode 100644 index 0000000..a161a55 Binary files /dev/null and b/admin/images/photogallery.png differ diff --git a/admin/images/user.png b/admin/images/user.png new file mode 100644 index 0000000..55bf586 Binary files /dev/null and b/admin/images/user.png differ diff --git a/admin/images/user_add.png b/admin/images/user_add.png new file mode 100644 index 0000000..534ced9 Binary files /dev/null and b/admin/images/user_add.png differ diff --git a/admin/images/user_delete.png b/admin/images/user_delete.png new file mode 100644 index 0000000..4fa8551 Binary files /dev/null and b/admin/images/user_delete.png differ diff --git a/admin/images/user_two_delete.png b/admin/images/user_two_delete.png new file mode 100644 index 0000000..36d61a0 Binary files /dev/null and b/admin/images/user_two_delete.png differ diff --git a/admin/images/user_warning.png b/admin/images/user_warning.png new file mode 100644 index 0000000..334bdbf Binary files /dev/null and b/admin/images/user_warning.png differ diff --git a/admin/images/users_two.png b/admin/images/users_two.png new file mode 100644 index 0000000..b5cbbd3 Binary files /dev/null and b/admin/images/users_two.png differ diff --git a/admin/images/users_two_add.png b/admin/images/users_two_add.png new file mode 100644 index 0000000..a211177 Binary files /dev/null and b/admin/images/users_two_add.png differ diff --git a/admin/images/users_two_warning.png b/admin/images/users_two_warning.png new file mode 100644 index 0000000..f7cc071 Binary files /dev/null and b/admin/images/users_two_warning.png differ diff --git a/admin/images/view.gif b/admin/images/view.gif new file mode 100644 index 0000000..52cbddb Binary files /dev/null and b/admin/images/view.gif differ diff --git a/admin/index.php b/admin/index.php new file mode 100644 index 0000000..665f125 --- /dev/null +++ b/admin/index.php @@ -0,0 +1,130 @@ +. + */ + + session_start(); + +include '../includes/debug.php'; +include '../includes/config.php'; +include '../includes/sql.class.php'; +include 'functions.php'; + +$db = new Bayonet_SQL(); +$db->Connect( + $config['sql']['hostname'], + $config['sql']['username'], + $config['sql']['password'] + ); +$db->Select_db($config['sql']['database']); +//$config['logs']['dir'] = "../logs/"; + +include 'header.php'; + + + if(!defined("MODULE_FILE")) + { + //die("Access denied."); + } + + define("ADMIN_FILE",'admin_file'); + include 'admin_functions.php'; + + if(isset($_GET['op']) && $_GET['op'] == 'logout') + { + logout(); + } + + if(login()) + { + //this is so dirty... sigh. + if(is_loggedin()) + { + ?> + +
    +
    + + + + + + +
    bayonet online web admin + Account Settings  |  + Logout, +
    + +
    + +
    + Administration Menu: +
    Modules','?op=modules'), + LinkInternal('
    Blocks','?op=blocks'), + LinkInternal('
    Navigation','?op=navigation'), + LinkInternal('
    Edit Admins','?op=admins') + ); + + //render administration table + CompileAdmin($th,$td); + ?> +
    +
    +
    + Module Administration: +
    Pages','?op=pages'), + LinkInternal('
    News','?op=news'), + LinkInternal('
    Calendar','?op=calendar'), + LinkInternal('
    Downloads', '?op=downloads'), + LinkInternal('
    Announcements','?op=announcements') + ); + + //render administration table + CompileAdmin($th,$td); + ?> +
    + +
    +
    + + +
    + Queries: %d | Fetches: %d
    \n", + $totaltime, ((float)memory_get_usage()/1024/1024), ((float)memory_get_peak_usage()/1024/1024), $phpversion, $db_queries, $db_fetches); + ?> +
    + +
    +
    +
    +
    + + \ No newline at end of file diff --git a/admin/modules/functions.php b/admin/modules/functions.php new file mode 100644 index 0000000..e69de29 diff --git a/admin/modules/index.php b/admin/modules/index.php new file mode 100644 index 0000000..e69de29 diff --git a/admin/navigation/functions.php b/admin/navigation/functions.php new file mode 100644 index 0000000..29aa10f --- /dev/null +++ b/admin/navigation/functions.php @@ -0,0 +1,42 @@ +. + */ + +/** + * Note to anyone feeling the need to edit this file... + * You MUST declare $db as global inside your functions in order access MySQL from here. + */ + +function ListNavigation(){ + + global $db; + $result = $db->Query("SELECT `nav_id`, `title`, `weight` FROM `bayonet_navigation` ORDER BY `weight`"); + while(($row = $db->Fetch($result))!=false) + { + $data[] = $row; + } + + echo "|0|Home|0|
    "; + + foreach($data as $nav){ + + echo "|{$nav['nav_id']}|{$nav['title']}|{$nav['weight']}|
    "; + } + +} +?> \ No newline at end of file diff --git a/admin/navigation/index.php b/admin/navigation/index.php new file mode 100644 index 0000000..f50ef55 --- /dev/null +++ b/admin/navigation/index.php @@ -0,0 +1,54 @@ +. + */ + ?> + +

    - Navigation Links

    + -Edit Order, Edit Page, Delete Pages, Add Pages
    + + \ No newline at end of file diff --git a/admin/news/functions.php b/admin/news/functions.php new file mode 100644 index 0000000..e69de29 diff --git a/admin/news/index.php b/admin/news/index.php new file mode 100644 index 0000000..e69de29 diff --git a/admin/operation.php b/admin/operation.php new file mode 100644 index 0000000..4ba80e4 --- /dev/null +++ b/admin/operation.php @@ -0,0 +1,53 @@ +. + */ + +if(!defined("ADMIN_FILE")) +{ + die("Access denied."); + return; +} + +if(!isset($_GET['op'])) +{ + echo "
    No operation selected
    \n"; + return; +} + +$op = $_GET['op']; +$basedir = './'; + +if(file_exists($basedir)) +{ + if(file_exists($basedir . $op)) + { + include $basedir . $op . '/index.php'; + } + else + { + ReportError("Administrative operation '$op' does not exist."); + } +} +else +{ + ReportError("Administrative base directory path does not exist."); +} + + + +?> \ No newline at end of file diff --git a/admin/pages/functions.php b/admin/pages/functions.php new file mode 100644 index 0000000..5dd1d91 --- /dev/null +++ b/admin/pages/functions.php @@ -0,0 +1,387 @@ +. + */ + +/** + * Note to anyone feeling the need to edit this file... + * You MUST declare $db as global inside your functions in order access MySQL from here. + */ + +function ListArticles($pageid){ + + global $db; + $result = $db->Query("SELECT article_id,title FROM bayonet_articles WHERE `page_id` = $pageid ORDER BY `weight`"); + while(($row = $db->Fetch($result))!=false) + { + $articles[] = $row; + } + + echo ""; + + ?> + + + + +
    +  Add New Article','?op=pages&edit='.$pageid.'&newarticle=true'); ?> +
    No Articles Found.
    "; + return; + } + foreach($articles as $article) + { + if($_GET['aid'] == $article['article_id']) + echo ''; + else + echo ''; + ?> + + ^ + + + + v + + + "; + + + +} + +function NewArticle($page_id) +{ + global $db; + if(isset($_POST['newarticleprocessed'])) + { + //Secure our data to prevent injection attacks. + $title = addslashes($_POST['title']); + $text = addslashes($_POST['text']); + if(empty($title) || empty($text)) + { + echo "You must fill everything out before proceeding."; + return; + } + $weight = 0; + $result = $db->Query("SELECT * FROM `bayonet_articles` WHERE `page_id` = $page_id ORDER BY `weight` DESC LIMIT 1"); + while(($row = $db->Fetch($result))!=false) + { + $weight = $row['weight']; + } + $weight++; + + //Update the database with the new data. + $db->Query("INSERT INTO `bayonet_articles` (`article_id` ,`page_id` ,`title` ,`text`, `weight`)VALUES (NULL , $page_id, '$title', '$text', '$weight')"); + echo "New article, '$title', has been added.\n"; + //die, because we have completed what we wanted to do. + return; + } + + ?> +

    Add New Article

    +
    + + + + +
    Title:
    +
    + Query("UPDATE bayonet_articles SET title = '$title', text = '$text' WHERE article_id = '$article_id'"); + echo "Article, '$title', has been edited.\n

    Please wait while you are redirected.

    + Click here if you don't feel like waiting."; + + // 3 second redirect to go back to the edit page + //echo ""; + PageRedirect(3,"?op=pages&edit={$_GET['edit']}&aid={$article_id}"); + + //die, because we have completed what we wanted to do. + return; + } + + + //Grab the page from the database according to the $article_id passed to the function. + $result = $db->Query("SELECT title,text FROM bayonet_articles WHERE article_id = '$article_id'"); + while(($row = $db->Fetch($result))!=false) + { + //We only want one row, so we don't have to $article[]... No foreach necessary. + $article = $row; + } + + + ?> +
    + + + +
    + + + Delete This Article +
    +
    + Query("SELECT title FROM bayonet_articles WHERE article_id = '$article_id'"); + $article = $db->Fetch($result); + + if(isset($_POST['proceed'])) + { + echo "Article '{$article['title']}', was deleted."; + $db->Query("DELETE FROM bayonet_articles WHERE article_id = '$article_id' LIMIT 1"); + return; + } + if(isset($_POST['cancel'])) + { + echo "User cancelled deletion of article: '{$article['title']}'"; + return; + } + ?> +
    + + + +
    Are you SURE you want to delete the article titled: ''?
       
    +
    + Query("SELECT page_id,title FROM bayonet_pages"); + while(($row = $db->Fetch($result))!=false) + { + $pages[] = $row; + } + + echo ""; + + ?> + + + + +
    +  Create New Page','?op=pages&create=true'); ?> +
    No Pages Found.
    "; + return; + } + + foreach($pages as $page) + { + if($pid == $page['page_id']) + echo ''; + else + echo ''; + ?> + + + + + + + + + + + + +  View this Page','../index.php?load=page&id='.$pid); ?> + + + + +  Delete this Page','?op=pages&delete='.$pid); ?> + + + "; + +} + +function NewPage() +{ + global $db; + if(isset($_POST['newpageprocessed'])) + { + //Secure our data to prevent injection attacks. + $title = addslashes($_POST['title']); + if(empty($title)) + { + echo "You must fill everything out before proceeding."; + return; + } + + //Update the database with the new data. + $db->Query("INSERT INTO `bayonet_pages` (`page_id` ,`author_id` ,`page_created` ,`title` ,`text`)VALUES (NULL , '0',CURRENT_TIMESTAMP , '$title', '$text')"); + + echo "New page, '$title', has been added.\n"; + //die, because we have completed what we wanted to do. + return; + } + + ?> +

    Add New Page

    +
    + + + +
    Title
    +
    + Query("UPDATE bayonet_pages SET title = '$title' WHERE page_id = '$page_id'"); + echo "Page, '$title', has been edited.\n"; + //die, because we have completed what we wanted to do. + return; + } + +?> + + + + + + + + +
    + + + + + 0){ + EditArticle($aid); + } + ?> +
    + Query("SELECT title FROM bayonet_pages WHERE page_id = '$page_id'"); + $page = $db->Fetch($result); + + if(isset($_POST['proceed'])) + { + echo "Page '{$page['title']}', was deleted."; + $db->Query("DELETE FROM bayonet_pages WHERE page_id = '$page_id' LIMIT 1"); + return; + } + if(isset($_POST['cancel'])) + { + echo "User cancelled deletion of page: '{$page['title']}'"; + return; + } + if($page_id == 1){ + echo "You can not delete the home page."; + return; + } + + ?> + +
    + + + +
    Are you SURE you want to delete the page titled: ''?
    All articles attached to this page will be deleted as well.
       
    +
    + \ No newline at end of file diff --git a/admin/pages/index.php b/admin/pages/index.php new file mode 100644 index 0000000..ce3ec74 --- /dev/null +++ b/admin/pages/index.php @@ -0,0 +1,78 @@ +. + */ + ?> + +

    - Manage Pages

    + -Order articles needs to be completed. + + + + + +"; + DeletePage($page_id); + echo ""; + //return; + } + else if(isset($_GET['create'])) + { + $create = $_GET['create']; + if($create) + { + echo ""; + //return; + } + } + else + { + echo " + "; + } + +?> + + +
    + + "; + NewPage(); + echo " + +
    + diff --git a/admin/scripts/jquery.js b/admin/scripts/jquery.js new file mode 100644 index 0000000..b1ae21d --- /dev/null +++ b/admin/scripts/jquery.js @@ -0,0 +1,19 @@ +/* + * jQuery JavaScript Library v1.3.2 + * http://jquery.com/ + * + * Copyright (c) 2009 John Resig + * Dual licensed under the MIT and GPL licenses. + * http://docs.jquery.com/License + * + * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009) + * Revision: 6246 + */ +(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("",""]||!O.indexOf("",""]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"","
    "]||!O.indexOf("",""]||(!O.indexOf("",""]||!O.indexOf("",""]||!o.support.htmlSerialize&&[1,"div
    ","
    "]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}}); +/* + * Sizzle CSS Selector Engine - v0.9.3 + * Copyright 2009, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * More information: http://sizzlejs.com/ + */ +(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return UT[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="

    ";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="
    ";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("
    ").append(M.responseText.replace(//g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='
    ';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})(); \ No newline at end of file diff --git a/admin/scripts/mocha.js b/admin/scripts/mocha.js new file mode 100644 index 0000000..a220424 --- /dev/null +++ b/admin/scripts/mocha.js @@ -0,0 +1,156 @@ +/* + * -------------------------------------------------------------------- + * Simple Password Strength Checker + * by Siddharth S, www.ssiddharth.com, hello@ssiddharth.com + * for Net Tuts, www.net.tutsplus.com + * Version: 1.0, 05.10.2009 + * -------------------------------------------------------------------- + */ + + +$(document).ready(function() +{ + var strPassword; + var charPassword; + var complexity = $("#complexity"); + var rating = $("#rating") + var minPasswordLength = 6; + var baseScore = 0, score = 0; + + var num = {}; + num.Excess = 0; + num.Upper = 0; + num.Numbers = 0; + num.Symbols = 0; + + var bonus = {}; + bonus.Excess = 3; + bonus.Upper = 4; + bonus.Numbers = 5; + bonus.Symbols = 5; + bonus.Combo = 0; + bonus.FlatLower = 0; + bonus.FlatNumber = 0; + + outputResult(); + $("#inputPassword").bind("keyup", checkVal); + +function checkVal() +{ + init(); + + if (charPassword.length >= minPasswordLength) + { + baseScore = 50; + analyzeString(); + calcComplexity(); + } + else + { + baseScore = 0; + } + + outputResult(); +} + +function init() +{ + strPassword= $("#inputPassword").val(); + charPassword = strPassword.split(""); + + num.Excess = 0; + num.Upper = 0; + num.Numbers = 0; + num.Symbols = 0; + bonus.Combo = 0; + bonus.FlatLower = 0; + bonus.FlatNumber = 0; + baseScore = 0; + score =0; +} + +function analyzeString () +{ + for (i=0; i=50 && score<75) + { + complexity.html("Good"); + rating.removeClass("strong secure").addClass("good"); + } + else if (score>=75 && score<100) + { + complexity.html("Strong"); + rating.removeClass("secure").addClass("strong"); + } + else if (score>=100) + { + complexity.html("Secure"); + rating.addClass("secure"); + } + + /* + $("#details").html("Base Score :" + baseScore + "" + + "
    Length Bonus :" + (num.Excess*bonus.Excess) + " ["+num.Excess+"x"+bonus.Excess+"] " + + "
    Upper case bonus :" + (num.Upper*bonus.Upper) + " ["+num.Upper+"x"+bonus.Upper+"] " + + "
    Number Bonus : " + (num.Numbers*bonus.Numbers) + " ["+num.Numbers+"x"+bonus.Numbers+"]" + + "
    Symbol Bonus : " + (num.Symbols*bonus.Symbols) + " ["+num.Symbols+"x"+bonus.Symbols+"]" + + "
    Combination Bonus : " + bonus.Combo + "" + + "
    Lower case only penalty : " + bonus.FlatLower + "" + + "
    Numbers only penalty : " + bonus.FlatNumber + "" + + "
    Total Score: " + score + "" ); */ +} + +} +); diff --git a/admin/settings/functions.php b/admin/settings/functions.php new file mode 100644 index 0000000..910a312 --- /dev/null +++ b/admin/settings/functions.php @@ -0,0 +1,77 @@ +. + */ + +/** + * Note to anyone feeling the need to edit this file... + * You MUST declare $db as global inside your functions in order access MySQL from here. + */ + + +function changePassword(){ + + global $db; + + if(isset($_POST['processed'])) + { + $password = $_POST['password']; + $confirm = $_POST['confirm']; + + if($password != $confirm){ + ReportError("The passwords you entered did not match."); + PageRedirect(3, "?op=settings&change=password"); + return; + }else if(strlen($password)<6){ + ReportError("The password you entered is less than 6 characters."); + PageRedirect(3, "?op=settings&change=password"); + return; + } + $newpassword = crypt(md5($password),'iamnotadirtywhorebitch'); + $username = $_SESSION['username']; + $db->Query("UPDATE `bayonet_users` SET `password` = '$newpassword' WHERE `username` = '$username' LIMIT 1"); + + echo "Your password has successfully been changed."; + PageRedirect(3,"?op=settings"); + return; + } +?> +
    +
    +

    Change Your Password

    + + + + + + + + + + + + +
    Password: + + + +
    Password Strength:
    +
    Minimum of 6 Characters
    Confirm Password:
    +
    +
    +. + */ + ?> + +

    - Account Settings

    + -Change password, email, name
    +
    + + + + + + + + + \ No newline at end of file diff --git a/admin/style.css b/admin/style.css new file mode 100644 index 0000000..19ad293 --- /dev/null +++ b/admin/style.css @@ -0,0 +1,272 @@ +body { + background-color:#225eac; + text-align:center; + font-family:sans-serif; + font-size:10pt; +} + +img { + border:0px; +} + +a, a:visited, a:active { + font-family:sans-serif; + font-size:10pt; + color:black; + text-decoration:none; +} + +a:hover { + font-family:sans-serif; + font-size:10pt; + color: #225eac; + text-decoration:none; +} + +h1, h2, h3, h4, h5, h6 { + font-family: 'Century Gothic'; + font-weight: normal; +} +h2 { + font-size:26px; +} +h3 { + font-size:20px; +} + +div.content { + width:1024px; + background-color:white; + padding:15px; +} + +td { + font-family:sans-serif; + font-size:10pt; + color:black; +} + +table.panel { + height:435px; + border:1px solid #848484; +} + +.panel-none { + width:201px; + vertical-align:top; +} + +.panel-shadow { + background-image:url("../images/rightshadow.png"); + background-position: left; + background-repeat: repeat-y; + width:201px; + padding-left: 10px; + vertical-align:top; +} + +.panel-box { + background-image:url("../images/rightshadow.png"); + background-position: left; + background-repeat: repeat-y; + padding-left: 10px; + vertical-align:top; +} + +.option-box { + background-color: #6f6f6f; +} + +table.panelitems { + font-family:sans-serif; + font-size:10pt; + color:black; +} + +table.panelitems tr { + height:20px; +} + +table.panelitems tr.highlight { + background-color: #5b8dda; +} + +/* Panel Links */ +table.panel a, table.panel a:hover, table.panel a:visited, table.panel a:active { + font-family:sans-serif; + font-size:10pt; + color:black; + text-decoration:none; +} + +/* Panel Highlight Links << must be after Panel Links */ +tr.highlight a, tr.highlight a:visited, tr.highlight a:hover, tr.highlight a:active { + font-family:sans-serif; + font-size:10pt; + color:white; +} +fieldset { + padding:0px; + border: 1px solid #a1a1a1; +} +/* START>> CALENDAR STYLES*/ + .monthTitle{ + color:black; + text-align:center; + font-size:12px; + font-weight:bold; + font-family:arial; + } + td.weekday { + width:40px; + height:20px; + background-color:#cb2121; + color:green; + text-align:center; + font-size:10px; + font-weight:bold; + } + th.weekday { + width:40px; + height:29px; + background-color:white; + color:black; + text-align:center; + font-size:11px; + font-weight:bold; + } + .monthday { + width:40px; + height:20px; + background-color:#aea2a2; + color:white; + text-align:left; + font-size:10pt; + font-weight:bold; + + } + .monthtoday { + width:38px; + height:38px; + /* background-color:#3666ba; */ + color:#225eac; + text-align:center; + font-size:14px; + font-weight:bold; + border:1px solid #333333; + } + .event { + width:38px; + height:38px; + background-color:#225eac; + text-align:center; + border:1px solid #333333; + } + table.calendar a, table.calendar a:visited, table.calendar a:active, table.calendar a:hover { + color:white; + } + .eventtoday{ + width:38px; + height:38px; + background-color:#225eac; + color:#ef8e25; + text-align:center; + font-size:14px; + font-weight:bold; + border:1px solid #333333; + } + td.cal_weekday { + width:40px; + height:40px; + background-color:#a1a1a1; + vertical-align:top; + color:#eeeeee; + font-family:arial; + text-align:center; + font-size:14px; + } + td.cal_weekend { + width:40px; + height:40px; + background-color:#8f8f8f; + vertical-align:top; + color:#eeeeee; + font-family:arial; + text-align:center; + font-size:14px; + } + td.cal_notmonth { + width:40px; + height:40px; + background-color:#6e6e6e; + vertical-align:top; + color:#d4d4d4; + text-align:left; + font-size:11px; + } +/* END>> CALENDAR STYLES */ + +/* START>> PASSWORD STYLES */ + +input{ + font-family: "Lucida Grande", "Verdana", sans-serif; +} + +#pwordCont{ + font-family: "Lucida Grande", "Verdana", sans-serif; + width: 820px; + font-size:12px; + margin-left: auto; + margin-right: auto; + padding: 50px 0 0 0; +} + +#complexity{ + color: #000; + font-size: 10px; + text-align: center; +} + +.outer { + width:180px; + height:5px; + background-color: #CCC; +} + +.default { + height:5px; + background-color: #CCC; + width:0px; +} +.short { + height:5px; + background-color: #aa0033; + width:15px; +} +.weak { + height:5px; + background-color: #aa0033; + width:45px; +} +.good { + height:5px; + background-color: #6699cc; + width:90px; +} +.strong { + height:5px; + background-color: #008000; + width:135px; +} +.secure { + height:5px; + background-color: #008000; + width:180px; +} + +span.value{ + font-weight:bold; + float: right; +} + +/* END>> PASSWORD STYLES */ \ No newline at end of file diff --git a/ajax/database/New Text Document.txt b/ajax/database/New Text Document.txt new file mode 100644 index 0000000..e69de29 diff --git a/ajax/database/getuser.php b/ajax/database/getuser.php new file mode 100644 index 0000000..bf6e677 --- /dev/null +++ b/ajax/database/getuser.php @@ -0,0 +1,38 @@ + + +Firstname +Lastname +Age +Hometown +Job +"; + +while($row = mysql_fetch_array($result)) + { + echo ""; + echo "" . $row['FirstName'] . ""; + echo "" . $row['LastName'] . ""; + echo "" . $row['Age'] . ""; + echo "" . $row['Hometown'] . ""; + echo "" . $row['Job'] . ""; + echo ""; + } +echo ""; + +mysql_close($con); +?> \ No newline at end of file diff --git a/ajax/database/index.htm b/ajax/database/index.htm new file mode 100644 index 0000000..98b0009 --- /dev/null +++ b/ajax/database/index.htm @@ -0,0 +1,20 @@ + + + + + + +
    +Select a User: + +
    +
    +
    Person info will be listed here.
    + + + \ No newline at end of file diff --git a/ajax/database/selectuser.js b/ajax/database/selectuser.js new file mode 100644 index 0000000..a91721e --- /dev/null +++ b/ajax/database/selectuser.js @@ -0,0 +1,40 @@ +var xmlhttp; + +function showUser(str) +{ +xmlhttp=GetXmlHttpObject(); +if (xmlhttp==null) + { + alert ("Browser does not support HTTP Request"); + return; + } +var url="getuser.php"; +url=url+"?q="+str; +url=url+"&sid="+Math.random(); +xmlhttp.onreadystatechange=stateChanged; +xmlhttp.open("GET",url,true); +xmlhttp.send(null); +} + +function stateChanged() +{ +if (xmlhttp.readyState==4) +{ +document.getElementById("txtHint").innerHTML=xmlhttp.responseText; +} +} + +function GetXmlHttpObject() +{ +if (window.XMLHttpRequest) + { + // code for IE7+, Firefox, Chrome, Opera, Safari + return new XMLHttpRequest(); + } +if (window.ActiveXObject) + { + // code for IE6, IE5 + return new ActiveXObject("Microsoft.XMLHTTP"); + } +return null; +} \ No newline at end of file diff --git a/ajax/form_suggestions/clienthint.js b/ajax/form_suggestions/clienthint.js new file mode 100644 index 0000000..408c220 --- /dev/null +++ b/ajax/form_suggestions/clienthint.js @@ -0,0 +1,45 @@ +var xmlhttp + +function showHint(str) +{ +if (str.length==0) + { + document.getElementById("txtHint").innerHTML=""; + return; + } +xmlhttp=GetXmlHttpObject(); +if (xmlhttp==null) + { + alert ("Your browser does not support XMLHTTP!"); + return; + } +var url="gethint.php"; +url=url+"?q="+str; +url=url+"&sid="+Math.random(); +xmlhttp.onreadystatechange=stateChanged; +xmlhttp.open("GET",url,true); +xmlhttp.send(null); +} + +function stateChanged() +{ +if (xmlhttp.readyState==4) + { + document.getElementById("txtHint").innerHTML=xmlhttp.responseText; + } +} + +function GetXmlHttpObject() +{ +if (window.XMLHttpRequest) + { + // code for IE7+, Firefox, Chrome, Opera, Safari + return new XMLHttpRequest(); + } +if (window.ActiveXObject) + { + // code for IE6, IE5 + return new ActiveXObject("Microsoft.XMLHTTP"); + } +return null; +} \ No newline at end of file diff --git a/ajax/form_suggestions/gethint.php b/ajax/form_suggestions/gethint.php new file mode 100644 index 0000000..8cb7379 --- /dev/null +++ b/ajax/form_suggestions/gethint.php @@ -0,0 +1,71 @@ +0 +if (strlen($q) > 0) + { + $hint=""; + for($i=0; $i \ No newline at end of file diff --git a/ajax/form_suggestions/index.htm b/ajax/form_suggestions/index.htm new file mode 100644 index 0000000..c2fc742 --- /dev/null +++ b/ajax/form_suggestions/index.htm @@ -0,0 +1,14 @@ + + + + + + +
    +First Name: +
    + +

    Suggestions:

    + + + \ No newline at end of file diff --git a/ajax/simple_form/index.htm b/ajax/simple_form/index.htm new file mode 100644 index 0000000..2c01922 --- /dev/null +++ b/ajax/simple_form/index.htm @@ -0,0 +1,36 @@ + + + + + +
    +Name: +Time: +
    + + + \ No newline at end of file diff --git a/ajax/simple_form/time.php b/ajax/simple_form/time.php new file mode 100644 index 0000000..3d938ae --- /dev/null +++ b/ajax/simple_form/time.php @@ -0,0 +1,6 @@ + \ No newline at end of file diff --git a/blocks/donations/index.php b/blocks/donations/index.php new file mode 100644 index 0000000..8695f68 --- /dev/null +++ b/blocks/donations/index.php @@ -0,0 +1,13 @@ + + +
    +
    +
    + + + + +
    +
    +
    diff --git a/blocks/mini_calendar/functions.php b/blocks/mini_calendar/functions.php new file mode 100644 index 0000000..06ce910 --- /dev/null +++ b/blocks/mini_calendar/functions.php @@ -0,0 +1,301 @@ +. + */ + +/** + * Note to anyone feeling the need to edit this file... + * You MUST declare $db as global inside your functions in order access MySQL from here. + */ + + /** + * SelectDate($date) + * Function for outputing an html form for selecting a month day and year + * @param date - formatted date string yyyy-mm-dd (optional) + */ + function SelectDate($date = NULL){ + + //function for adding to the db in sql 'datetime' format + //$date = date("Y-m-d h:i:s", mktime(8, 30, 0, 10, 26, 2009)); + //$date = "2009-11-2"; + //echo $date."
    "; + //function for parsing our date format into an array + //echo "
    ";
    +	$date_arr = date_parse($date); //returns an associative array $array['year']
    +	//print_r($date_arr);
    +	//echo "
    "; + //echo $date_arr['year']." ".$date_arr['month']." ".$date_arr['day']."
    ";; + + //List Months + echo '"; + + //List Days + echo '"; + + //List Years [CurYear, CurYear+5] + echo '"; + + } + + function ListEvents($date){ + + global $db; + +?> +
    +

    Events for:

    +
    + Add New Event +
    +"; + + $result = $db->Query("SELECT * FROM bayonet_events WHERE `date` = '$date' ORDER BY `time`"); + while(($row = $db->Fetch($result))!=false) + { + $tmp = true; + + $datetime = date_create($date.' '.$row['time']); + $time = date_format($datetime, 'g:ia'); //gets time in hour:minutes am|pm +?> + + + +      + + Edit +  |  + Delete + + + +

    + + + +
    + +There are no events posted for this day."; + + echo ""; + + } + + + /** + * PrintCalendar() - prints the calendar with events + */ + function PrintCalendar(){ + + $date = time(); + date_default_timezone_set("America/New_York"); //EASTERN TIME ZONE + + //GET values for month and year + $month = ""; + $year = ""; + //$month = $_GET['month']; + //$year = $_GET['year']; + + $useCurDate = true; + + //check to makes sure month and year are in the desired ranges + if(!empty($month) && !empty($year) && $month > 0 && $month < 13 && $year > 1990){ + $useCurDate = false; + } + //check to see if the get variables are for todays month + if($month == date('n', $date) && $year == date('Y', $date)){ + $useCurDate = true; + } + + //use current date unless GET values are set + if($useCurDate) + { + $day = date('d', $date); + $today = date('j', $date); + $month = date('m', $date); + $monthNum = date('n', $date); + $year = date('Y', $date); + } + else + { + $monthNum = $month; + //if GET values are equal to curdate, set $today + if($year == date('Y', $date) && $monthNum == date('n', $date)) + $today = date('j', $date); + else + $today = 0; + } + + /* Accounts for the last couple days from the previous months */ + $first_day = mktime(0,0,0,$monthNum, 1, $year); + + $title = date('F', $first_day); + + $day_of_week = date('D', $first_day); + + switch($day_of_week){ + case "Sun": $blank = 0; break; + case "Mon": $blank = 1; break; + case "Tue": $blank = 2; break; + case "Wed": $blank = 3; break; + case "Thu": $blank = 4; break; + case "Fri": $blank = 5; break; + case "Sat": $blank = 6; break; + } + + /* calculates the days in the current month */ + $days_in_month = cal_days_in_month(0, $monthNum, $year); + + //makes sure that previous year is not year 0 + if($monthNum == 1){ + $previous_month = 12; + $previous_year = $year-1; + }else{ + $previous_month = $monthNum-1; + $previous_year = $year; + } + //makes sure the next year is not year 13 + if($monthNum == 12){ + $next_month = 1; + $next_year = $year+1; + }else{ + $next_month = $monthNum+1; + $next_year = $year; + } + ?> +
    + + + + + + + + + + + + 0){ + $blank = $blank-1; + $days_before = $days_monthbefore-$blank; + echo ''; //'.$days_before.''; + $day_count++; + } + + //loop printing each day of the CURRENT month ONLY + while($day_num <= $days_in_month){ + + if($day_count==1 || $day_count==7){ + echo ''; + + $day_num++; + $day_count++; + + if($day_count > 7){ + echo ''; + $day_count = 1; + } + } + + $days_after = 1; + //loop for printing the days for the next month + while($day_count > 1 && $day_count <=7){ + echo ''; //'.$days_after.''; + $days_after++; + $day_count++; + } + + ?> + + +
    + + +      + +
    SunMonTueWedThuFriSat
    '.$days_before.''; //weekends + }else{ + echo ''; //weekdays + } + + $sqlDate = $year.'-'.$monthNum.'-'.$day_num; //old way NOT unix + + //checks to see if the current day has events + $isEvent=false; + + global $db; + $result = $db->Query("SELECT title,color FROM `bayonet_events` WHERE `date` = '$sqlDate' LIMIT 1"); + while(($row = $db->Fetch($result))!=false) + { + $isEvent = true; + } + + if($day_num == $today && $isEvent==true){ + echo '
    '.$day_num.'
    '; + }else if($day_num == $today && $isEvent==false){ + echo '
    '.$day_num.'
    '; + }else if($day_num != $today && $isEvent==true){ + echo '
    '; + echo $day_num; + echo '
    '; + }else{ + echo $day_num; + } + + echo '
    '.$days_after.'
    +
    + \ No newline at end of file diff --git a/blocks/mini_calendar/index.php b/blocks/mini_calendar/index.php new file mode 100644 index 0000000..6516646 --- /dev/null +++ b/blocks/mini_calendar/index.php @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/blocks/mini_calendar/scripts.js b/blocks/mini_calendar/scripts.js new file mode 100644 index 0000000..e69de29 diff --git a/blocks/mini_calendar/style.css b/blocks/mini_calendar/style.css new file mode 100644 index 0000000..72898ee --- /dev/null +++ b/blocks/mini_calendar/style.css @@ -0,0 +1,96 @@ +/* START>> CALENDAR STYLES*/ + .monthTitle{ + color:black; + text-align:center; + font-size:12px; + font-weight:bold; + font-family:arial; + } + td.weekday { + width:40px; + height:20px; + background-color:#cb2121; + color:green; + text-align:center; + font-size:10px; + font-weight:bold; + } + th.weekday { + width:40px; + height:29px; + background-color:white; + color:black; + text-align:center; + font-size:11px; + font-weight:bold; + } + .monthday { + width:40px; + height:20px; + background-color:#aea2a2; + color:white; + text-align:left; + font-size:10pt; + font-weight:bold; + + } + .monthtoday { + width:38px; + height:38px; + /* background-color:#3666ba; */ + color:#225eac; + text-align:center; + font-size:14px; + font-weight:bold; + border:1px solid #333333; + } + .event { + width:38px; + height:38px; + background-color:#225eac; + text-align:center; + border:1px solid #333333; + } + table.calendar a, table.calendar a:visited, table.calendar a:active, table.calendar a:hover { + color:white; + } + .eventtoday{ + width:38px; + height:38px; + background-color:#225eac; + color:#ef8e25; + text-align:center; + font-size:14px; + font-weight:bold; + border:1px solid #333333; + } + td.cal_weekday { + width:40px; + height:40px; + background-color:#a1a1a1; + vertical-align:top; + color:#eeeeee; + font-family:arial; + text-align:center; + font-size:14px; + } + td.cal_weekend { + width:40px; + height:40px; + background-color:#8f8f8f; + vertical-align:top; + color:#eeeeee; + font-family:arial; + text-align:center; + font-size:14px; + } + td.cal_notmonth { + width:40px; + height:40px; + background-color:#6e6e6e; + vertical-align:top; + color:#d4d4d4; + text-align:left; + font-size:11px; + } +/* END>> CALENDAR STYLES */ \ No newline at end of file diff --git a/blocks/rss_agw/index.php b/blocks/rss_agw/index.php new file mode 100644 index 0000000..83c3ff1 --- /dev/null +++ b/blocks/rss_agw/index.php @@ -0,0 +1,29 @@ + +load('http://www.armedglobalwarfare.com/index.php?type=rss;action=.xml;limit=30'); + + $items = $rss->getItems(); #returns all rss items + + $numFeeds = 0; + echo "
    "; + foreach($items as $story){ + if($story['category']=="Tournament Announcements"){ + $numFeeds++; + echo "{$story['title']}
    + {$story['pubDate']}
    + {$story['description']}

    "; + } + } + if(!$numFeeds){ + echo "No new updates for this news feed."; + } + echo "
    "; + // echo "
    ";
    +  //print_r($items);
    +   // echo "
    "; +?> diff --git a/blocks/rss_agw/rssreader.php b/blocks/rss_agw/rssreader.php new file mode 100644 index 0000000..41fa238 --- /dev/null +++ b/blocks/rss_agw/rssreader.php @@ -0,0 +1,161 @@ + + Published: 200801 :: blacknet :: via rssphp.net + + RSS_PHP is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. + + Usage: + See the documentation at http://rssphp.net/documentation + Examples: + Can be found online at http://rssphp.net/examples +*/ + +class rss_php { + + public $document; + public $channel; + public $items; + +/**************************** + public load methods +***/ + # load RSS by URL + public function load($url=false, $unblock=true) { + if($url) { + if($unblock) { + $this->loadParser(file_get_contents($url, false, $this->randomContext())); + } else { + $this->loadParser(file_get_contents($url)); + } + } + } + # load raw RSS data + public function loadRSS($rawxml=false) { + if($rawxml) { + $this->loadParser($rawxml); + } + } + +/**************************** + public load methods + @param $includeAttributes BOOLEAN + return array; +***/ + # return full rss array + public function getRSS($includeAttributes=false) { + if($includeAttributes) { + return $this->document; + } + return $this->valueReturner(); + } + # return channel data + public function getChannel($includeAttributes=false) { + if($includeAttributes) { + return $this->channel; + } + return $this->valueReturner($this->channel); + } + # return rss items + public function getItems($includeAttributes=false) { + if($includeAttributes) { + return $this->items; + } + return $this->valueReturner($this->items); + } + +/**************************** + internal methods +***/ + private function loadParser($rss=false) { + if($rss) { + $this->document = array(); + $this->channel = array(); + $this->items = array(); + $DOMDocument = new DOMDocument; + $DOMDocument->strictErrorChecking = false; + $DOMDocument->loadXML($rss); + $this->document = $this->extractDOM($DOMDocument->childNodes); + } + } + + private function valueReturner($valueBlock=false) { + if(!$valueBlock) { + $valueBlock = $this->document; + } + foreach($valueBlock as $valueName => $values) { + if(isset($values['value'])) { + $values = $values['value']; + } + if(is_array($values)) { + $valueBlock[$valueName] = $this->valueReturner($values); + } else { + $valueBlock[$valueName] = $values; + } + } + return $valueBlock; + } + + private function extractDOM($nodeList,$parentNodeName=false) { + $itemCounter = 0; + foreach($nodeList as $values) { + if(substr($values->nodeName,0,1) != '#') { + if($values->nodeName == 'item') { + $nodeName = $values->nodeName.':'.$itemCounter; + $itemCounter++; + } else { + $nodeName = $values->nodeName; + } + $tempNode[$nodeName] = array(); + if($values->attributes) { + for($i=0;$values->attributes->item($i);$i++) { + $tempNode[$nodeName]['properties'][$values->attributes->item($i)->nodeName] = $values->attributes->item($i)->nodeValue; + } + } + if(!$values->firstChild) { + $tempNode[$nodeName]['value'] = $values->textContent; + } else { + $tempNode[$nodeName]['value'] = $this->extractDOM($values->childNodes, $values->nodeName); + } + if(in_array($parentNodeName, array('channel','rdf:RDF'))) { + if($values->nodeName == 'item') { + $this->items[] = $tempNode[$nodeName]['value']; + } elseif(!in_array($values->nodeName, array('rss','channel'))) { + $this->channel[$values->nodeName] = $tempNode[$nodeName]; + } + } + } elseif(substr($values->nodeName,1) == 'text') { + + $tempValue = trim(preg_replace('/\s\s+/',' ',str_replace("\n",' ', $values->textContent))); + if($tempValue) { + $tempNode = $tempValue; + } + } elseif(substr($values->nodeName,1) == 'cdata-section'){ + $tempNode = $values->textContent; + } + } + return $tempNode; + } + + private function randomContext() { + $headerstrings = array(); + $headerstrings['User-Agent'] = 'Mozilla/5.0 (Windows; U; Windows NT 5.'.rand(0,2).'; en-US; rv:1.'.rand(2,9).'.'.rand(0,4).'.'.rand(1,9).') Gecko/2007'.rand(10,12).rand(10,30).' Firefox/2.0.'.rand(0,1).'.'.rand(1,9); + $headerstrings['Accept-Charset'] = rand(0,1) ? 'en-gb,en;q=0.'.rand(3,8) : 'en-us,en;q=0.'.rand(3,8); + $headerstrings['Accept-Language'] = 'en-us,en;q=0.'.rand(4,6); + $setHeaders = 'Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5'."\r\n". + 'Accept-Charset: '.$headerstrings['Accept-Charset']."\r\n". + 'Accept-Language: '.$headerstrings['Accept-Language']."\r\n". + 'User-Agent: '.$headerstrings['User-Agent']."\r\n"; + $contextOptions = array( + 'http'=>array( + 'method'=>"GET", + 'header'=>$setHeaders + ) + ); + return stream_context_create($contextOptions); + } + +} + +?> \ No newline at end of file diff --git a/blocks/rss_agw/style.css b/blocks/rss_agw/style.css new file mode 100644 index 0000000..0bc6e81 --- /dev/null +++ b/blocks/rss_agw/style.css @@ -0,0 +1,17 @@ + .rss img { + display: none; + } + .rss span.title{ + font-size: 16px; + font-weight: bold; + /* text-decoration:underline; */ + } + + .rss span.date{ + font-family: 'Trebuchet MS', Trebuchet, Verdana, sans-serif; + font-size: 11px; + text-transform: uppercase; + font-weight:bold; + text-align: center; + letter-spacing: 2px; + } \ No newline at end of file diff --git a/blocks/server_monitor/index.php b/blocks/server_monitor/index.php new file mode 100644 index 0000000..791a5b2 --- /dev/null +++ b/blocks/server_monitor/index.php @@ -0,0 +1,16 @@ +\n +link}\">{$server->name}
    \n +IP: {$server->ip}:{$server->port}
    \n +Players: {$server->player}/{$server->maxplayer}
    \n +\n +
    \n"; +CloseBlock(); + +?> \ No newline at end of file diff --git a/blocks/soldier_info/index.php b/blocks/soldier_info/index.php new file mode 100644 index 0000000..f40f528 --- /dev/null +++ b/blocks/soldier_info/index.php @@ -0,0 +1,25 @@ +
    + + Your IP:
    +

    '.$postnum.' post(s)

    +
    + + + Welcome, '.$logged_username.'
    +  Logout
    '; + } + else{ + echo 'Welcome Guest.
    + +
    '; + } + if ($logged_in == 'true'){ + echo'
    + Private Messages
    + Unread: '.$pm_unread.'
    + Total: '.$pm_total.'

    '; + } +?> + \ No newline at end of file diff --git a/blocks/tsviewer/index.php b/blocks/tsviewer/index.php new file mode 100644 index 0000000..cee0be4 --- /dev/null +++ b/blocks/tsviewer/index.php @@ -0,0 +1,18 @@ +\n"; +////until it works again i'm going to have this here... +//echo "TSViewer is not working."; +//echo "\n"; +//CloseBlock(); +//return; //die + +?> + + + +\n"; +CloseBlock(); ?> diff --git a/footer.php b/footer.php new file mode 100644 index 0000000..df7d61a --- /dev/null +++ b/footer.php @@ -0,0 +1,46 @@ +. + */ + +$phpversion = preg_replace('/[a-z-]/', '', phpversion()); +$mtime = explode(' ', microtime()); +$totaltime = $mtime[0] + $mtime[1] - $starttime; +$debug_output = sprintf("Page generated in %.3f seconds | Memory: real(%.3fmb) peak(%.3fmb) | PHP: %s
    Queries: %d | Fetches: %d
    \n", + $totaltime, ((float)memory_get_usage()/1024/1024), ((float)memory_get_peak_usage()/1024/1024), $phpversion, $db_queries, $db_fetches); +?> + + + + + + \ No newline at end of file diff --git a/functions.js b/functions.js new file mode 100644 index 0000000..88a7412 --- /dev/null +++ b/functions.js @@ -0,0 +1,8 @@ +function gotoEditPage(id) +{ + var pageid = document.getElementById(id).value; + if(pageid == 0) + location.href="?load=admin&op=pages"; + else + location.href="?load=admin&op=pages&edit="+pageid; +} \ No newline at end of file diff --git a/header.php b/header.php new file mode 100644 index 0000000..0a79f4d --- /dev/null +++ b/header.php @@ -0,0 +1,50 @@ +. + */ + +ob_start(); +$starttime = explode(' ', microtime()); +$starttime = $starttime[1] + $starttime[0]; +?> + + + + + +3rd Infantry Division - 8 years strong - ArmaII Unit + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/images/add.gif b/images/add.gif new file mode 100644 index 0000000..836dbf2 Binary files /dev/null and b/images/add.gif differ diff --git a/images/addnewarticle.png b/images/addnewarticle.png new file mode 100644 index 0000000..0e29960 Binary files /dev/null and b/images/addnewarticle.png differ diff --git a/images/addnewpage.png b/images/addnewpage.png new file mode 100644 index 0000000..c60c68c Binary files /dev/null and b/images/addnewpage.png differ diff --git a/images/annoucement.png b/images/annoucement.png new file mode 100644 index 0000000..c70591d Binary files /dev/null and b/images/annoucement.png differ diff --git a/images/announcement.png b/images/announcement.png new file mode 100644 index 0000000..c70591d Binary files /dev/null and b/images/announcement.png differ diff --git a/images/arrowleft.png b/images/arrowleft.png new file mode 100644 index 0000000..502ae41 Binary files /dev/null and b/images/arrowleft.png differ diff --git a/images/arrowright.png b/images/arrowright.png new file mode 100644 index 0000000..ddd163b Binary files /dev/null and b/images/arrowright.png differ diff --git a/images/bayonetLogo.png b/images/bayonetLogo.png new file mode 100644 index 0000000..4183a88 Binary files /dev/null and b/images/bayonetLogo.png differ diff --git a/images/blockbackground.jpg b/images/blockbackground.jpg new file mode 100644 index 0000000..ea6c7d3 Binary files /dev/null and b/images/blockbackground.jpg differ diff --git a/images/calendar.png b/images/calendar.png new file mode 100644 index 0000000..86b9861 Binary files /dev/null and b/images/calendar.png differ diff --git a/images/delete.gif b/images/delete.gif new file mode 100644 index 0000000..4e2a37f Binary files /dev/null and b/images/delete.gif differ diff --git a/images/dicon.png b/images/dicon.png new file mode 100644 index 0000000..e9323cb Binary files /dev/null and b/images/dicon.png differ diff --git a/images/dlaxlogo.png b/images/dlaxlogo.png new file mode 100644 index 0000000..b4991ae Binary files /dev/null and b/images/dlaxlogo.png differ diff --git a/images/editfiles.png b/images/editfiles.png new file mode 100644 index 0000000..500e206 Binary files /dev/null and b/images/editfiles.png differ diff --git a/images/editpage.png b/images/editpage.png new file mode 100644 index 0000000..ab3fd58 Binary files /dev/null and b/images/editpage.png differ diff --git a/images/error.gif b/images/error.gif new file mode 100644 index 0000000..cb1fcbe Binary files /dev/null and b/images/error.gif differ diff --git a/images/error.png b/images/error.png new file mode 100644 index 0000000..5bc1824 Binary files /dev/null and b/images/error.png differ diff --git a/images/file_doc.png b/images/file_doc.png new file mode 100644 index 0000000..b1da1ef Binary files /dev/null and b/images/file_doc.png differ diff --git a/images/file_pdf.png b/images/file_pdf.png new file mode 100644 index 0000000..500e206 Binary files /dev/null and b/images/file_pdf.png differ diff --git a/images/file_rtf.png b/images/file_rtf.png new file mode 100644 index 0000000..39304c1 Binary files /dev/null and b/images/file_rtf.png differ diff --git a/images/file_word.png b/images/file_word.png new file mode 100644 index 0000000..3011f00 Binary files /dev/null and b/images/file_word.png differ diff --git a/images/hgrad.png b/images/hgrad.png new file mode 100644 index 0000000..86daf8b Binary files /dev/null and b/images/hgrad.png differ diff --git a/images/larrow.png b/images/larrow.png new file mode 100644 index 0000000..554b6e9 Binary files /dev/null and b/images/larrow.png differ diff --git a/images/leftshadow.png b/images/leftshadow.png new file mode 100644 index 0000000..1f32159 Binary files /dev/null and b/images/leftshadow.png differ diff --git a/images/limericklax.png b/images/limericklax.png new file mode 100644 index 0000000..1a565ea Binary files /dev/null and b/images/limericklax.png differ diff --git a/images/logo.jpg b/images/logo.jpg new file mode 100644 index 0000000..cfe19c2 Binary files /dev/null and b/images/logo.jpg differ diff --git a/images/lvgrad.png b/images/lvgrad.png new file mode 100644 index 0000000..487d7e3 Binary files /dev/null and b/images/lvgrad.png differ diff --git a/images/navbackground.jpg b/images/navbackground.jpg new file mode 100644 index 0000000..93ffece Binary files /dev/null and b/images/navbackground.jpg differ diff --git a/images/navbg.png b/images/navbg.png new file mode 100644 index 0000000..00a8f88 Binary files /dev/null and b/images/navbg.png differ diff --git a/images/navigation.png b/images/navigation.png new file mode 100644 index 0000000..739c95f Binary files /dev/null and b/images/navigation.png differ diff --git a/images/navspacer.png b/images/navspacer.png new file mode 100644 index 0000000..cdc8cb4 Binary files /dev/null and b/images/navspacer.png differ diff --git a/images/news_header.png b/images/news_header.png new file mode 100644 index 0000000..00861bf Binary files /dev/null and b/images/news_header.png differ diff --git a/images/nvgrad.png b/images/nvgrad.png new file mode 100644 index 0000000..5e4c05c Binary files /dev/null and b/images/nvgrad.png differ diff --git a/images/photogallery.png b/images/photogallery.png new file mode 100644 index 0000000..a161a55 Binary files /dev/null and b/images/photogallery.png differ diff --git a/images/photoleft.png b/images/photoleft.png new file mode 100644 index 0000000..f4eb3af Binary files /dev/null and b/images/photoleft.png differ diff --git a/images/photoright.png b/images/photoright.png new file mode 100644 index 0000000..16a251b Binary files /dev/null and b/images/photoright.png differ diff --git a/images/rarrow.png b/images/rarrow.png new file mode 100644 index 0000000..9a272d9 Binary files /dev/null and b/images/rarrow.png differ diff --git a/images/rightshadow.png b/images/rightshadow.png new file mode 100644 index 0000000..bc970f0 Binary files /dev/null and b/images/rightshadow.png differ diff --git a/images/sandbackground.jpg b/images/sandbackground.jpg new file mode 100644 index 0000000..2a2d800 Binary files /dev/null and b/images/sandbackground.jpg differ diff --git a/images/spacer.png b/images/spacer.png new file mode 100644 index 0000000..f187f4a Binary files /dev/null and b/images/spacer.png differ diff --git a/images/vgrad.png b/images/vgrad.png new file mode 100644 index 0000000..e7a96e8 Binary files /dev/null and b/images/vgrad.png differ diff --git a/images/view.gif b/images/view.gif new file mode 100644 index 0000000..52cbddb Binary files /dev/null and b/images/view.gif differ diff --git a/images/xoma_logo.jpg b/images/xoma_logo.jpg new file mode 100644 index 0000000..36914ff Binary files /dev/null and b/images/xoma_logo.jpg differ diff --git a/includes/debug.php b/includes/debug.php new file mode 100644 index 0000000..abafd2d --- /dev/null +++ b/includes/debug.php @@ -0,0 +1,77 @@ +. + */ + +define("RUDI_DEBUG",true); +define("RUDI_DEBUG_LEVEL",true); +define('NO_REPEAT','norepeat'); +define('REPEAT','repeat'); + +static $last_message = NULL; +static $last_message_count = 0; + +function decho($message, $flag = REPEAT) +{ + global $last_message, $last_message_count; + if($last_message == $message) + { + if($flag == NO_REPEAT) + ++$last_message_count; + else + $last_message_count = $last_message_count; + return; + } + elseif($last_message != $message) + { + if($last_message_count > 0 && !is_array($last_message) && !is_object($last_message)) + { + WriteLog("Receieved previous message $last_message_count times\n",BAYONET_LOG_INFO); + } + else + { + if(is_array($message)) + { + $array_dump = print_r($message,true); + WriteLog($array_dump,BAYONET_LOG_INFO); + } + elseif(is_object($message)) + { + ob_start(); + var_dump($message); + $obj_dump = ob_get_contents(); + ob_end_clean(); + //htmlentities($obj_dump,ENT_QUOTES); + WriteLog($obj_dump,BAYONET_LOG_INFO); + } + elseif(is_string($message)) + { + $message = wordwrap($message,80,'
    '); + WriteLog($message,BAYONET_LOG_INFO); + } + } + + $last_message_count = 0; + } + + $last_message = $message; + +} + + + +?> \ No newline at end of file diff --git a/includes/functions.php b/includes/functions.php new file mode 100644 index 0000000..cd25792 --- /dev/null +++ b/includes/functions.php @@ -0,0 +1,559 @@ +. + */ + +/** + * bbcode_format() + * + * Modified public domain code from www.phpit.net + * + * @param mixed $str + * @return + */ +function bbcode_format ($str) +{ + $str = htmlentities($str); + $str = strip_tags($str); + $str = wordwrap($str,100,"\n",true); + + $simple_search = array( + '/\[b\](.*?)\[\/b\]/is', + '/\[i\](.*?)\[\/i\]/is', + '/\[u\](.*?)\[\/u\]/is', + '/\[hr\]/is', + '/\[pi\](.*?)\[\/pi\]/is', + '/\[center\](.*?)\[\/center\]/is', + '/\[title\](.*?)\[\/title\]/is', + '/\[article\](.*?)\[\/article\]/is', + '/\[section\](.*?)\[\/section\]/is', + '/\[code\](.*?)\[\/code\]/is', + '/\[quote\](.*?)\[\/quote\]/is', + '/\[quote\=(.*?)\](.*?)\[\/quote\]/is', + '/\[url\=(.*?)\](.*?)\[\/url\]/is', + '/\[align\=(.*?)\](.*?)\[\/align\]/is', + '/\[size\=(.*?)\](.*?)\[\/size\]/is', + '/\[img\=(.*?)\](.*?)\[\/img\]/is' + ); + + $simple_replace = array( + '$1', + '$1', + '$1', + '
    ', + '

    $1

    ', + '
    $1
    ', + '

    $1

    ', + '

    $1

    ', + '

    $1

    ', + '
    $1
    ', + '
    $1
    ', + '$1 wrote:
    $2
    ', + '$2', + '$2', + '$2', + '$2' + ); + + $order = array("\r\n", "\n", "\r"); + $replace = "\n
    "; + + $str = preg_replace ($simple_search, $simple_replace, $str); + $str = str_ireplace($order,$replace,$str); + return $str; +} + + //BBcode 2 HTML was written by WAY2WEB.net + + function BBCode($Text) + { + // Replace any html brackets with HTML Entities to prevent executing HTML or script + // Don't use strip_tags here because it breaks [url] search by replacing & with amp + $Text = str_replace("<", "<", $Text); + $Text = str_replace(">", ">", $Text); + + // Convert new line chars to html
    tags + $Text = nl2br($Text); + + // Set up the parameters for a URL search string + $URLSearchString = " a-zA-Z0-9\:\/\-\?\&\.\=\_\~\#\'"; + // Set up the parameters for a MAIL search string + $MAILSearchString = $URLSearchString . " a-zA-Z0-9\.@"; + + // Perform URL Search + $Text = preg_replace("/\[url\]([$URLSearchString]*)\[\/url\]/", '$1', $Text); + $Text = preg_replace("(\[url\=([$URLSearchString]*)\](.+?)\[/url\])", '$2', $Text); + //$Text = preg_replace("(\[url\=([$URLSearchString]*)\]([$URLSearchString]*)\[/url\])", '$2', $Text); + + // Perform MAIL Search + $Text = preg_replace("(\[mail\]([$MAILSearchString]*)\[/mail\])", '$1', $Text); + $Text = preg_replace("/\[mail\=([$MAILSearchString]*)\](.+?)\[\/mail\]/", '$2', $Text); + + // Check for bold text + $Text = preg_replace("(\[b\](.+?)\[\/b])is",'$1',$Text); + + // Check for Italics text + $Text = preg_replace("(\[i\](.+?)\[\/i\])is",'$1',$Text); + + // Check for Underline text + $Text = preg_replace("(\[u\](.+?)\[\/u\])is",'$1',$Text); + + // Check for strike-through text + $Text = preg_replace("(\[s\](.+?)\[\/s\])is",'$1',$Text); + + // Check for over-line text + $Text = preg_replace("(\[o\](.+?)\[\/o\])is",'$1',$Text); + + // Check for colored text + $Text = preg_replace("(\[color=(.+?)\](.+?)\[\/color\])is","$2",$Text); + + // Check for sized text + $Text = preg_replace("(\[size=(.+?)\](.+?)\[\/size\])is","$2",$Text); + + // Check for list text + $Text = preg_replace("/\[list\](.+?)\[\/list\]/is", '
      $1
    ' ,$Text); + $Text = preg_replace("/\[list=1\](.+?)\[\/list\]/is", '
      $1
    ' ,$Text); + $Text = preg_replace("/\[list=i\](.+?)\[\/list\]/s", '
      $1
    ' ,$Text); + $Text = preg_replace("/\[list=I\](.+?)\[\/list\]/s", '
      $1
    ' ,$Text); + $Text = preg_replace("/\[list=a\](.+?)\[\/list\]/s", '
      $1
    ' ,$Text); + $Text = preg_replace("/\[list=A\](.+?)\[\/list\]/s", '
      $1
    ' ,$Text); + $Text = str_replace("[*]", "
  • ", $Text); + + // Check for font change text + $Text = preg_replace("(\[font=(.+?)\](.+?)\[\/font\])","$2",$Text); + + // Declare the format for [code] layout + $CodeLayout = ' + + + + + + +
    Code:
    $1
    '; + // Check for [code] text + $Text = preg_replace("/\[code\](.+?)\[\/code\]/is","$CodeLayout", $Text); + // Declare the format for [php] layout + $phpLayout = ' + + + + + + +
    Code:
    $1
    '; + // Check for [php] text + $Text = preg_replace("/\[php\](.+?)\[\/php\]/is",$phpLayout, $Text); + + // Declare the format for [quote] layout + $QuoteLayout = ' + + + + + + +
    Quote:
    $1
    '; + + // Check for [quote] text + $Text = preg_replace("/\[quote\](.+?)\[\/quote\]/is","$QuoteLayout", $Text); + + // Images + // [img]pathtoimage[/img] + $Text = preg_replace("/\[img\](.+?)\[\/img\]/", '', $Text); + + //[img=align]image source[/img] + $Text = preg_replace("(\[img align\=(.+?)\](.+?)\[\/img\])is","",$Text); + + // [img=widthxheight]image source[/img] + $Text = preg_replace("/\[img\=([0-9]*)x([0-9]*)\](.+?)\[\/img\]/", '', $Text); + + // Alignment + // [align=type]text[/align] + $Text = preg_replace("(\[align=(.+?)\](.+?)\[\/align\])is","
    $2
    ",$Text); + + return $Text; + } + +function articleHeading($text){ + + // Set the content-type + header('Content-type: image/png'); + + //$text = $_GET['text']; + + $im = imagecreatefrompng('images/news_header.png'); // open image + imagealphablending($im, true); // setting alpha blending on + imagesavealpha($im, true); // save alphablending setting (important) + + // Create some colors + $black = imagecolorallocate($im, 0, 0, 0); + + + // Replace path by your own font path + //$font = 'TrajanPro-Regular.otf'; + //$font = 'TrajanPro-Bold.otf'; + $font = 'BrushScriptStd.otf'; + //$font = 'TRATS__.TTF'; + //$text = strtoupper($text); + + // Add the text + imagettftext($im, 18, 0, 0, 17, $black, $font, $text); + + // Using imagepng() results in clearer text compared with imagejpeg() + imagepng($im); + imagedestroy($im); +} + +function LinkList($array) +{ + if(!is_array($array)) + { + ReportError("List was not an array"); + return; + } + + echo "
      "; + foreach($array as $text => $link) + { + echo "
    • $text
    • "; + } + echo "
    "; +} + +/** + * LinkModule() + * + * Helper function to link to Bayonet modules. + * + * @param mixed $module_name + * @param mixed $link_name + * @return + */ +function LinkModule($module_name,$args = NULL,$link_name) +{ + return "{$link_name}"; +} + +/** + * LinkPage() + * + * Helper function to link to Bayonet pages. + * + * @param mixed $page_id + * @param mixed $page_name + * @return + */ +function LinkPage($page_id,$page_name) +{ + return "{$page_name}"; +} + +/** + * LinkInternal() + * + * Helper function to link to a relative Bayonet path. + * + * @param mixed $name + * @param string $rel_path + * @param string $file + * @return + */ +function LinkInternal($name,$file,$rel_path = "./") +{ + return "{$name}"; +} + +if(!defined("CALLED_FROM_ADMIN")) +{ + /** + * OpenTable() + * + * Begins a Bayonet site table. + * + * @return + */ + function OpenTable() + { + //width="100%" is important. Otherwise all of our tables will be text width. + //echo "\n"; + echo "
    "; + echo "
    "; + } + + /** + * CloseTable() + * + * Closes a Bayonet site table. + * + * @return + */ + function CloseTable() + { + //echo "
    "; + echo ""; + echo ""; + } +} + +function OpenBlock($title = 'New Block') +{ + OpenTable(); + echo "
    {$title}
    "; + echo "
    "; +} + +function CloseBlock() +{ + echo "
    "; + CloseTable(); +} +/** + * ReportError() + * + * This function should be called in the event that an error has occured. + * + * @param mixed $message - automatically logged + * @return + */ +function ReportError($message) +{ + //WriteLog($message,BAYONET_LOG_ERROR); + OpenTable(); + echo "
    Error Message
    {$message}
    "; + CloseTable(); +} + +/** + * ReportHack() + * + * This function should be called in the event that we are confirming + * a hacking attempt. + * + * @param mixed $message - automatically logged + * @return void + */ +function ReportHack($message) +{ + //WriteLog($message,BAYONET_LOG_HACK); + OpenTable(); + echo "Hack Attempt{$message}"; + CloseTable(); +} + + +/** + * array_dump() + * + * Useful against $_POST and $_GET variables, for dumping data to + * a log file, or to stdout. The return value is a single string, + * with each array key => value pair delimited by a character. + * The default character is a pipe -> '|'. It is assumed that if + * wanted to have a newline character inserted, just replace $spacer + * with '\n'. + * + * @param mixed $array + * @param string $spacer + * @return + */ +function array_dump($array, $spacer = '|') +{ + $retval = NULL; + foreach($array as $challenge => $answer) + { + $retval .= " $challenge => $answer " . $spacer; + } + + return $retval; +} + +/** + * WriteLog() + * + * This function can be accessed directly, however, anything that is + * passed to ReportError() or ReportHack(), or decho() will be logged in their + * appropriate log file. + * + * Change made: added checks to see if the log files exist before opening + * + * @param mixed $message + * @param mixed $flag + * @return + */ +define('BAYONET_LOG_HACK','bayonet_log_hack'); +define('BAYONET_LOG_ERROR','bayonet_log_error'); +define('BAYONET_LOG_WARN','bayonet_log_warn'); +define('BAYONET_LOG_INFO','bayonet_log_info'); + +function WriteLog($message,$flag) +{ + global $config; + $enabled = $config['logs']['enabled']; + + if(!$enabled) + { + return false; + } + + $dir = $config['logs']['dir']; + date_default_timezone_set($config['logs']['timezone']); + $varstr = array_dump($_GET); + $type = NULL; + $ip = $_SERVER['REMOTE_ADDR']; + $hostname = gethostbyaddr($ip); + $executed = $_SERVER['PHP_SELF']; + $timestamp = date('Y-M-d H:i:s T'); + + + $message = str_replace("\n",'',$message); + $message = str_replace("
    ",'',$message); + + switch($flag) + { + case BAYONET_LOG_HACK: + if(!file_exists($dir.'hacks.log')){ + break; + } + $fp = fopen($dir.'hacks.log','a'); + $type = 'HACK'; + $full_message = "TIMESTAMP: {$timestamp}\n\t\tIP: {$ip}\n\t\tHOSTNAME: {$hostname}\n\t\tACTION: {$type} of {$executed}\n\t\tDEFERRAL: {$message}\n\t\tVAR: ({$varstr})\n\n"; + break; + case BAYONET_LOG_ERROR: + if(!file_exists($dir.'error.log')){ + break; + } + $fp = fopen($dir.'error.log','a'); + $type = 'ERROR'; + $full_message = "({$timestamp}) - {$type} - {$message} - ({$varstr})\n"; + break; + case BAYONET_LOG_WARN: + if(!file_exists($dir.'warn.log')){ + break; + } + $fp = fopen($dir.'warn.log','a'); + $type = 'WARN'; + $full_message = "({$timestamp}) - {$type} - {$message} - ({$varstr})\n"; + break; + case BAYONET_LOG_INFO: + if(!file_exists($dir.'info.log')){ + break; + } + $fp = fopen($dir.'info.log','a'); + $type = 'INFO'; + $full_message = "({$timestamp}) - {$type} - {$message}\n"; + break; + default: + echo 'To log something, you need to define a log to write to.
    '; + return; + } + if(file_exists($fp)){ + fwrite($fp,$full_message); + fclose($fp); + }else{ + //echo "could not write to file because file does not exist.
    "; + } +} + +/** + * UnderConstruction() + * + * Displays a site-wide message across the page header. + * + * @param mixed $message + * @param mixed $flag Acceptable flags are BAYONET_SITE, and BAYONET_SECTION + * @return + */ +define('BAYONET_SITE','bayonet_site'); +define('BAYONET_SECTION','bayonet_section'); +function UnderConstruction($message = NULL, $flag = BAYONET_SITE) +{ + $timestamp = date("Y-M-d h:m:s"); + OpenTable(); + switch($flag) + { + case BAYONET_SITE: + echo "Site is currently under construction : $timestamp"; + break; + case BAYONET_SECTION: + echo "Section currently under construction : $timestamp"; + } + + if(!is_null($message)) + { + echo "$message"; + } + + CloseTable(); + echo "
    "; +} + +/** + * GetBlocks() + * + * Includes all directories listed in blocks/ and uses the bayonet_blocks + * MySQL table to determine the order of the blocks displayed. + * + * @return + */ + +define('BLOCK_LEFT',false); +define('BLOCK_RIGHT',false); + +function GetBlocks($position = BLOCK_LEFT) +{ + global $config; + /** + * I had to reconnect to the database for some fucking reason at this point. + * I have no idea why, but I was recieving errors telling me that $db was no longer + * an object. This is/was bullshit. + */ + $db = new Bayonet_SQL(); + $db->Connect( + $config['sql']['hostname'], + $config['sql']['username'], + $config['sql']['password'] + ); + $db->Select_db($config['sql']['database']); + + $result = $db->Query("SELECT * FROM `bayonet_blocks` ORDER BY weight, position"); + //$result = mysql_query("SELECT * FROM bayonet_blocks ORDER BY weight, position"); + while(($row = $db->Fetch($result))!==false) + { + $blocks[] = $row; + } + $db->Free($result); + + foreach($blocks as $block) + { + if($block['position'] == $position && $block['active'] == true) + { + $load = 'blocks/'.$block['dir_name'].'/index.php'; + if(file_exists($load)) + { + OpenBlock($block['title']); + include $load; + CloseBlock(); + } + else + { + ReportError("Failed to load block, '{$block['dir_name']}'. Check block config."); + } + if($config['blocks']['spacer']) echo "
    "; + } + } +} +?> \ No newline at end of file diff --git a/includes/sql.class.php b/includes/sql.class.php new file mode 100644 index 0000000..141a7ae --- /dev/null +++ b/includes/sql.class.php @@ -0,0 +1,115 @@ +. + */ + +static $db_queries = 0; +static $db_connections = 0; +static $db_frees = 0; +static $db_fetches = 0; + +class Bayonet_SQL +{ + protected $hostname; + public function Connect($hostname, $username, $passwd) + { + global $db_connections; + ++$db_connections; + + $this->hostname = $hostname; + + decho("Connecting ('$hostname')"); + return mysql_connect($hostname, $username, $passwd); + } + + public function Disconnect($link) + { + decho("Disconnecting ('$link' from '$this->hostname')"); + //return mysql_close($link); + } + + public function Select_db($db) + { + decho("Selecting database ('$db')"); + return mysql_select_db($db); + } + + public function Query($str) + { + global $db_queries; + ++$db_queries; + //FIGURE OUT HOW TO CHECK EXCEPTION, TRY CATCH ??? + // if(!mysql_query($str)) + // { + // throw new Exception(mysql_error()); + // } + /* + try{ + + }catch(Exception $e){ + + } */ + return mysql_query($str); + } + + public function Free($result) + { + global $db_frees; + ++$db_frees; + //decho("Freeing ('$result')"); + return mysql_free_result($result); + } + + public function Fetch($result) + { + return $this->FetchArray($result); + } + + public function FetchArray($result) + { + global $db_fetches; + ++$db_fetches; + /* Alias Fetch() prefered, so no decho information */ + return mysql_fetch_array($result,MYSQL_ASSOC); + } + + public function FetchObject($result,$class) + { + global $db_fetches; + ++$db_fetches; + return mysql_fetch_object($result,$class); + } + + public function FetchAssoc($result) + { + global $db_fetches; + ++$db_fetches; + return mysql_fetch_assoc($result); + } + + public function FetchRow($result) + { + return mysql_fetch_row($result); + } + + public function Rows($result) + { + return mysql_num_rows($result); + } +} + +?> \ No newline at end of file diff --git a/index.php b/index.php new file mode 100644 index 0000000..e1ded92 --- /dev/null +++ b/index.php @@ -0,0 +1,65 @@ + +Connect( + $config['sql']['hostname'], + $config['sql']['username'], + $config['sql']['password'] + ); +$db->Select_db($config['sql']['database']); + + +include 'header.php'; +//session_start(); +?> + +
    + + + + + + + + + + + + + + + + + + +
    + + + +
    + +
    + +td.short{width:100%;}" . "" . "" . "" . "
    Code" . $e->getCode() . "
    In File" . $e->getFile() . "
    " . $e->getLine() . " - " . $e->getMessage() . "
    " + ); +} +?> \ No newline at end of file diff --git a/logs/error.log b/logs/error.log new file mode 100644 index 0000000..e69de29 diff --git a/logs/hacks.log b/logs/hacks.log new file mode 100644 index 0000000..e69de29 diff --git a/logs/info.log b/logs/info.log new file mode 100644 index 0000000..e69de29 diff --git a/markitup/images/body.png b/markitup/images/body.png new file mode 100644 index 0000000..cad1bea Binary files /dev/null and b/markitup/images/body.png differ diff --git a/markitup/images/jaysalvat.png b/markitup/images/jaysalvat.png new file mode 100644 index 0000000..83b76fa Binary files /dev/null and b/markitup/images/jaysalvat.png differ diff --git a/markitup/images/markitup.png b/markitup/images/markitup.png new file mode 100644 index 0000000..bb52e89 Binary files /dev/null and b/markitup/images/markitup.png differ diff --git a/markitup/images/style.css b/markitup/images/style.css new file mode 100644 index 0000000..b29e3c7 --- /dev/null +++ b/markitup/images/style.css @@ -0,0 +1,27 @@ +body { + background:#EEE url(body.png) repeat-x; + font: 13px "Trebuchet MS", Arial, Verdana; + padding-top:95px; +} +a { + text-decoration:none; + color:#3C769D; +} +h1 a, +p em a { + display:block; + overflow:hidden; + text-indent:-1000px; + position:absolute; + top:0px; left:0px; +} +h1 a { + background:#EEE url(markitup.png) no-repeat top left; + width:245px; height:85px; + top:28px; +} +p em a { + background:transparent url(jaysalvat.png) no-repeat 10% 50%; + width:120px; height:28px; + left:30px; +} \ No newline at end of file diff --git a/markitup/index.html b/markitup/index.html new file mode 100644 index 0000000..4049448 --- /dev/null +++ b/markitup/index.html @@ -0,0 +1,65 @@ + + + + +markItUp! Universal markup editor + + + + + + + + + + + + + + +

    markItUp!

    +

    By Jay Salvat

    +

    Downloads, examples and documentation at http://markitup.jaysalvat.com.

    +

    Click this link to insert content from anywhere in the page or this one to remove markItUp!

    +

    + +

    +

    Support the projet : Donate | Contact

    + + diff --git a/markitup/jquery.pack.js b/markitup/jquery.pack.js new file mode 100644 index 0000000..74cdfee --- /dev/null +++ b/markitup/jquery.pack.js @@ -0,0 +1,11 @@ +/* + * jQuery 1.2.3 - New Wave Javascript + * + * Copyright (c) 2008 John Resig (jquery.com) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * $Date: 2008-02-06 00:21:25 -0500 (Wed, 06 Feb 2008) $ + * $Rev: 4663 $ + */ +eval(function(p,a,c,k,e,r){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(J(){7(1e.3N)L w=1e.3N;L E=1e.3N=J(a,b){K 1B E.2l.4T(a,b)};7(1e.$)L D=1e.$;1e.$=E;L u=/^[^<]*(<(.|\\s)+>)[^>]*$|^#(\\w+)$/;L G=/^.[^:#\\[\\.]*$/;E.1n=E.2l={4T:J(d,b){d=d||T;7(d.15){6[0]=d;6.M=1;K 6}N 7(1o d=="25"){L c=u.2O(d);7(c&&(c[1]||!b)){7(c[1])d=E.4a([c[1]],b);N{L a=T.5J(c[3]);7(a)7(a.2w!=c[3])K E().2s(d);N{6[0]=a;6.M=1;K 6}N d=[]}}N K 1B E(b).2s(d)}N 7(E.1q(d))K 1B E(T)[E.1n.21?"21":"3U"](d);K 6.6E(d.1k==1M&&d||(d.5h||d.M&&d!=1e&&!d.15&&d[0]!=10&&d[0].15)&&E.2I(d)||[d])},5h:"1.2.3",87:J(){K 6.M},M:0,22:J(a){K a==10?E.2I(6):6[a]},2F:J(b){L a=E(b);a.54=6;K a},6E:J(a){6.M=0;1M.2l.1g.1i(6,a);K 6},R:J(a,b){K E.R(6,a,b)},4X:J(b){L a=-1;6.R(J(i){7(6==b)a=i});K a},1J:J(c,a,b){L d=c;7(c.1k==4e)7(a==10)K 6.M&&E[b||"1J"](6[0],c)||10;N{d={};d[c]=a}K 6.R(J(i){Q(c 1p d)E.1J(b?6.W:6,c,E.1l(6,d[c],b,i,c))})},1j:J(b,a){7((b==\'27\'||b==\'1R\')&&2M(a)<0)a=10;K 6.1J(b,a,"2o")},1u:J(b){7(1o b!="3V"&&b!=V)K 6.4x().3t((6[0]&&6[0].2i||T).5r(b));L a="";E.R(b||6,J(){E.R(6.3p,J(){7(6.15!=8)a+=6.15!=1?6.6K:E.1n.1u([6])})});K a},5m:J(b){7(6[0])E(b,6[0].2i).5k().3o(6[0]).2c(J(){L a=6;2b(a.1C)a=a.1C;K a}).3t(6);K 6},8w:J(a){K 6.R(J(){E(6).6z().5m(a)})},8p:J(a){K 6.R(J(){E(6).5m(a)})},3t:J(){K 6.3O(18,P,S,J(a){7(6.15==1)6.38(a)})},6q:J(){K 6.3O(18,P,P,J(a){7(6.15==1)6.3o(a,6.1C)})},6o:J(){K 6.3O(18,S,S,J(a){6.1a.3o(a,6)})},5a:J(){K 6.3O(18,S,P,J(a){6.1a.3o(a,6.2B)})},3h:J(){K 6.54||E([])},2s:J(b){L c=E.2c(6,J(a){K E.2s(b,a)});K 6.2F(/[^+>] [^+>]/.17(b)||b.1f("..")>-1?E.57(c):c)},5k:J(e){L f=6.2c(J(){7(E.14.1d&&!E.3E(6)){L a=6.69(P),4Y=T.3s("1x");4Y.38(a);K E.4a([4Y.3d])[0]}N K 6.69(P)});L d=f.2s("*").4R().R(J(){7(6[F]!=10)6[F]=V});7(e===P)6.2s("*").4R().R(J(i){7(6.15==3)K;L c=E.O(6,"2R");Q(L a 1p c)Q(L b 1p c[a])E.16.1b(d[i],a,c[a][b],c[a][b].O)});K f},1E:J(b){K 6.2F(E.1q(b)&&E.3y(6,J(a,i){K b.1P(a,i)})||E.3e(b,6))},56:J(b){7(b.1k==4e)7(G.17(b))K 6.2F(E.3e(b,6,P));N b=E.3e(b,6);L a=b.M&&b[b.M-1]!==10&&!b.15;K 6.1E(J(){K a?E.33(6,b)<0:6!=b})},1b:J(a){K!a?6:6.2F(E.37(6.22(),a.1k==4e?E(a).22():a.M!=10&&(!a.12||E.12(a,"3u"))?a:[a]))},3H:J(a){K a?E.3e(a,6).M>0:S},7j:J(a){K 6.3H("."+a)},5O:J(b){7(b==10){7(6.M){L c=6[0];7(E.12(c,"2k")){L e=c.3T,5I=[],11=c.11,2X=c.U=="2k-2X";7(e<0)K V;Q(L i=2X?e:0,2f=2X?e+1:11.M;i<2f;i++){L d=11[i];7(d.2p){b=E.14.1d&&!d.9J.1A.9y?d.1u:d.1A;7(2X)K b;5I.1g(b)}}K 5I}N K(6[0].1A||"").1r(/\\r/g,"")}K 10}K 6.R(J(){7(6.15!=1)K;7(b.1k==1M&&/5u|5t/.17(6.U))6.3k=(E.33(6.1A,b)>=0||E.33(6.31,b)>=0);N 7(E.12(6,"2k")){L a=b.1k==1M?b:[b];E("98",6).R(J(){6.2p=(E.33(6.1A,a)>=0||E.33(6.1u,a)>=0)});7(!a.M)6.3T=-1}N 6.1A=b})},3q:J(a){K a==10?(6.M?6[0].3d:V):6.4x().3t(a)},6S:J(a){K 6.5a(a).1V()},6Z:J(i){K 6.2K(i,i+1)},2K:J(){K 6.2F(1M.2l.2K.1i(6,18))},2c:J(b){K 6.2F(E.2c(6,J(a,i){K b.1P(a,i,a)}))},4R:J(){K 6.1b(6.54)},O:J(d,b){L a=d.23(".");a[1]=a[1]?"."+a[1]:"";7(b==V){L c=6.5n("8P"+a[1]+"!",[a[0]]);7(c==10&&6.M)c=E.O(6[0],d);K c==V&&a[1]?6.O(a[0]):c}N K 6.1N("8K"+a[1]+"!",[a[0],b]).R(J(){E.O(6,d,b)})},35:J(a){K 6.R(J(){E.35(6,a)})},3O:J(g,f,h,d){L e=6.M>1,3n;K 6.R(J(){7(!3n){3n=E.4a(g,6.2i);7(h)3n.8D()}L b=6;7(f&&E.12(6,"1O")&&E.12(3n[0],"4v"))b=6.3S("1U")[0]||6.38(6.2i.3s("1U"));L c=E([]);E.R(3n,J(){L a=e?E(6).5k(P)[0]:6;7(E.12(a,"1m")){c=c.1b(a)}N{7(a.15==1)c=c.1b(E("1m",a).1V());d.1P(b,a)}});c.R(6A)})}};E.2l.4T.2l=E.2l;J 6A(i,a){7(a.3Q)E.3P({1c:a.3Q,3l:S,1H:"1m"});N E.5g(a.1u||a.6x||a.3d||"");7(a.1a)a.1a.34(a)}E.1s=E.1n.1s=J(){L b=18[0]||{},i=1,M=18.M,5c=S,11;7(b.1k==8d){5c=b;b=18[1]||{};i=2}7(1o b!="3V"&&1o b!="J")b={};7(M==1){b=6;i=0}Q(;i-1}},68:J(b,c,a){L e={};Q(L d 1p c){e[d]=b.W[d];b.W[d]=c[d]}a.1P(b);Q(L d 1p c)b.W[d]=e[d]},1j:J(d,e,c){7(e=="27"||e=="1R"){L b,46={43:"4W",4U:"1Z",19:"3D"},3c=e=="27"?["7O","7M"]:["7J","7I"];J 5E(){b=e=="27"?d.7H:d.7F;L a=0,2N=0;E.R(3c,J(){a+=2M(E.2o(d,"7E"+6,P))||0;2N+=2M(E.2o(d,"2N"+6+"5X",P))||0});b-=24.7C(a+2N)}7(E(d).3H(":4d"))5E();N E.68(d,46,5E);K 24.2f(0,b)}K E.2o(d,e,c)},2o:J(e,k,j){L d;J 3x(b){7(!E.14.2d)K S;L a=T.4c.4K(b,V);K!a||a.4M("3x")==""}7(k=="1w"&&E.14.1d){d=E.1J(e.W,"1w");K d==""?"1":d}7(E.14.2z&&k=="19"){L c=e.W.50;e.W.50="0 7r 7o";e.W.50=c}7(k.1D(/4g/i))k=y;7(!j&&e.W&&e.W[k])d=e.W[k];N 7(T.4c&&T.4c.4K){7(k.1D(/4g/i))k="4g";k=k.1r(/([A-Z])/g,"-$1").2h();L h=T.4c.4K(e,V);7(h&&!3x(e))d=h.4M(k);N{L f=[],2C=[];Q(L a=e;a&&3x(a);a=a.1a)2C.4J(a);Q(L i=0;i<2C.M;i++)7(3x(2C[i])){f[i]=2C[i].W.19;2C[i].W.19="3D"}d=k=="19"&&f[2C.M-1]!=V?"2H":(h&&h.4M(k))||"";Q(L i=0;i]*?)\\/>/g,J(b,a,c){K c.1D(/^(aa|a6|7e|a5|4D|7a|a0|3m|9W|9U|9S)$/i)?b:a+">"});L f=E.3g(d).2h(),1x=h.3s("1x");L e=!f.1f("<9P")&&[1,"<2k 74=\'74\'>",""]||!f.1f("<9M")&&[1,"<73>",""]||f.1D(/^<(9G|1U|9E|9B|9x)/)&&[1,"<1O>",""]||!f.1f("<4v")&&[2,"<1O><1U>",""]||(!f.1f("<9w")||!f.1f("<9v"))&&[3,"<1O><1U><4v>",""]||!f.1f("<7e")&&[2,"<1O><1U><6V>",""]||E.14.1d&&[1,"1x<1x>",""]||[0,"",""];1x.3d=e[1]+d+e[2];2b(e[0]--)1x=1x.5o;7(E.14.1d){L g=!f.1f("<1O")&&f.1f("<1U")<0?1x.1C&&1x.1C.3p:e[1]=="<1O>"&&f.1f("<1U")<0?1x.3p:[];Q(L j=g.M-1;j>=0;--j)7(E.12(g[j],"1U")&&!g[j].3p.M)g[j].1a.34(g[j]);7(/^\\s/.17(d))1x.3o(h.5r(d.1D(/^\\s*/)[0]),1x.1C)}d=E.2I(1x.3p)}7(d.M===0&&(!E.12(d,"3u")&&!E.12(d,"2k")))K;7(d[0]==10||E.12(d,"3u")||d.11)k.1g(d);N k=E.37(k,d)});K k},1J:J(d,e,c){7(!d||d.15==3||d.15==8)K 10;L f=E.3E(d)?{}:E.46;7(e=="2p"&&E.14.2d)d.1a.3T;7(f[e]){7(c!=10)d[f[e]]=c;K d[f[e]]}N 7(E.14.1d&&e=="W")K E.1J(d.W,"9u",c);N 7(c==10&&E.14.1d&&E.12(d,"3u")&&(e=="9r"||e=="9o"))K d.9m(e).6K;N 7(d.28){7(c!=10){7(e=="U"&&E.12(d,"4D")&&d.1a)6Q"U 9i 9h\'t 9g 9e";d.9b(e,""+c)}7(E.14.1d&&/6O|3Q/.17(e)&&!E.3E(d))K d.4z(e,2);K d.4z(e)}N{7(e=="1w"&&E.14.1d){7(c!=10){d.6k=1;d.1E=(d.1E||"").1r(/6M\\([^)]*\\)/,"")+(2M(c).3X()=="96"?"":"6M(1w="+c*6L+")")}K d.1E&&d.1E.1f("1w=")>=0?(2M(d.1E.1D(/1w=([^)]*)/)[1])/6L).3X():""}e=e.1r(/-([a-z])/95,J(a,b){K b.2E()});7(c!=10)d[e]=c;K d[e]}},3g:J(a){K(a||"").1r(/^\\s+|\\s+$/g,"")},2I:J(b){L a=[];7(1o b!="93")Q(L i=0,M=b.M;i*",6).1V();2b(6.1C)6.34(6.1C)}},J(a,b){E.1n[a]=J(){K 6.R(b,18)}});E.R(["8f","5X"],J(i,c){L b=c.2h();E.1n[b]=J(a){K 6[0]==1e?E.14.2z&&T.1h["5e"+c]||E.14.2d&&1e["8e"+c]||T.6F=="79"&&T.1F["5e"+c]||T.1h["5e"+c]:6[0]==T?24.2f(24.2f(T.1h["5d"+c],T.1F["5d"+c]),24.2f(T.1h["5L"+c],T.1F["5L"+c])):a==10?(6.M?E.1j(6[0],b):V):6.1j(b,a.1k==4e?a:a+"2S")}});L C=E.14.2d&&4s(E.14.5K)<8c?"(?:[\\\\w*4r-]|\\\\\\\\.)":"(?:[\\\\w\\8b-\\8a*4r-]|\\\\\\\\.)",6v=1B 4q("^>\\\\s*("+C+"+)"),6u=1B 4q("^("+C+"+)(#)("+C+"+)"),6s=1B 4q("^([#.]?)("+C+"*)");E.1s({6r:{"":J(a,i,m){K m[2]=="*"||E.12(a,m[2])},"#":J(a,i,m){K a.4z("2w")==m[2]},":":{89:J(a,i,m){K im[3]-0},2Z:J(a,i,m){K m[3]-0==i},6Z:J(a,i,m){K m[3]-0==i},3j:J(a,i){K i==0},3J:J(a,i,m,r){K i==r.M-1},6n:J(a,i){K i%2==0},6l:J(a,i){K i%2},"3j-4p":J(a){K a.1a.3S("*")[0]==a},"3J-4p":J(a){K E.2Z(a.1a.5o,1,"4t")==a},"83-4p":J(a){K!E.2Z(a.1a.5o,2,"4t")},6B:J(a){K a.1C},4x:J(a){K!a.1C},82:J(a,i,m){K(a.6x||a.81||E(a).1u()||"").1f(m[3])>=0},4d:J(a){K"1Z"!=a.U&&E.1j(a,"19")!="2H"&&E.1j(a,"4U")!="1Z"},1Z:J(a){K"1Z"==a.U||E.1j(a,"19")=="2H"||E.1j(a,"4U")=="1Z"},80:J(a){K!a.2Y},2Y:J(a){K a.2Y},3k:J(a){K a.3k},2p:J(a){K a.2p||E.1J(a,"2p")},1u:J(a){K"1u"==a.U},5u:J(a){K"5u"==a.U},5t:J(a){K"5t"==a.U},59:J(a){K"59"==a.U},3I:J(a){K"3I"==a.U},58:J(a){K"58"==a.U},6j:J(a){K"6j"==a.U},6i:J(a){K"6i"==a.U},2G:J(a){K"2G"==a.U||E.12(a,"2G")},4D:J(a){K/4D|2k|6h|2G/i.17(a.12)},3Y:J(a,i,m){K E.2s(m[3],a).M},7X:J(a){K/h\\d/i.17(a.12)},7W:J(a){K E.3y(E.3G,J(b){K a==b.Y}).M}}},6g:[/^(\\[) *@?([\\w-]+) *([!*$^~=]*) *(\'?"?)(.*?)\\4 *\\]/,/^(:)([\\w-]+)\\("?\'?(.*?(\\(.*?\\))?[^(]*?)"?\'?\\)/,1B 4q("^([:.#]*)("+C+"+)")],3e:J(a,c,b){L d,2m=[];2b(a&&a!=d){d=a;L f=E.1E(a,c,b);a=f.t.1r(/^\\s*,\\s*/,"");2m=b?c=f.r:E.37(2m,f.r)}K 2m},2s:J(t,p){7(1o t!="25")K[t];7(p&&p.15!=1&&p.15!=9)K[];p=p||T;L d=[p],2r=[],3J,12;2b(t&&3J!=t){L r=[];3J=t;t=E.3g(t);L o=S;L g=6v;L m=g.2O(t);7(m){12=m[1].2E();Q(L i=0;d[i];i++)Q(L c=d[i].1C;c;c=c.2B)7(c.15==1&&(12=="*"||c.12.2E()==12))r.1g(c);d=r;t=t.1r(g,"");7(t.1f(" ")==0)6w;o=P}N{g=/^([>+~])\\s*(\\w*)/i;7((m=g.2O(t))!=V){r=[];L l={};12=m[2].2E();m=m[1];Q(L j=0,3f=d.M;j<3f;j++){L n=m=="~"||m=="+"?d[j].2B:d[j].1C;Q(;n;n=n.2B)7(n.15==1){L h=E.O(n);7(m=="~"&&l[h])1Q;7(!12||n.12.2E()==12){7(m=="~")l[h]=P;r.1g(n)}7(m=="+")1Q}}d=r;t=E.3g(t.1r(g,""));o=P}}7(t&&!o){7(!t.1f(",")){7(p==d[0])d.4l();2r=E.37(2r,d);r=d=[p];t=" "+t.6e(1,t.M)}N{L k=6u;L m=k.2O(t);7(m){m=[0,m[2],m[3],m[1]]}N{k=6s;m=k.2O(t)}m[2]=m[2].1r(/\\\\/g,"");L f=d[d.M-1];7(m[1]=="#"&&f&&f.5J&&!E.3E(f)){L q=f.5J(m[2]);7((E.14.1d||E.14.2z)&&q&&1o q.2w=="25"&&q.2w!=m[2])q=E(\'[@2w="\'+m[2]+\'"]\',f)[0];d=r=q&&(!m[3]||E.12(q,m[3]))?[q]:[]}N{Q(L i=0;d[i];i++){L a=m[1]=="#"&&m[3]?m[3]:m[1]!=""||m[0]==""?"*":m[2];7(a=="*"&&d[i].12.2h()=="3V")a="3m";r=E.37(r,d[i].3S(a))}7(m[1]==".")r=E.55(r,m[2]);7(m[1]=="#"){L e=[];Q(L i=0;r[i];i++)7(r[i].4z("2w")==m[2]){e=[r[i]];1Q}r=e}d=r}t=t.1r(k,"")}}7(t){L b=E.1E(t,r);d=r=b.r;t=E.3g(b.t)}}7(t)d=[];7(d&&p==d[0])d.4l();2r=E.37(2r,d);K 2r},55:J(r,m,a){m=" "+m+" ";L c=[];Q(L i=0;r[i];i++){L b=(" "+r[i].1t+" ").1f(m)>=0;7(!a&&b||a&&!b)c.1g(r[i])}K c},1E:J(t,r,h){L d;2b(t&&t!=d){d=t;L p=E.6g,m;Q(L i=0;p[i];i++){m=p[i].2O(t);7(m){t=t.7V(m[0].M);m[2]=m[2].1r(/\\\\/g,"");1Q}}7(!m)1Q;7(m[1]==":"&&m[2]=="56")r=G.17(m[3])?E.1E(m[3],r,P).r:E(r).56(m[3]);N 7(m[1]==".")r=E.55(r,m[2],h);N 7(m[1]=="["){L g=[],U=m[3];Q(L i=0,3f=r.M;i<3f;i++){L a=r[i],z=a[E.46[m[2]]||m[2]];7(z==V||/6O|3Q|2p/.17(m[2]))z=E.1J(a,m[2])||\'\';7((U==""&&!!z||U=="="&&z==m[5]||U=="!="&&z!=m[5]||U=="^="&&z&&!z.1f(m[5])||U=="$="&&z.6e(z.M-m[5].M)==m[5]||(U=="*="||U=="~=")&&z.1f(m[5])>=0)^h)g.1g(a)}r=g}N 7(m[1]==":"&&m[2]=="2Z-4p"){L e={},g=[],17=/(-?)(\\d*)n((?:\\+|-)?\\d*)/.2O(m[3]=="6n"&&"2n"||m[3]=="6l"&&"2n+1"||!/\\D/.17(m[3])&&"7U+"+m[3]||m[3]),3j=(17[1]+(17[2]||1))-0,d=17[3]-0;Q(L i=0,3f=r.M;i<3f;i++){L j=r[i],1a=j.1a,2w=E.O(1a);7(!e[2w]){L c=1;Q(L n=1a.1C;n;n=n.2B)7(n.15==1)n.4k=c++;e[2w]=P}L b=S;7(3j==0){7(j.4k==d)b=P}N 7((j.4k-d)%3j==0&&(j.4k-d)/3j>=0)b=P;7(b^h)g.1g(j)}r=g}N{L f=E.6r[m[1]];7(1o f=="3V")f=f[m[2]];7(1o f=="25")f=6c("S||J(a,i){K "+f+";}");r=E.3y(r,J(a,i){K f(a,i,m,r)},h)}}K{r:r,t:t}},4u:J(b,c){L d=[];L a=b[c];2b(a&&a!=T){7(a.15==1)d.1g(a);a=a[c]}K d},2Z:J(a,e,c,b){e=e||1;L d=0;Q(;a;a=a[c])7(a.15==1&&++d==e)1Q;K a},5i:J(n,a){L r=[];Q(;n;n=n.2B){7(n.15==1&&(!a||n!=a))r.1g(n)}K r}});E.16={1b:J(f,i,g,e){7(f.15==3||f.15==8)K;7(E.14.1d&&f.53!=10)f=1e;7(!g.2D)g.2D=6.2D++;7(e!=10){L h=g;g=J(){K h.1i(6,18)};g.O=e;g.2D=h.2D}L j=E.O(f,"2R")||E.O(f,"2R",{}),1v=E.O(f,"1v")||E.O(f,"1v",J(){L a;7(1o E=="10"||E.16.5f)K a;a=E.16.1v.1i(18.3R.Y,18);K a});1v.Y=f;E.R(i.23(/\\s+/),J(c,b){L a=b.23(".");b=a[0];g.U=a[1];L d=j[b];7(!d){d=j[b]={};7(!E.16.2y[b]||E.16.2y[b].4j.1P(f)===S){7(f.3F)f.3F(b,1v,S);N 7(f.6b)f.6b("4i"+b,1v)}}d[g.2D]=g;E.16.2a[b]=P});f=V},2D:1,2a:{},1V:J(e,h,f){7(e.15==3||e.15==8)K;L i=E.O(e,"2R"),29,4X;7(i){7(h==10||(1o h=="25"&&h.7T(0)=="."))Q(L g 1p i)6.1V(e,g+(h||""));N{7(h.U){f=h.2q;h=h.U}E.R(h.23(/\\s+/),J(b,a){L c=a.23(".");a=c[0];7(i[a]){7(f)2V i[a][f.2D];N Q(f 1p i[a])7(!c[1]||i[a][f].U==c[1])2V i[a][f];Q(29 1p i[a])1Q;7(!29){7(!E.16.2y[a]||E.16.2y[a].4h.1P(e)===S){7(e.67)e.67(a,E.O(e,"1v"),S);N 7(e.66)e.66("4i"+a,E.O(e,"1v"))}29=V;2V i[a]}}})}Q(29 1p i)1Q;7(!29){L d=E.O(e,"1v");7(d)d.Y=V;E.35(e,"2R");E.35(e,"1v")}}},1N:J(g,c,d,f,h){c=E.2I(c||[]);7(g.1f("!")>=0){g=g.2K(0,-1);L a=P}7(!d){7(6.2a[g])E("*").1b([1e,T]).1N(g,c)}N{7(d.15==3||d.15==8)K 10;L b,29,1n=E.1q(d[g]||V),16=!c[0]||!c[0].36;7(16)c.4J(6.4Z({U:g,2L:d}));c[0].U=g;7(a)c[0].65=P;7(E.1q(E.O(d,"1v")))b=E.O(d,"1v").1i(d,c);7(!1n&&d["4i"+g]&&d["4i"+g].1i(d,c)===S)b=S;7(16)c.4l();7(h&&E.1q(h)){29=h.1i(d,b==V?c:c.71(b));7(29!==10)b=29}7(1n&&f!==S&&b!==S&&!(E.12(d,\'a\')&&g=="4V")){6.5f=P;1S{d[g]()}1X(e){}}6.5f=S}K b},1v:J(c){L a;c=E.16.4Z(c||1e.16||{});L b=c.U.23(".");c.U=b[0];L f=E.O(6,"2R")&&E.O(6,"2R")[c.U],42=1M.2l.2K.1P(18,1);42.4J(c);Q(L j 1p f){L d=f[j];42[0].2q=d;42[0].O=d.O;7(!b[1]&&!c.65||d.U==b[1]){L e=d.1i(6,42);7(a!==S)a=e;7(e===S){c.36();c.44()}}}7(E.14.1d)c.2L=c.36=c.44=c.2q=c.O=V;K a},4Z:J(c){L a=c;c=E.1s({},a);c.36=J(){7(a.36)a.36();a.7S=S};c.44=J(){7(a.44)a.44();a.7R=P};7(!c.2L)c.2L=c.7Q||T;7(c.2L.15==3)c.2L=a.2L.1a;7(!c.4S&&c.5w)c.4S=c.5w==c.2L?c.7P:c.5w;7(c.64==V&&c.63!=V){L b=T.1F,1h=T.1h;c.64=c.63+(b&&b.2v||1h&&1h.2v||0)-(b.62||0);c.7N=c.7L+(b&&b.2x||1h&&1h.2x||0)-(b.60||0)}7(!c.3c&&((c.4f||c.4f===0)?c.4f:c.5Z))c.3c=c.4f||c.5Z;7(!c.7b&&c.5Y)c.7b=c.5Y;7(!c.3c&&c.2G)c.3c=(c.2G&1?1:(c.2G&2?3:(c.2G&4?2:0)));K c},2y:{21:{4j:J(){5M();K},4h:J(){K}},3C:{4j:J(){7(E.14.1d)K S;E(6).2j("4P",E.16.2y.3C.2q);K P},4h:J(){7(E.14.1d)K S;E(6).3w("4P",E.16.2y.3C.2q);K P},2q:J(a){7(I(a,6))K P;18[0].U="3C";K E.16.1v.1i(6,18)}},3B:{4j:J(){7(E.14.1d)K S;E(6).2j("4O",E.16.2y.3B.2q);K P},4h:J(){7(E.14.1d)K S;E(6).3w("4O",E.16.2y.3B.2q);K P},2q:J(a){7(I(a,6))K P;18[0].U="3B";K E.16.1v.1i(6,18)}}}};E.1n.1s({2j:J(c,a,b){K c=="4H"?6.2X(c,a,b):6.R(J(){E.16.1b(6,c,b||a,b&&a)})},2X:J(d,b,c){K 6.R(J(){E.16.1b(6,d,J(a){E(6).3w(a);K(c||b).1i(6,18)},c&&b)})},3w:J(a,b){K 6.R(J(){E.16.1V(6,a,b)})},1N:J(c,a,b){K 6.R(J(){E.16.1N(c,a,6,P,b)})},5n:J(c,a,b){7(6[0])K E.16.1N(c,a,6[0],S,b);K 10},2g:J(){L b=18;K 6.4V(J(a){6.4N=0==6.4N?1:0;a.36();K b[6.4N].1i(6,18)||S})},7D:J(a,b){K 6.2j(\'3C\',a).2j(\'3B\',b)},21:J(a){5M();7(E.2Q)a.1P(T,E);N E.3A.1g(J(){K a.1P(6,E)});K 6}});E.1s({2Q:S,3A:[],21:J(){7(!E.2Q){E.2Q=P;7(E.3A){E.R(E.3A,J(){6.1i(T)});E.3A=V}E(T).5n("21")}}});L x=S;J 5M(){7(x)K;x=P;7(T.3F&&!E.14.2z)T.3F("5W",E.21,S);7(E.14.1d&&1e==3b)(J(){7(E.2Q)K;1S{T.1F.7B("26")}1X(3a){3z(18.3R,0);K}E.21()})();7(E.14.2z)T.3F("5W",J(){7(E.2Q)K;Q(L i=0;i=0){L i=g.2K(e,g.M);g=g.2K(0,e)}c=c||J(){};L f="4Q";7(d)7(E.1q(d)){c=d;d=V}N{d=E.3m(d);f="61"}L h=6;E.3P({1c:g,U:f,1H:"3q",O:d,1y:J(a,b){7(b=="1W"||b=="5U")h.3q(i?E("<1x/>").3t(a.4b.1r(/<1m(.|\\s)*?\\/1m>/g,"")).2s(i):a.4b);h.R(c,[a.4b,b,a])}});K 6},7n:J(){K E.3m(6.5T())},5T:J(){K 6.2c(J(){K E.12(6,"3u")?E.2I(6.7m):6}).1E(J(){K 6.31&&!6.2Y&&(6.3k||/2k|6h/i.17(6.12)||/1u|1Z|3I/i.17(6.U))}).2c(J(i,c){L b=E(6).5O();K b==V?V:b.1k==1M?E.2c(b,J(a,i){K{31:c.31,1A:a}}):{31:c.31,1A:b}}).22()}});E.R("5S,6d,5R,6D,5Q,6m".23(","),J(i,o){E.1n[o]=J(f){K 6.2j(o,f)}});L B=(1B 3v).3L();E.1s({22:J(d,b,a,c){7(E.1q(b)){a=b;b=V}K E.3P({U:"4Q",1c:d,O:b,1W:a,1H:c})},7l:J(b,a){K E.22(b,V,a,"1m")},7k:J(c,b,a){K E.22(c,b,a,"3i")},7i:J(d,b,a,c){7(E.1q(b)){a=b;b={}}K E.3P({U:"61",1c:d,O:b,1W:a,1H:c})},85:J(a){E.1s(E.4I,a)},4I:{2a:P,U:"4Q",2U:0,5P:"4o/x-7h-3u-7g",5N:P,3l:P,O:V,6p:V,3I:V,49:{3M:"4o/3M, 1u/3M",3q:"1u/3q",1m:"1u/4m, 4o/4m",3i:"4o/3i, 1u/4m",1u:"1u/a7",4G:"*/*"}},4F:{},3P:J(s){L f,2W=/=\\?(&|$)/g,1z,O;s=E.1s(P,s,E.1s(P,{},E.4I,s));7(s.O&&s.5N&&1o s.O!="25")s.O=E.3m(s.O);7(s.1H=="4E"){7(s.U.2h()=="22"){7(!s.1c.1D(2W))s.1c+=(s.1c.1D(/\\?/)?"&":"?")+(s.4E||"7d")+"=?"}N 7(!s.O||!s.O.1D(2W))s.O=(s.O?s.O+"&":"")+(s.4E||"7d")+"=?";s.1H="3i"}7(s.1H=="3i"&&(s.O&&s.O.1D(2W)||s.1c.1D(2W))){f="4E"+B++;7(s.O)s.O=(s.O+"").1r(2W,"="+f+"$1");s.1c=s.1c.1r(2W,"="+f+"$1");s.1H="1m";1e[f]=J(a){O=a;1W();1y();1e[f]=10;1S{2V 1e[f]}1X(e){}7(h)h.34(g)}}7(s.1H=="1m"&&s.1T==V)s.1T=S;7(s.1T===S&&s.U.2h()=="22"){L i=(1B 3v()).3L();L j=s.1c.1r(/(\\?|&)4r=.*?(&|$)/,"$a4="+i+"$2");s.1c=j+((j==s.1c)?(s.1c.1D(/\\?/)?"&":"?")+"4r="+i:"")}7(s.O&&s.U.2h()=="22"){s.1c+=(s.1c.1D(/\\?/)?"&":"?")+s.O;s.O=V}7(s.2a&&!E.5H++)E.16.1N("5S");7((!s.1c.1f("a3")||!s.1c.1f("//"))&&s.1H=="1m"&&s.U.2h()=="22"){L h=T.3S("6f")[0];L g=T.3s("1m");g.3Q=s.1c;7(s.7c)g.a2=s.7c;7(!f){L l=S;g.9Z=g.9Y=J(){7(!l&&(!6.39||6.39=="5V"||6.39=="1y")){l=P;1W();1y();h.34(g)}}}h.38(g);K 10}L m=S;L k=1e.78?1B 78("9X.9V"):1B 76();k.9T(s.U,s.1c,s.3l,s.6p,s.3I);1S{7(s.O)k.4C("9R-9Q",s.5P);7(s.5C)k.4C("9O-5A-9N",E.4F[s.1c]||"9L, 9K 9I 9H 5z:5z:5z 9F");k.4C("X-9C-9A","76");k.4C("9z",s.1H&&s.49[s.1H]?s.49[s.1H]+", */*":s.49.4G)}1X(e){}7(s.6Y)s.6Y(k);7(s.2a)E.16.1N("6m",[k,s]);L c=J(a){7(!m&&k&&(k.39==4||a=="2U")){m=P;7(d){6I(d);d=V}1z=a=="2U"&&"2U"||!E.6X(k)&&"3a"||s.5C&&E.6J(k,s.1c)&&"5U"||"1W";7(1z=="1W"){1S{O=E.6W(k,s.1H)}1X(e){1z="5x"}}7(1z=="1W"){L b;1S{b=k.5q("6U-5A")}1X(e){}7(s.5C&&b)E.4F[s.1c]=b;7(!f)1W()}N E.5v(s,k,1z);1y();7(s.3l)k=V}};7(s.3l){L d=53(c,13);7(s.2U>0)3z(J(){7(k){k.9t();7(!m)c("2U")}},s.2U)}1S{k.9s(s.O)}1X(e){E.5v(s,k,V,e)}7(!s.3l)c();J 1W(){7(s.1W)s.1W(O,1z);7(s.2a)E.16.1N("5Q",[k,s])}J 1y(){7(s.1y)s.1y(k,1z);7(s.2a)E.16.1N("5R",[k,s]);7(s.2a&&!--E.5H)E.16.1N("6d")}K k},5v:J(s,a,b,e){7(s.3a)s.3a(a,b,e);7(s.2a)E.16.1N("6D",[a,s,e])},5H:0,6X:J(r){1S{K!r.1z&&9q.9p=="59:"||(r.1z>=6T&&r.1z<9n)||r.1z==6R||r.1z==9l||E.14.2d&&r.1z==10}1X(e){}K S},6J:J(a,c){1S{L b=a.5q("6U-5A");K a.1z==6R||b==E.4F[c]||E.14.2d&&a.1z==10}1X(e){}K S},6W:J(r,b){L c=r.5q("9k-U");L d=b=="3M"||!b&&c&&c.1f("3M")>=0;L a=d?r.9j:r.4b;7(d&&a.1F.28=="5x")6Q"5x";7(b=="1m")E.5g(a);7(b=="3i")a=6c("("+a+")");K a},3m:J(a){L s=[];7(a.1k==1M||a.5h)E.R(a,J(){s.1g(3r(6.31)+"="+3r(6.1A))});N Q(L j 1p a)7(a[j]&&a[j].1k==1M)E.R(a[j],J(){s.1g(3r(j)+"="+3r(6))});N s.1g(3r(j)+"="+3r(a[j]));K s.6a("&").1r(/%20/g,"+")}});E.1n.1s({1G:J(c,b){K c?6.2e({1R:"1G",27:"1G",1w:"1G"},c,b):6.1E(":1Z").R(J(){6.W.19=6.5s||"";7(E.1j(6,"19")=="2H"){L a=E("<"+6.28+" />").6y("1h");6.W.19=a.1j("19");7(6.W.19=="2H")6.W.19="3D";a.1V()}}).3h()},1I:J(b,a){K b?6.2e({1R:"1I",27:"1I",1w:"1I"},b,a):6.1E(":4d").R(J(){6.5s=6.5s||E.1j(6,"19");6.W.19="2H"}).3h()},6N:E.1n.2g,2g:J(a,b){K E.1q(a)&&E.1q(b)?6.6N(a,b):a?6.2e({1R:"2g",27:"2g",1w:"2g"},a,b):6.R(J(){E(6)[E(6).3H(":1Z")?"1G":"1I"]()})},9f:J(b,a){K 6.2e({1R:"1G"},b,a)},9d:J(b,a){K 6.2e({1R:"1I"},b,a)},9c:J(b,a){K 6.2e({1R:"2g"},b,a)},9a:J(b,a){K 6.2e({1w:"1G"},b,a)},99:J(b,a){K 6.2e({1w:"1I"},b,a)},97:J(c,a,b){K 6.2e({1w:a},c,b)},2e:J(l,k,j,h){L i=E.6P(k,j,h);K 6[i.2P===S?"R":"2P"](J(){7(6.15!=1)K S;L g=E.1s({},i);L f=E(6).3H(":1Z"),4A=6;Q(L p 1p l){7(l[p]=="1I"&&f||l[p]=="1G"&&!f)K E.1q(g.1y)&&g.1y.1i(6);7(p=="1R"||p=="27"){g.19=E.1j(6,"19");g.32=6.W.32}}7(g.32!=V)6.W.32="1Z";g.40=E.1s({},l);E.R(l,J(c,a){L e=1B E.2t(4A,g,c);7(/2g|1G|1I/.17(a))e[a=="2g"?f?"1G":"1I":a](l);N{L b=a.3X().1D(/^([+-]=)?([\\d+-.]+)(.*)$/),1Y=e.2m(P)||0;7(b){L d=2M(b[2]),2A=b[3]||"2S";7(2A!="2S"){4A.W[c]=(d||1)+2A;1Y=((d||1)/e.2m(P))*1Y;4A.W[c]=1Y+2A}7(b[1])d=((b[1]=="-="?-1:1)*d)+1Y;e.45(1Y,d,2A)}N e.45(1Y,a,"")}});K P})},2P:J(a,b){7(E.1q(a)||(a&&a.1k==1M)){b=a;a="2t"}7(!a||(1o a=="25"&&!b))K A(6[0],a);K 6.R(J(){7(b.1k==1M)A(6,a,b);N{A(6,a).1g(b);7(A(6,a).M==1)b.1i(6)}})},94:J(b,c){L a=E.3G;7(b)6.2P([]);6.R(J(){Q(L i=a.M-1;i>=0;i--)7(a[i].Y==6){7(c)a[i](P);a.72(i,1)}});7(!c)6.5p();K 6}});L A=J(b,c,a){7(!b)K 10;c=c||"2t";L q=E.O(b,c+"2P");7(!q||a)q=E.O(b,c+"2P",a?E.2I(a):[]);K q};E.1n.5p=J(a){a=a||"2t";K 6.R(J(){L q=A(6,a);q.4l();7(q.M)q[0].1i(6)})};E.1s({6P:J(b,a,c){L d=b&&b.1k==92?b:{1y:c||!c&&a||E.1q(b)&&b,2u:b,3Z:c&&a||a&&a.1k!=91&&a};d.2u=(d.2u&&d.2u.1k==51?d.2u:{90:8Z,9D:6T}[d.2u])||8X;d.5y=d.1y;d.1y=J(){7(d.2P!==S)E(6).5p();7(E.1q(d.5y))d.5y.1i(6)};K d},3Z:{70:J(p,n,b,a){K b+a*p},5j:J(p,n,b,a){K((-24.8V(p*24.8U)/2)+0.5)*a+b}},3G:[],3W:V,2t:J(b,c,a){6.11=c;6.Y=b;6.1l=a;7(!c.47)c.47={}}});E.2t.2l={4y:J(){7(6.11.30)6.11.30.1i(6.Y,[6.2J,6]);(E.2t.30[6.1l]||E.2t.30.4G)(6);7(6.1l=="1R"||6.1l=="27")6.Y.W.19="3D"},2m:J(a){7(6.Y[6.1l]!=V&&6.Y.W[6.1l]==V)K 6.Y[6.1l];L r=2M(E.1j(6.Y,6.1l,a));K r&&r>-8Q?r:2M(E.2o(6.Y,6.1l))||0},45:J(c,b,d){6.5B=(1B 3v()).3L();6.1Y=c;6.3h=b;6.2A=d||6.2A||"2S";6.2J=6.1Y;6.4B=6.4w=0;6.4y();L e=6;J t(a){K e.30(a)}t.Y=6.Y;E.3G.1g(t);7(E.3W==V){E.3W=53(J(){L a=E.3G;Q(L i=0;i6.11.2u+6.5B){6.2J=6.3h;6.4B=6.4w=1;6.4y();6.11.40[6.1l]=P;L b=P;Q(L i 1p 6.11.40)7(6.11.40[i]!==P)b=S;7(b){7(6.11.19!=V){6.Y.W.32=6.11.32;6.Y.W.19=6.11.19;7(E.1j(6.Y,"19")=="2H")6.Y.W.19="3D"}7(6.11.1I)6.Y.W.19="2H";7(6.11.1I||6.11.1G)Q(L p 1p 6.11.40)E.1J(6.Y.W,p,6.11.47[p])}7(b&&E.1q(6.11.1y))6.11.1y.1i(6.Y);K S}N{L n=t-6.5B;6.4w=n/6.11.2u;6.4B=E.3Z[6.11.3Z||(E.3Z.5j?"5j":"70")](6.4w,n,0,1,6.11.2u);6.2J=6.1Y+((6.3h-6.1Y)*6.4B);6.4y()}K P}};E.2t.30={2v:J(a){a.Y.2v=a.2J},2x:J(a){a.Y.2x=a.2J},1w:J(a){E.1J(a.Y.W,"1w",a.2J)},4G:J(a){a.Y.W[a.1l]=a.2J+a.2A}};E.1n.5L=J(){L b=0,3b=0,Y=6[0],5l;7(Y)8M(E.14){L d=Y.1a,41=Y,1K=Y.1K,1L=Y.2i,5D=2d&&4s(5K)<8J&&!/a1/i.17(v),2T=E.1j(Y,"43")=="2T";7(Y.6G){L c=Y.6G();1b(c.26+24.2f(1L.1F.2v,1L.1h.2v),c.3b+24.2f(1L.1F.2x,1L.1h.2x));1b(-1L.1F.62,-1L.1F.60)}N{1b(Y.5G,Y.5F);2b(1K){1b(1K.5G,1K.5F);7(48&&!/^t(8H|d|h)$/i.17(1K.28)||2d&&!5D)2N(1K);7(!2T&&E.1j(1K,"43")=="2T")2T=P;41=/^1h$/i.17(1K.28)?41:1K;1K=1K.1K}2b(d&&d.28&&!/^1h|3q$/i.17(d.28)){7(!/^8G|1O.*$/i.17(E.1j(d,"19")))1b(-d.2v,-d.2x);7(48&&E.1j(d,"32")!="4d")2N(d);d=d.1a}7((5D&&(2T||E.1j(41,"43")=="4W"))||(48&&E.1j(41,"43")!="4W"))1b(-1L.1h.5G,-1L.1h.5F);7(2T)1b(24.2f(1L.1F.2v,1L.1h.2v),24.2f(1L.1F.2x,1L.1h.2x))}5l={3b:3b,26:b}}J 2N(a){1b(E.2o(a,"a8",P),E.2o(a,"a9",P))}J 1b(l,t){b+=4s(l)||0;3b+=4s(t)||0}K 5l}})();',62,631,'||||||this|if||||||||||||||||||||||||||||||||||||||function|return|var|length|else|data|true|for|each|false|document|type|null|style||elem||undefined|options|nodeName||browser|nodeType|event|test|arguments|display|parentNode|add|url|msie|window|indexOf|push|body|apply|css|constructor|prop|script|fn|typeof|in|isFunction|replace|extend|className|text|handle|opacity|div|complete|status|value|new|firstChild|match|filter|documentElement|show|dataType|hide|attr|offsetParent|doc|Array|trigger|table|call|break|height|try|cache|tbody|remove|success|catch|start|hidden||ready|get|split|Math|string|left|width|tagName|ret|global|while|map|safari|animate|max|toggle|toLowerCase|ownerDocument|bind|select|prototype|cur||curCSS|selected|handler|done|find|fx|duration|scrollLeft|id|scrollTop|special|opera|unit|nextSibling|stack|guid|toUpperCase|pushStack|button|none|makeArray|now|slice|target|parseFloat|border|exec|queue|isReady|events|px|fixed|timeout|delete|jsre|one|disabled|nth|step|name|overflow|inArray|removeChild|removeData|preventDefault|merge|appendChild|readyState|error|top|which|innerHTML|multiFilter|rl|trim|end|json|first|checked|async|param|elems|insertBefore|childNodes|html|encodeURIComponent|createElement|append|form|Date|unbind|color|grep|setTimeout|readyList|mouseleave|mouseenter|block|isXMLDoc|addEventListener|timers|is|password|last|runtimeStyle|getTime|xml|jQuery|domManip|ajax|src|callee|getElementsByTagName|selectedIndex|load|object|timerId|toString|has|easing|curAnim|offsetChild|args|position|stopPropagation|custom|props|orig|mozilla|accepts|clean|responseText|defaultView|visible|String|charCode|float|teardown|on|setup|nodeIndex|shift|javascript|currentStyle|application|child|RegExp|_|parseInt|previousSibling|dir|tr|state|empty|update|getAttribute|self|pos|setRequestHeader|input|jsonp|lastModified|_default|unload|ajaxSettings|unshift|getComputedStyle|styleSheets|getPropertyValue|lastToggle|mouseout|mouseover|GET|andSelf|relatedTarget|init|visibility|click|absolute|index|container|fix|outline|Number|removeAttribute|setInterval|prevObject|classFilter|not|unique|submit|file|after|windowData|deep|scroll|client|triggered|globalEval|jquery|sibling|swing|clone|results|wrapAll|triggerHandler|lastChild|dequeue|getResponseHeader|createTextNode|oldblock|checkbox|radio|handleError|fromElement|parsererror|old|00|Modified|startTime|ifModified|safari2|getWH|offsetTop|offsetLeft|active|values|getElementById|version|offset|bindReady|processData|val|contentType|ajaxSuccess|ajaxComplete|ajaxStart|serializeArray|notmodified|loaded|DOMContentLoaded|Width|ctrlKey|keyCode|clientTop|POST|clientLeft|clientX|pageX|exclusive|detachEvent|removeEventListener|swap|cloneNode|join|attachEvent|eval|ajaxStop|substr|head|parse|textarea|reset|image|zoom|odd|ajaxSend|even|before|username|prepend|expr|quickClass|uuid|quickID|quickChild|continue|textContent|appendTo|contents|evalScript|parent|defaultValue|ajaxError|setArray|compatMode|getBoundingClientRect|styleFloat|clearInterval|httpNotModified|nodeValue|100|alpha|_toggle|href|speed|throw|304|replaceWith|200|Last|colgroup|httpData|httpSuccess|beforeSend|eq|linear|concat|splice|fieldset|multiple|cssFloat|XMLHttpRequest|webkit|ActiveXObject|CSS1Compat|link|metaKey|scriptCharset|callback|col|pixelLeft|urlencoded|www|post|hasClass|getJSON|getScript|elements|serialize|black|keyup|keypress|solid|change|mousemove|mouseup|dblclick|resize|focus|blur|stylesheet|rel|doScroll|round|hover|padding|offsetHeight|mousedown|offsetWidth|Bottom|Top|keydown|clientY|Right|pageY|Left|toElement|srcElement|cancelBubble|returnValue|charAt|0n|substring|animated|header|noConflict|line|enabled|innerText|contains|only|weight|ajaxSetup|font|size|gt|lt|uFFFF|u0128|417|Boolean|inner|Height|toggleClass|removeClass|addClass|removeAttr|replaceAll|insertAfter|prependTo|contentWindow|contentDocument|wrap|iframe|children|siblings|prevAll|nextAll|prev|wrapInner|next|parents|maxLength|maxlength|readOnly|readonly|reverse|class|htmlFor|inline|able|boxModel|522|setData|compatible|with|1px|ie|getData|10000|ra|it|rv|PI|cos|userAgent|400|navigator|600|slow|Function|Object|array|stop|ig|NaN|fadeTo|option|fadeOut|fadeIn|setAttribute|slideToggle|slideUp|changed|slideDown|be|can|property|responseXML|content|1223|getAttributeNode|300|method|protocol|location|action|send|abort|cssText|th|td|cap|specified|Accept|With|colg|Requested|fast|tfoot|GMT|thead|1970|Jan|attributes|01|Thu|leg|Since|If|opt|Type|Content|embed|open|area|XMLHTTP|hr|Microsoft|onreadystatechange|onload|meta|adobeair|charset|http|1_|img|br|plain|borderLeftWidth|borderTopWidth|abbr'.split('|'),0,{})) \ No newline at end of file diff --git a/markitup/markitup/jquery.markitup.js b/markitup/markitup/jquery.markitup.js new file mode 100644 index 0000000..1bdf319 --- /dev/null +++ b/markitup/markitup/jquery.markitup.js @@ -0,0 +1,553 @@ +// ---------------------------------------------------------------------------- +// markItUp! Universal MarkUp Engine, JQuery plugin +// v 1.1.5 +// Dual licensed under the MIT and GPL licenses. +// ---------------------------------------------------------------------------- +// Copyright (C) 2007-2008 Jay Salvat +// http://markitup.jaysalvat.com/ +// ---------------------------------------------------------------------------- +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// ---------------------------------------------------------------------------- +(function($) { + $.fn.markItUp = function(settings, extraSettings) { + var options, ctrlKey, shiftKey, altKey; + ctrlKey = shiftKey = altKey = false; + + options = { id: '', + nameSpace: '', + root: '', + previewInWindow: '', // 'width=800, height=600, resizable=yes, scrollbars=yes' + previewAutoRefresh: true, + previewPosition: 'after', + previewTemplatePath: '~/templates/preview.html', + previewParserPath: '', + previewParserVar: 'data', + resizeHandle: true, + beforeInsert: '', + afterInsert: '', + onEnter: {}, + onShiftEnter: {}, + onCtrlEnter: {}, + onTab: {}, + markupSet: [ { /* set */ } ] + }; + $.extend(options, settings, extraSettings); + + // compute markItUp! path + if (!options.root) { + $('script').each(function(a, tag) { + miuScript = $(tag).get(0).src.match(/(.*)jquery\.markitup(\.pack)?\.js$/); + if (miuScript !== null) { + options.root = miuScript[1]; + } + }); + } + + return this.each(function() { + var $$, textarea, levels, scrollPosition, caretPosition, caretOffset, + clicked, hash, header, footer, previewWindow, template, iFrame, abort; + $$ = $(this); + textarea = this; + levels = []; + abort = false; + scrollPosition = caretPosition = 0; + caretOffset = -1; + + options.previewParserPath = localize(options.previewParserPath); + options.previewTemplatePath = localize(options.previewTemplatePath); + + // apply the computed path to ~/ + function localize(data, inText) { + if (inText) { + return data.replace(/("|')~\//g, "$1"+options.root); + } + return data.replace(/^~\//, options.root); + } + + // init and build editor + function init() { + id = ''; nameSpace = ''; + if (options.id) { + id = 'id="'+options.id+'"'; + } else if ($$.attr("id")) { + id = 'id="markItUp'+($$.attr("id").substr(0, 1).toUpperCase())+($$.attr("id").substr(1))+'"'; + + } + if (options.nameSpace) { + nameSpace = 'class="'+options.nameSpace+'"'; + } + $$.wrap('
    '); + $$.wrap('
    '); + $$.wrap('
    '); + $$.addClass("markItUpEditor"); + + // add the header before the textarea + header = $('
    ').insertBefore($$); + $(dropMenus(options.markupSet)).appendTo(header); + + // add the footer after the textarea + footer = $('
    ').insertAfter($$); + + // add the resize handle after textarea + if (options.resizeHandle === true && $.browser.safari !== true) { + resizeHandle = $('
    ') + .insertAfter($$) + .bind("mousedown", function(e) { + var h = $$.height(), y = e.clientY, mouseMove, mouseUp; + mouseMove = function(e) { + $$.css("height", Math.max(20, e.clientY+h-y)+"px"); + return false; + }; + mouseUp = function(e) { + $("html").unbind("mousemove", mouseMove).unbind("mouseup", mouseUp); + return false; + }; + $("html").bind("mousemove", mouseMove).bind("mouseup", mouseUp); + }); + footer.append(resizeHandle); + } + + // listen key events + $$.keydown(keyPressed).keyup(keyPressed); + + // bind an event to catch external calls + $$.bind("insertion", function(e, settings) { + if (settings.target !== false) { + get(); + } + if (textarea === $.markItUp.focused) { + markup(settings); + } + }); + + // remember the last focus + $$.focus(function() { + $.markItUp.focused = this; + }); + } + + // recursively build header with dropMenus from markupset + function dropMenus(markupSet) { + var ul = $('
      '), i = 0; + $('li:hover > ul', ul).css('display', 'block'); + $.each(markupSet, function() { + var button = this, t = '', title, li, j; + title = (button.key) ? (button.name||'')+' [Ctrl+'+button.key+']' : (button.name||''); + key = (button.key) ? 'accesskey="'+button.key+'"' : ''; + if (button.separator) { + li = $('
    • '+(button.separator||'')+'
    • ').appendTo(ul); + } else { + i++; + for (j = levels.length -1; j >= 0; j--) { + t += levels[j]+"-"; + } + li = $('
    • '+(button.name||'')+'
    • ') + .bind("contextmenu", function() { // prevent contextmenu on mac and allow ctrl+click + return false; + }).click(function() { + return false; + }).mouseup(function() { + if (button.call) { + eval(button.call)(); + } + markup(button); + return false; + }).hover(function() { + $('> ul', this).show(); + $(document).one('click', function() { // close dropmenu if click outside + $('ul ul', header).hide(); + } + ); + }, function() { + $('> ul', this).hide(); + } + ).appendTo(ul); + if (button.dropMenu) { + levels.push(i); + $(li).addClass('markItUpDropMenu').append(dropMenus(button.dropMenu)); + } + } + }); + levels.pop(); + return ul; + } + + // markItUp! markups + function magicMarkups(string) { + if (string) { + string = string.toString(); + string = string.replace(/\(\!\(([\s\S]*?)\)\!\)/g, + function(x, a) { + var b = a.split('|!|'); + if (altKey === true) { + return (b[1] !== undefined) ? b[1] : b[0]; + } else { + return (b[1] === undefined) ? "" : b[0]; + } + } + ); + // [![prompt]!], [![prompt:!:value]!] + string = string.replace(/\[\!\[([\s\S]*?)\]\!\]/g, + function(x, a) { + var b = a.split(':!:'); + if (abort === true) { + return false; + } + value = prompt(b[0], (b[1]) ? b[1] : ''); + if (value === null) { + abort = true; + } + return value; + } + ); + return string; + } + return ""; + } + + // prepare action + function prepare(action) { + if ($.isFunction(action)) { + action = action(hash); + } + return magicMarkups(action); + } + + // build block to insert + function build(string) { + openWith = prepare(clicked.openWith); + placeHolder = prepare(clicked.placeHolder); + replaceWith = prepare(clicked.replaceWith); + closeWith = prepare(clicked.closeWith); + if (replaceWith !== "") { + block = openWith + replaceWith + closeWith; + } else if (selection === '' && placeHolder !== '') { + block = openWith + placeHolder + closeWith; + } else { + block = openWith + (string||selection) + closeWith; + } + return { block:block, + openWith:openWith, + replaceWith:replaceWith, + placeHolder:placeHolder, + closeWith:closeWith + }; + } + + // define markup to insert + function markup(button) { + var len, j, n, i; + hash = clicked = button; + get(); + + $.extend(hash, { line:"", + root:options.root, + textarea:textarea, + selection:(selection||''), + caretPosition:caretPosition, + ctrlKey:ctrlKey, + shiftKey:shiftKey, + altKey:altKey + } + ); + // callbacks before insertion + prepare(options.beforeInsert); + prepare(clicked.beforeInsert); + if (ctrlKey === true && shiftKey === true) { + prepare(clicked.beforeMultiInsert); + } + $.extend(hash, { line:1 }); + + if (ctrlKey === true && shiftKey === true) { + lines = selection.split(/\r?\n/); + for (j = 0, n = lines.length, i = 0; i < n; i++) { + if ($.trim(lines[i]) !== '') { + $.extend(hash, { line:++j, selection:lines[i] } ); + lines[i] = build(lines[i]).block; + } else { + lines[i] = ""; + } + } + string = { block:lines.join('\n')}; + start = caretPosition; + len = string.block.length + (($.browser.opera) ? n : 0); + } else if (ctrlKey === true) { + string = build(selection); + start = caretPosition + string.openWith.length; + len = string.block.length - string.openWith.length - string.closeWith.length; + len -= fixIeBug(string.block); + } else if (shiftKey === true) { + string = build(selection); + start = caretPosition; + len = string.block.length; + len -= fixIeBug(string.block); + } else { + string = build(selection); + start = caretPosition + string.block.length ; + len = 0; + start -= fixIeBug(string.block); + } + if ((selection === '' && string.replaceWith === '')) { + caretOffset += fixOperaBug(string.block); + + start = caretPosition + string.openWith.length; + len = string.block.length - string.openWith.length - string.closeWith.length; + + caretOffset = $$.val().substring(caretPosition, $$.val().length).length; + caretOffset -= fixOperaBug($$.val().substring(0, caretPosition)); + } + $.extend(hash, { caretPosition:caretPosition, scrollPosition:scrollPosition } ); + + if (string.block !== selection && abort === false) { + insert(string.block); + set(start, len); + } else { + caretOffset = -1; + } + get(); + + $.extend(hash, { line:'', selection:selection }); + + // callbacks after insertion + if (ctrlKey === true && shiftKey === true) { + prepare(clicked.afterMultiInsert); + } + prepare(clicked.afterInsert); + prepare(options.afterInsert); + + // refresh preview if opened + if (previewWindow && options.previewAutoRefresh) { + refreshPreview(); + } + + // reinit keyevent + shiftKey = altKey = ctrlKey = abort = false; + } + + // Substract linefeed in Opera + function fixOperaBug(string) { + if ($.browser.opera) { + return string.length - string.replace(/\n*/g, '').length; + } + return 0; + } + // Substract linefeed in IE + function fixIeBug(string) { + if ($.browser.msie) { + return string.length - string.replace(/\r*/g, '').length; + } + return 0; + } + + // add markup + function insert(block) { + if (document.selection) { + var newSelection = document.selection.createRange(); + newSelection.text = block; + } else { + $$.val($$.val().substring(0, caretPosition) + block + $$.val().substring(caretPosition + selection.length, $$.val().length)); + } + } + + // set a selection + function set(start, len) { + if (textarea.createTextRange){ + // quick fix to make it work on Opera 9.5 + if ($.browser.opera && $.browser.version >= 9.5 && len == 0) { + return false; + } + range = textarea.createTextRange(); + range.collapse(true); + range.moveStart('character', start); + range.moveEnd('character', len); + range.select(); + } else if (textarea.setSelectionRange ){ + textarea.setSelectionRange(start, start + len); + } + textarea.scrollTop = scrollPosition; + textarea.focus(); + } + + // get the selection + function get() { + textarea.focus(); + + scrollPosition = textarea.scrollTop; + if (document.selection) { + selection = document.selection.createRange().text; + if ($.browser.msie) { // ie + var range = document.selection.createRange(), rangeCopy = range.duplicate(); + rangeCopy.moveToElementText(textarea); + caretPosition = -1; + while(rangeCopy.inRange(range)) { // fix most of the ie bugs with linefeeds... + rangeCopy.moveStart('character'); + caretPosition ++; + } + } else { // opera + caretPosition = textarea.selectionStart; + } + } else { // gecko + caretPosition = textarea.selectionStart; + selection = $$.val().substring(caretPosition, textarea.selectionEnd); + } + return selection; + } + + // open preview window + function preview() { + if (!previewWindow || previewWindow.closed) { + if (options.previewInWindow) { + previewWindow = window.open('', 'preview', options.previewInWindow); + } else { + iFrame = $(''); + if (options.previewPosition == 'after') { + iFrame.insertAfter(footer); + } else { + iFrame.insertBefore(header); + } + previewWindow = iFrame[iFrame.length-1].contentWindow || frame[iFrame.length-1]; + } + } else if (altKey === true) { + if (iFrame) { + iFrame.remove(); + } + previewWindow.close(); + previewWindow = iFrame = false; + } + if (!options.previewAutoRefresh) { + refreshPreview(); + } + } + + // refresh Preview window + function refreshPreview() { + if (previewWindow.document) { + try { + sp = previewWindow.document.documentElement.scrollTop + } catch(e) { + sp = 0; + } + previewWindow.document.open(); + previewWindow.document.write(renderPreview()); + previewWindow.document.close(); + previewWindow.document.documentElement.scrollTop = sp; + } + if (options.previewInWindow) { + previewWindow.focus(); + } + } + + function renderPreview() { + if (options.previewParserPath !== '') { + $.ajax( { + type: 'POST', + async: false, + url: options.previewParserPath, + data: options.previewParserVar+'='+encodeURIComponent($$.val()), + success: function(data) { + phtml = localize(data, 1); + } + } ); + } else { + if (!template) { + $.ajax( { + async: false, + url: options.previewTemplatePath, + success: function(data) { + template = localize(data, 1); + } + } ); + } + phtml = template.replace(//g, $$.val()); + } + return phtml; + } + + // set keys pressed + function keyPressed(e) { + shiftKey = e.shiftKey; + altKey = e.altKey; + ctrlKey = (!(e.altKey && e.ctrlKey)) ? e.ctrlKey : false; + + if (e.type === 'keydown') { + if (ctrlKey === true) { + li = $("a[accesskey="+String.fromCharCode(e.keyCode)+"]", header).parent('li'); + if (li.length !== 0) { + ctrlKey = false; + li.triggerHandler('mouseup'); + return false; + } + } + if (e.keyCode === 13 || e.keyCode === 10) { // Enter key + if (ctrlKey === true) { // Enter + Ctrl + ctrlKey = false; + markup(options.onCtrlEnter); + return options.onCtrlEnter.keepDefault; + } else if (shiftKey === true) { // Enter + Shift + shiftKey = false; + markup(options.onShiftEnter); + return options.onShiftEnter.keepDefault; + } else { // only Enter + markup(options.onEnter); + return options.onEnter.keepDefault; + } + } + if (e.keyCode === 9) { // Tab key + if (shiftKey == true || ctrlKey == true || altKey == true) { // Thx Dr Floob. + return false; + } + if (caretOffset !== -1) { + get(); + caretOffset = $$.val().length - caretOffset; + set(caretOffset, 0); + caretOffset = -1; + return false; + } else { + markup(options.onTab); + return options.onTab.keepDefault; + } + } + } + } + + init(); + }); + }; + + $.fn.markItUpRemove = function() { + return this.each(function() { + $$ = $(this).unbind().removeClass('markItUpEditor'); + $$.parent('div').parent('div.markItUp').parent('div').replaceWith($$); + } + ); + }; + + $.markItUp = function(settings) { + var options = { target:false }; + $.extend(options, settings); + if (options.target) { + return $(options.target).each(function() { + $(this).focus(); + $(this).trigger('insertion', [options]); + }); + } else { + $('textarea').trigger('insertion', [options]); + } + }; +})(jQuery); diff --git a/markitup/markitup/jquery.markitup.pack.js b/markitup/markitup/jquery.markitup.pack.js new file mode 100644 index 0000000..f1244c9 --- /dev/null +++ b/markitup/markitup/jquery.markitup.pack.js @@ -0,0 +1,9 @@ +// ---------------------------------------------------------------------------- +// markItUp! Universal MarkUp Engine, JQuery plugin +// v 1.1.5 +// Dual licensed under the MIT and GPL licenses. +// ---------------------------------------------------------------------------- +// Copyright (C) 2007-2008 Jay Salvat +// http://markitup.jaysalvat.com/ +// ---------------------------------------------------------------------------- +eval(function(p,a,c,k,e,r){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(3($){$.24.T=3(f,g){E k,v,A,F;v=A=F=7;k={C:\'\',12:\'\',U:\'\',1j:\'\',1A:8,25:\'26\',1k:\'~/2Q/1B.1C\',1b:\'\',27:\'28\',1l:8,1D:\'\',1E:\'\',1F:{},1G:{},1H:{},1I:{},29:[{}]};$.V(k,f,g);2(!k.U){$(\'2R\').1c(3(a,b){1J=$(b).14(0).2S.2T(/(.*)2U\\.2V(\\.2W)?\\.2X$/);2(1J!==2a){k.U=1J[1]}})}4 G.1c(3(){E d,u,15,16,p,H,L,P,17,1m,w,1n,M,18;d=$(G);u=G;15=[];18=7;16=p=0;H=-1;k.1b=1d(k.1b);k.1k=1d(k.1k);3 1d(a,b){2(b){4 a.W(/("|\')~\\//g,"$1"+k.U)}4 a.W(/^~\\//,k.U)}3 2b(){C=\'\';12=\'\';2(k.C){C=\'C="\'+k.C+\'"\'}l 2(d.1K("C")){C=\'C="T\'+(d.1K("C").2c(0,1).2Y())+(d.1K("C").2c(1))+\'"\'}2(k.12){12=\'N="\'+k.12+\'"\'}d.1L(\'\');d.1L(\'\');d.1L(\'\');d.2d("2e");17=$(\'\').2f(d);$(1M(k.29)).1N(17);1m=$(\'\').1O(d);2(k.1l===8&&$.X.32!==8){1l=$(\'\').1O(d).1e("34",3(e){E h=d.2g(),y=e.2h,1o,1p;1o=3(e){d.2i("2g",35.36(20,e.2h+h-y)+"37");4 7};1p=3(e){$("1C").1P("2j",1o).1P("1q",1p);4 7};$("1C").1e("2j",1o).1e("1q",1p)});1m.2k(1l)}d.2l(1Q).38(1Q);d.1e("1R",3(e,a){2(a.1r!==7){14()}2(u===$.T.2m){Y(a)}});d.1f(3(){$.T.2m=G})}3 1M(b){E c=$(\'\'),i=0;$(\'B:2n > Z\',c).2i(\'39\',\'q\');$.1c(b,3(){E a=G,t=\'\',1s,B,j;1s=(a.19)?(a.1S||\'\')+\' [3a+\'+a.19+\']\':(a.1S||\'\');19=(a.19)?\'2o="\'+a.19+\'"\':\'\';2(a.2p){B=$(\'\'+(a.2p||\'\')+\'\').1N(c)}l{i++;2q(j=15.6-1;j>=0;j--){t+=15[j]+"-"}B=$(\'\'+(a.1S||\'\')+\'\').1e("3e",3(){4 7}).2s(3(){4 7}).1q(3(){2(a.2t){3f(a.2t)()}Y(a);4 7}).2n(3(){$(\'> Z\',G).3g();$(D).3h(\'2s\',3(){$(\'Z Z\',17).2u()})},3(){$(\'> Z\',G).2u()}).1N(c);2(a.2v){15.3i(i);$(B).2d(\'3j\').2k(1M(a.2v))}}});15.3k();4 c}3 2w(c){2(c){c=c.3l();c=c.W(/\\(\\!\\(([\\s\\S]*?)\\)\\!\\)/g,3(x,a){E b=a.1T(\'|!|\');2(F===8){4(b[1]!==2x)?b[1]:b[0]}l{4(b[1]===2x)?"":b[0]}});c=c.W(/\\[\\!\\[([\\s\\S]*?)\\]\\!\\]/g,3(x,a){E b=a.1T(\':!:\');2(18===8){4 7}1U=3m(b[0],(b[1])?b[1]:\'\');2(1U===2a){18=8}4 1U});4 c}4""}3 I(a){2($.3n(a)){a=a(P)}4 2w(a)}3 1g(a){J=I(L.J);1a=I(L.1a);Q=I(L.Q);O=I(L.O);2(Q!==""){q=J+Q+O}l 2(m===\'\'&&1a!==\'\'){q=J+1a+O}l{q=J+(a||m)+O}4{q:q,J:J,Q:Q,1a:1a,O:O}}3 Y(a){E b,j,n,i;P=L=a;14();$.V(P,{1t:"",U:k.U,u:u,m:(m||\'\'),p:p,v:v,A:A,F:F});I(k.1D);I(L.1D);2(v===8&&A===8){I(L.3o)}$.V(P,{1t:1});2(v===8&&A===8){R=m.1T(/\\r?\\n/);2q(j=0,n=R.6,i=0;i=9.5&&b==0){4 7}1i=u.2B();1i.3t(8);1i.2C(\'21\',a);1i.3u(\'21\',b);1i.3v()}l 2(u.2D){u.2D(a,a+b)}u.1v=16;u.1f()}3 14(){u.1f();16=u.1v;2(D.m){m=D.m.1Z().2A;2($.X.2z){E a=D.m.1Z(),1w=a.3w();1w.3x(u);p=-1;3y(1w.3z(a)){1w.2C(\'21\');p++}}l{p=u.2E}}l{p=u.2E;m=d.K().1h(p,u.3A)}4 m}3 1B(){2(!w||w.3B){2(k.1j){w=3C.2F(\'\',\'1B\',k.1j)}l{M=$(\'<2G N="3D">\');2(k.25==\'26\'){M.1O(1m)}l{M.2f(17)}w=M[M.6-1].3E||3F[M.6-1]}}l 2(F===8){2(M){M.3G()}w.2H();w=M=7}2(!k.1A){1Y()}}3 1Y(){2(w.D){3H{22=w.D.2I.1v}3I(e){22=0}w.D.2F();w.D.3J(2J());w.D.2H();w.D.2I.1v=22}2(k.1j){w.1f()}}3 2J(){2(k.1b!==\'\'){$.2K({2L:\'3K\',2M:7,2N:k.1b,28:k.27+\'=\'+3L(d.K()),2O:3(a){23=1d(a,1)}})}l{2(!1n){$.2K({2M:7,2N:k.1k,2O:3(a){1n=1d(a,1)}})}23=1n.W(//g,d.K())}4 23}3 1Q(e){A=e.A;F=e.F;v=(!(e.F&&e.v))?e.v:7;2(e.2L===\'2l\'){2(v===8){B=$("a[2o="+3N.3O(e.1x)+"]",17).1y(\'B\');2(B.6!==0){v=7;B.3P(\'1q\');4 7}}2(e.1x===13||e.1x===10){2(v===8){v=7;Y(k.1H);4 k.1H.1z}l 2(A===8){A=7;Y(k.1G);4 k.1G.1z}l{Y(k.1F);4 k.1F.1z}}2(e.1x===9){2(A==8||v==8||F==8){4 7}2(H!==-1){14();H=d.K().6-H;1X(H,0);H=-1;4 7}l{Y(k.1I);4 k.1I.1z}}}}2b()})};$.24.3Q=3(){4 G.1c(3(){$$=$(G).1P().3R(\'2e\');$$.1y(\'z\').1y(\'z.T\').1y(\'z\').Q($$)})};$.T=3(a){E b={1r:7};$.V(b,a);2(b.1r){4 $(b.1r).1c(3(){$(G).1f();$(G).2P(\'1R\',[b])})}l{$(\'u\').2P(\'1R\',[b])}}})(3S);',62,241,'||if|function|return||length|false|true|||||||||||||else|selection||string|caretPosition|block||||textarea|ctrlKey|previewWindow|||div|shiftKey|li|id|document|var|altKey|this|caretOffset|prepare|openWith|val|clicked|iFrame|class|closeWith|hash|replaceWith|lines||markItUp|root|extend|replace|browser|markup|ul||start|nameSpace||get|levels|scrollPosition|header|abort|key|placeHolder|previewParserPath|each|localize|bind|focus|build|substring|range|previewInWindow|previewTemplatePath|resizeHandle|footer|template|mouseMove|mouseUp|mouseup|target|title|line|fixIeBug|scrollTop|rangeCopy|keyCode|parent|keepDefault|previewAutoRefresh|preview|html|beforeInsert|afterInsert|onEnter|onShiftEnter|onCtrlEnter|onTab|miuScript|attr|wrap|dropMenus|appendTo|insertAfter|unbind|keyPressed|insertion|name|split|value|opera|fixOperaBug|set|refreshPreview|createRange||character|sp|phtml|fn|previewPosition|after|previewParserVar|data|markupSet|null|init|substr|addClass|markItUpEditor|insertBefore|height|clientY|css|mousemove|append|keydown|focused|hover|accesskey|separator|for|markItUpButton|click|call|hide|dropMenu|magicMarkups|undefined|insert|msie|text|createTextRange|moveStart|setSelectionRange|selectionStart|open|iframe|close|documentElement|renderPreview|ajax|type|async|url|success|trigger|templates|script|src|match|jquery|markitup|pack|js|toUpperCase|markItUpContainer|markItUpHeader|markItUpFooter|safari|markItUpResizeHandle|mousedown|Math|max|px|keyup|display|Ctrl|markItUpSeparator|className|href|contextmenu|eval|show|one|push|markItUpDropMenu|pop|toString|prompt|isFunction|beforeMultiInsert|trim|join|afterMultiInsert|version|collapse|moveEnd|select|duplicate|moveToElementText|while|inRange|selectionEnd|closed|window|markItUpPreviewFrame|contentWindow|frame|remove|try|catch|write|POST|encodeURIComponent|content|String|fromCharCode|triggerHandler|markItUpRemove|removeClass|jQuery'.split('|'),0,{})) \ No newline at end of file diff --git a/markitup/markitup/readme.txt b/markitup/markitup/readme.txt new file mode 100644 index 0000000..8e52604 --- /dev/null +++ b/markitup/markitup/readme.txt @@ -0,0 +1,62 @@ +markItUp! 1.1.5 + +CHANGE LOG +markItUp! 1.1.5 2009-05-01 +- Modified: http://drupal.org/project/wysiwyg compatibility +- Modified: Alt/Ctrl/Alt+Tab are now disabled + +markItUp! 1.1.4 2008-12-03 +- Fixed: Extra quote deleted line 95 + +markItUp! 1.1.3 2008-09-12 +- Fixed: IE7 preview problem + +markItUp! 1.1.2 2008-07-17 +- Fixed: Quick fix for Opera 9.5 caret position problem after insertion + +markItUp! 1.1.1 2008-06-02 +- Fixed: Key events status are passed to callbacks properly +- Improved: ScrollPosition is kept in the preview when its refreshed + +markItUp! 1.1.0 2008-05-04 +- Modified: Textarea's id is no more moved to the main container +- Modified: NameSpace Span become a Div to remain strict +- Added: Relative path to the script is computed +- Added: Relative path to the script passed to callbacks +- Added: Global instance ID property +- Added: $(element).markItUpRemove() to remove markItUp! +- Added: Resize handle is now optional with resizeHandle property +- Added: Property previewInWindow is added and accept window parameter +- Added: Property previewPosition is added +- Modified: Resize handle is no more displayed in Safari to avoid repetition with the native handle +- Modified: Property previewIframeRefresh become previewAutorefresh +- Modified: Built-in Html Preview call a template file +- Improved: Autorefreshing is now apply for preview in window too +- Improved: Cancel button in prompt window cancel now the whole insertion process +- Improved: Cleaner markItUp! code added to the DOM +- Removed: Depreciated preview properties as previewBaseUrl, previewCharset, previewCssPath, previewBodyId, previewBodyClassName +- Removed: Property previewIframe not longer exists +- Fixed: "Magic markups" works with line feeds +- Fixed: Key events are initialized after insertion +- Fixed: Internet Explorer line feed offset bug +- Fixed: Shortcut keys on Mac OS +- Fixed: Ctrl+click works and doesn't open Mac context menu anymore +- Fixed: Ctrl+click works and doesn't open the page in a new tab anymore +- Fixed: Minor Css modifications + +markItUp! 1.0.3 2008-04-04 +- Fixed: IE7 Preview empty baseurl problem +- Fixed: IE7 external targeted insertion +- Added: Property scrollPosition is passed to callbacks functions + +markItUp! 1.0.2 2008-03-31 +- Fixed: IE7 Html preview problems +- Fixed: Selection is kept if nothing is inserted +- Improved: Code minified + +markItUp! 1.0.1 2008-03-21 +- Removed: Global PlaceHolder +- Modified: Property previewCharset is setted to "utf-8" by default + +markItUp! 1.0.0 2008-03-01 +- First public release diff --git a/markitup/markitup/sets/bbcode/images/bold.png b/markitup/markitup/sets/bbcode/images/bold.png new file mode 100644 index 0000000..889ae80 Binary files /dev/null and b/markitup/markitup/sets/bbcode/images/bold.png differ diff --git a/markitup/markitup/sets/bbcode/images/clean.png b/markitup/markitup/sets/bbcode/images/clean.png new file mode 100644 index 0000000..7e7cefb Binary files /dev/null and b/markitup/markitup/sets/bbcode/images/clean.png differ diff --git a/markitup/markitup/sets/bbcode/images/code.png b/markitup/markitup/sets/bbcode/images/code.png new file mode 100644 index 0000000..63fe6ce Binary files /dev/null and b/markitup/markitup/sets/bbcode/images/code.png differ diff --git a/markitup/markitup/sets/bbcode/images/fonts.png b/markitup/markitup/sets/bbcode/images/fonts.png new file mode 100644 index 0000000..b7960db Binary files /dev/null and b/markitup/markitup/sets/bbcode/images/fonts.png differ diff --git a/markitup/markitup/sets/bbcode/images/italic.png b/markitup/markitup/sets/bbcode/images/italic.png new file mode 100644 index 0000000..8482ac8 Binary files /dev/null and b/markitup/markitup/sets/bbcode/images/italic.png differ diff --git a/markitup/markitup/sets/bbcode/images/link.png b/markitup/markitup/sets/bbcode/images/link.png new file mode 100644 index 0000000..25eacb7 Binary files /dev/null and b/markitup/markitup/sets/bbcode/images/link.png differ diff --git a/markitup/markitup/sets/bbcode/images/list-bullet.png b/markitup/markitup/sets/bbcode/images/list-bullet.png new file mode 100644 index 0000000..4a8672b Binary files /dev/null and b/markitup/markitup/sets/bbcode/images/list-bullet.png differ diff --git a/markitup/markitup/sets/bbcode/images/list-item.png b/markitup/markitup/sets/bbcode/images/list-item.png new file mode 100644 index 0000000..8cb4d69 Binary files /dev/null and b/markitup/markitup/sets/bbcode/images/list-item.png differ diff --git a/markitup/markitup/sets/bbcode/images/list-numeric.png b/markitup/markitup/sets/bbcode/images/list-numeric.png new file mode 100644 index 0000000..33b0b8d Binary files /dev/null and b/markitup/markitup/sets/bbcode/images/list-numeric.png differ diff --git a/markitup/markitup/sets/bbcode/images/picture.png b/markitup/markitup/sets/bbcode/images/picture.png new file mode 100644 index 0000000..4a158fe Binary files /dev/null and b/markitup/markitup/sets/bbcode/images/picture.png differ diff --git a/markitup/markitup/sets/bbcode/images/preview.png b/markitup/markitup/sets/bbcode/images/preview.png new file mode 100644 index 0000000..a9925a0 Binary files /dev/null and b/markitup/markitup/sets/bbcode/images/preview.png differ diff --git a/markitup/markitup/sets/bbcode/images/quotes.png b/markitup/markitup/sets/bbcode/images/quotes.png new file mode 100644 index 0000000..e54ebeb Binary files /dev/null and b/markitup/markitup/sets/bbcode/images/quotes.png differ diff --git a/markitup/markitup/sets/bbcode/images/stroke.png b/markitup/markitup/sets/bbcode/images/stroke.png new file mode 100644 index 0000000..612058a Binary files /dev/null and b/markitup/markitup/sets/bbcode/images/stroke.png differ diff --git a/markitup/markitup/sets/bbcode/images/underline.png b/markitup/markitup/sets/bbcode/images/underline.png new file mode 100644 index 0000000..90d0df2 Binary files /dev/null and b/markitup/markitup/sets/bbcode/images/underline.png differ diff --git a/markitup/markitup/sets/bbcode/readme.txt b/markitup/markitup/sets/bbcode/readme.txt new file mode 100644 index 0000000..745d5dd --- /dev/null +++ b/markitup/markitup/sets/bbcode/readme.txt @@ -0,0 +1,11 @@ +Markup language: +BBCode + +Description: +A basic BBCode markup set with Bold, Italic, Underline, Picture, Link, Size, List, Quotes, Code, Clean button, Preview button. + +Install: +- Download the zip file +- Unzip it in your markItUp! sets folder +- Modify your JS link to point at this set.js +- Modify your CSS link to point at this style.css \ No newline at end of file diff --git a/markitup/markitup/sets/bbcode/set.js b/markitup/markitup/sets/bbcode/set.js new file mode 100644 index 0000000..4641a1d --- /dev/null +++ b/markitup/markitup/sets/bbcode/set.js @@ -0,0 +1,39 @@ +// ---------------------------------------------------------------------------- +// markItUp! +// ---------------------------------------------------------------------------- +// Copyright (C) 2008 Jay Salvat +// http://markitup.jaysalvat.com/ +// ---------------------------------------------------------------------------- +// BBCode tags example +// http://en.wikipedia.org/wiki/Bbcode +// ---------------------------------------------------------------------------- +// Feel free to add more tags +// ---------------------------------------------------------------------------- +mySettings = { + previewParserPath: '', // path to your BBCode parser + markupSet: [ + {name:'Bold', key:'B', openWith:'[b]', closeWith:'[/b]'}, + {name:'Italic', key:'I', openWith:'[i]', closeWith:'[/i]'}, + {name:'Underline', key:'U', openWith:'[u]', closeWith:'[/u]'}, + {separator:'---------------' }, + {name:'Picture', key:'P', replaceWith:'[img][![Url]!][/img]'}, + {name:'Link', key:'L', openWith:'[url=[![Url]!]]', closeWith:'[/url]', placeHolder:'Your text to link here...'}, + {separator:'---------------' }, + {name:'Size', key:'S', openWith:'[size=[![Text size]!]]', closeWith:'[/size]', + dropMenu :[ + {name:'Big', openWith:'[size=200]', closeWith:'[/size]' }, + {name:'Normal', openWith:'[size=100]', closeWith:'[/size]' }, + {name:'Small', openWith:'[size=50]', closeWith:'[/size]' } + ]}, + {separator:'---------------' }, + {name:'Bulleted list', openWith:'[list]\n', closeWith:'\n[/list]'}, + {name:'Numeric list', openWith:'[list=[![Starting number]!]]\n', closeWith:'\n[/list]'}, + {name:'List item', openWith:'[*] '}, + {separator:'---------------' }, + {name:'Quotes', openWith:'[quote]', closeWith:'[/quote]'}, + {name:'Code', openWith:'[code]', closeWith:'[/code]'}, + {separator:'---------------' }, + {name:'Clean', className:"clean", replaceWith:function(markitup) { return markitup.selection.replace(/\[(.*?)\]/g, "") } }, + {name:'Preview', className:"preview", call:'preview' } + ] +} \ No newline at end of file diff --git a/markitup/markitup/sets/bbcode/style.css b/markitup/markitup/sets/bbcode/style.css new file mode 100644 index 0000000..3da35fd --- /dev/null +++ b/markitup/markitup/sets/bbcode/style.css @@ -0,0 +1,47 @@ +/* ------------------------------------------------------------------- +// markItUp! +// By Jay Salvat - http://markitup.jaysalvat.com/ +// ------------------------------------------------------------------*/ +.markItUp .markItUpButton1 a { + background-image:url(images/bold.png); +} +.markItUp .markItUpButton2 a { + background-image:url(images/italic.png); +} +.markItUp .markItUpButton3 a { + background-image:url(images/underline.png); +} + +.markItUp .markItUpButton4 a { + background-image:url(images/picture.png); +} +.markItUp .markItUpButton5 a { + background-image:url(images/link.png); +} + +.markItUp .markItUpButton6 a { + background-image:url(images/fonts.png); +} +.markItUp .markItUpButton7 a { + background-image:url(images/list-bullet.png); +} +.markItUp .markItUpButton8 a { + background-image:url(images/list-numeric.png); +} +.markItUp .markItUpButton9 a { + background-image:url(images/list-item.png); +} + +.markItUp .markItUpButton10 a { + background-image:url(images/quotes.png); +} +.markItUp .markItUpButton11 a { + background-image:url(images/code.png); +} + +.markItUp .clean a { + background-image:url(images/clean.png); +} +.markItUp .preview a { + background-image:url(images/preview.png); +} \ No newline at end of file diff --git a/markitup/markitup/sets/default/images/bold.png b/markitup/markitup/sets/default/images/bold.png new file mode 100644 index 0000000..889ae80 Binary files /dev/null and b/markitup/markitup/sets/default/images/bold.png differ diff --git a/markitup/markitup/sets/default/images/clean.png b/markitup/markitup/sets/default/images/clean.png new file mode 100644 index 0000000..7e7cefb Binary files /dev/null and b/markitup/markitup/sets/default/images/clean.png differ diff --git a/markitup/markitup/sets/default/images/image.png b/markitup/markitup/sets/default/images/image.png new file mode 100644 index 0000000..fc3c393 Binary files /dev/null and b/markitup/markitup/sets/default/images/image.png differ diff --git a/markitup/markitup/sets/default/images/italic.png b/markitup/markitup/sets/default/images/italic.png new file mode 100644 index 0000000..8482ac8 Binary files /dev/null and b/markitup/markitup/sets/default/images/italic.png differ diff --git a/markitup/markitup/sets/default/images/link.png b/markitup/markitup/sets/default/images/link.png new file mode 100644 index 0000000..25eacb7 Binary files /dev/null and b/markitup/markitup/sets/default/images/link.png differ diff --git a/markitup/markitup/sets/default/images/picture.png b/markitup/markitup/sets/default/images/picture.png new file mode 100644 index 0000000..4a158fe Binary files /dev/null and b/markitup/markitup/sets/default/images/picture.png differ diff --git a/markitup/markitup/sets/default/images/preview.png b/markitup/markitup/sets/default/images/preview.png new file mode 100644 index 0000000..a9925a0 Binary files /dev/null and b/markitup/markitup/sets/default/images/preview.png differ diff --git a/markitup/markitup/sets/default/images/stroke.png b/markitup/markitup/sets/default/images/stroke.png new file mode 100644 index 0000000..612058a Binary files /dev/null and b/markitup/markitup/sets/default/images/stroke.png differ diff --git a/markitup/markitup/sets/default/set.js b/markitup/markitup/sets/default/set.js new file mode 100644 index 0000000..2498b25 --- /dev/null +++ b/markitup/markitup/sets/default/set.js @@ -0,0 +1,27 @@ +// ---------------------------------------------------------------------------- +// markItUp! +// ---------------------------------------------------------------------------- +// Copyright (C) 2008 Jay Salvat +// http://markitup.jaysalvat.com/ +// ---------------------------------------------------------------------------- +// Html tags +// http://en.wikipedia.org/wiki/html +// ---------------------------------------------------------------------------- +// Basic set. Feel free to add more tags +// ---------------------------------------------------------------------------- +mySettings = { + onShiftEnter: {keepDefault:false, replaceWith:'
      \n'}, + onCtrlEnter: {keepDefault:false, openWith:'\n

      ', closeWith:'

      '}, + onTab: {keepDefault:false, replaceWith:' '}, + markupSet: [ + {name:'Bold', key:'B', openWith:'(!(|!|)!)', closeWith:'(!(|!|)!)' }, + {name:'Italic', key:'I', openWith:'(!(|!|)!)', closeWith:'(!(|!|)!)' }, + {name:'Stroke through', key:'S', openWith:'', closeWith:'' }, + {separator:'---------------' }, + {name:'Picture', key:'P', replaceWith:'[![Alternative text]!]' }, + {name:'Link', key:'L', openWith:'', closeWith:'', placeHolder:'Your text to link...' }, + {separator:'---------------' }, + {name:'Clean', className:'clean', replaceWith:function(markitup) { return markitup.selection.replace(/<(.*?)>/g, "") } }, + {name:'Preview', className:'preview', call:'preview'} + ] +} \ No newline at end of file diff --git a/markitup/markitup/sets/default/style.css b/markitup/markitup/sets/default/style.css new file mode 100644 index 0000000..26cb927 --- /dev/null +++ b/markitup/markitup/sets/default/style.css @@ -0,0 +1,27 @@ +/* ------------------------------------------------------------------- +// markItUp! +// By Jay Salvat - http://markitup.jaysalvat.com/ +// ------------------------------------------------------------------*/ +.markItUp .markItUpButton1 a { + background-image:url(images/bold.png); +} +.markItUp .markItUpButton2 a { + background-image:url(images/italic.png); +} +.markItUp .markItUpButton3 a { + background-image:url(images/stroke.png); +} + +.markItUp .markItUpButton4 a { + background-image:url(images/picture.png); +} +.markItUp .markItUpButton5 a { + background-image:url(images/link.png); +} + +.markItUp .markItUpButton6 a { + background-image:url(images/clean.png); +} +.markItUp .preview a { + background-image:url(images/preview.png); +} \ No newline at end of file diff --git a/markitup/markitup/skins/markitup/images/bg-container.png b/markitup/markitup/skins/markitup/images/bg-container.png new file mode 100644 index 0000000..a28e018 Binary files /dev/null and b/markitup/markitup/skins/markitup/images/bg-container.png differ diff --git a/markitup/markitup/skins/markitup/images/bg-editor-bbcode.png b/markitup/markitup/skins/markitup/images/bg-editor-bbcode.png new file mode 100644 index 0000000..39cdbd8 Binary files /dev/null and b/markitup/markitup/skins/markitup/images/bg-editor-bbcode.png differ diff --git a/markitup/markitup/skins/markitup/images/bg-editor-dotclear.png b/markitup/markitup/skins/markitup/images/bg-editor-dotclear.png new file mode 100644 index 0000000..b3188dc Binary files /dev/null and b/markitup/markitup/skins/markitup/images/bg-editor-dotclear.png differ diff --git a/markitup/markitup/skins/markitup/images/bg-editor-html.png b/markitup/markitup/skins/markitup/images/bg-editor-html.png new file mode 100644 index 0000000..11bff45 Binary files /dev/null and b/markitup/markitup/skins/markitup/images/bg-editor-html.png differ diff --git a/markitup/markitup/skins/markitup/images/bg-editor-json.png b/markitup/markitup/skins/markitup/images/bg-editor-json.png new file mode 100644 index 0000000..e898c1d Binary files /dev/null and b/markitup/markitup/skins/markitup/images/bg-editor-json.png differ diff --git a/markitup/markitup/skins/markitup/images/bg-editor-markdown.png b/markitup/markitup/skins/markitup/images/bg-editor-markdown.png new file mode 100644 index 0000000..c199715 Binary files /dev/null and b/markitup/markitup/skins/markitup/images/bg-editor-markdown.png differ diff --git a/markitup/markitup/skins/markitup/images/bg-editor-textile.png b/markitup/markitup/skins/markitup/images/bg-editor-textile.png new file mode 100644 index 0000000..3ab1e9f Binary files /dev/null and b/markitup/markitup/skins/markitup/images/bg-editor-textile.png differ diff --git a/markitup/markitup/skins/markitup/images/bg-editor-wiki.png b/markitup/markitup/skins/markitup/images/bg-editor-wiki.png new file mode 100644 index 0000000..7887181 Binary files /dev/null and b/markitup/markitup/skins/markitup/images/bg-editor-wiki.png differ diff --git a/markitup/markitup/skins/markitup/images/bg-editor-xml.png b/markitup/markitup/skins/markitup/images/bg-editor-xml.png new file mode 100644 index 0000000..33b1c5d Binary files /dev/null and b/markitup/markitup/skins/markitup/images/bg-editor-xml.png differ diff --git a/markitup/markitup/skins/markitup/images/bg-editor.png b/markitup/markitup/skins/markitup/images/bg-editor.png new file mode 100644 index 0000000..ab7cde4 Binary files /dev/null and b/markitup/markitup/skins/markitup/images/bg-editor.png differ diff --git a/markitup/markitup/skins/markitup/images/handle.png b/markitup/markitup/skins/markitup/images/handle.png new file mode 100644 index 0000000..3993b20 Binary files /dev/null and b/markitup/markitup/skins/markitup/images/handle.png differ diff --git a/markitup/markitup/skins/markitup/images/menu.png b/markitup/markitup/skins/markitup/images/menu.png new file mode 100644 index 0000000..44a07af Binary files /dev/null and b/markitup/markitup/skins/markitup/images/menu.png differ diff --git a/markitup/markitup/skins/markitup/images/submenu.png b/markitup/markitup/skins/markitup/images/submenu.png new file mode 100644 index 0000000..03d1977 Binary files /dev/null and b/markitup/markitup/skins/markitup/images/submenu.png differ diff --git a/markitup/markitup/skins/markitup/style.css b/markitup/markitup/skins/markitup/style.css new file mode 100644 index 0000000..05f053c --- /dev/null +++ b/markitup/markitup/skins/markitup/style.css @@ -0,0 +1,148 @@ +/* ------------------------------------------------------------------- +// markItUp! Universal MarkUp Engine, JQuery plugin +// By Jay Salvat - http://markitup.jaysalvat.com/ +// ------------------------------------------------------------------*/ +.markItUp * { + margin:0px; padding:0px; + outline:none; +} +.markItUp a:link, +.markItUp a:visited { + color:#000; + text-decoration:none; +} +.markItUp { + width:580px; + margin:5px 0 5px 0; + border:5px solid #F5F5F5; +} +.markItUpContainer { + border:1px solid #3C769D; + background:#FFF url(images/bg-container.png) repeat-x top left; + padding:5px 5px 2px 5px; + font:11px Verdana, Arial, Helvetica, sans-serif; +} +.markItUpEditor { + font:12px 'Courier New', Courier, monospace; + padding:5px 5px 5px 35px; + border:3px solid #3C769D; + width:567px; + height:320px; + background-image:url(images/bg-editor.png); + background-repeat:no-repeat; + clear:both; display:block; + line-height:18px; + overflow:auto; +} +.markItUpPreviewFrame { + overflow:auto; + background-color:#FFFFFF; + border:1px solid #3C769D; + width:99.9%; + height:300px; + margin:5px 0; +} +.markItUpFooter { + width:100%; + cursor:n-resize; +} +.markItUpResizeHandle { + overflow:hidden; + width:22px; height:5px; + margin-left:auto; + margin-right:auto; + background-image:url(images/handle.png); + cursor:n-resize; +} +/***************************************************************************************/ +/* first row of buttons */ +.markItUpHeader ul li { + list-style:none; + float:left; + position:relative; +} +.markItUpHeader ul li ul{ + display:none; +} +.markItUpHeader ul li:hover > ul{ + display:block; +} +.markItUpHeader ul .markItUpDropMenu { + background:transparent url(images/menu.png) no-repeat 115% 50%; + margin-right:5px; +} +.markItUpHeader ul .markItUpDropMenu li { + margin-right:0px; +} +.markItUpHeader ul .markItUpSeparator { + margin:0 10px; + width:1px; + height:16px; + overflow:hidden; + background-color:#CCC; +} +.markItUpHeader ul ul .markItUpSeparator { + width:auto; height:1px; + margin:0px; +} +/* next rows of buttons */ +.markItUpHeader ul ul { + display:none; + position:absolute; + top:18px; left:0px; + background:#F5F5F5; + border:1px solid #3C769D; + height:inherit; +} +.markItUpHeader ul ul li { + float:none; + border-bottom:1px solid #3C769D; +} +.markItUpHeader ul ul .markItUpDropMenu { + background:#F5F5F5 url(images/submenu.png) no-repeat 100% 50%; +} +/* next rows of buttons */ +.markItUpHeader ul ul ul { + position:absolute; + top:-1px; left:150px; +} +.markItUpHeader ul ul ul li { + float:none; +} +.markItUpHeader ul a { + display:block; + width:16px; height:16px; + text-indent:-10000px; + background-repeat:no-repeat; + padding:3px; + margin:0px; +} +.markItUpHeader ul ul a { + display:block; + padding-left:0px; + text-indent:0; + width:120px; + padding:5px 5px 5px 25px; + background-position:2px 50%; +} +.markItUpHeader ul ul a:hover { + color:#FFF; + background-color:#3C769D; +} +/************************************************************************************** +.html .markItUpEditor { + background-image:url(images/bg-editor-html.png); +} +.markdown .markItUpEditor { + background-image:url(images/bg-editor-markdown.png); +} +.textile .markItUpEditor { + background-image:url(images/bg-editor-textile.png); +} +.bbcode .markItUpEditor { + background-image:url(images/bg-editor-bbcode.png); +} +.wiki .markItUpEditor, +.dotclear .markItUpEditor { + background-image:url(images/bg-editor-wiki.png); +}*/ \ No newline at end of file diff --git a/markitup/markitup/skins/simple/images/handle.png b/markitup/markitup/skins/simple/images/handle.png new file mode 100644 index 0000000..3993b20 Binary files /dev/null and b/markitup/markitup/skins/simple/images/handle.png differ diff --git a/markitup/markitup/skins/simple/images/menu.png b/markitup/markitup/skins/simple/images/menu.png new file mode 100644 index 0000000..44a07af Binary files /dev/null and b/markitup/markitup/skins/simple/images/menu.png differ diff --git a/markitup/markitup/skins/simple/images/submenu.png b/markitup/markitup/skins/simple/images/submenu.png new file mode 100644 index 0000000..03d1977 Binary files /dev/null and b/markitup/markitup/skins/simple/images/submenu.png differ diff --git a/markitup/markitup/skins/simple/style.css b/markitup/markitup/skins/simple/style.css new file mode 100644 index 0000000..1838ded --- /dev/null +++ b/markitup/markitup/skins/simple/style.css @@ -0,0 +1,118 @@ +/* ------------------------------------------------------------------- +// markItUp! Universal MarkUp Engine, JQuery plugin +// By Jay Salvat - http://markitup.jaysalvat.com/ +// ------------------------------------------------------------------*/ +.markItUp * { + margin:0px; padding:0px; + outline:none; +} +.markItUp a:link, +.markItUp a:visited { + color:#000; + text-decoration:none; +} +.markItUp { + width:700px; + margin:5px 0 5px 0; +} +.markItUpContainer { + font:11px Verdana, Arial, Helvetica, sans-serif; +} +.markItUpEditor { + font:12px 'Courier New', Courier, monospace; + padding:5px; + width:690px; + height:320px; + clear:both; display:block; + line-height:18px; + overflow:auto; +} +.markItUpPreviewFrame { + overflow:auto; + background-color:#FFF; + width:99.9%; + height:300px; + margin:5px 0; +} +.markItUpFooter { + width:100%; +} +.markItUpResizeHandle { + overflow:hidden; + width:22px; height:5px; + margin-left:auto; + margin-right:auto; + background-image:url(images/handle.png); + cursor:n-resize; +} +/***************************************************************************************/ +/* first row of buttons */ +.markItUpHeader ul li { + list-style:none; + float:left; + position:relative; +} +.markItUpHeader ul li:hover > ul{ + display:block; +} +.markItUpHeader ul .markItUpDropMenu { + background:transparent url(images/menu.png) no-repeat 115% 50%; + margin-right:5px; +} +.markItUpHeader ul .markItUpDropMenu li { + margin-right:0px; +} +/* next rows of buttons */ +.markItUpHeader ul ul { + display:none; + position:absolute; + top:18px; left:0px; + background:#FFF; + border:1px solid #000; +} +.markItUpHeader ul ul li { + float:none; + border-bottom:1px solid #000; +} +.markItUpHeader ul ul .markItUpDropMenu { + background:#FFF url(images/submenu.png) no-repeat 100% 50%; +} +.markItUpHeader ul .markItUpSeparator { + margin:0 10px; + width:1px; + height:16px; + overflow:hidden; + background-color:#CCC; +} +.markItUpHeader ul ul .markItUpSeparator { + width:auto; height:1px; + margin:0px; +} +/* next rows of buttons */ +.markItUpHeader ul ul ul { + position:absolute; + top:-1px; left:150px; +} +.markItUpHeader ul ul ul li { + float:none; +} +.markItUpHeader ul a { + display:block; + width:16px; height:16px; + text-indent:-10000px; + background-repeat:no-repeat; + padding:3px; + margin:0px; +} +.markItUpHeader ul ul a { + display:block; + padding-left:0px; + text-indent:0; + width:120px; + padding:5px 5px 5px 25px; + background-position:2px 50%; +} +.markItUpHeader ul ul a:hover { + color:#FFF; + background-color:#000; +} diff --git a/markitup/markitup/templates/preview.css b/markitup/markitup/templates/preview.css new file mode 100644 index 0000000..ad91a87 --- /dev/null +++ b/markitup/markitup/templates/preview.css @@ -0,0 +1,5 @@ +/* preview style examples */ +body { + background-color:#EFEFEF; + font:70% Verdana, Arial, Helvetica, sans-serif; +} \ No newline at end of file diff --git a/markitup/markitup/templates/preview.html b/markitup/markitup/templates/preview.html new file mode 100644 index 0000000..b8b3702 --- /dev/null +++ b/markitup/markitup/templates/preview.html @@ -0,0 +1,11 @@ + + + + +markItUp! preview template + + + + + + diff --git a/modules.php b/modules.php new file mode 100644 index 0000000..96bb241 --- /dev/null +++ b/modules.php @@ -0,0 +1,94 @@ +. + */ + +define("MODULE_FILE",true); + +global $load,$index_module; + +if(isset($_GET['load'])) + $load = $_GET['load']; + +if(isset($_GET['file'])) + $file = $_GET['file']; + +if(is_null($load)) +{ + $load = $config['modules']['default']; +} + +$deny_chars = $config['modules']['deny_chars']; + +$load_temp = $load; + +/* + * broken i guess. +for($chars = 0; $chars <= strlen($load_temp); ++$chars) +{ + foreach($deny_chars as $deny) + { + if($load_temp[$chars] == $deny) + { + OpenTable(); + ReportHack("Invalid characters detected.\n"); + CloseTable(); + } + } +} +*/ +if(isset($load) && !empty($load) && !isset($file)) +{ + if(file_exists("modules/" . $load)) + { + include 'modules/' . $load . '/index.php'; + } + else + { + ReportError("Cannot load module directory.
      \n"); + } +} +elseif(isset($load) && isset($file)) +{ + if(file_exists("modules/" . $load)) + { + //$file_temp = explode('.',$file); + //$file = $file_temp[0]; + + $run = "modules/" . $load . "/" . $file; + + if(file_exists($run)) + { + include $run; + } + else + { + ReportError("Cannot load module directory.
      \n"); + } + } + else + { + ReportError("Cannot load module file.
      \n"); + } +} +else +{ + ReportError("Failure to load module.
      \n"); +} + + +?> \ No newline at end of file diff --git a/modules/admin/admin_functions.php b/modules/admin/admin_functions.php new file mode 100644 index 0000000..30a40d0 --- /dev/null +++ b/modules/admin/admin_functions.php @@ -0,0 +1,151 @@ +. + */ + +if(!defined("ADMIN_FILE")) +{ + die("Access denied."); + return; +} + +function is_loggedin() +{ + $id = session_id(); + if($id == "") + { + header("location: index.php"); + return false; + } + return true; +} + +function login() +{ + global $db; + + if(isset($_SESSION['username']) || isset($_SESSION['password'])) + { + return true; + } + + if(isset($_POST['processed'])) + { + $username = addslashes($_POST['username']); + $password = addslashes($_POST['password']); + $password = crypt(md5($password),'iamnotadirtywhorebitch'); + $result = $db->Query("SELECT * FROM bayonet_users WHERE username = '$username' AND password = '$password'"); + $rows = $db->Rows($result); + + if($rows > 0) + { + $_SESSION['username'] = stripslashes($username); + $_SESSION['password'] = stripslashes($password); + return true; + } + else + { + ReportError("Login incorrect."); + return false; + } + + } + else + { + echo "
      \n"; + OpenTable(); + echo "Administrative Login\n"; + + echo "\n + \n + \n + \n +
      Username
      Password
      \n"; + CloseTable(); + echo "
      \n"; + return false; + } +} + +function logout() +{ + session_unset(); + session_destroy(); +} + +/** + * CompileAdmin() + * + * because we want to have a horizontal display of options, we need to have + * the data separated by arrays. the data is processed into single tables, and is + * echoed in realtime. we checked to make sure they were arrays, but there is no + * checking to make sure the data passed is not malicious in nature. + * + * @param mixed $head + * @param mixed $body + * @return + */ +function CompileAdmin($head,$body) +{ + /*if we were not passed arrays, then say goodbye*/ + if(!is_array($head) || !is_array($body)) + { + echo "must be array\n"; + return; + } + + echo ""; + echo ""; + + $num = 1; + foreach($body as $td) + { + echo "\n"; + if($num%4 == 0){ + echo ""; + } + $num++; + } + echo "
      $td
      \n"; +} + +/** + * OpenTable() + * + * The administration OpenTable() function requires an argument to define + * the header title. It may be wise to replace the standard OpenTable() function + * with this one... that's alot of code to unfuck though. + * + * @param mixed $title + * @return + */ +function OpenTable_Ex($title) +{ + echo "
      {$title}
      "; +} + +/** + * CloseTable() + * + * @return + */ +function CloseTable_Ex() +{ + echo "
      "; +} + +?> \ No newline at end of file diff --git a/modules/admin/blocks/functions.php b/modules/admin/blocks/functions.php new file mode 100644 index 0000000..660b8e7 --- /dev/null +++ b/modules/admin/blocks/functions.php @@ -0,0 +1,173 @@ +. + */ + +function ListBlocks() +{ + global $db; + $result = $db->Query("SELECT * FROM bayonet_blocks"); + while(($rows = $db->fetch($result))!=false) + { + $blocks[] = $rows; + } + + echo ""; + foreach($blocks as $block) + { + echo ""; + } + echo "
      Existing Blocks
      {$block['weight']} : {$block['dir_name']}EditDelete
      "; +} + +function NewBlock() +{ + global $db; + if(isset($_POST['processed'])) + { + //Secure our data to prevent injection attacks. + $weight = addslashes($_POST['weight']); + $dir_name = addslashes($_POST['dir_name']); + $position = addslashes($_POST['position']); + $active = addslashes($_POST['active']); + + if(empty($weight) || empty($dir_name) || empty($position)) + { + echo "You must fill everything out before proceeding."; + return; + } + //Update the database with the new data. + $db->Query("INSERT INTO bayonet_blocks SET weight = '$weight', dir_name = '$dir_name', position = '$position', active = '$active'"); + //die, because we have completed what we wanted to do. + echo "New block, '$dir_name', at position '$weight' added.\n"; + return; + } + + ?> +
      + + + + + + +
      Weight
      Position
      Directory Name
      Active +
      +
      + 'Yes',0 => 'No'); + foreach($options as $option => $value) + { + $selected = NULL; + if($active == $option) + { + $selected = "selected"; + } + echo "\n"; + } + + +} + +function EditBlock($block_id) +{ + global $db; + if(isset($_POST['processed'])) + { + //Secure our data to prevent injection attacks. + $weight = addslashes($_POST['weight']); + $dir_name = addslashes($_POST['dir_name']); + $position = addslashes($_POST['position']); + $active = addslashes($_POST['active']); + + if(empty($weight) || empty($dir_name) || empty($position)) + { + echo "You must fill everything out before proceeding."; + return; + } + + //Update the database with the new data. + $db->Query("UPDATE bayonet_blocks SET weight = '$weight', dir_name = '$dir_name', position = '$position', active = '$active' WHERE block_id = '$block_id'"); + //$isActive = $active ? "IS" : "IS NOT"; + echo "Block, '$dir_name', at position '$weight' has been edited.\n"; + //die, because we have completed what we wanted to do. + return; + } + + //Grab the page from the database according to the $page_id passed to the function. + $result = $db->Query("SELECT weight,dir_name,position,active FROM bayonet_blocks WHERE block_id = '$block_id'"); + while(($row = $db->Fetch($result))!=false) + { + //We only want one row, so we don't have to $block[]... No foreach necessary. + $block = $row; + } + + ?> +
      + + + + + + + +
      Weight
      Position
      Directory Name
      Active + +
      +
      + Query("SELECT dir_name FROM bayonet_blocks WHERE block_id = '$block_id'"); + $block = $db->Fetch($result); + + if(isset($_POST['proceed'])) + { + echo "Block '{$block['dir_name']}', was deleted."; + $db->Query("DELETE FROM bayonet_blocks WHERE block_id = '$block_id' LIMIT 1"); + return; + } + if(isset($_POST['cancel'])) + { + echo "User cancelled deletion of page: '{$block['dir_name']}'"; + return; + } + + ?> +
      + + + +
      Are you SURE you want to delete the block titled: ''?
         
      +
      + \ No newline at end of file diff --git a/modules/admin/blocks/index.php b/modules/admin/blocks/index.php new file mode 100644 index 0000000..6dac3d2 --- /dev/null +++ b/modules/admin/blocks/index.php @@ -0,0 +1,59 @@ +. + */ + +/** + * This file administers the site blocks. + * + * -weight + * -directory name + */ + +if(!defined("ADMIN_FILE")) +{ + die("Access denied."); +} + + +include $basedir.'blocks/functions.php'; + +if(isset($_GET['edit'])) +{ + $block_id = $_GET['edit']; + EditBlock($block_id); + return; +} + +if(isset($_GET['delete'])) +{ + $block_id = $_GET['delete']; + DeleteBlock($block_id); + return; +} + +if(isset($_GET['create'])) +{ + NewBlock(); + return; +} + +echo "
      ".LinkInternal('Create a Block','?load=admin&op=blocks&create=true')."
      "; + +ListBlocks(); + +?> \ No newline at end of file diff --git a/modules/admin/images/addnewarticle.png b/modules/admin/images/addnewarticle.png new file mode 100644 index 0000000..0e29960 Binary files /dev/null and b/modules/admin/images/addnewarticle.png differ diff --git a/modules/admin/images/addnewpage.png b/modules/admin/images/addnewpage.png new file mode 100644 index 0000000..c60c68c Binary files /dev/null and b/modules/admin/images/addnewpage.png differ diff --git a/modules/admin/images/announcement.png b/modules/admin/images/announcement.png new file mode 100644 index 0000000..c70591d Binary files /dev/null and b/modules/admin/images/announcement.png differ diff --git a/modules/admin/images/calendar.png b/modules/admin/images/calendar.png new file mode 100644 index 0000000..86b9861 Binary files /dev/null and b/modules/admin/images/calendar.png differ diff --git a/modules/admin/images/editfiles.png b/modules/admin/images/editfiles.png new file mode 100644 index 0000000..500e206 Binary files /dev/null and b/modules/admin/images/editfiles.png differ diff --git a/modules/admin/images/editpage.png b/modules/admin/images/editpage.png new file mode 100644 index 0000000..ab3fd58 Binary files /dev/null and b/modules/admin/images/editpage.png differ diff --git a/modules/admin/images/file_doc.png b/modules/admin/images/file_doc.png new file mode 100644 index 0000000..b1da1ef Binary files /dev/null and b/modules/admin/images/file_doc.png differ diff --git a/modules/admin/images/file_pdf.png b/modules/admin/images/file_pdf.png new file mode 100644 index 0000000..500e206 Binary files /dev/null and b/modules/admin/images/file_pdf.png differ diff --git a/modules/admin/images/file_rtf.png b/modules/admin/images/file_rtf.png new file mode 100644 index 0000000..39304c1 Binary files /dev/null and b/modules/admin/images/file_rtf.png differ diff --git a/modules/admin/images/file_word.png b/modules/admin/images/file_word.png new file mode 100644 index 0000000..3011f00 Binary files /dev/null and b/modules/admin/images/file_word.png differ diff --git a/modules/admin/images/photogallery.png b/modules/admin/images/photogallery.png new file mode 100644 index 0000000..a161a55 Binary files /dev/null and b/modules/admin/images/photogallery.png differ diff --git a/modules/admin/index.php b/modules/admin/index.php new file mode 100644 index 0000000..4dd4539 --- /dev/null +++ b/modules/admin/index.php @@ -0,0 +1,73 @@ +. + */ + + if(!defined("MODULE_FILE")) + { + die("Access denied."); + } + + define("ADMIN_FILE",'admin_file'); + include 'admin_functions.php'; + + if($_GET['op'] == 'logout') + { + logout(); + } + +/* if(login()) + { + //this is so dirty... sigh. + if(is_loggedin()) + { + */ ?> + + + + + + +
      + +
      +
      + Administrative Tools: +
      Manage Pages','?load=admin&op=pages'), + LinkInternal('
      Edit Navigation','?load=admin'), + LinkInternal('
      Edit Announcements','?load=admin'), + LinkInternal('
      Manage Events','?load=admin'), + LinkInternal('
      Manage Galleries', '?load=admin') + + ); + + //render administration table + CompileAdmin($th,$td); + ?> +
      + +
      + + \ No newline at end of file diff --git a/modules/admin/operation.php b/modules/admin/operation.php new file mode 100644 index 0000000..0ac2a9b --- /dev/null +++ b/modules/admin/operation.php @@ -0,0 +1,53 @@ +. + */ + +if(!defined("ADMIN_FILE")) +{ + die("Access denied."); + return; +} + +if(!isset($_GET['op'])) +{ + echo "
      No operation selected
      \n"; + return; +} + +$op = $_GET['op']; +$basedir = 'modules/admin/'; + +if(file_exists($basedir)) +{ + if(file_exists($basedir . $op)) + { + include $basedir . $op . '/index.php'; + } + else + { + ReportError("Administrative operation '$op' does not exist."); + } +} +else +{ + ReportError("Administrative base directory path does not exist."); +} + + + +?> \ No newline at end of file diff --git a/modules/admin/pages/functions.php b/modules/admin/pages/functions.php new file mode 100644 index 0000000..104a19a --- /dev/null +++ b/modules/admin/pages/functions.php @@ -0,0 +1,230 @@ +. + */ + +/** + * Note to anyone feeling the need to edit this file... + * You MUST declare $db as global inside your functions in order access MySQL from here. + */ + +function ListArticles($pageid){ + + global $db; + $result = $db->Query("SELECT article_id,title FROM bayonet_articles WHERE `page_id` = $pageid ORDER BY `weight`"); + while(($row = $db->Fetch($result))!=false) + { + $articles[] = $row; + } + + echo ""; + + if(count($articles)==0){ + echo "
      There are no articles posted on this page.
      "; + return; + } + foreach($articles as $article) + { + if($_GET['aid'] == $article['article_id']) + echo ''; + else + echo ''; + ?> + + ^ + + + + v + + + "; + + + +} + +function EditArticle($article_id){ + + global $db; + //Grab the page from the database according to the $article_id passed to the function. + $result = $db->Query("SELECT title,text FROM bayonet_articles WHERE article_id = '$article_id'"); + while(($row = $db->Fetch($result))!=false) + { + //We only want one row, so we don't have to $article[]... No foreach necessary. + $article = $row; + } + ?> +
      + + + +
      + + +
      +
      + Query("SELECT page_id,title FROM bayonet_pages"); + while(($row = $db->Fetch($result))!=false) + { + $pages[] = $row; + } + + echo 'Select page: '; + // echo ""; +} + +function NewPage() +{ + global $db; + if(isset($_POST['processed'])) + { + //Secure our data to prevent injection attacks. + $title = addslashes($_POST['title']); + $text = addslashes($_POST['text']); + if(empty($title) || empty($text)) + { + echo "You must fill everything out before proceeding."; + return; + } + + //Update the database with the new data. + $db->Query("INSERT INTO bayonet_pages SET title = '$title', text = '$text'"); + echo "New page, '$title', has been added.\n"; + //die, because we have completed what we wanted to do. + return; + } + + ?> +

      Add New Page

      +
      + + + + +
      Title
      Text
      +
      + Query("UPDATE bayonet_pages SET title = '$title', text = '$text' WHERE page_id = '$page_id'"); + echo "Page, '$title', has been edited.\n"; + //die, because we have completed what we wanted to do. + return; + } + + $aid = $_GET['aid']; +?> + + + + + + +
       View this Page','?load=page&id='.$page_id); ?> Delete this Page','?load=admin&op=pages&delete='.$page_id); ?>
      +
      + + + + + +
      + + + 0){ + EditArticle($aid); + } + ?> +
      + Query("SELECT title FROM bayonet_pages WHERE page_id = '$page_id'"); + $page = $db->Fetch($result); + + if(isset($_POST['proceed'])) + { + echo "Page '{$page['title']}', was deleted."; + $db->Query("DELETE FROM bayonet_pages WHERE page_id = '$page_id' LIMIT 1"); + return; + } + if(isset($_POST['cancel'])) + { + echo "User cancelled deletion of page: '{$page['title']}'"; + return; + } + if($page_id == 1){ + echo "You can not delete the home page."; + return; + } + + ?> +
      + + + +
      Are you SURE you want to delete the page titled: ''?
         
      +
      + \ No newline at end of file diff --git a/modules/admin/pages/index.php b/modules/admin/pages/index.php new file mode 100644 index 0000000..0fb6cff --- /dev/null +++ b/modules/admin/pages/index.php @@ -0,0 +1,68 @@ +. + */ + ?> + +
      +
      + Manage Pages: + + + + + + + + +
      +  Create a Page','?load=admin&op=pages&create=true'); ?> +
      +
      +
      diff --git a/modules/gallery/dynamitelax/100_2867.JPG b/modules/gallery/dynamitelax/100_2867.JPG new file mode 100644 index 0000000..92a423d Binary files /dev/null and b/modules/gallery/dynamitelax/100_2867.JPG differ diff --git a/modules/gallery/dynamitelax/100_2889.JPG b/modules/gallery/dynamitelax/100_2889.JPG new file mode 100644 index 0000000..c216acf Binary files /dev/null and b/modules/gallery/dynamitelax/100_2889.JPG differ diff --git a/modules/gallery/dynamitelax/100_2901.JPG b/modules/gallery/dynamitelax/100_2901.JPG new file mode 100644 index 0000000..48a68e5 Binary files /dev/null and b/modules/gallery/dynamitelax/100_2901.JPG differ diff --git a/modules/gallery/dynamitelax/100_3042.JPG b/modules/gallery/dynamitelax/100_3042.JPG new file mode 100644 index 0000000..cabdf59 Binary files /dev/null and b/modules/gallery/dynamitelax/100_3042.JPG differ diff --git a/modules/gallery/dynamitelax/100_3047.JPG b/modules/gallery/dynamitelax/100_3047.JPG new file mode 100644 index 0000000..1d8966d Binary files /dev/null and b/modules/gallery/dynamitelax/100_3047.JPG differ diff --git a/modules/gallery/dynamitelax/100_3050.JPG b/modules/gallery/dynamitelax/100_3050.JPG new file mode 100644 index 0000000..1f201eb Binary files /dev/null and b/modules/gallery/dynamitelax/100_3050.JPG differ diff --git a/modules/gallery/dynamitelax/100_3051.JPG b/modules/gallery/dynamitelax/100_3051.JPG new file mode 100644 index 0000000..c8e30a1 Binary files /dev/null and b/modules/gallery/dynamitelax/100_3051.JPG differ diff --git a/modules/gallery/dynamitelax/100_3883.jpg b/modules/gallery/dynamitelax/100_3883.jpg new file mode 100644 index 0000000..95d43f1 Binary files /dev/null and b/modules/gallery/dynamitelax/100_3883.jpg differ diff --git a/modules/gallery/index.php b/modules/gallery/index.php new file mode 100644 index 0000000..e69de29 diff --git a/modules/gallery/testphotos/dlogo.png b/modules/gallery/testphotos/dlogo.png new file mode 100644 index 0000000..68d3aa8 Binary files /dev/null and b/modules/gallery/testphotos/dlogo.png differ diff --git a/modules/gallery/testphotos/logo.png b/modules/gallery/testphotos/logo.png new file mode 100644 index 0000000..2c62008 Binary files /dev/null and b/modules/gallery/testphotos/logo.png differ diff --git a/modules/gallery/testphotos/player.jpg b/modules/gallery/testphotos/player.jpg new file mode 100644 index 0000000..434f6c2 Binary files /dev/null and b/modules/gallery/testphotos/player.jpg differ diff --git a/modules/gallery/testphotos/team.jpg b/modules/gallery/testphotos/team.jpg new file mode 100644 index 0000000..8e5c6eb Binary files /dev/null and b/modules/gallery/testphotos/team.jpg differ diff --git a/modules/index/index.php b/modules/index/index.php new file mode 100644 index 0000000..fd1eef1 --- /dev/null +++ b/modules/index/index.php @@ -0,0 +1,36 @@ +> + * This page is a module that displays multiple modules + * Database should store a list of module names in the order they are to be displayed + * This should be fairly simple to produce -- Dont forget to set this as the default + * in the config.php array + * + */ +?> + +Query("SELECT `index_modules` FROM `bayonet_settings` WHERE `title` = 'Default'"); + while(($row = $db->Fetch($result))!==false) + { + $indexModules = $row['index_modules']; + } + + $indexModules = explode(',',$indexModules); + + foreach($indexModules as $module) + { + if(file_exists("modules/" . $module)) + { + include 'modules/' . $module . '/index.php'; + } + else + { + OpenTable(); + ReportError("Cannot load module '{$module}' directory.
      \n"); + CloseTable(); + } + echo "
      "; + } +?> \ No newline at end of file diff --git a/modules/news/categories/3rdIDnews.png b/modules/news/categories/3rdIDnews.png new file mode 100644 index 0000000..e31a7f5 Binary files /dev/null and b/modules/news/categories/3rdIDnews.png differ diff --git a/modules/news/categories/marnemessenger.png b/modules/news/categories/marnemessenger.png new file mode 100644 index 0000000..691129e Binary files /dev/null and b/modules/news/categories/marnemessenger.png differ diff --git a/modules/news/functions.php b/modules/news/functions.php new file mode 100644 index 0000000..66c8b68 --- /dev/null +++ b/modules/news/functions.php @@ -0,0 +1,260 @@ +. + */ + + /** + * getNewsComments($id) + * Function getting an array of comments for posted news + * @param id - news_id cooresponding to `bayonet_news` + * @return - associative array of comments + */ +function getNewsComments($id){ + + global $db; + $result = $db->Query("SELECT c.comment_id, c.news_id, c.author_id, c.message, c.date, u.username AS author, u.avatar as avatar ". + "FROM `bayonet_news_comments` AS c ". + "LEFT OUTER JOIN `mybb_users` AS u ON u.uid = c.author_id ". + "WHERE c.news_id = '$id' ". + "ORDER BY date ASC"); + while(($row = $db->Fetch($result)) != false) + { + $comments[] = $row; + } + + $db->Free($result); + + return $comments; +} + + /** + * displayComments($data) + * Function that takes an array of comments and displays them in html + * @param data - associative array of comments from the database + */ +function displayComments($data){ + + date_default_timezone_set("America/New_York"); + OpenTable(); + ?> + +
      + + + + + +

      User Comments

      Add Yours
      +
        + + +
      1. +
        + +
        + "; + }else{ + echo ""; + } + ?> +

        + 0){ + echo "{$comment['author']}"; + }else{ + echo "Guest"; + } + ?> + + +

        +
        + +
        + +

        + +
        + +
        +
      2. + + "; + + commentForm(); + + CloseTable(); +} + + /** + * getNumOfComments($id) + * Function that gets the number of comments a news post has + * @param id - news_id cooresponding to `bayonet_news` + */ +function getNumOfComments($id){ + + global $db; + $result = $db->Query("SELECT `comment_id` FROM `bayonet_news_comments` WHERE `news_id` = '$id'"); + + return $db->Rows($result);; +} + + /** + * getNumOfComments($id) + * Function that gets the desired news from the database and returns it as an array + * @param id - (optional) news_id cooresponding to `bayonet_news` + */ +function getNews($id = NULL){ + + global $db; + $query = "SELECT n.news_id, n.title, n.message, n.date, n.category_id, u.username AS author, c.name AS catname, c.image AS catimage ". + "FROM `bayonet_news` AS n ". + "INNER JOIN `bayonet_news_categories` AS c ON c.category_id = n.category_id ". + "LEFT OUTER JOIN `mybb_users` AS u ON u.uid = n.author_id "; + if(isset($id)){ + $query = $query."WHERE n.news_id = '$id' "; + }else{ + $query = $query."ORDER BY date DESC"; + if($limit !=NULL){ + $query = $query." LIMIT '$limit'"; + } + } + + $result = $db->Query($query); + while(($row = $db->Fetch($result)) != false) + { + $data[] = $row; + } + + $db->Free($result); + + return $data; +} + + /** + * displayNews($data) + * Function that takes an array of news and displays it as html + * @param data - associative array of news from the database + */ +function displayNews($data){ + + date_default_timezone_set("America/New_York"); + foreach($data as $news) + { + $numComments = getNumOfComments($news['news_id']); + + OpenTable(); ?> + +
        + + + + + +
        Posted by:
        +
        +
        + <?php echo $news['catname']; ?> + +
        + + + "; + } +} + +/** This was coded on Coda with a MacBook Pro **/ +function commentForm(){ + + global $db; + + if(isset($_POST['processed'])) + { + $comment = stripslashes($_POST['comment']); + $author_id = stripslashes($_POST['author']); + + echo "Author: {$author_id}
        Comment: {$comment}
        "; + echo "Your comment has been processed. Please wait.
        "; + } + + $cur_user_id = 0; //testing variable, until i get the login system working for this + + $logged_in = false; + $result = $db->Query("SELECT `username`, `avatar` FROM `mybb_users` WHERE `uid` = '$cur_user_id' LIMIT 1"); + while(($row = $db->Fetch($result)) != false) + { + $username = $row['username']; + $avatar = $row['avatar']; + $logged_in = true; + } + +?> + +

        Add Your Comment

        + +
          +
        1. + +
          + "; + }else{ + echo ""; + } + ?> +

          + +

          +
          +
          + + + + + +
          +
        2. +
        + + \ No newline at end of file diff --git a/modules/news/images/avatar.png b/modules/news/images/avatar.png new file mode 100644 index 0000000..825197a Binary files /dev/null and b/modules/news/images/avatar.png differ diff --git a/modules/news/images/comment_arrow.png b/modules/news/images/comment_arrow.png new file mode 100644 index 0000000..0962f4f Binary files /dev/null and b/modules/news/images/comment_arrow.png differ diff --git a/modules/news/index.php b/modules/news/index.php new file mode 100644 index 0000000..6aaec2d --- /dev/null +++ b/modules/news/index.php @@ -0,0 +1,44 @@ + +. + */ + +if(!defined("MODULE_FILE")) +{ + die('Access Denied.'); +} + +include 'modules/news/functions.php'; + +$logged_id = 2; + +if(isset($_GET['id'])) +{ + $news_id = $_GET['id']; + displayNews(getNews($news_id)); + displayComments(getNewsComments($news_id)); + return; +} +else +{ + displayNews(getNews()); + return; +} + + +?> \ No newline at end of file diff --git a/modules/news/style.css b/modules/news/style.css new file mode 100644 index 0000000..fe98982 --- /dev/null +++ b/modules/news/style.css @@ -0,0 +1,234 @@ + /********************************* + ** Comment Styles ** + *********************************/ + + div.comment_author a, div.comment_author a:visited { + font-size: 10px; + font-family: verdana; + color:#3666ba; + } + + div.comment_author a:hover, div.comment_author a:visited:hover { + font-size: 10px; + font-family: verdana; + color:#42423d; + } + +/* Comments */ +#comments { + background: #ededed; + padding: 25px 25px; + padding-top:0px; + border: 1px solid #dcdddd; + color: #42423d; +} +#comments a { + text-decoration: none; +} +#comments_wrap h3 { + font-size: 22px; + font-weight: normal; + margin: 0px; + padding-bottom: 20px; + margin-top: 10px; +} +#comments_wrap h3 a, #comments_wrap h3 a:hover { + color: #242323; + text-decoration: none; +} +#comments_wrap .get_avatar { + color: #a7a7a7; + font-size: 10px; + letter-spacing: -1px; + padding-top: 10px; +} +#comments ol.parent { + padding-bottom: 25px +} +#comments ol { + margin: 0px; + padding: 0px; + padding-left: 120px; +} +#comments ol li { + list-style: none; + padding: 0px; + margin: 10px 0px; + padding-top: 1px; +} +#comments span.comment-reply { + position: absolute; + bottom: 10px; + left: 20px; + font-size: 10px; + text-transform: uppercase; +} +#comments .comment_wrap { + position: relative; + background: #fff; + border: 1px solid #dcdddd; +} +#comments .single_comment { + padding: 20px; + padding-bottom: 60px; + color: #42423d; +} +#comments .comment_arrow { + position: absolute; + top: 20px; + left: -32px; +} +#comments .comment_author { + position: absolute; + left: -120px; + width: 100px; + color: #8d8d8d; + font-size: 10px; + line-height: 14px; +} +#comments .comment_author span { + display: block; +} +#comments .children { + padding-left: 0px; + border-left: 1px solid #ced0d0; +} +#comments .children li { + padding-left: 25px; + background: url(images/comment_li_bg.gif) no-repeat 0px 25px; +} +#comments .children .comment_wrap { + background: #f8f8f8; + border: 1px solid #d3d5d5; +} +#comments .children .comment_arrow { + display: none; +} +#comments .children .comment_author { + position: absolute; + left: auto; + right: 20px; + bottom: 10px; + width: 200px; + height: 40px; +} +#comments .children .comment_author p { + position: absolute; + right: 50px; + bottom: -20px; + text-align: right; +} +#comments .children .comment_author span { + display: block; +} +#comments .children .comment_author img { + width: 40px; + height: 40px; + float: right; +} +/* Comments Form */ +#respond { + position: relative; +} +#comments .comment_form_wrap { + position: relative; + padding-left: 120px; +} +#comments .parent .comment_form_wrap { + position: relative; + padding-left: 0px; +} +#comments .textarea_arrow { + position: absolute; + top: 25px; + left: 89px; +} +#comments .children .textarea_arrow, +#comments .parent .textarea_arrow { + display: none; +} +#comments .comment_form_wrap .comment_author { + position: absolute; + left: 0px; +} +#comments .children .comment_form_wrap { + position: relative; + padding-left: 0px; +} +#comments .children .comment_form_wrap .comment_author, +#comments .parent .comment_form_wrap .comment_author, +#comments .children .form_header, +#comments .parent .form_header { + display: none; +} +#comments .input { + width: 456px; + padding: 4px 5px; + background: #fff; + border: 1px solid #ced0d0; + color: #5f6565; + font-family: Tahoma, Arial, Helvetica, sans-serif; + display: block; + margin-bottom: 10px; +} +#comments .children .input { + width: 431px; +} +#comments .textarea { + padding-top: 20px; + padding-left: 20px; + width: 448px; + max-width: 468px; + height: 135px; + font-size: 12px; + color: #5f6565; + font-family: Tahoma, Arial, Helvetica, sans-serif; +} +#comments .children .textarea { + width: 423px; +} +#comments #submit_comment { + width: 12.0em; + height: 3.0em; + float: right; + margin-right: 7px; + margin-top: 10px; +} +#wpUserLinks_form #submit_comment { + width: 12.0em; + height: 3.0em; + margin-top: 10px; +} +#comments .inputerror { + border-color: #555; +} +#cancel-comment-reply { + float: left; + width: 120px; + height: 30px; + margin-top: 8px; +} +#cancel-comment-reply-link { + background: #fdfdfd url(images/button_bg.png) repeat-x 0 100%; + border: 1px solid #bbbbbb; + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 9px; + text-transform: uppercase; + height: 22px; + width: 70px; + text-align: center; + padding-bottom: 2px; + letter-spacing: -0.05em; + cursor: pointer; + display: block; + line-height: 22px; +} +*+html #cancel-comment-reply-link { + height: 22px; + padding-bottom: 0px; +} +#cancel-comment-reply-link:hover { + color: #232323; + background: #eeeeee url(images/button_bg_hover.png) repeat-x 0 100%; + text-decoration: none; +} diff --git a/modules/newsreel/images/slidenavbg.png b/modules/newsreel/images/slidenavbg.png new file mode 100644 index 0000000..6e3a726 Binary files /dev/null and b/modules/newsreel/images/slidenavbg.png differ diff --git a/modules/newsreel/images/slidenavbg2.png b/modules/newsreel/images/slidenavbg2.png new file mode 100644 index 0000000..8b9f612 Binary files /dev/null and b/modules/newsreel/images/slidenavbg2.png differ diff --git a/modules/newsreel/images/slidenavbg3.png b/modules/newsreel/images/slidenavbg3.png new file mode 100644 index 0000000..a027d26 Binary files /dev/null and b/modules/newsreel/images/slidenavbg3.png differ diff --git a/modules/newsreel/index.php b/modules/newsreel/index.php new file mode 100644 index 0000000..5aaf9ba --- /dev/null +++ b/modules/newsreel/index.php @@ -0,0 +1,113 @@ + + + + +
        + newsreel + + +'.$echo_slidenav['title'].''; + $y++; + } +?> + +
        +
        + + \ No newline at end of file diff --git a/modules/newsreel/slides/arma2move.png b/modules/newsreel/slides/arma2move.png new file mode 100644 index 0000000..7c7c419 Binary files /dev/null and b/modules/newsreel/slides/arma2move.png differ diff --git a/modules/newsreel/slides/newsite.png b/modules/newsreel/slides/newsite.png new file mode 100644 index 0000000..88a28e8 Binary files /dev/null and b/modules/newsreel/slides/newsite.png differ diff --git a/modules/newsreel/slides/recruitmentGT.png b/modules/newsreel/slides/recruitmentGT.png new file mode 100644 index 0000000..c74ae8c Binary files /dev/null and b/modules/newsreel/slides/recruitmentGT.png differ diff --git a/modules/newsreel/slides/teamwork.png b/modules/newsreel/slides/teamwork.png new file mode 100644 index 0000000..99f760b Binary files /dev/null and b/modules/newsreel/slides/teamwork.png differ diff --git a/modules/page/index.php b/modules/page/index.php new file mode 100644 index 0000000..e5ac25e --- /dev/null +++ b/modules/page/index.php @@ -0,0 +1,71 @@ +. + */ + +define("MODULE_FAIL", "You cannot access this module directly.
        \n",true); + +if(!defined("MODULE_FILE")) +{ + die(MODULE_FAIL); +} + +global $db; + + +if(!isset($_GET['id'])) +{ + //ReportError("No page has been requested.
        \n"); + // return 1; + $id = 1; //makes it so that the default page is the home page +}else{ + $id = $_GET['id']; +} + +$result = $db->Query("SELECT u.username AS author, p.page_created, p.title, p.text FROM `bayonet_pages` AS p LEFT OUTER JOIN `bayonet_users` AS u ON u.user_id = p.author_id WHERE p.page_id = '$id'"); +$proceed = mysql_num_rows($result); + +if($proceed > 0) +{ + while(($row = $db->Fetch($result))!==false) + { + $page = $row; + OpenTable(); + echo "
        "; + $aresult = $db->Query("SELECT * FROM `bayonet_articles` WHERE `page_id` = $id ORDER BY `weight` ASC"); + while(($article = $db->Fetch($aresult))!==false) + { + $articleTitle = $article['title']; + echo '

        '.$articleTitle.'

        '; + //echo "

        ".$article['title']."

        "; + echo BBCode($article['text']); + } + echo "
        "; + CloseTable(); + + } + ?> + + + \n"); +} + +?> \ No newline at end of file diff --git a/modules/tsviewer/index.php b/modules/tsviewer/index.php new file mode 100644 index 0000000..18ee7c5 --- /dev/null +++ b/modules/tsviewer/index.php @@ -0,0 +1,43 @@ +. + */ + +if(!defined("MODULE_FILE")) +{ + echo "Access denied..."; + return; +} + +OpenTable(); +echo "How to Connect

        IP: 64.214.185.50:9004

        Password: Garand

        "; +CloseTable(); + + +OpenTable(); +echo "Teamspeak Server"; +/*echo "
        \n";*/ +echo "
        \n"; +?> + +\n"; +echo ""; +CloseTable(); + + +?> diff --git a/navigation.php b/navigation.php new file mode 100644 index 0000000..ecf1236 --- /dev/null +++ b/navigation.php @@ -0,0 +1,23 @@ + + + + +Query("SELECT * FROM `bayonet_navigation` ORDER BY `weight`"); + while(($row = $db->Fetch($result))!==false) + { + echo ''; + } +?> + + \ No newline at end of file diff --git a/style.css b/style.css new file mode 100644 index 0000000..b5492ef --- /dev/null +++ b/style.css @@ -0,0 +1,389 @@ + /********************************* + ** Layout Styles ** + *********************************/ + div.container { + /* width:990px; + margin: 0px auto 0px auto; + text-align:center; */ + /* background-image:url('images/sandbackground.jpg'); + background-repeat: repeat;*/ + width: 990px; + color: #000000; + margin: auto auto; + text-align: left; /* IE 5 fix */ + } + div.banner { + /* width:800px; + height:125px; + text-align:center; + vertical-align:middle; + background-color:#202020; */ + width: 990px; + background: #fff; + color: #000000; + margin: auto auto; + } + div.nav { + /* + height:19px; + text-align:center; + vertical-align:top; + background-color:blue; */ + /* background-image:url("images/navbg.png"); */ + width: 990px; + height: 28px; + background: #284c75; + background-image:url('images/navbackground.jpg'); + color: #000000; + margin: auto auto; + font-size:14px; + } + table.main { + background-image:url('images/sandbackground.jpg'); + padding: 0px; + color:#ffffff; + width:990px; + background-color:#a3a2a0; + } + + table.main td { + /* color:white; */ + } + .leftcol { + width:644px; + background-color:transparent; + vertical-align:top; + } + .rightcol { + vertical-align:top; + } + div.footer { + text-align:center; + font-family:verdana; + font-size:10pt; + color:#5e5e5e; + background-color:#333333; + border-top: 1px solid #5e5e5e; + } + + /********************************* + ** Content Styles ** + *********************************/ + div.contentBorder1 { + background-color:white; + border:1px solid #3666ba; + } + div.contentBorder2 { + background-color:white; + border:1px solid #333333; + } + div.contentHeading { + background-image:url(images/blockbackground.jpg); + background-repeat:repeat-x; + background-color:#112f50; + height:25px; + padding-left:10px; + padding-right:10px; + padding-top:5px; + color:white; + } + div.content { + padding:10px; + color:#333333; + } + div.content img { + padding:5px; + } + div.contentFooter { + border-top:1px solid #333333; + background-color:#a4a4a4; + color:white; + padding-left:5px; + padding-right:5px; + } + span.footer-text { + font-size: 10px; + } + + /********************************* + ** Nav Links Styles ** + *********************************/ + table.navLinks a, table.navLinks a:visited, table.navLinks a:active { + background-color:transparent; + color:white; + font-family:verdana; + font-size:11px; + font-weight:bold; + text-decoration:none; + } + + table.navLinks a:hover, table.navLinks a:visited:hover { + background-color:transparent; + color:#d2d2d2; + font-size:11px; + font-weight:bold; + text-decoration:none; + } + + table.navLinks { + height:25px; + } + + table.navLinks td { + border-right: 1px solid #213f61; + vertical-align:middle; + } + + /********************************* + ** Nav Links Styles ** + *********************************/ + + h1, h2, h3, h4, h5, h6 { + font-family: Helvetica, Arial, sans-serif; + font-weight: normal; + } + + .leftbar { + /* background-image:url("images/leftshadow.png"); */ + background-repeat: + repeat-y; + width:50px; + } + .rightbar { + /* background-image:url("images/rightshadow.png"); */ + background-repeat: + repeat-y; + width:15px; + } + table, tr, td { + padding:0px; + border:0px; + margin:0px + } + body, td, div { + font-size:10pt; + /* color:black; */ + font-family:verdana; + font-weight:normal; + } + a, a:visited, a:active { + background-color:transparent; + color:#3666ba; + font-family:verdana; + font-size:12px; + text-decoration:none; + } + + a:hover, a:visited:hover { + background-color:transparent; + color:#3666ba; + font-family:verdana; + font-size:12px; + text-decoration:underline; + } + a.admin, a.admin:visited, a.admin:active { + + color:#e3c70b; + font-size:16px; + text-decoration:none; + } + a.admin:hover, a.admin:visited:hover { + + color:#b90000; + font-size:16px; + text-decoration:none; + } + body { + background-color:#091a34; + margin:0; + padding:0; + text-align:left; + } + +/* div.content { + width:800px; + min-height:570px; + background-color:white; + } */ + div.topbar { + height:25px; + text-align:center; + background-color:black; + font-family:verdana; + font-size:10pt; + color:#797e4f; + } + div.botbar { + height:50px; + padding:5px; + text-align:center; + background-color:black; + font-family:verdana; + font-size:10pt; + } + .footertext { + color:blue; + } + div.announcement { + color:black; + padding:7px; + } + .navspacer { + text-align:center; + width:20px; + } + table.slideshow { + border-top:1px #ffffff solid; + background-image:url(slidebg.png); + vertical-align:baseline; + width:100%; + height:100%; + } + table.slideshow td { + color:white; + } + .slidenav { + text-align:center; + font-size:11pt; + line-height: 1.4; + background-image:url("modules/newsreel/images/slidenavbg.png"); + vertical-align:text-bottom; + border-right:1px solid #333333; + } + a img { + border:0px; + } + table.cleartable td { + background-color:transparent; + } + table.wide-table { + width:100%; + background-color: yellow; + } + div.maincontent { + color:black; + width:766px; + padding:15px; + padding-bottom:5px; + text-align:left; + } + div.maincontent-news { + width:663px; + padding:15px; + padding-top:5px; + padding-bottom:5px; + } + input { + /*background-color:black; */ + /*color:#575757; */ + /*border:1px solid #575757;*/ + } + input.input { + background-color:black; + width:119px; + border:1px solid #575757; + margin-bottom:5px; + color:#575757; + padding:3px; + font-family:verdana; + } + div.submitbutton { + text-align:right; + margin-bottom:0; + float:right; + } + form { + margin:0; + } + p.contentp { + margin-top:0; + } + p.contentpc { + margin-top:0; + text-align:center; + } + table.options { + width:100%; + /*text-align:right;*/ + vertical-align:middle; + /*background-color: #a1a1a1;*/ + border-top: 1px solid #a1a1a1; + border-left: 1px solid #a1a1a1; + border-bottom: 1px solid #a1a1a1; + } + table.options th { + background-color:#666666; + color:white; + height:17px; + font-size:10px; + font-weight:bold; + text-align:center; + } + table.options td { + background-color:transparent; + border-right: 1px solid #a1a1a1; + border-top: 1px solid #a1a1a1; + padding:3px; + font-size:10px; + vertical-align:middle; + color:black; + } + table.options td a, table.options td a:visited { + font-weight:bold; + font-size:10px; + color:#333333; + } + table.options td a:hover, table.options td a.visited:hover { + font-weight:bold; + font-size:10px; + color:#333333; + } + table.options td a.highlight, table.options td a.highlight:visited { + font-weight:bold; + font-size:10px; + color:#474747; + } + table.options td a.highlight:hover, table.options td a.highlight.visited:hover { + font-weight:bold; + font-size:10px; + color:#474747; + } + table.options tr { + + } + tr.rownorm{ + background-color:white; + + } + tr.rowhigh{ + background-color:#e0e0e0; + } + .photoleft{ + background-image:url("images/photoleft.png"); + background-repeat:repeat-y; + text-align:center; + width:49px; + } + .photoright{ + background-image:url("images/photoright.png"); + background-repeat:repeat-y; + text-align:center; + width:49px; + } + .left{ + text-align:left; + } + .right{ + text-align:right; + } + .center{ + text-align:center; + } + .title{ + font-size:14px; + font-weight:bold; + font-family:arial; + } + + + diff --git a/style_bbcode.css b/style_bbcode.css new file mode 100644 index 0000000..7299c06 --- /dev/null +++ b/style_bbcode.css @@ -0,0 +1,71 @@ +.bold { + font-weight: bold; +} + +.italics { + font-style: italic; +} + +.underline { + text-decoration: underline; +} + +.strikethrough { + text-decoration: line-through; +} + +.overline { + text-decoration: overline; +} + +.quotecodeheader { + font-family: Verdana, arial, helvetica, sans-serif; + font-size: 12px; + font-weight: bold; +} + +.codebody { + background-color: #FFFFFF; + font-family: Courier new, courier, mono; + font-size: 12px; + color: #006600; + border: 1px solid #BFBFBF; +} + +.quotebody { + background-color: #FFFFFF; + font-family: Courier new, courier, mono; + font-size: 12px; + color: #660002; + border: 1px solid #BFBFBF; +} + +.listbullet { + list-style-type: disc; + list-style-position: inside; +} + +.listdecimal { + list-style-type: decimal; + list-style-position: inside; +} + +.listlowerroman { + list-style-type: lower-roman; + list-style-position: inside; +} + +.listupperroman { + list-style-type: upper-roman; + list-style-position: inside; +} + +.listloweralpha { + list-style-type: lower-alpha; + list-style-position: inside; +} + +.listupperalpha { + list-style-type: upper-alpha; + list-style-position: inside; +} -- cgit