From 12cd5888c5329224185c02a0b2bec271fca1e05c Mon Sep 17 00:00:00 2001 From: PioDer Date: Sat, 14 Feb 2015 12:01:53 +0100 Subject: [PATCH] initial commit with snapshot 20140213 --- config.php | 17 + images/avatars/11.jpg | Bin 0 -> 2707 bytes images/avatars/6.jpg | Bin 0 -> 2707 bytes images/smiles/big_smile.gif | Bin 0 -> 696 bytes images/smiles/cool.gif | Bin 0 -> 1398 bytes images/smiles/cry.png | Bin 0 -> 995 bytes images/smiles/curve.gif | Bin 0 -> 1082 bytes images/smiles/evil.gif | Bin 0 -> 1146 bytes images/smiles/exclaim.gif | Bin 0 -> 1131 bytes images/smiles/lol.gif | Bin 0 -> 515 bytes images/smiles/mad.gif | Bin 0 -> 465 bytes images/smiles/neutral.gif | Bin 0 -> 1246 bytes images/smiles/redface.gif | Bin 0 -> 906 bytes images/smiles/roll.gif | Bin 0 -> 705 bytes images/smiles/sad.gif | Bin 0 -> 698 bytes images/smiles/smile.gif | Bin 0 -> 1114 bytes images/smiles/tongue.gif | Bin 0 -> 698 bytes images/smiles/wink.gif | Bin 0 -> 696 bytes images/smiles/yikes.gif | Bin 0 -> 698 bytes inc/askModel.class.php | 34 + inc/bbcode.php | 111 ++++ inc/constants.php | 35 ++ inc/controller.class.php | 53 ++ inc/controllers/AdminController.class.php | 605 ++++++++++++++++++ inc/controllers/MainController.class.php | 724 ++++++++++++++++++++++ inc/database_connection.php | 6 + inc/misc_functions.php | 5 + inc/model.class.php | 56 ++ inc/models/BansModel.class.php | 64 ++ inc/models/ConfigModel.class.php | 38 ++ inc/models/ForumsModel.class.php | 119 ++++ inc/models/NavigationModel.class.php | 43 ++ inc/models/PostsModel.class.php | 126 ++++ inc/models/SessionModel.class.php | 125 ++++ inc/models/StatisticsModel.class.php | 56 ++ inc/models/UsersModel.class.php | 128 ++++ inc/view.class.php | 29 + inc/views/MainView.class.php | 536 ++++++++++++++++ index.php | 43 ++ templates/admin/admin.css | 81 +++ templates/admin/ban_form.tpl.php | 56 ++ templates/admin/banlist.tpl.php | 36 ++ templates/admin/cat_form.tpl.php | 41 ++ templates/admin/config.tpl.php | 49 ++ templates/admin/forum_form.tpl.php | 76 +++ templates/admin/forums.tpl.php | 69 +++ templates/admin/images/button_beam.gif | Bin 0 -> 1167 bytes templates/admin/images/category_beam.gif | Bin 0 -> 457 bytes templates/admin/images/delete.gif | Bin 0 -> 1024 bytes templates/admin/images/lock.gif | Bin 0 -> 1030 bytes templates/admin/images/move.gif | Bin 0 -> 1030 bytes templates/admin/images/no_av.gif | Bin 0 -> 2562 bytes templates/admin/images/offline.gif | Bin 0 -> 131 bytes templates/admin/images/online.gif | Bin 0 -> 131 bytes templates/admin/images/td_beam_top.gif | Bin 0 -> 139 bytes templates/admin/images/uf_logo.svg | 289 +++++++++ templates/admin/images/unlock.gif | Bin 0 -> 1031 bytes templates/admin/kopia admin.css | 489 +++++++++++++++ templates/admin/main.tpl.php | 112 ++++ templates/admin/overall_header.tpl.php | 46 ++ templates/admin/userlist.tpl.php | 73 +++ templates/confirm_action.tpl.php | 34 + templates/edprofile.tpl.php | 175 ++++++ templates/forum_message.tpl.php | 28 + templates/images/button_beam.gif | Bin 0 -> 1374 bytes templates/images/category_beam.gif | Bin 0 -> 998 bytes templates/images/delete.gif | Bin 0 -> 1024 bytes templates/images/lock.gif | Bin 0 -> 1030 bytes templates/images/move.gif | Bin 0 -> 1030 bytes templates/images/no_av.gif | Bin 0 -> 2562 bytes templates/images/offline.gif | Bin 0 -> 131 bytes templates/images/online.gif | Bin 0 -> 131 bytes templates/images/td_beam_top.gif | Bin 0 -> 139 bytes templates/images/uf_logo.svg | 289 +++++++++ templates/images/unlock.gif | Bin 0 -> 1031 bytes templates/kopia main.css | 489 +++++++++++++++ templates/kopia viewtopic.tpl.php | 146 +++++ templates/login_form.tpl.php | 54 ++ templates/main.css | 81 +++ templates/main.tpl.php | 123 ++++ templates/move_topic.tpl.php | 67 ++ templates/overall_footer.tpl.php | 6 + templates/overall_header.tpl.php | 56 ++ templates/posting.tpl.php | 126 ++++ templates/register_form.tpl.php | 83 +++ templates/scripts/chkcookie.js | 33 + templates/scripts/nick.js | 62 ++ templates/scripts/posting.js | 70 +++ templates/styles.css | 415 +++++++++++++ templates/userlist.tpl.php | 65 ++ templates/viewforum.tpl.php | 74 +++ templates/viewprofile.tpl.php | 65 ++ templates/viewtopic.tpl.php | 127 ++++ 93 files changed, 7038 insertions(+) create mode 100644 config.php create mode 100644 images/avatars/11.jpg create mode 100644 images/avatars/6.jpg create mode 100644 images/smiles/big_smile.gif create mode 100644 images/smiles/cool.gif create mode 100644 images/smiles/cry.png create mode 100644 images/smiles/curve.gif create mode 100644 images/smiles/evil.gif create mode 100644 images/smiles/exclaim.gif create mode 100644 images/smiles/lol.gif create mode 100644 images/smiles/mad.gif create mode 100644 images/smiles/neutral.gif create mode 100644 images/smiles/redface.gif create mode 100644 images/smiles/roll.gif create mode 100644 images/smiles/sad.gif create mode 100644 images/smiles/smile.gif create mode 100644 images/smiles/tongue.gif create mode 100644 images/smiles/wink.gif create mode 100644 images/smiles/yikes.gif create mode 100644 inc/askModel.class.php create mode 100644 inc/bbcode.php create mode 100644 inc/constants.php create mode 100644 inc/controller.class.php create mode 100644 inc/controllers/AdminController.class.php create mode 100644 inc/controllers/MainController.class.php create mode 100644 inc/database_connection.php create mode 100644 inc/misc_functions.php create mode 100644 inc/model.class.php create mode 100644 inc/models/BansModel.class.php create mode 100644 inc/models/ConfigModel.class.php create mode 100644 inc/models/ForumsModel.class.php create mode 100644 inc/models/NavigationModel.class.php create mode 100644 inc/models/PostsModel.class.php create mode 100644 inc/models/SessionModel.class.php create mode 100644 inc/models/StatisticsModel.class.php create mode 100644 inc/models/UsersModel.class.php create mode 100644 inc/view.class.php create mode 100644 inc/views/MainView.class.php create mode 100644 index.php create mode 100644 templates/admin/admin.css create mode 100755 templates/admin/ban_form.tpl.php create mode 100755 templates/admin/banlist.tpl.php create mode 100755 templates/admin/cat_form.tpl.php create mode 100755 templates/admin/config.tpl.php create mode 100755 templates/admin/forum_form.tpl.php create mode 100755 templates/admin/forums.tpl.php create mode 100644 templates/admin/images/button_beam.gif create mode 100644 templates/admin/images/category_beam.gif create mode 100644 templates/admin/images/delete.gif create mode 100644 templates/admin/images/lock.gif create mode 100644 templates/admin/images/move.gif create mode 100644 templates/admin/images/no_av.gif create mode 100644 templates/admin/images/offline.gif create mode 100644 templates/admin/images/online.gif create mode 100644 templates/admin/images/td_beam_top.gif create mode 100644 templates/admin/images/uf_logo.svg create mode 100644 templates/admin/images/unlock.gif create mode 100644 templates/admin/kopia admin.css create mode 100755 templates/admin/main.tpl.php create mode 100644 templates/admin/overall_header.tpl.php create mode 100755 templates/admin/userlist.tpl.php create mode 100755 templates/confirm_action.tpl.php create mode 100755 templates/edprofile.tpl.php create mode 100755 templates/forum_message.tpl.php create mode 100644 templates/images/button_beam.gif create mode 100644 templates/images/category_beam.gif create mode 100644 templates/images/delete.gif create mode 100644 templates/images/lock.gif create mode 100644 templates/images/move.gif create mode 100644 templates/images/no_av.gif create mode 100644 templates/images/offline.gif create mode 100644 templates/images/online.gif create mode 100644 templates/images/td_beam_top.gif create mode 100644 templates/images/uf_logo.svg create mode 100644 templates/images/unlock.gif create mode 100644 templates/kopia main.css create mode 100755 templates/kopia viewtopic.tpl.php create mode 100755 templates/login_form.tpl.php create mode 100644 templates/main.css create mode 100755 templates/main.tpl.php create mode 100755 templates/move_topic.tpl.php create mode 100644 templates/overall_footer.tpl.php create mode 100644 templates/overall_header.tpl.php create mode 100755 templates/posting.tpl.php create mode 100755 templates/register_form.tpl.php create mode 100644 templates/scripts/chkcookie.js create mode 100644 templates/scripts/nick.js create mode 100644 templates/scripts/posting.js create mode 100644 templates/styles.css create mode 100755 templates/userlist.tpl.php create mode 100755 templates/viewforum.tpl.php create mode 100755 templates/viewprofile.tpl.php create mode 100755 templates/viewtopic.tpl.php diff --git a/config.php b/config.php new file mode 100644 index 0000000..d738c18 --- /dev/null +++ b/config.php @@ -0,0 +1,17 @@ + diff --git a/images/avatars/11.jpg b/images/avatars/11.jpg new file mode 100644 index 0000000000000000000000000000000000000000..9e12b74bda5a3a405703405e424313d17c3fe491 GIT binary patch literal 2707 zcmV;E3T*ZN*#F=F5K2Z#MgRc;0RTtG1Oo*G1Ox>I1qKHU2nPoT z2M-Gi2@DYr5)u&)5fKv>92XN58Wj-{7$F!M9UUJZ9}^cMBqAOp93CGY|G)qX2mp8h zcmV+s0RO}Q8~^|T1pxs80000000000000LA1O)~N0s#R3!~i=G00IF60|EmE1Oo;K z000000RjU61Q7)iAqFuAK~WPTVR3Yx&w32=rb#Kti$EU4W29tAV zI=k(XE^?|d{3naKeTULT0yKPm!wPWFRkF&J7b8+ z=L6S*C<}9SaWtk`T)Ve+W1eZV&cT5UcMjas>kU>|LoU_#$lQF+J5|r5dYwNOpNxpf zx0T1w%+aGk)NHTp4Ek-(*8|>H8{%W>$H(PPx-To$8d$;4 z;!`=JefHL30UxOSDUId?BX)Riy;(W{FqY>dJEQOE&1MxG(&^rxS#aYcj`{l3SBhPG zFH31DVWzqbLgW#+^X%8x9={sTpP#7RNi@ zfgAvED4XG}`=#2Q+-IEDkm&7h8^%j{&^i^{&osu~*jROewQ-2ppJWLAC-o`*Vx{jF z^RhSuoKhD`&uy?U!8y%YdIDYY+@U-w4%L`cQmIP3p3c^3JeD?Zur-=)+{<|^ht5Jz z-lgK=*?Am_O!9djy?UWZU`kbc*E*&~ zjd{-B$de3yRhuIP<_f1dZ@o_HEG;b~0W!o?9JkkB@P5_8UECG~fd$l@g$Rs zRIGNFp2SH6F8S<0&M8Y>SEwu}%3C`hFLsNb4E3*6S!=fMcWTDjmwo*VTf`fj0U zFRbQRnXnp2_&*SQ>rQxweGHx(>32W@8%#OJAECdcM)dBhZK&AWAa;PT*oI}>zZ`M( zsVRX-+aTu{Ak~+{Rx({&Dc~$zoP298FM4Ct@<|s@Ur7)p#77wKpELHLn>Xd|-Hi4k zz0%nwyu!?@e{R64zbR zn$F~NoW|gCjq5{+{5|SBTe%)P7M9u&T*@3{VDtX~YOP*AWhH>kGrzkdWJUI-DV`ON zy6VTs=A|@ii_JQ9n#^KO>OtfhBkA}0wy$LrGsdefe^B6@{JE&!s?cZCVOyEd#(awm zQFFk1Snh2jxZ9D%7<$IaZB9#VHrinmHMv$Sp@!Bx@P1XrmYW`zr@>~DG{r}~ApjOW zybKC(067B#KMJ$-W+RgWpLd_VWposxig5>UeLG^Tb`gnm>$va+_#Az3YccB4?7EO+ z_>Dtfssg?;hld@22emr)Q^cM@~kHEV`0rPZMJ7Khjt{xus&_~aT!{{TqW zV!49a?^3$EOod}4rG`(C&1#PaG$W^I_OS%RxL@}*H5Kye9w$oCw&-As*{%q0+qH#VmZMF)`*=OEzO(*-Dj3Th4aAAdMEUsMz*J^!Kms9 z`Ed-WBaHgdS6S8I>3s~9EBMKiY!Qy@#y5P0S3EZ|KDN_0E@NWH)RHoPdLv%8-0*Rl zLDzDFQ{Ep*yH$_{{VAW`vif(WlyghM4(=*9t$NG+Eu{Ydmr(ap5QB{E2mb)H6TY0u za`KkW<|O=0A(e0IN=0JR458+w`gf+UukVo-GO3bhoD&OIZZrX#gb`cEySbs_(Y7w7e zPH;)CpoelU?nWwqp{1UeE=E2zl@NK-$=f}?esq?jeI1RnNax-o-5#_n>z9*K zvzvJ)LNX40DwSIeEY{FoEoia7DhKWC_T*KuseEJF)6_H^QTb9=ZN9#`N-%v$cwM-xi25@o3Ghj&1AbM4cp?Cf| NR7_)FCq8`F|JgP83~>Me literal 0 HcmV?d00001 diff --git a/images/avatars/6.jpg b/images/avatars/6.jpg new file mode 100644 index 0000000000000000000000000000000000000000..9e12b74bda5a3a405703405e424313d17c3fe491 GIT binary patch literal 2707 zcmV;E3T*ZN*#F=F5K2Z#MgRc;0RTtG1Oo*G1Ox>I1qKHU2nPoT z2M-Gi2@DYr5)u&)5fKv>92XN58Wj-{7$F!M9UUJZ9}^cMBqAOp93CGY|G)qX2mp8h zcmV+s0RO}Q8~^|T1pxs80000000000000LA1O)~N0s#R3!~i=G00IF60|EmE1Oo;K z000000RjU61Q7)iAqFuAK~WPTVR3Yx&w32=rb#Kti$EU4W29tAV zI=k(XE^?|d{3naKeTULT0yKPm!wPWFRkF&J7b8+ z=L6S*C<}9SaWtk`T)Ve+W1eZV&cT5UcMjas>kU>|LoU_#$lQF+J5|r5dYwNOpNxpf zx0T1w%+aGk)NHTp4Ek-(*8|>H8{%W>$H(PPx-To$8d$;4 z;!`=JefHL30UxOSDUId?BX)Riy;(W{FqY>dJEQOE&1MxG(&^rxS#aYcj`{l3SBhPG zFH31DVWzqbLgW#+^X%8x9={sTpP#7RNi@ zfgAvED4XG}`=#2Q+-IEDkm&7h8^%j{&^i^{&osu~*jROewQ-2ppJWLAC-o`*Vx{jF z^RhSuoKhD`&uy?U!8y%YdIDYY+@U-w4%L`cQmIP3p3c^3JeD?Zur-=)+{<|^ht5Jz z-lgK=*?Am_O!9djy?UWZU`kbc*E*&~ zjd{-B$de3yRhuIP<_f1dZ@o_HEG;b~0W!o?9JkkB@P5_8UECG~fd$l@g$Rs zRIGNFp2SH6F8S<0&M8Y>SEwu}%3C`hFLsNb4E3*6S!=fMcWTDjmwo*VTf`fj0U zFRbQRnXnp2_&*SQ>rQxweGHx(>32W@8%#OJAECdcM)dBhZK&AWAa;PT*oI}>zZ`M( zsVRX-+aTu{Ak~+{Rx({&Dc~$zoP298FM4Ct@<|s@Ur7)p#77wKpELHLn>Xd|-Hi4k zz0%nwyu!?@e{R64zbR zn$F~NoW|gCjq5{+{5|SBTe%)P7M9u&T*@3{VDtX~YOP*AWhH>kGrzkdWJUI-DV`ON zy6VTs=A|@ii_JQ9n#^KO>OtfhBkA}0wy$LrGsdefe^B6@{JE&!s?cZCVOyEd#(awm zQFFk1Snh2jxZ9D%7<$IaZB9#VHrinmHMv$Sp@!Bx@P1XrmYW`zr@>~DG{r}~ApjOW zybKC(067B#KMJ$-W+RgWpLd_VWposxig5>UeLG^Tb`gnm>$va+_#Az3YccB4?7EO+ z_>Dtfssg?;hld@22emr)Q^cM@~kHEV`0rPZMJ7Khjt{xus&_~aT!{{TqW zV!49a?^3$EOod}4rG`(C&1#PaG$W^I_OS%RxL@}*H5Kye9w$oCw&-As*{%q0+qH#VmZMF)`*=OEzO(*-Dj3Th4aAAdMEUsMz*J^!Kms9 z`Ed-WBaHgdS6S8I>3s~9EBMKiY!Qy@#y5P0S3EZ|KDN_0E@NWH)RHoPdLv%8-0*Rl zLDzDFQ{Ep*yH$_{{VAW`vif(WlyghM4(=*9t$NG+Eu{Ydmr(ap5QB{E2mb)H6TY0u za`KkW<|O=0A(e0IN=0JR458+w`gf+UukVo-GO3bhoD&OIZZrX#gb`cEySbs_(Y7w7e zPH;)CpoelU?nWwqp{1UeE=E2zl@NK-$=f}?esq?jeI1RnNax-o-5#_n>z9*K zvzvJ)LNX40DwSIeEY{FoEoia7DhKWC_T*KuseEJF)6_H^QTb9=ZN9#`N-%v$cwM-xi25@o3Ghj&1AbM4cp?Cf| NR7_)FCq8`F|JgP83~>Me literal 0 HcmV?d00001 diff --git a/images/smiles/big_smile.gif b/images/smiles/big_smile.gif new file mode 100644 index 0000000000000000000000000000000000000000..ad04031985f852db3d385d5ff5ecc2991fa18c0d GIT binary patch literal 696 zcmV;p0!RHvNk%w1VH5xq0OorD_}d=(-5>GK8vf-X{^TK|n0#eW9o^m7b2H9q`T? z|{^VA)Z zatzed%B_6|(3=XdlMK-mnnY*3bRoA?Cjp+pZ98Pza@)fz+Q1rh*N6X+LRI zAZb(}Z&nI&Uome~3Du$uW>6fbo`iE@GtQX_(9Xo9gAdrJ4XB0>*w@gZmwRYS2&ak> z-mehZrwzS~38H)pYETJ}Z3^kf8QrfC!lV_uiV3!l4&t{H-mwsya0ktr3z~iq>%|xE z(H#HfBJc9^nr{c#w-@Kc7}eCwxd5)wT+E(wQ%2nB6VGk0}#NmK<0haVYVVE_RE02&); zEg2t$2R>K;3j_lL1PcHb3TZzFgJW_r4mNqmc*l7T0vA&Z4T5e!EDL#f*x6!v7$Z12 z6oO4^00i0Rcmx0s5F{dk5oG}b=-C4S0vvAQLQK5q*x_}D>0suQFnj?Au literal 0 HcmV?d00001 diff --git a/images/smiles/cool.gif b/images/smiles/cool.gif new file mode 100644 index 0000000000000000000000000000000000000000..9db001ff67e381bb6b90d800b035fe41faf37829 GIT binary patch literal 1398 zcmZ?wbhEHb6k`x!c$UrZ=>O$_xZK;1B zDgL@AzhqYZ(>)?fW;dh;$llu^@a?+n_03|>4~VVp7kYh4Dm_T{$u8mdXQfJ$&Cae8 zSyRKFAHtdK$Nv7J%+2Mzch?KtSk9Xr$hoqee^)2x{Y`>Xig|ACl$epnJ}aO7?HTE} zrz8`+#j^Z3R`&{)rC40rB(`{F?bSs*OPhGl&E%Yz$Ccs3@no;qvppiqTKT7TX53sO za9|R5MVj@o6=E~<*ym5Jm|ZV0sV${DmAx{<_VqFGbF;bk_Hgc8$&jO4#-eYG%>J$YRGPCZfR|6Z;}@m78aN9Xk$;d zcht1e_A+Ll(8L|2&%nycz%Sro&OIT?pMi;)hliPoL5L$Rx?L(ZYY!*yo&$T*yxR`$ zJ9r|iHC>e}>-fn%Y$8rA4i+*OE;4HPhPDV>%kUh`%sj{_7^Bc)tH#Cr?9(S^20pg% zH_ckgN=z)D&j<=A9P;AO@#An^DClsIt>F_#PJpliCy#6@*H#5Z$42dxtp_p+6EnC3 zSp?)-q(ZqGdwBv(WR!%DF|)BVGFcpWpym0Na8m#qi~C>U6&8Vp&SynFY8gW`MXfWJ3 zkwsZBB-1Jwm>5_YxPX{}T^y7evVq=dX=>|8Z|UxAZJ&@mskspmWNbin>|nJ*K(!#H z&8_WCogHnxT}?>JKuU;E#(`5=GqP!%xRiA?BfE_os0`#j26jQ9+aOMB%Wmmv>di)S z8V^tf2*Ok~bMj`lbaXYfH{n*5ozJ-tAsomrD7Pn?p)Hf=Ja#;hzx!HJo`95QnP s3zJfq;za5Bo(9u|I1-{J3UHW7227MQl+;n5Xyh8gJ@MqJiH!`_086X7FaQ7m literal 0 HcmV?d00001 diff --git a/images/smiles/cry.png b/images/smiles/cry.png new file mode 100644 index 0000000000000000000000000000000000000000..c0f8ee6f42864723b208e31d0dee4b98c2ff38d9 GIT binary patch literal 995 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc3?z4jzqJQa%*9TgAsieWw;%dHU|?Wu4)6(a z{r~^}%Qx>|yngrm)!Wst|NnoceD~hn|4-!qKbHUZK3zDpNQ{kp>S>oUi=Ge^#zK78iX!5`<@PM=rqH(lMLTZF?>J8@a+V{*W(PIk1>2Y!Vq))|ChrIpARv7ImGb!Aj9YV44;5# zFT=+@3~zTbeAvP8VH?AT?F{cXF}&Z%aDNM<{fRGcRx`X=#c*#ObOsAJHJ)gsHe>%hCsSNk0GCY{fuyA_qg6TE$r&i6IQZaXO#oS5db0(FY?`1sG z&2*@T=}zH?!GtIAMSy9Ha ztdM0^0n4%+=A~K8OR`yJWV2MH+f=04Oif}bPqQvdwJJ?EFHSNoh%+b-XU`92&kU9; z3}(*=l+6f|%?n^p50FXmm(BNO&+}u?^<~fTW>4@IPw*0p_Y`q95demN>6zeVz}RUl z3GxdDat9PJOgiz{ALtm)0*}aI1_o{+5N5n|x9$&6P^`o?qQto|zDq2n8bp z1C#c$HRpk8P~6kSF{ENna>fBBi32K&m$+B?`tE91QFfYecDurzFyFI=%dSl4RnwRz zt{=|Nq~+#WnIzzNPe^@Y6&sttBy$d(C#;-C?rjZ6Bo0JeG*N8g)X`YJCip1cb|xchNg8|h6iq1>THz~ELq_2?aZpxr$4#yrIau*w1_s^Jez!QE-*|P NJYD@<);T3K0RZyw@vQ&= literal 0 HcmV?d00001 diff --git a/images/smiles/curve.gif b/images/smiles/curve.gif new file mode 100644 index 0000000000000000000000000000000000000000..294aac2fc10bbeaac9342e351d99ba76d94222f0 GIT binary patch literal 1082 zcmeH`>oZgV9EN{;_HdRYw}>q3QmUzj(xlpE*4QE@DUBx6)P_*07`J6&HWZW0Y^zNf z*G+~lE=^OKinX07)+V=^6|w8O$YoiV4SP=f4}I+U{LcH~dFS;$aopq3Wiv2?B>*pX z6LO7FC-pn%>+g%c=(^Hly3)O=qfJVVI+7y}tulP|r|J0Q%u)-i$Tt=W5+`2*$Ipr! zW~d5)9I{`Mfofuk9Hh(Tor}#t4%^Rt25tm%<_(nQrL6W^@H0X$ov>K$q{*a>%Uy;m za$~Iw)bH1l4ogxfk3kc|kBo~z*Jq{c-%^ryJM0vFrWT_7FrCt-`aVi1Y=j{wF+eAj zHnX2#xdT(?LPY{P`2q-q^};u}8Gy~I~}lmM^kw zMEA=wHsruu1B^a}oBr5DB@_q}J|-gk^bkcJlD_7x!l?ZR7o}xd4^65 z*tRr_U)@2UTt`WjQ$&Dm>^W?)34Y{IhJ+xOcNC|f^D=$Gy>N9MDBe`mfsF|RZ$o9g1hln6XK?wX|8tyZw&B&Z0pEg742F)(1By(gILe-d|FW1lW`G(J2&wgmfbj%fDLT^=!NzH)&8-z)Hrr`Xcn&Lo)eti zceL45Z@a@@pTStHmA5m=HnNR}9K!e=l5 literal 0 HcmV?d00001 diff --git a/images/smiles/evil.gif b/images/smiles/evil.gif new file mode 100644 index 0000000000000000000000000000000000000000..bd42ed204ce4d80d437d07090ac1005e287a3795 GIT binary patch literal 1146 zcmd^;jZ@Qg0Ea)@e(pCoz#%){9I%Z|!A4QBLcwc!{@>Fg(;dF*%Vc=a8a+)m`rM4;M2M{LG^!a#uM0 z6~=+<#$QRQV7=AX5xr5d+jBi}^DW>>I6c(Uy*?9guD;|pkS&+|-G}8~%+!Kd1Qzqq z+Ju+6-*hsE8k8`}U4g9!7m8RNU$CYwGcJ{~9=`y)2?fem9sL`x0ac#Va2X>vj?R-w z>k1DQy~Dl(%o#BM4L;mL+lR0$##9}qYO%K4lbjX~4j9*_ea{phZ401=Ox@RkZ$Dt= z$bw0Qz-l!Ui_nnETI@tab>UxEaXu-r7dV_Q%ZsP`fu3?EF$-4)UwofwVh2`C$V%k*rR?e1#2gVZ=k7nU590p(0x^pwFEYqn;FXJp ztoL4j*oM#EWvkO7M=BVNU#cIEupL%6+cuc`e<78^+H^{vryP8m30S^{;irA0+^klM z!|JNq_o4;(D4s4nu;XBo-@>vT{||)!QVgII(r3EQo&bm7fD=z6*BDDESO3Ux#2Y^E zWas-JX`14csQA2_&ON0kn7&;{dnxV)=a+~1+09D|m*n%4xu<>zN;&sh>zGY@EPJ3V z!db3KoE81S7VppJ-+)fXd=Any1w;OuK3MOPt(UZ>_(Q$=2{cTjju!*&cS@bPTz=+b z=v6EiO;WlTs_Bx18jmJTJCh3>e@# zZ!0cm2GcFa(vny;&Hij}oD$m#`c-md`R@g z-5hQKSL=H^L$7sl3j2B&<(DFk!_l literal 0 HcmV?d00001 diff --git a/images/smiles/exclaim.gif b/images/smiles/exclaim.gif new file mode 100644 index 0000000000000000000000000000000000000000..6e95b7d516c1b00ac2d7b1e2dd3730f848f80ec5 GIT binary patch literal 1131 zcmds$jZ@Nh9LGPPxgUY{6EUPAf_mj{>dZ4o=kCNTL9#+??ksnc*-mAoX>n%e2ILe4 z5k+0h2Xx?5X9>CuU4H-rYT9yoMmdQ`>y_tz5j#P>veB_Vgh%&mhSsJD?r`!xd$`O zx!G5Gm~s4x>H#%jsF}35^bB=xMAm@W6TpwgQ7?0PYVtuL2)XztVbE{XBD43SM~_io zAZqh6t7U&Hpgje~^>6?3{rUO%`N}Lo?XlF=UQWULfEqonYM9GC9A$cpA=j@x6>e71 z$0YE)25uBV;hvBuWpG>=d?Xss*F(HJ+ZIp^E{>Z>Z)Ivh04bEctZTJUcz8~rjTwZ$x|I=~S+z9}eAoLC2 zn@<3SAdkcpSX$#wQ$hr3LE_Q4)2xGQ5BuD8Si*+4qAi)KdJ?(HhPCO&;+g(9&bB)w z%Bp?dUg7f0!!`v`asU%-bB-}69^!W@mpZNl05l!8+T1+ODTAr9NZgjnHeaAKXo-8%4x(?B*zTMkGf|Ki6qS8%d7491CB&C7W0m5;L5v0DtD0q6m_T z7g`$5^^@Cp{x~}q6V(O}_H2%F53JEUYKcC5Y=Wb8cBop=h}R452SrpHgBq~Qq-}({ z7Wd<#Q`!2t50ez0=}p3|r8mkv14JnmAuXi}A!A)whS1mCMcv_TD%B;D1G9&C2}CiQ LK&G>3IK=!1Nko$F literal 0 HcmV?d00001 diff --git a/images/smiles/lol.gif b/images/smiles/lol.gif new file mode 100644 index 0000000000000000000000000000000000000000..04e86950d3daf53a557eb16f9333eb99ccd25a7c GIT binary patch literal 515 zcmZ?wbhEHb6k-r!cq+~i?!b{B%C)v%=;~&%cW0zdtrT6+#-HWKF}q&i{Y9A{x8;7_ zmH&E8_Tzb}r@KXFmT*TobNqRz@b8J@zo$yCj)?E-<90R?`2S4l=WY3UmE8ZID&1W# z@Mycx&7BelCUKvi&84rxeQhz%%slp`O}zgV71z|T_hoUe=@YuPReX6X-_t#!&ku<0 zn83GgqR^9FBKs$D@9E}bAO$G?=k{|A33hf2a5d61U}gmBRs6}q$i-mDpaU`oBHnl>G6nwPw1 zW+;MWQER&~XOyiTEDKV#~Zvg{yP4TML zVlASsY`hX;3R|~r72{J>3T71HE#AIEOj^FJU3vdO6%~bI>D`Hj0-}5(YmO+Y=6f)x zNz3r@$y|_EyL6YGUrte8R4FLruA6I!BghY|U_UT2Ffs@LAp@Hy&<`C_%i2z;6fMo+ z3tyAyZ84KaT}V;ba%04rSnse*!D*)rw`_Rfv+vf2AG4y?hO6=@zRCFZYp-E+W06~n Rvrbc6ms7r?ftMqLH2@x$sP6y( literal 0 HcmV?d00001 diff --git a/images/smiles/mad.gif b/images/smiles/mad.gif new file mode 100644 index 0000000000000000000000000000000000000000..e68c5c5195aa2df1e95b704f91c84c86632a0dbc GIT binary patch literal 465 zcmV;?0WSVWNk%w1VH5xq0M$PL|MDo@l>+9p0Gf&mmUjzqTLprGg8J7C|LGy#-rn=g z1H{C{``Q!#?k4}`9yvKVSy@^B@dOta7X8rz{K5j-u@3CQ0PL#({pbn$y8!>=9slMa z;-mon%>gSU0^pef0001d ze0=-+`~T}B|MDF7)CTs&0K|(8-oFmw%MH7i4#cDn)u;`vbr0pQ0O+9r|J?w-vJQ)j zi~s-sA^8LW002J#EC2ui02BZe000K=z@KnPEE@%itN%CX))mV{jc8 zkOBr{LO4(pN&&JcCM3NG0MK|LHlqW@CP@%m19Ec>2zMGH6Bz_8Lm(bd4!FOiijqcRsH4?+?Lbak$ghbI;n9}>1PCXEZF4c zLf+hYncji&iDzvV2y z^(?>b0>AAd|Lcn(`cDqDU*=zBXyNPY1y?@{y?G_#rat1kj*ziy=_hf|Eh;Nzjt#OC{pNwalQPmNO}vf?CO>Rj*&Ew?6X4NM5frPt)iK)8S(wTTJvrJ_#pQm9b=PCf5^eq)DmZ6RSK|rS zPd)p+`e0^RLycJ6Ki`W*TTd=_jhm&KT4U&_+_=*| zq4GM8-59QmZ)eH5lkKvM8cyi@V-KWdtzl8ohQ#}kDMvmYsd;V4(y;$rc-$fByAOmp zXAFu!r{veqjc=tTEeK5h*zD7W?7*mmxJ-Ol(Nr#$Rtj^^&o+;H8*5t+BnH=};uBa~ z+Iv%_*!(os#3PQ%!c6kU^7f?4PuIVyKCI!e3b`%uVwR4KQ5ZWKf)eFoRRwY6Bj5-J zZ~aV=kyF(gOlGJm-e29jpk}fDvo>naS^@~bm;@ddSYXm8i(lA|0}dQuGd&VASWv}R dC0x>n9pm#}tiL=GRkwKJkN|+lhzjOG-oMW4v*-W- literal 0 HcmV?d00001 diff --git a/images/smiles/redface.gif b/images/smiles/redface.gif new file mode 100644 index 0000000000000000000000000000000000000000..7b213d2b0b80ad156845c6260611adbea7bb08d3 GIT binary patch literal 906 zcmZ?wbhEHb6k!ly_{PBS|NsAZd69A#tHmvKSI(Tw5apO9!@gUM^NJq#RRf-VTHKjp z9M>{s=<@7oG4)8@T!{78-{`vq;Td)5NaJjL>*Ip^0`%$8%nX~MfgpTEMzdapX? zJsW|`E~003xF0zQKlhh7r_cQ|P%>3r_J9ue6IYQNUg8z5HVYf7<|%PKauj+WEV8HeZ(O(y8O`K7E{&mApuu`VkE{!EbHU@0^?C-wd3Pnp^ZTlD!}dW(Gum;RTb^e~rqhw|o2$b5J-MDfwOOkVmKL1%KkvBn-??R+5d5A4H70i+0 zTGU+g^y%X(XHP9{Z>;jLPg0Sr_H8dcSqlnUs|fJ( z@$$6B#zZGaMMgwKMkR-bg@(j7TWa|P`1|$r`1uF;cx!5?w-y%U=jG;PXJuv-6t=p% zxkmNv@9A@Pa&)k7GBHe!ymKcq*~UQMq{+imAuPcqIVmYQ(Ire?PIi)l;gt3R42+CS z91;!+{fbVNAMR`nUd}hyvPj0xCV3f;WX-Qb4L=_pJtOH9yu{_<)7Rk}61}Hzh&)+* zd}rQ%xwVfsI=k}~8Hq)92m3snYsB`5JAPpz{|kSz|6qL zF3{lX%h1x??9#!|%+TS|(g;$-2@X$o20jK>21cMF)&`fRCL|ezcHssW7lxK52C&at z7<_zekWFA?-~n303N%5ifq}uLrOCIYBcQ#*#aFV&MXIR-Vk9HjGK5m`20!0sUq64B Rj?S(w$!;lVgf%i)0|1!YE#d$G literal 0 HcmV?d00001 diff --git a/images/smiles/roll.gif b/images/smiles/roll.gif new file mode 100644 index 0000000000000000000000000000000000000000..def8a49d92dc0ea844c86e03a9e1d99b04852862 GIT binary patch literal 705 zcmZ?wbhEHb6k!lyxN6U^Y*x+AUY--nMcjZ9JKfR)sGdGy?-&3Ws zWYeBZ&gu-CRlP#XTKGPmmpV6#D>Xni$w&O$T<$*)6;>~3nbwi|^T)Su*JU5xy>#=+ z@p~Hup6n9I^5wX^QS9|G@v95DA8i-9xtw=)A-l7Q!2f4T|NsC0byxo16UCQ@#GXF7 z`S$hGAK$-ZhRDyYF-?Dub9ynFN9=PR=NCvrbOB5`B8`1^}8 zlZtpYOcr{1ToP!G;(u;G*N|Xm#{gF&Jp*P&1_lPjpDe6g4E78{{|?MA z@X(R!l$f1rHuH=Q`qy1J^GYO89tzPPRvJEwVPYunT|1vXA;CkDQj(rF7-nU(YzoOrD?xJpYq z)@caHTJSmv*{#{2wx^V9ldOo)c1u>xJtt0RvMv=oY|kq%Dav(n50|KlbO7!^1q zI2s)e$t#(P85k%uF)#|sxVa>3Sa58jmR#He4nZXbUj2k+2^I{>Zj&Vp7Wv$?ROJ8% z2`eZ_*cjLuI2eGT#KwLgII}`%S`)GyD^QLFC?|9v=%u@eSo`t&FI__PW*&K}4>95d z#0WOH5kW6aMCL(^0EajWP&+pR8_)>V1NYZY65``N)^#Z5*Gv)7C6hdB!;DsDnTBfo z^@>ycp`9XicE1AHat4s82%YjkogqSe-G?r{3<)u6KfN?~m5R~K(AGk27uAXGi2@AP E0Pb)65C8xG literal 0 HcmV?d00001 diff --git a/images/smiles/sad.gif b/images/smiles/sad.gif new file mode 100644 index 0000000000000000000000000000000000000000..6aca31070f37777f77c8abba52294b4c9af8cfc9 GIT binary patch literal 698 zcmV;r0!95tNk%w1VH5xq0OooC|K%e3-5>GK8vNlP{^cV6q_SYTq(Hs5ZA&h@t@Xi|EB1KI+aGmgI-8Pta$q#X!@Xfl8J>0u z#>T+px)kQT6y>}W%ge}gV>n((6xE>%nU8hlyAB-8*&Y20` zun^v{5N};C*{l%5!@R}Czmjqcnr{c&t`N454(r7in{Ws3(H!i_8Q7-{Z&V4Uf(>j_ z3e&I^n{fxQlM-Z48~EEELo^Wo<|5?k@&Et;000000000000000A^8LW004RbEC2ui z02BZe000O7fO>+1goTEL3sN;I8X8(yObdsC3I}pgI$3U0E-MELhaebKZFm6zcX$v> zXBZ%b30pX+1q1{I19%M-J}e1?UR8A!cmR3Fc>oT00v<3A5rSqvL<7cn$i)K;5@}Bv zf=4-b1;^Otc?EX}6B{Ig7DWLB=;#Ci0v$sZf(AD8_3~i5m#>R~eoe?BTbOPgiXI2` zSeV1W8pCAUB#5DLLl6lW0xCE#hD=$7W?qAtJ;D4wCE&E))m=JIhTXDgXcg literal 0 HcmV?d00001 diff --git a/images/smiles/smile.gif b/images/smiles/smile.gif new file mode 100644 index 0000000000000000000000000000000000000000..6dbb1e5ce0669d329916a00009f2e173b0d95de4 GIT binary patch literal 1114 zcmeH`{Zq>U9LGQ3hxRSTzD>4@ZB||9q3hy2l!v=-8$x2rc{q*~wLGNd)I8qCB-+jz zUF8g2S0lK{Jz%@@4Hvr;)T&Mo7lhxw-&_H zNxEG~cZASw0=grVc21z%LtM9^`C~Kf6f|1RSsS8;-?Dx+`G4;2b=SkNZIs&r4VKz6 zT`t|q>%Iz|dPt7v(oW&eSH7KHJvQ4bx|Q#BjLS`%BTt{}x&xb+^E~#TAq!|#sh`h- z#cUk5jo!F8pzi@x$nbN;`@Jo^^5O$-GYmclPcygoCiEI$unx3`Q*5?IX(DfD5>a+i zz9WG!6`&bO{DE4yb`YaGL%pqhy)NftHIgnFfBiWAvyu4p+F1c-PRWOx$V>?_Xa-plQL+uM*pAt6AwvzQS@mZh(2$1|rQlUcyx#=< zPoet?>`WjAOkghtuRZ8n4e0XHyln!nJ@|eudbVhIH89mi-_5j}Z5Vpq?*Hu_oB^Wf=x z2`3%;a;h9-GC~tCHyIEegRPjLZiz~!lqiNzl|zW6G$fqUu8a+!5GDdlvQTIdgdfkU zQCf`?6@W1HTafl6%&{3=YceQf6@s7;xJc_XDr4d!<>mWkC;-j(39DnbC`w3KxBkZI z!5b_T{ZkbiTaiCMcAE6b-awf`1n*W_O^kd2mw9Uyhot-zz9*Kf+#^aKQR;748@9+L z#uZaElLOII5vJi!;^#9c&rHEQ4x`Wtm3btOP+Mln$(99Na%03f+3O@n+~j4O$48SF nM90MIR^_Nm#6F=Tvy)|Uf^oaUB(YQE3Uma&%4!uO2+a8npttBL3td{NW(^+aG069o^m7qL_T|^7Q`# z0O`UOZBPiCa0h8s zAmX*V57*YusD=;k(Hz^Z5YU?nwvP_fp9`g%fuEIllZIv4rwwOQ9;Si~ zW>6f7WCzvM%)pWhX;dI;PzmYB8RWbc=D!xxuoc3j6}yTFZ&nJLZwJk)6ry|!r=Em+ zYCzJm7IR@U-LDYX*U+$&5}R=c-?9P_4)k(0000000000A^8LW004XdEC2ui z02BZe000O7fP8|3goTEL2~uETARul^Y6*ve3SP1OoyB0|a>v3vE;fgLF)01s8h9d&hbO03u%x5P~UOaRhpM*x40&77a!` zB!X~wc>~$!djokV5*i$W5i0=#=-C1R03lNmf(BOe^|0N`C&NHL72s+2>6 g9UMs)wsdjvX%e3VA5fSWF~S6j50dN(E))m=JD~L_)Bpeg literal 0 HcmV?d00001 diff --git a/images/smiles/wink.gif b/images/smiles/wink.gif new file mode 100644 index 0000000000000000000000000000000000000000..9cb78104b210e7ac85e22a42267268943a32b60d GIT binary patch literal 696 zcmZ?wbhEHb6k!ly_{PBS{?nH$mrgF3-B6Wjm*^w@e%zM(byxoDHQ5j6q@L^*n^Mek_wJ315ZPlZ z#Qr=~`1eHd-&3Ve7o}ew65BC>FEd2`-N#Rp+fvs}6#98v{_i72XA^<{&y+r%mwLKK zWL_or)Xt3epFUqaf3z@y`^#0?Z`WmC9}~Z`ULf0_!`{F7b62PSb>X4t+xBmHET$hkS(sR6PH-eRv$Nu8U`U7BomeY4pA zr%LxW2<+|QtVpw-Keb|IJO8siA~%=w&dO(BIKBG9xg+@@oX-!4-CHkkaW+@BAN!=X zl%-9)_csY%UC2E%k3Bs|X8Q!b*GI+gt`}HS1LVq1%;UPbM&QPB-g7fKyHnY-{5bYb z;J&(u=gNHUU7egW^4K$cIF`(+uSmCv_Y`5k3lx8{ure@|G3bC)f#QUL{eMGQQ*%pe zTML6E6SI;MGm|7kdy}4xfvTOnr8h@-v2welfS|mZh?<(AmUy86Yb&b~kD83SoSeFh zn!JLd)cPg{T~&J-4UO&F)zwy~>P{--H!wPO@|wD+u?ahWlZ~p{c1;b;RxEa4j=L9?}>t&LB?p(Mp~atbfY+zmWAHy=JZEp1UK`sBlf ZEDi?-MyI|jm4}oaE_pWavobMQ0|2_q6!HK7 literal 0 HcmV?d00001 diff --git a/images/smiles/yikes.gif b/images/smiles/yikes.gif new file mode 100644 index 0000000000000000000000000000000000000000..1bb07ba998941f2527e29e70d1fcabe8532dc2bd GIT binary patch literal 698 zcmV;r0!95tNk%w1VH5xq0OorD|K%e3-5>ttBL3td@y{Ck;UMJYB1J>-PmPN z9io_g`P(1w%o&n}WA5?t{o*0^*B$cF8{)ST@Xi`|XFTP+6y&-T=DZZ6nSSNF6xi6& z{{jH@)*W?YHlB70Voe!eNfdWxI-!<&)Y8e(&&AcD3+u)g*w@h5w-?mY%4|*t(9Xo7 zd<(RV4su^HX-x?1$r;(K5Yo`c;MX;mQJu@Grg zAoJ86Y*PxpkPB!_2)&F6t&b9>f(_7{3bv09)SnC4rw#AX9G{hV-?9g32i>m_k8KL)#2BHM zd)1;0b73>yuMpC*7J6wv_}d;sG!XyhBK7(G000000000000000A^8LW004UcEC2ui z02BZe000O7fO~?2goTEL2Vr75ARu>ODhG#x1`9x1b~`a>Us4MOhZ`PNN_YVQcpVfp zHXa*=2|QSMd3gc?1GN$eEsFHdH@i41Q;z24}vpJKLy5l$i)Q_Cpcy$ zf^tN71IO6rdINY36CWdj6)6D%=;#6g1Q#_Gf(ljh$O7uQm(PoWesRbNM5eAmmK+E7 zR8SMa+Cl)^PV^YkM$m{Z1Q1WZi0fi@_?lOq<^G$@(J!W$D)&io>Tf({%R6EtX;(1c2qGB4O1ss!Uh gkU2;f$UqVDY0{npBr=Ey5kf=;5|Zo+E))m=JEO)aDgXcg literal 0 HcmV?d00001 diff --git a/inc/askModel.class.php b/inc/askModel.class.php new file mode 100644 index 0000000..00e6e11 --- /dev/null +++ b/inc/askModel.class.php @@ -0,0 +1,34 @@ +models)) //realizowany singleton + { + require_once('./inc/models/'.$model.'.class.php'); + $this->models[$model] = new $model($this->db); + } + else + { + throw new Exception('Could not load selected model: '.$model); + } + } + + function getModel($model) + { + if (array_key_exists($model, $this->models)) + return $this->models[$model]; + else + throw new Exception('Could not get selected model: '.$model); + } + + function putExistingModel($model, &$model_ptr) + { + $this->models[$model] = $model_ptr; + } +} + +?> \ No newline at end of file diff --git a/inc/bbcode.php b/inc/bbcode.php new file mode 100644 index 0000000..7e6a4c0 --- /dev/null +++ b/inc/bbcode.php @@ -0,0 +1,111 @@ +', # :) + ':|', # :| + ':(', # :( + ':(', # ;( + ':D', # :D + ':o', # :o + ';)', # ;) + ':p', # :p + ':/', # :curve: + ':!:', # :!: + ':lol:', # :lol: + ':evil:', # :evil: + ':mad:', # :mad: + ':roll:', # :roll: + ':cool:', # :cool: + ':redface:', # :redface: + '\1', # [b] + '\1', # [i] + '\1', # [u] + '\1', # [s] + '

\1

', # [center] + '\3', # [url=] + '\1', # [url] + '\2', # [color] (hex) + '\2', # [color] (text) + '
    \1
', # [list] + '
  • \1
  • ', # [*] + '
    Quote:
    \1
    ', # [quote] + '
    \1 wrote:
    \2
    ', # [quote=] + '
    Code:
    \1
    ', # [code] + '
    ', # \n + '', # \r + '\\1\\2', + ); + + return preg_replace($pattern, $replace, $content); +} + +function StripBBCode($content) +{ + $pattern = array( + '/\\n/', # \n + '/\\r/', # \r + '/\[b\](.*?)\[\/b\]/is', # [b] + '/\[i\](.*?)\[\/i\]/is', # [i] + '/\[u\](.*?)\[\/u\]/is', # [u] + '/\[s\](.*?)\[\/s\]/is', # [s] + '/\[url=(.*?)\](.*?)\[\/url\]/is', # [url=] + '/\[url](.*?)\[\/url\]/is', # [url] + '/\[img](.*?)\[\/img\]/is', # [img] + '/\[color=(.*?)\](.*?)\[\/color\]/is', # [color] + ); + + $replace = array( + '', # \n + '', # \r + '\1', # [b] + '\1', # [i] + '\1', # [u] + '\1', # [s] + '\2', # [url=] + '\1', # [url] + '', # [img] + '\2', # [color] + ); + + return preg_replace($pattern, $replace, $content); +} +?> \ No newline at end of file diff --git a/inc/constants.php b/inc/constants.php new file mode 100644 index 0000000..dac2914 --- /dev/null +++ b/inc/constants.php @@ -0,0 +1,35 @@ + \ No newline at end of file diff --git a/inc/controller.class.php b/inc/controller.class.php new file mode 100644 index 0000000..0d872ee --- /dev/null +++ b/inc/controller.class.php @@ -0,0 +1,53 @@ +$m($arg); + else + $this->forward('index.php'); + } + + public function __construct(&$db) + { + $this->db = $db; + } + + public function forward($address) + { + header('Location: ' . $address); + } + + + public function loadView($view) + { + if (file_exists('./inc/views/'.$view.'.class.php') && !array_key_exists($view, $this->views)) + { + require_once('./inc/views/'.$view.'.class.php'); + $this->views[$view] = new $view($this->db); + } + else + { + throw new Exception('Could not load selected view: '.$view); + } + } + + public function getView($view) + { + if (array_key_exists($view, $this->views)) + return $this->views[$view]; + else + throw new Exception('Could not get selected view: '.$widok); + } +} + +?> \ No newline at end of file diff --git a/inc/controllers/AdminController.class.php b/inc/controllers/AdminController.class.php new file mode 100644 index 0000000..4a1821b --- /dev/null +++ b/inc/controllers/AdminController.class.php @@ -0,0 +1,605 @@ +main(); + } + + private function loadDependencies() // zależności (sesje itp) + { + $this->loadModel('SessionModel'); //aktywacja sesji + $this->loadModel('ConfigModel'); //konfiguracja ogólna skryptu + $this->loadView('MainView'); + $this->getView('MainView')->putExistingModel('SessionModel', $this->getModel('SessionModel')); + $this->getView('MainView')->putExistingModel('ConfigModel', $this->getModel('ConfigModel')); + + if ($_SERVER['REQUEST_SCHEME'] == 'http') + $this->forward('https://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']); + + if (!$this->getModel('SessionModel')->isLogged()) + { + $this->getView('MainView')->forum_message('You are not logged.', 'index.php?mode=login', true); + $lockv = true; + } + + if ($this->getModel('SessionModel')->getRank() == RANK_USER && !isset($lockv)) + { + $this->getView('MainView')->forum_message('You are not admin', 'index.php'); + $lockv = true; + } + + if (!isset($lockv)) + return true; + else + return false; + } + + public function main() + { + if ($this->loadDependencies()) + { + $this->getView('MainView')->admin_main(); + } + } + + public function eduser() + { + if ($this->loadDependencies()) + { + $this->loadModel('UsersModel'); + $user_info = $this->getModel('UsersModel')->getUserInformation($_GET['id'], true); + + if ($user_info == null) + { + $this->getView('MainView')->forum_message('User does not exist!', 'index.php?mode=admin&submode=users'); + $lockv = true; + } + else + { + $msg = ''; + if (isset($_POST['nick'], $_POST['passwd'], $_POST['passwd_confirm'], $_POST['email'])) + { + //secure pools + $_POST['nick'] = trim(strip_tags($this->db->real_escape_string($_POST['nick']))); + $_POST['passwd'] = trim(strip_tags($_POST['passwd'])); + $_POST['passwd_confirm'] = trim(strip_tags($_POST['passwd_confirm'])); + $_POST['email'] = trim(strip_tags($this->db->real_escape_string($_POST['email']))); + $_POST['location'] = trim(strip_tags($this->db->real_escape_string($_POST['location']))); + $_POST['signature'] = trim(strip_tags($this->db->real_escape_string($_POST['signature']))); + $_POST['user_rank'] = trim(strip_tags($this->db->real_escape_string($_POST['user_rank']))); + + if ($_POST['passwd'] != '') + { + if (strlen($_POST['passwd']) < 8) + $msg .= 'Password is too short (min 8 characters)
    '; + + if ($_POST['passwd'] != $_POST['passwd_confirm']) + $msg .= 'Password do not match!
    '; + } + + if ($_GET['id'] == $this->getModel('SessionModel')->getID() && $_POST['user_rank'] != RANK_ADMIN) + { + $msg .= 'You cannot set rank for your profile
    '; + $_POST['user_rank'] = RANK_ADMIN; + } + + if ($this->getModel('UsersModel')->nickExists($_POST['nick']) == true && $_POST['nick'] != $user_info['nick']) + $msg .= 'Nick is in use. Type another one.
    '; + + if (strlen($_POST['nick']) < 3) + $msg .= 'Nick is too short (min 3 characters)
    '; + + if ($_POST['user_rank'] > RANK_ADMIN || $_POST['user_rank'] < RANK_USER) + $msg .= 'Rank is not valid!
    '; + + //check if avatar is uploaded + if ($_FILES['avatar']['tmp_name'] != null) + { + global $allowed_avatars; + $image_size = @getimagesize($_FILES['avatar']['tmp_name']); + + if ($image_size == null) + $msg .= 'Type of uploaded file are not allowed.
    '; + else + if (!in_array($image_size['mime'], $allowed_avatars)) + $msg .= 'Type of uploaded avatar is not supported.
    '; + else + if ($image_size[0] > 120 || $image_size[1] > 150) + $msg .= 'Uploaded avatar is too big (maximum 120x150 px).
    '; + } + + if (!filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) + $msg .= 'Email is incorrect
    '; + + if ($msg == '') + { + if ($_FILES['avatar']['tmp_name'] != null && !isset($_POST['delete_avatar'])) //change an avatar + { + if ($user_info['avatar'] != '') + unlink('./'.$user_info['avatar']); + + $ext = pathinfo($_FILES['avatar']['name'], PATHINFO_EXTENSION); + $av = 'images/avatars/'.$this->getModel('SessionModel')->getID().'.'.$ext; + move_uploaded_file($_FILES['avatar']['tmp_name'], './'.$av); + } + else + if (isset($_POST['delete_avatar'])) + { + unlink('./'.$user_info['avatar']); + $av = ''; + } + else + $av = $user_info['avatar']; //if new avatar is not set + + if ($_POST['passwd'] != '') + $this->getModel('UsersModel')->changeUserPassword($_GET['id'], sha1($_POST['passwd'])); + + $this->getModel('UsersModel')->changeUserRank($_GET['id'], $_POST['user_rank']); + $this->getModel('UsersModel')->updateUserProfile($_GET['id'], $_POST['nick'], $_POST['email'], $_POST['location'], $_POST['signature'], $av); + $this->getView('MainView')->forum_message('User profile has changed.', 'index.php?mode=admin&submode=users'); + $lockv = true; + + } + } + + $_POST['nick'] = (isset($_POST['nick'])) ? $_POST['nick'] : $user_info['nick']; + $_POST['email'] = (isset($_POST['email'])) ? $_POST['email'] : $user_info['email']; + $_POST['location'] = (isset($_POST['location'])) ? $_POST['location'] : $user_info['location']; + $_POST['signature'] = (isset($_POST['signature'])) ? $_POST['signature'] : $user_info['signature']; + $_POST['user_rank'] = (isset($_POST['user_rank'])) ? $_POST['user_rank'] : $user_info['rank']; + + $this->getView('MainView')->putExistingModel('UsersModel', $this->getModel('UsersModel')); + + if (!isset($lockv)) + $this->getView('MainView')->edprofile_form($msg, true); + } + } + } + + public function users() + { + if ($this->loadDependencies()) + { + if (isset($_GET['rank'])) + { + switch ($_GET['rank']) + { + case 'admin': + $_GET['rank'] = RANK_ADMIN; + break; + case 'mod': + $_GET['rank'] = RANK_MOD; + break; + case 'user': + $_GET['rank'] = RANK_USER; + break; + default: + $_GET['rank'] = ''; + break; + } + } + else + $_GET['rank'] = ''; + + $_POST['sort_type'] = (isset($_POST['sort_type'])) ? $this->db->real_escape_string($_POST['sort_type']) : 'regdate'; + $allowed_sorting = array('regdate', 'lastvisit', 'nick', 'post_count'); + if (!in_array($_POST['sort_type'], $allowed_sorting)) + $_POST['sort_type'] = ''; + $_POST['sort_desc'] = (isset($_POST['sort_desc'])) ? 'DESC' : 'ASC'; + + $this->getView('MainView')->admin_userlist(); + } + + } + + public function deluser() + { + if ($this->loadDependencies()) + { + $this->loadModel('UsersModel'); + $this->getView('MainView')->putExistingModel('UsersModel', $this->getModel('UsersModel')); + + $_GET['id'] = (isset($_GET['id'])) ? trim(strip_tags($this->db->real_escape_string($_GET['id']))) : 0; + + $user_info = $this->getModel('UsersModel')->getUserInformation($_GET['id']); + if ($user_info == null) + { + $this->getView('MainView')->forum_message('User does not exist!', 'index.php?mode=admin&submode=users'); + $lockv = true; + } + else + { + if ($_GET['id'] == $this->getModel('SessionModel')->getID()) + { + $this->getView('MainView')->forum_message('You cannot delete own profile!', 'index.php?mode=admin&submode=users'); + $lockv = true; + } + } + + + if (isset($_POST['confirmed']) && !isset($lockv)) + { + if (!isset($_POST['rejected'])) + { + $this->getModel('UsersModel')->deleteUser($_GET['id']); + $this->getView('MainView')->forum_message('Profile deleted. Redirecting to users list...', 'index.php?mode=admin&submode=users'); + $lockv = true; + } + else + { + $this->forward('index.php?mode=admin&submode=users'); + } + } + + if (!isset($lockv)) + $this->getView('MainView')->confirm_action('Do you want delete user '.$user_info['nick'].'? This operation cannot undone.'); + } + } + + public function config() + { + if ($this->loadDependencies()) + { + $msg = ''; + + if (isset($_POST['forum_name'], $_POST['forum_desc'])) + { + $_POST['forum_name'] = trim(htmlspecialchars($this->db->real_escape_string($_POST['forum_name']))); + $_POST['forum_desc'] = trim(htmlspecialchars($_POST['forum_desc'])); + + if (strlen($_POST['forum_name']) < 3) + { + $msg .= 'Forum name is too short (min 3 characters)!
    '; + } + + if (strlen($_POST['forum_name']) > 30) + { + $msg .= 'Forum name is too long (max 30 characters)!
    '; + } + + if (strlen($_POST['forum_desc']) > 50) + { + $msg .= 'Forum description is too long (max 50 characters)!
    '; + } + + if ($msg == '') + { + $what = ''; + if ($_POST['forum_name'] != $this->getModel('ConfigModel')->getConf('forum_name')) + $this->getModel('ConfigModel')->updateConf('forum_name', $_POST['forum_name']); + + if ($_POST['forum_desc'] != $this->getModel('ConfigModel')->getConf('forum_desc')) + $this->getModel('ConfigModel')->updateConf('forum_desc', $_POST['forum_desc']); + + $this->getView('MainView')->forum_message('Forum configuration updated. Redirecting...', 'index.php?mode=admin&submode=config'); + $lockv = true; + } + } + + $_POST['forum_name'] = (isset($_POST['forum_name'])) ? $_POST['forum_name'] : $this->getModel('ConfigModel')->getConf('forum_name'); + $_POST['forum_desc'] = (isset($_POST['forum_desc'])) ? $_POST['forum_desc'] : $this->getModel('ConfigModel')->getConf('forum_desc'); + if (!isset($lockv)) + { + $this->getView('MainView')->admin_config($msg); + } + } + } + + public function forums() + { + if ($this->loadDependencies()) + { + $this->getView('MainView')->admin_forums(); + } + } + + public function addcat() + { + if ($this->loadDependencies()) + { + $this->modify_cat('add'); + } + } + + public function edcat() + { + if ($this->loadDependencies()) + { + $this->modify_cat('edit'); + } + } + + public function addforum() + { + if ($this->loadDependencies()) + { + $this->modify_forum('add'); + } + } + + public function edforum() + { + if ($this->loadDependencies()) + { + $this->modify_forum('edit'); + } + } + + public function delforum() + { + if ($this->loadDependencies()) + { + $this->loadModel('ForumsModel'); + $_GET['id'] = (isset($_GET['id'])) ? trim(strip_tags($this->db->real_escape_string($_GET['id']))) : 0; + $forum_info = $this->getModel('ForumsModel')->getForum($_GET['id']); + + if ($forum_info == null) + { + $this->getView('MainView')->forum_message('Forum does not exist!', 'index.php?mode=admin&submode=forums'); + $lockv = true; + } + + if (isset($_POST['confirmed']) && !isset($lockv)) + { + if (!isset($_POST['rejected'])) + { + $this->getModel('ForumsModel')->deleteForum($_GET['id']); + $this->getView('MainView')->forum_message('Forum deleted. Redirecting...', 'index.php?mode=admin&submode=forums'); + $lockv = true; + } + else + $this->forward('index.php?mode=admin&submode=forums'); + } + + if (!isset($lockv)) + $this->getView('MainView')->confirm_action('Do you REALLY want delete forum '.$forum_info['name'].' with ALL CONTENT? This operation cannot undone!'); + } + + } + + public function delcat() + { + if ($this->loadDependencies()) + { + $this->loadModel('ForumsModel'); + $_GET['id'] = (isset($_GET['id'])) ? trim(strip_tags($this->db->real_escape_string($_GET['id']))) : 0; + $cat_info = $this->getModel('ForumsModel')->getCat($_GET['id']); + + if ($cat_info == null) + { + $this->getView('MainView')->forum_message('Category does not exist!', 'index.php?mode=admin&submode=forums'); + $lockv = true; + } + + if (isset($_POST['confirmed']) && !isset($lockv)) + { + if (!isset($_POST['rejected'])) + { + $this->getModel('ForumsModel')->deleteCat($_GET['id']); + $this->getView('MainView')->forum_message('Category deleted. Redirecting...', 'index.php?mode=admin&submode=forums'); + $lockv = true; + } + else + $this->forward('index.php?mode=admin&submode=forums'); + } + + if (!isset($lockv)) + $this->getView('MainView')->confirm_action('Do you REALLY want delete category '.$cat_info['name'].' with ALL FORUMS AND CONTENT? This operation cannot undone!'); + } + + } + + private function modify_cat($m) + { + $msg = ''; + + $this->loadModel('ForumsModel'); + + if ($m == 'edit') + { + $_GET['id'] = (isset($_GET['id'])) ? trim(strip_tags($this->db->real_escape_string($_GET['id']))) : 0; + $cat_info = $this->getModel('ForumsModel')->getCat($_GET['id']); + + if ($cat_info == null) + { + $this->getView('MainView')->forum_message('Category does not exist!', 'index.php?mode=admin&submode=forums'); + $lockv = true; + } + } + + + if (isset($_POST['name']) && !isset($lockv)) + { + $_POST['name'] = trim(htmlspecialchars($this->db->real_escape_string($_POST['name']))); + if (strlen($_POST['name']) < 3) + $msg .= 'Category name is too short (min 3 characters)!
    '; + + if ($msg == '') + { + if ($m == 'add') + { + $this->getModel('ForumsModel')->addCat($_POST['name']); + $this->getView('MainView')->forum_message('Category added. Redirecting...', 'index.php?mode=admin&submode=forums'); + $lockv = true; + } + else + { + $this->getModel('ForumsModel')->changeCat($_GET['id'], $_POST['name']); + $this->getView('MainView')->forum_message('Category updated. Redirecting...', 'index.php?mode=admin&submode=forums'); + $lockv = true; + } + } + } + + if (!isset($lockv)) + { + if ($m == 'add') + $_POST['name'] = (isset($_POST['name'])) ? $_POST['name'] : ''; + else + $_POST['name'] = (isset($_POST['name'])) ? $_POST['name'] : $cat_info['name']; + + $this->getView('MainView')->putExistingModel('ForumsModel', $this->getModel('ForumsModel')); + $this->getView('MainView')->admin_cat_form($msg, $m); + } + } + + private function modify_forum($m) + { + $msg = ''; + + $this->loadModel('ForumsModel'); + + if ($m == 'edit') + { + $_GET['id'] = (isset($_GET['id'])) ? trim(strip_tags($this->db->real_escape_string($_GET['id']))) : 0; + $forum_info = $this->getModel('ForumsModel')->getForum($_GET['id']); + + if ($forum_info == null) + { + $this->getView('MainView')->forum_message('Forum does not exist!', 'index.php?mode=admin&submode=forums'); + $lockv = true; + } + } + + + if (isset($_POST['name']) && !isset($lockv)) + { + $_POST['name'] = trim(htmlspecialchars($this->db->real_escape_string($_POST['name']))); + $_POST['desc'] = trim(htmlspecialchars($this->db->real_escape_string($_POST['desc']))); + $_POST['category_id'] = trim(strip_tags($this->db->real_escape_string($_POST['category_id']))); + $_POST['locked'] = trim(strip_tags($this->db->real_escape_string($_POST['locked']))); + $_POST['locked'] = ($_POST['locked'] == true) ? true : false; + + if (strlen($_POST['name']) < 3) + $msg .= 'Forum name is too short (min 3 characters)!
    '; + + $c = $this->getModel('ForumsModel')->getCat($_POST['category_id']); + + if ($c == null) + $msg .= 'Category does not exist!
    '; + + if ($msg == '') + { + if ($m == 'add') + { + $this->getModel('ForumsModel')->addForum($_POST['name'], $_POST['desc'], $_POST['category_id'], $_POST['locked']); + $this->getView('MainView')->forum_message('Forum added. Redirecting...', 'index.php?mode=admin&submode=forums'); + $lockv = true; + } + else + { + $this->getModel('ForumsModel')->changeForum($_GET['id'], $_POST['name'], $_POST['desc'], $_POST['category_id'], $_POST['locked']); + $this->getView('MainView')->forum_message('Forum updated. Redirecting...', 'index.php?mode=admin&submode=forums'); + $lockv = true; + } + } + } + + if (!isset($lockv)) + { + if ($m == 'add') + { + $_POST['name'] = (isset($_POST['name'])) ? $_POST['name'] : ''; + $_POST['desc'] = (isset($_POST['desc'])) ? $_POST['desc'] : ''; + $_POST['category_id'] = (isset($_POST['category_id'])) ? $_POST['category_id'] : ''; + $_POST['locked'] = (isset($_POST['locked'])) ? $_POST['locked'] : ''; + } + else + { + $_POST['name'] = (isset($_POST['name'])) ? $_POST['name'] : $forum_info['name']; + $_POST['desc'] = (isset($_POST['desc'])) ? $_POST['desc'] : $forum_info['desc']; + $_POST['category_id'] = (isset($_POST['category_id'])) ? $_POST['category_id'] : $forum_info['category_id']; + $_POST['locked'] = (isset($_POST['locked'])) ? $_POST['locked'] : $forum_info['locked']; + } + + $this->getView('MainView')->putExistingModel('ForumsModel', $this->getModel('ForumsModel')); + $this->getView('MainView')->admin_forum_form($msg, $m); + } + } + + public function banlist() + { + if ($this->loadDependencies()) + $this->getView('MainView')->admin_banlist(); + } + + public function delban() + { + if ($this->loadDependencies()) + { + $this->loadModel('BansModel'); + $_GET['id'] = (isset($_GET['id'])) ? trim(strip_tags($this->db->real_escape_string($_GET['id']))) : 0; + $ban_info = $this->getModel('BansModel')->getBan($_GET['id']); + + if ($ban_info == null) + { + $this->getView('MainView')->forum_message('Ban does not exist!', 'index.php?mode=admin&submode=banlist'); + $lockv = true; + } + + if (isset($_POST['confirmed']) && !isset($lockv)) + { + if (!isset($_POST['rejected'])) + { + $this->getModel('BansModel')->deleteBan($_GET['id']); + $this->getView('MainView')->forum_message('Ban deleted. Redirecting...', 'index.php?mode=admin&submode=banlist'); + $lockv = true; + } + else + $this->forward('index.php?mode=admin&submode=banlist'); + } + + if (!isset($lockv)) + $this->getView('MainView')->confirm_action('Do you want delete ban for user '.$ban_info['nick'].'?'); + } + + } + + public function addban() + { + if ($this->loadDependencies()) + { + $msg = ''; + + $this->loadModel('BansModel'); + $this->loadModel('UsersModel'); + + if (isset($_POST['user_id'], $_POST['reason'])) + { + $_POST['user_id'] = trim(strip_tags($this->db->real_escape_string($_POST['user_id']))); + $_POST['reason'] = trim(strip_tags($this->db->real_escape_string($_POST['reason']))); + + if ($_POST['user_id'] == $this->getModel('SessionModel')->getID()) + $msg .= 'You cannot ban your profile!
    '; + + if ($this->getModel('BansModel')->getUserBan($_POST['user_id']) != null) + $msg .= 'This user has already been banned!
    '; + + if ($this->getModel('UsersModel')->getUserInformation($_POST['user_id']) == null) + $msg .= 'User does not exist!
    '; + + if ($msg == '') + { + $this->getModel('BansModel')->addBan($_POST['user_id'], $_POST['reason']); + $this->getView('MainView')->forum_message('Ban added. Redirecting...', 'index.php?mode=admin&submode=banlist'); + $lockv = true; + } + } + + if (!isset($lockv)) + { + $_POST['user_id'] = (isset($_POST['user_id'])) ? $_POST['user_id'] : ''; + $_POST['reason'] = (isset($_POST['reason'])) ? $_POST['reason'] : ''; + + $this->getView('MainView')->admin_ban_form($msg); + } + } + } +} + +?> \ No newline at end of file diff --git a/inc/controllers/MainController.class.php b/inc/controllers/MainController.class.php new file mode 100644 index 0000000..386bfbb --- /dev/null +++ b/inc/controllers/MainController.class.php @@ -0,0 +1,724 @@ +main(); + } + + private function loadDependencies() // zależności (sesje itp) + { + $this->loadModel('SessionModel'); //aktywacja sesji + $this->loadModel('ConfigModel'); //konfiguracja ogólna skryptu + $this->loadView('MainView'); + $this->getView('MainView')->putExistingModel('SessionModel', $this->getModel('SessionModel')); + $this->getView('MainView')->putExistingModel('ConfigModel', $this->getModel('ConfigModel')); + } + + public function main() + { + $this->loadDependencies(); + + $this->getView('MainView')->main(); + } + + public function viewforum() + { + $this->loadDependencies(); + + $this->loadModel('ForumsModel'); + + $_GET['id'] = (isset($_GET['id'])) ? trim(strip_tags($this->db->real_escape_string($_GET['id']))) : 0; + + $f = $this->getModel('ForumsModel')->getForum($_GET['id']); + + if ($f == null) + $this->getView('MainView')->forum_message('Forum does not exist!', 'index.php'); + else + { + $this->getView('MainView')->putExistingModel('ForumsModel', $this->getModel('ForumsModel')); + $this->getView('MainView')->viewforum(); + } + } + + public function userlist() + { + $this->loadDependencies(); + + if (isset($_GET['rank'])) + { + switch ($_GET['rank']) + { + case 'admin': + $_GET['rank'] = RANK_ADMIN; + break; + case 'mod': + $_GET['rank'] = RANK_MOD; + break; + case 'user': + $_GET['rank'] = RANK_USER; + break; + default: + $_GET['rank'] = ''; + break; + } + } + else + $_GET['rank'] = ''; + + $_POST['sort_type'] = (isset($_POST['sort_type'])) ? $this->db->real_escape_string($_POST['sort_type']) : 'regdate'; + $allowed_sorting = array('regdate', 'lastvisit', 'nick', 'post_count'); + if (!in_array($_POST['sort_type'], $allowed_sorting)) + $_POST['sort_type'] = ''; + $_POST['sort_desc'] = (isset($_POST['sort_desc'])) ? 'DESC' : 'ASC'; + + $this->getView('MainView')->userlist(); + + } + + public function viewtopic() + { + $this->loadDependencies(); + + $this->loadModel('PostsModel'); + + $_GET['id'] = (isset($_GET['id'])) ? trim(strip_tags($this->db->real_escape_string($_GET['id']))) : 0; + + $t = $this->getModel('PostsModel')->getTopic($_GET['id']); + + if ($t == null) + $this->getView('MainView')->forum_message('Topic does not exist!', 'index.php'); + else + { + $this->getView('MainView')->putExistingModel('PostsModel', $this->getModel('PostsModel')); + $this->getView('MainView')->viewtopic(); + } + } + + public function newtopic() + { + $this->posting(POSTING_NEWTOPIC); + } + + public function reply() + { + $this->posting(POSTING_REPLY); + } + + public function editpost() + { + $this->posting(POSTING_EDIT); + } + + public function quote() + { + $this->posting(POSTING_QUOTE); + } + + public function moderate() + { + $this->loadDependencies(); + $this->loadModel('PostsModel'); + $this->loadModel('ForumsModel'); + + $_GET['id'] = (isset($_GET['id'])) ? trim(strip_tags($this->db->real_escape_string($_GET['id']))) : 0; + $_GET['submode'] = (isset($_GET['submode'])) ? trim(strip_tags($this->db->real_escape_string($_GET['submode']))) : 0; + + if (!$this->getModel('SessionModel')->isLogged()) + { + $this->getView('MainView')->forum_message('You are not logged.', 'index.php?mode=login'); + $lockv = true; + } + + if ($this->getModel('SessionModel')->getRank() == RANK_USER && !isset($lockv)) + { + $this->getView('MainView')->forum_message('Only mods have access to this menu', 'index.php'); + $lockv = true; + } + + //sprawdź czy wątek/post istnieje + + if (!isset($lockv)) + switch($_GET['submode']) + { + case 'deletetopic': + case 'locktopic': + case 'movetopic': + $t = $this->getModel('PostsModel')->getTopic($_GET['id']); + + if ($t == null) + { + $this->getView('MainView')->forum_message('Topic does not exist!', 'index.php'); + $lockv = true; + } + break; + + case 'deletepost': + $p = $this->getModel('PostsModel')->getPost($_GET['id']); + if ($p == null) + { + $this->getView('MainView')->forum_message('Post does not exist!', 'index.php'); + $lockv = true; + } + else + { + $t = $this->getModel('PostsModel')->getTopic($p['topic_id']); + + if ($t['post_count'] == 1) + { + $this->getView('MainView')->forum_message('If topic has only one post, use delete topic option.', 'index.php?mode=viewtopic&id='.$p['topic_id'], 3); + $lockv = true; + } + } + + break; + + default: + $this->getView('MainView')->forum_message('Invalid mode', 'index.php'); + $lockv = true; + break; + } + + //wysyłanie formularza + if (isset($_POST['confirmed']) && !isset($lockv)) + { + if (!isset($_POST['rejected'])) + { + switch($_GET['submode']) + { + case 'deletepost': + $this->getModel('PostsModel')->deletePost($_GET['id']); + $this->getView('MainView')->forum_message('Post deleted. Redirecting...', 'index.php?mode=viewtopic&id='.$p['topic_id']); + $lockv = true; + break; + + case 'deletetopic': + $this->getModel('PostsModel')->deleteTopic($_GET['id']); + $this->getView('MainView')->forum_message('Topic deleted. Redirecting...', 'index.php?mode=viewforum&id='.$t['forum_id']); + $lockv = true; + break; + + case 'locktopic': + if ($t['topic_locked'] == false) + { + $this->getModel('PostsModel')->lockTopic($_GET['id']); + $this->getView('MainView')->forum_message('Topic locked. Redirecting...', 'index.php?mode=viewtopic&id='.$_GET['id']); + } + else + { + $this->getModel('PostsModel')->lockTopic($_GET['id'], false); + $this->getView('MainView')->forum_message('Topic unlocked. Redirecting...', 'index.php?mode=viewtopic&id='.$_GET['id']); + } + $lockv = true; + break; + case 'movetopic': + if ($this->getModel('ForumsModel')->getForum($_POST['forum_id']) == null) + $this->getView('MainView')->forum_message('Forum does not exist!', 'index.php?mode=viewtopic&id='.$_GET['id']); + else + { + $this->getModel('PostsModel')->moveTopic($_GET['id'], $_POST['forum_id']); + $this->getView('MainView')->forum_message('Topic moved. Redirecting...', 'index.php?mode=viewtopic&id='.$_GET['id']); + } + $lockv = true; + break; + + } + } + else + { + switch ($_GET['submode']) + { + case 'deletetopic': + case 'locktopic': + case 'movetopic': + $this->forward('index.php?mode=viewtopic&id='.$_GET['id']); + break; + case 'deletepost': + $this->forward('index.php?mode=viewtopic&id='.$p['topic_id']); + } + } + } + + if (!isset($lockv)) + switch($_GET['submode']) + { + case 'deletepost': + $this->getView('MainView')->confirm_action('Do you really want delete post #'.$_GET['id'].'?'); + break; + case 'deletetopic': + $this->getView('MainView')->confirm_action('Do you really want delete topic #'.$_GET['id'].' with all posts? This operation cannot undone.'); + break; + + case 'locktopic': + if ($t['topic_locked'] == false) + $this->getView('MainView')->confirm_action('Do you want lock topic #'.$_GET['id'].'?'); + else + $this->getView('MainView')->confirm_action('Do you want unlock topic #'.$_GET['id'].'?'); + break; + case 'movetopic': + $this->getView('MainView')->putExistingModel('PostsModel', $this->getModel('PostsModel')); + $this->getView('MainView')->move_topic(); + break; + } + } + + + public function posting($type) + { + $this->loadDependencies(); + $msg = ''; + + $this->loadModel('PostsModel'); + $this->loadModel('ForumsModel'); + + $_GET['id'] = (isset($_GET['id'])) ? trim(strip_tags($this->db->real_escape_string($_GET['id']))) : 0; + + if (!$this->getModel('SessionModel')->isLogged()) + { + $this->getView('MainView')->forum_message('You are not logged.', 'index.php?mode=login'); + $lockv = true; + } + + //SPRAWDZANIE CZY TEMAT/FORUM ISTNIEJE I CZY NIE ZABLOKOWANE + if (!isset($lockv)) + switch($type) + { + case POSTING_NEWTOPIC: //sprawdzenie czy forum istnieje i czy nie zablokowane + $f = $this->getModel('ForumsModel')->getForum($_GET['id']); + + if ($f == null) + { + $this->getView('MainView')->forum_message('Forum does not exist!', 'index.php'); + $lockv = true; + } + else + if ($f['locked'] == true) + { + $this->getView('MainView')->forum_message('Forum is locked', 'index.php?mode=viewforum&id='.$_GET['id']); + $lockv = true; + } + break; + + case POSTING_REPLY: //sprawdzenie czy temat istnieje + case POSTING_QUOTE: + $t = $this->getModel('PostsModel')->getTopic($_GET['id']); + + if ($t == null) + { + $this->getView('MainView')->forum_message('Topic does not exist!', 'index.php'); + $lockv = true; + } + else + { + if ($t['forum_locked'] == true && $this->getModel('SessionModel')->getRank() < RANK_MOD) + { + $this->getView('MainView')->forum_message('Forum is locked', 'index.php?mode=viewtopic&id='.$t['topic_id']); + $lockv = true; + } + + if ($t['topic_locked'] == true && $this->getModel('SessionModel')->getRank() < RANK_MOD) + { + $this->getView('MainView')->forum_message('Topic is locked', 'index.php?mode=viewtopic&id='.$t['topic_id']); + $lockv = true; + } + + if ($type == POSTING_QUOTE) + { + $_GET['q'] = (isset($_GET['q'])) ? trim(strip_tags($this->db->real_escape_string($_GET['q']))) : 0; + $qp = $this->getModel('PostsModel')->getPost($_GET['q']); + + if ($qp == null) + { + $this->getView('MainView')->forum_message('Invalid quoted post', 'index.php?mode=viewtopic&id='.$t['topic_id']); + $lockv = true; + } + else + { + if ($qp['topic_id'] != $_GET['id']) + { + $this->getView('MainView')->forum_message('Invalid quoted post', 'index.php?mode=viewtopic&id='.$t['topic_id']); + $lockv = true; + } + } + } + } + break; + + case POSTING_EDIT: + $p = $this->getModel('PostsModel')->getPost($_GET['id']); + + if ($p == null) + { + $this->getView('MainView')->forum_message('Post does not exist!', 'index.php'); + $lockv = true; + } + else + { + $t = $this->getModel('PostsModel')->getTopic($p['topic_id']); + if ($t['forum_locked'] == true && $this->getModel('SessionModel')->getRank() < RANK_MOD) + { + $this->getView('MainView')->forum_message('Forum is locked', 'index.php?mode=viewtopic&id='.$t['topic_id']); + $lockv = true; + } + if ($t['topic_locked'] == true && $this->getModel('SessionModel')->getRank() < RANK_MOD) + { + $this->getView('MainView')->forum_message('Topic is locked', 'index.php?mode=viewtopic&id='.$t['topic_id']); + $lockv = true; + } + + //sprawdzić czy edycja tematu + // i ustawić opdowiednie parametry $type = POSTING_EDITTOPIC + $first = $this->getModel('PostsModel')->getFirstPost($t['topic_id']); + + if ($first['post_id'] == $_GET['id']) + $type = POSTING_EDITTOPIC; + + if ($p['user_id'] != $this->getModel('SessionModel')->getID() && $this->getModel('SessionModel')->getRank() < RANK_MOD) + { + $this->getView('MainView')->forum_message('You can edit only own posts', 'index.php?mode=viewtopic&id='.$t['topic_id']); + $lockv = true; + } + } + + break; + } + + //przesłanie formularza -------------------------------------------------------------------------------- + if (isset($_POST['post']) && !isset($_POST['preview']) && !isset($lockv)) + { + $_POST['post'] = trim(htmlspecialchars($this->db->real_escape_string($_POST['post']))); + + if ($type == POSTING_NEWTOPIC || $type == POSTING_EDITTOPIC) //walidacja tytułu tematu (add, edit) + { + $_POST['topic'] = trim(strip_tags($this->db->real_escape_string($_POST['topic']))); + + if (strlen($_POST['topic']) < 3) + $msg .= 'Topic title is too short (min 3 characters)
    '; + } + + if (strlen($_POST['post']) < 3) + $msg .= 'Post content is too short (min 3 characters)
    '; + + if ($msg == null) + { + switch ($type) + { + case POSTING_NEWTOPIC: //akcje dodania nowego tematu + + $topic_id = $this->getModel('PostsModel')->addTopic($_POST['topic'], $_POST['post'], $_GET['id'], $this->getModel('SessionModel')->getID()); + if ($topic_id != null) + { + $this->getView('MainView')->forum_message('Topic created, Redirecting...', 'index.php?mode=viewtopic&id='.$topic_id); + $lockv = true; + } + else + $msg .= 'Something went wrong, try again.'; + break; + case POSTING_EDITTOPIC: + case POSTING_EDIT: + $this->getModel('PostsModel')->changePost($_GET['id'], $_POST['post']); + + if ($type == POSTING_EDITTOPIC) + $this->getModel('PostsModel')->changeTopic($t['topic_id'], $_POST['topic']); + + $this->getView('MainView')->forum_message('Post edited. Redirecting to topic...', 'index.php?mode=viewtopic&id='.$t['topic_id']); + $lockv = true; + break; + + case POSTING_QUOTE: + case POSTING_REPLY: + $this->getModel('PostsModel')->addPost($_GET['id'], $this->getModel('SessionModel')->getID(), $_POST['post']); + + $this->getView('MainView')->forum_message('Reply saved. Redirecting to topic...', 'index.php?mode=viewtopic&id='.$_GET['id']); + $lockv = true; + break; + } + } + } + + if (!isset($lockv)) + { + switch ($type) + { + case POSTING_NEWTOPIC: + case POSTING_REPLY: + $_POST['post'] = (isset($_POST['post'])) ? $_POST['post'] : ''; + break; + case POSTING_EDITTOPIC: + $_POST['post'] = (isset($_POST['post'])) ? $_POST['post'] : $p['content']; + $_POST['topic'] = (isset($_POST['topic'])) ? $_POST['topic'] : $t['topic_title']; + break; + case POSTING_EDIT: + $_POST['post'] = (isset($_POST['post'])) ? $_POST['post'] : $p['content']; + break; + + case POSTING_QUOTE: + $quote = ($qp['nick'] != null) ? '='.$qp['nick'] : ''; + $_POST['post'] = (isset($_POST['post'])) ? $_POST['post'] : '[quote'.$quote.']'.$qp['content'].'[/quote]'; + break; + + } + if ($type == POSTING_NEWTOPIC) + $_POST['topic'] = (isset($_POST['topic'])) ? $_POST['topic'] : ''; //tylko edycja/tworzenie tematu + + $this->getView('MainView')->putExistingModel('PostsModel', $this->getModel('PostsModel')); + $this->getView('MainView')->putExistingModel('ForumsModel', $this->getModel('ForumsModel')); + + $this->getView('MainView')->posting_form($type, $msg); + } + } + + public function myprofile() + { + $this->loadDependencies(); + if (!$this->getModel('SessionModel')->isLogged()) + $this->forward('index.php'); + else + $this->forward('index.php?mode=viewprofile&id='.$this->getModel('SessionModel')->getID()); + } + + public function viewprofile() + { + $this->loadDependencies(); + + $this->loadModel('UsersModel'); + $this->getView('MainView')->putExistingModel('UsersModel', $this->getModel('UsersModel')); + + $_GET['id'] = (isset($_GET['id'])) ? trim(strip_tags($this->db->real_escape_string($_GET['id']))) : 0; + + if ($this->getModel('UsersModel')->getUserInformation($_GET['id']) == null) + $this->getView('MainView')->forum_message('User does not exist!', 'index.php'); + else + { + //$this->getView('MainView')->putExistingModel('PostsModel', $this->getModel('PostsModel')); + $this->getView('MainView')->viewprofile(); + } + } + + public function editprofile() + { + $this->loadDependencies(); + $this->loadModel('UsersModel'); + $user_info = $this->getModel('UsersModel')->getUserInformation($this->getModel('SessionModel')->getID(), true); + + if (!$this->getModel('SessionModel')->isLogged()) + { + $this->getView('MainView')->forum_message('You are not logged.', 'index.php?mode=login'); + } + else + { + $msg = ''; + if (isset($_POST['nick'], $_POST['passwd'], $_POST['passwd_confirm'], $_POST['email'])) + { + //secure pools + $_POST['nick'] = trim(strip_tags($this->db->real_escape_string($_POST['nick']))); + $_POST['passwd_old'] = trim(strip_tags($_POST['passwd_old'])); + $_POST['passwd'] = trim(strip_tags($_POST['passwd'])); + $_POST['passwd_confirm'] = trim(strip_tags($_POST['passwd_confirm'])); + $_POST['email'] = trim(strip_tags($this->db->real_escape_string($_POST['email']))); + $_POST['location'] = trim(strip_tags($this->db->real_escape_string($_POST['location']))); + $_POST['signature'] = trim(strip_tags($this->db->real_escape_string($_POST['signature']))); + + if ($_POST['email'] != $user_info['email'] || $_POST['passwd'] != '') + { + if (sha1($_POST['passwd_old']) != $user_info['password']) + $msg .= 'Old password is incorrect!
    '; + } + if ($_POST['passwd'] != '') + { + if (strlen($_POST['passwd']) < 8) + $msg .= 'Password is too short (min 8 characters)
    '; + + if ($_POST['passwd'] != $_POST['passwd_confirm']) + $msg .= 'Password do not match!
    '; + } + + //check if avatar is uploaded + if ($_FILES['avatar']['tmp_name'] != null) + { + global $allowed_avatars; + $image_size = @getimagesize($_FILES['avatar']['tmp_name']); + + if ($image_size == null) + $msg .= 'Type of uploaded file are not allowed.
    '; + else + if (!in_array($image_size['mime'], $allowed_avatars)) + $msg .= 'Type of uploaded avatar is not supported.
    '; + else + if ($image_size[0] > 120 || $image_size[1] > 150) + $msg .= 'Uploaded avatar is too big (maximum 120x150 px).
    '; + } + + if (!filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) + $msg .= 'Email is incorrect
    '; + + if ($msg == '') + { + if ($_FILES['avatar']['tmp_name'] != null && !isset($_POST['delete_avatar'])) //change an avatar + { + if ($user_info['avatar'] != '') + unlink('./'.$user_info['avatar']); + + $ext = pathinfo($_FILES['avatar']['name'], PATHINFO_EXTENSION); + $av = 'images/avatars/'.$this->getModel('SessionModel')->getID().'.'.$ext; + move_uploaded_file($_FILES['avatar']['tmp_name'], './'.$av); + } + else + if (isset($_POST['delete_avatar'])) + { + unlink('./'.$user_info['avatar']); + $av = ''; + } + else + $av = $user_info['avatar']; //if new avatar is not set + + if ($_POST['passwd'] != '') + $this->getModel('UsersModel')->changeUserPassword($this->getModel('SessionModel')->getID(), sha1($_POST['passwd'])); + + $this->getModel('UsersModel')->updateUserProfile($this->getModel('SessionModel')->getID(), '', $_POST['email'], $_POST['location'], $_POST['signature'], $av); + $this->getView('MainView')->forum_message('Your profile has changed.', 'index.php?mode=viewprofile&id='.$this->getModel('SessionModel')->getID()); + $lockv = true; + + } + } + + $_POST['nick'] = (isset($_POST['nick'])) ? $_POST['nick'] : $user_info['nick']; + $_POST['email'] = (isset($_POST['email'])) ? $_POST['email'] : $user_info['email']; + $_POST['location'] = (isset($_POST['location'])) ? $_POST['location'] : $user_info['location']; + $_POST['signature'] = (isset($_POST['signature'])) ? $_POST['signature'] : $user_info['signature']; + + $this->getView('MainView')->putExistingModel('UsersModel', $this->getModel('UsersModel')); + + if (!isset($lockv)) + $this->getView('MainView')->edprofile_form($msg); + } + } + + public function logout() + { + $this->loadDependencies(); + + if (!$this->getModel('SessionModel')->isLogged()) + $this->forward('index.php'); + + $this->getModel('SessionModel')->deleteSession(); + + $this->getView('MainView')->forum_message('You are logged out.', 'index.php'); + } + + public function login() + { + $this->loadDependencies(); + $this->loadModel('BansModel'); + + if ($_SERVER['REQUEST_SCHEME'] == 'http') + $this->forward('https://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']); + + if ($this->getModel('SessionModel')->isLogged()) + $this->forward('index.php'); + + $msg = ''; + if (isset($_POST['nick'], $_POST['passwd'])) + { + //secure pools + $_POST['nick'] = trim(strip_tags($this->db->real_escape_string($_POST['nick']))); + $_POST['passwd'] = sha1(trim(strip_tags($this->db->real_escape_string($_POST['passwd'])))); + + $userinfo = $this->getModel('SessionModel')->tryGetUser($_POST['nick'], $_POST['passwd']); + + if (count($userinfo) == 0) + $msg = 'Invalid username or password.'; + + if ($msg == '') + { + $ban_info = $this->getModel('BansModel')->getUserBan($userinfo['user_id']); + + if ($ban_info == null) + { + $this->getModel('SessionModel')->registerNewSession($userinfo['user_id']); + $this->getView('MainView')->forum_message('You are logged as: '.$userinfo['nick'].'', 'index.php'); + } + else + { + $reason = ($ban_info['reason'] != '') ? '
    Reason: '.$ban_info['reason'].'' : ''; + $this->getView('MainView')->forum_message('You are banned!'.$reason); + } + $lockv = true; + } + } + + $_POST['nick'] = (isset($_POST['nick'])) ? $_POST['nick'] : ''; + if (!isset($lockv)) + $this->getView('MainView')->login_form($msg); + } + + public function register() + { + $this->loadDependencies(); + $this->loadModel('UsersModel'); + + if ($this->getModel('SessionModel')->isLogged()) + $this->forward('index.php'); + + if ($_SERVER['REQUEST_SCHEME'] == 'http') + $this->forward('https://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']); + + $msg = ''; + if (isset($_POST['nick'], $_POST['passwd'], $_POST['passwd_confirm'], $_POST['email'])) + { + //secure pools + $_POST['nick'] = trim(strip_tags($this->db->real_escape_string($_POST['nick']))); + $_POST['passwd'] = trim(strip_tags($_POST['passwd'])); + $_POST['passwd_confirm'] = trim(strip_tags($_POST['passwd_confirm'])); + $_POST['email'] = trim(strip_tags($this->db->real_escape_string($_POST['email']))); + + if (strlen($_POST['nick']) < 3) + $msg .= 'Nick is too short (min 3 characters)
    '; + + if (strlen($_POST['passwd']) < 8) + $msg .= 'Password is too short (min 8 characters)
    '; + + if (!filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) + $msg .= 'Email is incorrect
    '; + + if ($this->getModel('UsersModel')->nickExists($_POST['nick']) == true) + $msg .= 'Nick is in use. Type another one.
    '; + + if ($_POST['passwd'] != $_POST['passwd_confirm']) + $msg .= 'Password do not match'; + + if ($msg == '') + { + $this->getModel('UsersModel')->createNewUser($_POST['nick'], sha1($_POST['passwd']), $_POST['email']); + $this->getView('MainView')->forum_message('Your account has created. Log in to write new posts.', 'index.php'); + $lockv = true; + } + } + + $_POST['nick'] = (isset($_POST['nick'])) ? $_POST['nick'] : ''; + $_POST['email'] = (isset($_POST['email'])) ? $_POST['email'] : ''; + + if (!isset($lockv)) + $this->getView('MainView')->register_form($msg); + } + + public function checknick() + { + $this->loadModel('UsersModel'); + if (!isset($_GET['nick'])) + $_GET['nick'] = ''; + + $_GET['nick'] = trim($this->db->real_escape_string(strip_tags($_GET['nick']))); + + if ($this->getModel('UsersModel')->nickExists($_GET['nick']) == true) + echo 'true'; + else + echo 'false'; + } +} + +?> \ No newline at end of file diff --git a/inc/database_connection.php b/inc/database_connection.php new file mode 100644 index 0000000..37f246e --- /dev/null +++ b/inc/database_connection.php @@ -0,0 +1,6 @@ +query("SET NAMES `utf8`"); +?> \ No newline at end of file diff --git a/inc/misc_functions.php b/inc/misc_functions.php new file mode 100644 index 0000000..ba2e1f6 --- /dev/null +++ b/inc/misc_functions.php @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/inc/model.class.php b/inc/model.class.php new file mode 100644 index 0000000..121a6f0 --- /dev/null +++ b/inc/model.class.php @@ -0,0 +1,56 @@ +db = $db; + } + + public function select($table, $what='*', $where = '', $sorting = '', $limit = '') + { + $sql="SELECT $what FROM $table"; + + if ($where != '') + $sql .= " WHERE $where"; + + if($sorting != '') + $sql .= " ORDER BY $sorting"; + + if($limit != '') + $sql .= " LIMIT $limit"; + + $result = $this->db->query($sql); + + $out = array(); + if ($result->num_rows > 0) + { + while ($row = $result->fetch_assoc()) + { + $out[]=$row; + } + } + + return $out; + } + + public function select_query($sql) + { + $result = $this->db->query($sql); + + $out = array(); + if ($result->num_rows > 0) + { + while ($row = $result->fetch_assoc()) + { + $out[]=$row; + } + } + + return $out; + } +} \ No newline at end of file diff --git a/inc/models/BansModel.class.php b/inc/models/BansModel.class.php new file mode 100644 index 0000000..7ec7414 --- /dev/null +++ b/inc/models/BansModel.class.php @@ -0,0 +1,64 @@ +select_query($query); + } + + public function getBan($ban_id) + { + if ($this->ban_info == null) + { + $query = 'SELECT b.ban_id as ban_id, b.user_id as user_id, u.nick as nick, b.reason as reason + FROM '.BANLIST_TABLE.' b + LEFT JOIN '.USERS_TABLE.' u ON u.user_id = b.user_id + WHERE `ban_id`=\''.$ban_id.'\''; + + $out = $this->select_query($query); + + if (count($out) > 0) + $this->ban_info = $out[0]; + } + + return $this->ban_info; + } + + public function getUserBan($user_id) + { + $out = $this->select(BANLIST_TABLE, '*', 'user_id=\''.$user_id.'\''); + + if (count($out) > 0) + return $out[0]; + else + return null; + } + + public function addBan($user_id, $reason) + { + $query = 'INSERT INTO '.BANLIST_TABLE.' + (`ban_id`, `user_id`, `reason`) + VALUES (NULL, \''.$user_id.'\', \''.$reason.'\')'; + + $this->db->query($query); + + $query = 'DELETE FROM '.SESSIONS_TABLE.' WHERE `user_id`=\''.$user_id.'\''; + $this->db->query($query); + } + + public function deleteBan($ban_id) + { + $query = 'DELETE FROM '.BANLIST_TABLE.' WHERE `ban_id`=\''.$ban_id.'\''; + + $this->db->query($query); + } +} +?> \ No newline at end of file diff --git a/inc/models/ConfigModel.class.php b/inc/models/ConfigModel.class.php new file mode 100644 index 0000000..1a8e7fa --- /dev/null +++ b/inc/models/ConfigModel.class.php @@ -0,0 +1,38 @@ +db = $db; + + $result = $this->select (CONFIG_TABLE); + + for ($i=0; $iconfList[$result[$i]['name']] = $result[$i]['value']; + + } + + public function getConf($name) + { + if (isset($this->confList[$name])) + return $this->confList[$name]; + else + return null; + } + + public function updateConf($name, $value) + { + $query = 'UPDATE '.CONFIG_TABLE.' + SET `value`=\''.$value.'\' + WHERE `name`=\''.$name.'\''; + + $this->db->query($query); + } +} + +?> \ No newline at end of file diff --git a/inc/models/ForumsModel.class.php b/inc/models/ForumsModel.class.php new file mode 100644 index 0000000..bfaa554 --- /dev/null +++ b/inc/models/ForumsModel.class.php @@ -0,0 +1,119 @@ +select (FORUMS_VIEW); + } + + public function getCats() + { + return $this->select (CATS_TABLE); + } + + public function getForumsNames() + { + $out = $this->select (FORUMS_TABLE, 'forum_id, name', '', 'forum_id ASC'); + if (count($out) > 0) + return $out; + else + return array(); + } + + public function getForum($forum_id) + { + if ($this->forum_info == null) + { + $out = $this->select(FORUMS_TABLE, '*', 'forum_id=\''.$forum_id.'\''); + + if (count($out) > 0) + $this->forum_info = $out[0]; + } + + return $this->forum_info; + } + + public function getTopics($forum_id) + { + $out = $this->select(TOPICS_VIEW, '*', 'forum_id=\''.$forum_id.'\'', 'lastpost_post_id DESC'); + if (count($out) > 0) + return $out; + else + return array(); + } + + public function getCat($cat_id) + { + if ($this->cat_info == null) + { + $out = $this->select(CATS_TABLE, '*', 'category_id=\''.$cat_id.'\''); + + if (count($out) > 0) + $this->cat_info = $out[0]; + } + + return $this->cat_info; + } + + public function changeCat($cat_id, $cat_name) + { + $query = 'UPDATE '.CATS_TABLE.' + SET `name`=\''.$cat_name.'\' + WHERE `category_id`=\''.$cat_id.'\''; + + $this->db->query($query); + } + + public function addCat($cat_name) + { + $query = 'INSERT INTO '.CATS_TABLE.' + (category_id, name) + VALUES (NULL, \''.$cat_name.'\')'; + + $this->db->query($query); + } + + public function deleteCat($cat_id) + { + $query = 'DELETE FROM '.CATS_TABLE.' + WHERE `category_id`=\''.$cat_id.'\''; + + $this->db->query($query); + } + + public function changeForum($forum_id, $forum_name, $forum_desc, $forum_category_id, $forum_locked) + { + $query = 'UPDATE '.FORUMS_TABLE.' + SET `name`=\''.$forum_name.'\', + `desc`=\''.$forum_desc.'\', + `category_id`=\''.$forum_category_id.'\', + `locked`=\''.$forum_locked.'\' + WHERE `forum_id`=\''.$forum_id.'\''; + + $this->db->query($query); + } + + public function addForum($forum_name, $forum_desc, $forum_category_id, $forum_locked) + { + $query = 'INSERT INTO '.FORUMS_TABLE.' + (`forum_id`, `name`, `desc`, `category_id`, `locked`) + VALUES (NULL, \''.$forum_name.'\', \''.$forum_desc.'\', \''.$forum_category_id.'\', \''.$forum_locked.'\')'; + + $this->db->query($query); + } + + public function deleteForum($forum_id) + { + $query = 'DELETE FROM '.FORUMS_TABLE.' + WHERE `forum_id`=\''.$forum_id.'\''; + + $this->db->query($query); + } +} + +?> \ No newline at end of file diff --git a/inc/models/NavigationModel.class.php b/inc/models/NavigationModel.class.php new file mode 100644 index 0000000..81e454c --- /dev/null +++ b/inc/models/NavigationModel.class.php @@ -0,0 +1,43 @@ +addLink('Forum '.$fn, 'index.php'); + $this->title = $fn. ' • '; + } + public function addLink($name, $url = '') + { + if ($url == null) + $url = $_SERVER['REQUEST_URI']; + $l = array( + 'name' => $name, + 'url' => $url + ); + + array_push($this->linksList, $l); + } + + public function setSubTitle($t) + { + $this->title .= $t; + } + + public function getTitle() + { + return $this->title; + } + + public function getNav() + { + return $this->linksList; + } +} + +?> \ No newline at end of file diff --git a/inc/models/PostsModel.class.php b/inc/models/PostsModel.class.php new file mode 100644 index 0000000..4c7b09f --- /dev/null +++ b/inc/models/PostsModel.class.php @@ -0,0 +1,126 @@ +topic_info == null) + { + $query = ' + SELECT + t.topic_id as topic_id, t.title as topic_title, t.locked as topic_locked, t.forum_id as forum_id, f.name as forum_name, f.locked as forum_locked, pc.post_count as post_count + FROM '.TOPICS_TABLE.' t + LEFT JOIN '.FORUMS_TABLE.' f ON f.forum_id = t.forum_id + LEFT JOIN '.TOPICS_PC_VIEW.' pc ON pc.topic_id = t.topic_id + WHERE t.topic_id=\''.$topic_id.'\''; + $out = $this->select_query($query); + if (count($out) > 0) + $this->topic_info = $out[0]; + } + + return $this->topic_info; + } + + public function getPosts($topic_id) + { + $out = $this->select (POSTS_VIEW, '*', 'topic_id=\''.$topic_id.'\'', 'post_id ASC'); + + if ($out != null) + return $out; + else + return null; + } + + public function getPost($post_id) + { + $out = $this->select (POSTS_VIEW, '*', 'post_id=\''.$post_id.'\''); + + if (count($out) > 0) + return $out[0]; + else + return null; + } + + public function getFirstPost($topic_id) + { + $out = $this->select (POSTS_VIEW, 'post_id', 'topic_id=\''.$topic_id.'\'', 'post_id ASC', 1); + + if (count($out) > 0) + return $out[0]; + else + return null; + } + + //mod options + public function deletePost($post_id) + { + $query = 'DELETE FROM '.POSTS_TABLE.' WHERE post_id=\''.$post_id.'\';'; + + $this->db->query($query); + } + + public function deleteTopic($topic_id) + { + $query = 'call delete_topic(\''.$topic_id.'\');'; + $this->db->query($query); + } + + public function lockTopic($topic_id, $locked = true) + { + $query = 'UPDATE '.TOPICS_TABLE.' SET locked=\''.$locked.'\' WHERE topic_id=\''.$topic_id.'\';'; + + $this->db->query($query); + } + + public function moveTopic($topic_id, $forum_id) + { + $query = 'UPDATE '.TOPICS_TABLE.' SET forum_id=\''.$forum_id.'\' WHERE topic_id=\''.$topic_id.'\';'; + + $this->db->query($query); + } + + public function addTopic($title, $content, $forum_id, $user_id) + { + $query = 'call add_topic(\''.$title.'\', + \''.$content.'\', + \''.$forum_id.'\', + \''.$user_id.'\', + \''.$_SERVER['HTTP_USER_AGENT'].'\', + @out);'; + $this->db->query($query); + $result = $this->db->query('select @out as topic_id'); + + if ($result != null) + return $result->fetch_assoc()['topic_id']; + else + return null; + } + + public function changePost($post_id, $content) + { + $query = 'UPDATE '.POSTS_TABLE.' SET `content`=\''.$content.'\' WHERE `post_id`=\''.$post_id.'\''; + $this->db->query($query); + } + + public function changeTopic($topic_id, $title) + { + $query = 'UPDATE '.TOPICS_TABLE.' SET `title`=\''.$title.'\' WHERE `topic_id`=\''.$topic_id.'\''; + $this->db->query($query); + } + + public function addPost($topic_id, $user_id, $content) + { + $query = 'INSERT INTO '.POSTS_TABLE.' + (post_id, topic_id, user_id, content, date, user_agent) + VALUES + (NULL, \''.$topic_id.'\', \''.$user_id.'\', \''.$content.'\', NOW(), \''.$_SERVER['HTTP_USER_AGENT'].'\')'; + $this->db->query($query); + } +} + +?> \ No newline at end of file diff --git a/inc/models/SessionModel.class.php b/inc/models/SessionModel.class.php new file mode 100644 index 0000000..6d6e0a9 --- /dev/null +++ b/inc/models/SessionModel.class.php @@ -0,0 +1,125 @@ +db = $db; + + if (isset($_COOKIE[COOKIE_NAME])) + { + $result = $this->select(SESSIONS_TABLE, '*', 'session_id=\''.$_COOKIE[COOKIE_NAME].'\' AND expiry_time>=NOW()'); + if (count($result) > 0) + { + //update session expiry time in database and in cookie + if ($result[0]['IP'] != $_SERVER['REMOTE_ADDR']) + { + $this->deleteSession(); + } + else + { + $this->updateSession(); + $uid = $result[0]['user_id']; + + $result = $this->select(USERS_TABLE, 'user_id, nick, rank', 'user_id=\''.$uid.'\''); + $this->userdata = $result[0]; + } + } + else + { + $this->deleteSession(); + } + } + } + + public function updateSession() + { + /*$this->db->query('UPDATE '.SESSIONS_TABLE.' SET expiry_time=(NOW() + INTERVAL 120 MINUTE) WHERE session_id=\''.$_COOKIE[COOKIE_NAME].'\''); + setcookie(COOKIE_NAME, $_COOKIE[COOKIE_NAME], $_SERVER['REQUEST_TIME']+7200, COOKIE_PATH, COOKIE_DOMAIN, false, true); */ + $newid = $this->generateSessionID(); + $this->db->query('UPDATE '.SESSIONS_TABLE.' SET expiry_time=(NOW() + INTERVAL 120 MINUTE), session_id=\''.$newid.'\' WHERE session_id=\''.$_COOKIE[COOKIE_NAME].'\''); + setcookie(COOKIE_NAME, $newid, $_SERVER['REQUEST_TIME']+7200, COOKIE_PATH, COOKIE_DOMAIN, false, true); + $_COOKIE[COOKIE_NAME] = $newid; + } + + public function deleteSession() + { + setcookie(COOKIE_NAME, '', $_SERVER['REQUEST_TIME']-3600, COOKIE_PATH, COOKIE_DOMAIN, false, true); + $this->db->query('DELETE FROM '.SESSIONS_TABLE.' WHERE session_id=\''.$_COOKIE[COOKIE_NAME].'\''); + } + + private function generateSessionID() + { + $out = $_SERVER['HTTP_USER_AGENT'].$_SERVER['REQUEST_TIME_FLOAT'].$_SERVER['REMOTE_ADDR'].rand(1, 50000); + return md5($out); + } + + public function registerNewSession($user_id) + { + $newID = $this->generateSessionID(); + $query = 'UPDATE '.USERS_INFO_TABLE.' + SET lastvisit=NOW() + WHERE user_id=\''.$user_id.'\''; + + $this->db->query($query); + + $query = + 'INSERT INTO + '.SESSIONS_TABLE.' + (session_id, user_id, IP, expiry_time) + VALUES + (\''.$newID.'\', \''.$user_id.'\', \''.$_SERVER['REMOTE_ADDR'].'\', (NOW() + INTERVAL 120 MINUTE) );'; + + $this->db->query($query); + + setcookie(COOKIE_NAME, $newID, $_SERVER['REQUEST_TIME']+7200, COOKIE_PATH, COOKIE_DOMAIN, false, true); + } + + public function tryGetUser($nick, $passwd) + { + $result = $this->select(USERS_TABLE, 'user_id, nick', 'nick=\''.$nick.'\' AND password=\''.$passwd.'\'', '', 1); + + if (count($result) > 0 ) + return $result[0]; + else + return array(); + } + + public function isLogged() + { + if (count($this->userdata) > 0) + return true; + else + return false; + } + + public function getNick() + { + if ($this->isLogged()) + return $this->userdata['nick']; + else + return null; + } + + public function getRank() + { + if ($this->isLogged()) + return $this->userdata['rank']; + else + return null; + } + + public function getID() + { + if ($this->isLogged()) + return $this->userdata['user_id']; + else + return null; + } +} + +?> \ No newline at end of file diff --git a/inc/models/StatisticsModel.class.php b/inc/models/StatisticsModel.class.php new file mode 100644 index 0000000..e46ff3c --- /dev/null +++ b/inc/models/StatisticsModel.class.php @@ -0,0 +1,56 @@ +select(POSTS_TABLE, 'count(post_id) AS posts_count'); + return $out[0]['posts_count']; + } + + public function getTopicsCount() + { + $out = $this->select(TOPICS_TABLE, 'count(topic_id) AS topics_count'); + return $out[0]['topics_count']; + } + + public function getUsersCount() + { + $out = $this->select(USERS_TABLE, 'count(user_id) AS users_count'); + return $out[0]['users_count']; + } + + public function getLastRegisteredUser() + { + $out = $this->select(USERS_TABLE, 'user_id, nick, rank', '', 'user_id DESC', '1'); + return $out[0]; + } + + private function retrieveLoggedUsers() + { + if ($this->logged_users == null) + { + $this->logged_users = $this->select(LOGGED_USERS_VIEW); + } + } + + public function getLoggedUsersCount() + { + $this->retrieveLoggedUsers(); + + return count($this->logged_users); + } + + public function getLoggedUsers() + { + $this->retrieveLoggedUsers(); + + return $this->logged_users; + } +} + +?> \ No newline at end of file diff --git a/inc/models/UsersModel.class.php b/inc/models/UsersModel.class.php new file mode 100644 index 0000000..6b5f535 --- /dev/null +++ b/inc/models/UsersModel.class.php @@ -0,0 +1,128 @@ +select(USERS_TABLE, 'nick', '`nick`=\''.$nick.'\'', '', 1); + if (count($out) > 0) + return true; + else + return false; + } + + public function createNewUser($nick, $passwd, $email) + { + $this->db->query('call add_user(\''.$nick.'\', \''.$passwd.'\', \''.$email.'\');'); + } + + public function getUsersNicks() + { + $out = $this->select (USERS_TABLE, 'user_id, nick', '', 'user_id ASC'); + if (count($out) > 0) + return $out; + else + return array(); + } + + public function getUserInformation($user_id, $passwd = false) + { + if ($this->user_info == null) + { + $query = ' + SELECT + u.nick as nick, u.email as email, u.rank as rank, u.active as active, + ui.regdate as regdate, ui.lastvisit as lastvisit, ui.avatar as avatar, ui.location as location, ui.signature as signature, pc.post_count as post_count, lu.IP as user_IP '; + if ($passwd) + $query .= ',u.password as password '; + $query .= ' + FROM '.USERS_TABLE.' u + LEFT JOIN '.USERS_INFO_TABLE.' ui on ui.user_id = u.user_id + LEFT JOIN '.USERS_PC_VIEW.' pc on pc.user_id = u.user_id + LEFT JOIN '.LOGGED_USERS_VIEW.' lu on lu.user_id = u.user_id + WHERE u.user_id = \''.$user_id.'\''; + + $out = $this->select_query($query); + if (count($out) > 0) + $this->user_info = $out[0]; + } + + return $this->user_info; + } + + public function changeUserPassword($user_id, $passwd) + { + $query = + 'UPDATE .'.USERS_TABLE.' + SET `password`=\''.$passwd.'\' + WHERE `user_id` = \''.$user_id.'\''; + + $this->db->query($query); + } + + public function changeUserRank($user_id, $rank) + { + $query = + 'UPDATE .'.USERS_TABLE.' + SET `rank`=\''.$rank.'\' + WHERE `user_id` = \''.$user_id.'\''; + + $this->db->query($query); + } + + public function updateUserProfile($user_id, $nick, $email, $location, $signature, $avatar) + { + $query = + 'UPDATE .'.USERS_TABLE.' + SET '; + if ($nick != null) + $query .= '`nick`=\''.$nick.'\','; + $query .= '`email`=\''.$email.'\' + WHERE `user_id` = \''.$user_id.'\''; + + $this->db->query($query); + + //profile informations + $query = + 'UPDATE .'.USERS_INFO_TABLE.' + SET + `avatar`=\''.$avatar.'\', + `location`=\''.$location.'\', + `signature`=\''.$signature.'\' + WHERE `user_id` = \''.$user_id.'\''; + + $this->db->query($query); + } + + public function getUsers($stype, $sorder, $rank) + { + $query = ' + SELECT + u.user_id as user_id, u.nick as nick, u.rank as rank, ui.regdate as regdate, ui.lastvisit as lastvisit, pc.post_count as post_count + FROM '.USERS_TABLE.' u + LEFT JOIN '.USERS_INFO_TABLE.' ui on ui.user_id = u.user_id + LEFT JOIN '.USERS_PC_VIEW.' pc on pc.user_id = u.user_id '; + if ($rank !== '') + $query .= 'WHERE rank=\''.$rank.'\''; + $query .= ' + ORDER BY '.$stype.' '.$sorder; + + $out = $this->select_query($query); + + return $out; + } + + public function deleteUser($user_id) + { + $query = + 'DELETE FROM .'.USERS_TABLE.' + WHERE `user_id` = \''.$user_id.'\''; + $this->db->query($query); + } +} + +?> \ No newline at end of file diff --git a/inc/view.class.php b/inc/view.class.php new file mode 100644 index 0000000..9330ed0 --- /dev/null +++ b/inc/view.class.php @@ -0,0 +1,29 @@ +TPL[$n] = $v; + } + + function __construct(&$db) + { + $this->db = $db; + } +} + +?> \ No newline at end of file diff --git a/inc/views/MainView.class.php b/inc/views/MainView.class.php new file mode 100644 index 0000000..313a61a --- /dev/null +++ b/inc/views/MainView.class.php @@ -0,0 +1,536 @@ +assign('is_logged', $this->getModel('SessionModel')->isLogged()); + $this->assign('my_nick', $this->getModel('SessionModel')->getNick()); + $this->assign('my_id', $this->getModel('SessionModel')->getID()); + $this->assign('my_rank', $this->getModel('SessionModel')->getRank()); + $this->assign('actual_time', date('Y-m-d G:i', $_SERVER['REQUEST_TIME'])); + + //forum prefs + $this->assign('forum_name', $this->getModel('ConfigModel')->getConf('forum_name')); + $this->assign('forum_desc', $this->getModel('ConfigModel')->getConf('forum_desc')); + + //navigation + $this->loadModel('NavigationModel'); + $this->getModel('NavigationModel')->setForumName($this->getModel('ConfigModel')->getConf('forum_name')); + if ($admin) + $this->getModel('NavigationModel')->addLink('ACP Admin', 'index.php?mode=admin'); + } + + //widok strony głównej + public function main() + { + $this->setDefaults(); + + // get categories, forums, forums statistics + $this->loadModel('ForumsModel'); + $this->assign('forums_list', $this->getModel('ForumsModel')->getForums()); + + //get data for bottom statistics + $this->loadModel('StatisticsModel'); + $this->assign('posts_count', $this->getModel('StatisticsModel')->getPostsCount()); + $this->assign('users_count', $this->getModel('StatisticsModel')->getUsersCount()); + $this->assign('last_user', $this->getModel('StatisticsModel')->getLastRegisteredUser()); + $this->assign('logged_users_count', $this->getModel('StatisticsModel')->getLoggedUsersCount()); + $this->assign('logged_users', $this->getModel('StatisticsModel')->getLoggedUsers()); + + //nawigacja po witrynie + $this->getModel('NavigationModel')->setSubTitle('Main Page'); + $this->getModel('NavigationModel')->addLink('Main Page', 'index.php'); + + // końcowe rzeczy + $this->assign('nav', $this->getModel('NavigationModel')->getNav()); + $this->assign('meta_title', $this->getModel('NavigationModel')->getTitle()); + $this->show('main'); + } + + public function viewforum() + { + $this->setDefaults(); + + // get forum info + $f_info = $this->getModel('ForumsModel')->getForum($_GET['id']); + + $this->assign('f_name', $f_info['name']); + $this->assign('forum_info', $f_info); + $this->assign('topics_list', $this->getModel('ForumsModel')->getTopics($_GET['id'])); + //nawigacja po witrynie + $this->getModel('NavigationModel')->setSubTitle('View forum: '.$f_info['name']); + $this->getModel('NavigationModel')->addLink($f_info['name'], 'index.php?mode=viewforum&id='.$_GET['id']); + + // końcowe rzeczy + $this->assign('nav', $this->getModel('NavigationModel')->getNav()); + $this->assign('meta_title', $this->getModel('NavigationModel')->getTitle()); + $this->show('viewforum'); + } + + public function userlist() + { + $this->setDefaults(); + + $this->loadModel('UsersModel'); + $this->assign('users_list', $this->getModel('UsersModel')->getUsers($_POST['sort_type'], $_POST['sort_desc'], $_GET['rank'])); + + $this->assign('regdate_selected', ($_POST['sort_type'] == 'regdate') ? 'selected="selected"' : ''); + $this->assign('lastvisit_selected', ($_POST['sort_type'] == 'lastvisit') ? 'selected="selected"' : ''); + $this->assign('username_selected', ($_POST['sort_type'] == 'nick') ? 'selected="selected"' : ''); + $this->assign('posts_selected', ($_POST['sort_type'] == 'post_count') ? 'selected="selected"' : ''); + $this->assign('desc_checked', ($_POST['sort_desc'] == 'DESC') ? 'checked="checked"' : ''); + + //nawigacja po witrynie + $this->getModel('NavigationModel')->setSubTitle('Users list'); + $this->getModel('NavigationModel')->addLink('Users list', 'index.php?mode=userlist'); + + // końcowe rzeczy + $this->assign('nav', $this->getModel('NavigationModel')->getNav()); + $this->assign('meta_title', $this->getModel('NavigationModel')->getTitle()); + $this->show('userlist'); + } + + public function viewtopic() + { + $this->setDefaults(); + + // get forum info + $t_info = $this->getModel('PostsModel')->getTopic($_GET['id']); + + $this->assign('topic_info', $t_info); + $this->assign('posts_list', $this->getModel('PostsModel')->getPosts($_GET['id'])); + //nawigacja po witrynie + $this->getModel('NavigationModel')->setSubTitle('View topic: '.$t_info['topic_title']); + $this->getModel('NavigationModel')->addLink($t_info['forum_name'], 'index.php?mode=viewforum&id='.$t_info['forum_id']); + $this->getModel('NavigationModel')->addLink($t_info['topic_title'], 'index.php?mode=viewtopic&id='.$_GET['id']); + + // końcowe rzeczy + $this->assign('nav', $this->getModel('NavigationModel')->getNav()); + $this->assign('meta_title', $this->getModel('NavigationModel')->getTitle()); + $this->show('viewtopic'); + } + + public function login_form($msg) + { + $this->setDefaults(); + + $this->assign('nick', $_POST['nick']); + $this->assign('error_msg', $msg); + + //nawigacja po witrynie + $this->getModel('NavigationModel')->setSubTitle('Log in'); + $this->getModel('NavigationModel')->addLink('Log in', 'index.php?mode=login'); + + // końcowe rzeczy + $this->assign('nav', $this->getModel('NavigationModel')->getNav()); + $this->assign('meta_title', $this->getModel('NavigationModel')->getTitle()); + $this->show('login_form'); + } + + public function register_form($msg) + { + $this->setDefaults(); + + $this->assign('nick', $_POST['nick']); + $this->assign('email', $_POST['email']); + $this->assign('error_msg', $msg); + + //nawigacja po witrynie + $this->getModel('NavigationModel')->setSubTitle('Register'); + $this->getModel('NavigationModel')->addLink('Register', 'index.php?mode=register'); + + // końcowe rzeczy + $this->assign('nav', $this->getModel('NavigationModel')->getNav()); + $this->assign('meta_title', $this->getModel('NavigationModel')->getTitle()); + $this->show('register_form'); + } + + public function viewprofile() + { + $this->setDefaults(); + $this->loadModel('StatisticsModel'); + + $user_info = $this->getModel('UsersModel')->getUserInformation($_GET['id']); + + $this->assign('user_info', $user_info); + $total_posts = $this->getModel('StatisticsModel')->getPostsCount(); + $posts_ration = ($total_posts > 0) ? round(100*$user_info['post_count']/$total_posts, 2) : 0; + $this->assign('post_ratio', $total_posts); + $this->assign('logged_id', $this->getModel('SessionModel')->getID()); + + //nawigacja po witrynie + $this->getModel('NavigationModel')->addLink('Users list', 'index.php?mode=userlist'); + $this->getModel('NavigationModel')->setSubTitle('View profile: '.$user_info['nick']); + $this->getModel('NavigationModel')->addLink('Profile: '.$user_info['nick'], 'index.php?mode=viewprofile&id='.$_GET['id']); + + // końcowe rzeczy + $this->assign('nav', $this->getModel('NavigationModel')->getNav()); + $this->assign('meta_title', $this->getModel('NavigationModel')->getTitle()); + $this->show('viewprofile'); + } + + public function edprofile_form($msg, $admin = false) + { + $this->setDefaults($admin); + + if ($admin) + $user_info = $this->getModel('UsersModel')->getUserInformation($_GET['id']); + else + $user_info = $this->getModel('UsersModel')->getUserInformation($this->getModel('SessionModel')->getID()); + $this->assign('nick', $_POST['nick']); + $this->assign('is_admin', $admin); + $this->assign('email', $_POST['email']); + $this->assign('location', $_POST['location']); + $this->assign('signature', $_POST['signature']); + $this->assign('avatar', $user_info['avatar']); + $this->assign('error_msg', $msg); + + if ($admin) + { + $this->assign('user_selected', ($_POST['user_rank'] == RANK_USER) ? 'checked="checked"' : ''); + $this->assign('mod_selected', ($_POST['user_rank'] == RANK_MOD) ? 'checked="checked"' : ''); + $this->assign('admin_selected', ($_POST['user_rank'] == RANK_ADMIN) ? 'checked="checked"' : ''); + } + + //nawigacja po witrynie + if ($admin) + { + $this->getModel('NavigationModel')->setSubTitle('ACP • Edit profile'); + $this->getModel('NavigationModel')->addLink('Users list', 'index.php?mode=admin&submode=users'); + $this->getModel('NavigationModel')->addLink('Edit user: '.$user_info['nick']); + } + else + { + $this->getModel('NavigationModel')->setSubTitle('Edit profile'); + $this->getModel('NavigationModel')->addLink('Edit profile', 'index.php?mode=editprofile'); + } + + // końcowe rzeczy + $this->assign('nav', $this->getModel('NavigationModel')->getNav()); + $this->assign('meta_title', $this->getModel('NavigationModel')->getTitle()); + $this->show('edprofile'); + } + + public function posting_form($type, $msg='') + { + $this->setDefaults(); + $this->assign('error_msg', $msg); + + //nawigacja po witrynie + switch ($type) + { + case POSTING_NEWTOPIC: + $forum_info = $this->getModel('ForumsModel')->getForum($_GET['id']); + $this->getModel('NavigationModel')->setSubTitle('New topic'); + $this->getModel('NavigationModel')->addLink($forum_info['name'], 'index.php?mode=viewforum&id='.$forum_info['forum_id']); + $this->getModel('NavigationModel')->addLink('New topic', $_SERVER['REQUEST_URI']); + break; + case POSTING_REPLY: + case POSTING_QUOTE: + $topic_info = $this->getModel('PostsModel')->getTopic($_GET['id']); + + $this->getModel('NavigationModel')->setSubTitle('Reply'); + $this->getModel('NavigationModel')->addLink($topic_info['forum_name'], 'index.php?mode=viewforum&id='.$topic_info['forum_id']); + $this->getModel('NavigationModel')->addLink($topic_info['topic_title'], 'index.php?mode=viewtopic&id='.$topic_info['topic_id']); + $this->getModel('NavigationModel')->addLink('Write a reply', $_SERVER['REQUEST_URI']); + break; + + case POSTING_EDIT: + $topic_info = $this->getModel('PostsModel')->getTopic($_GET['id']); + + $this->getModel('NavigationModel')->setSubTitle('Edit post'); + $this->getModel('NavigationModel')->addLink($topic_info['forum_name'], 'index.php?mode=viewforum&id='.$topic_info['forum_id']); + $this->getModel('NavigationModel')->addLink($topic_info['topic_title'], 'index.php?mode=viewtopic&id='.$topic_info['topic_id']); + $this->getModel('NavigationModel')->addLink('Edit post', $_SERVER['REQUEST_URI']); + break; + + case POSTING_EDITTOPIC: + $topic_info = $this->getModel('PostsModel')->getTopic($_GET['id']); + + $this->getModel('NavigationModel')->setSubTitle('Edit topic'); + $this->getModel('NavigationModel')->addLink($topic_info['forum_name'], 'index.php?mode=viewforum&id='.$topic_info['forum_id']); + $this->getModel('NavigationModel')->addLink($topic_info['topic_title'], 'index.php?mode=viewtopic&id='.$topic_info['topic_id']); + $this->getModel('NavigationModel')->addLink('Edit topic', $_SERVER['REQUEST_URI']); + break; + } + + $this->assign('post', $_POST['post']); + if (isset($_POST['preview'])) + $this->assign('preview', addslashes(htmlspecialchars($_POST['post']))); + + if ($type == POSTING_NEWTOPIC || $type == POSTING_EDITTOPIC) + $this->assign('topic', $_POST['topic']); + + // końcowe rzeczy + $this->assign('nav', $this->getModel('NavigationModel')->getNav()); + $this->assign('meta_title', $this->getModel('NavigationModel')->getTitle()); + $this->show('posting'); + } + + public function move_topic() + { + $this->setDefaults(); + $this->loadModel('ForumsModel'); + + //nawigacja po witrynie + $this->getModel('NavigationModel')->setSubTitle('Move topic'); + $this->getModel('NavigationModel')->addLink('Move topic', $_SERVER['REQUEST_URI']); + + $this->assign('topic_info', $this->getModel('PostsModel')->getTopic($_GET['id'])); + $this->assign('forums_list', $this->getModel('ForumsModel')->getForumsNames()); + + // końcowe rzeczy + $this->assign('nav', $this->getModel('NavigationModel')->getNav()); + $this->assign('meta_title', $this->getModel('NavigationModel')->getTitle()); + $this->show('move_topic'); + } + + public function forum_message($msg, $url = '', $timeout = 2) + { + $this->setDefaults(); + + $this->assign('message', $msg); + $this->assign('url', $url); + $this->assign('timeout', $timeout); + + //nawigacja po witrynie + $this->getModel('NavigationModel')->setSubTitle('Forum message'); + $this->getModel('NavigationModel')->addLink('Forum message', 'index.php'); + + // końcowe rzeczy + $this->assign('nav', $this->getModel('NavigationModel')->getNav()); + $this->assign('meta_title', $this->getModel('NavigationModel')->getTitle()); + $this->show('forum_message'); + } + + public function confirm_action($msg) + { + $this->setDefaults(); + + $this->assign('message', $msg); + + //nawigacja po witrynie + $this->getModel('NavigationModel')->setSubTitle('Confirm action'); + $this->getModel('NavigationModel')->addLink('Confirm action', $_SERVER['REQUEST_URI']); + + // końcowe rzeczy + $this->assign('nav', $this->getModel('NavigationModel')->getNav()); + $this->assign('meta_title', $this->getModel('NavigationModel')->getTitle()); + $this->show('confirm_action'); + } + + public function colorRank($username, $rank) + { + if ($rank == RANK_ADMIN) + return ''.$username.''; + + if ($rank == RANK_MOD) + return ''.$username.''; + + return $username; + } + + public function getRankLevel($rank) + { + if ($rank == RANK_ADMIN) + return $this->colorRank('Admin', $rank); + if ($rank == RANK_MOD) + return $this->colorRank('Mod', $rank); + + return 'User'; + } + + // ADMIN PANEL ----------------------------------------------------------------- + public function admin_main() + { + $this->setDefaults(true); + $this->loadModel('StatisticsModel'); + + //nawigacja po witrynie + $this->getModel('NavigationModel')->setSubTitle('Main Page'); + $this->assign('installation_date', $this->getModel('ConfigModel')->getConf('installation_date')); + $this->assign('topics_total', $this->getModel('StatisticsModel')->getTopicsCount()); + $this->assign('posts_total', $this->getModel('StatisticsModel')->getPostsCount()); + $this->assign('users_total', $this->getModel('StatisticsModel')->getUsersCount()); + $this->assign('script_version', VERSION); + $this->assign('logged_users', $this->getModel('StatisticsModel')->getLoggedUsers()); + $this->assign('logged_users_total', $this->getModel('StatisticsModel')->getLoggedUsersCount()); + + // końcowe rzeczy + $this->assign('nav', $this->getModel('NavigationModel')->getNav()); + $this->assign('meta_title', $this->getModel('NavigationModel')->getTitle()); + $this->show('admin/main'); + } + + public function admin_userlist() + { + $this->setDefaults(true); + + $this->loadModel('UsersModel'); + $this->assign('users_list', $this->getModel('UsersModel')->getUsers($_POST['sort_type'], $_POST['sort_desc'], $_GET['rank'])); + + $this->assign('regdate_selected', ($_POST['sort_type'] == 'regdate') ? 'selected="selected"' : ''); + $this->assign('lastvisit_selected', ($_POST['sort_type'] == 'lastvisit') ? 'selected="selected"' : ''); + $this->assign('username_selected', ($_POST['sort_type'] == 'nick') ? 'selected="selected"' : ''); + $this->assign('posts_selected', ($_POST['sort_type'] == 'post_count') ? 'selected="selected"' : ''); + $this->assign('desc_checked', ($_POST['sort_desc'] == 'DESC') ? 'checked="checked"' : ''); + + //nawigacja po witrynie + $this->getModel('NavigationModel')->setSubTitle('ACP • Users list'); + $this->getModel('NavigationModel')->addLink('Users list'); + + // końcowe rzeczy + $this->assign('nav', $this->getModel('NavigationModel')->getNav()); + $this->assign('meta_title', $this->getModel('NavigationModel')->getTitle()); + $this->show('admin/userlist'); + } + + public function admin_config($msg) + { + $this->setDefaults(true); + + $this->loadModel('UsersModel'); + + + $this->assign('forum_name', $_POST['forum_name']); + $this->assign('forum_desc', $_POST['forum_desc']); + $this->assign('error_msg', $msg); + + //nawigacja po witrynie + $this->getModel('NavigationModel')->setSubTitle('ACP • Admin config'); + $this->getModel('NavigationModel')->addLink('Forum configuration'); + + // końcowe rzeczy + $this->assign('nav', $this->getModel('NavigationModel')->getNav()); + $this->assign('meta_title', $this->getModel('NavigationModel')->getTitle()); + $this->show('admin/config'); + } + + //widok strony głównej + public function admin_forums() + { + $this->setDefaults(true); + + // get categories, forums, forums statistics + $this->loadModel('ForumsModel'); + $this->assign('forums_list', $this->getModel('ForumsModel')->getForums()); + + //nawigacja po witrynie + $this->getModel('NavigationModel')->setSubTitle('ACP • Forums list'); + $this->getModel('NavigationModel')->addLink('Forums list'); + + // końcowe rzeczy + $this->assign('nav', $this->getModel('NavigationModel')->getNav()); + $this->assign('meta_title', $this->getModel('NavigationModel')->getTitle()); + $this->show('admin/forums'); + } + + public function admin_cat_form($msg, $m) + { + $this->setDefaults(true); + + $this->assign('name', $_POST['name']); + $this->assign('error_msg', $msg); + + //nawigacja po witrynie + $this->getModel('NavigationModel')->addLink('Forums list', 'index.php?mode=admin&submode=forums'); + if ($m == 'add') + { + $this->getModel('NavigationModel')->setSubTitle('ACP • Add category'); + $this->getModel('NavigationModel')->addLink('Add category'); + $this->assign('cat_form_name', 'Add new category'); + } + else + { + $cat_info = $this->getModel('ForumsModel')->getCat($_GET['id']); + $this->getModel('NavigationModel')->setSubTitle('ACP • Edit category'); + $this->getModel('NavigationModel')->addLink('Edit category: '.$cat_info['name']); + $this->assign('cat_form_name', 'Edit category'); + } + + // końcowe rzeczy + $this->assign('nav', $this->getModel('NavigationModel')->getNav()); + $this->assign('meta_title', $this->getModel('NavigationModel')->getTitle()); + $this->show('admin/cat_form'); + } + + public function admin_forum_form($msg, $m) + { + $this->setDefaults(true); + + $this->assign('name', $_POST['name']); + $this->assign('desc', $_POST['desc']); + $this->assign('category_id', $_POST['category_id']); + $this->assign('lock_selected', ($_POST['locked']) ? 'checked="checked"' : ''); + $this->assign('unlock_selected', (!$_POST['locked']) ? 'checked="checked"' : ''); + $this->assign('error_msg', $msg); + $this->assign('cats_list', $this->getModel('ForumsModel')->getCats()); + + //nawigacja po witrynie + $this->getModel('NavigationModel')->addLink('Forums list', 'index.php?mode=admin&submode=forums'); + if ($m == 'add') + { + $this->getModel('NavigationModel')->setSubTitle('ACP • Add forum'); + $this->getModel('NavigationModel')->addLink('Add forum'); + $this->assign('forum_form_name', 'Add new forum'); + } + else + { + $forum_info = $this->getModel('ForumsModel')->getForum($_GET['id']); + $this->getModel('NavigationModel')->setSubTitle('ACP • Edit forum'); + $this->getModel('NavigationModel')->addLink('Edit forum'.$forum_info['name']); + $this->assign('forum_form_name', 'Edit forum'); + } + + // końcowe rzeczy + $this->assign('nav', $this->getModel('NavigationModel')->getNav()); + $this->assign('meta_title', $this->getModel('NavigationModel')->getTitle()); + $this->show('admin/forum_form'); + } + + public function admin_banlist() + { + $this->setDefaults(true); + + $this->loadModel('BansModel'); + $this->assign('bans_list', $this->getModel('BansModel')->getBans()); + + //nawigacja po witrynie + $this->getModel('NavigationModel')->setSubTitle('ACP • Banlist'); + $this->getModel('NavigationModel')->addLink('Banlist'); + + // końcowe rzeczy + $this->assign('nav', $this->getModel('NavigationModel')->getNav()); + $this->assign('meta_title', $this->getModel('NavigationModel')->getTitle()); + $this->show('admin/banlist'); + } + + public function admin_ban_form($msg) + { + $this->setDefaults(true); + + $this->assign('user_id', $_POST['user_id']); + $this->assign('reason', $_POST['reason']); + + $this->loadModel('UsersModel'); + $this->assign('error_msg', $msg); + $this->assign('users_list', $this->getModel('UsersModel')->getUsersNicks()); + + //nawigacja po witrynie + $this->getModel('NavigationModel')->addLink('Banlist', 'index.php?mode=admin&submode=banlist'); + + $this->getModel('NavigationModel')->setSubTitle('ACP • Add ban'); + $this->getModel('NavigationModel')->addLink('Add ban'); + $this->assign('forum_form_name', 'Add ban'); + + // końcowe rzeczy + $this->assign('nav', $this->getModel('NavigationModel')->getNav()); + $this->assign('meta_title', $this->getModel('NavigationModel')->getTitle()); + $this->show('admin/ban_form'); + } +} +?> \ No newline at end of file diff --git a/index.php b/index.php new file mode 100644 index 0000000..e4f3b86 --- /dev/null +++ b/index.php @@ -0,0 +1,43 @@ +$_GET['mode'](); + else + $ob->loadDefault(); + break; + case 'admin': + require_once('./inc/controllers/AdminController.class.php'); + $ob = new AdminController($DB); + if ($_GET['submode'] != null) + $ob->$_GET['submode'](); + else + $ob->loadDefault(); + break; + } +} +catch (Exception $e) +{ + echo + 'Unexpected error occured:
    + '.$e->getMessage().'
    +
    + File: '.$e->getFile().'
    + Line: '.$e->getLine().'
    + Trace: '.$e->getTraceAsString().'
    '; + exit; +} +?> \ No newline at end of file diff --git a/templates/admin/admin.css b/templates/admin/admin.css new file mode 100644 index 0000000..1bb834c --- /dev/null +++ b/templates/admin/admin.css @@ -0,0 +1,81 @@ +#container { + background-color: lightgray; + border: 2px solid #551c1c; +} + +a:hover { + color: #551c1c; +} + +#container #top { + background-color: lightgray; + height: 70px; +} + +#container #top h1 { + top: 0%; + color: #551c1c; +} + +#container #footer { + background-color: #551c1c; +} + +#container #menu { + background-image: url('images/button_beam.gif'); +} + +.navigation { + color: #551c1c; +} + +.row:last-child .tc1, .row:last-child .tc2, .row:last-child .tc3, .row:last-child .tc4 { + border-bottom: 1px solid #551c1c; +} + +.rcol { + border: 1px solid #551c1c; +} + +.tc1 { + border-left: 1px solid #551c1c; +} + +.tc4 { + border-right: 1px solid #551c1c; +} + +.hc1, .hc2, .hc3, .hc4 { + background-image: url('images/category_beam.gif'); + border-top: 1px solid #551c1c; +} + +.hc1 { + border-left: 1px solid #551c1c; +} + +.hc4 { + border-right: 1px solid #551c1c; +} + +.tab_desc { + color: #551c1c; +} + + input[type="button"], input[type="reset"], input[type="submit"] { + background-color: #f8e3e3; + border: 1px solid #f8d6d6; + color: #A30000; +} + +input[type="button"]:hover, input[type="reset"]:hover, input[type="submit"]:hover { + background-color: #f8f1f1; +} + +.btn { + background-image: url('images/button_beam.gif'); +} + +.btn_small { + background-image: url('images/button_beam.gif'); +} \ No newline at end of file diff --git a/templates/admin/ban_form.tpl.php b/templates/admin/ban_form.tpl.php new file mode 100755 index 0000000..d059211 --- /dev/null +++ b/templates/admin/ban_form.tpl.php @@ -0,0 +1,56 @@ + + +
    + TPL['error_msg'] != '') { ?> +
    + TPL['error_msg']; ?> +
    + +
    +
    +
    +
    TPL['forum_form_name']; ?>
    +
     
    +
    +
    +
    + User: +
    +
    + +
    +
    +
    +
    + Reason: +
    +
    + +
    +
    +
    +
    +   +
    +
    + +
    +
    +
    +
    +
    + + \ No newline at end of file diff --git a/templates/admin/banlist.tpl.php b/templates/admin/banlist.tpl.php new file mode 100755 index 0000000..4ca9f89 --- /dev/null +++ b/templates/admin/banlist.tpl.php @@ -0,0 +1,36 @@ + +
    + Add ban +
    +
    +
    +
    Banlist
    +
     
    +
     
    +
    +
    +
    Username
    +
    Reason
    +
    +
    + TPL['bans_list']); $i++) + { + echo '
    '."\n"; + echo "\t\t\t".'
    '.$this->TPL['bans_list'][$i]['nick'].'
    '."\n"; + echo "\t\t\t".'
    '.$this->TPL['bans_list'][$i]['reason'].'
    '."\n"; + echo "\t\t\t".'
    + Delete +
    '; + echo "\t\t".'
    '."\n"; + } + if (count($this->TPL['bans_list']) == 0) + { + echo '
    Banlist is empty.
    '; + } + ?> +
    +
    +
    + + \ No newline at end of file diff --git a/templates/admin/cat_form.tpl.php b/templates/admin/cat_form.tpl.php new file mode 100755 index 0000000..f18b28a --- /dev/null +++ b/templates/admin/cat_form.tpl.php @@ -0,0 +1,41 @@ + + +
    + TPL['error_msg'] != '') { ?> +
    + TPL['error_msg']; ?> +
    + +
    +
    +
    +
    TPL['cat_form_name']; ?>
    +
     
    +
    + +
    +
    + Category name: +
    +
    + +
    +
    +
    +
    +   +
    +
    + +
    +
    +
    +
    +
    + + \ No newline at end of file diff --git a/templates/admin/config.tpl.php b/templates/admin/config.tpl.php new file mode 100755 index 0000000..19e66de --- /dev/null +++ b/templates/admin/config.tpl.php @@ -0,0 +1,49 @@ + + +
    + TPL['error_msg'] != '') { ?> +
    + TPL['error_msg']; ?> +
    + +
    +
    +
    +
    Overall configuration
    +
     
    +
    + +
    +
    + Forum name: +
    +
    + +
    +
    +
    +
    + Forum description: +
    +
    + +
    +
    +
    +
    +   +
    +
    + +
    +
    +
    +
    +
    + + \ No newline at end of file diff --git a/templates/admin/forum_form.tpl.php b/templates/admin/forum_form.tpl.php new file mode 100755 index 0000000..2e3aeb6 --- /dev/null +++ b/templates/admin/forum_form.tpl.php @@ -0,0 +1,76 @@ + + +
    + TPL['error_msg'] != '') { ?> +
    + TPL['error_msg']; ?> +
    + +
    +
    +
    +
    TPL['forum_form_name']; ?>
    +
     
    +
    + +
    +
    + Forum name: +
    +
    + +
    +
    +
    +
    + Forum description: +
    +
    + +
    +
    +
    +
    + Category: +
    +
    + +
    +
    +
    +
    + Forum locked: +
    +
    + TPL['lock_selected']; ?>> + Yes   + TPL['unlock_selected']; ?>> + No +
    +
    +
    +
    +   +
    +
    + +
    +
    +
    +
    +
    + + \ No newline at end of file diff --git a/templates/admin/forums.tpl.php b/templates/admin/forums.tpl.php new file mode 100755 index 0000000..1606d00 --- /dev/null +++ b/templates/admin/forums.tpl.php @@ -0,0 +1,69 @@ + +
    +
    + New Category + New Forum +
     
    + TPL['forums_list']); $i++) + { + if ($i > 0) + { + if ($this->TPL['forums_list'][$i-1]['category_id'] != $this->TPL['forums_list'][$i]['category_id']) + echo '

    +
    +
    '.$this->TPL['forums_list'][$i]['category_name'].'
    + + +
    '; + } + else + { + echo '
    +
    +
    '.$this->TPL['forums_list'][$i]['category_name'].'
    + + +
    '; + } + if ($this->TPL['forums_list'][$i]['forum_id'] != null) + { + echo '
    '."\n"; + echo "\t\t\t".'
    + '.$this->TPL['forums_list'][$i]['forum_name'].'
    + '.$this->TPL['forums_list'][$i]['forum_desc'].'
    '."\n"; + echo "\t\t\t".'
    + Edit +
    '."\n"; + echo "\t\t\t".'
    + Delete +
    '."\n"; + echo "\t\t".'
    '."\n"; + } + else + { + echo '
    No forums in this category.
    '; + } + } + ?> + TPL['forums_list']) > 0) echo '
    '; ?> +
    +
    + + \ No newline at end of file diff --git a/templates/admin/images/button_beam.gif b/templates/admin/images/button_beam.gif new file mode 100644 index 0000000000000000000000000000000000000000..8e1af536d4ead7efdc65e7ee17eabb237eb1b680 GIT binary patch literal 1167 zcmZ?wbhEHb)MqeaIOfF=DkBpnBNHwo6Co=b2}E*oQF3z8KqN08BQGB(FCVXI4n!In6&f0q8X8p^8r2#awHg{Vnwqtm zn)RBR4cgj`+S*Op+RfV9EkK5jPP2|qi;hmKj!qkp)YWa%)os_+?a($rq)7S3@A_Id71_u8JJy857=vIRvK4a#r*>mR3o4;V;qQy&=HZiSOxoY)lM#eQ8)~(yX z#Jp|$j-9)9?_put!_0c<@R6fO+1ZbsVmrZhik0KyrOQ{YaB^O~dHwoL4zBwT9zJ^f zt~k1kRP1q!oK=%F8xhNsEe#SqopWt(2LUwRTlvHruMG!&OV8M31oZ$vez= zdSIF}`__L2jwK1d!*p+N&3t@p?(S*196J>Mz2a3&a!ELt#V_w?bLhi;fnMHb2b-B2 zIu0lqrSthT9Z5Yso3nhM&LU&Z<4e6Oj;*O|d3k+(?CQ4KUB#U@Rr2net(7*<7e3I; zE$_Ey$H&KNej4%T_U!!p{K8^wcgMZEzP`S(Is3k!ZR_{<4}w=ntXH!6`T5EI`QrWm zth>K|h+I=)Ki`%6m-egs{rU3$fB*gXc6vNFi`b1OZnj+u6dF0?Ry=4HP}{MfSy=AJ zp;n1~0?utR$2KUoE3{QCY?r9wINYgmYJpOh&MFP&Zi8bIi@ViVSsd=Qc(&qkpUt-y zk9$p7BAIzjI5brzx=1~=Oqt})SE({7fUR>0ulb7!&Ag^J5|;AD+?sHBdicEusxxBa zW~NS0F8ZlDE$i8W!?W{?IG4{UxR$9tH|mwc^0`&dRyOn7yg9(UppoxX^FnKtSBDpM za=mh1Z2e%ui-rB~7*;H3jFQR_aQMRDA~2_lOKZj4Zyye?u>YcvwQAL>Dydm?ne2y%FyYx=ytUqVBdd=p`ZrX1*?KL~S zX6v1@*KfB!aLaBHbe)p@Zs&_-tKaQqZzBVPH2|^Z BQE>nO literal 0 HcmV?d00001 diff --git a/templates/admin/images/category_beam.gif b/templates/admin/images/category_beam.gif new file mode 100644 index 0000000000000000000000000000000000000000..da61063d6055a4a924a067114503240fe46b056e GIT binary patch literal 457 zcmZ?wbhEHblwpu#SgObnDkBpvBNHhn7cD0jD=(j*ppdAbkgTAPqNtdrsF<##l&P$o zrL3HzqLQnklCP>-psHG|rdFn|UZJ5;si9G=p;4o$S*NMlsIA?kt=+7n)2gG>uB+Rn zr`N5g*Qc*P!NA}@ErAXL5P9<__ z9(*WQVB~kZ}=ijv)oJ}09&8=;1oZUUWoLpSo6DCfY zJZ<_6E?yqq**tUR&YL@D!NS?|_*Sl3$-jEdnzelV8`lVI+s?mz+s<8kcL^Ricm{BLg!J zhpE5~gAEH0aPTSx%y78Kc!YzG)k~rv@la#Gf~kAQ`Z=jPg1+A*wRaBAjd;#$Kp%R$qhHDY#FfrG=LkY!$* zlUfZL9Imq@t+it~AjS~M$i%kfDW`+xZ3eciyo?Lm-bHP*VP1eALS*NL=8^EMO#j&*y;R5mpWdXM+ZY##Xka##|>39B6L6EhqKh R%#904Y`l^xX*?VZ)&R(0==A^q literal 0 HcmV?d00001 diff --git a/templates/admin/images/lock.gif b/templates/admin/images/lock.gif new file mode 100644 index 0000000000000000000000000000000000000000..6bd5ef08dd47e77b1e0e27ce28d0da9a7e399466 GIT binary patch literal 1030 zcmZ?wbhEHb6lM@&_|Cvk*Y#i4>;Hzi|7|qS#g+WuzT|&*<$v9<|I^$5A6)nU=%)X< z>Hir_|1)U(m_GCWo|XTXP5JMe{of(!|EcZ&7ccz3Z_|HXhWQau|F^FG&mjLP(eE>l z(|=C8|HpUyH}d*_`M`e$hO|*M8Ulkh1QdU=FfuU6Gw3h?0Vq$fb3A6S=Maf#WN7B$ zuoQS=s zL4kuqQ`nri-AzlS8XRt}NVr_2>mYu}pMmk3-GuDMbqp*v)+P(Qr>|#V6yQlo&}eLE zI8?;1{Gs6^b1NGMU-rE}<&JDT%)Cks2P6%fSa~@tT6P>bkio&hBe7$G)nj%BX^Dy* X2W~qz&)>!#b>~20^N}7#Mh0sDo(bvX literal 0 HcmV?d00001 diff --git a/templates/admin/images/move.gif b/templates/admin/images/move.gif new file mode 100644 index 0000000000000000000000000000000000000000..9fffc7d8f48a1705cb9bf1bebc4c0b9fb6d3cc37 GIT binary patch literal 1030 zcmZ?wbhEHb6lM@&_|CwvZOQ+-uK#ArCpOIeFYoz3uH=7v>3@Tu|I=IkAKmo-z`Fmr z>Hir_|1)U(*t7Eg^qK#cP5JMe{of(!|EcZ&7ccz3Z`1#XsQ+76{}*Cd!XW>N$Lar( z?f*IL{-4|Xe`?SF%Lo25FrodLWX7@ z4oi_61{)S0;NVpXnBnk|@dyVWtCvDSqEl19g1*3n2LXo|yA*=e0t|{07}%skPO%(# z(CEO#Xrp%Ez~<#m^SQWWegrIRJlAhq$yCa)@L(GQdl*ybge#4q%Vgw4CMbMe-mofM zQ9xru=)q8C2^Nb7oC|arHZn2^?0EHHbu>>NyTXc{3mc;um{^{$8YD2VFiTq1ObAF| zczB?N+uN;x;W0ZGuZ_n&n@YzvZf0Jkh66VZnpk_oFidFArbD Y4c`XFbGMjvvmPu^Z1QbqWMr@g0O)b*M*si- literal 0 HcmV?d00001 diff --git a/templates/admin/images/no_av.gif b/templates/admin/images/no_av.gif new file mode 100644 index 0000000000000000000000000000000000000000..93a098c328baa3a468a11e6d53ba49bfd735dec8 GIT binary patch literal 2562 zcmV+d3jOs*Nk%w1VNd{20O$VzHC>HkSXg9PS!G&UW?Ni4WRGE9VrE@qUtnlIWtMDR zWk_U~QDK~EU}iOJk2hdP@ZktAOmRD_?d}5qPbC^nUomy?8c4>ikYIaF=nSE(@N_LuCai2?fn}KS7Q+1n! zX@y&Jn`LjNeQbbKcAQOkomF?8R(PIQd7oZ)pJ#NWT6m>ddZ2)Arc`^Uf^md|ZlQ;6 zoPctRhi#}@d!k)=ty_GfWO=BJaE*p=q+)xcTz#a7bB<|xq+NccWqqYyf2NFbpmlkl zZhEV4d!UDOp^0;*W`3uIcAI2?pi*>1Ve5h`IsAzzxm~@km zb);;7ql$N=jd+t{gQ{tPs$_z&lXsMDfu)vqnrDNgj(DGHf~$*prEY?zae=Fkc&uHA zt!smpOChqkGz4I!=RAEnv%nz zk;SBuzn+rInw7tLpTM4$yN{Z{pp?y{l*gWy$EB6Xq?ov)m(Zq{%9ftLsF=*Dnaz5r z$bzQGho{4(ozJM8)vTP*g{jM>p}&c##eS^Js-D-4sm!3K$)l&kovh4?vdy2f%cQf^ zjlS5JywZ-u)}O!Jn8etp!rHIK*rdtcn$Y5()##ws>964JwBhKr>+rnl@w)K!xAywO z|NYGV{{R2~A^8LW3IP8AEC2ui08ju>000R70RIUbNU)&6g9sBUT*$DY!-o(fN}Ncs zqQ#3CGiuz(v7^V24*BK7w*`ofDO0#`nPNnTj(Pm{f$TUh7&B?zs#Ti?ZQ8PB$$|-Vun|4>Nyogh!YSpi=!+Wa&lQkz+#J-Na2KxGyW4t zEVem!z>ic`X{7)J@X$*yx;P<44^0Y$NGi@fLWqx7rukz4Fx=9M6Hb5`W-w)ram$oy z=9vU7nD`(?nE%j;$RlGEqYR!^1_@-Io3JuWD}egK1tIkbh-Ux+TtLPqu#A#L18V+2 z2|s`elt&mn+(My`2eirME&jUbLJKSkq&Yz(`jjeAF#q^LVFNIX5^Jot+(OH&dZc+k zB)Sr`jxD`tLTs_L+yV&l1@de9Vm(fY@P28fgZQ z#S<}Lkiq8_4Dxrg%?Q#36GvRm!~q5%;JN{@H~x7B6>#vy98ff)>ph-y;(I4;xIjY= zLFAA_42^HFK?R^ozyTkJ5Z*@$^#Dr5@0M8NJ0wiFz(EGeZvZ+35{QrnB!Lvp2lOd~ zJ>w0obdvr2ac|Fr4KA>tzY9#vVaXxuTc739a0n)pVnc9{-~6%{x4Ee)dg>FP9olfY zG^BwEBe>5X7RbT5K|)P{2%!YqkcK&!kc1aJgLK3Z2)WHo5|Z#BBn}Y>HSwW>B(%dE z+F%9?`Y;XtHgE@Nz@Y@Wxlo4a3q%dmbh!$qfrl0}Ll3{e1SX`x1#fFhKa|jk26`|N z=<7owLa3%Tv|$cUOhXTQc)=>VkqM&c%LtBmh$Id!gz8h152a{9Dt_S#SEynWtk8rd zxBwnpDaRbpH$x=`q7NeE!yGK9M>Bk(hi`Oa6PU0BBn)8)K_~-PUSSDG3NC#joWl(- zmpL_3kqKJRE;FAwpaBhHAOjVs00kz<05m_M zgd4ik3@D7^E4#T#a4IthhvL(! zEXC+c!*^8Bb+se?pupuU`2{VIRgj!i=2^*k)s_;~s7Dpw>_8{eju;~d3k4)z3mHyO zrZl4atmt1efC09OudSe)ghx!V1TE~82|e}XLxDPjv=Y^_gJoU?Rx5$oJ-`?qndQVz zH(5o|R+Y5;bZJq;=Q+Wq)~&0>008{q5jmuxq-K5WN@q|}-E!4&gPq-KndjCF6kr@5 zDF+3t5YF53mANcH!CxJ>+rWZvcC7`SYAaBH1A@dJ9~c7hfI3mE{#AKgjV|pfklyLC zcDmYV3l3h<0Tw`Z1}X@z3D&xS{GRu75=gIl{R@EzSRitw!37RPU;*b^*0+O=uyp-f z0rH7p2Qy*^0}=oM=4}82mA$Nfr7K+sJRku=XqGHYF^M}w;Kvb&aD*Q~P>!;cr%dH4DA*I#_x@{%_cpZo++yuGv^2AmNmDoPF>}=-`h$o{X5sb0)xwE+O2(+7_0&L CJt8&$ literal 0 HcmV?d00001 diff --git a/templates/admin/images/td_beam_top.gif b/templates/admin/images/td_beam_top.gif new file mode 100644 index 0000000000000000000000000000000000000000..b322b1f1034f3b561195bea682ca0ad89b13cb89 GIT binary patch literal 139 zcmZ?wbhEHbWMmL#Xc1)Cxnt+<-Mjbh-Meq!z5@pi96WgNFbEtucI?>66DNV-^y$-Q y&z?PZ{@jK0=PzBlboI*B#iRfo1|R_0#lR}Cz(K}ilL`M9i=HNlqXG + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + µForum + + + + diff --git a/templates/admin/images/unlock.gif b/templates/admin/images/unlock.gif new file mode 100644 index 0000000000000000000000000000000000000000..54ff5152f0368e51246879759ae1626f388c5eca GIT binary patch literal 1031 zcmZ?wbhEHb6lM@&_|Cwvf6f28uK(MY{NFJ5zpU5)xRU?VTK-$9pJ^%nuN(IN$fp0f z>Hir_|1)U(m_GCWvMK+4v;R9J{Xez+|Kf%J_ig&m$FLwG>i@2l{~6>z@i_fIvi(1& z-TwsNPexw<&+Ywx`M`e$hO|*M8Ulkh1QdU=FfuU6Gw3h?0Vq$fb39?N=MeE&$iU3Q zVJ>pPV8cQO4qgSH2@V$-T{!qy-4qxcnwt6*^aVN|7&tL?DcDQ>;7E9KfI&K_$;RRH zVg@!o79oxYhN?}>Tzmx#3=15Z_(i0?uy8h{U1oNXH@P67!062&x+#sd!0|vUH@}&M zhJYhu;F>7yn%LhB4vd>z_Agtjupsa5Hb$m`80+in8W`CMvN9fQe}A8mUm)Sb2Sukw z#?t3}GkA6|ALAF6l2~wN=B7qg2|XT@j0cYCN9Ie56mS$aHeTY7Q{J$^>Tx@Rq(sSv Y1G|}<=Wb( + +
    + + Welcome in µForum Admin Control Panel!
    + Choose option from menu to manage forum.
    +

    +
    +
    +
    Forum statistics
    +
     
    +
    +
    +
    + Installation date: +
    +
    + TPL['installation_date']; ?> +
    +
    +
    +
    + Topics total: +
    +
    + TPL['topics_total']; ?> +
    +
    + +
    +
    + Posts total: +
    +
    + TPL['posts_total']; ?> +
    +
    + +
    +
    + Users total: +
    +
    + TPL['users_total']; ?> +
    +
    + +
    +
    + Logged users total (last 5 min): +
    +
    + TPL['logged_users_total']; ?> +
    +
    + +
    +
    + Script version: +
    +
    + TPL['script_version']; ?> +
    +
    + +
    +
    + Updates: +
    +
    + in future... +
    +
    +
    +
    +
    +
    +
    Logged users (last 5 min)
    +
     
    +
     
    +
    +
    +
    Username
    +
    Rank
    +
    IP
    +
    + TPL['logged_users']); $i++) + { + echo ' +
    +
    '.$this->TPL['logged_users'][$i]['nick'].'
    +
    '.$this->getRankLevel($this->TPL['logged_users'][$i]['rank']).'
    +
    '.$this->TPL['logged_users'][$i]['IP'].'
    +
    '; + } + + if (count($this->TPL['logged_users']) == 0) + echo '
    No logged users.
    '; + ?> +
    +
    + + \ No newline at end of file diff --git a/templates/admin/overall_header.tpl.php b/templates/admin/overall_header.tpl.php new file mode 100644 index 0000000..652f2c0 --- /dev/null +++ b/templates/admin/overall_header.tpl.php @@ -0,0 +1,46 @@ + + + +<?= $this->TPL['meta_title']; ?> + + + + + + + +
    +
    +

    µForum ACP

    +
    + +
    +
    + TPL['is_logged']) { ?> + You are logged as: TPL['my_nick'] ?> + + Welcome Guest! You are not logged. +
    + Actual time: TPL['actual_time']; ?>
    +
    +
    + \ No newline at end of file diff --git a/templates/admin/userlist.tpl.php b/templates/admin/userlist.tpl.php new file mode 100755 index 0000000..e3029d9 --- /dev/null +++ b/templates/admin/userlist.tpl.php @@ -0,0 +1,73 @@ + +
    +
    +
    +
    +
    Users list
    +
     
    +
     
    +
     
    +
     
    +
     
    +
    +
    +
    Username
    +
    Joined
    +
    Last visit
    +
    Posts
    +
    +
    +
    + TPL['users_list']); $i++) + { + echo '
    '."\n"; + echo "\t\t\t".''."\n"; + echo "\t\t\t".'
    '.$this->TPL['users_list'][$i]['regdate'].'
    '."\n"; + echo "\t\t\t".'
    '.(($this->TPL['users_list'][$i]['lastvisit']!= null) ? $this->TPL['users_list'][$i]['lastvisit'] : 'Never').'
    '."\n"; + echo "\t\t\t".'
    '.$this->TPL['users_list'][$i]['post_count'].'
    '."\n"; + echo "\t\t\t".'
    + Edit
    '."\n"; + echo "\t\t\t".' '."\n"; + echo "\t\t".'
    '."\n"; + } + ?> + + +
    +
    +
    +
    +
    Options
    +
    +
    +
    +
    + Sort users by: + +     + TPL['desc_checked']; ?> />Descending +        +
    +
    +
    + +
    +
    + + \ No newline at end of file diff --git a/templates/confirm_action.tpl.php b/templates/confirm_action.tpl.php new file mode 100755 index 0000000..bdad268 --- /dev/null +++ b/templates/confirm_action.tpl.php @@ -0,0 +1,34 @@ + + +
    +
    +
    +
    +
    +
    Confirm your action
    +
    + +
    +
    + TPL['message']; ?> +
    + +
    +
    +
    + + + +
    + +
    +
    +
    +
    + + \ No newline at end of file diff --git a/templates/edprofile.tpl.php b/templates/edprofile.tpl.php new file mode 100755 index 0000000..8b38c2a --- /dev/null +++ b/templates/edprofile.tpl.php @@ -0,0 +1,175 @@ + + + +
    + TPL['error_msg'] != '') { ?> +
    + TPL['error_msg']; ?> +
    + +
    +
    +
    +
    Basic informations
    +
     
    +
    + +
    +
    + Nick: +
    +
    + TPL['is_admin']) {?> + + + TPL['nick']; ?> + + +
    +
    + TPL['is_admin']) {?> +
    +
    + Old password: +
    +
    + (type only if you want to change password or email.) +
    +
    + +
    +
    + New password: +
    +
    + (type only if you want to change it.) +
    +
    +
    +
    + Confirm password: +
    +
    + +
    +
    +
    +
    + Email address: +
    +
    + +
    +
    +
    +
    +   +
    +
    + +
    +
    +
    +
    +
    +
    +
    Profile informations
    +
     
    +
    + +
    +
    + Location: +
    +
    + +
    +
    +
    +
    + Signature: +
    +
    + +
    +
    +
    +
    + Avatar: +
    +
    + Current avatar:
    + user avatar
    + TPL['avatar'] != null) { ?> Delete avatar
    + + +
    +
    +
    +
    +   +
    +
    + +
    +
    +
    + TPL['is_admin']) {?> +
    +
    +
    +
    Admin options
    +
     
    +
    +
    +
    + User rank: +
    +
    + TPL['user_selected']; ?> > + User   + TPL['mod_selected']; ?>> + Mod   + TPL['admin_selected']; ?>> + Admin +
    +
    +
    +
    +   +
    +
    + +
    +
    +
    + + +
    +
    + + \ No newline at end of file diff --git a/templates/forum_message.tpl.php b/templates/forum_message.tpl.php new file mode 100755 index 0000000..f13fb24 --- /dev/null +++ b/templates/forum_message.tpl.php @@ -0,0 +1,28 @@ + + +TPL['url'] != '') { ?> + + + +
    +
    +
    +
    +
    Forum message
    +
    + +
    +
    + TPL['message']; ?> +
    + +
    +
    +
    + + \ No newline at end of file diff --git a/templates/images/button_beam.gif b/templates/images/button_beam.gif new file mode 100644 index 0000000000000000000000000000000000000000..d909d5bc1a8afdd0cb192b464912cca53b1a7654 GIT binary patch literal 1374 zcmdVXi&GMI0KoBIfC_?&??+0G$_mSN+O*bVc9msikI`jU*<~5CS!r6{&6NLm5?-2vQi1UGFUR2VE338lfU?f@GK(uxS+ckN;606_(aJhW8?u%!V69oXhO zTi*l7`v6q{K{B9rh1RGNfTr8pl>$cwaICbqX9B0k!1;-zLm6Mz+94@cArj}nPsBfTyCScXvOm1mwm5QYznW979+0?Fl-u}E* z1?g&qXqvT6nt{OqFx;mY92*^zO}u{7F)|5(nFdVe_j7Z`55`Zk9~S3fpDiC3mw`b= zW3ir*;m)|T-2%3PhW5l2i_VvKW}pHHCj`fL@5{n?UiotBI_W^B&*qf92&YS3x!8Rt z$BOfx?avK~JaR=|Fhyd9l5KrPbnE()8* zxVtzlX&6oz;6TMNHsaf0b9ueZk=>ZPD`rHd~lkuhCqKX+INuIW=x;~y-d*){R zs4V{!^~2bLh=2|H!XtsxF$Kp19$k9y^R;k&5&lBBz95Q~ebQqhI+$l}&OLEv0GWx5~+&p|<5w$Q*vQ3^gq?OGZH%1`f9W1HK58tpET3 literal 0 HcmV?d00001 diff --git a/templates/images/category_beam.gif b/templates/images/category_beam.gif new file mode 100644 index 0000000000000000000000000000000000000000..c86276ddd5a323cf282c43a53dfa683b508e618e GIT binary patch literal 998 zcmY+>YfqbX0EY4Z;pqVw>w%V*XDwZ^>xCo(QL}5WEqQVK#Ktfk&SKA zLQ6|o+Z75pnqUtbl&HXrzzif~w3U=-XkrATfJCYx10%el7z37<-nsJo0(W^unfy$( z0HlIoGr*t`gC+tr5}*mA76P?k+(O`61a83;EvD!Qik6`0FjYrTwU}naG!qe%9?L|; zjJM!;D^9TB1S>k`z{eaY(SeWZMT`N&aAL*)W;hYkiJ1eK=|pTdVtX*#joBWQp*h(C(>V<=?;rA$I{0+N%6oIvCx6wDyO z3=~d7;S3T^BjF4b%|VeLiRO^V55*xUUO?gy5--5C5ISlBN*19cj3kRl5{9S3FntN8 zFT;!_n6Zp9mO$1D$XbP2s~~$7X0O2PRge>bIU6u10;C&28iCRcD2;&J=OA|r#>|Vg z1!ETMfP!6EumfWj?t;@%aC#reqCmC}Wl<>G2StbA#ls{2pA^J)^aY?Dv?7Fo4nknk z>D!PA-!p*@T^qDnu@UuI^&KYI*6q-Pc8h(m$ML1Ey?fX=)IEN$r|X*`oB1=x7tTl1 z2KU@_m(TZPC}eXR%)Om`WB1#JL!+Lr!}|WguAtZQ)kXkP2?{~qq!WK{6PpBWn@Zo? zqQ@n~A0DzLZ$3S##h+r@!H0{$r6bsBulDCFklx5nD{cns3cs0MTx!c-hm?fOf=g3Z zU8Snt%*tTZ=Eo0J#|1^2r%!IYZa6M@2}C|uWW3>$TkoD^>1vG+MWwCu_1R52OHyWI z&N}?>urpP|C9I-AJSSb%Bd>m@TuwTu|K)Mw^JJ=-pMPcSsu&yAlBMeT`f8q`YcBuV zuPg6)8WKqvxmLf$rzM_{OPA*Vof@~KzH+<$ubrFaHK}KmZOL_{j3Fw%#f(GVB4(Ph zoe6h66U^1gPu8e~O1b^_vo^uyyM7}p^1WI1nx*QW8!w!*ODpWk3VZtb$9eG39~a&J zqfdT$^p2`$@1lFkiuCcEy$jxwpBa&v+u0Y+DFWQei`uhVN@{aJ`}X@h9If&p5O7@ul3FvtQsfly6vOsFjY|bt?T-Ux|-Tkf_Dv@)V|7RtPVlbj|Jtz p#>H{m{BLg!J zhpE5~gAEH0aPTSx%y78Kc!YzG)k~rv@la#Gf~kAQ`Z=jPg1+A*wRaBAjd;#$Kp%R$qhHDY#FfrG=LkY!$* zlUfZL9Imq@t+it~AjS~M$i%kfDW`+xZ3eciyo?Lm-bHP*VP1eALS*NL=8^EMO#j&*y;R5mpWdXM+ZY##Xka##|>39B6L6EhqKh R%#904Y`l^xX*?VZ)&R(0==A^q literal 0 HcmV?d00001 diff --git a/templates/images/lock.gif b/templates/images/lock.gif new file mode 100644 index 0000000000000000000000000000000000000000..6bd5ef08dd47e77b1e0e27ce28d0da9a7e399466 GIT binary patch literal 1030 zcmZ?wbhEHb6lM@&_|Cvk*Y#i4>;Hzi|7|qS#g+WuzT|&*<$v9<|I^$5A6)nU=%)X< z>Hir_|1)U(m_GCWo|XTXP5JMe{of(!|EcZ&7ccz3Z_|HXhWQau|F^FG&mjLP(eE>l z(|=C8|HpUyH}d*_`M`e$hO|*M8Ulkh1QdU=FfuU6Gw3h?0Vq$fb3A6S=Maf#WN7B$ zuoQS=s zL4kuqQ`nri-AzlS8XRt}NVr_2>mYu}pMmk3-GuDMbqp*v)+P(Qr>|#V6yQlo&}eLE zI8?;1{Gs6^b1NGMU-rE}<&JDT%)Cks2P6%fSa~@tT6P>bkio&hBe7$G)nj%BX^Dy* X2W~qz&)>!#b>~20^N}7#Mh0sDo(bvX literal 0 HcmV?d00001 diff --git a/templates/images/move.gif b/templates/images/move.gif new file mode 100644 index 0000000000000000000000000000000000000000..9fffc7d8f48a1705cb9bf1bebc4c0b9fb6d3cc37 GIT binary patch literal 1030 zcmZ?wbhEHb6lM@&_|CwvZOQ+-uK#ArCpOIeFYoz3uH=7v>3@Tu|I=IkAKmo-z`Fmr z>Hir_|1)U(*t7Eg^qK#cP5JMe{of(!|EcZ&7ccz3Z`1#XsQ+76{}*Cd!XW>N$Lar( z?f*IL{-4|Xe`?SF%Lo25FrodLWX7@ z4oi_61{)S0;NVpXnBnk|@dyVWtCvDSqEl19g1*3n2LXo|yA*=e0t|{07}%skPO%(# z(CEO#Xrp%Ez~<#m^SQWWegrIRJlAhq$yCa)@L(GQdl*ybge#4q%Vgw4CMbMe-mofM zQ9xru=)q8C2^Nb7oC|arHZn2^?0EHHbu>>NyTXc{3mc;um{^{$8YD2VFiTq1ObAF| zczB?N+uN;x;W0ZGuZ_n&n@YzvZf0Jkh66VZnpk_oFidFArbD Y4c`XFbGMjvvmPu^Z1QbqWMr@g0O)b*M*si- literal 0 HcmV?d00001 diff --git a/templates/images/no_av.gif b/templates/images/no_av.gif new file mode 100644 index 0000000000000000000000000000000000000000..93a098c328baa3a468a11e6d53ba49bfd735dec8 GIT binary patch literal 2562 zcmV+d3jOs*Nk%w1VNd{20O$VzHC>HkSXg9PS!G&UW?Ni4WRGE9VrE@qUtnlIWtMDR zWk_U~QDK~EU}iOJk2hdP@ZktAOmRD_?d}5qPbC^nUomy?8c4>ikYIaF=nSE(@N_LuCai2?fn}KS7Q+1n! zX@y&Jn`LjNeQbbKcAQOkomF?8R(PIQd7oZ)pJ#NWT6m>ddZ2)Arc`^Uf^md|ZlQ;6 zoPctRhi#}@d!k)=ty_GfWO=BJaE*p=q+)xcTz#a7bB<|xq+NccWqqYyf2NFbpmlkl zZhEV4d!UDOp^0;*W`3uIcAI2?pi*>1Ve5h`IsAzzxm~@km zb);;7ql$N=jd+t{gQ{tPs$_z&lXsMDfu)vqnrDNgj(DGHf~$*prEY?zae=Fkc&uHA zt!smpOChqkGz4I!=RAEnv%nz zk;SBuzn+rInw7tLpTM4$yN{Z{pp?y{l*gWy$EB6Xq?ov)m(Zq{%9ftLsF=*Dnaz5r z$bzQGho{4(ozJM8)vTP*g{jM>p}&c##eS^Js-D-4sm!3K$)l&kovh4?vdy2f%cQf^ zjlS5JywZ-u)}O!Jn8etp!rHIK*rdtcn$Y5()##ws>964JwBhKr>+rnl@w)K!xAywO z|NYGV{{R2~A^8LW3IP8AEC2ui08ju>000R70RIUbNU)&6g9sBUT*$DY!-o(fN}Ncs zqQ#3CGiuz(v7^V24*BK7w*`ofDO0#`nPNnTj(Pm{f$TUh7&B?zs#Ti?ZQ8PB$$|-Vun|4>Nyogh!YSpi=!+Wa&lQkz+#J-Na2KxGyW4t zEVem!z>ic`X{7)J@X$*yx;P<44^0Y$NGi@fLWqx7rukz4Fx=9M6Hb5`W-w)ram$oy z=9vU7nD`(?nE%j;$RlGEqYR!^1_@-Io3JuWD}egK1tIkbh-Ux+TtLPqu#A#L18V+2 z2|s`elt&mn+(My`2eirME&jUbLJKSkq&Yz(`jjeAF#q^LVFNIX5^Jot+(OH&dZc+k zB)Sr`jxD`tLTs_L+yV&l1@de9Vm(fY@P28fgZQ z#S<}Lkiq8_4Dxrg%?Q#36GvRm!~q5%;JN{@H~x7B6>#vy98ff)>ph-y;(I4;xIjY= zLFAA_42^HFK?R^ozyTkJ5Z*@$^#Dr5@0M8NJ0wiFz(EGeZvZ+35{QrnB!Lvp2lOd~ zJ>w0obdvr2ac|Fr4KA>tzY9#vVaXxuTc739a0n)pVnc9{-~6%{x4Ee)dg>FP9olfY zG^BwEBe>5X7RbT5K|)P{2%!YqkcK&!kc1aJgLK3Z2)WHo5|Z#BBn}Y>HSwW>B(%dE z+F%9?`Y;XtHgE@Nz@Y@Wxlo4a3q%dmbh!$qfrl0}Ll3{e1SX`x1#fFhKa|jk26`|N z=<7owLa3%Tv|$cUOhXTQc)=>VkqM&c%LtBmh$Id!gz8h152a{9Dt_S#SEynWtk8rd zxBwnpDaRbpH$x=`q7NeE!yGK9M>Bk(hi`Oa6PU0BBn)8)K_~-PUSSDG3NC#joWl(- zmpL_3kqKJRE;FAwpaBhHAOjVs00kz<05m_M zgd4ik3@D7^E4#T#a4IthhvL(! zEXC+c!*^8Bb+se?pupuU`2{VIRgj!i=2^*k)s_;~s7Dpw>_8{eju;~d3k4)z3mHyO zrZl4atmt1efC09OudSe)ghx!V1TE~82|e}XLxDPjv=Y^_gJoU?Rx5$oJ-`?qndQVz zH(5o|R+Y5;bZJq;=Q+Wq)~&0>008{q5jmuxq-K5WN@q|}-E!4&gPq-KndjCF6kr@5 zDF+3t5YF53mANcH!CxJ>+rWZvcC7`SYAaBH1A@dJ9~c7hfI3mE{#AKgjV|pfklyLC zcDmYV3l3h<0Tw`Z1}X@z3D&xS{GRu75=gIl{R@EzSRitw!37RPU;*b^*0+O=uyp-f z0rH7p2Qy*^0}=oM=4}82mA$Nfr7K+sJRku=XqGHYF^M}w;Kvb&aD*Q~P>!;cr%dH4DA*I#_x@{%_cpZo++yuGv^2AmNmDoPF>}=-`h$o{X5sb0)xwE+O2(+7_0&L CJt8&$ literal 0 HcmV?d00001 diff --git a/templates/images/td_beam_top.gif b/templates/images/td_beam_top.gif new file mode 100644 index 0000000000000000000000000000000000000000..b322b1f1034f3b561195bea682ca0ad89b13cb89 GIT binary patch literal 139 zcmZ?wbhEHbWMmL#Xc1)Cxnt+<-Mjbh-Meq!z5@pi96WgNFbEtucI?>66DNV-^y$-Q y&z?PZ{@jK0=PzBlboI*B#iRfo1|R_0#lR}Cz(K}ilL`M9i=HNlqXG + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + µForum + + + + diff --git a/templates/images/unlock.gif b/templates/images/unlock.gif new file mode 100644 index 0000000000000000000000000000000000000000..54ff5152f0368e51246879759ae1626f388c5eca GIT binary patch literal 1031 zcmZ?wbhEHb6lM@&_|Cwvf6f28uK(MY{NFJ5zpU5)xRU?VTK-$9pJ^%nuN(IN$fp0f z>Hir_|1)U(m_GCWvMK+4v;R9J{Xez+|Kf%J_ig&m$FLwG>i@2l{~6>z@i_fIvi(1& z-TwsNPexw<&+Ywx`M`e$hO|*M8Ulkh1QdU=FfuU6Gw3h?0Vq$fb39?N=MeE&$iU3Q zVJ>pPV8cQO4qgSH2@V$-T{!qy-4qxcnwt6*^aVN|7&tL?DcDQ>;7E9KfI&K_$;RRH zVg@!o79oxYhN?}>Tzmx#3=15Z_(i0?uy8h{U1oNXH@P67!062&x+#sd!0|vUH@}&M zhJYhu;F>7yn%LhB4vd>z_Agtjupsa5Hb$m`80+in8W`CMvN9fQe}A8mUm)Sb2Sukw z#?t3}GkA6|ALAF6l2~wN=B7qg2|XT@j0cYCN9Ie56mS$aHeTY7Q{J$^>Tx@Rq(sSv Y1G|}<=Wb( +
    + TPL['topic_info']['forum_locked'] == false && $this->TPL['topic_info']['topic_locked'] == false) { ?> + +
    + Reply +
    +
    + +
    + Locked +
    + +
    + +TPL['posts_list']); $i++) + { + echo ' +
    +
    +
     
    +
     
    +
    Post #'.($i+1).'
    +
    +
    +
    '; + if ($this->TPL['posts_list'][$i]['nick'] != null) + echo ''.$this->colorRank($this->TPL['posts_list'][$i]['nick'], $this->TPL['posts_list'][$i]['user_rank']).''; + else + echo 'Anonymous'; + echo '
    '; + + if ($this->TPL['posts_list'][$i]['avatar'] != null) + echo 'user avatar'; + else + echo 'user avatar'; + echo ' +
    +
    '; + + echo BBCode($this->TPL['posts_list'][$i]['content']); + + if ($this->TPL['posts_list'][$i]['signature'] != null) + echo ' +

    +
    + '.BBCode($this->TPL['posts_list'][$i]['signature']).'

    '; + echo ' +
    +
    + Posted: '.$this->TPL['posts_list'][$i]['date'].'
    + +
    + Quote +
    +
    '; + if ($this->TPL['my_id'] == $this->TPL['posts_list'][$i]['user_id']) + echo ' + +
    + Edit +
    +
    '; + + echo '
    '; + + if ($this->TPL['my_rank'] >= RANK_MOD) + echo ' +
    + Mod options
    + +
    + Edit +
    +
    + +
    + X +
    +
    +
    '; + echo ' +
    +
    + +
    +
    + Status: user status +
    +
    +
    +
    + Posts: '.$this->TPL['posts_list'][$i]['user_post_count'].' +
    +
    + Joined: '.$this->TPL['posts_list'][$i]['regdate'].' +
    +
    + Last visit: '.(($this->TPL['posts_list'][$i]['lastvisit']!= null) ? $this->TPL['posts_list'][$i]['lastvisit'] : 'Never').' +
    +
    +
    +
    Rank: '.$this->getRankLevel($this->TPL['posts_list'][$i]['user_rank']).'
    +
    +
    +
    '; + } + ?> + + TPL['topic_info']['forum_locked'] == false && $this->TPL['topic_info']['topic_locked'] == false) { ?> + +
    + Reply +
    +
    + +
    + Locked +
    + + + TPL['my_rank'] >= RANK_MOD) { ?> +
    +
    +
    Actions
    +
    +
    + +
    +
    + +
     
    +
    + + \ No newline at end of file diff --git a/templates/login_form.tpl.php b/templates/login_form.tpl.php new file mode 100755 index 0000000..d386f32 --- /dev/null +++ b/templates/login_form.tpl.php @@ -0,0 +1,54 @@ + +
    + + +

    You must enable cookies if you want log in

    + TPL['error_msg'] != '') { ?> +
    + TPL['error_msg']; ?> +
    + +
    +
    +
    +
    Log in
    +
     
    +
    + +
    +
    + Nick: +
    +
    + +
    +
    +
    +
    + Password: +
    +
    + +
    +
    +
    +
    +   +
    +
    + +
    +
    +
    +
    + + \ No newline at end of file diff --git a/templates/main.css b/templates/main.css new file mode 100644 index 0000000..719f561 --- /dev/null +++ b/templates/main.css @@ -0,0 +1,81 @@ +#container { + background-color: #CEE3F6; + border: 2px solid navy; +} + +a:hover { + color: navy; +} + +#container #top { + background-color: #CEE3F6; + height: 140px; +} + +#container #top h1 { + top: 30%; + color: navy; +} + +#container #footer { + background-color: navy; +} + +#container #menu { + background-image: url('images/button_beam.gif'); +} + +.navigation { + color: navy; +} + +.row:last-child .tc1, .row:last-child .tc2, .row:last-child .tc3, .row:last-child .tc4 { + border-bottom: 1px solid #040074; +} + +.rcol { + border: 1px solid #040074; +} + +.tc1 { + border-left: 1px solid #040074; +} + +.tc4 { + border-right: 1px solid #040074; +} + +.hc1, .hc2, .hc3, .hc4 { + background-image: url('images/category_beam.gif'); + border-top: 1px solid #040074; +} + +.hc1 { + border-left: 1px solid #040074; +} + +.hc4 { + border-right: 1px solid #040074; +} + +.tab_desc { + color: blue; +} + +input[type="button"], input[type="reset"], input[type="submit"] { + background-color: #C7E2FB; + border: 1px solid #AACAE8; + color: #204E7A; +} + +input[type="button"]:hover, input[type="reset"]:hover, input[type="submit"]:hover { + background-color: #e3effb; +} + +.btn { + background-image: url('images/button_beam.gif'); +} + +.btn_small { + background-image: url('images/button_beam.gif'); +} \ No newline at end of file diff --git a/templates/main.tpl.php b/templates/main.tpl.php new file mode 100755 index 0000000..0ff4744 --- /dev/null +++ b/templates/main.tpl.php @@ -0,0 +1,123 @@ + + +
    + + TPL['forums_list']); $i++) + { + if ($this->TPL['forums_list'][$i]['forum_id'] != null) + { + if ($i > 0) + { + if ($this->TPL['forums_list'][$i-1]['category_id'] != $this->TPL['forums_list'][$i]['category_id']) + echo '

    +
    +
    '.$this->TPL['forums_list'][$i]['category_name'].'
    +
     
    +
     
    +
     
    +
    +
    +
    Forum name
    +
    Topics
    +
    Posts
    +
    Last Post
    +
    '; + } + else + { + echo '
    +
    +
    '.$this->TPL['forums_list'][$i]['category_name'].'
    +
     
    +
     
    +
     
    +
    +
    +
    Forum name
    +
    Topics
    +
    Posts
    +
    Last Post
    +
    '; + } + echo '
    '."\n"; + echo "\t\t\t".'
    '.$this->TPL['forums_list'][$i]['forum_name'].'
    '.$this->TPL['forums_list'][$i]['forum_desc'].'
    '."\n"; + echo "\t\t\t".'
    '.$this->TPL['forums_list'][$i]['topic_count'].'
    '."\n"; + echo "\t\t\t".'
    '.$this->TPL['forums_list'][$i]['post_count'].'
    '."\n"; + + if ($this->TPL['forums_list'][$i]['lastpost_post_id'] != null) + { + $lastpost = ''.$this->TPL['forums_list'][$i]['lastpost_date'].'
    Topic #'.$this->TPL['forums_list'][$i]['lastpost_topic_id'].': '; + if ($this->TPL['forums_list'][$i]['lastpost_user_id'] != null) + $lastpost .= ''.$this->colorRank($this->TPL['forums_list'][$i]['lastpost_nick'], $this->TPL['forums_list'][$i]['lastpost_user_rank']).''; + else + $lastpost .= 'Anonymous'; + $lastpost .= '
    '; + } + else + { + $lastpost = 'No posts'; + } + + echo "\t\t\t".'
    '.$lastpost.'
    '."\n"; + echo "\t\t".'
    '."\n"; + + $items++; + } + } + + if ($items > 0) + echo '
    '; + else + { + echo '
    +
    +
    Forum message
    +
    +
    +
    No forums
    +
    +
    '; + } + ?> + +
    +
    +
    +
    Statistics
    +
    +
    +
    + Our users have written TPL['posts_count']; ?> posts.
    + We have TPL['users_count']; ?> unique users.
    + Last registered user: TPL['last_user']['nick']; ?>
    + Users ranks: AdminMod • User
    + This forum is browsing by TPL['logged_users_count']; ?> logged users(list):
    + TPL['logged_users_count'] == 0) echo 'none.'; + else + for ($i=0; $iTPL['logged_users']); $i++) + { + echo ''.$this->colorRank($this->TPL['logged_users'][$i]['nick'], $this->TPL['logged_users'][$i]['rank']).''; + + if ($iTPL['logged_users'])-1) + echo ', '; + } + + + ?> +
    +
    +
    +
    + + \ No newline at end of file diff --git a/templates/move_topic.tpl.php b/templates/move_topic.tpl.php new file mode 100755 index 0000000..f3dca35 --- /dev/null +++ b/templates/move_topic.tpl.php @@ -0,0 +1,67 @@ + + +
    +
    +
    +
    +
    +
    Move topic to another forum
    +
     
    +
    + +
    +
    + Topic title: +
    +
    + TPL['topic_info']['topic_title']; ?> +
    + + +
    + +
    +
    + Topic is in forum: +
    +
    + TPL['topic_info']['forum_name']; ?> +
    + + +
    + +
    +
    + Select a new forum: +
    +
    + +
    + + +
    +
    +
    +   +
    +
    + + + +
    + +
    +
    +
    +
    + + \ No newline at end of file diff --git a/templates/overall_footer.tpl.php b/templates/overall_footer.tpl.php new file mode 100644 index 0000000..f48035a --- /dev/null +++ b/templates/overall_footer.tpl.php @@ -0,0 +1,6 @@ + +
    + + \ No newline at end of file diff --git a/templates/overall_header.tpl.php b/templates/overall_header.tpl.php new file mode 100644 index 0000000..dc704bf --- /dev/null +++ b/templates/overall_header.tpl.php @@ -0,0 +1,56 @@ + + + +<?= $this->TPL['meta_title']; ?> + + + + + + + +
    +
    +
    µF logo
    +
    +

    TPL['forum_name']; ?>

    +

    TPL['forum_desc']; ?>

    +
    +
    + +
    +
    + TPL['is_logged']) { ?> + You are logged as: TPL['my_nick'] ?> + + Welcome Guest! You are not logged. +
    + Actual time: TPL['actual_time']; ?>
    + TPL['my_rank'] == RANK_ADMIN ) { ?> + Go to ACP » + +
    +
    + \ No newline at end of file diff --git a/templates/posting.tpl.php b/templates/posting.tpl.php new file mode 100755 index 0000000..bb6130a --- /dev/null +++ b/templates/posting.tpl.php @@ -0,0 +1,126 @@ + + +
    + TPL['error_msg'] != '') { ?> +
    + TPL['error_msg']; ?> +
    + + + TPL['preview'])) { ?> +
    +
    +
    Post preview
    +
    + +
    +
    + TPL['preview']); ?> +
    +
    +
    +
    + + + +
    + TPL['topic'])) { ?> +
    +
    +
    Topic information
    +
     
    +
    + +
    +
    + Title: +
    +
    + +
    +
    +
    +
    + + +
    +
    +
    Post information
    +
     
    +
    + +
    +
    + Emoticons: +
    +
    +

    + Turn on JavaScript to enable BBCode and emoticons buttons. +

    + +
    +
    +
    +
    + +
    +
    + +
    +
    +
    +
    +   +
    +
    + + + +
    +
    +
    + +
    +
    + + \ No newline at end of file diff --git a/templates/register_form.tpl.php b/templates/register_form.tpl.php new file mode 100755 index 0000000..b42d338 --- /dev/null +++ b/templates/register_form.tpl.php @@ -0,0 +1,83 @@ + + + + +
    + TPL['error_msg'] != '') { ?> +
    + TPL['error_msg']; ?> +
    + +
    +
    +
    +
    Register
    +
     
    +
    + +
    +
    + Nick: +
    +
    + + + +
    +
    +
    +
    + Password: +
    +
    + +
    +
    +
    +
    + Confirm password: +
    +
    + +
    +
    +
    +
    + Email address: +
    +
    + +
    +
    + +
    +
    +   +
    +
    + +
    +
    +
    +
    + + \ No newline at end of file diff --git a/templates/scripts/chkcookie.js b/templates/scripts/chkcookie.js new file mode 100644 index 0000000..73d588a --- /dev/null +++ b/templates/scripts/chkcookie.js @@ -0,0 +1,33 @@ +function create_cookie(name, value, days) +{ + if (days) + { + var date = new Date(); + date.setTime(date.getTime()+(days*24*3600*1000)); + + var expires ="; expires="+date.toGMTString(); + } + else + var expires = ""; + + document.cookie += name+"="+value+expires+"; path=/"; +} + +function read_cookie(name) +{ + var nameEQ = name + "="; + var ca = document.cookie.split(';'); + for (var i=0; i< ca.length; i++) + { + var c = ca[i]; + while (c.charAt(0) == ' ') c = c.substring(1, c.length); + if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length); + } + + return null; +} + +function erase_cookie(name) +{ + create_cookie(name, "", -1); +} \ No newline at end of file diff --git a/templates/scripts/nick.js b/templates/scripts/nick.js new file mode 100644 index 0000000..2263afd --- /dev/null +++ b/templates/scripts/nick.js @@ -0,0 +1,62 @@ +var ajax; + +function init() { + initAjax(); +} + +function initAjax() { + try + { + ajax = new XMLHttpRequest(); + } + catch(e) // IE <= 6 + { + var XmlHttpVersions = [ + 'MSXML2.XMLHTTP.6.0', + 'MSXML2.XMLHTTP.5.0', + 'MSXML2.XMLHTTP.4.0', + 'MSXML2.XMLHTTP.3.0', + 'MSXML2.XMLHTTP', + 'Microsoft.XMLHTTP' + ]; + for (var i=0; i < XmlHttpVersions.length && null === ajax; i++) + { + try + { + ajax = new ActiveXObject(XmlHttpVersions[i]); + } catch (e) {} + } + + if (null === ajax) + { + throw new Error('AJAX Error'); + } + } + + return true; +} + +function response() { + if (ajax.readyState != 4 || ajax.status != 200) + return; + if (ajax.responseText == 'true') + { + document.getElementById('nick-inuse').style.display = 'inline'; + document.getElementById('nick-free').style.display = 'none'; + } + else + { + document.getElementById('nick-inuse').style.display = 'none'; + document.getElementById('nick-free').style.display = 'inline'; + } +} + +function checkNick() { + if (ajax == null) + init(); + if (document.getElementById('nick').value == '') return 0; + ajax.onreadystatechange = response; + ajax.open('GET', 'index.php?mode=checknick&nick=' + document.getElementById('nick').value); + + ajax.send(null); +} \ No newline at end of file diff --git a/templates/scripts/posting.js b/templates/scripts/posting.js new file mode 100644 index 0000000..be3b26b --- /dev/null +++ b/templates/scripts/posting.js @@ -0,0 +1,70 @@ +var bbcode = ['[b]', '[/b]', '[i]', '[/i]', '[u]', '[/u]', '[s]', '[/s]', '[url]', '[/url]', '[center]', '[/center]', '[quote]', '[/quote]', '[code]', '[/code]']; + +function insertTag(first, second) +{ + postArea = document.getElementById('post'); + if (document.selection) // IE + { + postArea.focus(); + sel = document.selection.createRange(); + sel.text = first + sel.text + second; + } + else if (postArea.selectionStart || postArea.selectionStart == '0') + { + var startPos = postArea.selectionStart; + var endPos = postArea.selectionEnd; + if (startPos == endPos) + { + if (first == bbcode[8]) + { + var link = prompt('Type hyperlink address', 'http://'); + if (startPos != 0) + { + postArea.value = postArea.value.substring(0, startPos) + '[url=' + link + '] ' + postArea.value.substring(startPos, endPos) + second + postArea.value.substring(endPos, postArea.value.length); + } + else + { + postArea.value += '[url=' + link + '][/url]'; + } + } + else + { + postArea.value += ' ' + first + second; + } + } + else + { + postArea.value = postArea.value.substring(0, startPos) + first + postArea.value.substring(startPos, endPos) + second + postArea.value.substring(endPos, postArea.value.length); + } + } + else + { + postArea.value += ' ' + first + second; + } +} + +function bbTag(item) +{ + if(item < bbcode.length -1) + { + insertTag(bbcode[item], bbcode[item+1]); + } + else + { + switch(item) + { + case 16: + var firstItem = prompt('Type first item list'); + document.getElementById('post').value += "[list]\n[*]"+firstItem+"\n[/list]"; + break; + case 18: + var color = document.getElementById('text_color').value;//prompt('Type font color', 'black'); + insertTag('[color='+color+']', '[/color]'); + } + } +} + +function insertSmile(smile) +{ + document.getElementById('post').value += ' ' + smile; +} \ No newline at end of file diff --git a/templates/styles.css b/templates/styles.css new file mode 100644 index 0000000..4b82569 --- /dev/null +++ b/templates/styles.css @@ -0,0 +1,415 @@ +body { + font-family: Helvetica; + font-size: 11pt; + background-color: #E5E7E9; +} + +#container { + width: 900px; + margin: 0 auto; + text-align: center; + border-collapse: collapse; + border-radius: 10px; +} + +a, a:visited { + text-decoration: none; +} + +img { + border: 0px; +} + +a:hover { + text-decoration: underline; +} + +a { + color: #000000; +} + +#container #top { + width: 100%; + vertical-align: middle; + padding-top: 20px; + border-bottom: 1px solid #777777; + border-top-left-radius: 10px; + border-top-right-radius: 10px; +} + +#container #userpanel { + text-align: right; + font-size: 0.8em; + width: 100%; +} + +#container #navi_bar { + padding-left: 10px; + text-align: left; + width: 98%; + word-wrap: break-word; + max-width: 98%; +} + +#container #top h1 { + margin: 0px; + position: relative; + font-size: 36pt; + font-weight: bold; +} + +#container #top h2 { + color: #005AE5; + font-size: 20px; + text-decoration: none; + font-weight: bold; +} + +#container #footer { + width: 100%; + font-size: 8pt; + color: #FFFFFF; + height: 18px; + line-height: 18px; + border-bottom-left-radius: 5px; + border-bottom-right-radius: 5px; + box-shadow: 0 8px 6px -6px black; +} + +#container #footer a { + color: #FFFFFF; +} + +#contanier #footer a:visited { + color: #FFFFFF; +} + +#container #content { + text-align: left; + min-height: 200px; + padding: 10px; +} + +#container #content h3 { + margin-left: 20px; + color: gray; + font-size: 1.5em; +} + +#container #menu { + text-align: center; + margin: 0 auto; + width: 100%; + height: 50px; + background-color: #99CCFF; +} + +#container #menu ul { + list-style-type: none; + margin: 0px; + padding: 0px; +} + +#container #menu li { + display: inline-block; + border-right: 1px #9A9A9A solid; + height: 37px; + width: 120px; + padding-top: 13px; + margin: auto -4px auto auto; + +} + +#container #menu li a { + color: #FFFFFF; + font-weight: bold; + font-family: Verdana; + font-size: 14px; + font-weight: bold; +} + +#container #menu li:last-child { + border: 0px; +} + +.sect { + color: #434354; + font-family: Verdana; + font-size: 10pt; + font-weight: bold; + text-decoration: none; +} + +.navigation { + text-decoration: none; + font-size: 12px; + font-weight: bold; +} + +.forum_table { + display: table; + width: 100%; + border-collapse: separate; + box-shadow: 0 8px 6px -6px black; +} + +.fsmall { + color: #434354; + font-size: 8pt; + text-decoration: none; +} + +.row { + display: table-row; + width: 100%; +} + +.rcol { + display: table-caption; + border-collapse: collapse; + background-color: #e1f0ff; + padding: 3px; + vertical-align: middle; + border-top: 0px; + caption-side: bottom; + text-align: center; + font-style: italic; +} + +.tc1, .tc2, .tc3, .tc4 { + display: table-cell; + background-color: #F0F8FF; + padding: 3px; + vertical-align: middle; + word-wrap: break-word; +} + +.tc1 { + max-width: 150px; +} + +.tc2, .tc3 { + vertical-align: middle; + text-align: center; + max-width: 150px; +} + +.tc4 { + text-align: center; + vertical-align: middle; + width: 150px; + max-width: 150px; +} + +.hc1, .hc2, .hc3, .hc4 { + color: #FFFFFF; + font-weight: bold; + background-color: yellow; + vertical-align: middle; + display: table-cell; + padding-left: 15px; + height: 30px; + word-wrap: break-word; +} + +.hc1 { + border-top-left-radius: 10px; + max-width: 150px; +} + +.hc4 { + border-top-right-radius: 10px; + width: 150px; +} + +.tab_desc { + text-align: center; + font-weight: bold; + background-image: url('images/td_beam_top.gif'); + height: 19px; + +} + +.lc { + width: 30%; + text-align: right; + margin-right: 10px; + +} + +.rc { + width: 70%; + text-align: left; + margin-left: 10px; +} + +.rc input[type="text"], input[type="password"], input[type="email"] { + width: 200px; +} + +input[type="button"], input[type="reset"], input[type="submit"] { + border-radius: 5px; + padding: 5px; + min-width: 30px; + font-size: 12px; + cursor: pointer; +} + +#signature { + width: 490px; + height: 60px; + resize: vertical; +} + +#post { + width: 490px; + height: 180px; + resize: vertical; +} + +#signature, #post, input[type="text"], input[type="password"], input[type="email"], select { + border-radius: 5px; + border: 1px solid #C7E2FB; + min-height: 20px; + font-size: 12px; + background-color: #FFFFE8; +} + +.error_form { + margin: 0 auto; + text-align: center; + width: 90%; + border: 1px solid #FF0000; + background-color: #FFCC99; + padding: 10px; + color: #FF0000; + border-radius: 10px; + font-weight: bold; +} + +.fadmin, .fmod { + font-weight: bold; +} +.fmod { + color: darkgreen; +} + +.fadmin { + color: orange; +} + +.btn { + display: block; + width: 90px; + height: 30px; + color: #FFFFFF; + font-weight: bold; + text-align: center; + font-size: 1em; + border-radius: 10px; + line-height: 30px; + box-shadow: 0 8px 6px -6px black; +} + +.btn:hover, .btn_small:hover { + color: #FFFFFF; +} +.btn_small { + display: block; + width: 60px; + height: 20px; + color: #FFFFFF; + font-weight: bold; + text-align: center; + font-size: 0.8em; + border-radius: 10px; + margin: 0 auto; + line-height: 20px; + margin-bottom: 5px; + box-shadow: 0 8px 6px -6px black; +} + +.ut { + padding: 0px; + border-left: 0px; +} + +.tc2 .forum_table .tc1, .tc2 .forum_table .tc2, .tc2 .forum_table .tc3 { + border-bottom: 0px !important; + border-top: 1px solid lightgray; + +} + +.mod_pool { + margin: 0 auto; + width: 90%; + background-color: #FFFF99; + text-align: center; + padding: 5px; + border: 1px solid orange; + border-radius: 10px; +} + +hr { + border: 0; + border-bottom: 1px dashed #ccc; + background: #999; + width: 50%; + margin: 0; + margin-top: 5px; +} + +.hcpost { + height: 10px; +} + +.f_hc4 { + text-align: right; + padding-right: 10px; +} + +.post_3c { + width: 120px; +} + +.f_tc2 { + width: 120px; + vertical-align: top; + height: 150px; + text-align: center; +} + +.topic_mod { + width: 80px; + float: right; +} +.p_uinfo { + width: 38%; +} + +.post_content { + vertical-align: top; + position: relative; + text-align: left; + max-width: 500px; +} + +.row .hcpost a { + color: #FFFFFF; +} + +.qpost { + background-color: #DDDAC5; + width: 95%; + font-style: italic; + box-shadow: 7px 8px 6px -3px gray; + padding: 5px; +} + +.cpost { + background-color: #C5DDCC; + width: 95%; + font-family: Courier New; + box-shadow: 7px 8px 6px -3px gray; + padding: 5px; +} \ No newline at end of file diff --git a/templates/userlist.tpl.php b/templates/userlist.tpl.php new file mode 100755 index 0000000..3edefd5 --- /dev/null +++ b/templates/userlist.tpl.php @@ -0,0 +1,65 @@ + +
    +
    +
    +
    +
    Users list
    +
     
    +
     
    +
     
    +
    +
    +
    Username
    +
    Joined
    +
    Last visit
    +
    Posts
    +
    + TPL['users_list']); $i++) + { + echo '
    '."\n"; + echo "\t\t\t".''."\n"; + echo "\t\t\t".'
    '.$this->TPL['users_list'][$i]['regdate'].'
    '."\n"; + echo "\t\t\t".'
    '.(($this->TPL['users_list'][$i]['lastvisit']!= null) ? $this->TPL['users_list'][$i]['lastvisit'] : 'Never').'
    '."\n"; + echo "\t\t\t".'
    '.$this->TPL['users_list'][$i]['post_count'].'
    '."\n"; + echo "\t\t".'
    '."\n"; + } + ?> + + +
    +
    +
    +
    +
    Options
    +
    +
    +
    +
    + Sort users by: + +     + TPL['desc_checked']; ?> />Descending +        +
    +
    +
    + +
    +
    + + \ No newline at end of file diff --git a/templates/viewforum.tpl.php b/templates/viewforum.tpl.php new file mode 100755 index 0000000..99a136d --- /dev/null +++ b/templates/viewforum.tpl.php @@ -0,0 +1,74 @@ + +
    + TPL['forum_info']['locked'] == false) { ?> + New Topic + +
    + Locked +
    + +
    +
    +
    +
    TPL['f_name']; ?>
    +
     
    +
     
    +
     
    +
    +
    +
    Topic name
    +
    Author
    +
    Replies
    +
    Last Post
    +
    + TPL['topics_list']); $i++) + { + echo '
    '."\n"; + echo "\t\t\t".''."\n"; + echo "\t\t\t".'
    '; + if ($this->TPL['topics_list'][$i]['user_id'] != null) + echo ''.$this->colorRank($this->TPL['topics_list'][$i]['user_nick'], $this->TPL['topics_list'][$i]['user_rank']).''; + else + echo 'Anonymous'; + echo '
    '."\n"; + echo "\t\t\t".'
    '.($this->TPL['topics_list'][$i]['post_count']-1).'
    '."\n"; + + if ($this->TPL['topics_list'][$i]['lastpost_post_id'] != null) + { + $lastpost = ' '.$this->TPL['topics_list'][$i]['lastpost_date'].'
    Post #'.$this->TPL['topics_list'][$i]['lastpost_post_id'].': '; + if ($this->TPL['topics_list'][$i]['lastpost_user_id'] != null) + $lastpost .= ''.$this->colorRank($this->TPL['topics_list'][$i]['lastpost_user_nick'], $this->TPL['topics_list'][$i]['lastpost_user_rank']).''; + else + $lastpost .= 'Anonymous'; + $lastpost .= '
    '; + } + else + { + $lastpost = 'No posts.'; + } + + echo "\t\t\t".'
    '.$lastpost.'
    '."\n"; + echo "\t\t".'
    '."\n"; + } + ?> + + + TPL['topics_list']) == 0) + { + echo '
    No topics in this forum.
    '; + } + ?> +
    +
    + TPL['forum_info']['locked'] == false) { ?> + New Topic + +
    + Locked +
    + +
    + + \ No newline at end of file diff --git a/templates/viewprofile.tpl.php b/templates/viewprofile.tpl.php new file mode 100755 index 0000000..f182b6b --- /dev/null +++ b/templates/viewprofile.tpl.php @@ -0,0 +1,65 @@ + + +
    +
    +
    +
    +
    TPL['user_info']['nick']; ?>
    +
    + TPL['logged_id']) {?> + Edit my profile » +   +
    +
    + +
    +
    + TPL['user_info']['avatar'] != null) + echo 'user avatar'; + else + echo 'user avatar'; + ?> +
    +
    + +Joined: TPL['user_info']['regdate']; ?>
    +Last visit: TPL['user_info']['lastvisit']!= null) ? $this->TPL['user_info']['lastvisit'] : 'Never') ?>
    +Posts: TPL['user_info']['post_count']; ?>; TPL['post_ratio']; ?>% of total.
    +Location: TPL['user_info']['location']; ?>
    +
    +
    +
    +
    + Email +
    +
    + Status: user status
    + Rank: getRankLevel($this->TPL['user_info']['rank']); ?> +
    +
    + + + +
    +
    + TPL['user_info']['signature'] != null) { ?> +
    +
    +
    TPL['user_info']['nick']; ?>'s signature
    +
    + +
    +
    + TPL['user_info']['signature']); ?> +
    +
    +
    + + + + + +
    + + \ No newline at end of file diff --git a/templates/viewtopic.tpl.php b/templates/viewtopic.tpl.php new file mode 100755 index 0000000..80cc530 --- /dev/null +++ b/templates/viewtopic.tpl.php @@ -0,0 +1,127 @@ + +
    + TPL['topic_info']['forum_locked'] == false && $this->TPL['topic_info']['topic_locked'] == false) { ?> + Reply + +
    + Locked +
    + +
    + +TPL['posts_list']); $i++) + { + echo ' +
    +
    +
     
    +
     
    +
    Post #'.($i+1).'
    +
    + +
    +
    '; + if ($this->TPL['posts_list'][$i]['nick'] != null) + echo ''.$this->colorRank($this->TPL['posts_list'][$i]['nick'], $this->TPL['posts_list'][$i]['user_rank']).''; + else + echo 'Anonymous'; + echo '
    '; + + if ($this->TPL['posts_list'][$i]['avatar'] != null) + echo 'user avatar'; + else + echo 'user avatar'; + echo ' +
    +
    '; + echo BBCode($this->TPL['posts_list'][$i]['content']); + + if ($this->TPL['posts_list'][$i]['signature'] != null) + echo ' +

    +
    + '.BBCode($this->TPL['posts_list'][$i]['signature']).'

    '; + + echo ' +
    +
    + Posted: '.$this->TPL['posts_list'][$i]['date'].'
    + Quote'; + if ($this->TPL['my_id'] == $this->TPL['posts_list'][$i]['user_id'] && $this->TPL['posts_list'][$i]['user_id'] != null) + echo ' + Edit'; + + echo '
    '; + + if ($this->TPL['my_rank'] >= RANK_MOD) + { + echo ' +
    + Mod options

    + Edit'; + if ($this->TPL['topic_info']['post_count'] > 1) + echo ' + X'; + echo '
    '; + } + echo ' +
    +
    + +
    +
    + Status: user status +
    +
    +
    +
    + Posts: '.(($this->TPL['posts_list'][$i]['user_post_count']!== null) ? $this->TPL['posts_list'][$i]['user_post_count'] : '0').' +
    +
    + Joined: '.(($this->TPL['posts_list'][$i]['regdate']!= null) ? $this->TPL['posts_list'][$i]['regdate'] : 'Never').' +
    +
    + Last visit: '.(($this->TPL['posts_list'][$i]['lastvisit']!= null) ? $this->TPL['posts_list'][$i]['lastvisit'] : 'Never').' +
    +
    +
    +
    Rank: '.$this->getRankLevel($this->TPL['posts_list'][$i]['user_rank']).'
    +
    +
    +
    '; + } + ?> + + TPL['topic_info']['forum_locked'] == false && $this->TPL['topic_info']['topic_locked'] == false) { ?> + Reply + +
    + Locked +
    + + + TPL['my_rank'] >= RANK_MOD) { ?> +
    +
    +
    Actions
    +
    +
    + +
    +
    + +
     
    +
    + + \ No newline at end of file