May, 2010Archive for

WordPress模板常用调用函数

WordPress基本模板文件 一套完整的WordPress模板应至少具有如下文件: style.css : CSS(样式表)文件 index.php : 主页模板 archive.php : Archive/Category模板 404.php : Not Found 错误页模板 comments.php : 留言/回复模板 footer.php : Footer模板 header.php : Header模板 sidebar.php : 侧栏模板 page.php : 内容页(Page)模板 single.php : 内容页(Post)模板 searchform.php : 搜索表单模板 search.php : 搜索结果模板 当然,具体到特定的某款模板,可能不止这些文件,但一般而言,这些文件是每套模板所必备的。 基本条件判断Tag is_home() : 是否为主页 is_single() : 是否为内容页(Post) is_page() : 是否为内容页(Page) is_category() : 是否为Category...

Example for pagination using Zend_Paginator

You may interesting to view Zend_Paginator Full Example. Here is simple and easy understand example to show you how to use Zend_Paginator. After you get search results from database, pass results to Zend_Paginator. Add following code to your controller page. Code example in view script: Create a paginator template in application/views/scripts/my_pagination_control.phtml . I have added the 3 types of pagination in following code. The defalut use one is drop down. You can simply c...

ThinkPHP-如何在option中使用if语句

注意写法: 在if中,{$l.id} 要写成 $l['id']

Search for text in vi or vim

vi and vim have powerful searching capabilities because they bring to bear the richness of regular expressions. To search for the next occurence of the text ‘maybe’ from the current cursor position, type: Search backward from the current position by using ? instead of / in the command. Once you have searched for something, you can find the next occurrence by pressing n or the previous occurrence with N. Searching in vi/vim is enhanced with regular expressions. For example, ...

Favorite Coupon Sites

DealCoupon.com This is part of the DealNews site, which includes information on all types of discounts and promotions--online and off. I particularly appreciate the site's handy customization features: Not only can you choose up to 30 merchants whose coupons you want highlighted, but you can sign up for e-mail notification of new coupons from the stores on your favorites list. Nice. Dealsdujour.com: I found leads on several great deals here, including 10 percent off anything at the Pal...

52 Incredibly Useful Sites: The Full List

Business GenBook: Allows clients to schedule appointments with your company Huddle: Helps your workgroup manage projects, and offers online storage JobSpice: Generates attractive online résumés Phonebooth: Provides phone services Stacks: Organizes tasks by person and project TextFlow: Simplifies document collaboration Yammer: Gives workgroups a private microblog Zoho: Offers a large variety of cloud-based apps Communication FaxZero: Sends no-cost, ad-supported f...

How To Create Multiple Themes Application With Zend Framework?

Zend Framework is a good choice for developers who want a well-designed, flexible PHP framework. I’ve been using PHP because of its speed and flexibility, which are weaknesses of other scripting languages. With phpBB, WordPress… or almost other PHP softwares, the users can have various themes to switch between them easily. Zend Framework does not natively support this feature but we can do it using 2 solutions. The first, as many developers have been using, is that you can use Zend_Layo...