| 1 | <?php |
|---|
| 2 | // $Id: forumform.inc.php,v 1.5 2005/09/04 20:46:10 onokazu Exp $ |
|---|
| 3 | // ------------------------------------------------------------------------ // |
|---|
| 4 | // XOOPS - PHP Content Management System // |
|---|
| 5 | // Copyright (c) 2000 XOOPS.org // |
|---|
| 6 | // <http://www.xoops.org/> // |
|---|
| 7 | // ------------------------------------------------------------------------ // |
|---|
| 8 | // This program is free software; you can redistribute it and/or modify // |
|---|
| 9 | // it under the terms of the GNU General Public License as published by // |
|---|
| 10 | // the Free Software Foundation; either version 2 of the License, or // |
|---|
| 11 | // (at your option) any later version. // |
|---|
| 12 | // // |
|---|
| 13 | // You may not change or alter any portion of this comment or credits // |
|---|
| 14 | // of supporting developers from this source code or any supporting // |
|---|
| 15 | // source code which is considered copyrighted (c) material of the // |
|---|
| 16 | // original comment or credit authors. // |
|---|
| 17 | // // |
|---|
| 18 | // This program is distributed in the hope that it will be useful, // |
|---|
| 19 | // but WITHOUT ANY WARRANTY; without even the implied warranty of // |
|---|
| 20 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // |
|---|
| 21 | // GNU General Public License for more details. // |
|---|
| 22 | // // |
|---|
| 23 | // You should have received a copy of the GNU General Public License // |
|---|
| 24 | // along with this program; if not, write to the Free Software // |
|---|
| 25 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // |
|---|
| 26 | // ------------------------------------------------------------------------ // |
|---|
| 27 | // Author: Kazumi Ono (AKA onokazu) // |
|---|
| 28 | // URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ // |
|---|
| 29 | // Project: The XOOPS Project // |
|---|
| 30 | // ------------------------------------------------------------------------- // |
|---|
| 31 | |
|---|
| 32 | if (!defined('XOOPS_ROOT_PATH')) { |
|---|
| 33 | exit(); |
|---|
| 34 | } |
|---|
| 35 | include_once XOOPS_ROOT_PATH."/class/xoopslists.php"; |
|---|
| 36 | include_once XOOPS_ROOT_PATH."/include/xoopscodes.php"; |
|---|
| 37 | |
|---|
| 38 | $token=&XoopsMultiTokenHandler::quickCreate('newbb_post'); |
|---|
| 39 | |
|---|
| 40 | echo "<form action='post.php' method='post' name='forumform' id='forumform' onsubmit='return xoopsValidate(\"subject\", \"message\", \"contents_submit\", \"".htmlspecialchars(_PLZCOMPLETE, ENT_QUOTES)."\", \"".htmlspecialchars(_MESSAGETOOLONG, ENT_QUOTES)."\", \"".htmlspecialchars(_ALLOWEDCHAR, ENT_QUOTES)."\", \"".htmlspecialchars(_CURRCHAR, ENT_QUOTES)."\");'><table cellspacing='1' class='outer' width='100%'><tr><td class='head' width='25%' valign='top'>". _MD_ABOUTPOST .":</td>"; |
|---|
| 41 | echo $token->getHtml(); |
|---|
| 42 | |
|---|
| 43 | if ( $forumdata['forum_type'] == 1 ) { |
|---|
| 44 | echo "<td class='even'>". _MD_PRIVATE ."</td>"; |
|---|
| 45 | } elseif ( $forumdata['forum_access'] == 1 ) { |
|---|
| 46 | echo "<td class='even'>". _MD_REGCANPOST ."</td>"; |
|---|
| 47 | } elseif ( $forumdata['forum_access'] == 2 ) { |
|---|
| 48 | echo "<td class='even'>". _MD_ANONCANPOST ."</td>"; |
|---|
| 49 | } elseif ( $forumdata['forum_access'] == 3 ) { |
|---|
| 50 | echo "<td class='even'>". _MD_MODSCANPOST ."</td>"; |
|---|
| 51 | } |
|---|
| 52 | |
|---|
| 53 | echo "</tr> |
|---|
| 54 | <tr> |
|---|
| 55 | <td class='head' valign='top' nowrap='nowrap'>". _MD_SUBJECTC ."</td> |
|---|
| 56 | <td class='odd'>"; |
|---|
| 57 | |
|---|
| 58 | echo "<input type='text' id='subject' name='subject' size='60' maxlength='100' value='$subject' /></td></tr> |
|---|
| 59 | <tr> |
|---|
| 60 | <td class='head' valign='top' nowrap='nowrap'>". _MD_RESPONSE ."</td> |
|---|
| 61 | <td class='even'> |
|---|
| 62 | "; |
|---|
| 63 | |
|---|
| 64 | // Âбþ¾õ¶· |
|---|
| 65 | echo " <select name='response'>"; |
|---|
| 66 | echo "<option value=''>ÁªÂò¤Ê¤·</option>"; |
|---|
| 67 | foreach ($arrResponse as $key => $val){ |
|---|
| 68 | echo "<option value='" . $key . "' >" . $val . "</option>"; |
|---|
| 69 | } |
|---|
| 70 | |
|---|
| 71 | echo "</select></td></tr> |
|---|
| 72 | <tr> |
|---|
| 73 | <td class='head' valign='top' nowrap='nowrap'>". _MD_MESSAGEICON ."</td> |
|---|
| 74 | <td class='odd'> |
|---|
| 75 | "; |
|---|
| 76 | |
|---|
| 77 | |
|---|
| 78 | $lists = new XoopsLists; |
|---|
| 79 | $filelist = $lists->getSubjectsList(); |
|---|
| 80 | $count = 1; |
|---|
| 81 | while ( list($key, $file) = each($filelist) ) { |
|---|
| 82 | $checked = ""; |
|---|
| 83 | if ( isset($icon) && $file==$icon ) { |
|---|
| 84 | $checked = " checked='checked'"; |
|---|
| 85 | } |
|---|
| 86 | echo "<input type='radio' value='$file' name='icon'$checked /> "; |
|---|
| 87 | echo "<img src='".XOOPS_URL."/images/subject/$file' alt='' /> "; |
|---|
| 88 | if ( $count == 8 ) { |
|---|
| 89 | echo "<br />"; |
|---|
| 90 | $count = 0; |
|---|
| 91 | } |
|---|
| 92 | $count++; |
|---|
| 93 | } |
|---|
| 94 | |
|---|
| 95 | echo "</td></tr> |
|---|
| 96 | <tr align='left'> |
|---|
| 97 | <td class='head' valign='top' nowrap='nowrap'>". _MD_MESSAGEC ." |
|---|
| 98 | </td> |
|---|
| 99 | <td class='even'>"; |
|---|
| 100 | xoopsCodeTarea("message"); |
|---|
| 101 | |
|---|
| 102 | if ( !empty($isreply) && isset($hidden) && $hidden != "" ) { |
|---|
| 103 | echo "<input type='hidden' name='isreply' value='1' />"; |
|---|
| 104 | echo "<input type='hidden' name='hidden' id='hidden' value='$hidden' /> |
|---|
| 105 | <input type='button' name='quote' class='formButton' value='"._MD_QUOTE."' onclick='xoopsGetElementById(\"message\").value=xoopsGetElementById(\"message\").value + xoopsGetElementById(\"hidden\").value; xoopsGetElementById(\"hidden\").value=\"\";' /><br />"; |
|---|
| 106 | } |
|---|
| 107 | xoopsSmilies("message"); |
|---|
| 108 | |
|---|
| 109 | echo "</td></tr> |
|---|
| 110 | <tr>"; |
|---|
| 111 | echo "<td class='head' valign='top' nowrap='nowrap'>"._MD_OPTIONS."</td>\n"; |
|---|
| 112 | echo "<td class='odd'>"; |
|---|
| 113 | |
|---|
| 114 | if ( $xoopsUser && $forumdata['forum_access'] == 2 && !empty($post_id) ) { |
|---|
| 115 | echo "<input type='checkbox' name='noname' value='1'"; |
|---|
| 116 | if ( isset($noname) && $noname ) { |
|---|
| 117 | echo " checked='checked'"; |
|---|
| 118 | } |
|---|
| 119 | echo " /> "._MD_POSTANONLY."<br />\n"; |
|---|
| 120 | } |
|---|
| 121 | |
|---|
| 122 | echo "<input type='checkbox' name='nosmiley' value='1'"; |
|---|
| 123 | if ( isset($nosmiley) && $nosmiley ) { |
|---|
| 124 | echo " checked='checked'"; |
|---|
| 125 | } |
|---|
| 126 | echo " /> "._MD_DISABLESMILEY."<br />\n"; |
|---|
| 127 | |
|---|
| 128 | if ( $forumdata['allow_html'] ) { |
|---|
| 129 | echo "<input type='checkbox' name='nohtml' value='1'"; |
|---|
| 130 | if ( $nohtml ) { |
|---|
| 131 | echo " checked='checked'"; |
|---|
| 132 | } |
|---|
| 133 | echo " /> "._MD_DISABLEHTML."<br />\n"; |
|---|
| 134 | } else { |
|---|
| 135 | echo "<input type='hidden' name='nohtml' value='1' />"; |
|---|
| 136 | } |
|---|
| 137 | |
|---|
| 138 | if ( $forumdata['allow_sig'] && $xoopsUser ) { |
|---|
| 139 | echo "<input type='checkbox' name='attachsig' value='1'"; |
|---|
| 140 | if (isset($_POST['contents_preview'])) { |
|---|
| 141 | if ( $attachsig ) { |
|---|
| 142 | echo " checked='checked' /> "; |
|---|
| 143 | } else { |
|---|
| 144 | echo " /> "; |
|---|
| 145 | } |
|---|
| 146 | } else { |
|---|
| 147 | if ($xoopsUser->getVar('attachsig') || !empty($attachsig)) { |
|---|
| 148 | echo " checked='checked' /> "; |
|---|
| 149 | } else { |
|---|
| 150 | echo "/> "; |
|---|
| 151 | } |
|---|
| 152 | } |
|---|
| 153 | |
|---|
| 154 | echo _MD_ATTACHSIG."<br />\n"; |
|---|
| 155 | } |
|---|
| 156 | |
|---|
| 157 | if (!empty($xoopsUser) && !empty($xoopsModuleConfig['notification_enabled'])) { |
|---|
| 158 | echo "<input type='hidden' name='istopic' value='1' />"; |
|---|
| 159 | echo "<input type='checkbox' name='notify' value='1'"; |
|---|
| 160 | if (!empty($notify)) { |
|---|
| 161 | // If 'notify' set, use that value (e.g. preview) |
|---|
| 162 | echo ' checked="checked"'; |
|---|
| 163 | } else { |
|---|
| 164 | // Otherwise, check previous subscribed status... |
|---|
| 165 | $notification_handler =& xoops_gethandler('notification'); |
|---|
| 166 | if (!empty($topic_id) && $notification_handler->isSubscribed('thread', $topic_id, 'new_post', $xoopsModule->getVar('mid'), $xoopsUser->getVar('uid'))) { |
|---|
| 167 | echo ' checked="checked"'; |
|---|
| 168 | } |
|---|
| 169 | } |
|---|
| 170 | echo " /> "._MD_NEWPOSTNOTIFY."<br />\n"; |
|---|
| 171 | } |
|---|
| 172 | echo "</td></tr>"; |
|---|
| 173 | echo "<tr><td class='head' valign='top' nowrap='nowrap'>"; |
|---|
| 174 | echo "Åê¹Æ»þ¤Î¤´Ãí°Õ¡§"; |
|---|
| 175 | echo "</td><td class='even' height=\"90\"><div class=\"box\">"; |
|---|
| 176 | echo "¤³¤Î¥µ¥¤¥È¤Ï£Å£Ã¥ª¡¼¥×¥ó¥½¡¼¥¹¥½¥Õ¥È¥¦¥§¥¢¤Ç¤¢¤ë¡Ö£Å£Ã¡Ý£Ã£Õ£Â£Å¡×¤Î³«È¯¥³¥ß¥å¥Ë¥Æ¥£¤Ç¤¹¡£¤¢¤Ê¤¿¤¬Åê¹Æ¤·¤Æ¤¤¤¿¤À¤¤¤¿ÆâÍÆ¤Ï¡¢ÉÔ¶ñ¹çÊó¹ð¡¢°Õ¸«¡¢¥¢¥¤¥Ç¥£¥¢¡¢¥×¥í¥°¥é¥à¥³¡¼¥É¤½¤Î¾ÆâÍÆ¤ÎÇ¡²¿¤òÌä¤ï¤º¡¢¡Ö£Å£Ã¡Ý£Ã£Õ£Â£Å¡×¤Î³«È¯¤ËÍøÍѤµ¤ì¡¢<a href=\"http://www.fsf.org/licenses/\" target=\"_blank\">£Ç£Ð£Ì¥é¥¤¥»¥ó¥¹¢¨</a>¤Î²¼¤ÇÈÒÉÛ¤µ¤ì¤ë³«È¯À®²Ìʪ¤Ë¼è¤ê¹þ¤Þ¤ì¤ë¤³¤È¤¬¤¢¤ê¤Þ¤¹¡£<br /> |
|---|
| 177 | ¥×¥í¥°¥é¥à¥³¡¼¥É¤ä¥Ç¥¶¥¤¥óÅù¤ÎÅê¹Æ¤â´¿·Þ¤¤¤¿¤·¤Æ¤ª¤ê¤Þ¤¹¤¬¡¢Åê¹Æ¤ËºÝ¤·¤Æ¤Ï¡¢¤¢¤Ê¤¿¤¬ÁϺ¡¢Âè»°¼Ô¤¬¸¢Íø¤òÊÝ»ý¤·¤Æ¤¤¤Ê¤¤¤â¤Î¤Î¤ß¤òÅê¹Æ¤·¤Æ¤¯¤À¤µ¤¤¡£Âè»°¼Ô¤¬Ãøºî¸¢¤ä¤½¤Î¾¤ÎÃÎŪºâ»º¸¢¤òͤ·¤Æ¤¤¤ë¤â¤Î¤òÅê¹Æ¤µ¤ì¤Þ¤¹¤È¡¢¤½¤ÎÊý¤Î¸¢Íø¤¬¿¯³²¤µ¤ì¡¢¤¢¤Ê¤¿¤¬Ë¡Åª¤ËÇå½þÀÕǤ¤òÉ餦¤³¤È¤¬¤¢¤ê¤Þ¤¹¡£<br /> |
|---|
| 178 | ¤Þ¤¿¡Ö£Å£Ã¡Ý£Ã£Õ£Â£Å¡×¤Ï¥Ç¥å¥¢¥ë¥é¥¤¥»¥ó¥¹Êý¼°¤òºÎÍѤ·¤Æ¤ª¤ê¡¢£Ç£Ð£Ì¥é¥¤¥»¥ó¥¹¤Ç¤Ï¤Ê¤¯¡¢³ô¼°²ñ¼Ò¥í¥Ã¥¯¥ª¥ó¤¬ÆÈ¼«¤ËÀßÄꤹ¤ë¥¯¥í¡¼¥º¥É¥½¡¼¥¹¥é¥¤¥»¥ó¥¹¤Î²¼¤ÇÈÒÉÛ¤µ¤ì¤ë¤³¤È¤¬¤¢¤ê¤Þ¤¹¡£¤³¤ì¤ò²Äǽ¤È¤¹¤ë¤¿¤á¡¢¤¢¤Ê¤¿¤ÎÅê¹ÆÆâÍÆ¤¬Ãøºî¸¢Ë¡¾å¤ÎÃøºîʪ¤Ç¤¢¤ë¾ì¹ç¤Ë¤Ï¡¢Åê¹Æ¤ÈƱ»þ¤Ë¡¢¤¢¤Ê¤¿¤ÎÃøºî¸¢ºâ»º¸¢¤ò³ô¼°²ñ¼Ò¥í¥Ã¥¯¥ª¥ó¤Ë°Üž¤·¡¢Ãøºî¼Ô¿Í³Ê¸¢¤ò¹Ô»È¤·¤Ê¤¤¤³¤È¤Ë¤´Æ±°Õ¤¤¤¿¤À¤¯¤³¤È¤È¤Ê¤ê¤Þ¤¹¡£<br /><br /> |
|---|
| 179 | |
|---|
| 180 | °Ê¾å¤ÎÃí°Õ»ö¹à¤ËƱ°Õ¤¤¤¿¤À¤¤¤¿¾ì¹ç¤Î¤ßÅê¹Æ¥Ü¥¿¥ó¤ò²¡¤·¤Æ¤¯¤À¤µ¤¤¡£<br /><br /> |
|---|
| 181 | |
|---|
| 182 | ¢¨GPL¤Ï¡¢±Ñ¸ì¤Ç½ñ¤«¤ì¤¿¤â¤Î¤¬Ë¡Åª¤Ê¹´Â«ÎϤò¤â¤ÄÍ£°ì¤ÎÀµÊ¸¤Ç¤¹¤¬¡¢Èó¸ø¼°¤Ê<a href=\"http://www.opensource.jp/gpl/gpl.ja.html\" target=\"_blank\">ÆüËܸìÌõ¤Ï¤³¤Á¤é</a>¤ò¤´»²¾È¤¯¤À¤µ¤¤¡£ |
|---|
| 183 | "; |
|---|
| 184 | |
|---|
| 185 | $post_id = isset($post_id) ? intval($post_id) : ''; |
|---|
| 186 | $topic_id = isset($topic_id) ? intval($topic_id) : ''; |
|---|
| 187 | $order = isset($order) ? intval($order) : ''; |
|---|
| 188 | $pid = isset($pid) ? intval($pid) : 0; |
|---|
| 189 | echo "</div></td></tr> |
|---|
| 190 | <tr><td class='head'></td><td class='odd'> |
|---|
| 191 | <input type='hidden' name='pid' value='".intval($pid)."' /> |
|---|
| 192 | <input type='hidden' name='post_id' value='".$post_id."' /> |
|---|
| 193 | <input type='hidden' name='topic_id' value='".$topic_id."' /> |
|---|
| 194 | <input type='hidden' name='forum' value='".intval($forum)."' /> |
|---|
| 195 | <input type='hidden' name='viewmode' value='$viewmode' /> |
|---|
| 196 | <input type='hidden' name='order' value='".$order."' /> |
|---|
| 197 | <input type='submit' name='contents_preview' class='formButton' value='"._PREVIEW."' /> <input type='submit' name='contents_submit' class='formButton' id='contents_submit' value='"._MD_POST."' /> |
|---|
| 198 | <input type='button' onclick='location=\""; |
|---|
| 199 | if ( isset($topic_id) && $topic_id != "" ) { |
|---|
| 200 | echo "viewtopic.php?topic_id=".intval($topic_id)."&forum=".intval($forum)."\"'"; |
|---|
| 201 | } else { |
|---|
| 202 | echo "viewforum.php?forum=".intval($forum)."\"'"; |
|---|
| 203 | } |
|---|
| 204 | echo " class='formButton' value='"._MD_CANCELPOST."' />"; |
|---|
| 205 | echo "</td></tr></table></form>\n"; |
|---|
| 206 | ?> |
|---|