onokazu
onoka****@users*****
2005年 6月 11日 (土) 11:32:46 JST
Index: xoops2jp/html/modules/newbb/include/forumform.inc.php diff -u xoops2jp/html/modules/newbb/include/forumform.inc.php:1.2 xoops2jp/html/modules/newbb/include/forumform.inc.php:1.3 --- xoops2jp/html/modules/newbb/include/forumform.inc.php:1.2 Fri Mar 18 21:52:25 2005 +++ xoops2jp/html/modules/newbb/include/forumform.inc.php Sat Jun 11 11:32:46 2005 @@ -1,5 +1,5 @@ <?php -// $Id: forumform.inc.php,v 1.2 2005/03/18 12:52:25 onokazu Exp $ +// $Id: forumform.inc.php,v 1.3 2005/06/11 02:32:46 onokazu Exp $ // ------------------------------------------------------------------------ // // XOOPS - PHP Content Management System // // Copyright (c) 2000 XOOPS.org // @@ -30,21 +30,24 @@ // ------------------------------------------------------------------------- // if (!defined('XOOPS_ROOT_PATH')) { - exit(); + exit(); } include_once XOOPS_ROOT_PATH."/class/xoopslists.php"; include_once XOOPS_ROOT_PATH."/include/xoopscodes.php"; +$token=&XoopsMultiTokenHandler::quickCreate('newbb_post'); + 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>"; +echo $token->getHtml(); if ( $forumdata['forum_type'] == 1 ) { - echo "<td class='even'>". _MD_PRIVATE ."</td>"; + echo "<td class='even'>". _MD_PRIVATE ."</td>"; } elseif ( $forumdata['forum_access'] == 1 ) { - echo "<td class='even'>". _MD_REGCANPOST ."</td>"; + echo "<td class='even'>". _MD_REGCANPOST ."</td>"; } elseif ( $forumdata['forum_access'] == 2 ) { - echo "<td class='even'>". _MD_ANONCANPOST ."</td>"; + echo "<td class='even'>". _MD_ANONCANPOST ."</td>"; } elseif ( $forumdata['forum_access'] == 3 ) { - echo "<td class='even'>". _MD_MODSCANPOST ."</td>"; + echo "<td class='even'>". _MD_MODSCANPOST ."</td>"; } echo "</tr> @@ -62,17 +65,17 @@ $filelist = $lists->getSubjectsList(); $count = 1; while ( list($key, $file) = each($filelist) ) { - $checked = ""; - if ( isset($icon) && $file==$icon ) { - $checked = " checked='checked'"; - } - echo "<input type='radio' value='$file' name='icon'$checked /> "; - echo "<img src='".XOOPS_URL."/images/subject/$file' alt='' /> "; - if ( $count == 8 ) { - echo "<br />"; - $count = 0; - } - $count++; + $checked = ""; + if ( isset($icon) && $file==$icon ) { + $checked = " checked='checked'"; + } + echo "<input type='radio' value='$file' name='icon'$checked /> "; + echo "<img src='".XOOPS_URL."/images/subject/$file' alt='' /> "; + if ( $count == 8 ) { + echo "<br />"; + $count = 0; + } + $count++; } echo "</td></tr> @@ -83,9 +86,9 @@ xoopsCodeTarea("message"); if ( !empty($isreply) && isset($hidden) && $hidden != "" ) { - echo "<input type='hidden' name='isreply' value='1' />"; - echo "<input type='hidden' name='hidden' id='hidden' value='$hidden' /> - <input type='button' name='quote' class='formButton' value='"._MD_QUOTE."' onclick='xoopsGetElementById(\"message\").value=xoopsGetElementById(\"message\").value + xoopsGetElementById(\"hidden\").value; xoopsGetElementById(\"hidden\").value=\"\";' /><br />"; + echo "<input type='hidden' name='isreply' value='1' />"; + echo "<input type='hidden' name='hidden' id='hidden' value='$hidden' /> + <input type='button' name='quote' class='formButton' value='"._MD_QUOTE."' onclick='xoopsGetElementById(\"message\").value=xoopsGetElementById(\"message\").value + xoopsGetElementById(\"hidden\").value; xoopsGetElementById(\"hidden\").value=\"\";' /><br />"; } xoopsSmilies("message"); @@ -95,62 +98,62 @@ echo "<td class='even'>"; if ( $xoopsUser && $forumdata['forum_access'] == 2 && !empty($post_id) ) { - echo "<input type='checkbox' name='noname' value='1'"; - if ( isset($noname) && $noname ) { - echo " checked='checked'"; - } - echo " /> "._MD_POSTANONLY."<br />\n"; + echo "<input type='checkbox' name='noname' value='1'"; + if ( isset($noname) && $noname ) { + echo " checked='checked'"; + } + echo " /> "._MD_POSTANONLY."<br />\n"; } echo "<input type='checkbox' name='nosmiley' value='1'"; if ( isset($nosmiley) && $nosmiley ) { - echo " checked='checked'"; + echo " checked='checked'"; } echo " /> "._MD_DISABLESMILEY."<br />\n"; if ( $forumdata['allow_html'] ) { - echo "<input type='checkbox' name='nohtml' value='1'"; - if ( $nohtml ) { - echo " checked='checked'"; - } - echo " /> "._MD_DISABLEHTML."<br />\n"; + echo "<input type='checkbox' name='nohtml' value='1'"; + if ( $nohtml ) { + echo " checked='checked'"; + } + echo " /> "._MD_DISABLEHTML."<br />\n"; } else { - echo "<input type='hidden' name='nohtml' value='1' />"; + echo "<input type='hidden' name='nohtml' value='1' />"; } if ( $forumdata['allow_sig'] && $xoopsUser ) { - echo "<input type='checkbox' name='attachsig' value='1'"; - if (isset($HTTP_POST_VARS['contents_preview'])) { - if ( $attachsig ) { - echo " checked='checked' /> "; - } else { - echo " /> "; - } - } else { - if ($xoopsUser->getVar('attachsig') || !empty($attachsig)) { - echo " checked='checked' /> "; - } else { - echo "/> "; - } - } + echo "<input type='checkbox' name='attachsig' value='1'"; + if (isset($HTTP_POST_VARS['contents_preview'])) { + if ( $attachsig ) { + echo " checked='checked' /> "; + } else { + echo " /> "; + } + } else { + if ($xoopsUser->getVar('attachsig') || !empty($attachsig)) { + echo " checked='checked' /> "; + } else { + echo "/> "; + } + } - echo _MD_ATTACHSIG."<br />\n"; + echo _MD_ATTACHSIG."<br />\n"; } if (!empty($xoopsUser) && !empty($xoopsModuleConfig['notification_enabled'])) { - echo "<input type='hidden' name='istopic' value='1' />"; - echo "<input type='checkbox' name='notify' value='1'"; - if (!empty($notify)) { - // If 'notify' set, use that value (e.g. preview) - echo ' checked="checked"'; - } else { - // Otherwise, check previous subscribed status... - $notification_handler =& xoops_gethandler('notification'); - if (!empty($topic_id) && $notification_handler->isSubscribed('thread', $topic_id, 'new_post', $xoopsModule->getVar('mid'), $xoopsUser->getVar('uid'))) { - echo ' checked="checked"'; - } - } - echo " /> "._MD_NEWPOSTNOTIFY."<br />\n"; + echo "<input type='hidden' name='istopic' value='1' />"; + echo "<input type='checkbox' name='notify' value='1'"; + if (!empty($notify)) { + // If 'notify' set, use that value (e.g. preview) + echo ' checked="checked"'; + } else { + // Otherwise, check previous subscribed status... + $notification_handler =& xoops_gethandler('notification'); + if (!empty($topic_id) && $notification_handler->isSubscribed('thread', $topic_id, 'new_post', $xoopsModule->getVar('mid'), $xoopsUser->getVar('uid'))) { + echo ' checked="checked"'; + } + } + echo " /> "._MD_NEWPOSTNOTIFY."<br />\n"; } $post_id = isset($post_id) ? intval($post_id) : ''; @@ -168,9 +171,9 @@ <input type='submit' name='contents_preview' class='formButton' value='"._PREVIEW."' /> <input type='submit' name='contents_submit' class='formButton' id='contents_submit' value='"._SUBMIT."' /> <input type='button' onclick='location=\""; if ( isset($topic_id) && $topic_id != "" ) { - echo "viewtopic.php?topic_id=".intval($topic_id)."&forum=".intval($forum)."\"'"; + echo "viewtopic.php?topic_id=".intval($topic_id)."&forum=".intval($forum)."\"'"; } else { - echo "viewforum.php?forum=".intval($forum)."\"'"; + echo "viewforum.php?forum=".intval($forum)."\"'"; } echo " class='formButton' value='"._MD_CANCELPOST."' />"; echo "</td></tr></table></form>\n"; Index: xoops2jp/html/modules/newbb/include/search.inc.php diff -u xoops2jp/html/modules/newbb/include/search.inc.php:1.2 xoops2jp/html/modules/newbb/include/search.inc.php:1.3 --- xoops2jp/html/modules/newbb/include/search.inc.php:1.2 Fri Mar 18 21:52:25 2005 +++ xoops2jp/html/modules/newbb/include/search.inc.php Sat Jun 11 11:32:46 2005 @@ -1,5 +1,5 @@ <?php -// $Id: search.inc.php,v 1.2 2005/03/18 12:52:25 onokazu Exp $ +// $Id: search.inc.php,v 1.3 2005/06/11 02:32:46 onokazu Exp $ // ------------------------------------------------------------------------ // // XOOPS - PHP Content Management System // // Copyright (c) 2000 XOOPS.org // @@ -30,32 +30,32 @@ // ------------------------------------------------------------------------- // function newbb_search($queryarray, $andor, $limit, $offset, $userid){ - global $xoopsDB; - $sql = "SELECT p.post_id,p.topic_id,p.forum_id,p.post_time,p.uid,p.subject FROM ".$xoopsDB->prefix("bb_posts")." p LEFT JOIN ".$xoopsDB->prefix("bb_posts_text")." t ON t.post_id=p.post_id LEFT JOIN ".$xoopsDB->prefix("bb_forums")." f ON f.forum_id=p.forum_id WHERE f.forum_type=0"; - if ( $userid != 0 ) { - $sql .= " AND p.uid=".$userid." "; - } - // because count() returns 1 even if a supplied variable - // is not an array, we must check if $querryarray is really an array - if ( is_array($queryarray) && $count = count($queryarray) ) { - $sql .= " AND ((p.subject LIKE '%$queryarray[0]%' OR t.post_text LIKE '%$queryarray[0]%')"; - for($i=1;$i<$count;$i++){ - $sql .= " $andor "; - $sql .= "(p.subject LIKE '%$queryarray[$i]%' OR t.post_text LIKE '%$queryarray[$i]%')"; - } - $sql .= ") "; - } - $sql .= "ORDER BY p.post_time DESC"; - $result = $xoopsDB->query($sql,$limit,$offset); - $ret = array(); - $i = 0; - while($myrow = $xoopsDB->fetchArray($result)){ - $ret[$i]['link'] = "viewtopic.php?topic_id=".$myrow['topic_id']."&forum=".$myrow['forum_id']."#forumpost".$myrow['post_id']; - $ret[$i]['title'] = $myrow['subject']; - $ret[$i]['time'] = $myrow['post_time']; - $ret[$i]['uid'] = $myrow['uid']; - $i++; - } - return $ret; + global $xoopsDB; + $sql = "SELECT p.post_id,p.topic_id,p.forum_id,p.post_time,p.uid,p.subject FROM ".$xoopsDB->prefix("bb_posts")." p LEFT JOIN ".$xoopsDB->prefix("bb_posts_text")." t ON t.post_id=p.post_id LEFT JOIN ".$xoopsDB->prefix("bb_forums")." f ON f.forum_id=p.forum_id WHERE f.forum_type=0"; + if ( $userid != 0 ) { + $sql .= " AND p.uid=".$userid." "; + } + // because count() returns 1 even if a supplied variable + // is not an array, we must check if $querryarray is really an array + if ( is_array($queryarray) && $count = count($queryarray) ) { + $sql .= " AND ((p.subject LIKE '%$queryarray[0]%' OR t.post_text LIKE '%$queryarray[0]%')"; + for($i=1;$i<$count;$i++){ + $sql .= " $andor "; + $sql .= "(p.subject LIKE '%$queryarray[$i]%' OR t.post_text LIKE '%$queryarray[$i]%')"; + } + $sql .= ") "; + } + $sql .= "ORDER BY p.post_time DESC"; + $result = $xoopsDB->query($sql,$limit,$offset); + $ret = array(); + $i = 0; + while($myrow = $xoopsDB->fetchArray($result)){ + $ret[$i]['link'] = "viewtopic.php?topic_id=".$myrow['topic_id']."&forum=".$myrow['forum_id']."&post_id=".$myrow['post_id']."#forumpost".$myrow['post_id']; + $ret[$i]['title'] = $myrow['subject']; + $ret[$i]['time'] = $myrow['post_time']; + $ret[$i]['uid'] = $myrow['uid']; + $i++; + } + return $ret; } ?> \ No newline at end of file