新年快乐!

2011年1月1日 没有评论

新的一年

新的开始…

分类: 随语 标签:

圣诞到了~

2010年12月23日 没有评论

圣诞到了

到了

到..

无聊

分类: 随语 标签:

盗梦空间

2010年9月12日 没有评论

准备进场了!

分类: 杂志 标签:

修改virtuemart的图片上传功能

2010年9月8日 7 条评论

有2个图片上传的地方需要修改:

1 默认产品的大图,要把它修改为不管上传的图片多大,都会自动更改为640×480大小。

The solution for this case is to hack the main product image resize to max height/width 600px, open the the file in administrator/components/com_virtuemart/classes/imageTools.class.php file. Locate the following code.

original code

// Resize the Full Image
if( !empty ( $_FILES[$tmp_field_name]["tmp_name"] )) {
	$full_file = $_FILES[$tmp_field_name]["tmp_name"];
	$image_info = getimagesize($full_file);
}

Replace with the following code

// Beginning of Modify by DesignerSandbox
// resize the full product image dynamically and give it maximal dimensions 600x600 during uploading
// Resize the Full Image
if( !empty ( $_FILES[$tmp_field_name]["tmp_name"] )) {
	$full_file = $_FILES[$tmp_field_name]["tmp_name"];

	$image_info = getimagesize($full_file);
	$original_height =  $image_info[1];
	$original_width =  $image_info[0];

	if ($original_height > $original_width) {
		$largewidth = (480 / $original_height) * $original_width;
		$largeheight = "480px";
	} else {
		$largeheight = (640 / $original_width) * $original_height;
		$largewidth = "640px";
	}

	//Get Image size info
	list($original_width, $original_height, $image_type) = getimagesize($full_file);

	switch ($image_type)
	{
		case 1: $im = imagecreatefromgif($full_file); break;
		case 2: $im = imagecreatefromjpeg($full_file);  break;
		case 3: $im = imagecreatefrompng($full_file); break;
		default:  trigger_error('Unsupported filetype!', E_USER_WARNING);  break;
	}

	$big = imagecreatetruecolor($largewidth, $largeheight);

	/* Check if this image is PNG or GIF, then set if Transparent*/
	if(($image_type == 1) OR ($image_type==3))
	{
		imagealphablending($big, false);
		imagesavealpha($big,true);
		$transparent = imagecolorallocatealpha($big, 255, 255, 255, 127);
		imagefilledrectangle($big, 0, 0, $largewidth, $largeheight, $transparent);
	}
	imagecopyresampled($big, $im, 0, 0, 0, 0, $largewidth, $largeheight, $original_width, $original_height);

	//Generate the file, and rename it to $newfilename
	switch ($image_type)
	{
		case 1: imagegif($big,$full_file); break;
		case 2: imagejpeg($big,$full_file);  break;
		case 3: imagepng($big,$full_file); break;
		default:  trigger_error('Er ging iets fout!', E_USER_WARNING);  break;
	}}
// end of edit by DesignerSandbox

2 上传额外的图片时候,把默认的尺寸设置改为640×480:

打开:/administrator/components/com_virtuemart/html/product.file_form.php 文件,

把下列代码:

<?php echo $VM_LANG->_(‘PHPSHOP_PRODUCT_FORM_HEIGHT’);?>: <input type=”text” name=”fullimage_height” value=”500″ />&nbsp;&nbsp;&nbsp;
<?php echo $VM_LANG->_(‘PHPSHOP_PRODUCT_FORM_WIDTH’);?>: <input type=”text” name=”fullimage_width” value=”500″ /></div>

改为:

<?php echo $VM_LANG->_(‘PHPSHOP_PRODUCT_FORM_HEIGHT’);?>: <input type=”text” name=”fullimage_height” value=”480″ />&nbsp;&nbsp;&nbsp;
<?php echo $VM_LANG->_(‘PHPSHOP_PRODUCT_FORM_WIDTH’);?>: <input type=”text” name=”fullimage_width” value=”640″ /></div>

分类: 技术 标签:

最简单的去掉Virtuemart Cart中的logo方式

2010年8月21日 没有评论

原文地址:

http://www.newworlddesigns.co.uk/blog/removing-hiding-the-virtuemart-logo-from-an-empty-cart-module/

I have wrote many times on the VirtueMart forums, on how to remove/hide the VirtueMart logo fro the Virtuemart Cart Module, but thought I would add it in here as well.

.vmCartModule img {
        display: none;
}

If you add this to your main template style sheet and refresh your page, it should work, you may need to do a cache refresh as well by holding down Shift+Reload (Shift+F5)
/templates/xxxxx/css/template.css

Is the usual path to your template css.

Some people say it should be here

/components/com_virtuemart/themes/theme.css

But to be honest it makes no difference at all, as long as it is loaded in, it can be anywhere you like.

分类: 技术 标签:

VirtueMart 配置gamil发信技巧-Mail Settings设置

2010年8月21日 1 条评论

当使用Virtuemart做为joomla的商店程序时,如果网站配置的发信邮箱是gmail的,可能会出现错误,导致无法发送信件。

解决方法如下:

在Site – Global Configuration – Server – Mail Settings下按如下设置:

mail server: SMTP server
Adress: name@gmail.com
Name: name
SMTP identification: Yes
SMTP security: none
Port: 25
User: name@gmail.com
Passwd: passwd
Smtp host: ssl://smtp.gmail.com:465

And IT IS NOT EQUIVALENT TO

(如果用下面的设置,目前来看会出错!)

mail server: SMTP server
Adress: name@gmail.com
Name: name
SMTP identification: Yes
SMTP security: SSL
Port: 465
User: name@gmail.com
Passwd: passwd
Smtp host: smtp.gmail.com

原文地址:http://forum.virtuemart.net/index.php?topic=58983.15

疯了

2010年8月18日 没有评论

广州交警疯了

经常乱跑都没有被抓,今天这么倒霉,被抓了现行,罚款200,扣3分!

刚刚才换了驾照,今天就被抓!!

分类: 随语 标签:

换了新驾照

2010年8月17日 2 条评论

 20100817396

分类: 图片 标签:

如何让IIS7显示ASP错误的详细信息

2010年8月12日 没有评论

在网站目录下建立web.config文件,内容如下:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <httpErrors errorMode="Detailed" />
        <asp scriptErrorSentToBrowser="true"/>
    </system.webServer>
</configuration>

这样就可以重新显示详细信息了。在Godaddy的虚拟主机上测试可行。

原文如下:

地址:http://internetoptimizers.com/2010/01/24/classic-asp-using-iis7-error-handling-500-internal-server-error-godaddy/

Classic ASP using IIS7 – Error Handling – 500 Internal Server

Howdy All,

This is a common problem I see lots of people running into since GoDaddy upgraded from IIS 6 to IIS 7.  The below story is a similar situation that I had while trying to work on a Classic ASP web site hosted at GoDaddy. I have included the answer/fix below.
Original Story:  I am with godaddy for webhosting right now. The have me using IIS7.
When I run my ASP page I get the error :

Error 500 :There is a problem with the resource you are looking for,
and it cannot be displayed.

Basically, there is an error in my code, however, it doesn’t tell me
the line number the error was found on. After searching the web I
found out how to turn on the more detailed error reporting… but you
have to do it on the webserver. I don’t have access to the webserver.

After spending allot of time chatting with godaddy, they claim I can
turn this on in the web.config file. I know this can be turn on for
ASP.NET in the web.config file… but as far as I know, not classic
asp.

OK…. Here is the web.config file I use that gives you the old school error handling data:

Step 1.  Open a text document.

Step 2.  Insert this code:

<configuration>
    <system.webServer>
        <httpErrors errorMode="Detailed"/>
        <asp scriptErrorSentToBrowser="true"/>
    </system.webServer>
</configuration>

Step 3.  Save the file as Web.Config

Step 4.  Upload the Web.Config file to your host web directory.

I hope this helps people avoid the few hours I was on the phone with GoDaddy technical support.  :)   Please let me know if this helps anyone out.

巽竂湾

2010年7月17日 没有评论

20100717387

分类: 杂志 标签: