HTML: Make a Page Refresh Every xx Seconds

by Yang Yang on August 28, 2011

A quick tip for those who just started learning HTML. It’s possible to add a line of code in your HTML page so that it’s automatically refreshed every few seconds when loaded in the user’s browser.

To make the page automatically refresh itself every 60 seconds, just insert the following code in the <head></head> section of your HTML source code:

<meta http-equiv="refresh" content="60">

This would be very useful to display information that is constantly changing.

This can also be used to redirect the user from the current page to another, just specify the destination URL:

<meta http-equiv="refresh" content="30; url=http://example.com/">

Which would redirect the browser to http://example.com/ 30 seconds after finishing loading the current page.

{ Comments on this entry are closed }

online software microsoft office365Office 365 is a set of team collaboration / productivity web applications for professionals, businesses, government agencies and education institutions. It currently offers 3 different plans:

  1. For professionals and small businesses, $6 / user / month, basic features
  2. For midsize businesses and enterprises, $12 and more / user / month, advanced features
  3. For education

And I signed up with the first one which is meant for individual professionals, or businesses / organizations with up to 25 employees, at $6 / user / month. For now, I have yet to reach the end of my first month, and I have only one user in my organization which is myself. So this review would be pretty straightforward and very limited to those who are looking at the multi-user features in team collaboration / communication.

You will need a credit card to sign up. To verify the credit card, They billed me $1 when I signed up and that’s it. So I guess they bill clients at the end of every month instead of at the beginning.

What I get for $6 / month?

For $6 / month at Microsoft Office 365, I get these cool stuff:

  1. Online web applications of Microsoft Office: Word, Excel, PowerPoint and OneNote. You can create documents, edit and save them in your favorite web browser, and publish them to your team site so you and your colleagues can collaborate on them. You can also upload existing documents from your computer to Office 365.
    office-suite_thumb2
    Shared documents:
    office-365-shared-documents_thumb
    Word web app:
    office-365-word-app_thumb1
    Excel web app:
    office-365-excel-app_thumb
  2. Instant communication tool Lync 2010 enables you and your team members to send instant messages, easily set up online meetings and perform PC-to-PC audio / video calls.
  3. SharePoint Online. A public company website at http://yourcompany.sharepoint.com/ that you can edit from SharePoint. The default theme looks like this:
    sharepoint-public-website_thumb6
    You can re-create your public website by 3 editing panels, namely Home, Insert and Design:
    public-website-editor-in-sharepoint_
    From the content navigation sidebar on the left, you can add new content and remove existing content to the Recycle Bin: pages, documents, images, etc.
    And as always, you can also add your own top-level domain to SharePoint, from the Admin panel, rather than using a subdomain of sharepoint.com.
  4. Other than a public website, a private Team Site is pre-configured and ready to be edited when you (as the administrator) first sign in. This site is used as a portal for all team members where you can list contacts, shared documents, calendar entries / meeting schedules, announcements, discussion posts, and so forth. Much like editing the public website, you can freely edit the Team Site as if it’s a web page: lists, tables, images, links, etc.
    office-365-team-site_thumb2
  5. Exchange Online. Emails hosting under the domain @yourcompany.onmicrosoft.com. Likewise, you can add your own domain for the emails thus having @yourcompany.com hosted at Office 365. Everything looks like the desktop applications. You would be using a very similar online version of Outlook (web app) and it’s very intuitive. The learning curve is minimal.
    office-365-outlook_thumb3
    A calendar (Week view): (also are Day view, Work Week view and Month view)
    office-365-calendar_thumb2
    User self management:
    office-365-outlook-manage-myself-con[1]
    Organization management:
    office-365-outlook-users-management_
  6. Full administration panel and organization management features:
    office-365-administrator-panel_thumb

Some quick facts about Office 365

  1. It bills you at the end of each billing term. For instance, if you started the plan on Jan. 15th, it would first bill you $1 to verify credit card and then $6 / month each month on Feb. 15th and on.
  2. If you cancel the subscription, your subscription will remain active until the end of the billing term.
  3. You get 99.9% uptime guarantee.
  4. You can add multiple domains to your service. The default one is yourcompany.onmicrosoft.com for email and yourcompany.sharepoint.com for team site / public site.
  5. You can use different plans / multiple subscriptions under one administrator account.

Official tours

For administrators: http://office.microsoft.com/en-us/videos/office-365-for-professionals-and-small-businesses-a-tour-for-administrators-HA102653442.aspx?redir=0

For users: http://office.microsoft.com/en-us/videos/office-365-a-tour-for-users-HA102657904.aspx?redir=0

{ Comments on this entry are closed }

Buying a grandfathered .EDU domain?

by Yang Yang on June 17, 2011

Someone approached to sell me a grandfathered .EDU name. I never thought .EDU domain can be traded so I started to research a little bit. Ain’t they owned only by educational institutions of United States?

Turns out .EDU names in existence as of October 29, 2001 were more freely registered and thus many non-educational entities such as individuals and businesses owned them. However, after the management of the .EDU name space were transferred to EDUCAUSE and thus new regulations were introduced on and from October 29, 2001, .EDU names can only be distributed to certified higher educational institutions operating in the United States and cannot be traded or exchanged whatsoever. But the .EDU names created before Oct.29, 2001 remained in the hands of their original registrant. That’s why they are called “grandfathered”. They are out of the current rules but they can still exist.

While you cannot acquire a new .EDU name now – unless you purchase a small local college for couple of millions – can you get a grandfathered .EDU from its previous owner?

The owner / registrant name of the .EDU name must remain unchanged for its lifetime – no matter if it’s a grandfathered .EDU or a .EDU created after Oct. 29, 2001. So is this all a scam or is it really possible to buy a grandfathered .EDU name?

The way to trade a grandfathered .EDU is probably to trade the owner entity. You are not buying the name, instead, you are buying the business entity that owns the .EDU name. I never personally bought such an entity to get any .EDU name so I’m not saying this way would work. From my research, this is definitely a possible way. Quite a few domain name brokers said they knew such sales existed or even engaged in one.

To make sure, I approached the staff at EDUCAUSE.edu and these are the 2 official replies I got:

EDU domains cannot be given, sold, or in any other way transferred to another institution. EDU domains –even those grandfathered – must remain registered to the original registrant.

— Kate, Member Services Representative

Nothing seriously against the idea of obtaining the owner entity to obtain the .edu name. However the second reply from a Senior Policy Director comes much more serious:

Names in the .edu domain are made available to registrants under conditions and policies specified by the U.S. Department of Commerce. In particular they are not "owned" by the registrant and therefore may not be sold or otherwise transferred. The contract included in your most recent message is thus in error in stating "…that this Business Entity is the sole beneficial owner of the domain name xxxxxx.edu, that said domain name is not encumbered in any manner…".

In your original e-mail you said: "Someone approached me to sell me a grandfathered .edu name." Such a sale would be invalid regardless of any attempt to embed that sale within another transaction. EDUCAUSE will not hesitate to disable any .edu name we find to have been sold or otherwise transferred in violation of policy.

— Steven, Senior Policy Director

If you are ever buying a grandfathered .edu name, better make sure to stay low and never let EDUCAUSE knows about the deal. 😉

{ Comments on this entry are closed }

DreamHost Promo Invitations – $100 Off!

by Yang Yang on May 27, 2011

DreamHost just gave me 5 promo invitations that could be used for new accounts only. Whoever uses one of the invitation codes to sign up with them would get $100 off for a two-year plan.

Just use one of the 12-digit invitation code in the “Promo Code” field when signing up at DreamHost:

  • 737871080684
  • 599411300419
  • 843524772888
  • 995826163955
  • 163012137693

Each code can only be claimed ONCE and after it is claimed it’s gone forever. Here are some more promo codes for DreamHost:

{ Comments on this entry are closed }

Given a directory, how to display the contents (directories and files under it) of it recursively and exhaustively? Here’s the code:

$dir = '/path/to/directory'; // without trailing slash, can be absolute paths such as '/home/jim/public_html' or relative paths such as 'samples'

getDirContents($dir);

function getDirContents($dir) {
	if (is_dir($dir)) {
		$dirs = explode('/', $dir);
		$last_dir = $dirs[count($dirs) - 1];
		echo '<strong>'.$last_dir.'</strong>';
	    if ($dh = opendir($dir)) {
	    	echo '<ul>';
	        while (($file = readdir($dh)) !== false) {
	        	if ($file == '.' || $file == '..') {} else {
		        	echo '<li>';
		        	if (is_dir($dir.'/'.$file)) {
		        		getDirContents($dir.'/'.$file);
		        	} else {
		        		echo $file;
		        	}
		        	echo '</li>';
	        	}
	        }
	        echo '</ul>';
	        closedir($dh);
	    }
	}
	return false;
}

Recursively, the function getDirContents() explores every entry in the directory. If the entry is a file, it simply prints it; if it is a directory, it opens another subroutine of itself to explore that directory; and so forth, until every branch and sub-branches, etc. are all printed out.

{ Comments on this entry are closed }

I was trying to find a PHP function or class that can convert English words / nouns in plural form into their singular form so that wordcrow.com automatically detects and redirects plural lookup to the singular page. After a while searching on Google, I found this class.

This great class (Inflector) was ported from Ruby on Rails to PHP in the Akelos Framework by Akelos Media, S.L. http://www.akelos.com/.

List of Functions

Other than pluralize and singularize, this class has some more functions to convert text strings by certain standards. List below are all the functions this class has:

  • Inflector::pluralize – return the plural form of the given English word, e.g. “search” to “searches”.
  • Inflector::singularize – return the singular form of the given English word, e.g. “searches” to “search”.
  • Inflector::titleize – create a title text from the given string, e.g. “WelcomePage”, “welcome_page” or “welcome page” to “Welcome Page”.
  • Inflector::camelize – return the CamelCased text from the given string, e.g. “send_email” to “SendEmail”, “who’s online” to “WhoSOnline”.
  • Inflector::underscore – return a underscored text from the given string, e.g. “CamelCased” or “ordinary Word” to “underscored_word” that is lowercased.
  • Inflector::humanize – return a human-readable text from the given string, e.g., by replacing underscores with spaces, and by upper-casing the initial character by default.
  • Inflector::variablize – same as camelize but first char is underscored.
  • Inflector::tableize – converts a class name to its table name by rails naming conventions.
  • Inflector::classify – converts a table name to its class name by rails naming conventions.
  • Inflector::ordinalize – converts a natural number to its ordinal form in English, e.g. “2” to “2nd”, “15” to “15th”, “31” to “31st”.

Inflector Class

<?php

/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */

// +----------------------------------------------------------------------+
// | Akelos PHP Application Framework                                     |
// +----------------------------------------------------------------------+
// | Copyright (c) 2002-2006, Akelos Media, S.L.  http://www.akelos.com/  |
// | Released under the GNU Lesser General Public License                 |
// +----------------------------------------------------------------------+
// | You should have received the following files along with this library |
// | - COPYRIGHT (Additional copyright notice)                            |
// | - DISCLAIMER (Disclaimer of warranty)                                |
// | - README (Important information regarding this library)              |
// +----------------------------------------------------------------------+

/**
* Inflector for pluralize and singularize English nouns.
*
* This Inflector is a port of Ruby on Rails Inflector.
*
* It can be really helpful for developers that want to
* create frameworks based on naming conventions rather than
* configurations.
*
* It was ported to PHP for the Akelos Framework, a
* multilingual Ruby on Rails like framework for PHP that will
* be launched soon.
*
* @author Bermi Ferrer Martinez 
* @copyright Copyright (c) 2002-2006, Akelos Media, S.L. http://www.akelos.org
* @license GNU Lesser General Public License 
* @since 0.1
* @version $Revision 0.1 $
*/
class Inflector
{
    // ------ CLASS METHODS ------ //

    // ---- Public methods ---- //

    // {{{ pluralize()

    /**
    * Pluralizes English nouns.
    *
    * @access public
    * @static
    * @param    string    $word    English noun to pluralize
    * @return string Plural noun
    */
    function pluralize($word)
    {
        $plural = array(
        '/(quiz)$/i' => '1zes',
        '/^(ox)$/i' => '1en',
        '/([m|l])ouse$/i' => '1ice',
        '/(matr|vert|ind)ix|ex$/i' => '1ices',
        '/(x|ch|ss|sh)$/i' => '1es',
        '/([^aeiouy]|qu)ies$/i' => '1y',
        '/([^aeiouy]|qu)y$/i' => '1ies',
        '/(hive)$/i' => '1s',
        '/(?:([^f])fe|([lr])f)$/i' => '12ves',
        '/sis$/i' => 'ses',
        '/([ti])um$/i' => '1a',
        '/(buffal|tomat)o$/i' => '1oes',
        '/(bu)s$/i' => '1ses',
        '/(alias|status)/i'=> '1es',
        '/(octop|vir)us$/i'=> '1i',
        '/(ax|test)is$/i'=> '1es',
        '/s$/i'=> 's',
        '/$/'=> 's');

        $uncountable = array('equipment', 'information', 'rice', 'money', 'species', 'series', 'fish', 'sheep');

        $irregular = array(
        'person' => 'people',
        'man' => 'men',
        'child' => 'children',
        'sex' => 'sexes',
        'move' => 'moves');

        $lowercased_word = strtolower($word);

        foreach ($uncountable as $_uncountable){
            if(substr($lowercased_word,(-1*strlen($_uncountable))) == $_uncountable){
                return $word;
            }
        }

        foreach ($irregular as $_plural=> $_singular){
            if (preg_match('/('.$_plural.')$/i', $word, $arr)) {
                return preg_replace('/('.$_plural.')$/i', substr($arr[0],0,1).substr($_singular,1), $word);
            }
        }

        foreach ($plural as $rule => $replacement) {
            if (preg_match($rule, $word)) {
                return preg_replace($rule, $replacement, $word);
            }
        }
        return false;

    }

    // }}}
    // {{{ singularize()

    /**
    * Singularizes English nouns.
    *
    * @access public
    * @static
    * @param    string    $word    English noun to singularize
    * @return string Singular noun.
    */
    function singularize($word)
    {
        $singular = array (
        '/(quiz)zes$/i' => '\1',
        '/(matr)ices$/i' => '\1ix',
        '/(vert|ind)ices$/i' => '\1ex',
        '/^(ox)en/i' => '\1',
        '/(alias|status)es$/i' => '\1',
        '/([octop|vir])i$/i' => '\1us',
        '/(cris|ax|test)es$/i' => '\1is',
        '/(shoe)s$/i' => '\1',
        '/(o)es$/i' => '\1',
        '/(bus)es$/i' => '\1',
        '/([m|l])ice$/i' => '\1ouse',
        '/(x|ch|ss|sh)es$/i' => '\1',
        '/(m)ovies$/i' => '\1ovie',
        '/(s)eries$/i' => '\1eries',
        '/([^aeiouy]|qu)ies$/i' => '\1y',
        '/([lr])ves$/i' => '\1f',
        '/(tive)s$/i' => '\1',
        '/(hive)s$/i' => '\1',
        '/([^f])ves$/i' => '\1fe',
        '/(^analy)ses$/i' => '\1sis',
        '/((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$/i' => '\1\2sis',
        '/([ti])a$/i' => '\1um',
        '/(n)ews$/i' => '\1ews',
        '/s$/i' => '',
        );

        $uncountable = array('equipment', 'information', 'rice', 'money', 'species', 'series', 'fish', 'sheep');

        $irregular = array(
        'person' => 'people',
        'man' => 'men',
        'child' => 'children',
        'sex' => 'sexes',
        'move' => 'moves');

        $lowercased_word = strtolower($word);
        foreach ($uncountable as $_uncountable){
            if(substr($lowercased_word,(-1*strlen($_uncountable))) == $_uncountable){
                return $word;
            }
        }

        foreach ($irregular as $_plural=> $_singular){
            if (preg_match('/('.$_singular.')$/i', $word, $arr)) {
                return preg_replace('/('.$_singular.')$/i', substr($arr[0],0,1).substr($_plural,1), $word);
            }
        }

        foreach ($singular as $rule => $replacement) {
            if (preg_match($rule, $word)) {
                return preg_replace($rule, $replacement, $word);
            }
        }

        return $word;
    }

    // }}}
    // {{{ titleize()

    /**
    * Converts an underscored or CamelCase word into a English
    * sentence.
    *
    * The titleize function converts text like "WelcomePage",
    * "welcome_page" or  "welcome page" to this "Welcome
    * Page".
    * If second parameter is set to 'first' it will only
    * capitalize the first character of the title.
    *
    * @access public
    * @static
    * @param    string    $word    Word to format as tile
    * @param    string    $uppercase    If set to 'first' it will only uppercase the
    * first character. Otherwise it will uppercase all
    * the words in the title.
    * @return string Text formatted as title
    */
    function titleize($word, $uppercase = '')
    {
        $uppercase = $uppercase == 'first' ? 'ucfirst' : 'ucwords';
        return $uppercase(Inflector::humanize(Inflector::underscore($word)));
    }

    // }}}
    // {{{ camelize()

    /**
    * Returns given word as CamelCased
    *
    * Converts a word like "send_email" to "SendEmail". It
    * will remove non alphanumeric character from the word, so
    * "who's online" will be converted to "WhoSOnline"
    *
    * @access public
    * @static
    * @see variablize
    * @param    string    $word    Word to convert to camel case
    * @return string UpperCamelCasedWord
    */
    function camelize($word)
    {
        return str_replace(' ','',ucwords(preg_replace('/[^A-Z^a-z^0-9]+/',' ',$word)));
    }

    // }}}
    // {{{ underscore()

    /**
    * Converts a word "into_it_s_underscored_version"
    *
    * Convert any "CamelCased" or "ordinary Word" into an
    * "underscored_word".
    *
    * This can be really useful for creating friendly URLs.
    *
    * @access public
    * @static
    * @param    string    $word    Word to underscore
    * @return string Underscored word
    */
    function underscore($word)
    {
        return  strtolower(preg_replace('/[^A-Z^a-z^0-9]+/','_',
        preg_replace('/([a-zd])([A-Z])/','1_2',
        preg_replace('/([A-Z]+)([A-Z][a-z])/','1_2',$word))));
    }

    // }}}
    // {{{ humanize()

    /**
    * Returns a human-readable string from $word
    *
    * Returns a human-readable string from $word, by replacing
    * underscores with a space, and by upper-casing the initial
    * character by default.
    *
    * If you need to uppercase all the words you just have to
    * pass 'all' as a second parameter.
    *
    * @access public
    * @static
    * @param    string    $word    String to "humanize"
    * @param    string    $uppercase    If set to 'all' it will uppercase all the words
    * instead of just the first one.
    * @return string Human-readable word
    */
    function humanize($word, $uppercase = '')
    {
        $uppercase = $uppercase == 'all' ? 'ucwords' : 'ucfirst';
        return $uppercase(str_replace('_',' ',preg_replace('/_id$/', '',$word)));
    }

    // }}}
    // {{{ variablize()

    /**
    * Same as camelize but first char is underscored
    *
    * Converts a word like "send_email" to "sendEmail". It
    * will remove non alphanumeric character from the word, so
    * "who's online" will be converted to "whoSOnline"
    *
    * @access public
    * @static
    * @see camelize
    * @param    string    $word    Word to lowerCamelCase
    * @return string Returns a lowerCamelCasedWord
    */
    function variablize($word)
    {
        $word = Inflector::camelize($word);
        return strtolower($word[0]).substr($word,1);
    }

    // }}}
    // {{{ tableize()

    /**
    * Converts a class name to its table name according to rails
    * naming conventions.
    *
    * Converts "Person" to "people"
    *
    * @access public
    * @static
    * @see classify
    * @param    string    $class_name    Class name for getting related table_name.
    * @return string plural_table_name
    */
    function tableize($class_name)
    {
        return Inflector::pluralize(Inflector::underscore($class_name));
    }

    // }}}
    // {{{ classify()

    /**
    * Converts a table name to its class name according to rails
    * naming conventions.
    *
    * Converts "people" to "Person"
    *
    * @access public
    * @static
    * @see tableize
    * @param    string    $table_name    Table name for getting related ClassName.
    * @return string SingularClassName
    */
    function classify($table_name)
    {
        return Inflector::camelize(Inflector::singularize($table_name));
    }

    // }}}
    // {{{ ordinalize()

    /**
    * Converts number to its ordinal English form.
    *
    * This method converts 13 to 13th, 2 to 2nd ...
    *
    * @access public
    * @static
    * @param    integer    $number    Number to get its ordinal value
    * @return string Ordinal representation of given string.
    */
    function ordinalize($number)
    {
        if (in_array(($number % 100),range(11,13))){
            return $number.'th';
        }else{
            switch (($number % 10)) {
                case 1:
                return $number.'st';
                break;
                case 2:
                return $number.'nd';
                break;
                case 3:
                return $number.'rd';
                default:
                return $number.'th';
                break;
            }
        }
    }

    // }}}

}

?>

Usage Examples

/* Singular to plural / Plural to singular */

echo Inflector::pluralize('search'); // outputs searches
echo Inflector::singularize('cases'); // outputs case
echo Inflector::pluralize('query'); // outputs queries
echo Inflector::singularize('queries'); // outputs query
echo Inflector::pluralize('ability'); // outputs abilities
echo Inflector::singularize('abilities'); // outputs ability
echo Inflector::pluralize('analysis'); // outputs analyses
echo Inflector::singularize('analyses'); // outputs analysis
echo Inflector::pluralize('information'); // outputs information
echo Inflector::singularize('information'); // outputs information
echo Inflector::pluralize('mouse'); // outputs mice
echo Inflector::singularize('mice'); // outputs mouse

/* CamelCase to underscore / underscore to CamelCase */

echo Inflector::underscore('SpecialGuest'); // outputs special_guest
echo Inflector::camelize('special_guest'); // outputs SpecialGuest
echo Inflector::underscore('FreeBSD'); // outputs free_bsd
echo Inflector::camelize('free_bsd'); // outputs FreeBsd
echo Inflector::underscore('HTML'); // outputs html
echo Inflector::camelize('html'); // outputs Html

/* Underscore to "human-text" / "Human-text" to Underscore */

echo Inflector::humanize('employee_salary'); // outputs Employee salary
echo Inflector::underscore('Employee salary'); // outputs employee_salary

/* Examples of titleize() */

echo Inflector::titleize('ActiveRecord'); // outputs Active Record
echo Inflector::titleize('action web service'); // outputs Action Web Service

/* Examples of ordinalize() */

echo Inflector::ordinalize(1); // outputs 1st
echo Inflector::ordinalize(2); // outputs 2nd
echo Inflector::ordinalize(3); // outputs 3rd
echo Inflector::ordinalize(4); // outputs 4th
echo Inflector::ordinalize(5); // outputs 5th
echo Inflector::ordinalize(20); // outputs 20th
echo Inflector::ordinalize(21); // outputs 21st

{ Comments on this entry are closed }

amazon affiliate earning stats screenshot I’ve been a happy Amazon affiliate for over a year now and the monthly revenues have been steadily climbing up ever since I started promoting their products galore. The most recent month, Mar. 2011 has ended up making me over $400 in commissions or advertising fees. Attached on the right is the screenshot. Considering I didn’t do much work, it’s really awesome to have a nice side income that’s gonna last for a while – which is the beauty of SEO! Once you done the hard work the right way, it’s gonna last for at least a few years and even grow by itself!

So I’ve got a few tips to share with you if you just started on Amazon to make money.

If you’ve got a blog:

These are tips for people who aren’t technically oriented but blog a lot.

  1. Don’t promote a product or widget on a site-wide level. My experience is it almost never works out. Go article level.
  2. Add a relevant product at the end of every blog post. It takes extra minutes for a post but it would definitely yield great results. Relevance is the key here. Find the most reviewed and best received product such as a book that carries the information relevant to your blog post. Find the product that best complements your post.
  3. Write articles in the mind of promoting one or more of the popular products at Amazon. Do not write to hype how good the product is, instead, write in your genuine tone to solve the readers’ or visitors’ problem and drop your Amazon affiliate links in-between the helpful words, naturally leading them to purchase the products.
  4. If you’ve used a product, write a genuine review! People love personal writings. Write a review and be personal. Then link to Amazon page under your affiliate ID.
  5. Target micro-niches and go long tail. The smallest product (in terms of price) would make you the most money. Most people who fail in Internet marketing fail to realize this. Small is big.

If you know how to build a website all by yourself:

These are tips for people who develop websites by themselves.

  1. Create a comparison shopping site / search engine that integrates a lot of different vendors. Visitors arrive on your page to compare the prices and terms of each vendor (including Amazon’s) and decide where to spend the money – by clicking your affiliate links. This is the mogul approach. It is great but you have to dedicate a lot of time and energy to make and maintain it. I built Dante Books off this ISBN database which is essentially a books directory site with limited price comparison. For now, it leads only to Amazon. 😉
  2. Add relevant products to your existing sites. For example, the traffic of a golf courses directory would be very much interested in the golf equipment.
  3. Create a review club of certain products. People can come to share their reviews. An online book club would be very fun to create and maintain!
  4. Create a rebate site. When customers order under your name and you earn 7% of the deal, give 3% rebate to the customer.

To make the most of Amazon Associate Program or any other affiliate programs:

Some general guidelines in making affiliate programs work.

  1. Use a clean, white design with minimum images unless it’s for the sale / conversion.
  2. Put content the first thing. Do NOT distract the readers from the content for any reason. Get rid of other ads. Less is more.
  3. Blend your affiliate links in the content as if it’s a very helpful and indispensable resource to compensate your point.
  4. Write the content within 2-minutes reading time’s length. Use at least one list, ordered or unordered, in each article. Plant at least one affiliate link in the list.

There could be more, but I’ve got to find something to eat now.

{ Comments on this entry are closed }

When people are replying to a thread, going advanced editing would require an extra click as well as page loading time – very inconvenient. However, at gotalk.org, users would generally want to post a lot of code because it’s a programming language forum in nature. But vBulletin doesn’t come with a CODE button in the quick reply editor toolbar by default.

So I’ll have to add the CODE button to the quick reply box myself.

How to add extra buttons to the toolbar of the quick reply editor? (v4.1.2)

Just copy and paste the buttons code from the advanced editor to the quick reply editor. The advanced editor template is “editor_toolbar_on” while that of the quick reply editor is “showthread_quickreply”. All we have to do is to copy some code from “editor_toolbar_on” to “showthread_quickreply”.

In the example below, I’ll add the CODE button from the advanced editor to the quick reply editor. You can add other buttons to the quick reply box in similar steps.

1. Open “editor_toolbar_on” template

From /admincp, Styles & Templates –> Style Manager –> click “Search in Templates” –> in the “Search for Text” box, enter “editor_toolbar_on” –> click “Find” –> double click “editor_toolbar_on” in the left selection.

2. Open “showthread_quickreply” template

From /admincp, Styles & Templates –> Style Manager –> click “Search in Templates” –> in the “Search for Text” box, enter “showthread_quickreply” –> click “Find” –> double click “showthread_quickreply” in the left selection.

3. Find the code for CODE button in the “editor_toolbar_on” template

Simply search for:

$show['code_bbcode']

In the “editor_toolbar_on” template and you would find a code block like this:

<vb:if condition="$show['code_bbcode'] OR $show['html_bbcode'] OR $show['php_bbcode']"> <li> <vb:if condition="$show['code_bbcode']"><img src="{vb:stylevar imgdir_editor}/code.png" class="imagebutton" id="{vb:raw editorid}_cmd_wrap0_code" width="20" height="20" alt="{vb:rawphrase wrap_code_tags}" /></vb:if> <vb:if condition="$show['html_bbcode']"><img src="{vb:stylevar imgdir_editor}/html.png" class="imagebutton" id="{vb:raw editorid}_cmd_wrap0_html" width="20" height="20" alt="{vb:rawphrase wrap_html_tags}" /></vb:if> <vb:if condition="$show['php_bbcode']"><img src="{vb:stylevar imgdir_editor}/php.png" class="imagebutton" id="{vb:raw editorid}_cmd_wrap0_php" width="20" height="20" alt="{vb:rawphrase wrap_php_tags}" /></vb:if> </li> </vb:if>

Copy this code block, and switch to the “showthread_quickreply” template.

4. Add the code in the “showthread_quickreply” template

Search for:

$show['quote_bbcode']

And you would find the code for the QUOTE button:

<vb:if condition="$show['quote_bbcode']"> <li class="editor_control_group_item"> <img src="{vb:stylevar imgdir_editor}/quote.png" class="imagebutton" id="{vb:raw editorid}_cmd_wrap0_quote" width="20" height="20" alt="{vb:rawphrase wrap_quote_tags}" /> </li> </vb:if>

Immediately below the QUOTE button block, paste what you just copied from the “editor_toolbar_on” template, and add a class=”editor_control_group_item” to the <li> element:

<vb:if condition="$show['quote_bbcode']"> <li class="editor_control_group_item"> <img src="{vb:stylevar imgdir_editor}/quote.png" class="imagebutton" id="{vb:raw editorid}_cmd_wrap0_quote" width="20" height="20" alt="{vb:rawphrase wrap_quote_tags}" /> </li> </vb:if> <vb:if condition="$show['code_bbcode'] OR $show['html_bbcode'] OR $show['php_bbcode']"> <li class="editor_control_group_item"> <vb:if condition="$show['code_bbcode']"><img src="{vb:stylevar imgdir_editor}/code.png" class="imagebutton" id="{vb:raw editorid}_cmd_wrap0_code" width="20" height="20" alt="{vb:rawphrase wrap_code_tags}" /></vb:if> <vb:if condition="$show['html_bbcode']"><img src="{vb:stylevar imgdir_editor}/html.png" class="imagebutton" id="{vb:raw editorid}_cmd_wrap0_html" width="20" height="20" alt="{vb:rawphrase wrap_html_tags}" /></vb:if> <vb:if condition="$show['php_bbcode']"><img src="{vb:stylevar imgdir_editor}/php.png" class="imagebutton" id="{vb:raw editorid}_cmd_wrap0_php" width="20" height="20" alt="{vb:rawphrase wrap_php_tags}" /></vb:if> </li> </vb:if>

Click “Save” or “Save and Reload”. Done!

Now refresh any thread page and you’ll see the CODE button as well as the HTML code button and PHP code button are all added to the toolbar of the quick reply editor. Following the same steps, you can add other buttons from the advanced editor to the quick reply editor.

(This is for vBulletin 4.1.2)

{ Comments on this entry are closed }

The quick reply box of vBulletin is by default about 100px or less in height which is bit small for large chunks of text editing such as code. To change the default height of the quick reply box without having to click the enlarge button manually every time, you’ll have to edit the template:

Changing default height of quick reply box

After you have logged in the /admincp:

Styles & Templates –> Style Manager –> Edit Templates (in the dropdown menu) –> double click Show Thread Templates (in the left selection of all the templates) –> double click “showthread_quickreply” –> search for “rows=” and you will arrive at the line you should edit.

However, just updating the rows property to a larger one won’t work, you have to manually add a style property like this:

rows="10" tabindex="1" cols="80" style="height:25em;" dir="{vb:stylevar textdirection}"

25em indicates that the quick reply box will be able to accommodate 40 lines of text within one scroll.

Now click “Save”.

Changing default height of advanced editor

The steps to change the default height or size of the advanced message editor in vBulletin goes similar. Instead of “showthread_quickreply”, just search for “editor_toolbar_on”. Search for “row=” or “textarea” and you will find the editor control. Add a style property just the same:

rows="10" tabindex="1" cols="80" style="height:40em;" dir="{vb:stylevar textdirection}"

These steps are for vBulletin 4.1.2. Some of the tutorials you can find for changing the default height of the editing boxes are a bit outdated and for older versions.

{ Comments on this entry are closed }

By default, only the forum name / title is displayed in the <title></title> tag of the homepage of your vBulletin forum, which is far from ideal in terms of SEO. One should give a much more descriptive title to the home page of the forum other than the mere name of it.

To do this:

  1. Log in to the /admincp of your vBulletin forum
  2. From the left administrative menu, Styles & Templates –> Style Manager –> Select Edit Templates in the right drop down of the current style set.
  3. In the left selection of templates, double click Forum Home Templates –> double click FORUMHOME.
  4. Now opens the homepage template of your forum, search for ‘<title>’ and you would find the HTML tag to edit.
  5. Add something descriptive and keywords-rich in the <title></title> tag and click Save.
  6. Done!

vBulletin is such a sophisticated application with a very large user base. Took me some time to find this solution. Hope it helps! Check out how I changed the homepage title of the forum for Go.

{ Comments on this entry are closed }