Пример #1
0
 }
 $mchid = $mtran['toid'];
 $mchannel = $mchannels[$mchid];
 $mfields = read_cache('mfields', $mchid);
 foreach (array('additems') as $var) {
     ${$var} = $mchannel[$var] ? explode(',', $mchannel[$var]) : array();
 }
 if (!submitcheck('bmtran')) {
     $a_field = new cls_field();
     $submitstr = '';
     $muststr = '<span style="color:red">*</span>';
     tabheader(lang('membertypeneedoption'), 'mtrans', "?action=mtrans", 2, 1, 1);
     trhidden('mtran[toid]', $mtran['toid']);
     trbasic(lang('needtime'), '', date("Y-m-d H:m", $isold ? $minfos['createdate'] : $timestamp), '');
     trbasic(lang('remark'), 'mtran[remark]', empty($minfos['remark']) ? '' : $minfos['remark'], 'textarea');
     $isold && trbasic(lang('masterreply') . @noedit(1), '', $minfos['reply'], 'textarea');
     tabfooter();
     tabheader(lang('inputmembermessage'));
     if (in_array('mtcid', $additems)) {
         trbasic(lang('spacetemplateproject'), 'minfosnew[mtcid]', makeoption(mtcidsarr($mchid), $minfos['mtcid']), 'select');
     }
     foreach ($grouptypes as $k => $v) {
         if (!$v['mode'] && !in_array($mchid, explode(',', $v['mchids'])) && in_array("grouptype{$k}", $additems)) {
             trbasic($v['cname'], "minfosnew[grouptype{$k}]", makeoption(ugidsarr($k, $mchid), $minfos["grouptype{$k}"]), 'select');
         }
     }
     foreach ($mfields as $k => $field) {
         if ($field['available'] && !$field['issystem'] && !$field['isfunc'] && !$field['isadmin'] && in_array($k, $additems)) {
             $a_field->init();
             $a_field->field = $field;
             if ($curuser->pmbypmids('field', $a_field->field['pmid'])) {
Пример #2
0
         }
     }
     unset($a_field);
     tabfooter('newcommu');
     check_submit_func($submitstr);
     $db->query("UPDATE {$tblprefix}mreplys SET " . ($amode ? "aread='1'" : "uread='1'") . " WHERE cid='{$cid}'");
 } else {
     $c_upload = new cls_upload();
     $fields = fields_order($fields);
     $a_field = new cls_field();
     foreach ($fields as $k => $v) {
         if (empty($u_lists) || in_array($k, $u_lists)) {
             if (!$v['isfunc'] && ($amode || !$v['isadmin'])) {
                 $a_field->init();
                 $a_field->field = $v;
                 if (!noedit($k, !$curuser->pmbypmids('field', $v['pmid']))) {
                     $a_field->oldvalue = isset($oldrow[$k]) ? $oldrow[$k] : '';
                     $a_field->deal('communew');
                     if (!empty($a_field->error)) {
                         $c_upload->rollback();
                         mcmessage($a_field->error, M_REFERER);
                     }
                     $uedit->updatefield($k, $a_field->newvalue);
                     if ($arr = multi_val_arr($a_field->newvalue, $v)) {
                         foreach ($arr as $x => $y) {
                             $uedit->updatefield($k . '_' . $x, $y);
                         }
                     }
                 }
             }
         }
Пример #3
0
 }
 if ($fields['thumb']['available'] && !$fields['thumb']['isadmin'] && $aedit->channel['autothumb'] && empty($archivenew['thumb']) && isset($archivenew[$aedit->channel['autothumb']])) {
     $archivenew['thumb'] = $c_upload->thumb_pick(stripslashes($archivenew[$aedit->channel['autothumb']]), $fields[$aedit->channel['autothumb']]['datatype'], $fields['thumb']['rpid']);
 }
 if ($aedit->channel['autosize'] && !empty($archivenew[$aedit->channel['autosize']])) {
     $archivenew['atmsize'] = atm_size(stripslashes($archivenew[$aedit->channel['autosize']]), $fields[$aedit->channel['autosize']]['datatype'], $aedit->channel['autosizemode']);
     $aedit->updatefield('atmsize', $archivenew['atmsize'], 'main');
 }
 if ($channel['autobyte'] && isset($archivenew[$channel['autobyte']])) {
     $archivenew['bytenum'] = atm_byte(stripslashes($archivenew[$channel['autobyte']]), $fields[$channel['autobyte']]['datatype']);
     $aedit->updatefield('bytenum', $archivenew['bytenum'], 'main');
 }
 foreach ($fields as $k => $v) {
     //需要分析是否有字段的编辑权
     if (isset($archivenew[$k])) {
         if ($v['available'] && !$v['isadmin'] && !$v['isfunc'] && !noedit($k)) {
             if ($curuser->pmbypmids('field', $v['pmid'])) {
                 if (!empty($v['istxt'])) {
                     $archivenew[$k] = saveastxt(stripslashes($archivenew[$k]), $aedit->namepres[$k]);
                 }
                 $aedit->updatefield($k, $archivenew[$k], $v['tbl']);
                 if ($arr = multi_val_arr($archivenew[$k], $v)) {
                     foreach ($arr as $x => $y) {
                         $aedit->updatefield($k . '_' . $x, $y, $v['tbl']);
                     }
                 }
             }
         }
     }
 }
 if ($aedit->archive['needupdate']) {