コード例 #1
0
 function getTopicType($data)
 {
     /*获取发帖分类信息:字段解析*/
     global $timestamp, $modelid;
     $topichtml = '';
     $pccheck = $error = '';
     if ($data['ifmust']) {
         $data['ifmust'] && ($pccheck = 'check="/^.+$/"');
     }
     $textsize = $data['textsize'] ? $data['textsize'] : 20;
     $data['rules'] && ($data['rules'] = unserialize($data['rules']));
     if ($data['type'] == 'number') {
         $data['rules']['minnum'] === '' && ($data['rules']['minnum'] = 'n');
         $data['rules']['maxnum'] === '' && ($data['rules']['maxnum'] = 'n');
         $pccheck = "check=\"{$data[rules][minnum]}-{$data[rules][maxnum]}\"";
         $error = $data['ifmust'] ? 'error="rang_error"' : 'error="rang_error2"';
         $topichtml = "<input type=\"text\" {$pccheck} {$error} class=\"input\" name=\"topic[{$data['fieldid']}]\" value=\"{$data['fieldvalue']}\" size=\"{$textsize}\" tabindex = \"{$data[tabindex]}\">";
         if ($data['rules']['minnum'] !== '' && $data['rules']['maxnum'] !== '') {
             $topichtml .= " <span class='gray'>(" . getLanginfo('other', 'pc_defaultname') . "{$data[rules][minnum]} ~ {$data[rules][maxnum]})</span>";
         }
     } elseif ($data['type'] == 'email') {
         $pccheck = 'check="/^[-a-zA-Z0-9_\\.]+@([0-9A-Za-z][0-9A-Za-z-]+\\.)+[A-Za-z]{2,5}$/"';
         if ($data['ifmust']) {
             $error = 'error="email_error"';
         } else {
             $error = 'error="email_error2"';
         }
         $topichtml = "<input type=\"text\" {$pccheck} {$error} class=\"input\" name=\"topic[{$data['fieldid']}]\" value=\"{$data['fieldvalue']}\" size=\"{$textsize}\"  tabindex = \"{$data[tabindex]}\" />";
     } elseif ($data['type'] == 'range') {
         $pccheck = 'check="/^\\d+$/"';
         if ($data['ifmust']) {
             $error = 'error="number_error"';
         } else {
             $error = 'error="number_error2"';
         }
         $topichtml = "<input type=\"text\" {$pccheck} {$error} class=\"input\" name=\"topic[{$data['fieldid']}]\" value=\"{$data['fieldvalue']}\" size=\"{$textsize}\"  tabindex = \"{$data[tabindex]}\" />";
     } elseif (in_array($data['type'], array('text', 'img', 'url'))) {
         $addfieldvalue = '';
         $data['type'] == 'url' && !$data[fieldvalue] && ($addfieldvalue = 'http://');
         $topichtml = "<input type=\"text\" {$pccheck} {$error} class=\"input\" name=\"topic[{$data['fieldid']}]\" value=\"{$addfieldvalue}{$data['fieldvalue']}\" size=\"{$textsize}\"  tabindex = \"{$data[tabindex]}\" />";
     } elseif ($data['type'] == 'radio') {
         $i = 0;
         foreach ($data['rules'] as $rk => $rv) {
             $i++;
             $chehcked = '';
             $rv_value = substr($rv, 0, strpos($rv, '='));
             $rv_name = substr($rv, strpos($rv, '=') + 1);
             if ($data['fieldvalue']) {
                 $rv_value == $data['fieldvalue'] && ($chehcked = 'checked');
             } elseif ($i == 1) {
                 $chehcked = 'checked';
             }
             $topichtml .= "<span class=\"fl w\"><input type=\"radio\" name=\"topic[{$data['fieldid']}]\" value=\"{$rv_value}\" {$chehcked}  tabindex = \"{$data[tabindex]}\" /> {$rv_name} </span>";
         }
     } elseif ($data['type'] == 'checkbox') {
         foreach ($data['rules'] as $ck => $cv) {
             $chehcked = '';
             if ($data['ifmust']) {
                 $pccheck = "check=\"1-\"";
             } else {
                 $pccheck = "";
             }
             $cv_value = substr($cv, 0, strpos($cv, '='));
             $cv_name = substr($cv, strpos($cv, '=') + 1);
             if (strpos("," . $data['fieldvalue'] . ",", "," . $cv_value . ",") !== false) {
                 $chehcked = 'checked';
             }
             $topichtml .= "<span class=\"fl w\"><input {$pccheck} type=\"checkbox\" name=\"topic[{$data['fieldid']}][]\" value=\"{$cv_value}\" {$chehcked}  tabindex = \"{$data[tabindex]}\" /> {$cv_name} </span>";
         }
     } elseif ($data['type'] == 'textarea') {
         $topichtml = "<textarea type=\"text\" {$pccheck} name=\"topic[{$data['fieldid']}]\" rows=\"4\" class=\"input\" cols=\"{$textsize}\"  tabindex = \"{$data[tabindex]}\" />{$data['fieldvalue']}</textarea>";
     } elseif ($data['type'] == 'select') {
         $topichtml .= "<select name=\"topic[{$data['fieldid']}]\"  tabindex = \"{$data[tabindex]}\" >";
         foreach ($data['rules'] as $sk => $sv) {
             $selected = '';
             $sv_value = substr($sv, 0, strpos($sv, '='));
             $sv_name = substr($sv, strpos($sv, '=') + 1);
             if ($sv_value == $data['fieldvalue']) {
                 $selected = 'selected';
             }
             $topichtml .= "<option value=\"{$sv_value}\" {$selected}>{$sv_name}</option>";
         }
         $topichtml .= "</select>";
     } elseif ($data['type'] == 'calendar') {
         !$data['fieldvalue'] && ($data['fieldvalue'] = $timestamp);
         $data['fieldvalue'] = get_date($data['fieldvalue'], 'Y-n-j');
         $topichtml = "<input id=\"calendar_{$data['fieldid']}\" {$pccheck} type=\"text\" class=\"input\" name=\"topic[{$data['fieldid']}]\" value=\"{$data['fieldvalue']}\" onclick=\"ShowCalendar(this.id,0)\" size=\"{$textsize}\"  tabindex = \"{$data[tabindex]}\" />";
     } elseif ($data['type'] == 'upload') {
         $imgs = '';
         $data['fieldvalue'] && ($data['fieldvalue'] = postTopic::getpcurl($data['fieldvalue'], 1));
         $data['fieldvalue'] && ($imgs = "<span id=\"img_{$data['fieldid']}\"><img src=\"{$data[fieldvalue]}\" width=\"240px\"/><a href=\"javascript:;\" onclick=\"pcdelimg('{$modelid}','{$data['fieldid']}','topic');return false;\">" . getLangInfo('other', 'pc_delimg') . "</a></span>");
         $topichtml .= "<input type=\"file\" class=\"bt\" name=\"topic_{$data['fieldid']}\" size=\"{$textsize}\"  tabindex = \"{$data[tabindex]}\" >{$imgs}";
     } else {
         $topichtml = "";
     }
     return $topichtml;
 }
コード例 #2
0
ファイル: activity.php プロジェクト: jechiy/PHPWind
 $rt['ifsearch_checked'] = $rt['ifsearch'] ? 'checked' : '';
 $rt['ifasearch_checked'] = $rt['ifasearch'] ? 'checked' : '';
 $rt['threadshow_checked'] = $rt['threadshow'] ? 'checked' : '';
 $rt['ifmust_checked'] = $rt['ifmust'] ? 'checked' : '';
 //不能删除的字段(默认字段)
 $rt['ifable_disabled'] = !$rt['ifdel'] && $rt['mustenable'] ? 'disabled="disabled"' : '';
 $rt['ifmust_disabled'] = !$rt['ifdel'] && $rt['ifmust'] && $rt['mustenable'] ? 'disabled="disabled"' : '';
 $rt['search_disabled'] = $rt['issearchable'] ? '' : 'disabled="disabled"';
 $rt['threadshow_disabled'] = $rt['allowthreadshow'] ? '' : 'disabled="disabled"';
 $rt['vieworder_disabled'] = !$rt['ifdel'] ? 'disabled="disabled"' : '';
 $rt['sectionname_disabled'] = !$rt['ifdel'] ? 'disabled="disabled"' : '';
 if ($rt['ifdel']) {
     $rt['editLinkHtml'] = "<a href=\"javascript:;\" class=\"mr20\" onclick=\"sendmsg('{$ajax_basename_edit}','fieldid={$rt['fieldid']}&actmid={$actmid}&actid={$actid}',this.id);\" id=\"editfield_{$rt['fieldid']}\">" . getLanginfo('other', 'act_edit') . "</a>";
     $rt['deleteLinkHtml'] = "<a href=\"javascript:;\" onclick=\"delfield({$rt['fieldid']});return false;\" class=\"mr20\">" . getLanginfo('other', 'act_delete') . "</a>";
 } else {
     $rt['editLinkHtml'] = "<a href=\"javascript:;\" class=\"mr20\" onclick=\"sendmsg('{$ajax_basename_view}','fieldid={$rt['fieldid']}&actmid={$actmid}&actid={$actid}',this.id);\" id=\"editfield_{$rt['fieldid']}\">" . getLanginfo('other', 'act_view') . "</a>";
     $rt['deleteLinkHtml'] = '';
 }
 if ($rt['ifsearch'] || $rt['ifasearch']) {
     $rt['ifindex'] = 1;
 }
 //获取字段的索引状态
 if (in_array($rt['type'], array('textarea', 'url', 'image', 'upload'))) {
     $rt['indexstate'] = '-1';
 } else {
     $tablename = getActivityValueTableNameByActmid($actmid, 1, $rt['ifdel']);
     $fieldname = $rt['fieldname'];
     $rt['indexstate'] = 0;
     $query2 = $db->query("SHOW KEYS FROM {$tablename}");
     while ($rt2 = $db->fetch_array($query2)) {
         $fieldname == $rt2['Column_name'] && ($rt['indexstate'] = 1);
コード例 #3
0
    /**
     * 返回活动发帖时每一字段的HTML
     * @param array $data
     * @return string
     */
    function getActivityField($data)
    {
        global $action, $tid, $imgpath, $attachpath, $mergedField;
        $actmid = $this->actmid;
        $acthtml = '';
        $textsize = $data['textwidth'] = $data['textwidth'] ? $data['textwidth'] : 20;
        $data['rules'] && ($data['rules'] = unserialize($data['rules']));
        //默认检查
        if ($data['ifmust']) {
            $pccheck = 'check="/^.+$/"';
            $error = 'error=""';
        }
        if ($data['fieldname'] == 'fees') {
            $isEditable = true;
            $activityStatusKey = $this->getActivityStatusKey($mergedField, $this->timestamp, $this->peopleAlreadySignup($tid));
            //获取活动状态
            if ($action == 'modify' && ($this->getPeopleAlreadySignup() || $this->getPeopleAlreadySignup() && $activityStatusKey == 'signup_is_ended' || in_array($activityStatusKey, array('activity_is_ended', 'activity_is_running')))) {
                //已有人报名、活动已结束、活动进行中、报名结束
                $isEditable = false;
            }
            $acthtml .= $this->getFeesFieldHtml($data, $isEditable);
        } elseif ($data['fieldname'] == 'feesdetail') {
            $acthtml .= $this->getFeesDetailFieldHtml($data);
        } elseif ($data['fieldname'] == 'maxparticipant') {
            $isEditable = true;
            $activityStatusKey = $this->getActivityStatusKey($mergedField, $this->timestamp, $this->peopleAlreadySignup($tid));
            //获取活动状态
            if ($action == 'modify' && ($this->getPeopleAlreadySignup() && $activityStatusKey == 'signup_is_ended' || in_array($activityStatusKey, array('activity_is_ended', 'activity_is_running')))) {
                //活动已结束、活动进行中、报名结束
                $isEditable = false;
            }
            $acthtml .= $this->getMaxParticipantHtml($data, $isEditable);
        } elseif ($data['fieldname'] == 'minparticipant') {
            $isEditable = true;
            $activityStatusKey = $this->getActivityStatusKey($mergedField, $this->timestamp, $this->peopleAlreadySignup($tid));
            //获取活动状态
            if ($action == 'modify' && ($this->getpeopleAlreadySignup() && $activityStatusKey == 'signup_is_ended' || in_array($activityStatusKey, array('activity_is_ended', 'activity_is_running')))) {
                //已有人支付、活动已结束、活动进行中
                $isEditable = false;
            }
            $acthtml .= $this->getMinParticipantHtml($data, $isEditable);
        } elseif ($data['fieldname'] == 'contact') {
            $acthtml .= $this->getContactHtml($data);
        } elseif ($data['fieldname'] == 'telephone') {
            $acthtml .= $this->getTelephoneHtml($data);
        } elseif ($data['type'] == 'number') {
            if ($data['rules']['minnum'] && $data['rules']['maxnum']) {
                $pccheck = "check=\"{$data['rules']['minnum']}-{$data['rules']['maxnum']}\"";
                if ($data['ifmust']) {
                    $error = 'error="rang_error"';
                } else {
                    $error = 'error="rang_error2"';
                }
            } else {
                $pccheck = 'check="/^\\d+$/"';
                if ($data['ifmust']) {
                    $error = 'error="number_error"';
                } else {
                    $error = 'error="number_error2"';
                }
            }
            $acthtml .= "<input type=\"text\" {$pccheck} {$error} class=\"input\" name=\"act[" . $data['fieldname'] . "]\" value=\"" . $data['fieldvalue'] . "\" size=\"" . $data['textwidth'] . "\">";
            if ($data['rules']['minnum'] && $data['rules']['maxnum']) {
                $acthtml .= " <span class='gray'>(" . getLanginfo('other', 'pc_defaultname') . "{$data['rules']['minnum']} ~ {$data['rules']['maxnum']})</span>";
            }
        } elseif ($data['type'] == 'email') {
            $pccheck = 'check="/^[-a-zA-Z0-9_\\.]+@([0-9A-Za-z][0-9A-Za-z-]+\\.)+[A-Za-z]{2,5}$/"';
            if ($data['ifmust']) {
                $error = 'error="email_error"';
            } else {
                $error = 'error="email_error2"';
            }
            $acthtml .= "<input type=\"text\" {$pccheck} {$error} class=\"input\" name=\"act[" . $data['fieldname'] . "]\" value=\"" . $data['fieldvalue'] . "\" size=\"" . $data['textwidth'] . "\"/>";
        } elseif ($data['type'] == 'range') {
            $pccheck = 'check="/^\\d+$/"';
            if ($data['ifmust']) {
                $error = 'error="number_error"';
            } else {
                $error = 'error="number_error2"';
            }
            $acthtml .= "<input type=\"text\" {$pccheck} {$error} class=\"input\" name=\"act[" . $data['fieldname'] . "]\" value=\"" . $data['fieldvalue'] . "\" size=\"" . $data['textwidth'] . "\"/>";
        } elseif (in_array($data['type'], array('text', 'img', 'url'))) {
            $acthtml .= "<input id=\"" . $data['fieldname'] . "\" type=\"text\" {$pccheck} {$error} class=\"input\" name=\"act[" . $data['fieldname'] . "]\" value=\"" . $data['fieldvalue'] . "\" size=\"" . $data['textwidth'] . "\"/>";
        } elseif ($data['type'] == 'radio') {
            $activityStatusKey = $this->getActivityStatusKey($mergedField, $this->timestamp, $this->peopleAlreadySignup($tid));
            //获取活动状态
            $i = 0;
            if ($data['fieldname'] == 'genderlimit' && $action == 'new') {
                $onchange = "onclick=\"changeFeeValue(this.value);\"";
                $allPeopleText = getLangInfo('other', 'act_all_people');
                $maleText = getLangInfo('other', 'act_male');
                $femaleText = getLangInfo('other', 'act_female');
                $acthtml .= "\n<script type=\"text/javascript\">\nfunction changeFeeValue(value) {\n\tif (value == 1) {\n\t\tgetObj('fees_default').value = {$allPeopleText};\n\t} else if (value == 2) {\n\t\tgetObj('fees_default').value = {$maleText};\n\t} else if (value == 3) {\n\t\tgetObj('fees_default').value = {$femaleText};\n\t}\n}\n</script>";
            }
            if ($data['fieldname'] == 'paymethod') {
                //现金支付和支付宝换位
                krsort($data['rules']);
                reset($data['rules']);
            }
            foreach ($data['rules'] as $rk => $rv) {
                $i++;
                $checked = '';
                $rv_value = substr($rv, 0, strpos($rv, '='));
                $rv_name = substr($rv, strpos($rv, '=') + 1);
                if ($data['fieldvalue']) {
                    $rv_value == $data['fieldvalue'] && ($checked = 'checked');
                } elseif (in_array($data['fieldname'], array('paymethod', 'userlimit', 'genderlimit'))) {
                    if ($data['fieldname'] == 'paymethod') {
                        //如果已经绑定并且实名认证通过
                        $tradeinfo = $this->db->get_value("SELECT tradeinfo FROM pw_memberinfo WHERE uid=" . S::sqlEscape($this->winduid));
                        if ($tradeinfo) {
                            $tradeinfo = unserialize($tradeinfo);
                            $iscertified = $tradeinfo['iscertified'];
                            $user_id = $tradeinfo['user_id'];
                        }
                        if ($user_id && $iscertified == 'T' && $rv_value == 1) {
                            $checked = 'checked';
                            $payDbTemp = array();
                            $payDbTemp['alipay'] = 1;
                        }
                        if (!$payDbTemp['alipay'] && $rv_value == 2) {
                            $checked = 'checked';
                        }
                    }
                    if ($data['fieldname'] == 'userlimit' && $rv_value == 1) {
                        $checked = 'checked';
                    }
                    if ($data['fieldname'] == 'genderlimit' && $rv_value == 1) {
                        $checked = 'checked';
                    }
                } elseif ($i == 1) {
                    $checked = 'checked';
                }
                if ($data['fieldname'] == 'paymethod' && $rv_value == 1 && !$this->getPeopleAlreadyPaid()) {
                    $onchange = "onclick=\"user_authentication(this.value);\"";
                    $acthtml .= "\n<script type=\"text/javascript\">\nfunction user_authentication(paymethod) {\n\tif (paymethod == 1) {\n\t\tajax.send('pw_ajax.php?action=activity&job=user_authentication','',function(){\n\t\t\tvar rText = ajax.request.responseText.split('\t');\n\t\t\tif (rText[0] == 'iscertified_fail') {\n\t\t\t\tshowDialog('warning','" . getLangInfo('other', 'act_unauth_alipay') . "');return false;\n\t\t\t} else if (rText[0] == 'isbinded_fail') {\n\t\t\t\tshowDialog('warning','" . getLangInfo('other', 'act_unbind_alipay') . "');return false;\n\t\t\t} else {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t});\n\t} else {\n\t\treturn false;\n\t}\n}\n</script>";
                }
                if ($data['fieldname'] == 'paymethod' && $action == 'modify' && ($this->getPeopleAlreadySignup() || in_array($activityStatusKey, array('activity_is_ended', 'activity_is_running')))) {
                    //已有人支付、活动已结束、活动进行中
                    if ($rv_value == $data['fieldvalue']) {
                        $acthtml .= "<span class=\"fl w\"><input type=\"hidden\" value=\"" . $data['fieldvalue'] . "\" name=\"act[" . $data['fieldname'] . "]\" id=\"AlreadyPaid\" /> {$rv_name} </span>";
                    } else {
                        $acthtml .= '';
                    }
                } else {
                    $acthtml .= "<span class=\"fl w\"><input {$onchange} type=\"radio\" name=\"act[" . $data['fieldname'] . "]\" value=\"{$rv_value}\" {$checked} /> {$rv_name} </span>";
                }
            }
        } elseif ($data['type'] == 'checkbox') {
            foreach ($data['rules'] as $ck => $cv) {
                $checked = '';
                if ($data['ifmust']) {
                    $pccheck = "check=\"1-\"";
                } else {
                    $pccheck = "";
                }
                $cv_value = substr($cv, 0, strpos($cv, '='));
                $cv_name = substr($cv, strpos($cv, '=') + 1);
                if (strpos("," . $data['fieldvalue'] . ",", "," . $cv_value . ",") !== false) {
                    $checked = 'checked';
                }
                $acthtml .= "<span class=\"fl w\"><input {$pccheck} type=\"checkbox\" name=\"act[" . $data['fieldname'] . "][]\" value=\"{$cv_value}\" {$checked} /> {$cv_name} </span>";
            }
        } elseif ($data['type'] == 'textarea') {
            $acthtml .= "<textarea type=\"text\" {$pccheck} name=\"act[" . $data['fieldname'] . "]\" rows=\"4\" class=\"input\" cols=\"" . $data['textwidth'] . "\"/>" . $data['fieldvalue'] . "</textarea>";
        } elseif ($data['type'] == 'select') {
            $acthtml .= "<select name=\"act[" . $data['fieldname'] . "]\">";
            foreach ($data['rules'] as $sk => $sv) {
                $selected = '';
                $sv_value = substr($sv, 0, strpos($sv, '='));
                $sv_name = substr($sv, strpos($sv, '=') + 1);
                $sv_value == $data['fieldvalue'] && ($selected = 'selected');
                $acthtml .= "<option value=\"{$sv_value}\" {$selected}>{$sv_name}</option>";
            }
            $acthtml .= "</select>";
        } elseif ($data['type'] == 'calendar') {
            $activityStatusKey = $this->getActivityStatusKey($mergedField, $this->timestamp, $this->peopleAlreadySignup($tid));
            //获取活动状态
            if (!$data['ifdel'] && $action == 'modify' && ('activity_is_ended' == $activityStatusKey || 'signupstarttime' == $data['fieldname'] && $this->getPeopleAlreadySignup() || 'signup_is_ended' == $activityStatusKey && $this->getPeopleAlreadyPaid() && in_array($data['fieldname'], array('signupstarttime', 'signupendtime')) || 'activity_is_running' == $activityStatusKey && $data['fieldname'] != 'endtime')) {
                //活动已结束、已有人报名、报名结束、已有人支付、活动进行中
                $acthtml .= $this->getCalendarFieldHtml($data, 0);
            } else {
                $acthtml .= $this->getCalendarFieldHtml($data, 1);
            }
        } elseif ($data['type'] == 'upload') {
            $imgs = '';
            if ($data['fieldname'] == 'picture1') {
                $nonedisplay = '';
                if ($data['fieldvalue']) {
                    $nonedisplay = 'style="display:none;"';
                }
                $imgs .= "<div class=\"t_img\" {$nonedisplay} id=\"img_picture_0\"><img src=\"{$imgpath}/activity/no_img.png\"/></div>";
                for ($i = 1; $i <= 5; $i++) {
                    $picvalue = $data['fieldvalue']['picture' . $i];
                    $valuedisplay = '';
                    if (empty($picvalue)) {
                        $valuedisplay = 'style="display:none;"';
                    }
                    $picpath = PW_PostActivity::getActivityImgUrl($picvalue, true);
                    $imgs .= "<input id=\"fetch_{$i}\" type=\"hidden\" name=\"act[picture{$i}]\" value=\"{$picvalue}\"/><div {$valuedisplay} class=\"t_img\" id=\"img_picture_{$i}\"><img id=\"act_pic_" . $data['fieldid'] . "\" src=\"{$picpath}\"/><a href=\"javascript:;\" onclick=\"delpicture('{$i}','{$actmid}','{$tid}','" . $data['fieldid'] . "');return false;\">" . getLangInfo('other', 'pc_delimg') . "</a></div>";
                }
                $acthtml .= "{$imgs} <input type=\"button\" class=\"btn\" value=\"" . getLangInfo('other', 'act_upload_img') . "\" onclick=\"uploadpicture('{$actmid}')\"><p>" . $data['descrip'] . "</p>";
                $acthtml .= '
<script type="text/javascript">
function uploadpicture(actmid) {
	var total = 0;
	for (var i=1; i<=5; i++) {
		var element_name = "act[picture" + i + "]";
		var value = document.getElementsByName(element_name)[0].value;
		if (value != "") {
			continue;
		} else {
			total ++ ;
		}
	}
	if (total == 0) {
		showDialog("error","' . getLangInfo('other', 'act_upload_img_max') . '",2);return false;
	} else {
		try {ajax.send("pw_ajax.php?action=activity&job=upload&actmid="+actmid,"",ajax.get);} catch(e){}
	}
}
function delpicture(id,actmid,tid,fieldid){
	var total = 0;
	for (var i=1; i<=5; i++) {
		var element_name = "act[picture" + i + "]";
		var value = document.getElementsByName(element_name)[0].value;
		if (value != "") {
			continue;
		} else {
			total ++ ;
		}
	}
	if (total == 4) {
		getObj("img_picture_0").style.display = "";
	}
	fieldid = parseInt(fieldid);
	id = parseInt(id);
	fieldid = fieldid + id - 1;
	ajax.send("pw_ajax.php?action=activity&job=delimg","actmid="+actmid+"&fieldid="+fieldid+"&tid="+tid+"&attachment="+getObj("fetch_"+id).value,function(){
		var rText = ajax.request.responseText;
		if (rText == "success") {
			getObj("img_picture_" + id).style.display = "none";
			getObj("img_picture_" + id).children[0].src = "";
			document.getElementsByName("act[picture" + id + "]")[0].value = "";
		} else {
			showDialog("error","' . getLangInfo('other', 'act_delete_fail') . '",2);return false;
			return false;
		}
	});
}
</script>';
            } elseif (in_array($data['fieldname'], array('picture2', 'picture3', 'picture4', 'picture5'))) {
                $acthtml .= "";
            } else {
                if ($data['fieldvalue']) {
                    $data['fieldvalue'] = PW_PostActivity::getActivityImgUrl($data['fieldvalue'], true);
                    $imgs = "<span id=\"img_" . $data['fieldid'] . "\"><img src=\"{$data['fieldvalue']}\" width=\"195px\"/><a href=\"javascript:;\" onclick=\"delimg('{$actmid}','" . $data['fieldid'] . "');\">" . getLangInfo('other', 'pc_delimg') . "</a></span>";
                    $imgs .= "\n<script>\nfunction delimg(actmid,fieldid) {\najax.send('pw_ajax.php?action=activity&job=delimg','actmid='+actmid+'&fieldid='+fieldid+'&tid='+'{$tid}',function(){\n    var rText = ajax.request.responseText;\n    if (rText == 'success') {\n        showDialog('success','" . getLangInfo('other', 'act_delete_success') . "',2); return false;\n        getObj('img_'+fieldid).style.display = 'none';\n    } else {\n        showDialog('error','" . getLangInfo('other', 'act_delete_fail') . "',2);return false;\n        return false;\n    }\n});\n}\n</script>";
                }
                $acthtml .= "<input type=\"file\" class=\"bt\" name=\"act_" . $data['fieldid'] . "\" size=\"" . $data['textwidth'] . "\">{$imgs}";
            }
        } else {
            $acthtml = "";
        }
        return $acthtml;
    }