Giving WordPress its Own Directory While Leaving Your Blog in the Root Directory

This item was filled under [ wordpress tips ]

Many people want WordPress to power their site’s root (e.g. http://example.com) but they don’t want all of the WordPress files cluttering up their root directory. WordPress allows you to install the WordPress files to a subdirectory, but have your blog exist in the site root. 阅读更多…

Bookmark and Share
Tagged with: [ ]

wpaffiliate, one famous wordpress affiliate plugin

This item was filled under [ wordpress plugins ]


Adsense Alternative – Earn More Revenue With The ClickBank Affiliate Program

Unless your Google Adsense income rocks, chances are you probably earn cents per click. Thanks to the WordPress Affiliate ClickBank Plugin you can now utilize ClickBank, one of the biggest affiliate networks on the Internet. Earn up to 75% commission per sale. ClickBank offers over 12,000 digital products with instant delivery, therefore making ClickBank affiliate ads the very best alternative to Adsense.

All Links With Your Affiliate ID Will Pay FULL Commission

The WordPress Affiliate ClickBank Plugin is unique because unlike with other similar plugins on the market I didn’t hide affiliate links in my product. Neither do I charge you a commission on your sales for using this plugin. You get to keep 100% of your sales commissions – just as it should be!
阅读更多…

Bookmark and Share

10 WordPress Plugins to Help Build Community

This item was filled under [ wordpress-plugin ]

The expression of community has changed considerably since the emergence of social media technologies, but its basic foundation — the notion of individuals exchanging information, ideas, and opinions — remains firmly intact. Today, one of the most widely-used tools in developing these types of exchanges online is WordPress (WordPress), the popular blogging and publishing platform. Part of its appeal is the ease with which users can build advanced functionality into their sites with plugins. If you’re interested in building a community around your site, there are plenty of third-party add-ons that can help create one.

These 10 WordPress plugins add features that will help you to engage your user base.

阅读更多…

Bookmark and Share

快速范例入门

This item was filled under [ magento ]

Just like any new concepts, we know that without actually diving in and getting your hand dirty, you can never truly grasp what you’ve been explained in words. So here are a couple of exercises for you to get a feel for working with layouts. In order to work with this exercise, you must have the default Magento theme ready and accessible.

Exercise #1: In the category page, move the “My Cart” box from the right column to the left
  1. Turn on the Template Path Hint by going to the admin then navigating to System -> Configuration. When you’re in the configuration page, select the store you’re working in by using the top left website/store selector. Wait for the page to reload, then select the Developer tab. Select ‘Yes’ in the select box for Template Path Hints. Click on Save. Go back to the store front, and reload.
  2. When the page reloads, look at the template path of the ‘My Cart’ block- it’ll most likely say ‘frontend/default/default/template/checkout/cart/sidebar.phtml’. By looking at the path, you know this template is being introduced via the ‘checkout’ module. How do you know this? – frontend/default/default/template/checkout/cart/sidebar.phtml. It says so in the template path. The immediate directory name following ‘template’ is the name of the module through which a template is introduced.
  3. Open up layout/checkout.xml – because now we know we’re dealing with the checkout module
  4. Search for ‘checkout/cart/sidebar.phtml’ (the template name of the My Cart block) in the layout updates. You will find an area that looks like this:
    <reference name="right">
    <block type="checkout/cart_sidebar" name="cart_sidebar" before="-" template="checkout/cart/sidebar.phtml"/">
    </reference">
    Change it to say the following instead (Note that all you’re doing is changing the <reference name="right"> to <reference name="left">).
    <reference name="left">
    <block type="checkout/cart_sidebar" name="cart_sidebar" before="-" template="checkout/cart/sidebar.phtml"/">
    </reference">
  5. Reload the store front and you will now see the change reflected.
Exercise #2: Separate the SEO links at the footer area – Instead of having the link items to be one list, isolate ‘Advanced Search’ to be in the header instead.
  1. You can make a calculated assumption that the SEO links must be assigned somewhere in the layout under the footer block because it’s being pulled through ‘<?=$this->getChildHtml()?>’ of template/page/html/footer.phtml. (You will need the Template Path Hints turned on to see why this is obvious).
  2. Open up layout/page.xml and look through the list of children under the footer block in order to locate a block that calls the footer links – You will find <block name=”footer_links”>, which is what calls the SEO links. Now that you know that layout updates reference the SEO links via the name=”footer_links”, now you will do a search in all the xml files for <reference name=”footer_links”>. You will find references for the footer_links block in catalog.xml (which calls ‘Site Map’), catalogsearch.xml(which calls ‘Search Terms’ and ‘Advanced Search’) and contacts.xml (which calls ‘Contact Us’).
  3. Now that you’ve located the area of the individual SEO link items, you will now begin the steps to isolate ‘Advanced Search’ from the bunch and make it it’s own thing in the header. First go back to page.xml and create a new block <block type=”page/template_links” name=”header_links” as=”header_links” template=”page/template/links.phtml”/> and nest it inside <block name=”header”>. You’ve made the layout updates to expect this link in header.phtml. Open template/page/html/header.phtml, and type in <?=$this->getChildHtml('header_links')?> where you want the link to reside.
  4. Now I go to catalogsearch.xml, and cut this:
    <action method="addLink" translate="label title" module="catalogsearch"><label>Advanced Search</label><url helper="catalogsearch/getAdvancedSearchUrl" /><title>Advanced Search</title></action>
    out from <reference name="footer_links">.
    I create new lines to reference the new header_links block I created, and nest the cut out code inside it like so:
    <reference name="header_links">
    <action method="addLink" translate="label title" module="catalogsearch"><label>Advanced Search</label><url helper="catalogsearch/getAdvancedSearchUrl" /><title>Advanced Search</title></action>
    </reference>
  5. Now I have Advanced search in the header instead of the footer.

This marks the end of Designer’s Guide to Magento. Hopefully by now you’re armed with confidence and knowledge about how to approach designing with Magento. We hope to see some of your results up on the forum. Share with us your designs, discuss this documentation and ask lots of questions at the community forum’s ‘HTML, XHTML, CSS, Design Questions’ thread.

Bookmark and Share

magento 定制注册字段并添加到数据库

This item was filled under [ magento ]

Alright, we will be dealing with 3 files. So open each of the following up:

app/design/frontend/default/yourstore/template/customer/form/register.html – Has the HTML form
app/code/core/Mage/Customer/Model/Entity/Setup.php – Has an array full of customer attributes to use for registration
app/code/core/Mage/Customer/controllers/AccountController.php – Has a specific block of code for registration

Alright, for this little tutorial, we will do a couple of fields. The first one will be a text box asking the customer for their occupation/title.
Navigate to somewhere around line 54 of register.html – You should see this block of code:

<li>
<
div class="input-box">
<
label for="email_address"><?php echo $this->__('Email Address') ?> <span class="required">*</span></label><br/>
<
input type="text" name="email" id="email_address" value="<?php echo $this->htmlEscape($this->getFormData()->getEmail()) ?>" title="<?php echo $this->__('Email Address') ?>" class="validate-email required-entry input-text" />
</
div>
</
li>

Now, we need to add our code for the occupation text box, so change that block of code to the following:

<li>
<
div class="input-box">
<
label for="email_address"><?php echo $this->__('Email Address') ?> <span class="required">*</span></label><br/>
<
input type="text" name="email" id="email_address" value="<?php echo $this->htmlEscape($this->getFormData()->getEmail()) ?>" title="<?php echo $this->__('Email Address') ?>" class="validate-email required-entry input-text" />
</
div>
<
div class="input-box">
<
label for="occupation"><?php echo $this->__('Occupation/Title') ?></label><br/>
<
input type="text" name="occupation" id="occupation" value="<?php echo $this->htmlEscape($this->getFormData()->getOccupation()) ?>" title="<?php echo $this->__('Occupation') ?>" class="input-text" />
</
div>
</
li>

Ok, if you refresh your create account (register) page, you will see the new field show up. Now, the fun part is getting that value into the database. Now, navigate to around line 78 in Setup.php – you should see this block of code:

'email' => array(
'type' => 'static',
'label' => 'Email',
'class' => 'validate-email',
'sort_order' => 6,
),

Now, we need to add our attribute to this file. So, change this block of code to:

'email' => array(
'type' => 'static',
'label' => 'Email',
'class' => 'validate-email',
'sort_order' => 6,
),
'occupation' => array(
'label' => 'Occupation',
'required' => false,
'sort_order' => 7,
),

Right under your occupation array, you will see the group_id one, etc. You need to increment the sort_order as they were doing before. So, since the sort_order for occupation is 7, make the one after it 8, and so on.

Now, head to line 164 of AccountController.php. You should see this block of code:

$customer = Mage::getModel('customer/customer')
->
setFirstname($this->getRequest()->getPost('firstname'))
->
setLastname($this->getRequest()->getPost('lastname'))
->
setEmail($this->getRequest()->getPost('email'))
->
setPassword($this->getRequest()->getPost('password'))
->
setConfirmation($this->getRequest()->getPost('confirmation'))
->
setId(null);

We need to add our new occupation attribute to this, so change the code to this:

$customer = Mage::getModel('customer/customer')
->
setFirstname($this->getRequest()->getPost('firstname'))
->
setLastname($this->getRequest()->getPost('lastname'))
->
setEmail($this->getRequest()->getPost('email'))
->
setOccupation($this->getRequest()->getPost('occupation')) //Add this
->setPassword($this->getRequest()->getPost('password'))
->
setConfirmation($this->getRequest()->getPost('confirmation'))
->
setId(null);

Now, our code is all set up and ready. However, we still need to add this attribute to the eav_attribute table in your mysql database. How do we do that? This block of code:

<?
$setup
= new Mage_Eav_Model_Entity_Setup('core_setup');
$attr2 = array (
'position' => 1,
'is_required'=>0 /* 0 if you want it to be a required field, 1 if not. Also, if required, add this class to the occupation input box on register.phtml class="required-entry input-text" */
);
$setup->addAttribute('1', 'occupation', $attr2);
?>

My suggestion is to add this block of code to the very top of your register.html file. You only need to load this block of code once, so add it to your register.html file, navigate to your register.html file, and then remove the block of code. If you go to your mysql database, view the eav_attribute table and do a search for occupation, you will see that your attribute has been added.

Now, go back to your create account page, fill it out, including your occupation, and bam your finished. If you need proof that it was added to the database, simply go to the customer_entity_varchar table and look for yourself smile

Also, to retrieve the customer data (as if you were in the account dashboard or something) you can call this function: getOccupation. I believe this works – if not, then hopefully someone else can provide this part of the code.

Thanks all!

Bookmark and Share

Zappos十则

This item was filled under [ 网络营销 ]

简介

1、服务创造惊喜
2、拥抱并推动变革
3、创造乐趣和一点不可思议
4、勇于冒险、创造性与开放的心态
5、追求成长与学习
6、建立诚实与开放的沟通机制
7、建立具备家族精神的积极团队
8、少花钱多办事
9、建立并保持主动性
10、保持谦逊

Zappos的这十条原则涵盖了从招聘到人才培养乃至解雇(的整个流程),从中我们可以看到一系列隐于原则之后的核心价值,以及它们如何铸就了Zappos的企业文化。

1. 服务创造惊喜
这是所有原则的核心价值,Zappos依此成为了行业中的客户服务典范(比如将订单免费升为一夜航运、送花、附带卡片等)。他们也将这种精神传递给了供应商,所有供应商都可以与公司管理层看到同样的存货和销售数据。

2. 拥抱并推动变革
CEO Tony Hsieh有将Zappos发展成为横跨几个行业的大公司的野心,但他并不觉得这有多么宏伟。这条核心价值确保了每一个创意都会被倾听,并从较低的标准中脱颖而出,最终获得认可。

3. 创造乐趣和一点不可思议
这一核心价值在显性和隐性方面都有明确的发挥——牛铃的声音响彻在拉斯维加斯的公司总部。在Zappos,即使是平凡的日常会议,也充满了歌声、笑声、游行、蓝色头发和口哨声,填字游戏和漫画更是家常便饭。面试中会问到任何问题,甚至非常规的(比如,若能成为超级英雄,你希望自己是哪一个?)。人力团队还会将可能被“处以极刑”的违规行编排进为新员工表演的滑稽短剧中。

4. 勇于冒险、创新与开放的心态
Zappos是一个鼓励试错且愿意承担风险的组织。呼叫中心的工作人员可以尝试新鲜玩意以取悦客户。经理们则要求团队成员走出办公室,基于不同的角度审视他们的工作,从而建立更加强有力的工作关系。

5. 追求成长与学习
Zappos的大厅有好几个书架放满了商管书籍:《Peak》杂志、《让创意更有黏性》和《从优秀到卓越》等,对员工完全免费。公司也鼓励员工参加公司组织的十多个培训课程,进行新技能的学习与训练,从而更上一层楼。

6. 建立诚实与开放的沟通机制
Zappos具有极高的透明度,员工们可以畅所欲言。公司还雇用了专职的职业生涯教练安排时间,以尽量保密的聆听员工的委屈与牢骚,并给予相应的职业生涯规划建议——往上爬或者选择离去。

7. 建立具备家族精神的积极团队
招聘经理Christa Foley说:“我们不只是在台面上宣扬工作与生活平衡的概念。”员工一块儿工作,一块儿玩乐,一块儿吃早饭……这些都能让他们觉得自己是这个大家庭的一员。

8. 少花钱多办事
2008是Zappos创纪录的、盈利的一年。但像所有公司一样,它也要节约开支。去年秋天,公司解雇了124人;而现在则是通过减少昂贵支出等方法,以获得同样的效果。一个例子:原来的新员工培训结束后的“欢乐时光”活动大约需要3000 美刀,而最近的“欢乐时光”活动则变成了一个110刀的冰激凌聚会。“或许这比去酒吧折腾的效果更好,”招聘经理Christa Foley说。

9. 建立并保持主动性
每个人对工作都应具备主动性,而Zappos则会鼓励将外部主动转化为内在动力。招聘经理Christa Foley说:“如果你热爱马拉松,并且希望公司也能参与,那就去做——不要等着别人说。”

10. 保持谦逊
这一最重要的核心价值,贯穿了Zappos历程中的每一个行为。以Hsieh为首,从哈佛毕业,到两次成功的企业家,他始终保持着温文尔雅的态度。“我们有理由相信,”招聘经理Christa Foley说:“即使有一吨的公司来观摩和学习我们如何做事,我们都会说‘这些是我们实践中一些行而有效的东西,请问你们又是如何做的?*’我们始终知道有更多的事情要做。”

文章背景:Amazon以9.2亿刀收购Zappos。本篇为《财富》之前“2009百佳雇主”专题中的一节,虽然又是一些“老生常谈”的话题,但我们也可以从人力管理的角度了解到,作为一个新兴的电子商务公司,Zappos为什么这么值钱。

Bookmark and Share

呵呵,有点搓,又犯个小错误

This item was filled under [ 一步一步学习中 ]

对于类的调用:后面要加()
class A:
pass

a=A() #才ok,要不然会报出个,不好找的异常

Bookmark and Share

cpedialog的login.py中的小问题

This item was filled under [ 一步一步学习中 ]

在本地调试时发现
类LostPassword 的一个bug
恩在重置密码时,发邮件的 message.body 的参数有问题

将urllib.urlencode改为 urllib.urlencode({‘email’:user.email})[6:]
urllib.urlencode的参数格式要求是要map的。。。


不过不知道要求的具体参数是要什么格式的,我在本地调试的时候,没有一封邮件有发送到邮箱的,还是因为是在本地调试有这个问题呢。。。

我的邮箱是ljy080829 在 gmail.com上的 把“在换成@
有知道的告诉我一下谢谢

Bookmark and Share
Tagged with: [ , , ]

google app engine 中import yaml问题的解决

This item was filled under [ 一步一步学习中 ]

转自:http://bluedusk.javaeye.com/blog/341832

通过代理上传Google App Engine 应用

这个是Google app engine的一个issue:

Seems to be no support for proxy in appcfg.py

http://code.google.com/p/googleappengine/issues/detail?id=126

解决方案:[Windows]

1、在命令行中Set evironment variables:

set http_proxy=http://proxy.blah.com.au:3128

set https_proxy=https://proxy.blah.com.au:31

C:\PROGRA~1\Google\GOOGLE~3>set https_proxy=https://proxy.blah.com.au:3128/

http_proxy=http://proxy.blah.com.au:3128/

2、下载Change the appcfg.py file:

http://googleappengine.googlecode.com/issues/attachment?aid=-622907771208491476&name=appcfg.py

替换掉:

C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py

appcfg.py

59.6 KB Download

3、如果替换后出现如下错误:

I replaced the appcfg.py file and now i get this error…

Traceback :

File “C:\Program Files\Google\google_appengine\appcfg.py”, line 53, in

from google.appengine.api import appinfo

File “C:\Program Files\Google\google_appengine\google\appengine\api\appinfo.py”,

line 31, in

from google.appengine.api import validation

File “C:\Program Files\Google\google_appengine\google\appengine\api\validation.py”,

line 44, in

import yaml

ImportError: No module named yaml

就要安装yaml:

C:\Program Files\Google\google_appengine\lib\yaml>python setup.py install

[To solve the yaml trouble you have to install yaml, as described in

\lib\yaml\README]

4、如果还有认证的问题:

Then to solve the authenticated proxy trouble, I used the arthurfreeman’s appcfg.py

and I’ve tried to modify it according to elspoono suggestion, but I still had

troubles with my corporate NTLM authenticated proxy, then I’ve installed and

configured ntlmaps proxy and finally solved! (using the original arthurfreeman’s

appcfg.py)

http://ntlmaps.sourceforge.net/

This Python proxy hides every issue about authenticated NTLM proxy, before running it

you have to input some infos in server.cfg file:

- port for ntlmaps listener

- your real proxy address

- your real proxy authentication domain/account/password

- your machine’s nt_hostname

- friendly ips (in this case your machine ip)

Then , running the ntlmaps proxy on port 5865, I’ve configured the environment

variables in this way:

set https_proxy=https://localhost:5865

set http_proxy=http://localhost:5865

and finally succeed in uploading my first application in google app engine!

5、这下该可以了吧!!:)

Bookmark and Share

ubuntu下tty的zhcon配置

This item was filled under [ 一步一步学习中 ]

原文章地址:http://www.casparant.com/tty-configuration-under-ubuntu.html

解决了的问题:1.tty下显示中文,2.支持中文输入,3.合适的分辨率,4.关闭终端响铃
第一步:打开FrameBuffer模块
参考网址:http://blog.chinaunix.net/u/12679/showart_513111.html
编辑文件:

sudo vi /etc/initramfs-tools/modules

加入三行内容:
fbcon
vesafb
vga16fb
编辑文件:

sudo vi /etc/modprobe.d/blacklist-framebuffer

把以下两行给注释掉:
blacklist vesafb
blacklist vga16fb
编辑文件:

sudo vi /boot/grub/menu.lst

在启动条目的内核项后面加入vga=xxx参数
xxx所代表的值可以用下面的方法来查看:

sudo hwinfo –framebuffer | grep ‘1280 ‘

这是我机子上的结果: Mode 0×0307: 1280×1024 (+1280), 8 bits
Mode 0×031a: 1280×1024 (+2560), 16 bits
Mode 0×031b: 1280×1024 (+5120), 24 bits
Mode 0×0379: 1280×768 (+1280), 8 bits
Mode 0×037a: 1280×768 (+2560), 16 bits
Mode 0×037b: 1280×768 (+5120), 24 bits

选择1280×1024的分辨率,16位色,所以应该在vga=后面加上0×031a
恩,你要用时要去网上查下自己显示器的最佳分辨率
在选择
第二步,安装支持中文的控制台zhcon并启动

sudo apt-get install zhcon

引用
chenjihua说:这里缺少了一步:

sudo update-initramfs -u

如果不做这一步,重启后会无法正常显示控制台。

重启后,
在tty状态下输入命令

zhcon –utf8 –drv=fb

在很多网页上提到使用–drv=vga参数来启动zhcon,这样做在我的机子上显示的分辨率是640×480,我希望有一个我看着比较舒服的大分辨率,所以我使用–drv=fb参数来启动zhcon
第三步,优化
化简zhcon启动的参数:
在~/.bashrc中增加一行,

alias zhcon=’zhcon –utf8 –drv=fb’

这样在启动zhcon时只需要输入zhcon即可。
设置zhcon开机自动启动:
在~/.bashrc中增加一行,

[[ $(tty) == /dev/tty[0-9]* ]] && zhcon

不过这个方法只针对当前用户,即对tty登入时的帐户下的~/.bashrc设置这行才有效。
第四步,中文输入法支持
zhcon中可以输入中文。Ctrl+Space即可。
第五步,关闭终端响铃
因为有时候电脑要在课上用,所以关闭system bell还是很有必要的。
网上找了半天,找到一个softbeep的软件,摆弄半天还是没成功。
狗狗告诉我,把pcspeaker这个模块给-r掉,我找了一下,Ubuntu没这个模块。
继续google,发现Ubuntu这个模块名字叫pcspkr,给它blacklist了算了。

sudo vi /etc/modprobe.d/blacklist

添加一行

blacklist pcspkr

搞定。

Bookmark and Share
Page 3 of 46«12345»102030...Last »