Example #1
0
function getatypeselect($var = "", $value = "", $other = "")
{
    $Table = new TableClass("atype", "typeid");
    $arraydata = $Table->getdata('', '', 'typeid asc');
    foreach ($arraydata as $val) {
        $arrayoption[$val['typeid']] = $val['typename'];
    }
    return getselectstr($var, $arrayoption, $value, $other);
}
Example #2
0
function getareaselect($var = "", $value = "", $other = "")
{
    $Table = new TableClass("area", "aid");
    $arraydata = $Table->getdata('', '', 'aid asc');
    foreach ($arraydata as $val) {
        $arrayoption[$val['aid']] = $val['name_cn'];
    }
    return getselectstr($var, $arrayoption, $value, $other);
}
Example #3
0
function pklabel($showarr, $isall = 1)
{
    global $_G, $_SGLOBAL, $alang, $lang, $mname;
    $thetext = $htmltext = $thelang = '';
    if (!empty($showarr['alang'])) {
        if (isset($alang[$showarr['alang']])) {
            $thelang = $alang[$showarr['alang']];
        } else {
            $thelang = $showarr['alang'];
        }
    } elseif (!empty($showarr['lang'])) {
        if (isset($lang[$showarr['lang']])) {
            $thelang = $lang[$showarr['lang']];
        } else {
            $thelang = $showarr['lang'];
        }
    }
    if (!isset($showarr['name'])) {
        $showarr['name'] = '';
    }
    if (!isset($showarr['size'])) {
        $showarr['size'] = 30;
    }
    if (!isset($showarr['maxlength'])) {
        $showarr['maxlength'] = '';
    }
    if (!isset($showarr['value'])) {
        $showarr['value'] = '';
    }
    if (!isset($showarr['values'])) {
        $showarr['values'] = array();
    }
    if (!isset($showarr['options'])) {
        $showarr['options'] = array();
    }
    if (!isset($showarr['other'])) {
        $showarr['other'] = '';
    }
    if (!isset($showarr['display'])) {
        $showarr['display'] = '';
    }
    if (!isset($showarr['hots'])) {
        $showarr['hots'] = array();
    }
    if (!isset($showarr['lasts'])) {
        $showarr['lasts'] = array();
    }
    if (!isset($showarr['btnname'])) {
        $showarr['btnname'] = '';
    }
    if (!isset($showarr['title'])) {
        $showarr['title'] = '';
    }
    if (!isset($showarr['mode'])) {
        $showarr['mode'] = '0';
    }
    if (!isset($showarr['cols'])) {
        $showarr['cols'] = '';
    }
    if (!isset($showarr['fileurl'])) {
        $showarr['fileurl'] = '';
    }
    switch ($showarr['type']) {
        case 'input':
            showsetting($showarr['alang'], $showarr['name'], $showarr['value'], 'text', '', '', '', $showarr['other'], $showarr['required']);
            break;
        case 'file':
            showsetting($showarr['alang'], $showarr['name'], $showarr['value'], 'file', '', '', '', $showarr['other'], $showarr['required']);
            if (!empty($showarr['value'])) {
                echo "\n" . '<tr class="noborder"><td class="vtop rowform">
<a href="' . $showarr['fileurl'] . '" target="_blank">' . $showarr['value'] . '</a></td><td class="vtop tips2"><a href="javascript:;" title="Delete" onclick="document.getElementById(\'' . $showarr['name'] . '_value\').value=\'\'; this.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode);">' . lang('delete') . '</a></td></tr>';
            }
            break;
        case 'edit':
            if (pkperm('isadmin')) {
                $enablealbum = 1;
            } else {
                if ($_SGLOBAL['panelinfo']['enablealbum']) {
                    $enablealbum = 1;
                } else {
                    $enablealbum = 0;
                }
            }
            echo "<script type=\"text/javascript\">var enablealbum={$enablealbum};</script>";
            echo "<script type=\"text/javascript\" charset=\"utf-8\" src=\"static/js/editor/xheditor-zh-cn.js\"></script>\n\t\t\t\t<tr><td class=\"td27\" colspan=\"2\">" . lang($showarr['alang']) . "{$showarr[required]}</td></tr>\n\t\t\t\t<tr class=\"noborder\"><td class=\"vtop rowform\" colspan=\"2\">\n\t\t\t\t<textarea cols=\"100\" id=\"{$showarr[name]}\" name=\"{$showarr[name]}\" rows=\"20\" style=\"width:600px;\" class=\"xheditor {tools:'Bold,Italic,Underline,Strikethrough,FontSize,FontColor,BackColor,Separator,Align,List,Separator,Link,Img,About',skin:'default'}\">{$showarr[value]}</textarea>\n\t\t\t\t</td></tr>";
            break;
        case 'textarea':
            showsetting($showarr['alang'], $showarr['name'], $showarr['value'], 'textarea', '', '', '', $showarr['other'], $showarr['required']);
            break;
        case 'select':
            $optionarr = array();
            foreach ($showarr['options'] as $key => $value) {
                $optionarr[$key][0] = $key;
                $optionarr[$key][1] = $value['pre'] . $value['name'];
            }
            showsetting($showarr['alang'], array($showarr['name'], $optionarr), $showarr['value'], 'select', '', '', '', $showarr['other'], $showarr['required']);
            break;
        case 'radio':
            showsetting($showarr['alang'], $showarr['name'], $showarr['value'], 'radio', '', '', '', $showarr['other'], $showarr['required']);
            break;
        case 'radio_a':
            showsetting($showarr['alang'], $showarr['name'], $showarr['value'], 'radio_a', '', '', '', $showarr['other'], $showarr['required']);
            break;
        case 'checkbox':
            $thetext = '';
            $i = 0;
            $thetext = '<table class="freetable"><tr>';
            foreach ($showarr['options'] as $tmpkey => $tmpvalue) {
                $thetext .= '<td><input name="' . $showarr['name'] . '[]" type="checkbox" value="' . $tmpkey . '"' . $showarr['other'] . ' />' . $tmpvalue . '</td>';
                if ($i % 5 == 4) {
                    $thetext .= '</tr><tr>';
                }
                $i++;
            }
            $thetext .= '</tr></table>';
            if (!empty($showarr['value'])) {
                if (is_array($showarr['value'])) {
                    $showvaluearr = $showarr['value'];
                } else {
                    $showvaluearr = explode(',', $showarr['value']);
                }
                foreach ($showvaluearr as $showvalue) {
                    $showvalue = trim($showvalue);
                    $thetext = str_replace('value="' . $showvalue . '"', 'value="' . $showvalue . '" checked', $thetext);
                }
            }
            break;
        case 'date':
            $datearr = array('0' => $alang['space_date_null'], '86400' => $alang['space_date_day_1'], '172800' => $alang['space_date_day_2'], '604800' => $alang['space_date_week_1'], '1209600' => $alang['space_date_week_2'], '2592000' => $alang['space_date_month_1'], '7948800' => $alang['space_date_month_3'], '15897600' => $alang['space_date_month_6'], '31536000' => $alang['space_date_year_1']);
            $thetext = getselectstr($showarr['name'], $datearr, $showarr['value']);
            break;
        case 'time':
            $thetext = '<input name="' . $showarr['name'] . '" readonly type="text" id="' . $showarr['name'] . '" value="' . $showarr['value'] . '"/><img src="static/image/admin/time.gif" onClick="getDatePicker(\'' . $showarr['name'] . '\',event,21)"/>';
            break;
        case 'hidden':
            $htmltext = '<tr><td colspan="2" style="display:none"><input name="' . $showarr['name'] . '" type="hidden" value="' . $showarr['value'] . '"' . $showarr['other'] . ' /></td></tr>';
            break;
        default:
            $thetext = '';
            break;
    }
    if (!$isall) {
        return $thetext;
    }
    return $htmltext . "\n";
}
Example #4
0
</table>
';
//LIST SHOW
if (is_array($listarr) && $listarr) {
    //FILTER
    $searcharr = array('tagname' => $alang['tag_search_tagname'], 'tagid' => $alang['tag_search_tagid'], 'username' => $alang['tag_search_username'], 'uid' => $alang['tag_search_uid']);
    $closearr = array('0' => $alang['tag_close_0'], '1' => $alang['tag_close_1']);
    $orderarr = array('' => $alang['space_order_default'], 'dateline' => $alang['tag_order_dateline'], 'uid' => $alang['tag_order_uid'], 'spacenewsnum' => $alang['tag_order_spacenewsnum']);
    $scarr = array('DESC' => $alang['space_sc_desc'], 'ASC' => $alang['space_sc_asc']);
    echo label(array('type' => 'form-start', 'name' => 'searchform', 'action' => $theurl));
    echo label(array('type' => 'help', 'text' => $alang['help_tag']));
    echo label(array('type' => 'table-start', 'class' => 'toptable'));
    echo '<tr><td>';
    echo ' ' . $alang['tag_search'] . ': ' . getselectstr('searchtype', $searcharr) . ' <input type="text" name="searchkey" size="20" value="" /> ';
    echo ' ' . $alang['tag_close'] . ': ' . getselectstr('close', $closearr);
    echo ' ' . $alang['tag_order'] . ': ' . getselectstr('order', $orderarr) . ' ' . getselectstr('sc', $scarr);
    echo ' <input type="submit" name="viewsubmit" value="' . $alang['tag_view_submit'] . '" />';
    echo '</td></tr>';
    echo label(array('type' => 'table-end'));
    echo label(array('type' => 'form-end'));
    $adminmenuarr = array('noop' => $alang['space_no_op'], 'close' => $alang['tag_op_close'], 'merge' => $alang['tag_op_merge'], 'delete' => $alang['poll_delete']);
    $adminmenu = $alang['space_batch_op'] . '</th><th>';
    $adminmenu .= '<input type="checkbox" name="chkall" onclick="checkall(this.form, \'item\')">' . $alang['space_select_all'];
    foreach ($adminmenuarr as $key => $value) {
        if ($key == 'noop') {
            $acheck = ' checked';
        } else {
            $acheck = '';
        }
        $adminmenu .= '<input type="radio" name="operation" value="' . $key . '" onClick="jsop(this.value)"' . $acheck . '> ' . $value;
    }
Example #5
0
/**
 * 用于后台HTML的显示调用函数。
 *
 * @param array $showarr:
 * return
*/
function label($showarr, $isall = 1)
{
    global $_SGLOBAL, $_SCONFIG, $alang, $lang;
    $thetext = $htmltext = $thelang = '';
    if (!empty($showarr['alang'])) {
        if (isset($alang[$showarr['alang']])) {
            $thelang = $alang[$showarr['alang']];
        } else {
            $thelang = $showarr['alang'];
        }
    } elseif (!empty($showarr['lang'])) {
        if (isset($lang[$showarr['lang']])) {
            $thelang = $lang[$showarr['lang']];
        } else {
            $thelang = $showarr['lang'];
        }
    }
    if (!isset($showarr['name'])) {
        $showarr['name'] = '';
    }
    if (!isset($showarr['size'])) {
        $showarr['size'] = 30;
    }
    if (!isset($showarr['maxlength'])) {
        $showarr['maxlength'] = '';
    }
    if (!isset($showarr['value'])) {
        $showarr['value'] = '';
    }
    if (!isset($showarr['values'])) {
        $showarr['values'] = array();
    }
    if (!isset($showarr['options'])) {
        $showarr['options'] = array();
    }
    if (!isset($showarr['other'])) {
        $showarr['other'] = '';
    }
    if (!isset($showarr['display'])) {
        $showarr['display'] = '';
    }
    if (!isset($showarr['hots'])) {
        $showarr['hots'] = array();
    }
    if (!isset($showarr['lasts'])) {
        $showarr['lasts'] = array();
    }
    if (!isset($showarr['btnname'])) {
        $showarr['btnname'] = '';
    }
    if (!isset($showarr['title'])) {
        $showarr['title'] = '';
    }
    if (!isset($showarr['mode'])) {
        $showarr['mode'] = '0';
    }
    if (!isset($showarr['cols'])) {
        $showarr['cols'] = '';
    }
    if (!isset($showarr['fileurl'])) {
        $showarr['fileurl'] = '';
    }
    switch ($showarr['type']) {
        case 'input':
            $thetext = '<input name="' . $showarr['name'] . '" type="text" id="' . $showarr['name'] . '" size="' . $showarr['size'] . '" value="' . $showarr['value'] . '"' . $showarr['other'] . ' />';
            break;
        case 'file':
            $thetext = '<input name="' . $showarr['name'] . '" type="file" id="' . $showarr['name'] . '" size="' . $showarr['size'] . '" ' . $showarr['other'] . ' />' . "\n" . '<input name="' . $showarr['name'] . '_value" type="hidden" id="' . $showarr['name'] . '_value" value="' . $showarr['value'] . '" />';
            if (!empty($showarr['value'])) {
                $thetext .= "\n" . '<div id="' . $showarr['name'] . '_dv"><a href="' . $showarr['fileurl'] . '" target="_blank">' . $showarr['value'] . '</a>&nbsp;<a href="javascript:;" title="Delete" onclick="document.getElementById(\'' . $showarr['name'] . '_value\').value=\'\'; this.parentNode.parentNode.removeChild(this.parentNode);">' . $lang['delete'] . '</a></div>';
            }
            break;
        case 'password':
            $thetext = '<input name="' . $showarr['name'] . '" type="password" id="' . $showarr['name'] . '" size="' . $showarr['size'] . '" value="' . $showarr['value'] . '"' . $showarr['other'] . ' />';
            break;
        case 'input2':
            if (!isset($showarr['value'][0])) {
                $showarr['value'][0] = '';
            }
            if (!isset($showarr['value'][1])) {
                $showarr['value'][1] = '';
            }
            $thetext = '<input name="' . $showarr['name'] . '[]" type="text" id="' . $showarr['name'] . '0" size="' . $showarr['size'] . '" value="' . $showarr['value'][0] . '"' . $showarr['other'] . ' />';
            $thetext .= ' ~ ';
            $thetext .= '<input name="' . $showarr['name'] . '[]" type="text" id="' . $showarr['name'] . '1" size="' . $showarr['size'] . '" value="' . $showarr['value'][1] . '"' . $showarr['other'] . ' />';
            break;
        case 'edit':
            $showarr['value'] = addcslashes($showarr['value'], '/"\\');
            $showarr['value'] = str_replace("\r", '\\r', $showarr['value']);
            $showarr['value'] = str_replace("\n", '\\n', $showarr['value']);
            $text = '
			<script type="text/javascript">
			function init() {
				et = new word("' . $showarr['name'] . '", "' . $showarr['value'] . '", ' . $showarr['mode'] . ', ' . $showarr['op'] . ');
			}
			if(window.Event) {
				window.onload = init;
			} else {
				init();
			}
			</script>
			';
            $htmltext .= '<tr><td><div id="fulledit" class="editerTextBox"><div id="' . $showarr['name'] . '" class="editerTextBox"></div></div>' . $text . '</td></tr>';
            break;
        case 'textarea':
            $thetext = '<textarea name="' . $showarr['name'] . '" style="width:98%;" rows="' . $showarr['rows'] . '"' . $showarr['other'] . '>' . $showarr['value'] . '</textarea>';
            break;
        case 'select':
            $thetext = '<select name="' . $showarr['name'] . '" id="' . $showarr['name'] . '"' . $showarr['other'] . '>' . "\n";
            foreach ($showarr['options'] as $tmpkey => $tmpvalue) {
                if (strlen($showarr['value']) > 0 && $tmpkey == $showarr['value']) {
                    $tmpselected = ' selected';
                } else {
                    $tmpselected = '';
                }
                $thetext .= '<option value="' . $tmpkey . '"' . $tmpselected . '>' . shtmlspecialchars($tmpvalue) . '</option>' . "\n";
            }
            $thetext .= '</select>' . "\n";
            break;
        case 'select-div':
            if (!empty($showarr['radio'])) {
                $thetext = '<select name="' . $showarr['name'] . '" id="' . $showarr['name'] . '"' . $showarr['other'] . '>' . "\n";
                foreach ($showarr['options'] as $okey => $ovalue) {
                    $name = $ovalue['name'];
                    if (strlen($showarr['value']) > 0 && $okey == $showarr['value']) {
                        $oselected = ' selected';
                        //当前选中
                    } else {
                        $oselected = '';
                    }
                    $thetext .= '<option value="' . $okey . '"' . $oselected . '>' . $ovalue['pre'] . shtmlspecialchars($name) . '</option>' . "\n";
                }
                $thetext .= '</select>' . "\n";
                break;
            } else {
                $thetext = '<div id="div' . $showarr['name'] . '" style="background-color: #FFFFFF; border: 1px solid #7F9DB9; height: 120px;overflow:auto">' . "\n";
                foreach ($showarr['options'] as $tmpkey => $tmpvalue) {
                    $pre = $tmpvalue['pre'];
                    $pre .= '<input name="' . $showarr['name'] . '[]" type="checkbox" value="' . $tmpkey . '"' . $showarr['other'] . ' />';
                    $thetext .= '<div style="height:20px;">' . $pre . ' ' . $tmpvalue['name'] . '</div>' . "\n";
                }
                $thetext .= '</div>' . "\n";
                if (!empty($showarr['value'])) {
                    if (is_array($showarr['value'])) {
                        $showvaluearr = $showarr['value'];
                    } else {
                        $showvaluearr = explode(',', $showarr['value']);
                    }
                    foreach ($showvaluearr as $showvalue) {
                        $showvalue = trim($showvalue);
                        $thetext = str_replace('value="' . $showvalue . '"', 'value="' . $showvalue . '" checked', $thetext);
                    }
                }
            }
            break;
        case 'select-order':
            $scselarr = array('' => '----', 'ASC' => $alang['space_order_asc'], 'DESC' => $alang['space_order_desc']);
            $thetext = '<table class="freetable">';
            for ($i = 0; $i < 3; $i++) {
                if (!isset($showarr['order'][$i])) {
                    $showarr['order'][$i] = '';
                }
                if (!isset($showarr['sc'][$i])) {
                    $showarr['sc'][$i] = '';
                }
                $orderselstr = getselectstr('order[]', $showarr['options'], $showarr['order'][$i]);
                $scselstr = getselectstr('sc[]', $scselarr, $showarr['sc'][$i]);
                $thetext .= '<tr><td>' . $alang['space_order_' . $i] . '</td><td>' . $orderselstr . '</td><td>' . $scselstr . '</td></tr>';
            }
            $thetext .= '</table>';
            break;
        case 'select-div-preview':
            $thetext = '<div id="div' . $showarr['name'] . '" style="background-color: #F7F7F7; border: 1px solid #7F9DB9; height: 120px;overflow:auto">' . "\n";
            $thetext .= '<table><tr><td valign="top" style="background: #F7F7F7;border: 0;"><div id="div1' . $showarr['name'] . '" style="overflow:auto">';
            $divnote = '';
            $thejscode = '<script language="javascript">
			<!--
			function show' . $showarr['name'] . 'note(notekey) {
				var note=new Array();
			';
            foreach ($showarr['options'] as $tmpkey => $tmpvalue) {
                $thejscode .= 'note[' . $tmpkey . ']="' . str_replace('\\n', '<br>', jsstrip($tmpvalue['tplnote'])) . '";' . "\n";
                if (isset($showarr['id']) && $showarr['id']) {
                    $inputvalue = $tmpvalue['tplid'];
                } else {
                    $inputvalue = $tmpvalue['tplfilepath'];
                }
                if (strlen($showarr['value']) > 0 && $inputvalue == $showarr['value']) {
                    $tmpchecked = ' checked';
                    $divnote = nl2br($tmpvalue['tplnote']);
                } else {
                    $tmpchecked = '';
                }
                $thetext .= '<input name="' . $showarr['name'] . '" type="radio" value="' . $inputvalue . '"' . $tmpchecked . ' onclick="show' . $showarr['name'] . 'note(' . $tmpkey . ')" />' . $tmpvalue['tplname'] . "<br>\n";
            }
            $thetext .= '</div></td>';
            $thetext .= '<td valign="top" style="background: #F7F7F7;border: 0;"><div style="background-color: #FFFCCC; overflow:auto; padding: 0.3em;" id="div2' . $showarr['name'] . '">' . $divnote . '</div></td></tr></table>';
            $thetext .= '</div>';
            $thejscode .= '
			document.getElementById("div2' . $showarr['name'] . '").innerHTML=note[notekey];
			}
			//-->
			</script>';
            $thetext = $thejscode . $thetext;
            break;
        case 'select-input':
            $optionstr = '<select name="sl' . $showarr['name'] . '" onchange="changevalue(\'' . $showarr['name'] . '\', this.value)">';
            foreach ($showarr['options'] as $opkey => $opvalue) {
                $optionstr .= '<option value="' . $opkey . '">' . $opvalue . '</option>';
            }
            $optionstr .= '</select>';
            $optionstr = str_replace('value="' . $showarr['value'] . '"', 'value="' . $showarr['value'] . '" selected', $optionstr);
            $thetext = '<input name="' . $showarr['name'] . '" type="text" id="' . $showarr['name'] . '" size="' . $showarr['size'] . '" value="' . $showarr['value'] . '" /> ';
            $thetext .= $optionstr;
            break;
        case 'upload':
            $count = count($showarr['values']);
            if (empty($showarr['noinsert'])) {
                $showarr['noinsert'] = 0;
                $inserthtml = getuploadinserthtml($showarr['values']);
            } else {
                $inserthtml = getuploadinserthtml($showarr['values'], 1);
            }
            if (empty($showarr['allowtype'])) {
                $showarr['allowtype'] = '';
            }
            $thetext = '
			<div id="uploadbox">
			<div class="tabs">
			<a id="localuploadtab" href="javascript:;" onclick="hideshowtags(\'uploadbox\', \'localupload\');" class="current">' . $alang['html_func_thumb_local'] . '</a><a id="remoteuploadtab" href="javascript:;" onclick="hideshowtags(\'uploadbox\', \'remoteupload\');">' . $alang['html_func_thumb_remote'] . '</a>';
            if ($showarr['allowmax'] > 1) {
                $thetext .= '<a id="batchuploadtab" href="javascript:;" onclick="hideshowtags(\'uploadbox\', \'batchupload\');">' . $alang['html_func_thumb_batch'] . '</a>';
            }
            $thetext .= '</div>
				<div id="localupload">
					<table cellpadding="0" cellspacing="0">
						<tr>
							<th>' . $alang['html_func_thumb_select_file'] . ':</th>
							<td><input name="localfile" type="file" id="localfile" size="28" /></td>
							<td valign="bottom" rowspan="3" class="upbtntd"><button onclick="return uploadFile(0)">' . $alang['html_func_thumb_upload'] . '</button></td>
						</tr>
						<tr>
							<th>' . $alang['html_func_thumb_explain'] . ':</th>
							<td><input name="uploadsubject0" type="text" size="40" /></td>
						</tr>
					</table>
				</div>
				<div id="remoteupload" style="display: none;">
					<table cellpadding="0" cellspacing="0">
						<tr>
							<th>' . $alang['html_func_thumb_url'] . ':</th>
							<td><input type="text" size="40" name="remotefile" value="http://" /></td>
							<td valign="bottom" rowspan="2" class="upbtntd"><button onclick="return uploadFile(1)" />' . $alang['html_func_thumb_upload'] . '</button></td>
						</tr>
						<tr>
							<th>' . $alang['html_func_thumb_explain'] . ':</th>
							<td><input name="uploadsubject1" type="text" size="40" /></td>
						</tr>
					</table>
				</div>
				<div id="batchupload" style="display: none;">
					<table summary="" cellpadding="0" cellspacing="6" border="0" width="100%">
						<tr>
							<td><span id="batchdisplay"><input size="28" class="fileinput" id="batch_1" name="batchfile[]" onchange="insertimg(this)" type="file" /></span></td>
							<td class="upbtntd" align="right">
							<button id="doupfile" onclick="return uploadFile(2)">' . $alang['html_func_thumb_upload'] . '</button>
							</td>
						<tr>
							<td colspan="2">
							<div id="batchpreview"></div>
							</td>
						</tr>
						<tr>
							<td colspan="2">
							<button id="delall" name="delall" onclick="return delpic()" style="background: transparent; border: none; cursor: pointer; color: red; " >' . $alang['spaceimage_delete_images'] . '</button>
							</td>
						</tr>
					</table>
				</div>

				<p class="textmsg" id="divshowuploadmsg" style="display:none"></p>
				<p class="textmsg succ" id="divshowuploadmsgok" style="display:none"></p>
				<input type="hidden" id="uploadallowmax" name="uploadallowmax" value="' . $showarr['allowmax'] . '">
				<input type="hidden" name="uploadallowtype" value="' . $showarr['allowtype'] . '">
				<input type="hidden" name="thumbwidth" value="' . $showarr['thumb'][0] . '">
				<input type="hidden" name="thumbheight" value="' . $showarr['thumb'][1] . '">
				<input type="hidden" name="noinsert" value="' . $showarr['noinsert'] . '">
			</div>
			';
            $thetext .= '<div id="divshowupload">' . $inserthtml . '</div>';
            break;
        case 'uploadpic':
            $thetext = '
			<script type="text/javascript">
			<!--
			var maxWidth=110;
			var maxHeight=120;
			var fileTypes=["jpg","gif"];
			var outImage="previewField";
			var defaultPic="' . $showarr['thumb'] . '";
			var globalPic;
		
			function preview(what){
				var source=what.value;
				var ext=source.substring(source.lastIndexOf(".")+1,source.length).toLowerCase();
				for (var i=0; i<fileTypes.length; i++) if (fileTypes[i]==ext) break;
				globalPic=new Image();
				if (i<fileTypes.length) globalPic.src=source;
				else {
					globalPic.src=defaultPic;
					what.outerHTML = what.outerHTML.replace(/value=\\w/g,"");
					alert("' . $lang['document_type_error'] . ': "+fileTypes.join(", "));
				}
				setTimeout("applyChanges()",200);
			}
			
			function applyChanges(){
				var field=document.getElementById(outImage);
				var x=parseInt(globalPic.width);
				var y=parseInt(globalPic.height);
				if (x>maxWidth) {
					y*=maxWidth/x;
					x=maxWidth;
				}
				if (y>maxHeight) {
					x*=maxHeight/y;
					y=maxHeight;
				}
				field.style.display=(x<1 || y<1)?"none":"";
				field.src=globalPic.src;
				field.width=x;
				field.height=y;
			}
			//-->
			</script>
			<img alt="preview" id="previewField" src="' . $showarr['thumb'] . '" width="110" height="120" ><br />
			<input type="file" name="' . $showarr['name'] . '" id="' . $showarr['name'] . '" onchange="preview(this)" size="15" >';
            break;
        case 'tag':
            $nowstr = '';
            $showvaluearr = array();
            if (!empty($showarr['values'])) {
                if (is_array($showarr['values'])) {
                    $showvaluearr = $showarr['values'];
                } else {
                    $showvaluearr = explode(',', $showarr['values']);
                }
            }
            if (!empty($showvaluearr)) {
                foreach ($showvaluearr as $showvalue) {
                    $nowstr .= '<input type="button" name="tagnamebtn[]" value="' . $showvalue . '" onclick="deletetag(this)"><input type="hidden" name="tagname[]" id="tagnameid' . $showvalue . '" value="' . $showvalue . '">';
                }
            }
            $hotsrt = $comma = '';
            if (!empty($showarr['hots']) && is_array($showarr['hots'])) {
                foreach ($showarr['hots'] as $showvalue) {
                    $hotsrt .= $comma . '<a href="javascript:;" onclick="addtagname(\'' . $showvalue['tagname'] . '\', \'tagtext\')">' . $showvalue['tagname'] . '</a>';
                    $comma = '&nbsp;&nbsp;';
                }
            }
            $lastsrt = $comma = '';
            if (!empty($showarr['lasts']) && is_array($showarr['lasts'])) {
                foreach ($showarr['lasts'] as $showvalue) {
                    $lastsrt .= $comma . '<a href="javascript:;" onclick="addtagname(\'' . $showvalue['tagname'] . '\', \'tagtext\')">' . $showvalue['tagname'] . '</a>';
                    $comma = '&nbsp;&nbsp;';
                }
            }
            $thetext = '<table class="freetable">';
            $thetext .= '<tr><td><table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0" style="table-layout: fixed; word-wrap: break-word"><tr><td>
			<div id="tagtext">' . $nowstr . '</div></td></tr></table></td></tr>';
            $thetext .= '<tr><td><input type="text" name="newtagname" id="newtagname" size="15" value="" onKeyDown="if(event.keyCode==13) {addtag(\'newtagname\', \'tagtext\');return false;}">&nbsp;<input type="button" name="btaddtag" value="' . $alang['space_add_tag'] . '" onclick="addtag(\'newtagname\', \'tagtext\')"></td></tr>';
            if (!empty($hotsrt)) {
                $thetext .= '<tr><td>' . $alang['space_hot_tag'] . ': ' . $hotsrt . '</td></tr>';
            }
            if (!empty($lastsrt)) {
                $thetext .= '<tr><td>' . $alang['space_last_tag'] . ': ' . $lastsrt . '</td></tr>';
            }
            $thetext .= '</table>';
            break;
        case 'radio':
            $thetext = '';
            foreach ($showarr['options'] as $tmpkey => $tmpvalue) {
                if (strlen($showarr['value']) > 0 && $tmpkey == $showarr['value']) {
                    $tmpchecked = ' checked';
                } else {
                    $tmpchecked = '';
                }
                $thetext .= '<input name="' . $showarr['name'] . '" type="radio" value="' . $tmpkey . '"' . $tmpchecked . $showarr['other'] . ' />' . $tmpvalue . '&nbsp;&nbsp;';
            }
            break;
        case 'checkbox':
            $thetext = '';
            $i = 0;
            $thetext = '<table class="freetable"><tr>';
            foreach ($showarr['options'] as $tmpkey => $tmpvalue) {
                $thetext .= '<td><input name="' . $showarr['name'] . '[]" type="checkbox" value="' . $tmpkey . '"' . $showarr['other'] . ' />' . $tmpvalue . '</td>';
                if ($i % 5 == 4) {
                    $thetext .= '</tr><tr>';
                }
                $i++;
            }
            $thetext .= '</tr></table>';
            if (!empty($showarr['value'])) {
                if (is_array($showarr['value'])) {
                    $showvaluearr = $showarr['value'];
                } else {
                    $showvaluearr = explode(',', $showarr['value']);
                }
                foreach ($showvaluearr as $showvalue) {
                    $showvalue = trim($showvalue);
                    $thetext = str_replace('value="' . $showvalue . '"', 'value="' . $showvalue . '" checked', $thetext);
                }
            }
            break;
        case 'date':
            $datearr = array('0' => $alang['space_date_null'], '86400' => $alang['space_date_day_1'], '172800' => $alang['space_date_day_2'], '604800' => $alang['space_date_week_1'], '1209600' => $alang['space_date_week_2'], '2592000' => $alang['space_date_month_1'], '7948800' => $alang['space_date_month_3'], '15897600' => $alang['space_date_month_6'], '31536000' => $alang['space_date_year_1']);
            $thetext = getselectstr($showarr['name'], $datearr, $showarr['value']);
            break;
        case 'time':
            $thetext = '<input name="' . $showarr['name'] . '" readonly type="text" id="' . $showarr['name'] . '" value="' . $showarr['value'] . '"/><img src="' . S_URL . '/admin/images/time.gif" onClick="getDatePicker(\'' . $showarr['name'] . '\',event,21)"/>';
            break;
        case 'hidden':
            $htmltext = '<tr><td colspan="2" style="display:none"><input name="' . $showarr['name'] . '" type="hidden" value="' . $showarr['value'] . '"' . $showarr['other'] . ' /></td></tr>';
            break;
        case 'title':
            $htmltext = '<h2>' . $thelang . '</h2>';
            break;
        case 'help':
            $htmltext = '<table cellspacing="2" cellpadding="2" class="helptable"><tr><td>' . $showarr['text'] . '</td></tr></table>';
            break;
        case 'table-start':
            if ($showarr['name']) {
                $tblid = ' id="' . $showarr['name'] . '"';
            } else {
                $tblid = '';
            }
            if (isset($showarr['class'])) {
                $class = ' class="' . $showarr['class'] . '"';
            } else {
                $class = ' class="maintable"';
            }
            $htmltext = '<table cellspacing="0" cellpadding="0" width="100%" ' . $tblid . $class . '>' . "\n";
            break;
        case 'table-end':
            $htmltext = '</table>' . "\n";
            break;
        case 'div-start':
            if (empty($_SGLOBAL['_tmp_div_num'])) {
                $_SGLOBAL['_tmp_div_num'] = 1;
            } elseif ($_SGLOBAL['_tmp_div_num'] == 1) {
                $_SGLOBAL['_tmp_div_num'] = 2;
            } elseif ($_SGLOBAL['_tmp_div_num'] == 2) {
                $_SGLOBAL['_tmp_div_num'] = 3;
            } else {
                $_SGLOBAL['_tmp_div_num'] = 1;
            }
            $htmltext = '<div class="colorarea0' . $_SGLOBAL['_tmp_div_num'] . '">' . "\n";
            break;
        case 'div-end':
            $htmltext = '</div>' . "\n";
            break;
        case 'form-start':
            $htmltext = '<form method="post" name="' . $showarr['name'] . '" id="theform" action="' . $showarr['action'] . '" enctype="multipart/form-data"' . $showarr['other'] . '>' . "\n" . '<input type="hidden" name="formhash" value="' . formhash() . '">' . "\n";
            break;
        case 'form-end':
            $htmltext = '</form>' . "\n";
            break;
        case 'button-submit':
            $htmltext = '<input type="submit" name="' . $showarr['name'] . '" value="' . $showarr['value'] . '"' . $showarr['other'] . ' class="submit">' . "\n";
            break;
        case 'button-reset':
            $htmltext = '<input type="reset" name="' . $showarr['name'] . '" value="' . $showarr['value'] . '">' . "\n";
            break;
        case 'text':
            $thetext = $showarr['text'] . "\n";
        case 'eval':
            $htmltext = $showarr['text'] . "\n";
            break;
        default:
            $thetext = '';
            break;
    }
    if (!$isall) {
        return $thetext;
    }
    if (!empty($thetext)) {
        if (empty($showarr['display'])) {
            $tmpdisplay = '';
        } else {
            $tmpdisplay = ' style="display:none"';
        }
        if (empty($showarr['id'])) {
            $idname = 'tr_' . $showarr['name'];
        } else {
            $idname = $showarr['id'];
        }
        $htmltext = "" . '<tr id="' . $idname . '"' . $tmpdisplay . '>' . "\n" . '<th>' . $thelang . '</th>' . "\n" . '<td>' . $thetext . '</td>' . "\n" . '</tr>' . "\n";
    }
    return $htmltext . "\n";
}
				<tr>
					<td><a href="' . CPURL . '?action=modelmanages&mid=' . $_GET['mid'] . '" class="view">' . $alang['spaces_spacecp'] . '</a></td>
					<td><a href="' . CPURL . '?action=modelmanages&op=add&mid=' . $_GET['mid'] . '" class="add">' . $alang['release_information'] . '</a></td>
					<td ' . $folderarr[1] . '><a href="' . CPURL . '?action=modelfolders&mid=' . $_GET['mid'] . '">' . $alang['pending_box_management'] . '</a></td>
					<td ' . $folderarr[2] . '><a href="' . CPURL . '?action=modelfolders&mid=' . $_GET['mid'] . '&folder=2">' . $alang['waste_management_bins'] . '</a></td>
				</tr>
			</table>
		</td>
	</tr>
</table>
';
//FILTER SHOW
$orderarr = array('' => $alang['space_order_default'], 'dateline' => $alang['days']);
$scarr = array('ASC' => $alang['space_sc_asc'], 'DESC' => $alang['space_sc_desc']);
$orderselectstr = getselectstr('order', $orderarr);
$scselectstr = getselectstr('sc', $scarr);
$htmlstr = label(array('type' => 'form-start', 'name' => 'listform', 'action' => $newurl));
$htmlstr .= label(array('type' => 'table-start', 'class' => 'toptable'));
$htmlstr .= '<tr><td>';
$htmlstr .= $lang['subject'] . ':</label> <input type="text" name="searchkey" id="searchkey" value="' . $_SGET['searchkey'] . '" size="10" /> ';
$htmlstr .= $alang['space_order_filter'] . ': ' . $orderselectstr . ' ' . $scselectstr . ' <input type="hidden" name="mid" value="' . $_GET['mid'] . '"><input type="hidden" name="folder" value="' . $_SGET['folder'] . '"><input type="submit" name="filtersubmit" value="GO">';
$htmlstr .= '</td></tr>';
$htmlstr .= label(array('type' => 'table-end'));
$htmlstr .= label(array('type' => 'form-end'));
echo $htmlstr;
//LIST SHOW
echo label(array('type' => 'form-start', 'name' => 'listform', 'action' => $newurl, 'other' => ' onSubmit="return listsubmitconfirm(this)"'));
echo label(array('type' => 'table-start', 'class' => 'listtable'));
echo '<tr>';
echo '<th width="40">' . $alang['space_select'] . '</th>';
echo '<th>' . $alang['spaceblog_subject'] . '</th>';
Example #7
0
    }
    echo '<h2>' . $alang['ad_add_adtype'] . '</h2>
		<script language="javascript" src="' . S_URL . '/include/js/selectdate.js"></script>
		<form method="post" action="' . $theurl . '" enctype="multipart/form-data">
		<input type="hidden" name="formhash" value="' . formhash() . '">
		<table cellspacing="0" cellpadding="0" width="100%"  class="maintable">' . $adtypehtml;
    if ($system == 1) {
        echo '<tr><th>' . $alang['ad_title_subject'] . '</th><td><input type="text" size="30" name="title" value="' . $thevalue['title'] . '"></td></tr>' . '<input type="hidden" size="10" name="outwidth" value="' . $parameters['outwidth'] . '">' . '<input type="hidden" size="10" name="outheight" value="' . $parameters['outheight'] . '">' . '
			<tr><th>' . $alang['ad_title_dateline'] . '</th><td>
			<input type="text" size="30" name="starttime" value="' . $parameters['starttime'] . '" id="starttime" readonly>
			<img src=' . S_URL . '/admin/images/time.gif onClick="getDatePicker(\'starttime\',event,21)"/></td></tr>
			<tr><th>' . $alang['ad_title_endtime'] . '</th><td>
			<input type="text" size="30" name="endtime" value="' . $parameters['endtime'] . '" id="endtime" readonly>
			<img src=' . S_URL . '/admin/images/time.gif onClick="getDatePicker(\'endtime\',event,21)"/></td></tr></table>';
    } else {
        echo '<th>' . $alang['ad_title_type'] . '</th><td>' . getselectstr('pagestyle', $searcharr, $thevalue['style'], ' onchange="changepagetype(this)"') . '</td></tr>
		<tr><th>' . $alang['ad_title_subject'] . '</th><td><input type="text" size="30" name="title" value="' . $thevalue['title'] . '"></td></tr><tr id="style_type" style="display:' . $style_type . '"><th>' . $alang['ad_type'] . '</th><td><select name="type[]" size="10"  multiple="multiple"><option value="all" ' . $checkall . '>' . $alang['ad_type_all'] . '</option><option value="indexad" ' . $checkindexad . '>&nbsp;&nbsp;>>' . $alang['ad_adtype_index_page'] . '</option><option value="space" ' . $checkspacead . '>&nbsp;&nbsp;>>' . $alang['ad_adtype_space'] . '</option>';
        foreach ($_SSCONFIG['channel'] as $key => $value) {
            $selected = empty(${$key}) ? '' : 'selected';
            if (empty($value['name'])) {
                echo "<option value='{$key}' {$selected}>&nbsp;&nbsp;>>" . $lang[$value['nameid']] . "</option>";
            } else {
                echo "<option value='{$key}' {$selected}>&nbsp;&nbsp;>>" . $value['name'] . "</option>";
            }
        }
        echo '</select></td></tr>
			<tr id="style_pagetype" style="display:' . $style_pagetype . '"><th>' . $alang['ad_page'] . '</th><td>
			<input id="id_view_1" type="checkbox" name="pagetype[]" value="1" ' . $typecheck1 . '>' . $alang['ad_adtype_page_one'] . '&nbsp;&nbsp;
			<input id="id_view_2" type="checkbox" name="pagetype[]" value="2" ' . $typecheck2 . '>' . $alang['ad_adtype_page_two'] . '&nbsp;&nbsp;
			<input id="id_view_3" type="checkbox" name="pagetype[]" value="3" ' . $typecheck3 . '>' . $alang['ad_adtype_page_view'] . '</td></tr>
			<tr><th>' . $alang['ad_title_dateline'] . '</th><td>
Example #8
0
//THE VALUE SHOW
if (is_array($thevalue) && $thevalue) {
    $tplfilepatharr = array('' => $alang['style_select_file']);
    $tpldir = S_ROOT . './styles';
    if (is_dir($tpldir)) {
        $filedir = dir($tpldir);
        while (false !== ($entry = $filedir->read())) {
            if (strpos($entry, '.html.php') === false) {
            } else {
                $entrykey = str_replace('.html.php', '', $entry);
                $tplfilepatharr[$entrykey] = $entry;
            }
        }
    }
    echo label(array('type' => 'form-start', 'name' => 'thevalueform', 'action' => $theurl));
    echo label(array('type' => 'div-start'));
    echo label(array('type' => 'table-start'));
    echo label(array('type' => 'select', 'alang' => 'style_tpltype', 'name' => 'tpltype', 'options' => $tplstylearr, 'width' => '30%', 'value' => $thevalue['tpltype']));
    echo label(array('type' => 'input', 'alang' => 'style_tplname', 'name' => 'tplname', 'size' => '30', 'value' => $thevalue['tplname']));
    echo label(array('type' => 'textarea', 'alang' => 'style_tplnote', 'name' => 'tplnote', 'cols' => '80', 'rows' => '5', 'value' => $thevalue['tplnote']));
    echo label(array('type' => 'text', 'alang' => 'style_tplfilepath', 'text' => $alang['style_dir'] . ': styles (<a href="' . S_URL . '/admincp.php?action=styletpl&op=add" target="_blank"><strong>' . $alang['online_documentation_new_modular_style'] . '</strong></a>)<br>' . $alang['style_file'] . ': ' . getselectstr('tplfilepath', $tplfilepatharr, $thevalue['tplfilepath'])));
    echo label(array('type' => 'table-end'));
    echo label(array('type' => 'div-end'));
    echo '<div class="buttons">';
    echo label(array('type' => 'button-submit', 'name' => 'thevaluesubmit', 'value' => $alang['common_submit']));
    echo label(array('type' => 'button-reset', 'name' => 'thevaluereset', 'value' => $alang['common_reset']));
    echo '</div>';
    echo '<input name="tplid" type="hidden" value="' . $thevalue['tplid'] . '" />';
    echo '<input name="valuesubmit" type="hidden" value="yes" />';
    echo label(array('type' => 'form-end'));
}
Example #9
0
                 $coarr = explode("\n", $cfoptionstr);
                 $coarr = sarray_unique($coarr);
                 foreach ($coarr as $covalue) {
                     $covalue = trim($covalue);
                     $cfoptionarr[$covalue] = $covalue;
                 }
             }
             switch ($cvalue['type']) {
                 case 'input':
                     $inputstr = '<input name="customfieldtext[' . $cfvalue['customfieldid'] . '][' . $ckey . ']" type="text" size="30" value="' . $thecfarr[$ckey] . '" />';
                     break;
                 case 'textarea':
                     $inputstr = '<textarea name="customfieldtext[' . $cfvalue['customfieldid'] . '][' . $ckey . ']" rows="5" cols="60">' . $thecfarr[$ckey] . '</textarea>';
                     break;
                 case 'select':
                     $inputstr = getselectstr('customfieldtext[' . $cfvalue['customfieldid'] . '][' . $ckey . ']', $cfoptionarr, $thecfarr[$ckey]);
                     break;
                 case 'checkbox':
                     $inputstr = getcheckboxstr('customfieldtext[' . $cfvalue['customfieldid'] . '][' . $ckey . ']', $cfoptionarr, $thecfarr[$ckey]);
                     break;
             }
             $cfhtml .= '<tr><th>' . $cvalue['name'] . '</th><td>' . $inputstr . '</td></tr>';
         }
         $cfhtml .= '</tbody>';
     }
 }
 //CATEGORIES
 $clistarr = getcategory($type);
 $categorylistarr = array('0' => array('pre' => '', 'name' => '------'));
 foreach ($clistarr as $key => $value) {
     $categorylistarr[$key] = $value;
Example #10
0
                        case 'select':
                            $inputstr = getselectstr('customfieldtext[' . $cfvalue['customfieldid'] . '][' . $ckey . ']', $cfoptionarr, $thecfarr[$ckey]);
                            break;
                        case 'checkbox':
                            $inputstr = getcheckboxstr('customfieldtext[' . $cfvalue['customfieldid'] . '][' . $ckey . ']', $cfoptionarr, $thecfarr[$ckey]);
                            break;
                    }
                    $cfhtml .= '<tr><th>' . $cvalue['name'] . '</th><td>' . $inputstr . '</td></tr>';
                }
                $cfhtml .= '</tbody>';
            }
        }
        //处理语言包
        $alang['space_title_customfield'] = str_replace('spacecp.php', 'admincp.php', $alang['space_title_customfield']);
        eval("\$alang['space_title_customfield'] = \"" . $alang['space_title_customfield'] . "\";");
        $cfhtml = '<tr><th>' . $alang['space_title_customfield'] . '</th><td>' . getselectstr('customfieldid', $cfhtmlselect, $thevalue['customfieldid'], 'onchange="showdivcustomfieldtext()"') . '</td></tr>' . "\n" . $cfhtml;
        $jscftext = '
		<script language="javascript">
		<!--
		function showdivcustomfieldtext() {
			var cfindex = document.getElementById("customfieldid").selectedIndex;
			showtbody(cfindex);
		}	
		function showtbody(id) {
			for(i=1;i<=' . $tbodynum . ';i++){
				obj=document.getElementById("cf_"+i);
				if(i == id) {
					obj.style.display="";
				} else {
					obj.style.display="none";
				}
Example #11
0
    }
    echo label(array('type' => 'table-end'));
    echo '<div class="buttons">';
    echo label(array('type' => 'button-submit', 'name' => 'listsubmit', 'value' => $alang['common_submit']));
    echo label(array('type' => 'button-reset', 'name' => 'customfieldlistreset', 'value' => $alang['common_reset']));
    echo '</div>';
    echo label(array('type' => 'form-end'));
}
//one
if (is_array($thevalue) && $thevalue) {
    $cftypearr = array('input' => $alang['customfield_input'], 'textarea' => $alang['customfield_textarea'], 'select' => $alang['customfield_select'], 'checkbox' => $alang['customfield_check']);
    $isdefaultarr = array('0' => $alang['customfield_isdefault_0'], '1' => $alang['customfield_isdefault_1']);
    foreach ($channels['types'] as $value) {
        $typearr[$value['nameid']] = $value['name'];
    }
    $cftypestr = getselectstr('customfieldtype[]', $cftypearr);
    $jscustomfieldtext = '<table><tr valign="top">';
    $jscustomfieldtext .= '<td><input type="text" name="customfieldname[]" id="aaa" size="20" value="" /></td>';
    $jscustomfieldtext .= '<td>' . $cftypestr . '</td>';
    $jscustomfieldtext .= '<td><textarea name="customfieldoption[]" rows="5" cols="22"></textarea></td>';
    $jscustomfieldtext .= '</tr></table>';
    $customfield_text = '<div id="div_customfield"><table>';
    $customfield_text .= '<tr bgcolor="#DEE1E4" style="font-weight:bold" height="22">';
    $customfield_text .= '<td width="130">' . $alang['customfield_customfield_title1'] . '</td>';
    $customfield_text .= '<td width="75">' . $alang['customfield_customfield_title2'] . '</td>';
    $customfield_text .= '<td width="155">' . $alang['customfield_customfield_title3'] . '</td>';
    $customfield_text .= '</tr></table>';
    $cfarr = unserialize($thevalue['customfieldtext']);
    foreach ($cfarr as $cfkey => $cfvalue) {
        $thecftypestr = str_replace('value="' . $cfvalue['type'] . '"', 'value="' . $cfvalue['type'] . '" selected', $cftypestr);
        $customfield_text .= '<table><tr bgcolor="#FFFFFF" valign="top">';