Categories
Make Money Online My Personal Reviews WordPress How To

WordPress: Display Ads in Post Content and Only Display Ads in Old Posts

The title pretty much says it all. It’s 2 of the most useful AdSense ads tips for bloggers in my opinion. Obtrusive ads have the unnecessary effect of driving away readers after they have found what they needed. Unless you have amazingly great content, the chance of them becoming a loyal reader is rather low when you have ads splashing into their faces – this is not something you want to do to your subscribed readers. On the other hand, you’d want to maximize your AdSense earnings by putting up ads on as many posts as possible.

Ad Injection (WP plugin)

This tiny little plugin, Ad Injection, gets it all. Very useful plugin for you to insert AdSense ads in your blog posts AND set a specific age threshold for the posts to display ads, so freshly published articles won’t have ads to drive your subscribers away. See detailed introduction here: Ad Injection for WordPress.

Just install it from the inventory (upload or install from within your WP administrator panel) and activate it. Go to Settings > Ad Injection > “Random ad (inserted randomly between paragraphs)” and insert your AdSense code there. Depending on how aggressive you are, you can use a variety of ad formats from Google. I used a 468×15 links banner on Health Not. Check out the screenshot below:

insert ads in wordpress posts

By default, Ad Injection inserts a maximum of 2 instances of the Random ad per post. This way, the ads are well blended in the content. What works a few years back with the 336 square ad format on top of the content is gradually dying out in CTR thus click revenues. You should try something new such as this.

Another useful option of the plugin is to set “Only show normal ads on pages older than xx (days) – only for single posts and pages”. This would prove very useful if you want a good balance between ad performance / earnings and user experiences. Only displaying ads on older posts are a pretty good idea for creating a good first impression to those who stumble upon your site.

Categories
PHP Tips & Tutorials

PHP: Check if A String Contain Only Uppercase / Capital Letters

Sometimes you would want to check if a string is an acronym or an abbreviation by testing if it only contains capitalized letters from A to Z and nothing else. There are 2 ways to accomplish this simple task in PHP.

ctype_upper()

Use the native ctype_upper() function and you will know if the provided string contains only uppercase letters:

if (ctype_upper($string)) {
	echo $string.' is all uppercase letters.';
} else {
	echo $string.' is not all uppercase letters.';
}

The Ctype functions would turn out to be very handy when you want to test a string against different character types – digits, alphabetic, alpha-numeric, lowercase letters, uppercase letter, and even punctuations, etc. See the full list here: http://www.php.net/manual/en/ref.ctype.php

strtoupper()

Use the strtoupper() function to transform the string into all uppercase characters that’s capitalized letters, and then compare the transformed string against the original one to see if they are identical. If they are, then you are pretty sure the original string was also a string consisting of ONLY capital letters.

if (strtoupper($string) == $string) {
	echo $string.' is all uppercase letters.';
}

Check if A String Consists of Only Lowercase Letters

The same goes true if you want to do the test other way around. Just use ctype_lower() and strtolower() instead.

Categories
WordPress How To

Customize WordPress Post Editor CSS Styles

Do you know you can actually change the CSS styles of the entire editing area / editor where you create the post content in WordPress? It doesn’t have to be the default styles and since version 3.0, people can freely style the TinyMCE rich text editor shipped with WordPress however they want to by a few simple changes to the theme files.

Step 1

Open the functions.php file in your theme folder (create it if it doesn’t exist) and add this line anywhere in the PHP tags <?php … ?>:

add_editor_style();

Step 2

Create a css file named editor-style.css and put it in the theme root, namely the same folder where functions.php is in. To start with, you may want to copy the CSS styles from that of the Twenty Eleven theme into yours.

Now you can freely change those styles (such as rich text font, size or color, etc.) to have your own customized WordPress editor styles. The default editor styles coming with Twenty Eleven are very nice that make me long to write. So I’m now using them for my editor in the current theme, Thesis. You should too, if you find it more inspiring than the default styles.

Categories
Domains Hosting Tips & Deals

Add Wildcard DNS Subdomain *.example.com in cPanel

Lots of people ask this question and most of them probably made the matter complicated by editing the DNS Zone from WHM in the DNS Functions. But they actually should just do it in cPanel which is A LOT easier.

Just log in your cPanel which manages the domain that you want to add support for wildcard (*) subdomains. Go to:

Domains > Subdomains

And enter asterisk * in the Subdomain and choose the domain you need it added to.

Click “Create”.

adding subdomain wildcard in cpanel

That’s it. Now you can access your domain from any random subdomain and it will automatically use the A record of the main domain as their own.

Categories
Desktop Development Internet Tools

FFVCL – FFmpeg Delphi VCL for Video / Audio Apps Development

ffmpeg delphi vclThis post is dedicated to one of my friends, Coolie (not his real name but he preferred to be called that way among friends), a father and self-entrepreneur who created the outstanding Delphi VCL component for FFmpeg that makes it extremely easy to develop audio and video applications for Windows.

For those who are not Windows desktop developers, FFmpeg is the ONE video and audio applications library across all major platforms that is able to encode, decode, edit, convert and stream audio and video. It is widely adopted as the standard library for multi-media applications development. Chances are, what you currently have for media player in your operating system uses FFmpeg to do all the underlying work.

The problem with FFmpeg is that it’s only got a command line interface. You would definitely find it fascinating if you are a Linux guru, but not GUI users. Developers must create another layer of interface to accommodate end users, another layer of abstraction for FFmpeg, and that’s exactly where Coolie’s talent comes in, who heroically produced the Delphi VCL for FFmpeg and the ActiveX OCX Controls for FFmpeg. Problem solved for people who want to make video and audio applications in Windows but daunted by the command-line FFmpeg.

Simply ground-breaking work he has made, Coolie graduated from Tsinghua university, the China counterpart of MIT or Princeton – approximately 100,000 high school students each year compete for just 1 admission to Tsinghua. Think about that.

Feel free to bug him if you are interested in developing a multi-media application yourself – it’s not so hard as it may seem because many contemporary languages and platforms are made to be used by absolute programming beginners, such as VB.NET.

Categories
Business and Marketing Google Hacks, Cheats & Tips Make Money Online

Aweber, Mailchimp Alternative – Free Email Autoresponder Subscription

google feedburner - free email subscription serviceI’ve been with Aweber for nearly 2 years and they are good. But I eventually decided that newsletter is not my type of thing – there are people who are making big bucks by building and maintaining a high profile email list, but I’m just not one of them. So I left Aweber and switched all my subscription forms to Feedburner email subscription.

It’s actually pretty good. On top of everything, it’s free and A LOT easier to set up. It’s got anti-spam captcha which Aweber lacks – I contacted Aweber support approximately 1 year ago about this feature and up until now, they still haven’t deployed it. The problem with a popular blog is that there are many spam bots waiting to fill every form on the pages. As a result, my list was filled with fake non-human emails which bloated my number of subscribers, thus monthly fees.

It sucks, though Aweber excels in many other regards such as demographic statistics and CTR, etc. If you’ve got a blog and just want to deliver your fresh posts to the inbox of your readers, namely blog subscription, Feedburner is perfect for you. If you want a little more as what an autoresponder does, Feedburner can somewhat help you in this as well, albeit limited in functionality.

Use Feedburner for Email Subscription

Just sign in your Google account and navigate to http://feedburner.google.com and you can start creating your feed right away. In addition to adding a Feedburner custom feed address to your blog, you can also get a email subscription form by “Type your blog or feed address here” and then click “Next”.

It’s all guided and easy to finish. After you have done, go to “Publicize” –> “Email Subscriptions” and click “Activate”, you would then be presented by a HTML code block which is the your blog subscription form that you should put at a prominent place on your blog. Readers can then enter their email addresses to sign up with your newsletter (not newsletter actually, but blog posts notifications). Recommended places to install the email subscription form include: 1) end of the post, 2) top of sidebar, etc.

Use Feedburner as Autoresponder

After you have created your feed at Feedburner, click the feed, and go to “Publicize” –> “Email Subscriptions” –> “Communication Preferences” and there’s a “Confirmation Email Body” that you are free to edit to include any messages or links you would like to show to the subscriber (yet-to-be), such as a thank-you line and the download URL of a ebook you’ve created. After you have made the changes, click “Save” to save them.

Now if anyone subscribes through the Feedburner email subscription form on your blog or website, he or she’d first receive a confirmation message from Feedburner containing things you added just now. It’s exactly like an autoresponder, and it’s free.

Categories
Kavoir & Whatever

Review of uCertify Zend PHP-5 Exam PrepKit

Recently uCertify approached me and asked me to do blogging on about Zend PHP-5 exam PrepKit. Since this is an interesting topic to me and as I would get a free simulator, I agreed. uCertify produces the preparation kits for many different IT Certifications including Microsoft, Oracle, Cisco, CompTIA, Adobe, etc. The uCertify PrepEngine looks like this:

Zend PHP5 Exam PrepKit

Features of the PrepKit:

  • A nice looking user interface with good usability, especially regarding the minor details. For example, it is possible to click the answer itself and not only the checkbox next to it.
  • It has an optional study mode for every kind of test. When enabled it displays the wrong answers immediately rather than evaluating the answers only after the test is over. This provides a harmonic way of learning and measuring one’s progress.
  • It automatically shuffles the order of the answer options thereby preventing me from remembering the position of the correct answer among various options.
  • The explanation to the answers is of good quality and includes chart, diagrams, tables, snippets wherever required.
  • Huge amount of study material are included in the kit! It is not only a simulator but a full preparation kit.

In general it is a nice product that can be helpful for one to prepare for an exam (they have various prepkit available at uCertify). However I do not want anybody to get an impression that I think this is the only resource that one could use to prepare and pass an exam. This product and all other products available out there (books, prep kits, study guides) are just another resource for learning and practicing that one might consider to use when preparing for an exam.

It’s a very nice kit for diversified learners who want to learn things in all different ways. It’s also a breeze to create your own tests and quizzes. Give it a try and you are gonna like it!