存档

‘技术’ 分类的存档

Magento设置Paypal支付步骤

2011年5月29日 1 条评论

1、Merchant Account:一般可以选美国,再填写你的paypal账号;

2、Select a PayPal Solution:选择Website Payments Standard就好。这样的效果是在客户填写完订单,最后一步转向Paypal主站,此时页面顶部的收款邮箱会显示第一步设置的邮箱,对于多邮箱的Paypal账号很有用;

3、如果在第二步选择了Express Checkout,其实也可以下单,但是不同之处在于:
(1)订单在倒数第二步就会转向paypal;
(2)在paypal主站上显示的会是你Paypal的主要邮箱,而不是你专为本店设置的邮箱;

4、API/Intergration Settings:不需要设置;

5、遇到提示"This invoice has already been paid. For more information, please contact the merchant",那么进去paypal的账户->用户信息->卖家习惯设定->收款习惯设定->拒绝意外付款:否,允许每个账单号多次付款;

6、搞定,吃饭。

分类: 技术 标签:

MYSQL替换语句:批量修改、增加、删除字段内容

2011年4月8日 没有评论

在MYSQL中使用替换语句可以整批替换某字段的内容,也可以批量在原字段内容上加上或去掉字符。

命令总解:update 表的名称 set  替换字段=REPLACE(替换字段,原来内容,新内容)

举例说明:

1)批量替换

例一:
把“backupfile”表里“url”的字段内容为“http://google.com/”的全部改为“http://google.cn/”

update backupfile set url=REPLACE(url,’http://google.com/’,’http://google.cn/’)

例二:
把“wp_posts”表里的“post_content”字段里的“PJBlog”全部替换成“WordPress”

update wp_posts set post_content=REPLACE(post_content,’PJBlog’,’WordPress’)

例三:
把“wp_comments”表里的“comment_content”字段里的“PJBlog”全部替换成“WordPress”

update wp_comments set comment_content=REPLACE(comment_content,’PJBlog’,’WordPress’)
执行完了这段代码之后就会有提示多少条被替换了:

影响列数: 16 (查询花费 0.1297 秒)

2)根据条件增加字段的内容,如把file_number=1的记录的logical_name字段的内容前面加上tmp,后面加上end。

update backupfile set logical_name=REPLACE(logical_name,logical_name,’tmp’+logical_name+’ end ‘) where file_number=1
3)根据条件去掉指定记录的前面2个字符。

update backupfile set logical_name=REPLACE(logical_name,logical_name,SUBSTRING(logical_name,3,len(logical_name)-2)) where file_number=1
4)根据条件去掉指定记录的后面4个字符。

update backupfile set logical_name=REPLACE(logical_name,logical_name,SUBSTRING(logical_name,1,len(logical_name)-4)) where file_number=2

分类: 技术 标签:

ZOHO CRM添加自定义字段公式

2011年1月17日 没有评论

比如要生成一个字段格式如下:

TS-20110117

“TS-“ 是前缀

2011是今年的年份

01是月份

17是日子

那么可以设置公式是这样的:

Concat(
‘TS-‘,
Tostring(Year(Now())),
Concat(Replace(Tostring(If(Len(Tostring(Month(Now())))>1,1,0)),’1′,”),Tostring(Month(Now()))),
Concat(Replace(Tostring(If(Len(Tostring(Dayofmonth(Now())))>1,1,0)),’1′,”),Tostring(Dayofmonth(Now())))
)

分类: 技术 标签:

修改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

如何让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.

TYPO3: TYPO3 vs. Joomla – The definite answer

2010年1月24日 没有评论

原文地址:http://www.essentialdots.com/int_en/blog/typo3_typo3_vs_joomla_the_definite_answer/index.html

A lot of clients have asked us why is TYPO3 better than Joomla, as these two both aim for the title of the best PHP open-source CMS. If you try to "google" the answer you can mostly find just Joomla developers writing that TYPO3 is indeed more advanced but way more complex to set up – but without detailed comparison.

As we don’t offer any services on Joomla, I have invested some time in researching the differences between these two. For this article I have used information provided on the CMS Matrix web site as well as the list of Joomla flaws stated in the book Professional Joomla! by Dan Rahmel.

Document version control

Joomla completely lacks document version control. TYPO3 on other hand has great version control – you can control absolutely every record and content element in the page tree – you can undo changes, browse history etc. When creating custom record type, adding version control features is as easy as clicking on the "Enable versioning" check box in the Kickstarter.

Workflow feature

Joomla completely lacks workflow as well. For example, if you have many editors who write articles, it won’t be possible to allow chief editor to make decision what will be published and what will be returned for revision.

TYPO3 has great feature called "Task center" where you can define tasks for each user and workflow. For example:

  • a chief editor can create a task for editor to create a news article
  • once editor writes the article it passes it for review
  • once the chief editor reviews the article he can publish the article to the news archive, censor the article or he can return it to the editor for revision.

While the workflow system in TYPO3 certainly needs improvement, what is currently present is a great advantage over Joomla.

Import/Export of the content

Joomla lacks export functionality. In order to transfer content from one website to another you would have to dig into MySQL tables directly and manually copy all the files using FTP.

TYPO3 has built-in import/export functionality. You can export and import content using TYPO3’s native .t3d archives. These archives can contain both records and content elements from the database and files stored on a server’s file system. While this feature can be a little tricky on a complex web sites when you try to use it on just one part of the page tree, it certainly helps a lot in manipulating data and is very easy to use in most of the cases.

阅读全文…

分类: 技术 标签:

vbs批量重命名脚本

2009年12月3日 没有评论

功能::假设有个文件夹的所有文件名称前面有个AA_开头,这个小脚本的作用就是删除这个AA_。只是简单的小脚本,如果还有多个”_”字符的时候,重复使用有可能会全部都删除了。

使用:dir填写实际文件所在目录;target填写要分割的字符,保存为.VBS文件,双击运行。做好备份,因为是直接修改原始文件!

dir=("C:\Users\海军\Desktop\104CANON")
target=("_")

Set fso = CreateObject("Scripting.FileSystemObject")
set rfd=fso.getfolder(dir)
set fs=rfd.files
for each f in fs

        If InStr(f.name,target) Then
            length=Len(f.name)
            star=InStr(f.name,target)
            newname=Right(f.name,length-star)
            f.name=newname
        End If

Next

分类: 技术 标签: ,

Virtuemart Menu

2009年11月26日 没有评论

The vmart module just outputs links instead of an unordered list like they should.
You’ll need to edit /templates/jp_techpraise_1.5/css/theme1.css (or the theme you’re using)
and add this

/*
* Virtuemart Menu
*/
.moduletable_content a{
display:block;
padding:2px 2px;
border-bottom:1px dotted #C8CACA;
//border-top:1px dotted #FDFDFD;
//color:#666;
text-decoration:none;
}

.moduletable_content a:hover {
background-color:#F0F0F0;
}

a#active_menu  {
color:#cc0000;
background-color:#b02500;
}

分类: 技术 标签: