Top

How To: Adding an Email This Button to Your Blog

June 7, 2008 by Tony · Leave a Comment 

In the past we’ve talked about how to add a print button to your WordPress theme. Today I wanted to give you the javascript code you need to create an Email This button on your WordPress blog.

Before getting to the code, I wanted to first say that this code is designed to allow readers to click on the button and have it open up their default email software and create a subject and link that point to the post the reader is currently visiting. This code is not designed to allow readers to contact the blog author.

If you are wanting your readers to be able to contact you, I recommend you use one of the many great contact form WordPress plugins available. You should never embed your email address into some HTML code because it will be picked up by spam bots. Contact forms prevent spammers from finding your email address. The other thing you can do is offer “EmailAddress AT EmailCompany DOT com” (which your email address information filled in) to avoid spammers.

Okay, so back to the Email button code. Here is the javascript you will need:

<script type="text/javascript">
<!– Begin
function isPPC() {
if (navigator.appVersion.indexOf(”PPC”) != -1) return true;
else return false;
}
if(isPPC()) {
document.write(’<a class=”contact” HREF=\”mailto:\?subject\=Take a look at this page I found, ‘ + document.title + ‘?body=You can see this page at: ‘ + window.location + ‘\” onMouseOver=”window.status=\’Send your friends e-mail about this page\’; return true” TITLE=”Send your friends e-mail about this page”>Email to a Friend<\/a>’);
}
else { document.write(’<a class=”contact” HREF=\”mailto:\?body\=Take a look at this page I found titled ‘ + document.title + ‘. You can see this page at: ‘ + window.location + ‘\” onMouseOver=”window.status=\’Send your friends e-mail about this page\’; return true” TITLE=”Send your friends e-mail about this page” rel=”nofollow”>Email This!<\/a>’);
}
// End –>
</script>

This will create an email where the reader can enter in someone’s email address and send them a link to your post/page.

[del.icio.us] [Digg] [Facebook] [Google] [MySpace] [Newsvine] [Reddit] [Slashdot] [StumbleUpon] [Technorati] [Windows Live] [Yahoo!] [Email]

How To: Feature Posts From a Particular Category

June 7, 2008 by Tony · Leave a Comment 

Recently Richard over at WP Project did a great redesign on his site.   With that redesign came a great “Featured Articles” section that features the five most recent posts in the “Featured” category on his blog.

In this post, Richard explains the steps required to feature a designated number of posts in a category of your choice.  Here is the result:

featured

 

 

 

 

 

 

Click over to get the code you need to setup something similar on your WordPress blog.

[del.icio.us] [Digg] [Facebook] [Google] [MySpace] [Newsvine] [Reddit] [Slashdot] [StumbleUpon] [Technorati] [Windows Live] [Yahoo!] [Email]

How To: Adding a Print This Button to Your Theme

June 7, 2008 by Tony · 1 Comment 

If you ever visit our actual website, you’ve probably noticed the “Print This” button that we display below each post.  Depending on the type of website or blog you are running, having a button like this may be a good fit for your blog.  I’ve found it to be good to have this button available to readers for any type of website that offers tutorials, recipes, guides, or pretty much anything that might require a visitor to print something you’ve written.

If you think you’d like to offer your readers the option to print something on your blog, here is the code I use on my blogs (uses Javascript):

<a href="javascript:window.print()" rel="nofollow">Print This!</a></span>

It prints the page you are on, so it is probably best to use it mostly on post and pages.  If you place it on the blog’s homepage, it will print the entire homepage, not just that post.

[del.icio.us] [Digg] [Facebook] [Google] [MySpace] [Newsvine] [Reddit] [Slashdot] [StumbleUpon] [Technorati] [Windows Live] [Yahoo!] [Email]

How To: Making a Categories Drop-Down Menu

June 7, 2008 by Tony · Leave a Comment 

Tired of your old navigation? So, what about creating a Magazine-style drop-down menu?
I propose here a drop-down menu listing your pages and sub pages, including one last item to show up your categories directly in the menu.

menu-pages-categories-wordpress

 

 

 

 

 

 

 

 

Read more

[del.icio.us] [Digg] [Facebook] [Google] [MySpace] [Newsvine] [Reddit] [Slashdot] [StumbleUpon] [Technorati] [Windows Live] [Yahoo!] [Email]

Is Your WordPress Site Hackable?

June 7, 2008 by Tony · Leave a Comment 

Today I want to ask all the web masters out there “Is your site hackable?”. I’m a test hacker, and I’ve seen some very popular sites get hacked in some of the simplest ways. Hacking wordpress is actually quite easy if you know what your doing. Two words my friend, “SQL Injections”, most people bypass this thought when they make a blog. Even know wordpress login forms prevent SQL Injections but what about form making plugins? Always check to see if your site is hackable through SQL Injections, for more information on simple hacking with SQL Injection visit my post about it by clicking here.

Also if you have a “robots.txt” file in your home directory, keep in mind that disallowing search engines doesn’t disallow people! Never leave directories with password’s in them, even if it is encrypted. If you have to password protect the director and/or password file. Also always keep your cgi-bin password protected because a lot of file management systems use it to keep passwords that you use. I know some cPanel file management systems do. So always check your site for rogue password files and SQL Injection prevention.

Editor’s Note: If you aren’t very familiar with some of this terminology, your best bet is to always keep your WordPress blogs upgraded to the latest version of WordPress.

Learning More About Javascript Injections

Ok, for those of you who don’t know what javascript injections are, they are ways to manipulate the page source of any web page. Some very simple javascript injections are to simply display an alert box with any text you want. To execute any form of javascript injection enter “javascript:” in the URL bar in your browser, then after the colon you can enter any javascript code in the same way you would in a normal web page. For example if you type in “javascript:var a = “hello world!”; alert(a)” in the URL bar an alert box would pop-up displaying the value of the variable “a”.

Now that you know the basics to javascript injections lets learn how to hack with them, as you should know javascript can manipulate anything on a web page. Here is a simple way to hack into a username on a website. Although the site you try to hack you have to be logged into that site. Once logged in type in the following javascript injection in the URL bar: “javascript:alert(document.cookie)”. This will display the cookie information that the site has on you, look for something like “user_id=xxx” or “PHPSESSID=xxx”. Typically you want to change this string’s value to 1, because the administrator is usually user_id number 1. To change it type in the following in the URL bar: “javascript:void(document.cookie user_id=1);alert(document.cookie);”. Now the user_id’s value should be 1, so refresh the page and you should be logged in as the administrator.

Please remember that you should never mess around with someones site. Always contact the administrator if you find a security hole in their site. Now remember how I said javascript can manipulate anything on a webpage? Well lets start manipulating stuff, for the basics we can just start with forms. Lets say a web page has a form to buy something using a debit card or something like that. Lets say the price for this item is fifty dollars, now lets manipulate this price. Lets say the submit button is a form itself, and it has no other values. In the URL bar type the following: “javascript:void(document.forms[0] = $1.00)”. Ultimately this will change price to one dollar, yes! The “[0]” represents the form number on the page, for example if there are 3 forms on a page. The first one would be labeled “0″ the second one “1″ and the third one “2″.

[del.icio.us] [Digg] [Facebook] [Google] [MySpace] [Newsvine] [Reddit] [Slashdot] [StumbleUpon] [Technorati] [Windows Live] [Yahoo!] [Email]

Next Page »

Bottom