在我的论坛脚本中移动主题系统

时间:2012-05-18 18:49:02

标签: php mysql smarty

我有这个代码的文件forum.php:

$tpc = $db->query("SELECT * FROM ".$pre."FORUMS 
WHERE FORUM_HIDDEN='0' AND FORUM_LEVEL='0' ORDER BY FORUM_ORDER");
$ntopics = $db->CNrows();
while($rs = $db->record()){
    $forumt[] = $rs;
}
$tmp->assign('forumt',$forumt);

我有这个聪明的文件forum.tpl,代码如下:

1-

<input type="checkbox" name="tpcs[]" id="tpcs" value="{$topic[topic].ID}" />

2-

<form action="tr_action.php?action=tmove" method="POST">
  <select name="movet">
  {section name=forumt loop=$forumt}
  <option value="{$forumt[forumt].ID}">
  {$forumt[forumt].FORUM_NAME} -- {$forumt[forumt].ID}</option>
  {/section}
  </select>
  <input class="button" type="submit" value="move topics to :" />
</form>

这是tr_action.php文件:

if($action == 'tmove') {
    $tpcs = $_POST['tpcs'];
    $f_to = intval($_POST['movet']);
    $topicsid = implode(", ",$tpcs);
    if(!$f_to) {
        $err = 'you must choose an forum';
        $tmp->assign('msg','false');
    } else {
        if(count($tpcs) > 0) {
            $db->query("UPDATE ".$pre."TOPICS SET F_ID='".$ftid."' WHERE ID IN (".$topicsid.")");
            $err = 'moved successfuly..';
            $tmp->assign('msg','true');
            $redirect = '<meta http-equiv="refresh" content="1; url='.$_SERVER['HTTP_REFERER'].'" />';
        } else {
            $err = 'you must choose an topic';
            $tmp->assign('msg','false');
        }
    }
}

但是当我测试这段代码时,我收到了这个错误:

  

警告:implode()[function.implode]:传入的参数无效   第293行的C:\ xampp \ htdocs \ mf2 \ tr_action.php

0 个答案:

没有答案