自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(39)
  • 收藏
  • 关注

原创 php 位运算

原理在Linux文件系统中,一个用户对文件或目录所拥有的权限分为三种:”可读”、”可写”和”可执行”,分别用 1 、2 和 4 来表示,它们之间可以任意组合:有“可读”、“可写”权限就用 3 来表示(1 + 2 = 3);有”可读“、”可执行“权限就用5来表示(1 + 4 = 5),三种权限全部拥有就用 7 表示(1 + 2 + 4 = 7)。 实际上,这种运算是基于二进制的。...

2012-07-25 02:45:19 164

原创 解决Ubuntu vim 中文乱码

打开vim的配置文件,位置在 /etc/vim/vimrc 在其中加入set fileencodings=utf-8,gb2312,gbk,gb18030set termencoding=utf-8set encoding=prc 保存退出,此时vim就能正确显示中文了。对于gedit,解决方法如下:在终端中运行 gconf-editor在打开的界面中选...

2012-07-24 21:50:20 319

原创 ubuntu上安装 ibus Google拼音输入法

最近听说Google拼音有了个ibus的版本了。试了一下之后,效果还真不错。下面我们就来说说如何安装这个Google拼音。首先我们要到ibus Google拼音输入法的主页下载两个安装包到桌面,如下:1. ibus-googlepinyin-0.1.2.tar.bz2  2. libgooglepinyin-0.1.2.tar.bz2 使用下面命令将其解压。tar ...

2012-07-21 05:10:26 401

原创 magento 首页添加随机产品 add a Random Featured Product list on home page in Magento

want to show products from a specific category on your home page you can do this simply with{{block type="catalog/product_list" category_id="12" template="catalog/product/list.phtml"}} on your h...

2012-07-19 05:20:22 228

原创 magento 问题解答 FQA

1. Is there a way by mysql to set ALL product visibility to catalog, search?  批量修改产品可见 open up the eav_attribute table and find the row where attribute_code = visibility . Take note of the a...

2012-07-19 04:40:44 120

原创 ubuntu 输入空白How to cd to folder name with spaces blank names (white space)

it's must to use \ because it has space bar between file name like this $cd FONT\ 001 You just use a backslashex.) cd /home/jesse/New\ Folder/ ...

2012-07-17 23:07:06 80

原创 Magento数据库结构:EAV

Magento的表有三百多张,以实体、属性、值(EAV)的数据库结构难以掌握,加上缺少有关EAV的文档,以至许多人不知道这种EAV方式的好处以及它对magento来说的重要性,在这里作为一名magento开发者,让我们来了解下,它是如何工作的并且对我们有什么好处。 什么是EAV呢?EAV是实体(Entity)、属性(Attribute)、值(Value)的意思,接下来来看看每一部分...

2012-07-17 09:22:09 522

原创 vim setting

/etc/vim/vimrcset nocompatible " use vim defaultsset backspace=2 "make backspace like most other appsset ls=2 " allways show status lineset tabstop=5 " numbers of sp...

2012-07-17 00:00:34 129

原创 清空magento所有的产品数据 Delete magento category / products by SQL

Magento 1.5 and 1.6 Truncate products This should remove all the products and their related records.TRUNCATE TABLE `catalog_product_bundle_option`; TRUNCATE TABLE `catalog_prod...

2012-07-13 02:55:06 239

原创 深入理解Magento-第十章-数据操作&数据收集器

在我们开始介绍数据操作前,我们先介绍一个神兵利器—Varien Data Collections。在最早的时候我们写php通常用Array来做数据收集器,这个小东西可发挥了大作用,要知道如果你想在其他语言中实现Array有多么难过。 例如c、c++。 在php5中,更是发扬了Array,php内置了一些类和接口,允许你创建你自己的数据结构。Magento充分利用了这一点,在使用 Vari...

2012-07-13 02:46:50 127

原创 使用命令行刷新Magento索引管理 Rebuilt Magento Indexes in terminal with php-cli

magento索引管理当我们网站商品很多的时候,比如有几千件,我们刷新Magento的索引管理(Index Management)经常会失败。那么后台刷新不了,我们还可以通过命令行来刷新。使用命令行来刷新索引管理会极大降低系统消耗,容易成功。我们来看下步骤,如果你在使用linux服务器,登入你的ssh客户端,切换目录到你magento根文件夹中名字是shell的文件中。...

2012-07-13 02:21:49 119

原创 深入理解Magento-第九章-修改、扩展、重写Magento代码

重写Magento模块(Module) 第一步,你需要创建属于你自己代码的命名空间,例如Wemvc,App等,为了方便与大家分享代码,我将空间命名为App。app/ code/ core/ community/ local/ App/ 假如你现...

2012-07-12 22:10:16 122

原创 深入理解Magento – 第七章 – 自定义Magento系统配置

深入理解Magento作者:Alan Storm 翻译:Hailong Zhang第七章 – 自定义Magento系统配置Magento拥有十分强大的后台管理系统。作为一名开发人员,这套后台管理系统可以让你的用户简单直接的配置Magento系统或者你创建的模块。和Magento的其他功能一样,你第一次使用这套管理系统的时候可能觉得很麻烦,但是一旦你上手了,你会发现它...

2012-07-12 21:43:20 140

原创 深入理解Magento – 第六章 – 高级Magento模型

深入理解Magento作者:Alan Storm 翻译:Hailong Zhang第六章 – 高级Magento模型我们讲过Magento有两种模型,简单模型和EAV(Entity Attribute Value)模型。上一章我们讲过所有的Magento模型都是继承自Mage_Core_Model_Abstract / Varien_Object。简单模型和EA...

2012-07-12 21:41:48 100

原创 深入理解Magento – 第五章 – Magento资源配置

深入理解Magento作者:Alan Storm 翻译:Hailong Zhang第五章 – Magento资源配置对于任何一个更新频繁的项目来说,保持开发环境和生产环境的数据库同步是件很头疼的事情。Magento提供了一套系统,用版本化的资源迁移脚本来解决这个问题。  上一章,我们为 Helloworld Blogpost 创建了一个模型。我们直接通过SQL语...

2012-07-12 21:31:32 132

原创 解决 ubuntu 无法关机 Dell Studio 1569 Cannot Shutdown in Ubuntu 11.10 or 12.04

Shutdown computer using terminal in Ubuntuf you want to shutdown your computer what do you do ? Simply go to shutdown button and click shutdown isn’t? Have you ever wondered how would you shut...

2012-07-12 21:24:21 263

原创 深入理解Magento – 第四章 – 模型和ORM基础

深入理解Magento作者:Alan Storm 翻译:Hailong Zhang第四章 – 模型和ORM基础对于任何一个MVC架构,模型(Model)层的实现都是占据了很大一部分。对于Magento来说,模型占据了一个更加重要的位置,因为它常常包含了一部分商业逻辑代码(可以说它对,也可以说它错)。这些代码在其他的MVC框架中往往出现在控制器或者帮助函数中。传统...

2012-07-11 02:48:54 163

原创 深入理解Magento – 第三章 – 布局,块和模板

深入理解Magento作者:Alan Storm 翻译:Hailong Zhang第三章 – 布局,块和模板我们接着研究Magento。根据我们第二章讲的Magento MVC的架构,我们接下来应该讲模型(Model),但是我们跳过模型先来看布局和块。和一些流行的PHP MVC架构不同的是,Magento的执行控制器不直接将数据传给试图,相反的视图将直接引用模型...

2012-07-11 02:39:23 170

原创 深入理解Magento – 第二章 – Magento请求分发与控制器

深入理解Magento作者:Alan Storm 翻译:Hailong Zhang第二章 – Magento请求分发与控制器Model-View-Controller (MVC) ,模型-视图-控制器,源于Smalltalk编程语言和Xerox Parc。现在有很多系统是基于MVC架构的,不同的系统MVC的实现也略有不同,但都体现了MVC的精髓,分离数据,业务逻辑和...

2012-07-11 02:09:10 130

原创 深入理解Magento – 第一章 – Magento强大的配置系统

深入理解Magento作者:Alan Storm 翻译:Hailong Zhang第一章 – Magento强大的配置系统Magento的配置系统就像是Magento的心脏,支撑着Magento的运行。这套配置系统掌管着几乎所有“module/model/class/template/etc”。它把整个Magento系统抽象出来,用一个配置文件来描述。这里的“配置文...

2012-07-10 22:15:58 131

原创 magento开启模板路径提示

 magento模板开发很方便,多得益于这个模板路径提示,今天我给大家图文讲解下如何开启magento模板路径的提示。这对于做magento模板进行文件的定位是很有帮助的。 第一步,首先进入后台的system—》configuration,所有的设置都是在这个里面设置的。 第二步,也是很多人都不知道的一步,将左上方的这个“Current Configuration Scope”...

2012-07-10 10:53:37 213

原创 magento URL分析,查找修改相应文件

通过 http://localhost/magento/index.php /customer/account/create/ 分析Magento调用该页面的过程 1. URL中的customer表明当前访问的模块 是customer ,自动定位到: app/code/core/Mage/Customer 2. URL中的account 表明当前访问的控制器文件 为 Account...

2012-07-10 09:26:59 191

原创 ubuntu vim 显示行号 Getting VIM to show the line numbers be default

vi / vim show line number commandTo display line numbers along the left side of a window, type any one of the following::set number or:set nu You can also define a mapping to toggle the ...

2012-07-10 04:30:13 217

原创 PHP 异常处理

异常(Exception)用于在指定的错误发生时改变脚本的正常流程。 什么是异常? PHP 5 提供了一种新的面向对象的错误处理方法。异常处理用于在指定的错误(异常)情况发生时改变脚本的正常流程。这种情况称为异常。当异常被触发时,通常会发生:当前代码状态被保存代码执行被切换到预定义的异常处理器函数根据情况,处理器也许会从保存的代码状态重新开始执...

2012-07-10 03:56:49 112

原创 magento 模块重写

以重写 app/code/core/Mage/Catalog/Block/Navigation.php 为例 1. 复制Mage (不推荐使用) First add a new Navigation.php file you can edit to your local folder that Magento will reference instead of the ...

2012-07-09 22:00:21 242

原创 magento 获取 pages/Static Block 内容 Get Pages/Static Block in Magento

1. pages Sometimes, you want to use information like title or content from a CMS page (or multiple CMS pages) in another page. For example, you want to show a part of “Welcome” page in homepage. H...

2012-07-09 10:14:59 160

原创 The Vim commands cheat sheet (ubuntu) vi编辑器常用的命令及快捷键

How to Exit :q[uit]Quit Vim. This fails when changes have been made.:q[uit]!Quit without writing.:cq[uit]Quit always, without writing.:wqWrite the current file and exit....

2012-07-07 05:40:44 260

原创 ubuntu 添加 qq

1. Empathy ctrl+alt+t 打开终端sudo add-apt-repository ppa:lainme/libqqsudo apt-get updatesudo apt-get install libqq-pidgin 经过以上几步,Empathy里面就有QQ了 2. Ubuntu 12.04安装QQ2012 ...

2012-07-06 21:55:38 111

原创 Install Google Chrome using Apt-Get in Ubuntu

Objectives:Install Google Chrome in Ubuntu using apt-get installEnjoy!To get started, press Ctrl – Alt – T to open Terminal. When it opens, run the command below to add Linux-repos...

2012-07-06 04:26:49 155

原创 Multimedia (MP3, MPEG-4, AVI, DiVX, etc.) support in Ubuntu 12.04 (Precise)

Why doesn’t Ubuntu support MP3 ‘out of the box’?Ubuntu cannot include support for MP3 or DVD video playback or recording. MP3 formats are patented, and the patent holders have not provided the n...

2012-07-06 04:12:02 116

原创 How to Enable Remote Access to MySQL (ubuntu)

MySQL remote access is disabled by default, but with a few simple steps, you should be up and running with remote MySQL in just a few minutes. This is especially useful when working with multiple ...

2012-07-05 21:10:18 154

原创 Select all in address bar of firefox (Ubuntu, Linux Mint) with a single click

Too many things to modify after installing ubuntu or linux mint. One of the annoying thing is Clicking the address bar on Firefox (provided with Ubuntu, linux mint) doesn’t select the whole text in it...

2012-07-04 02:46:45 78

原创 Linux/Mac 操作 mysql MySQL Commands

This is a list of handy MySQL commands that I use time and time again. At the bottom are statements, clauses, and functions you can use in MySQL. Below that are PHP and Perl API functions you can use...

2012-07-03 22:39:54 170

原创 Ubuntu禁用ipv6 ( Disable IPv6 If your Internet is Working Slow in Ubuntu)

Disable IPv6 If your internet is working Slow in Ubuntu 12.04 Precise Pangolin/Linux Mint 13/Any Ubuntu or Mint Version Follow this to Disable IPv6, So we have to edit the sysctl.conf file.To do thi...

2012-07-03 03:25:33 198

原创 Ubuntu 星际译王StarDict

日常办公应用中,我们经常会碰到一些陌生的外文单词或文章需要翻译,在Windows平台上,可通过很多翻译工具来帮忙解决。当我们转到Ubuntu系统中办公时,肯定也希望能有一款简单易用、功能强大的翻译工具。   这里给大家推荐Linux平台上最常用的翻译工具——StarDict(星际译王)。星际译王具有全文翻译、屏幕取词及单词朗读功能,支持本地和网络词典及模糊查找功能。本文介绍基于Ubun...

2012-07-03 03:20:58 231

原创 How to install Aptana Studio 3 on Ubuntu 12.04 LTS (Precise Pangolin)

1. Install the prerequisitessudo apt-get install openjdk-7-jdk libjpeg62 libwebkitgtk-1.0-0 git-core Although Aptana Studio doesn’t officially support OpenJDK, I’ve not encountered any problems...

2012-07-02 00:19:42 103

原创 Magento的基本架构

magento是在Zend框架基础上建立起来的,这点保证了代码的安全性及稳定性。选择Zend的原因有很多,但是最基本的是因为 zend框架提供了面向对象的代码库并且有很好的团队支持。通过这个框架,magento主要围绕三个基本点建立:灵活性:我们相信每一个解决方案都像它的商务支持一样是独一无二的。magento的代码可以无缝定制的。可升级性:magento可方便的...

2012-07-01 04:26:43 302

原创 Magento布局layout.xml文件详解

解析顺序布局xml文件一般位于app/design/{area}/{package}/{theme}/layout/目录下。Layout文件一般包含block、reference、action三种标签。 对于Magento系统,首先会将系统中相关相关的layout合并,合并一般是包括app\design\frontend\base\default\layout目录下的xml文件,以...

2012-07-01 04:19:05 320

原创 Magento getModel getSingleton等常用函数说明

Mage::getModel函数详解:在通常的PHP初始化类对象的时候,使用以下方式进行生成。$modelSales = new ModelSales();但是在magento中初始化模型对象时候,使用以下的方式进行生成模型对象。$product = Mage::getModel(’catalog/product’);我们阅读magneto系统核心代...

2012-07-01 04:06:33 136

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除