<?xml version="1.0" encoding="iso-8859-1"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>CrankBerry Blog &#187; Web Development</title>
	<atom:link href="http://www.crankberryblog.com/category/web-development/feed" rel="self" type="application/rss+xml" />
	<link>http://www.crankberryblog.com</link>
	<description>Sharing ideas on web design, development and the internet economy</description>
	<lastBuildDate>Thu, 24 Nov 2011 19:37:08 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Installing Sphinx on CentOS/Linux through SSH</title>
		<link>http://www.crankberryblog.com/2011/installing-sphinx-on-centoslinux-through-ssh</link>
		<comments>http://www.crankberryblog.com/2011/installing-sphinx-on-centoslinux-through-ssh#comments</comments>
		<pubDate>Fri, 22 Apr 2011 17:29:00 +0000</pubDate>
		<dc:creator>Jerry Low</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.crankberryblog.com/?p=479</guid>
		<description><![CDATA[Here are the steps into setting up Sphinx for your Plesk sever through SSH. I'm running on CentOS 5.2 but I'm pretty sure these instructions work on most Linux environment. If you're looking to <a href="http://www.crankberryblog.com/2011/intalling-sphinx-on-wamp-localhost-windows">install Sphinx on WAMP</a> (Windows machine) there's another article for that.
]]></description>
			<content:encoded><![CDATA[<p>Here are the steps into setting up Sphinx for your Plesk sever through SSH. I&#039;m running on CentOS 5.2 but I&#039;m pretty sure these instructions work on most Linux environment. If you&#039;re looking to <a href="http://www.crankberryblog.com/2011/intalling-sphinx-on-wamp-localhost-windows">install Sphinx on WAMP</a> (Windows machine) there&#039;s another article for that.</p>
<p>Here is my environment:</p>
<ul>
<li>CentOS 5.2</li>
<li>MySQL 5.1.36</li>
<li>PHP 5.3.6</li>
<li>Sphinx 1.10</li>
</ul>
<p>To do all this, login to your server via SSH with your favourite Telnet/SSH client. I prefer to use <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/" target="_blank">PuTTY</a>. Oh, you must login as root so have root access!</p>
<h3>How Does Sphinx Works</h3>
<p>In brief this is how Sphinx works. Sphinx creates a separate index of the table you want to search. Your PHP scripts calls the Sphinx API to search connecting to a specific port where Sphinx is listening to. Sphinx then searches its own index and does the search returning the result. Yes, the index has to be updated every time your update your original table. On my live environment I have a <a href="http://www.crankberryblog.com/2010/php-cron-job-without-using-cron-tab-cron-alternative-with-mysql-or-just-txt">cron job setup</a> to reindex with Sphinx every so often.</p>
<h3>Step 1 Extract and Prepare Conf File</h3>
<p>First of all you have to download the Sphinx package and extract it on your server. Here are the command lines for that. Note that the package I&#039;m downloading is the newest (1.10 Beta at this moment). If you&#039;re downloading the older stable version or newer ones since this article is written then you have to change the URL. BTW don&#039;t type in the ($).</p>
<pre>$ wget http://sphinxsearch.com/files/sphinx-1.10-beta.tar.gz
$ tar xzvf sphinx-0.9.8.tar.gz
$ cd sphinx</pre>
<p>To Summarize, the first line downloaded the Sphinx package to your server. Second line untarred it and lastly you went into the directory of your new download.</p>
<p>You can do the configuration if you&#039;ll like to edit the installation process. Here&#039;s an excerpt from Sphinx&#039;s site:</p>
<pre>$ ./configure

There's a number of options to configure. The complete listing may be
obtained by using --help switch. The most important ones are:

--prefix, which specifies where to install Sphinx; such as
--prefix=/usr/local/sphinx (all of the examples use this prefix)
--with-mysql, which specifies where to look for MySQL include and
library files, if auto-detection fails;
--with-pgsql, which specifies where to look for PostgreSQL include
and library files.</pre>
<p>Once you&#039;re done then all you have to do is make the binaries and install the software:</p>
<pre>$ make
$ make install</pre>
<p>Once you have installed Sphinx you&#039;ll need to prepare the configuration file. This is the most important part as Sphinx actually acts based on the settings and parameters defined in this single document. Let&#039;s say we&#039;ve installed Sphinx into /usr/local/sphinx. Copy the sample configuration file from the downloaded package into the Sphinx installation folder:</p>
<pre>mv /sphinx/sphinx-min.conf.in /usr/local/sphinx/sphinx.conf </pre>
<p>I named it sphinx.conf for ease, but you can call it anything you want. Now you want to edit sphinx.conf with your favourite editor. I like to use VI editor. Here&#039;s what the initial open of the file looks like and I&#039;ll run through each section of this script.</p>
<pre>#
# Minimal Sphinx configuration sample (clean, simple, functional)
#

source src1
{
	type			= mysql

	sql_host		= localhost
	sql_user		= test
	sql_pass		=
	sql_db			= test
	sql_port		= 3306	# optional, default is 3306

	sql_query		= \
		SELECT id, group_id, UNIX_TIMESTAMP(date_added) AS
		date_added, title, content \
		FROM table

	sql_attr_uint		= group_id
	sql_attr_timestamp	= date_added

	sql_query_info		= SELECT * FROM table WHERE id=$id
}

index test1
{
	source			= src1
	path			= @CONFDIR@/data/test1
	docinfo			= extern
	charset_type		= sbcs
}

index testrt
{
	type			= rt
	rt_mem_limit		= 32M

	path			= @CONFDIR@/data/testrt
	charset_type		= utf-8

	rt_field		= title
	rt_field		= content
	rt_attr_uint		= gid
}

indexer
{
	mem_limit		= 32M
}

searchd
{
	listen			= 9312
	listen			= 9306:mysql41
	log			= @CONFDIR@/log/searchd.log
	query_log		= @CONFDIR@/log/query.log
	read_timeout		= 5
	max_children		= 30
	pid_file		= @CONFDIR@/log/searchd.pid
	max_matches		= 1000
	seamless_rotate		= 1
	preopen_indexes		= 0
	unlink_old		= 1
	workers			= threads # for RT to work
}</pre>
<p>These settings should cover most of what you&#039;re looking for in terms of setting up Sphinx. I&#039;ll try to run through everything as much as possible. There are more parameters and customization you can do by reading their documentation here.</p>
<p><strong>source src1</strong></p>
<p>This section defines your SQL settings and what is needed to be index. So the first few lines sql_host, sql_user, sql_pass, sql_db is exactly your local host MySQL settings. The sql_port is defaulted to 3306. I haven&#039;t changed this setting for Wamp so that&#039;s where my port sits.</p>
<p>The sql_query is actually crucial. This is the query that you want Sphinx to do and build an index on. Its just like an SQL query you would do. Say my table people had columns: id, name, address, city, age, and joined (stored as time stamp) as follow:</p>
<table width="520" border="1" cellspacing="2" cellpadding="2">
<tr>
<td>id</td>
<td>name</td>
<td>address</td>
<td>city</td>
<td>age</td>
<td>joined</td>
</tr>
<tr>
<td>50</td>
<td>john doe</td>
<td>546 random st.</td>
<td>Vancouver</td>
<td>42</td>
<td>124568794562</td>
</tr>
<tr>
<td>51</td>
<td>amanda smith</td>
<td>
<p>3425 great ave</p>
</td>
<td>Vancouver</td>
<td>18</td>
<td>124568923423</td>
</tr>
<tr>
<td>52</td>
<td>justin heiber</td>
<td>352 awesome dr</td>
<td>
<p>Burnaby</p>
</td>
<td>56</td>
<td>124569000231</td>
</tr>
<tr>
<td>53</td>
<td>macy store</td>
<td>355 loser pl</td>
<td>Richmond</td>
<td>26</td>
<td>124569000352</td>
</tr>
</table>
<p>I want to be able to search for the people&#039;s name and address only so thats all I care about, but I have to include the id and the timestamp. You can also defined unsigned integer attributes. So my sql_query will be:</p>
<pre>sql_query		= \
		SELECT id, id AS id_attr, name, address, joined  \
		FROM people

sql_attr_uint		= id_attr
sql_attr_timestamp	= joined

sql_query_info		= SELECT * FROM people WHERE id=$id</pre>
<p>I&#039;ve defined the sql_attr_uint, sql_attr_timestamp, and sql_query_info. The sql_attr_uint is the unsigned integer attribute and it can&#039;t be the first column which is to define your id. The sql_attr_timestamp is the UNIX timestamp in your column. You can convert if you want but I usually store my dates in timestamp anyways. The sql_query_info is for testing purpose only. It is the query that retrieves the actual row after searching. You have to do this yourself in your PHP Script.</p>
<p><strong>index test1</strong></p>
<p>You can change the name of test1 to anything you want but for the sake of it I&#039;ll just leave it. The source is just the name of the section we did above. If you changed the name then you have to change it here. The path is where you want to store the indexed file on your site. So I&#039;ll store it in the site directory in a folder called sphinx: /var/www/vhosts/site.com/sphinx/test1. The remainder I left the same. I&#039;ve taken out the real time indexing because I&#039;ll be doing my own thing and I heard there were lots of limitations to it at this point, so its not my thing. If it floats your boat you can do some more research and look into it. Here&#039;s my index:</p>
<pre>index test1
{
	source			= src1
	path			= /var/sphinx/test1
	docinfo			= extern
	charset_type		= sbcs
}
indexer</pre>
<p>This section defines the indexer. My database is big so I increased the mem_limit to 64M. Don&#039;t just go for a high or low number. Too low can hurt your searching and too high can hurt your server. Find the balance based on the size of your database.</p>
<p><strong>searchd</strong></p>
<p>This part defined the searchd which is the search application from Sphinx. Besides the log paths I didn&#039;t change anything else. The listen port is where you want searchd to listen in on for search queries. I left it at 9312 which is where I&#039;ll point my PHP script to later on.</p>
<p>Here is my sphinx.conf file:</p>
<pre>#
# Minimal Sphinx configuration sample (clean, simple, functional)
#

source src1
{
	type			= mysql

	sql_host		= localhost
	sql_user		= test
	sql_pass		=
	sql_db			= test
	sql_port		= 3306	# optional, default is 3306

	sql_query		= \
		SELECT id, id AS id_attr, name, address, joined  \
		FROM people

	sql_attr_uint		= id_attr
	sql_attr_timestamp	= joined

	sql_query_info		= SELECT * FROM people WHERE id=$id
}

index test1
{
	source			= src1
	path			= /var/sphinx/test1
	docinfo			= extern
	charset_type		= sbcs
}

indexer
{
	mem_limit		= 64M
}

searchd
{
	listen			= 9312
	listen			= 9306:mysql41
	log			= /var/log/sphinx/test1searchd.log
	query_log		= /var/log/sphinx/test1query.log
	read_timeout		= 5
	max_children		= 30
	pid_file		= /var/log/sphinx/test1searchd.pid
	max_matches		= 1000
	seamless_rotate		= 1
	preopen_indexes		= 0
	unlink_old		= 1
}</pre>
<h3>Getting Sphinx Ready</h3>
<p>Now that you have the conf file setted up, save and close the file. Now we&#039;re ready to install.</p>
<p>First, we&#039;re going to build the index by typing in <em>indexer -config /usr/local/sphinxsphinx.conf test1</em>. Replace test1 if you changed the name of your index. If you don&#039;t get any errors and see some numbers run then you&#039;re fine.</p>
<p>Once the index is build you want to prepare Sphinx&#039;s service on your machine. Type in searchd -install -config /usr/local/sphinx/sphinx.conf. It&#039;ll prompt you that the installation was successful.</p>
<h3>Testing Sphinx Out</h3>
<p>Let us try out the new nifty search. So say I want to search my table for john doe I&#039;ll type search /usr/local/sphinx/sphinx.conf &#034;john doe&#034;. That should return something for me. I can define the matching modes and which column to search as well such as search -ext2 -config /usr/local/sphinx/sphinx.conf &#034;@name john @address awesome&#034;. If you are getting the results you want then you are ready to move forward into your PHP script.</p>
<h3>Sphinx and Your PHP Script</h3>
<p>You need the Sphinx API in your script for it to work so go to c:\sphinx\api and copy sphinxapi.php to your site directory. Include this file in your script and call on the class:</p>
<div class="dean_ch" style="white-space: wrap;"><span class="kw1">require_once</span><span class="br0">&#40;</span><span class="st0">&#039;sphinxapi.php&#039;</span><span class="br0">&#41;</span>;<br />
<span class="co1">//Sphinx</span><br />
<span class="re0">$s</span> = <span class="kw2">new</span> SphinxClient;<br />
<span class="re0">$s</span>-&gt;<span class="me1">setServer</span><span class="br0">&#40;</span><span class="st0">&quot;localhost&quot;</span>, <span class="nu0">9312</span><span class="br0">&#41;</span>;<br />
<span class="re0">$s</span>-&gt;<span class="me1">setMatchMode</span><span class="br0">&#40;</span>SPH_MATCH_EXTENDED2<span class="br0">&#41;</span>;</div>
<p>Noticed I have setServer pointing to the port I told Sphinx to listen to. The setMatchMode is just the matching mode you&#039;ll like to use. In my case I&#039;m using extended 2.</p>
<p>Now you can query search your Sphinx index with:</p>
<div class="dean_ch" style="white-space: wrap;"><span class="co1">//Search Query</span><br />
<span class="re0">$result</span> = <span class="re0">$s</span>-&gt;<span class="me1">query</span><span class="br0">&#40;</span><span class="st0">&quot;@name $searchName @address $searchAddress&quot;</span><span class="br0">&#41;</span>;</div>
<p>The $result returned will not include the rows and columns of your actual table. It&#039;ll return the follow parameters (taken from <a href="http://www.php.net" target="_blank">php.net</a>):</p>
<table width="520" border="1" cellpadding="1" cellspacing="1">
<thead valign="middle">
<tr valign="middle">
<th>Key</th>
<th>Value description</th>
</tr>
</thead>
<tbody valign="middle">
<tr valign="middle">
<td align="left">&quot;matches&quot;</td>
<td align="left">An array with found document IDs as keys and their weight and attributes values as values</td>
</tr>
<tr valign="middle">
<td align="left">&quot;total&quot;</td>
<td align="left">Total number of matches found and retrieved (depends on your settings)</td>
</tr>
<tr valign="middle">
<td align="left">&quot;total_found&quot;</td>
<td align="left">Total number of found documents matching the query</td>
</tr>
<tr valign="middle">
<td align="left">&quot;words&quot;</td>
<td align="left">An array with words (case-folded and stemmed) as keys and per-word statistics as values</td>
</tr>
<tr valign="middle">
<td align="left">&quot;error&quot;</td>
<td align="left">Query error message reported by searchd</td>
</tr>
<tr valign="middle">
<td align="left">&quot;warning&quot;</td>
<td align="left">Query warning reported by searchd</td>
</tr>
</tbody>
</table>
<p>This means that $result['total'] will tell me how many results were found and $result['matches'] is where the id of the search results are stored. So here&#039;s a simple line to return all of the results:</p>
<div class="dean_ch" style="white-space: wrap;"><span class="kw1">if</span> <span class="br0">&#40;</span><span class="re0">$result</span><span class="br0">&#91;</span><span class="st0">&#039;total&#039;</span><span class="br0">&#93;</span> &gt; <span class="nu0">0</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">foreach</span> <span class="br0">&#40;</span><span class="re0">$result</span><span class="br0">&#91;</span><span class="st0">&#039;matches&#039;</span><span class="br0">&#93;</span> <span class="kw1">as</span> <span class="re0">$id</span> =&gt; <span class="re0">$otherStuff</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//Get Column</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$searchColumn</span> = <a href="http://www.php.net/mysql_fetch_array"><span class="kw3">mysql_fetch_array</span></a><span class="br0">&#40;</span> <a href="http://www.php.net/mysql_query"><span class="kw3">mysql_query</span></a><span class="br0">&#40;</span><span class="st0">&quot;SELECT * FROM people WHERE id=$id&quot;</span><span class="br0">&#41;</span> <span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//Dump</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/var_dump"><span class="kw3">var_dump</span></a><span class="br0">&#40;</span><span class="re0">$searchColumn</span><span class="br0">&#41;</span>; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span> <span class="kw1">else</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/echo"><span class="kw3">echo</span></a> <span class="st0">&#039;No results found&#039;</span>; &nbsp; &nbsp; &nbsp; &nbsp;<br />
<span class="br0">&#125;</span></div>
<p>Notice that the mysql_query is the same as sql_query_info in sphinx.conf. What a coincidence eh? LOL. That is all and now you have a working Sphinx search system setup on your local machine. If you need to reindex your Sphinx you can do so without restarting the service. In command prompt just run <em>indexer -config /usr/local/sphinx/sphinx.conf -rotate test1</em>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.crankberryblog.com/2011/installing-sphinx-on-centoslinux-through-ssh/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Structuring websites in terms of folders, codes and naming conventions</title>
		<link>http://www.crankberryblog.com/2011/structuring-websites-in-terms-of-folders-codes-and-naming-conventions</link>
		<comments>http://www.crankberryblog.com/2011/structuring-websites-in-terms-of-folders-codes-and-naming-conventions#comments</comments>
		<pubDate>Thu, 03 Mar 2011 23:25:29 +0000</pubDate>
		<dc:creator>Jerry Low</dc:creator>
				<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.crankberryblog.com/?p=447</guid>
		<description><![CDATA[When you begin to build bigger sites composed of 50 or more files you start to get messy and unorganized - it's time to structure. The key to organizing a website is folders, code structure and naming conventions. Master these skills, be consistent, and you'll be more organize and prepared for the future.]]></description>
			<content:encoded><![CDATA[<p>When you begin to build bigger sites composed of 50 or more files you start to get messy and unorganized &#8211; it&#039;s time to structure. The key to organizing a website is folders, code structure and naming conventions. Master these skills, be consistent, and you&#039;ll be more organize and prepared for the future.</p>
<p>The future means resume working on a site after a long break. Often, when you&#039;re working on a site you&#039;ll know where every single line of code is. It&#039;s just like when you leave your keys or wallet somewhere, chances are you&#039;ll remember where it&#039;s located, but leave it there for a year and try to find it &#8211; unless it&#039;s in hindsight you&#039;ll forget where you&#039;ve put them. Train yourself to be organized and let it be a habit. Coming back to a site that you have left for months or years will natural as your organization skills haven&#039;t changed.</p>
<h3>Folders</h3>
<p>The first and simplest thing you can use is folders. Everybody knows how to create them and place files inside. Use them to group files together. One thing most developer will do is place all images in a folder, so that is a good start. Do this for everything. You can group css, images, functions, javascripts, and templates in their own folders. The first two maybe obvious and probably done by most developers already. As for functions, these can be scripts that are mainly classes and specific funtions. Javascripts can be all javascripts or specific ones like JQuery related codes. The last group, templates, can hold files that affects the aesthetics of the site (non-css files).</p>
<p>You can also use subfolders if you have a lot of files within each folder. If your site is composed of thousands of images, group them based on their location or their function of the site. Location based could be broken down as header, footer, landing page, content page and etc. Function based grouping can be something like user profiles, navigation, products and etc. I&#039;d like to keep it to the rule of third which is no further than three levels deep as then it starts to get messy again, but this really depends on your site. If your site is composed of thousands or files, then be my guest.</p>
<h3>Code Structure</h3>
<p>The structure of your code within each file is more of an art than science. Do what you need to do but ensure you&#039;re organized. Use comments as much as possible and don&#039;t be afraid to be descriptive. You can be creating with your comments as to highlight sections and create titles for individual sections. On certain files such as CSS you can code a based on hierarchy of your site, which means the top of your file defines the HTML then the BODY all the way to the FOOTER which is at the bottom. This type of structure can only work on certain files. Try and see what works best.</p>
<h3>Naming Conventions</h3>
<p>Organizing your files based on name is a really good skill too. If multiple files work together in a certain way you can name them to group them together without necessarly creating a folder for them. Say three files work together to make up the product update module you can have them named prod_update_delete.php, prod_update_edit and prod_update_info.php. That way when you need to edit the product update module you can quickly find the three files and know where to go. If the module has its own folder you can still combine the two for a quicker find, such as:</p>
<ul>
<li>[FOLDER] administrator
<ul>
<li>[FOLDER] products</li>
<li>[FILE] _class_prod.php</li>
<li>[FILE] _class_search.php</li>
<li>[FILE] _class_template.php</li>
<li>[FILE] images.php</li>
<li>[FILE] prod_update_delete.php</li>
<li>[FILE] prod_update_edit.php</li>
<li>[FILE] prod_update_info.php</li>
<li>[FILE] search.php</li>
<li>[FOLDER] shopping_cart</li>
</ul>
</li>
<li>[FOLDER] css</li>
<li>[FOLDER] images</li>
<li>[FOLDER] javascript</li>
</ul>
<p>Underscores can be used to bring files to the top of the list. You can use this for important or commonly shared files within the module such as classes and functions.</p>
<p>Structure and organization is good skills and habits to have especially if you work with multiple sites at a time or you often leave and come back to sites. Like everything else you do, you&#039;ll need practice to get better. Chances are you won&#039;t be comfortable with the way you did things on your first try, keep changing and perfecting it until you&#039;re where you prefer. As you deviate and evolve try to be consistent, it&#039;ll keep your style flowing. Good luck.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.crankberryblog.com/2011/structuring-websites-in-terms-of-folders-codes-and-naming-conventions/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The ultimate newb&#039;s guide to learning web development (Pt. 1: The Basic)</title>
		<link>http://www.crankberryblog.com/2010/the-ultimate-newbs-guide-to-learning-web-development-pt-1-the-basic</link>
		<comments>http://www.crankberryblog.com/2010/the-ultimate-newbs-guide-to-learning-web-development-pt-1-the-basic#comments</comments>
		<pubDate>Fri, 24 Sep 2010 22:22:21 +0000</pubDate>
		<dc:creator>Jerry Low</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[learning]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.crankberryblog.com/?p=406</guid>
		<description><![CDATA[If you are just discovering the world of web development but know nothing about HTML code, css and mumble-jumble, here's a good place to start. In this article I will outline in general where to find resources and some good skills to pick up on to becoming a minor expert in the field.]]></description>
			<content:encoded><![CDATA[<p>If you are just discovering the world of web development but know nothing about HTML code, css and mumble-jumble, here&#039;s a good place to start. In this article I will outline in general where to find resources and some good skills to pick up on to becoming a minor expert in the field.</p>
<p>To be honest, web development is all about practice and understanding, of course creativity as well (I&#039;ll get to this later). Here&#039;s a little scope about how I picked up on web development. I started making websites through FrontPage when I was 13, using only a bit of HTML and mainly the WYSIWYG (what you see is what you get) editor. It wasn&#039;t until I was 15 that I started developing with HTML and using CSS. When I was 18 I felt the need for more power in my websites which is when I picked up PHP and MySQL. About a year ago was finally when I started picking up on Javascript.</p>
<p>Basically, I learned everything through every resource except taking classes. I would search through the web, read books from the library or just pure trial and error. It wasn&#039;t insanely hard to gather all the information but the only times when I really learn was through projects and experiments. Web development is definitely a hands-on type of thing. Point is, if you want to learn web development you&#039;ll have to spend 30% reading and 70% doing.</p>
<h2>The Program/Software</h2>
<p>Web development can be accomplished through a few languages and most of them don&#039;t require any special software to write. The basic notepad that came with your Windows is capable of completing the task. I prefer to use a software that color codes coding to mitigate headaches. Here&#039;s a list of software that you could choose from.</p>
<ul>
<li><a href="http://notepad-plus-plus.org/" target="_blank">Notepad++ (Free)</a></li>
<li><a href="http://kompozer.net/" target="_blank">KompoZer (Free)</a></li>
<li><a href="http://www.w3.org/Amaya/" target="_blank">Amaya (Free)</a></li>
<li><a href="http://www.seamonkey-project.org/" target="_blank">SeaMonkey (Free)</a></li>
<li><a href="http://www.microsoft.com/expression/" target="_blank">Microsoft Expression Studio ($149)</a></li>
<li><a href="http://www.adobe.com/products/dreamweaver/" target="_blank">Adobe Dreamweaver ($399)</a></li>
</ul>
<p>I personally use Dreamweaver on my computer as I have been using it since I was young so I have a nostalgic feeling to it. When I&#039;m on the go I have notepad++ on my USB.</p>
<h2>Learning HTML</h2>
<p>Before you learn anything else, you have to be really good at HTML (hyper text markup language). The basic of websites all boils down to this language. HTML is the markup language containing markup tags that creates the webpage document. Every website requires HTML to make it work, yes even Flash websites.</p>
<p>Your basic website is wrapped in an opening and closing HTML tag. Opening tags are surrounded by arrow brackets while closing tags are the same but there&#039;s a front slash immediately after the first arrow bracket like such</p>
<div class="dean_ch" style="white-space: wrap;">&lt;html&gt;&lt;/html&gt;</div>
<p>Within the HTML tags there will be a HEAD and BODY tag. The head tags will describe items related to the website but will not be produced in the content. Items such as site title, meta tags, CSS, and Javascripts can be defined in the HEAD tag. The BODY tag will describe content that will be outputted to the user. A code like this:</p>
<div class="dean_ch" style="white-space: wrap;">&lt;html&gt;<br />
&lt;head&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;title&gt;Test Page&lt;/title&gt;<br />
&lt;/head&gt;</p>
<p>&lt;body&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; Hello world!<br />
&lt;/body&gt;<br />
&lt;/html&gt;</div>
<p>Will output &#034;Hello world!&#034; on the browser with the title Test Page in the browser title bar. Once you get this down you&#039;re ready to start building the website. The goal following this is to output the content you wish to show, it could be paragraphed text, images or tables. Everything you wished to use requires a markup tag to make it work. It&#039;ll be redundant for me to give you a tutorial on all the tags but here are two resources that are great.</p>
<ul>
<li><a href="http://www.w3schools.com/html/default.asp" target="_blank">w3school &#8211; HTML</a></li>
<li><a href="http://www.html.net/tutorials/html/" target="_blank">HTML.net</a></li>
</ul>
<p>w3school is great, as they are short writeups but concise so you can digest all of the content quickly. HTML.net is more detailed and a great read too but they incorporate a bit of CSS so its better to read it after w3school to cross-reference some of the ideas and undestanding. Once you&#039;ve got this down you&#039;re ready for some CSS.</p>
<h2>Learning CSS</h2>
<p>CSS (Cascading Style Sheet) is a language that focuses on the style and layout of your markup language. Its a common standard now generate the accurate aesthetic results of many websites. There are a few ways to include CSS in your website.</p>
<div class="dean_ch" style="white-space: wrap;">//Link to a CSS file &#8211; Goes in the &lt;head&gt;&lt;/head&gt; tag<br />
&lt;link href=&quot;css/styles.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;</p>
<p>//Have the CSS in the &lt;head&gt;&lt;/head&gt; tag<br />
&lt;style type=&quot;text/css&quot;&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; .css { font-weight: bold; }<br />
&lt;/style&gt;</p>
<p>//Inline with content markup tags &#8211; in &lt;body&gt;&lt;/body&gt; tag<br />
&lt;p style=&quot;font-size: 22px;&quot;&gt;this is a paragraph&lt;/p&gt;<br />
&nbsp;</div>
<p>Once you have your website linked with some CSS you can start controlling your website. Here are some example of CSS controlling a webpage.</p>
<div class="dean_ch" style="white-space: wrap;">//All paragraph content will be bold and have a line height of 22 pixels<br />
p { font-weight: bold; line-height: 22px; }</p>
<p>//The following code will modify all markup tags with the class &quot;change&quot; to have a background color of black<br />
.change { background: #000; }</p>
<p>//The following code will modify the element with ID &quot;element_1&quot; to have a background color of white<br />
#element_1 { background: #FFF; }</div>
<p>Here are the resources to read to learn all about CSS.</p>
<ul>
<li><a href="http://www.w3schools.com/css/default.asp" target="_blank">w3school &#8211; CSS</a></li>
<li><a href="http://www.html.net/tutorials/css/" target="_blank">HTML.net</a></li>
</ul>
<p>Again its good to go over the basics with w3school first then head to HTML.net. </p>
<p>At this point you should practice making a few websites with HTML and CSS. Try to envision something and then build it. The best practice is to try to design something in Photoshop then try to build a web site from it. As I always tell developers, just design it and I&#039;ll make it into a template, because I don&#039;t believe there&#039;s many design limitations that can&#039;t be built with HTML and CSS. By doing this exercise it&#039;ll help you learn different methods of building different elements.</p>
<h2>Notes and Reminders</h2>
<p>There are some things you should keep in mind when building with HTML and CSS though.</p>
<h3>Using tables for design</h3>
<p>This is a no and not recommended. A lot of people argue over this topic. Some believe that tables are good for design because its easier to control and it holds the shape of the original design better. The problem is tables are clunky, heavy in coding and not very flexible. Tables have specific standards to them so if you have two rows and two columns, the columns have to be equal width while rows have to be equal height. In order to work around that you&#039;ll have to nest your tables, imagine dealing with that. Its also less flexible for future expansions. You should use a table for tabular data though. Extreme non-table believers will argue that you don&#039;t, they can produce the same effect with other elements. They sure can but when it comes down to the user extracting your data (copying to word or excel), copying for a table is much easier than anything else. It just makes sense.</p>
<h3>Avoid absolute positioning of everything</h3>
<p>Many developers when they start will notice the amount of control with absolute positioning. It is not until their design gets more complicated that it all falls apart. Absolute position provides more flexibility but will sometimes diminish your control, use wisely.</p>
<h3>Test in multiple browsers</h3>
<p>There are various browsers on the web. It sometimes depends on who your website caters to but mind as well cover the major users. Test on desktop machines with Internet Explorer 6, 7, 8, 9, Chrome, Firefox, Safari. On mobile devices with Android, Opera Mini, iOS. Just make sure everything&#039;s consistent. This is a good chance to test how good your skills are too.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.crankberryblog.com/2010/the-ultimate-newbs-guide-to-learning-web-development-pt-1-the-basic/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>USB for web developer</title>
		<link>http://www.crankberryblog.com/2010/usb-for-web-developer</link>
		<comments>http://www.crankberryblog.com/2010/usb-for-web-developer#comments</comments>
		<pubDate>Fri, 27 Aug 2010 17:43:49 +0000</pubDate>
		<dc:creator>Jerry Low</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[apps]]></category>
		<category><![CDATA[usb]]></category>

		<guid isPermaLink="false">http://www.crankberryblog.com/?p=394</guid>
		<description><![CDATA[The other day I was working on a friend's machine, and since he didn't have the tools and programs I needed to commence my crazy development, I had to whip out my "stick". My USB stick that is. I plugged it in, and within minutes I was slicing, coding, and uploading. He asked me, "how'd you do that?". All I could reply was, "magic", but in fact you all might know by now, it's not magic. I have kept a USB with me for the last few years that has kept programs for mobile web development work. Today I will share with you the apps I have installed.]]></description>
			<content:encoded><![CDATA[<p>The other day I was working on a friend&#039;s machine, and since he didn&#039;t have the tools and programs I needed to commence my crazy development, I had to whip out my &#034;stick&#034;. My USB stick that is. I plugged it in, and within minutes I was slicing, coding, and uploading. He asked me, &#034;how&#039;d you do that?&#034;. All I could reply was, &#034;magic&#034;, but in fact you all might know by now, it&#039;s not magic. I have kept a USB with me for the last few years that has kept programs for mobile web development work. Today I will share with you the apps I have installed.</p>
<h3>The USB</h3>
<p>Before you can get started you&#039;ll have to get a USB flash drive (if you don&#039;t have one already). For the capacity, you&#039;ll want something 4 GB or more. The apps won&#039;t take up the whole 4 GB but having the extra space will be beneficial. As for the physical size, you&#039;ll want something easy to carry but hard to lose, so find something that you&#039;ll be comfortable carrying around all the time.</p>
<h3>The Setup</h3>
<p>First of all you&#039;ll want the launcher to organize everything on your USB. The launcher is a free software called PortableApps and can be found at: <a href="http://portableapps.com/apps" target="_blank">http://portableapps.com/apps</a>.</p>
<h3>The Apps</h3>
<p>After you have installed the launcher you can get all the apps. Here&#039;s a list of all the apps I used. You can pick and choose as you may have your own preference.</p>
<p><strong>HTML Editor &#8211; Notepad++</strong><br />
<a href="http://portableapps.com/apps/development/notepadpp_portable" target="_blank">http://portableapps.com/apps/development/notepadpp_portable</a><br />
The first and most important thing to have is a HTML editor. I vary between Dreamweaver and Notepad++ on my desktop so using Notepad++ on my USB was no surprise. Its light and has a nice color scheme.</p>
<p><img src="http://www.crankberryblog.com/images/usb-notepad.jpg" alt="USB Notepad++" /></p>
<p><strong>Server &#8211; XAMPP</strong><br />
<a href="http://portableapps.com/apps/development/xampp" target="_blank">http://portableapps.com/apps/development/xampp</a><br />
If you&#039;re coding with a database or using server-side scripting you&#039;ll need a server to do so. I&#039;m used to WAMP but using XAMPP is not bad either. A great portable alternative.</p>
<p><img src="http://www.crankberryblog.com/images/usb-xampp.jpg" alt="USB XAMPP" /></p>
<p><strong>Browser &#8211; FireFox</strong><br />
<a href="http://portableapps.com/news/2010-08-12_-_firefox_portable_4.0_beta_3" target="_blank">http://portableapps.com/news/2010-08-12_-_firefox_portable_4.0_beta_3</a><br />
Should I explain more? This is Firefox, FIREFOX!</p>
<p><img src="http://www.crankberryblog.com/images/usb-firefox.jpg" alt="USB Firefox" /></p>
<p><strong>FTP &#8211; Filezilla</strong><br />
<a href="http://portableapps.com/apps/internet/filezilla_portable" target="_blank">http://portableapps.com/apps/internet/filezilla_portable</a><br />
If you need to FTP your files there&#039;s the great Filezilla. I use Filezilla on my desktop already because its free and easy to use with constant updates. Its pretty much the same for the portable version.</p>
<p><img src="http://www.crankberryblog.com/images/usb-filezilla.jpg" alt="USB Filezilla" /></p>
<p><strong>FTP &#8211; Filezilla</strong><br />
<a href="http://portableapps.com/apps/internet/filezilla_portable" target="_blank">http://portableapps.com/apps/internet/filezilla_portable</a><br />
If you need to FTP your files there&#039;s the great Filezilla. I use Filezilla on my desktop already because its free and easy to use with constant updates. Its pretty much the same for the portable version.</p>
<p><img src="http://www.crankberryblog.com/images/usb-filezilla.jpg" alt="USB Filezilla" /></p>
<p><strong>Graphic &#8211; GIMP</strong><br />
<a href="http://portableapps.com/apps/graphics_pictures/gimp_portable" target="_blank">http://portableapps.com/apps/graphics_pictures/gimp_portable</a><br />
Working from graphics to coding cannot be easier with the great Photoshop alternative, GIMP!</p>
<p><img src="http://www.crankberryblog.com/images/usb-gimp.jpg" alt="USB GIMP" /></p>
<h3>Optional Apps</h3>
<p><strong>Compression &#8211; 7 ZIP</strong><br />
<a href="http://portableapps.com/apps/utilities/7-zip_portable" target="_blank">http://portableapps.com/apps/utilities/7-zip_portable</a><br />
Zip and unzip files with ease on the go.</p>
<p><img src="http://www.crankberryblog.com/images/usb-7zip.jpg" alt="USB 7zip" /></p>
<p><strong>Tablet &#8211; On Screen Keyboard</strong><br />
<a href="http://portableapps.com/apps/accessibility/on-screen_keyboard_portable" target="_blank">http://portableapps.com/apps/accessibility/on-screen_keyboard_portable</a><br />
If you&#039;re working on a tablet machine that doesn&#039;t have a native on screen keyboard, this is the right tool for you.</p>
<p><img src="http://www.crankberryblog.com/images/usb-keyboard.jpg" alt="USB Keyboard" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.crankberryblog.com/2010/usb-for-web-developer/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Image optimization for web design and development</title>
		<link>http://www.crankberryblog.com/2010/image-optimization-for-web-design-and-development</link>
		<comments>http://www.crankberryblog.com/2010/image-optimization-for-web-design-and-development#comments</comments>
		<pubDate>Tue, 16 Feb 2010 19:40:03 +0000</pubDate>
		<dc:creator>Jerry Low</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Bandwidth]]></category>
		<category><![CDATA[Image Optimization]]></category>
		<category><![CDATA[Load Size Reduction]]></category>

		<guid isPermaLink="false">http://www.crankberryblog.com/?p=311</guid>
		<description><![CDATA[Between a good design a good development there's a path in between that we all must cross which is converting your design into a functional website. An aspect to really consider now a days is loading time of the website. There are many variables that contribute to a site's load time which includes server and client aspects and everything in between. Today we will focus specifically on loading the images on the site and how you can optimize them for best performance.

<img src="http://www.crankberryblog.com/images/image-optimization.jpg" alt="Image Optimization" />]]></description>
			<content:encoded><![CDATA[<p>Between a good design a good development there&#039;s a path in between that we all must cross which is converting your design into a functional website. An aspect to really consider now a days is loading time of the website. There are many variables that contribute to a site&#039;s load time which includes server and client aspects and everything in between. Today we will focus specifically on loading the images on the site and how you can optimize them for best performance.</p>
<p><img src="http://www.crankberryblog.com/images/image-optimization.jpg" alt="Image Optimization" /></p>
<h2>The Design Aspect</h2>
<p>I always tell myself and people who design for me to not worry about the design. I can always code it and optimize it for the web. Although this maybe true I don&#039;t always design with that mentality. I usually keep the user of the website in mind. I never try to overkill the design just because I want to, but this is coming from a developer&#039;s thoughts. </p>
<p>Regardless, if you are one who is highly concerned about the graphical load time then design with that in mind. You can cut down on size by using design elements that you know can be replaced by CSS 2.0 standard coding. So we&#039;re talking about solid boxes, solid lines and etc. We&#039;ll go further into that in the CSS section. Using heavy graphics and lots of blending will add up in size. Something like that looks like Crankberry will cost you around 700 KB in image size with the whole page loading around 1 MB. I cater to designers and developers so fairly average for today&#039;s standard. </p>
<p>With that, keep those thoughts in mind when designing because if you design first then noticed that the site bogs down then you&#039;ll be going back many steps just to make revisions to that.</p>
<h2>Keeping the Balance</h2>
<p>As mentioned in the beginning of the article that there are many things that dampens the load time of your site. The way your content is drawn onto the pages is also a factor that may affect the speed. Static contents won&#039;t pull you down much unless you&#039;re uploading novels and encylclopedias on one page but then you have other problems to worry about don&#039;t you. Anyways, if your website pulls a lot of content from your database per page with lots of joins and queries then your content is also factored in. In these scenarios I usually recommend keeping a balance to mitigate high load times. So if you have a lot of heavy database interaction I would recommend keeping the design and graphics to a lower end. On the contrary if you don&#039;t have a lot of database interaction I may not recommend super heavy design just means that you&#039;re more flexible. Refer back to the last section as to how to optimize your design.</p>
<h2>JPEG vs GIF vs PNG</h2>
<p>Now that you&#039;re done your designing its time to slice the images up and start structuring your HTML and CSS. When saving your image files you have so many options as to which file format to save it as. You&#039;ve got JPEG, GIF, PNG, Bitmap, TIFF and the list goes on and on. Just to shorten your list down, I would stick to three primary formats: JPEG, GIF, and PNG. All the other formats for development wise can be forgotten. Now some people like to consistenty use one format throughout their whole website but I like to switch it up. I prefer to use JPEG, GIF and sometimes PNG. I&#039;ll go into further details about which I use and when I use it in a bit. First of all you should understand the difference between all these formats. There has been many articles written over this topic so it would be super redundant to do it again. I&#039;ll spare you the theatrics and give you the highlights.</p>
<p><strong>JPEG</strong></p>
<ul>
<li>Lossly compression</li>
<li>Compresses colors and grayscale</li>
<li>Used for complex images</li>
</ul>
<p><strong>GIF</strong></p>
<ul>
<li>Lossless compression</li>
<li>256 Colors</li>
<li>Good for line and simple drawings</li>
<li>Supports animation</li>
<li>Supports transparency</li>
</ul>
<p><strong>PNG</strong></p>
<ul>
<li>Lossless compression</li>
<li>Patent-free GIF</li>
<li>Supports transparency with opacity setting</li>
</ul>
<h2>Which to Use</h2>
<p>After reading the above part you maybe wondering how this infomation reflects on your files format and which one you should use. Here&#039;s how you look at it. Lean towards GIF and JPEG and if necessary then use PNG.</p>
<p>Lets start with why minimal use of PNG. PNG is a nice format format in replacement of GIF. When saving the same simple GIF file in PNG you can end up with a smaller file size as PNG does a better job in compression. The reason I still don&#039;t use PNG much is because some of the older, non-main stream and mobile browsers don&#039;t have a good support for PNGs. There are ways to go abouts for this but to accomodate for all browsers would be very timely. As I always focus to present a cross-browser compatible website I stay away from this format.</p>
<p>Now then, we&#039;re left with the JPEG and the GIF. It is very simple when it comes down to these two contenders. If the image you&#039;re saving has lots of colors and blending then go for the JPEG if it has simple lines and text and solid color go for the GIF. Your sizes will optimized this way.</p>
<p><img src="http://www.crankberryblog.com/images/image-optimization-example-jpeg.jpg" alt="Image Optimization with JPEG" /></p>
<p><img src="http://www.crankberryblog.com/images/image-optimization-example-gif.jpg" alt="Image Optimization with GIF" /></p>
<p>Here I took a screenshot of my currently portfolio (top design) which should most of the images should be saved in JPEG due to the complexity of the images and colors. The second screenshot is of FusedEffects which should mostly be saved in GIF due to the simple lines and large blobs of solid colors.</p>
<h2>Good Practice</h2>
<p>Obviously if you&#039;ve got all that down you can quickly decide which format to use and how much compression you may want to do. If you&#039;re lazy like myself and you have Photoshop the best thing to do is to use their [Save as for Web] setting. The window it popups up with will give you the image size before you even save it.</p>
<p><img src="http://www.crankberryblog.com/images/image-optimization-good-practice.jpg" alt="Image Optimization Practices" /></p>
<p>This way you can switch between JPEG, GIF, PNG and different settings until you get the quality and size that pleases you.</p>
<h2>The Role of CSS</h2>
<p>Ok ok ok, I mentioned a few times (at least I think) that you can replace certain elements with CSS to eliminate the use of graphics where necessary. I always prefer this method when possible as I tend to think a few lines of code is always smaller than an image size. </p>
<p>Now a days, developers have come up with many creative ways to achieve graphical effects with just a few lines of coding. Such as rounded corners. The trend right now seems to be using rounded corner boxes instead of plain old square. Since CSS 2.0 has no support for rounded corners on div tags people rely on images and positioning. As I have released months ago a script that is <a href="http://www.crankberryblog.com/tool/css-rounded-corners-generator.php">purely css, cross-browser compatible and image-less for rounded corners.</a></p>
<p><img src="http://www.crankberryblog.com/images/css-rounded-corners-with-borders.jpg" /></p>
<p>That&#039;s only one of the many examples in which graphical elements can be replaced by CSS coding. I will be doing a full article on this in the near future so stay tuned for that.</p>
<h3>If You Can&#039;t Replace The Image, Work With It</h3>
<p>In certain cases some pure CSS solutions aren&#039;t as stable yet such as gradient effects you can combine images with CSS to create the effect. So for a full stretch gradient instead of making an image 5000px x 10px just save it as 1px x 10px and use the background: repeat-x; This will save you lots.</p>
<p>In summary, how much can you save by going through so much optimization. This really depends on how heavily you designed your site. As you can tell by my style I like to go heavy with personal designs and light on business designs. Sometimes its not up to you. I work with a designer who over does gradients and shadows everywhere so its up to me to optimized the images. Sometimes I can save up to 500+ KB by doing the right optimization. You maybe thinking that with the advancement of cable internet and the cost of bandwidth going down it doesn&#039;t really matter. Remember its all about the user experience. There are lots of factors involved that contibutes to your site&#039;s load time, try to optimized everything so there&#039;s is minimal lag time. You should also understand that with the advancement of technology more and more people are surfing with their mobile phones or laptops tethered through their mobile phones. Its always a plus for your users when they get the things they&#039;re looking for, faster.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.crankberryblog.com/2010/image-optimization-for-web-design-and-development/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Stats you should know before making a website</title>
		<link>http://www.crankberryblog.com/2009/stats-you-should-know-before-making-a-website</link>
		<comments>http://www.crankberryblog.com/2009/stats-you-should-know-before-making-a-website#comments</comments>
		<pubDate>Wed, 18 Nov 2009 19:15:07 +0000</pubDate>
		<dc:creator>Jerry Low</dc:creator>
				<category><![CDATA[Blogging]]></category>
		<category><![CDATA[Internet Economy]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.crankberryblog.com/?p=300</guid>
		<description><![CDATA[Making a website or a blog now-a-days is not easy, given all the tools we have today compared to the early 90's means its not only easier for us but easier for others too. The competitive playground is just so big now a days. This is why your website not only has to be unique but has to cover a few basic things first. Here are some stats and guidelines to help you get started. As well as a look into the business aspect of making a website.]]></description>
			<content:encoded><![CDATA[<p>Making a website or a blog now-a-days is not easy, given all the tools we have today compared to the early 90&#039;s means its not only easier for us but easier for others too. The competitive playground is just so big now a days. This is why your website not only has to be unique but has to cover a few basic things first. Here are some stats and guidelines to help you get started. As well as a look into the business aspect of making a website.</p>
<h3>Website Name</h3>
<p>When I was a younger starting a website or a project was easy. Just come up with a name that I liked and then just purchase the relevant domain after. Today, its not the case, we name websites and projects based on domain availabilities and possibly price. Just to give you a scope there are 112,961,783 active domains currently, with 83,320,335 of that being a .com domain (1). Although the combination of words for domain is near endless, it&#039;ll be harder and harder to get the name you want.</p>
<p>It will eventually boils down to resorting to a longer domain name, unique play on words or purchasing pre-owned domains at a premium pricing.</p>
<h3>The Design</h3>
<p>Once you&#039;re ready to start designing your website you&#039;ll have to put into perspective how big or small to design it. Just because you have a 14&#034; or a 36&#034; monitor doesn&#039;t mean that everybody does as well. As of January 2009 57% of detectable users are displaying at higher than 1024&#215;768 px. There are 36% users at 1024&#215;768 and 4% less than that (2).</p>
<p>Understanding your target users is very important. If you cater to teenagers than a higher percentage of your user will end up in the 1024&#215;768+ category. If you cater to an older or well aged audience then you&#039;ll probably have more users in the 1024&#215;768 or below category. If you cater to graphic artists and designers then you most like have a much higher resolution to work with. </p>
<p>I tend to use a 1400&#215;1100 canvas for my design and keep content within a 1200&#215;1100 or 1000&#215;1100 box, the remaining area is for the design of the background. Just like shown below:</p>
<p><img src="http://www.crankberryblog.com/images/stats-for-web-canvas.jpg" alt="Canvas for Web Design" /></p>
<p><strong>Color Wise</strong></p>
<p>You shouldn&#039;t have to worry too much about colors as 95% of users has 24bit or 32 bit hardware supporting up to 16,777,216 colors.</p>
<h3>Developing</h3>
<p>The biggest concern that you should have is how the users view your website once its made into HTML. The most recent stats indicate that 47.5% users online are using Firefox and a collective percentage of 37.5% of users are using IE6, 7 and 8 (3). As you can see a significantly outstanding of majorities use Firefox and IE. </p>
<p>When developing offline I like to test and view my scripts in Firefox and IE7. Once done, I like to view it in IE 6 and tweak things. This step should be the biggest tweaking stage. If everything works in Firefox and IE 6 and 7 the probability (and this is not a probability of 1) of it working on other browsers is pretty good.</p>
<p>When I have time I also like to test the page on different machines and different mobile devices to get a glimpse of how its working out.</p>
<h3>The Money</h3>
<p>With that, lets get to where some of you are truly interested in &#8211; the money. Is there money to be made making websites? Yes, but the competition as said before is high. With 112,961,783 active domains and 50 million blogs (detected in 2006) there arena is just too crowded (4). Ask yourself what you want to do and how that can be done in a unique way.</p>
<p><strong>Who to Target</strong></p>
<p>Defining your target market is a key to a good business and marketing plan. Which demographic do you want to be your key audience? Currently 72% of advertisers find it beneficial to target the 35-44 and 25-34 year old category with them making up 29% and 28% of users online, respectively (5). Don&#039;t let age be the only determining factor for you though, targeting a common interest amongst a group of users could be a break-through factor as well. This may be people who loves sour candies, office interiors or just residing in the same local area. A combination of criteria may make it more unique for you as well such as people aged 16-24 who likes sour candies or people of aged 35-44 living in the same city.</p>
<p>By detailing and being more specific about your target market may give you a bit of a competitive edge but understand that by adding more criteria to the list you are shrinking the size of your target. Ask yourself, if you have a smaller market to serve can you still sustain? If you sell a product that&#039;s $1 and you target 25-34 y/o male residents a suburban area you may not have enough potential clients to survive. Do some math and see where you want to end up, that should give you a scope of how many people you may potential need to target.</p>
<p><strong>Making Money Through Advertisement</strong></p>
<p>Some of you webmasters are planning to make money through advertisement, this maybe through a 3rd party company such as Google Adsense or Adbrite or just handle advertisement internally. You should know that there&#039;s still plenty of advertising dollars floating around the internet for you to make, it all just depends if you know how to get it. </p>
<p>Focusing on North American market here, despite the depression and economic downturn organizations are keeping a budget ready for internet advertisement. There&#039;s many factors why this is, which is slightly irrelevant here but keep in mind that this dollar amount will continue to grow proportionate to the growth of how many and how often people access the internet on a daily base.</p>
<p>The outlook for 2009 was an 8.9% growth in overall internet advertisement spending which equates to $25.7 billion US dollars. This is a good enough motivation for those who wishes to make a career out of websites and advertisements (6).</p>
<p>I am just so tire right now so I suppose I&#039;ll edit and update this article as I go.</p>
<p>1. http://www.domaintools.com/internet-statistics/<br />
2. http://www.w3schools.com/browsers/browsers_display.asp<br />
3. http://www.w3schools.com/browsers/browsers_stats.asp<br />
4. http://www.cyberjournalist.net/news/003674.php<br />
5. http://www.eiaa.net/ftp/casestudiesppt/EIAA_Marketers_Internet_Ad_Barometer_2009_PR_Presentation.pdf<br />
6. http://www.emarketer.com/Article.aspx?R=1006813</p>
]]></content:encoded>
			<wfw:commentRss>http://www.crankberryblog.com/2009/stats-you-should-know-before-making-a-website/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Websites you should have bookmarked if you&#039;re a webmaster</title>
		<link>http://www.crankberryblog.com/2009/websites-you-should-have-bookmarked-if-youre-a-webmaster</link>
		<comments>http://www.crankberryblog.com/2009/websites-you-should-have-bookmarked-if-youre-a-webmaster#comments</comments>
		<pubDate>Mon, 02 Nov 2009 22:58:37 +0000</pubDate>
		<dc:creator>Jerry Low</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.crankberryblog.com/?p=258</guid>
		<description><![CDATA[If you not only own your website but also develop and maintain it yourself then you should understand how hard it is if there weren't some already developed tools and web resources to help you with your work. Here I've listed some of my favourite development resource sites and should be yours too for your developing moments. If you don't have them all bookmarked yet, DO IT NOW!

<img src="http://www.crankberryblog.com/images/bookmark-these-screenshot.jpg" />]]></description>
			<content:encoded><![CDATA[<p>If you not only own your website but also develop and maintain it yourself then you should understand how hard it is if there weren&#039;t some already developed tools and web resources to help you with your work. Here I&#039;ve listed some of my favourite development resource sites and should be yours too for your developing moments. If you don&#039;t have them all bookmarked yet, DO IT NOW!</p>
<p><a href="http://www.typetester.org/"><br />
<h3>Typetester</h3>
<p></a></p>
<p>Typetester is a website which allows you to test out fonts to see how they compare to to each other. This will allow you to test the font live and choose the one you want to use on your site.</p>
<p><a href="http://www.typetester.org/"><img src="http://www.crankberryblog.com/images/bookmark-these-typetester.jpg" /></a></p>
<p><a href="http://browsershots.org/"><br />
<h3>BrowserShots</h3>
<p></a></p>
<p>This is the resource for ultimate cross-browser compatibility building. BrowserShots allows you to take screenshots of your website so you can see what it looks like through various browsers and operating systems.</p>
<p><a href="http://browsershots.org/"><img src="http://www.crankberryblog.com/images/bookmark-these-browsershots.jpg" /></a></p>
<p><a href="http://validator.w3.org/"><br />
<h3>W3C Validator</h3>
<p></a></p>
<p>Run your site through W3C validator and it&#039;ll tell you if your HTML and Javascript codes are well structured. Good for building clean and proper codes.</p>
<p><a href="http://validator.w3.org/"><img src="http://www.crankberryblog.com/images/bookmark-these-w3c.jpg" /></a></p>
<p><a href="http://viewlike.us/"><br />
<h3>View Like Us</h3>
<p></a></p>
<p>View Like Us complements BrowserShots very well. This web tool allows you to quickly test your website viewport in various resolution sizes including Wii and iPhone screen resolutions.</p>
<p><a href="http://viewlike.us/"><img src="http://www.crankberryblog.com/images/bookmark-these-viewlikeus.jpg" /></a></p>
<p><a href="http://www.lipsum.com"><br />
<h3>Lorem Ipsum</h3>
<p></a></p>
<p>If you&#039;re just starting to build new sites, the best thing to have to fluff up your site is dummy text. Use the Lorem Ipsum generator to create various length of text to fill in those pages.</p>
<p><a href="http://www.lipsum.com"><img src="http://www.crankberryblog.com/images/bookmark-these-lorem.jpg" /></a></p>
<p><a href="http://www.shaboopie.com/"><br />
<h3>Shaboopie</h3>
<p></a></p>
<p>If you&#039;re not designing your own site and have no resources to hire somebody to do so then you should check out Shaboopie as they have a large selection for free vector logos to use.</p>
<p><a href="http://www.shaboopie.com/"><img src="http://www.crankberryblog.com/images/bookmark-these-logo.jpg" /></a></p>
<p><a href="http://www.iconarchive.com"><br />
<h3>Icon Archive</h3>
<p></a></p>
<p>Just like the excuse you have above, if you have no time to draw and you need great icons, just go to Icon Archive. They have a huge selection of free icons and the site is so easy to navigate.</p>
<p><a href="http://www.iconarchive.com"><img src="http://www.crankberryblog.com/images/bookmark-these-iconarchive.jpg" /></a></p>
<p><a href="http://www.bestwebframeworks.com/"><br />
<h3>Best Web Frameworks</h3>
<p></a></p>
<p>Best Web Frameworks is one of my favourites. Just select the web language you&#039;re using and check popular frameworks and compatibility.</p>
<p><a href="http://www.bestwebframeworks.com/"><img src="http://www.crankberryblog.com/images/bookmark-these-framework.jpg" /></a></p>
<p><a href="http://www.pixlr.com"><br />
<h3>Pixlr</h3>
<p></a></p>
<p>If you ever need to edit any images but don&#039;t have Photoshop handy, or Photoshop at all then you should use Pixlr. It is practically a tamed version of Photoshop online.</p>
<p><a href="http://www.pixlr.com"><img src="http://www.crankberryblog.com/images/bookmark-these-pixlr.jpg" /></a></p>
<p>What great things do you have in your pocket (nothing disgusting ok!)? Comment and share with the rest of the group.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.crankberryblog.com/2009/websites-you-should-have-bookmarked-if-youre-a-webmaster/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Generate rounded CSS corners without images</title>
		<link>http://www.crankberryblog.com/2009/generate-css-div-rounded-corners-without-images</link>
		<comments>http://www.crankberryblog.com/2009/generate-css-div-rounded-corners-without-images#comments</comments>
		<pubDate>Tue, 29 Sep 2009 23:13:53 +0000</pubDate>
		<dc:creator>Jerry Low</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.crankberryblog.com/?p=156</guid>
		<description><![CDATA[<div class="excerpt_screen_right"><img src="http://www.crankberryblog.com/images/css-rounded-corners-sm.jpg" alt="CSS Rounded Corners Generator" /></div>I was looking at ways in which I could have built my websites differently today and came across the question. How can I guarantee my CSS rounded corners to be closer to 100% cross browser compatible. I came across a few sites with scripts and generators simplifying the tasks but most of them failed the browser test. I came up with a simple script that was simple and light. I'm not going to share the code. Now don't flame me yet. Instead I've made it easier for everybody. I've created the <a href="http://csscorners.crankberryblog.com">simple CSS rounded corners generator</a>.]]></description>
			<content:encoded><![CDATA[<p>I was looking at ways in which I could have built my websites differently today and came across the question. How can I guarantee my CSS rounded corners to be closer to 100% cross browser compatible. I came across a few sites with scripts and generators simplifying the tasks but most of them failed the browser test. I came up with a simple script that was simple and light. I&#039;m not going to share the code. Now don&#039;t flame me yet. Instead I&#039;ve made it easier for everybody. I&#039;ve created the <a href="http://csscorners.crankberryblog.com">simple CSS rounded corners generator</a>.</p>
<p>The result is really just&#8230; a rounded div box. Here&#039;s an example I quickly generated from the tool.<br />
<img src="http://www.crankberryblog.com/images/css-rounded-corners-screen.jpg" alt="CSS Screenshot" /></p>
<p>Have you opened the link yet? No? Open it up and I&#039;ll give a quick tour of it. The tool&#039;s very simple to use. All you have to do is configure four settings and it&#039;ll do the rest for you. The four settings are:</p>
<ol>
<li>Class Name</li>
<li>Background Color</li>
<li>Font Color</li>
<li>Roundness</li>
</ol>
<p>I&#039;ll just briefly touch on the class name and roundness. The remaining settings is kind of obvious. So the class name does not really need to be set <em>UNLESS</em> you have multiple rounded corner boxes that are different. If you&#039;re using the same boxes over and over again, that&#039;s fine but once you change style you&#039;ll have to create new classes so they don&#039;t over lap.</p>
<p>The current roundness settings are 1, 2, 4, 8px. These are the settings I believe looks best with most web design. Anymore will make your template look like a lot of circles.</p>
<p>So that&#039;s it, that&#039;s the tool I created for all of you. If you have any questions or feedback leave a line here and I&#039;ll attend to it. Cheers!</p>
<p>If you didn&#039;t find the link in the Article here it is again.<br />
The Tool: <a href="http://csscorners.crankberryblog.com"><strong>CSS Rounded Corners Generator</strong></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.crankberryblog.com/2009/generate-css-div-rounded-corners-without-images/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Removing bullets from WordPress default theme menu</title>
		<link>http://www.crankberryblog.com/2009/removing-bullets-from-wordpress-default-theme-menu</link>
		<comments>http://www.crankberryblog.com/2009/removing-bullets-from-wordpress-default-theme-menu#comments</comments>
		<pubDate>Mon, 21 Sep 2009 20:42:56 +0000</pubDate>
		<dc:creator>Jerry Low</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://localhost/ctest/?p=17</guid>
		<description><![CDATA[As I was setting up this blog I was disgusted by the bullets that were implemented to the menu on the right (they call it side bar). I thought to myself, no biggie, I'll just remove it when skinning/theming this thing. As I have built many themes for different forums in the past I believe this wouldn't be such a hard task. After some searching I have found <a title="Removing the WordPress sidebar bullets " href="http://www.lancelhoff.com/removing-the-wordpress-sidebar-bullets/" target="_blank">this article</a>, but by editing the CSS it did not work for me. So here I'm sharing a method to <em>hard code</em> out the bullets in the side bar of the default WordPress theme Kubrick.]]></description>
			<content:encoded><![CDATA[<p>As I was setting up this blog I was disgusted by the bullets that were implemented to the menu on the right (they call it side bar). I thought to myself, no biggie, I&#039;ll just remove it when skinning/theming this thing. As I have built many themes for different forums in the past I believe this wouldn&#039;t be such a hard task. After some searching I have found <a title="Removing the WordPress sidebar bullets " href="http://www.lancelhoff.com/removing-the-wordpress-sidebar-bullets/" target="_blank">this article</a>, but by editing the CSS it did not work for me. So here I&#039;m sharing a method to <em>hard code</em> out the bullets in the side bar of the default WordPress theme Kubrick.</p>
<p>Now this method is not recommended for those who are not comfortable or disturbed by the thought of &#034;editing code&#034;. Its really not all that complicated but if you&#039;re really not comfortable stop reading now and quit while you&#039;re ahead, I&#039;m sure there&#039;s other people out there ready to help.</p>
<p><strong>What will you get from this?</strong></p>
<p>In the end you should be able to successfully remove the bullets in the Pages, Archives, Categories, and Bookmarks inner section. These are what I&#039;ve named them, yours could vary. I&#039;m calling it the inner section because I didn&#039;t talk about how to remove the bullets in the title here, at this point I haven&#039;t gone through everything so I&#039;ll update every one when it happens.</p>
<p>So, with that said lets get started. Here is a list of files that we&#039;ll be editing so I recommend you make a backup prior to beginning just in case something goes wrong.</p>
<ul>
<li>wp-includes/classes.php</li>
<li>wp-content/themes/default/sidebar.php</li>
<li>wp-includes/bookmark-template.php</li>
</ul>
<p>Got that? Backed it up? Good! We&#039;ll start from the top, so the first bullets we&#039;ll remove is the Pages section. These are links to pages that you can create outside of your blog postings.</p>
<h3>Removing Bullets from the Pages Section</h3>
<p>Open wp-includes/classes.php, if your editor has a find function use it now. Find the line class Walker_Page. This is the class that we need to work in.</p>
<div class="dean_ch" style="white-space: wrap;"><span class="kw2">function</span> start_lvl<span class="br0">&#40;</span>&amp;<span class="re0">$output</span>, <span class="re0">$depth</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$indent</span> = <a href="http://www.php.net/str_repeat"><span class="kw3">str_repeat</span></a><span class="br0">&#40;</span><span class="st0">&quot;<span class="es0">\t</span>&quot;</span>, <span class="re0">$depth</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$output</span> .= <span class="st0">&quot;<span class="es0">\n</span>$indent&lt;ul&gt;<span class="es0">\n</span>&quot;</span>;<br />
<span class="br0">&#125;</span></div>
<p>In line 3 you can find the &lt;ul&gt;  we need to remove. So remove it. Now the we removed the opening tag we have to remove the closing tag. Scroll down a little bit and the closing tag is on line 3 of:</p>
<div class="dean_ch" style="white-space: wrap;"><span class="kw2">function</span> end_lvl<span class="br0">&#40;</span>&amp;<span class="re0">$output</span>, <span class="re0">$depth</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$indent</span> = <a href="http://www.php.net/str_repeat"><span class="kw3">str_repeat</span></a><span class="br0">&#40;</span><span class="st0">&quot;<span class="es0">\t</span>&quot;</span>, <span class="re0">$depth</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$output</span> .= <span class="st0">&quot;$indent&lt;/ul&gt;<span class="es0">\n</span>&quot;</span>;<br />
<span class="br0">&#125;</span></div>
<p>Ok, now stay where you are. Scroll down a little more and you&#039;ll come across the function start_el. Within the function look for a line that looks or is exactly like:</p>
<div class="dean_ch" style="white-space: wrap;"><span class="re0">$output</span> .= <span class="re0">$indent</span> . <span class="st0">&#039;&lt;li class=&quot;&#039;</span> . <span class="re0">$css_class</span> . <span class="st0">&#039;&quot;&gt;&lt;a href=&quot;&#039;</span> . get_page_link<span class="br0">&#40;</span><span class="re0">$page</span>-&gt;<span class="me1">ID</span><span class="br0">&#41;</span> . <span class="st0">&#039;&quot; title=&quot;&#039;</span> . esc_attr<span class="br0">&#40;</span>apply_filters<span class="br0">&#40;</span><span class="st0">&#039;the_title&#039;</span>, <span class="re0">$page</span>-&gt;<span class="me1">post_title</span><span class="br0">&#41;</span><span class="br0">&#41;</span> . <span class="st0">&#039;&quot;&gt;&#039;</span> . <span class="re0">$link_before</span> . apply_filters<span class="br0">&#40;</span><span class="st0">&#039;the_title&#039;</span>, <span class="re0">$page</span>-&gt;<span class="me1">post_title</span><span class="br0">&#41;</span> . <span class="re0">$link_after</span> . <span class="st0">&#039;&lt;/a&gt;&#039;</span>;</div>
<p>In this code here you&#039;ll have to remove the following code. Note: Don&#039;t remove the &#039; in the beginning.</p>
<div class="dean_ch" style="white-space: wrap;">&lt;li class=&quot;&#039; . $css_class . &#039;&quot;&gt;</div>
<p>What we just did was remove the opening &lt;li&gt; lets find and remove the closing one. Take a guess at where it is, you&#039;re right! Scroll down a little more and you&#039;ll find the missing piece of the puzzle. Within the func end_el you&#039;ll notice the &lt;/li&gt; in line two.</p>
<div class="dean_ch" style="white-space: wrap;"><span class="kw2">function</span> end_el<span class="br0">&#40;</span>&amp;<span class="re0">$output</span>, <span class="re0">$page</span>, <span class="re0">$depth</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$output</span> .= <span class="st0">&quot;&lt;/li&gt;<span class="es0">\n</span>&quot;</span>;<br />
<span class="br0">&#125;</span></div>
<p>Instead of just removing this one, replace it with &lt;br /&gt;. This will add a line break between page listing.</p>
<h3>Removing Bullets from the Category Section</h3>
<p>At this point you should have already removed the bullets for the page section. Has it happened? If not you should spend some time in the first part of the article first. Next we will work on the category section, so in the same file find:</p>
<div class="dean_ch" style="white-space: wrap;"><span class="kw2">&lt;?php</span> wp_list_categories<span class="br0">&#40;</span><span class="st0">&#039;show_count=1&amp;title_li=&lt;h2&gt;Categories&lt;/h2&gt;&#039;</span><span class="br0">&#41;</span>; <span class="kw2">?&gt;</span></div>
<p>and change that to</p>
<div class="dean_ch" style="white-space: wrap;"><span class="kw2">&lt;?php</span> wp_list_categories<span class="br0">&#40;</span><span class="st0">&#039;style=none&amp;show_count=1&amp;title_li=&lt;h2&gt;Categories&lt;/h2&gt;&#039;</span><span class="br0">&#41;</span>; <span class="kw2">?&gt;</span></div>
<p>Basically what we have done is passed on the argument that the style is none (default is list).</p>
<h3>Removing Bullets from the Archive Section</h3>
<p>If you&#039;ve gotten this far, congratulations you have successfully removed the bullets in the categories section. If you have already guessed it by now yes the next step is pretty much the same but in this case they named it something else. To remove the bullets from the archive list find (also in sidebar.php):</p>
<div class="dean_ch" style="white-space: wrap;"><span class="kw2">&lt;?php</span> wp_get_archives<span class="br0">&#40;</span><span class="st0">&#039;type=monthly&#039;</span><span class="br0">&#41;</span>; <span class="kw2">?&gt;</span></div>
<p>and change it to:</p>
<div class="dean_ch" style="white-space: wrap;"><span class="kw2">&lt;?php</span> wp_get_archives<span class="br0">&#40;</span><span class="st0">&#039;type=monthly&amp;format=none&#039;</span><span class="br0">&#41;</span>; <span class="kw2">?&gt;</span></div>
<p>Basically they changed the argument from style to format.</p>
<h3>Removing Bullets from the Links Section</h3>
<p>Now you&#039;re only left with removing the bullets in the links section also known as the bookmark section. This one was hard to pass the argument, maybe somebody could suggest a way, but here&#039;s what I did. Open up wp-includes/bookmark-template.php. Find function wp_list_bookmarks. We&#039;ll remove the &lt;li&gt;&lt;&#47li&gt; tags first since it comes up first. The first thing that comes up in the function is an array.</p>
<div class="dean_ch" style="white-space: wrap;">&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$defaults</span> = <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&#039;orderby&#039;</span> =&gt; <span class="st0">&#039;name&#039;</span>, <span class="st0">&#039;order&#039;</span> =&gt; <span class="st0">&#039;ASC&#039;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&#039;limit&#039;</span> =&gt; <span class="nu0">-1</span>, <span class="st0">&#039;category&#039;</span> =&gt; <span class="st0">&#034;</span>, <span class="st0">&#039;exclude_category&#039;</span> =&gt; <span class="st0">&#034;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&#039;category_name&#039;</span> =&gt; <span class="st0">&#034;</span>, <span class="st0">&#039;hide_invisible&#039;</span> =&gt; <span class="nu0">1</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&#039;show_updated&#039;</span> =&gt; <span class="nu0">0</span>, <span class="st0">&#039;echo&#039;</span> =&gt; <span class="nu0">1</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&#039;categorize&#039;</span> =&gt; <span class="nu0">1</span>, <span class="st0">&#039;title_li&#039;</span> =&gt; __<span class="br0">&#40;</span><span class="st0">&#039;Bookmarks&#039;</span><span class="br0">&#41;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&#039;title_before&#039;</span> =&gt; <span class="st0">&#039;&lt;h2&gt;&#039;</span>, <span class="st0">&#039;title_after&#039;</span> =&gt; <span class="st0">&#039;&lt;/h2&gt;&#039;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&#039;category_orderby&#039;</span> =&gt; <span class="st0">&#039;name&#039;</span>, <span class="st0">&#039;category_order&#039;</span> =&gt; <span class="st0">&#039;ASC&#039;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&#039;class&#039;</span> =&gt; <span class="st0">&#039;linkcat&#039;</span>, <span class="st0">&#039;category_before&#039;</span> =&gt; <span class="st0">&#039;&lt;li id=&quot;%id&quot; class=&quot;%class&quot;&gt;&#039;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&#039;category_after&#039;</span> =&gt; <span class="st0">&#039;&lt;/li&gt;&#039;</span><br />
<span class="br0">&#41;</span>;</div>
<p>The last two lines you&#039;ll see category_before => and category_after =>. Clear everything inside of the single quotes that they are pointing to. So you should be left with &#039;category_before&#039; => &#034; and &#039;category_after&#039; => &#034;. Go down a bit further and you&#039;ll find this piece of code:</p>
<div class="dean_ch" style="white-space: wrap;"><span class="kw1">if</span> <span class="br0">&#40;</span> <span class="re0">$categorize</span> <span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="co1">//Split the bookmarks into ul&#039;s for each category</span><br />
&nbsp; &nbsp; <span class="re0">$cats</span> = get_terms<span class="br0">&#40;</span><span class="st0">&#039;link_category&#039;</span>, <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span><span class="st0">&#039;name__like&#039;</span> =&gt; <span class="re0">$category_name</span>, <span class="st0">&#039;include&#039;</span> =&gt; <span class="re0">$category</span>, <span class="st0">&#039;exclude&#039;</span> =&gt; <span class="re0">$exclude_category</span>, <span class="st0">&#039;orderby&#039;</span> =&gt; <span class="re0">$category_orderby</span>, <span class="st0">&#039;order&#039;</span> =&gt; <span class="re0">$category_order</span>, <span class="st0">&#039;hierarchical&#039;</span> =&gt; <span class="nu0">0</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;</p>
<p>&nbsp; &nbsp; <span class="kw1">foreach</span> <span class="br0">&#40;</span> <span class="br0">&#40;</span><a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#41;</span> <span class="re0">$cats</span> <span class="kw1">as</span> <span class="re0">$cat</span> <span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$params</span> = <a href="http://www.php.net/array_merge"><span class="kw3">array_merge</span></a><span class="br0">&#40;</span><span class="re0">$r</span>, <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span><span class="st0">&#039;category&#039;</span>=&gt;<span class="re0">$cat</span>-&gt;<span class="me1">term_id</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$bookmarks</span> = get_bookmarks<span class="br0">&#40;</span><span class="re0">$params</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span> <a href="http://www.php.net/empty"><span class="kw3">empty</span></a><span class="br0">&#40;</span><span class="re0">$bookmarks</span><span class="br0">&#41;</span> <span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">continue</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$output</span> .= <a href="http://www.php.net/str_replace"><span class="kw3">str_replace</span></a><span class="br0">&#40;</span><a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span><span class="st0">&#039;%id&#039;</span>, <span class="st0">&#039;%class&#039;</span><span class="br0">&#41;</span>, <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span><span class="st0">&quot;linkcat-$cat-&gt;term_id&quot;</span>, <span class="re0">$class</span><span class="br0">&#41;</span>, <span class="re0">$category_before</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$catname</span> = apply_filters<span class="br0">&#40;</span> <span class="st0">&quot;link_category&quot;</span>, <span class="re0">$cat</span>-&gt;<span class="me1">name</span> <span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$output</span> .= <span class="st0">&quot;$title_before$catname$title_after<span class="es0">\n</span><span class="es0">\t</span>&lt;ul class=&#039;xoxo blogroll&#039;&gt;<span class="es0">\n</span>&quot;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$output</span> .= _walk_bookmarks<span class="br0">&#40;</span><span class="re0">$bookmarks</span>, <span class="re0">$r</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$output</span> .= <span class="st0">&quot;<span class="es0">\n</span><span class="es0">\t</span>&lt;/ul&gt;<span class="es0">\n</span>$category_after<span class="es0">\n</span>&quot;</span>;<br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span> <span class="kw1">else</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="co1">//output one single list using title_li for the title</span><br />
&nbsp; &nbsp; <span class="re0">$bookmarks</span> = get_bookmarks<span class="br0">&#40;</span><span class="re0">$r</span><span class="br0">&#41;</span>;</p>
<p>&nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span> !<a href="http://www.php.net/empty"><span class="kw3">empty</span></a><span class="br0">&#40;</span><span class="re0">$bookmarks</span><span class="br0">&#41;</span> <span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span> !<a href="http://www.php.net/empty"><span class="kw3">empty</span></a><span class="br0">&#40;</span> <span class="re0">$title_li</span> <span class="br0">&#41;</span> <span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$output</span> .= <a href="http://www.php.net/str_replace"><span class="kw3">str_replace</span></a><span class="br0">&#40;</span><a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span><span class="st0">&#039;%id&#039;</span>, <span class="st0">&#039;%class&#039;</span><span class="br0">&#41;</span>, <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span><span class="st0">&quot;linkcat-$category&quot;</span>, <span class="re0">$class</span><span class="br0">&#41;</span>, <span class="re0">$category_before</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$output</span> .= <span class="st0">&quot;$title_before$title_li$title_after<span class="es0">\n</span><span class="es0">\t</span>&lt;ul class=&#039;xoxo blogroll&#039;&gt;<span class="es0">\n</span>&quot;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$output</span> .= _walk_bookmarks<span class="br0">&#40;</span><span class="re0">$bookmarks</span>, <span class="re0">$r</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$output</span> .= <span class="st0">&quot;<span class="es0">\n</span><span class="es0">\t</span>&lt;/ul&gt;<span class="es0">\n</span>$category_after<span class="es0">\n</span>&quot;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span> <span class="kw1">else</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$output</span> .= _walk_bookmarks<span class="br0">&#40;</span><span class="re0">$bookmarks</span>, <span class="re0">$r</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span></div>
<p>Do not be scared of its ginormous size. You can either go through and remove the two pairs of &lt;ul&gt;&lt;&#47ul&gt; or just comment them out. As I said they occur twice for different situations. Commenting it out will make it look like so:</p>
<div class="dean_ch" style="white-space: wrap;"><span class="kw1">if</span> <span class="br0">&#40;</span> <span class="re0">$categorize</span> <span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="co1">//Split the bookmarks into ul&#039;s for each category</span><br />
&nbsp; &nbsp; <span class="re0">$cats</span> = get_terms<span class="br0">&#40;</span><span class="st0">&#039;link_category&#039;</span>, <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span><span class="st0">&#039;name__like&#039;</span> =&gt; <span class="re0">$category_name</span>, <span class="st0">&#039;include&#039;</span> =&gt; <span class="re0">$category</span>, <span class="st0">&#039;exclude&#039;</span> =&gt; <span class="re0">$exclude_category</span>, <span class="st0">&#039;orderby&#039;</span> =&gt; <span class="re0">$category_orderby</span>, <span class="st0">&#039;order&#039;</span> =&gt; <span class="re0">$category_order</span>, <span class="st0">&#039;hierarchical&#039;</span> =&gt; <span class="nu0">0</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;</p>
<p>&nbsp; &nbsp; <span class="kw1">foreach</span> <span class="br0">&#40;</span> <span class="br0">&#40;</span><a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#41;</span> <span class="re0">$cats</span> <span class="kw1">as</span> <span class="re0">$cat</span> <span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$params</span> = <a href="http://www.php.net/array_merge"><span class="kw3">array_merge</span></a><span class="br0">&#40;</span><span class="re0">$r</span>, <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span><span class="st0">&#039;category&#039;</span>=&gt;<span class="re0">$cat</span>-&gt;<span class="me1">term_id</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$bookmarks</span> = get_bookmarks<span class="br0">&#40;</span><span class="re0">$params</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span> <a href="http://www.php.net/empty"><span class="kw3">empty</span></a><span class="br0">&#40;</span><span class="re0">$bookmarks</span><span class="br0">&#41;</span> <span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">continue</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$output</span> .= <a href="http://www.php.net/str_replace"><span class="kw3">str_replace</span></a><span class="br0">&#40;</span><a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span><span class="st0">&#039;%id&#039;</span>, <span class="st0">&#039;%class&#039;</span><span class="br0">&#41;</span>, <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span><span class="st0">&quot;linkcat-$cat-&gt;term_id&quot;</span>, <span class="re0">$class</span><span class="br0">&#41;</span>, <span class="re0">$category_before</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$catname</span> = apply_filters<span class="br0">&#40;</span> <span class="st0">&quot;link_category&quot;</span>, <span class="re0">$cat</span>-&gt;<span class="me1">name</span> <span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//$output .= &quot;$title_before$catname$title_after\n\t&lt;ul class=&#039;xoxo blogroll&#039;&gt;\n&quot;;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$output</span> .= _walk_bookmarks<span class="br0">&#40;</span><span class="re0">$bookmarks</span>, <span class="re0">$r</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//$output .= &quot;\n\t&lt;/ul&gt;\n$category_after\n&quot;;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span> <span class="kw1">else</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="co1">//output one single list using title_li for the title</span><br />
&nbsp; &nbsp; <span class="re0">$bookmarks</span> = get_bookmarks<span class="br0">&#40;</span><span class="re0">$r</span><span class="br0">&#41;</span>;</p>
<p>&nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span> !<a href="http://www.php.net/empty"><span class="kw3">empty</span></a><span class="br0">&#40;</span><span class="re0">$bookmarks</span><span class="br0">&#41;</span> <span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span> !<a href="http://www.php.net/empty"><span class="kw3">empty</span></a><span class="br0">&#40;</span> <span class="re0">$title_li</span> <span class="br0">&#41;</span> <span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$output</span> .= <a href="http://www.php.net/str_replace"><span class="kw3">str_replace</span></a><span class="br0">&#40;</span><a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span><span class="st0">&#039;%id&#039;</span>, <span class="st0">&#039;%class&#039;</span><span class="br0">&#41;</span>, <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span><span class="st0">&quot;linkcat-$category&quot;</span>, <span class="re0">$class</span><span class="br0">&#41;</span>, <span class="re0">$category_before</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//$output .= &quot;$title_before$title_li$title_after\n\t&lt;ul class=&#039;xoxo blogroll&#039;&gt;\n&quot;;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$output</span> .= _walk_bookmarks<span class="br0">&#40;</span><span class="re0">$bookmarks</span>, <span class="re0">$r</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//$output .= &quot;\n\t&lt;/ul&gt;\n$category_after\n&quot;;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span> <span class="kw1">else</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$output</span> .= _walk_bookmarks<span class="br0">&#40;</span><span class="re0">$bookmarks</span>, <span class="re0">$r</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span></div>
<p>Scroll up a bit in the same file and you&#039;ll find the last piece of the puzzle. Just edit the code in function _walk_bookmarks().</p>
<div class="dean_ch" style="white-space: wrap;"><span class="kw2">function</span> _walk_bookmarks<span class="br0">&#40;</span><span class="re0">$bookmarks</span>, <span class="re0">$args</span> = <span class="st0">&#034;</span> <span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
<span class="re0">$defaults</span> = <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&#039;show_updated&#039;</span> =&gt; <span class="nu0">0</span>, <span class="st0">&#039;show_description&#039;</span> =&gt; <span class="nu0">0</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&#039;show_images&#039;</span> =&gt; <span class="nu0">1</span>, <span class="st0">&#039;show_name&#039;</span> =&gt; <span class="nu0">0</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&#039;before&#039;</span> =&gt; <span class="st0">&#039;&lt;li&gt;&#039;</span>, <span class="st0">&#039;after&#039;</span> =&gt; <span class="st0">&#039;&lt;/li&gt;&#039;</span>, <span class="st0">&#039;between&#039;</span> =&gt; <span class="st0">&quot;<span class="es0">\n</span>&quot;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&#039;show_rating&#039;</span> =&gt; <span class="nu0">0</span>, <span class="st0">&#039;link_before&#039;</span> =&gt; <span class="st0">&#034;</span>, <span class="st0">&#039;link_after&#039;</span> =&gt; <span class="st0">&#034;</span><br />
<span class="br0">&#41;</span>;</div>
<p>Change the &lt;li&gt;&lt;&#47li&gt; to &#034; or for me I changed the &#039;after&#039; =&gt; &#034; to &#039;after&#039; =&gt; &#039;&lt;BR /&gt;&#039;. Just to have the space in there.</p>
<p>And there you have it you have successfully hard coded the bullets out. If you ever want them back just replace all of your files with the backed up ones. Once again I just want to remind you that I&#039;ve only used this method because the modifying the styles didn&#039;t work for me. Do whatever is easiest and works.</p>
<h3>Bonus: Removing Bullets from the Register Panel</h3>
<p>As a bonus feature I&#039;ll throw in &#034;how to remove bullets from the register panel&#034; for free. Its very simple, in your sidebar.php file find:</p>
<div class="dean_ch" style="white-space: wrap;"><span class="kw2">&lt;?php</span> wp_register<span class="br0">&#40;</span><span class="br0">&#41;</span>; <span class="kw2">?&gt;</span></div>
<p>Just put into the brackets &#034;,&#034; like so:</p>
<div class="dean_ch" style="white-space: wrap;"><span class="kw2">&lt;?php</span> wp_register<span class="br0">&#40;</span><span class="st0">&#034;</span> ,<span class="st0">&#034;</span><span class="br0">&#41;</span>; <span class="kw2">?&gt;</span></div>
]]></content:encoded>
			<wfw:commentRss>http://www.crankberryblog.com/2009/removing-bullets-from-wordpress-default-theme-menu/feed</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
	</channel>
</rss>

