Discuz X1.5群组缩略图大小修改

打开\source\function\function_group.php

	if($data['status'] == 3) {
		$imgwh = array('icon' => array('48', '48'), 'banner' => array('720', '168'));
		require_once libfile('class/image');
		$img = new image;
		$img->Thumb($upload->attach['target'], './'.$uploadtype.'/'.$upload->attach['attachment'], $imgwh[$type][0], $imgwh[$type][1], 'fixwr');
	}
	return $upload->attach['attachment'];
}

可增加一个字段:

	if($data['status'] == 3) {
		$imgwh = array('icon' => array('48', '48'), 'banner' => array('720', '168'), 'hkshadow' => array('91', '91'));
		require_once libfile('class/image');
		$img = new image;
		$img->Thumb($upload->attach['target'], './'.$uploadtype.'/'.$upload->attach['attachment'], $imgwh[$type][0], $imgwh[$type][1], 'fixwr');
	}
	return $upload->attach['attachment'];
}

然后打开\source\module\forum\forum_group.php

阅读更多

php $_ENV为空的原因分析

你的php.ini的variables_order值为”GPCS”,也就是说系统在定义PHP预定义变量时的顺序是GET,POST,COOKIES,SERVER,没有定义Environment(E),你可以修改php.ini文件的variables_order值为你想要的顺序,如:”EGPCS”。这时,$_ENV的值就可以取得了
EGPCS值(EGPCS是Environment、Get、Post、Cookies、Server的缩写 — 这是PHP中外部变量来源的全部范围)

在php此行修改:

阅读更多

PHP extract()函数从数组中把变量导入到当前的符号表中

对于数组中的每个元素,键名用于变量名,键值用于变量值。

第二个参数 type 用于指定当某个变量已经存在,而数组中又有同名元素时,extract() 函数如何对待这样的冲突。

语法:

extract(array,extract_rules,prefix)

array:
必需。规定要使用的输入。

extract_rules:
可选。extract() 函数将检查每个键名是否为合法的变量名,同时也检查和符号表中的变量名是否冲突。

对非法、数字和冲突的键名的处理将根据此参数决定。可以是以下值之一:

阅读更多