本文整理汇总了PHP中upload_key函数的典型用法代码示例。如果您正苦于以下问题:PHP upload_key函数的具体用法?PHP upload_key怎么用?PHP upload_key使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了upload_key函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: image
/**
* 图片字段表单组合处理
* @param type $field 字段名
* @param type $value 字段内容
* @param type $fieldinfo 字段配置
* @return type
*/
function image($field, $value, $fieldinfo)
{
//错误提示
$errortips = $fieldinfo['errortips'];
if ($fieldinfo['minlength']) {
//验证规则
$this->formValidateRules['info[' . $field . ']'] = array("required" => true);
//验证不通过提示
$this->formValidateMessages['info[' . $field . ']'] = array("required" => $errortips ? $errortips : $fieldinfo['name'] . "不能为空!");
}
$setting = unserialize($fieldinfo['setting']);
$width = $setting['width'] ? $setting['width'] : 180;
$html = '';
//图片裁减功能只在后台使用
if (defined('IN_ADMIN') && IN_ADMIN) {
$html = " <input type=\"button\" class=\"btn\" onclick=\"crop_cut_" . $field . "(\$('#{$field}').val());return false;\" value=\"裁减图片\"> \n <input type=\"button\" class=\"btn\" onclick=\"\$('#" . $field . "_preview').attr('src','" . CONFIG_SITEURL_MODEL . "statics/images/icon/upload-pic.png');\$('#" . $field . "').val('');return false;\" value=\"取消图片\"><script type=\"text/javascript\">\n function crop_cut_" . $field . "(id){\n\tif ( id =='' || id == undefined ) { \n isalert('请先上传缩略图!');\n return false;\n }\n var catid = \$('input[name=\"info[catid]\"]').val();\n if(catid == '' ){\n isalert('请选择栏目ID!');\n return false;\n }\n Wind.use('artDialog','iframeTools',function(){\n art.dialog.open(GV.DIMAUB+'index.php?a=public_imagescrop&m=Content&g=Contents&catid='+catid+'&picurl='+encodeURIComponent(id)+'&input={$field}&preview=" . ($setting['show_type'] && defined('IN_ADMIN') ? $field . "_preview" : '') . "', {\n title:'裁减图片', \n id:'crop',\n ok: function () {\n var iframe = this.iframe.contentWindow;\n if (!iframe.document.body) {\n alert('iframe还没加载完毕呢');\n return false;\n }\n iframe.uploadfile();\n return false;\n },\n cancel: true\n });\n });\n };\n</script>";
}
//模块
$module = in_array(GROUP_NAME, array("Contents", "contents")) ? 'Contents' : GROUP_NAME;
//生成上传附件验证
$authkey = upload_key("1,{$setting['upload_allowext']},{$setting['isselectimage']},{$setting['images_width']},{$setting['images_height']},{$setting['watermark']}");
//图片模式
if ($setting['show_type']) {
$preview_img = $value ? $value : CONFIG_SITEURL_MODEL . 'statics/images/icon/upload-pic.png';
return $str . "<div style=\"text-align: center;\"><input type='hidden' name='info[{$field}]' id='{$field}' value='{$value}'>\n\t\t\t<a href='javascript:void(0);' onclick=\"flashupload('{$field}_images', '附件上传','{$field}',thumb_images,'1,{$setting['upload_allowext']},{$setting['isselectimage']},{$setting['images_width']},{$setting['images_height']},{$setting['watermark']}','{$module}','{$this->catid}','{$authkey}');return false;\">\n\t\t\t<img src='{$preview_img}' id='{$field}_preview' width='135' height='113' style='cursor:hand' /></a>\n <br/> " . $html . "\n </div>";
} else {
//文本框模式
return $str . "<input type='text' name='info[{$field}]' id='{$field}' value='{$value}' style='width:{$width}px;' class='input' /> <input type='button' class='button' onclick=\"flashupload('{$field}_images', '附件上传','{$field}',submit_images,'1,{$setting['upload_allowext']},{$setting['isselectimage']},{$setting['images_width']},{$setting['images_height']},{$setting['watermark']}','{$module}','{$this->catid}','{$authkey}')\"/ value='上传图片'>" . $html;
}
}
示例2: swfupload
/**
* swfupload上传附件
*/
public function swfupload(){
$grouplist = getcache('grouplist','member');
if(isset($_POST['dosubmit'])){
if( $_POST['swf_auth_key'] != md5(pc_base::load_config('system','auth_key').$_POST['SWFUPLOADSESSID']) || ($_POST['isadmin']==0 && !$grouplist[$_POST['groupid']]['allowattachment'])) exit();
pc_base::load_sys_class('attachment','',0);
$attachment = new attachment($_POST['module'],$_POST['catid'],$_POST['siteid']);
$attachment->set_userid($_POST['userid']);
$siteid = get_siteid();
$site_setting = get_site_setting($siteid);
$site_allowext = $site_setting['upload_allowext'];
$aids = $attachment->upload('Filedata',$site_allowext,'','',array($_POST['thumb_width'],$_POST['thumb_height']),$_POST['watermark_enable']);
if($aids[0]) {
$filename= (strtolower(CHARSET) != 'utf-8') ? iconv('gbk', 'utf-8', $attachment->uploadedfiles[0]['filename']) : $attachment->uploadedfiles[0]['filename'];
if($attachment->uploadedfiles[0]['isimage']) {
echo $aids[0].','.$this->upload_url.$attachment->uploadedfiles[0]['filepath'].','.$attachment->uploadedfiles[0]['isimage'].','.$filename;
} else {
$fileext = $attachment->uploadedfiles[0]['fileext'];
if($fileext == 'zip' || $fileext == 'rar') $fileext = 'rar';
elseif($fileext == 'doc' || $fileext == 'docx') $fileext = 'doc';
elseif($fileext == 'xls' || $fileext == 'xlsx') $fileext = 'xls';
elseif($fileext == 'ppt' || $fileext == 'pptx') $fileext = 'ppt';
elseif ($fileext == 'flv' || $fileext == 'swf' || $fileext == 'rm' || $fileext == 'rmvb') $fileext = 'flv';
else $fileext = 'do';
echo $aids[0].','.$this->upload_url.$attachment->uploadedfiles[0]['filepath'].','.$fileext.','.$filename;
}
exit;
} else {
echo '0,'.$attachment->error();
exit;
}
} else {
if($this->isadmin==0 && !$grouplist[$this->groupid]['allowattachment']) showmessage(L('att_no_permission'));
$args = $_GET['args'];
$authkey = $_GET['authkey'];
if(upload_key($args) != $authkey) showmessage(L('attachment_parameter_error'));
extract(getswfinit($_GET['args']));
$siteid = $this->get_siteid();
$site_setting = get_site_setting($siteid);
$file_size_limit = sizecount($site_setting['upload_maxsize']*1024);
$att_not_used = param::get_cookie('att_json');
if(empty($att_not_used) || !isset($att_not_used)) $tab_status = ' class="on"';
if(!empty($att_not_used)) $div_status = ' hidden';
//获取临时未处理文件列表
$att = $this->att_not_used();
$userid_flash=sys_auth($this->userid, 'ENCODE');
include $this->admin_tpl('swfupload');
}
}
示例3: downfile
/**
* 单文件上传字段表单组合处理
* @param type $field 字段名
* @param type $value 字段内容
* @param type $fieldinfo 字段配置
* @return type
*/
function downfile($field, $value, $fieldinfo)
{
//错误提示
$errortips = $fieldinfo['errortips'];
if ($fieldinfo['minlength']) {
//验证规则
$this->formValidateRules['info[' . $field . ']'] = array("required" => true);
//验证不通过提示
$this->formValidateMessages['info[' . $field . ']'] = array("required" => $errortips ? $errortips : $fieldinfo['name'] . "不能为空!");
}
//扩展配置
$setting = unserialize($fieldinfo['setting']);
//表单长度
$width = $setting['width'] ? $setting['width'] : 300;
//生成上传附件验证 //同时允许的上传个数, 允许上传的文件类型, 是否允许从已上传中选择
$authkey = upload_key("1,{$setting['upload_allowext']},{$setting['isselectimage']}");
//模块
$module = MODULE_NAME;
//文本框模式
return "<input type='text' name='info[{$field}]' id='{$field}' value='{$value}' style='width:{$width}px;' class='input' /> <input type='button' class='button' onclick=\"flashupload('{$field}_downfile', '附件上传','{$field}',submit_attachment,'1,{$setting['upload_allowext']},{$setting['isselectimage']}','{$module}','{$this->catid}','{$authkey}')\"/ value='上传文件'>";
}
示例4: images
/**
* 多图片字段类型表单组合处理
* @param type $field 字段名
* @param type $value 字段内容
* @param type $fieldinfo 字段值
* @return string
*/
function images($field, $value, $fieldinfo)
{
//错误提示
$errortips = $fieldinfo['errortips'];
//长度
if ($fieldinfo['minlength']) {
//验证规则
$this->formValidateRules['info[' . $field . ']'] = array("required" => true);
//验证不通过提示
$this->formValidateMessages['info[' . $field . ']'] = array("required" => $errortips ? $errortips : $fieldinfo['name'] . "不能为空!");
}
//字段扩展配置
$setting = unserialize($fieldinfo['setting']);
$list_str = '';
if ($value) {
$value = unserialize(html_entity_decode($value, ENT_QUOTES));
if (is_array($value)) {
foreach ($value as $_k => $_v) {
$list_str .= "<div id='image_{$field}_{$_k}' style='padding:1px'><input type='text' name='{$field}_url[]' value='{$_v['url']}' style='width:310px;' ondblclick='image_priview(this.value);' class='input'> <input type='text' name='{$field}_alt[]' value='{$_v['alt']}' style='width:160px;' class='input'> <a href=\"javascript:remove_div('image_{$field}_{$_k}')\">移除</a></div>";
}
}
} else {
$list_str .= "<center><div class='onShow' id='nameTip'>您最多每次可以同时上传 <font color='red'>{$setting['upload_number']}</font> 张</div></center>";
}
$string = '<input name="info[' . $field . ']" type="hidden" value="1">
<fieldset class="blue pad-10">
<legend>图片列表</legend>';
$string .= $list_str;
$string .= '<div id="' . $field . '" class="picList"></div>
</fieldset>
<div class="bk10"></div>
';
//模块
$module = MODULE_NAME;
//生成上传附件验证
$authkey = upload_key("{$setting['upload_number']},{$setting['upload_allowext']},{$setting['isselectimage']},,,{$setting['watermark']}");
$string .= $str . "<a herf='javascript:void(0);' onclick=\"javascript:flashupload('{$field}_images', '图片上传','{$field}',change_images,'{$setting['upload_number']},{$setting['upload_allowext']},{$setting['isselectimage']},,,{$setting['watermark']}','{$module}','{$this->catid}','{$authkey}')\" class=\"btn\"><span class=\"add\"></span>选择图片 </a>";
return $string;
}
示例5: upfiles
/**
*
* @param string $name 表单名称
* @param int $id 表单id
* @param string $value 表单默认值
* @param string $moudle 模块名称
* @param int $catid 栏目id
* @param int $size 表单大小
* @param string $class 表单风格
* @param string $ext 表单扩展属性 如果 js事件等
* @param string $alowexts 允许图片格式
* @param array $file_setting
*/
public static function upfiles($name, $id = '', $value = '', $moudle = '', $catid = '', $size = 50, $class = '', $ext = '', $alowexts = '', $file_setting = array())
{
if (!$id) {
$id = $name;
}
if (!$size) {
$size = 50;
}
//图片属性
if (!empty($file_setting) && count($file_setting)) {
$file_ext = $file_setting[0] . ',' . $file_setting[1];
} else {
$file_ext = ',';
}
if (!$alowexts) {
$alowexts = 'jpg|gif';
}
if (!defined('UPFILES_INIT')) {
$str = '<script type="text/javascript" src="' . CONFIG_SITEURL_MODEL . 'statics/js/content_addtop.js"></script>';
define('UPFILES_INIT', 1);
}
//1, 允许上传的文件类型, 是否允许从已上传中选择, 图片高度, 图片宽度,是否添加水印1是
$authkey = upload_key("1,{$alowexts},1,{$file_ext}");
return $str . "<input type=\"text\" name=\"{$name}\" id=\"{$id}\" value=\"{$value}\" size=\"{$size}\" class=\"{$class}\" {$ext}/> <input type=\"button\" class=\"button\" onclick=\"javascript:flashupload('{$id}_files', '附件上传','{$id}',submit_attachment,'1,{$alowexts},1,{$file_ext}','{$moudle}','{$catid}','{$authkey}')\"/ value=\"上传文件\">";
}
示例6: upfiles
/**
*
* @param string $name 表单名称
* @param int $id 表单id
* @param string $value 表单默认值
* @param string $moudle 模块名称
* @param int $catid 栏目id
* @param int $size 表单大小
* @param string $class 表单风格
* @param string $ext 表单扩展属性 如果 js事件等
* @param string $alowexts 允许上传的文件格式
* @param array $file_setting
*/
public static function upfiles($name, $id = '', $value = '', $moudle = '', $catid = '', $size = 50, $class = '', $ext = '', $alowexts = '', $file_setting = array())
{
if (!$id) {
$id = $name;
}
if (!$size) {
$size = 50;
}
if (!empty($file_setting) && count($file_setting)) {
$file_ext = $file_setting[0] . ',' . $file_setting[1];
} else {
$file_ext = ',';
}
if (!$alowexts) {
$alowexts = 'rar|zip';
}
if (!defined('IMAGES_INIT')) {
$str = '<script type="text/javascript" src="' . JS_PATH . 'swfupload/swf2ckeditor.js"></script>';
define('IMAGES_INIT', 1);
}
$authkey = upload_key("1,{$alowexts},1,{$file_ext}");
return $str . "<input type=\"text\" name=\"{$name}\" id=\"{$id}\" value=\"{$value}\" size=\"{$size}\" class=\"{$class}\" {$ext}/> <input type=\"button\" class=\"button\" onclick=\"javascript:flashupload('{$id}_files', '" . L('attachmentupload') . "','{$id}',submit_attachment,'1,{$alowexts},1,{$file_ext}','{$moudle}','{$catid}','{$authkey}')\"/ value=\"" . L('filesupload') . "\">";
}
示例7: upload_key
</script>
<script type="text/javascript">
//编辑器路径定义
var editorURL = GV.DIMAUB;
</script>
<script type="text/javascript" src="<?php
echo CONFIG_SITEURL_MODEL;
?>
statics/js/ueditor/editor_config.js"></script>
<script type="text/javascript" src="<?php
echo CONFIG_SITEURL_MODEL;
?>
statics/js/ueditor/editor_all_min.js"></script>
<script type="text/javascript">
<?php
$authkey = upload_key("10,,1,,,0");
?>
var editorcontent;
UE.commands['attachments'] = {
execCommand : function(cmd){
flashupload('flashupload', '附件上传','content',ueAttachment,'10,,1,,,0','Web','10','<?php
echo $authkey;
?>
');
},
queryCommandState : function(){
return this.highlight ? -1 :0;
}
};
var editor_config_content = {
_catid:'10',
示例8: images
function images($field, $value, $fieldinfo)
{
extract($fieldinfo);
$list_str = '';
if ($value) {
$value = string2array(new_html_entity_decode($value));
if (is_array($value)) {
foreach ($value as $_k => $_v) {
$list_str .= "<li id='image{$_k}' style='padding:1px'><input type='text' name='{$field}_url[]' value='{$_v[url]}' style='width:310px;' ondblclick='image_priview(this.value);' class='input-text'> <input type='text' name='{$field}_alt[]' value='{$_v[alt]}' style='width:160px;' class='input-text'> <a href=\"javascript:remove_div('image{$_k}')\">" . L('remove') . "</a></li>";
}
}
} else {
//$list_str .= "<input type='hidden' name='{$field}_url[]' value='0'>";
$list_str .= "<center><div class='onShow' id='nameTip'>" . L('max_upload_num') . " <font color='red'>{$upload_number}</font> " . L('zhang') . "</div></center>";
}
$string = '<input name="info[' . $field . ']" type="hidden" value="1">
<fieldset class="blue pad-10">
<legend>' . L('picutre_list') . '</legend>';
$string .= $list_str;
$string .= '<ul id="' . $field . '" class="picList"></ul>
</fieldset>
<div class="bk10"></div>
';
if (!defined('IMAGES_INIT')) {
$str = '<script type="text/javascript" src="statics/js/swfupload/swf2ckeditor.js"></script>';
define('IMAGES_INIT', 1);
} else {
$str = '';
}
$authkey = upload_key("{$upload_number},{$upload_allowext},{$isselectimage}");
$string .= $str . "<div class='picBut cu'><a herf='javascript:void(0);' onclick=\"javascript:flashupload('{$field}_images', '" . L('attachment_upload') . "','{$field}',change_images,'{$upload_number},{$upload_allowext},{$isselectimage}','member','','{$authkey}')\"/> " . L('select_picture') . " </a></div>";
return $string;
}
示例9: L
var charset = '<?php echo CHARSET?>';
var uploadurl = '<?php echo pc_base::load_config('system','upload_url')?>';
//-->
</script>
<script language="javascript" type="text/javascript" src="<?php echo JS_PATH?>content_addtop.js"></script>
<script language="javascript" type="text/javascript" src="<?php echo JS_PATH?>colorpicker.js"></script>
<script language="javascript" type="text/javascript" src="<?php echo JS_PATH?>cookie.js"></script>
<form name="myform" id="myform" action="?m=special&c=content&a=edit&specialid=<?php echo $_GET['specialid']?>&id=<?php echo $_GET['id']?>" method="post" enctype="multipart/form-data">
<div class="addContent">
<div class="crumbs"><?php echo L('edit_pos_info')?></div>
<div class="col-right">
<div class="col-1">
<div class="content pad-6">
<h6> <?php echo L('content_thumb')?></h6>
<div class="upload-pic img-wrap"><div class="bk10"></div><input type="hidden" name="info[thumb]" value="<?php echo $info['thumb']?>" id="thumb">
<a href="javascript:;" onclick="javascript:flashupload('thumb_images', '<?php echo L('file_upload')?>','thumb',thumb_images,'1,jpg|jpeg|gif|bmp|png,300,300','content','39','<?php echo upload_key('1,jpg|jpeg|gif|bmp|png,300,300')?>')"><img src="<?php if($info['thumb']) { echo $info['thumb']; } else {?>statics/images/icon/upload-pic.png<?php }?>" id="thumb_preview" width="135" height="113" style="cursor:hand" /></a><input type="button" style="width: 66px;" class="button" onclick="crop_cut($('#thumb').val());return false;" value="<?php echo L('crop_thumb')?>"><script type="text/javascript">function crop_cut(id){
if (id=='') { alert('<?php echo L('please_upload_thumb')?>');return false;}
window.top.art.dialog({title:'<?php echo L('crop_thumb')?>', id:'crop', iframe:'index.php?m=content&c=content&a=public_crop&module=ZLCMS&picurl='+encodeURIComponent(id)+'&input=thumb&preview=thumb_preview', width:'680px', height:'480px'}, function(){var d = window.top.art.dialog({id:'crop'}).data.iframe;
d.uploadfile();return false;}, function(){window.top.art.dialog({id:'crop'}).close()});
};</script></div>
<h6> <?php echo L('author')?></h6>
<input type="text" name="data[author]" value="<?php echo $data['author']?>" size="30">
<h6> <?php echo L('islink')?></h6>
<input type="text" name="linkurl" id="linkurl" value="<?php if($info['islink']) { echo $info['url']; }?>" size="30" maxlength="255"<?php if($info['islink']) {?> disabled<?php }?>> <input name="info[islink]" type="checkbox" id="islink" value="1"<?php if($info['islink']) {?> checked<?php }?> onclick="ruselinkurl();" > <font color="red"><?php echo L('islink')?></font>
<h6> <?php echo L('inputtime')?></h6> <?php echo form::date('info[inputtime]', format::date($info['inputtime'], 1) , 1);?>
<h6> <?php echo L('template_style')?></h6> <?php echo form::select($template_list, $data['style'], 'name="data[style]" id="style" onchange="load_file_list(this.value)"', L('please_select'))?>
<h6> <?php echo L('show_template')?></h6> <span id="show_template"><?php echo '<script type="text/javascript">$.getJSON(\'?m=zl_admin&c=category&a=public_tpl_file_list&style='.$style.'&id='.$data['show_template'].'&module=special&templates=show&name=data\', function(data){$(\'#show_template\').html(data.show_template);});</script>'?></span>
</div>
</div>
</div>
<div class="col-auto">
示例10: swfupload
//.........这里部分代码省略.........
if ((int) $this->_post('watermark_enable')) {
$Callback = array(array("AttachmentsAction", "water"), array());
}
//设置缩略图最大宽度
$upload->thumbMaxWidth = $this->_post("thumb_width");
//设置缩略图最大高度
$upload->thumbMaxHeight = $this->_post("thumb_height");
//上传目录 可以单独写个方法,根据栏目ID生成相对于栏目目录附件
$this->filepath = $upload->savePath = $Attachment->FilePath();
//开始上传
if ($upload->upload($Callback)) {
//上传成功
$info = $upload->getUploadFileInfo();
//写入附件数据库信息
$status = $Attachment->FileData($info[0]);
if ($status) {
if (in_array($info[0]['extension'], array("jpg", "png", "jpeg", "gif"))) {
// 附件ID 附件网站地址 图标(图片时为1) 文件名
echo "{$status}," . $Attachment->filehttp . ",1," . str_replace(array("\\", "/"), "", $info[0]['name']);
exit;
} else {
$fileext = $info[0]['extension'];
if ($fileext == 'zip' || $fileext == 'rar') {
$fileext = 'rar';
} elseif ($fileext == 'doc' || $fileext == 'docx') {
$fileext = 'doc';
} elseif ($fileext == 'xls' || $fileext == 'xlsx') {
$fileext = 'xls';
} elseif ($fileext == 'ppt' || $fileext == 'pptx') {
$fileext = 'ppt';
} elseif ($fileext == 'flv' || $fileext == 'swf' || $fileext == 'rm' || $fileext == 'rmvb') {
$fileext = 'flv';
} else {
$fileext = 'do';
}
echo "{$status}," . $Attachment->filehttp . "," . $fileext . "," . str_replace(array("\\", "/"), "", $info[0]['name']);
exit;
}
} else {
//删除已经上传的图片,这里逻辑还要优化
@unlink($info[0]['savepath'] . $info[0]['savename']);
exit("0,上传成功,但写库失败!");
}
} else {
//上传失败,返回错误
exit("0," . $upload->getErrorMsg());
}
} else {
//1,允许上传的文件类型,是否允许从已上传中选择,图片高度,图片高度,是否添加水印1是
$args = $this->_get('args');
$authkey = $this->_get('authkey');
$module = $this->_get("module");
if ($this->module_list[ucwords($module)]) {
$this->module = strtolower($module);
}
if (empty($args) || upload_key($args) != $authkey) {
$this->error("配置参数有误!");
}
if (!$this->isadmin) {
$Member_group = F("Member_group");
if ((int) $Member_group[$this->groupid]['allowattachment'] < 1) {
$this->error("所在的用户组没有附件上传权限!");
}
}
$info = explode(",", $args);
$this->catid = $this->_get('catid');
$att_not_used = cookie('att_json');
if (empty($att_not_used)) {
$tab_status = ' class="on"';
}
if (!empty($att_not_used)) {
$div_status = ' hidden';
}
//参数补充完整
if (empty($info[1])) {
//如果允许上传的文件类型为空,启用网站配置的 uploadallowext
if ($this->isadmin) {
$info[1] = CONFIG_UPLOADALLOWEXT;
} else {
$info[1] = CONFIG_QTUPLOADALLOWEXT;
}
}
//获取临时未处理的图片
$att = $this->att_not_used();
//var_dump($att);exit;
$this->assign("initupload", initupload($this->module, $this->catid, $args, $this->upuserid, $this->groupid, $this->isadmin));
//上传格式显示
$this->assign("file_types", implode(",", explode("|", $info[1])));
$this->assign("file_size_limit", $this->isadmin ? CONFIG_UPLOADMAXSIZE : CONFIG_QTUPLOADMAXSIZE);
$this->assign("file_upload_limit", (int) $info[0]);
$this->assign("att", $att);
$this->assign("tab_status", $tab_status);
$this->assign("div_status", $div_status);
$this->assign("att_not_used", $att_not_used);
$this->assign("watermark_enable", (int) $info[5]);
//是否添加水印
$group = defined('GROUP_NAME') ? GROUP_NAME . '/' : '';
$this->display();
}
}
示例11: defined
<?php
defined('IN_ADMIN') or exit('No permission resources.');
//$show_header = $show_validator = $show_scroll = 1;
$show_dialog = $show_header = 1;
include $this->admin_tpl('header', 'admin');
$thisExt = isset($this->M['ext']) ? $this->M['ext'] : '';
$authkey = upload_key('1,' . $thisExt . ',1');
?>
<script language="javascript" type="text/javascript" src="<?php
echo JS_PATH;
?>
formvalidator.js" charset="UTF-8"></script>
<script language="javascript" type="text/javascript" src="<?php
echo JS_PATH;
?>
formvalidatorregex.js" charset="UTF-8"></script>
<div class="subnav">
<div class="content-menu ib-a blue line-x">
<?php
if (isset($big_menu)) {
echo '<a class="add fb" href="' . $big_menu[0] . '"><em>' . $big_menu[1] . '</em></a> ';
}
?>
<?php
echo admin::submenu($_GET['menuid'], $big_menu);
?>
<span>|</span><a href="javascript:window.top.art.dialog({id:'setting',iframe:'?m=poster&c=space&a=setting', title:'<?php
echo L('module_setting');
?>
示例12: isUpload
/**
* 检查是否可以上传
* @param string $module 模块名
* @param type $args 上传参数
* @param type $authkey 验证参数
* @return boolean|string
*/
public function isUpload($module, $args, $authkey)
{
if (ucwords($module) == 'User' || ucwords($module) == 'Works' || ucwords($module) == 'System' || ucwords($module) == 'News' || ucwords($module) == 'Advert' || ucwords($module) == 'Worksimg') {
$this->module = strtolower($module);
} else {
return false;
}
//验证参数是否合法
if (empty($args) || upload_key($args) != $authkey) {
return false;
}
return true;
}
示例13: upfiles
/**
* @param string $name 表单名称
* @param int $id 表单id
* @param string $value 表单默认值
* @param string $moudle 模块名称
* @param int $catid 栏目id
* @param int $size 表单大小
* @param string $class 表单风格
* @param string $ext 表单扩展属性 如果 js事件等
* @param string $alowexts 允许上传的文件格式
* @param array $file_setting
*/
public static function upfiles($name, $id = '', $value = '', $moudle = '', $catid = '', $size = 50, $class = '', $ext = '', $alowexts = '', $file_setting = array())
{
if (!$id) {
$id = $name;
}
if (!$size) {
$size = 50;
}
if (!empty($file_setting) && count($file_setting)) {
$file_ext = $file_setting[0] . ',' . $file_setting[1];
} else {
$file_ext = ',';
}
if (!$alowexts) {
$alowexts = 'rar|zip';
}
$authkey = upload_key("1,{$alowexts},1,{$file_ext}");
return $str . "<input type=\"text\" name=\"{$name}\" id=\"{$id}\" value=\"{$value}\" size=\"{$size}\" class=\"{$class}\" {$ext}/> <input type=\"button\" class=\"button\" onclick=\"javascript:flashupload('{$id}_files', '附件上传','{$id}',submit_attachment,'1,{$alowexts},1,{$file_ext}','{$moudle}','{$catid}','{$authkey}')\"/ value=\"上传文件\">";
}
示例14: isUpload
protected function isUpload($module, $args, $authkey)
{
//兼容
if ('content' == $module) {
$module = 'contents';
}
$Module_list = F("Module");
if ($Module_list[ucwords($module)]) {
$this->module = strtolower($module);
} else {
return '该模块未安装,不允许上传!';
}
//验证参数是否合法
if (empty($args) || upload_key($args) != $authkey) {
return '参数非法!';
}
//如果是前台上传,判断用户组权限
if ($this->isadmin == 0) {
$Member_group = F("Member_group");
if ((int) $Member_group[$this->groupid]['allowattachment'] < 1) {
return "所在的用户组没有附件上传权限!";
}
}
return true;
}
示例15: upload_key
<tr>
<th width="100">广告有效期</th>
<td>
<input type="test" name="sta_date" class="input J_date date" value="{$sta_date}" >-
<input type="test" name="end_date" class="input J_date date" value="{$end_date}">
</td>
</tr>
<tr>
<th width="100">广告图片</th>
<td>
<?php
$authkey = upload_key("1,jpg|jpeg|gif|png|bmp,1,,,1");
?>
<input type='hidden' name='thumb' id='thumb' value='{$ad_img}'>
<a href='javascript:void(0);' onclick="flashupload('thumb_images',
'附件上传','thumb',thumb_images,'1,jpg|jpeg|gif|png|bmp,1,,,1','Web','10','{$authkey}');return false;">
<img src='{$ad_img}' id='thumb_preview' width='135' height='113' style='cursor:hand' />
</a>
<br>
<input type="button" value="裁减图片" onclick="crop_cut_thumb($('#thumb').val());return false;" class="btn">
<input type="button" value="取消图片" onclick="$('#thumb_preview').attr('src','__ROOT__/statics/images/icon/upload-pic.png');$('#thumb').val('');return false;" class="btn">
<script type="text/javascript">
function crop_cut_thumb(id){
if ( id =='' || id == undefined ) {