Blog and WordPress, Web Design

Prevent JQuery From Conflict with Other Libraries

jquery Prevent JQuery From Conflict with Other Libraries photo
JQuery is getting more and more popular, many people are using JQuery in WordPress. The right way to import JQuery to your WordPress is like this:

< ?php wp_enqueue_script(“jquery”); ? >

Rather than using <script> syntax. Remember to run this script before wp_head(). And then you can load your own JavaScript like this:

< script type=”text/javascript”
src=”< ?php bloginfo("template_url"); ? >/js/testScript.js” >< /script>

Also remember you must put this after wp_head().

READ THE FULL ARTICLE >>

Gadget & Tech

Iphone App in Real World: Fridge Magnets

ipone app magnets 1 Iphone App in Real World: Fridge Magnets photo

Check out these little things, they are fridge magnets, look so cute, aren’t they? Now you can grab not just the iPhone in your hands, but also your iPhone apps.

READ THE FULL ARTICLE >>

Gadget & Tech

Sony Unveiled Its Motion Controller: PlayStation Move

sony playstation move 4 Sony Unveiled Its Motion Controller: PlayStation Move photo

Sony Unveiled Its Motion Controller in the big Sony press conference, it’s called PlayStation Move, rather than the Gem or Arc as suspected. It comes with two controller, one with ball on the top. There are several colors of the ball(four colors as seen for now). The color balls look quite cute, but not really match with controllers, I can’t help thinking about what the balls are for.

READ THE FULL ARTICLE >>

Web Design

New Website Released: Allbloglist.com

all blog list com New Website Released: Allbloglist.com photo

AllBlogList.com is a catalog website for blogs. It collects blogs from all over the world. You can submit your website to AllBlogList.com for free. It may help your blog to be visited by more and more people.

AllBlogList.com is a free way to promote your blog, why not give it a shot, submit your blog to AllBlogList.com now.

Gadget & Tech

Panasonic Released Lumix DMC-G2 and DMC-G10

panasonic g2k micro four third Panasonic Released Lumix DMC G2 and DMC G10 photo

Panasonic released Lumix DMC-G2 and DMC-G10, new Micro Four Thirds cameras. They both have a 12.1 megapixel sensor and a 3″ LCD screen.  The G2 also has a twist-able LCD touchscreen, and supports 720p (AVCHD Lite) movie mode.

READ THE FULL ARTICLE >>

Blog and WordPress, Web Design

Choose a Syntax Highlighter Plugin for WordPress

syntaxhighlighter evolved Choose a Syntax Highlighter Plugin for WordPress photo

More and more codes have been added to my blog, I used to wrap my codes with quote, it’s not enough for long codes. I need a syntax highlight plugin for my blog.

I tested several syntax highlight plugins, including:

READ THE FULL ARTICLE >>

Web Design

Redirect Users According to Browser Language

gearor gadgets tech mag Redirect Users According to Browser Language photo

I started a new blog Gearor.com, which is a gadgets and tech blog. I also set up a Chinese version using sub domain cn.Gearor.com. So I tried to do one thing, if visitors come with a Chinese browser, the website will automatically redirect them to the Chinese page.

At the first time, I simply check the browser language, if it’s Chinese, the page will redirect to Chinese page. There is one problem with this method. I made a English link in Chinese page so that Chinese users can visit English page if they want, but after I added the redirection, Chinese users can’t visit English page, every time they click the link, they will be redirect to Chinese page.

READ THE FULL ARTICLE >>

Web Design

Say Hello to Kohana 3

kohana 3 php logo 550x241 Say Hello to Kohana 3 photo
Kohana 3 has been released for a while. This is a redesign version of Kohana. Kohana 3 and 2 will both be in active, if you are new to Kohana, I suggest you to start with Kohana 3. The most important difference between these two version is that Kohana 3 uses a new design pattern HMVC rather than MVC as Kohana 2 is using. What is HMVC? These two articles may help you understand it:

  1. Presentation-abstraction-control
  2. HMVC Pattern For GUI Of Swing/GWT/Desktop Application

You can download Kohana 3 here:

Kohana 3 Download

READ THE FULL ARTICLE >>

Web Design

Addslashes or Mysql_real_escape_string to use to Avoid SQL Injection

SQL Injection Addslashes or Mysql real escape string to use to Avoid SQL Injection photo
I was reading some articles about avoiding SQL injection. People used to use addslashes() function, and later more and more programmers are using mysql_real_escape_string(). What’s the difference between these two functions? Alan Storm from StackOverFlow gives a description which is the best as I know:

PHP’s mysql_real_escape_string function will, more or less, ask mysql what character(s) needs to be escaped, where the addslashses function will just add a backslash in front of and any single quote (‘), double quote (“), backslash (\) or NUL (the NULL byte) character.

In the same post, Waage says that:

mysql_real_escape_string adds slashes to:
\x00, \n, \r, \, ‘, ” and \x1a. characters.
Where addslashes only adds slashes to:
‘ \ and NUL

READ THE FULL ARTICLE >>

Web Design

Design a Master CSS Stylesheet

CSSEditLogo Design a Master CSS Stylesheet photo
Every time we start a new website, we need to write our CSS code from the beginning. Actually, many of the codes are the same as our previous website, like settings of blockquote, title(<h1> to <h6>), etc. I was thinking that we can create a CSS template for all websites which containing most common CSS settings.

I lately found Kyle has done this, his master stylesheet has everything I need for a new website. I tried to add something to the stylesheet, but not much can be added, but the global browser setting I learn from Andrew, which may be useful:

* {
	padding:0;
	margin:0;
}

READ THE FULL ARTICLE >>

Page 1 of 1112345...Last »