示例#1
0
 isset($sid) or $sid = $fid;
 if (!isset($tid)) {
     $r = $db->get_one("SELECT max(itemid) AS tid FROM {$table} WHERE status=3 {$sql}");
     $tid = $r['tid'] ? $r['tid'] : 0;
 }
 if ($update) {
     require MD_ROOT . '/quote.class.php';
     $do = new quote($moduleid);
 }
 isset($num) or $num = 100;
 if ($fid <= $tid) {
     $result = $db->query("SELECT itemid FROM {$table} WHERE status=3 AND itemid>={$fid} {$sql} ORDER BY itemid LIMIT 0,{$num} ");
     if ($db->affected_rows($result)) {
         while ($r = $db->fetch_array($result)) {
             $itemid = $r['itemid'];
             $update ? $do->update($itemid) : tohtml('show', $module);
         }
         $itemid += 1;
     } else {
         $itemid = $fid + $num;
     }
 } else {
     if ($update) {
         $all ? msg('', '?moduleid=' . $moduleid . '&file=' . $file . '&action=index&all=1&one=' . $one) : dmsg('更新成功', $this_forward);
     } else {
         if ($one) {
             dheader('?file=html&action=back&mid=' . $moduleid);
         }
         $all ? msg($MOD['name'] . '生成成功', $this_forward) : dmsg($MOD['name'] . '生成成功', $this_forward);
     }
 }
示例#2
0
         if ($tocatid) {
             $db->query("UPDATE {$table} SET catid={$tocatid} WHERE `{$fromtype}` IN ({$fromids})");
             dmsg('移动成功', $forward);
         } else {
             msg('请选择目标分类');
         }
     } else {
         $itemid = $itemid ? implode(',', $itemid) : '';
         $menuid = 5;
         include tpl($action, $module);
     }
     break;
 case 'update':
     is_array($itemid) or msg('请选择' . $MOD['name']);
     foreach ($itemid as $v) {
         $do->update($v);
     }
     dmsg('更新成功', $forward);
     break;
 case 'tohtml':
     is_array($itemid) or msg('请选择' . $MOD['name']);
     $html_itemids = $itemid;
     foreach ($html_itemids as $itemid) {
         tohtml('show', $module);
     }
     dmsg('更新成功', $forward);
     break;
 case 'delete':
     $itemid or msg('请选择' . $MOD['name']);
     isset($recycle) ? $do->recycle($itemid) : $do->delete($itemid);
     dmsg('删除成功', $forward);