 |
 | |  |
|
AJAXify your Wordpress
Learn how I ajaxified my wordpress blog with these few steps...
|
|
| |
 | |  |
|
 | |  |
|
SBS Show!
Listen to the latest episode of the SBS Show, Dave Sobel talks about process management...
|
|
| |
 | |  |
|
 | |  |
|
Vladville Newsletter!
Looking for a more focused, exclusive insight into the world of SMB tech & business? Sign up for my newsletter!
|
|
| |
 | |  |
|
|
  |
Archive for the 'WordPress' Category
Being bad at math and making bad business decisions goes hand in hand. Sometimes we make bad decisions because we don’t know all the cost factors, replacement costs, unforeseen expenses and so on. Can’t do much about that. But sometimes we rationally ignore the basic arithmetic for the sake of vanity, promise or blind ambition.
I keep on telling myself that one day I’ll learn to fix that 
It has not happened yet.
In the long, long time ago I wrote a mail server. Over time that monster grew, scaled, exploded in complexity and.. aged.
Over the past month, I have been working on moving to a new architecture and rebuilding the system to incorporate all the new advanced stuff. At some point last week I hit a few major roadblocks that basically made it clear that I would have to rewrite a massive amount of our automation and management infrastructure.
STOP.
My time is not cheap. I’d like to think that in the marketplace as a VAR I could make double digits per hour if I really tried. But here I was, about to spend at least a week rewriting an infrastructure for something that A) Worked and B) Wasn’t a massively growing product.
Sanity check here: How many hours would I have to spend to do this? Divide by an average profit per mailbox? How long would it take to break even and make profit again?
What I should have done is have done is put my focus on a more lucrative project.
So I failed.
But, I had a really, really, really good reason – which is what you always say when you do something stupid – in that this new technology will allow us to scale faster and compete with Google and Big Pile of S*** / 360.
The Difference
Any rational person with any common sense would look at the above and agree with me that it was a waste.
But you’d be wrong.
The business owners, CEOs and others would probably take side with me in thinking that what is essential to keeping an organization competitive in the marketplace must be done regardless of tradeoff costs.
But those same people would sack an employee for doing the very same thing.
For business owners and people driving forward, accountability is very fluid. It’s what we make out of it. But employees are paid for a job – and a very specific one at that. I stand to lose millions of imaginary dollars if I fail – but I stand to win them if I’m right. Employees always have only their salary at risk – which they can replace relatively easily with another employer.
The point being, the prioritization of resources can often be frustrating for your employees to understand because they only see their role in it – until the next paycheck. Your role as the boss / owner / CEO is to make sure the company exists years down the road.
I hope this makes sense. There is no right or wrong – but there needs to be a vision and strategy. Sometimes getting from here to there isn’t paved with completely common sense. But if you believe it, and can work on making it a reality, the only real cost is your effort.
Read the whole post...
Of note for us WordPress fans is the release of WordPress 2.3.2, urgent release fixing a bug that can reveal the contents of your draft posts and database table structure.
Upgrading WordPress tends to be very simple – just grab the .zip file and uncompress it – upload everything except wp-content directory and wp-config.php file and hit /wp-admin to update the database. Thats all there is to it.
Read the whole post...
As I continue to tweak Vladville to fit in better with the upcoming Thieving Weasel framework, I decided to put in a little bit of work to make Vladville easier to navigate on Windows Mobile devices. Pulling up Vladville on a Windows Mobile (PocketPC or Smartphone) will now only display the content, sans the Javascript, AJAX, sidebar, slidey stuff or other blog gunk that you see in the full featured web page because.. well.. it’s what I do. Pull it up and see, hopefully this makes Vladville a little more pleasant in the pocket. It took all my might not to call it PocketVlad, for what its worth.
It’s a very quick WordPress loop hack that excludes certain form elements from the display when the browser is Windows CE based:
if(!strpos(“$_SERVER[HTTP_USER_AGENT]“,”Windows CE”))
{ display regular content to IE, FF, Opera.. }
WordPress checks the UserAgent sever variable for presence of Windows CE and if it doesn’t find it, it prints the regular blog content. However, if it finds out that you are on Windows CE it does not send the particular content to it.
So for example, let’s say your template code includes a like like <?php get_sidebar(); ?> and your sidebar has all that gunk useless to a mobile viewer? Just wrap it and it will not be displayed to the Windows Mobile browser:
if(!strpos(“$_SERVER[HTTP_USER_AGENT]“,”Windows CE”)) { get_sidebar(); }
What if you had some HTML markup like things you copied and pasted from the web site to include a comic, calendar or 8,285 buttons and ways to subscribe or share your posts?
<div id=’blah’>Blah blah blah</div>
Same thing, but a little different:
<? if(!strpos(“$_SERVER[HTTP_USER_AGENT]“,”Windows CE”)) { ?> <div id=’blah’>Blah blah blah</div> <? } ?>
Gotta love the simplicity of PHP. Just put line #1 above the content you want to block from Windows Mobile and below. Now, naturally, you have to have the markup elements match up because if you cut your table or div elements in half your layout will fall apart.
Still, pretty easy to make WordPress friendly with Windows Mobile…
Read the whole post...
One of the most frequent questions I get from new bloggers has to do with the concept of developing topics and stories. How do I come up with blog topics? What should I blog about? What makes a good post?
I come up with blog topics by reflecting on what I’m doing that day or thinking that week. The longer posts are the ones that have been on my mind for a few days and I just haven’t quite figured it out yet. The shorter posts are spur of the moment posts, just something that I’ve been discussing with folks that day and figured I’d offer it up.
It is not labor or intensive creative work that goes into writing articles and producing media (audio, video, documentation), it is actually more of a process of organizing thoughts, validating decisions and having some peace with what I’m doing. Truth is, if you’re an entrepreneur you already have enough pressure and your every waking moment is taken up with work and thinking of work. And if you let it bottle up and completely consume you, it will either kill you or completely exhaust you. So blogging is a great outlet as well.
Robbie Upcroft once asked me if I had an opinion on everything. Then he picked up a fork and asked “What do you think of this fork?” as I’m sure he expected me to break out into some sort of utencil analysis. I really am not that full of it! But when it rains it pours: I keep a flat text file on my desktop with blogging ideas. They are really just random thoughts that come to mind at odd moments and it’s more of a “Oh yeah, I’ve been meaning to mention that” kind of a thing.
Here, I’ll share with you my “Bloggable Crap” list:
How to create compelling video product walkthroughs Got a PocketPC blog writer software to recommend? Scott Adams Book: Stick to drawing comics, monkey brain! Worst Book Ever Excreted: The 4 Hour Work Week Arguments for or against web advertising schemes for content creators - ads, block digg/netscape, if you don’t click on my adwords you are a thief - but, remember if there is no commercial stuff, the projects die Time to upgrade Web 2.0 – financing of the entire genre is dependant on infinite FAD and consumerism How to staff a tech company in the down economy - Overpriced housing, no industry / unpopular - Is Florida over? - Where do you find the time to ___? - How can you get a link on Vladville? – Simple domain, one dot. - What makes those worn out silver marks on Dell Laptops? - for entrepreneurs, Conservatism leads to failure. “contradiction, don’t decisions to pursue uncertain future nearly guarantee failure? Let me ask you this – how did you decide to become an entrepreneur, what exactly warranted that move. Do you not regret it? If not, you need to feed it, not starve it. - Dont let emotion throw your focus on customer service. - Why do techies collect computer trash? 4eee PC - Why Vista is failing? Because it’s change, and people hate change… to web site layouts, to web browsers, to… well, anything. It should always come in just as the current one is, with the ability to turn on the insanity on demand. People consider things to suck when they cannot cope with the change – what sucks about Outlook? The fact that it doesn’t do what I expect it to do. When I find out the right way, if it ain’t my way, I get angry. - Affordable SMS/Paging Solutions In The 21st Century
Notice that not everything is a headline, it’s not like I sit there and brainstorm blog posts. I just jot down ideas as I come up with them and I eventually put them together to answer a question that someone asked (or at someone ought to be asking).
This works for me because I don’t care about your critical literary taste – I don’t even bother spell checking the post. I just type as I go along and wish you the best of luck with understanding where I am heading. Truth is, it takes longer to proof and organize a body of text than to create a rough draft / stream of consciousness or lack thereof (the porn posts). Sometimes this is brilliant, sometimes it backfires terribly and leads to misunderstandings and hurt feelings.
The idea behind blogging is that you offer your view as you would face to face with someone you knew. This isn’t the state of the union or a testimony to the grand jury, it’s just me reacting to something. It will never end up in the newspaper, it will not become a fatwa or a book but it helps stay in touch with people and it starts conversations.
At the end of the day, thats what this stuff is all about – continuing the relationships you established or meeting new friends and coleagues online. Kind of how you know me.
(Pardon the post quality, typed in the back of a rental car as I tried to get an extra hour of sleep due to my phone being stuck in the wrong time zone.. when that failed to materialize, I typed this up)
Read the whole post...
WordPress is one monster of a platform, and hacking it is probably as much fun as you can have with a web page without writing actual code. Unfortunately, that little convenience tends to bring out a lot of “Bubba the Web Alchemist” people out the woodworks that go buck wild with plugins and extensions to do some very, very simple things.
One of the biggest Bubba tasks is to use WordPress as a content management system but providing static pages for some parts of the content for one reason or another. While there is a plugin in WordPress 2.1+ to set a page as a homepage, there are also legitimate reasons to have pages in the WordPress powered page that are not part of the WordPress content database. That reason generally involves a third party web designer that doesn’t know how to code WordPress themes, inept content manager and more. Some people design an entire site from scratch then try to muscle WordPress into it. Some people go the opposite way, they start with WordPress but then have content sections they want to manage outside of WordPress content database.
But what if your template elements relied on WordPress functions?
Big gotcha. Suppose you had a flat web page that you wanted to use as a part of your online content but all your headers and footers had WordPress functions in them – to generate category printouts, archives or comments. You couldn’t just use a bare php include because PHP would crash when it couldn’t interpret the function you are trying to call. So, for all of you struggling Bubba alchemists out there, here is the simplest WordPress-aware page using content outside of the WordPress content database:
<? define(‘WP_USE_THEMES’, false); require(‘./wp-blog-header.php’); get_header(); ?>
Bubba the Web Alchemist <br/> Global HQ
<? get_sidebar(); get_footer(); ?>
The top section sets up the theme and includes the WordPress functions. get_header() gets the overall site header, and the other functions at the bottom (get_sidebar and get_footer) include the sidebar and footer. This can vary based on your template design but it gets the point across.
The part in the middle is the flat HTML you want displayed in the context of your WordPress theme without giving your webmaster a heart attack. They can go about designing the special pages (forms, surveys, internal/external content and more without bothering you or potentially destroying the WordPress deployment in the process.
See, how easy was that?
Read the whole post...
Today I took the first steps towards publishing my newsletter and that of course means putting up a signup form. This is a dreadful, backwards process of creating a new template page, building a form, a processing script and then sending the user where they started out from. It involves unnecessary clicks, diminishes from design and flow of the site. But it doesn’t have to – enter jQuery and WordPress.
Using jQuery framework and a simple backend server script you can collect data from the user and post the response inline on the same page with the minimal interruption to the browsing process and minimal changes to the layout. For example, my form prompts users for their email address in the sidebar to the right. It communicates errors or success by fading in a container with the error or congratulations text. No page reloads, no dedicated pages to design or maintain – just embed another widget in the sidebar and enable the site to be more functional. Gotta love AJAX.
I wrote a quick and simple HowTo article on creating AJAX driven forms in WordPress: Check it out.
Enjoy!
Read the whole post...
One of the worst things in blogging (aside from the constant, unrelenting abuse and hate mail you subject yourself to) is dealing with SPAM. Here you are just talking openly about whatever and someone tries to make money off of it. Low…
I’ve gone out of my way to kill the spammers. First, I only allow comments by registered users and registered users only receive a password to the email address they provide at registration. This nearly eliminates comment spam, I may have had one junk message in the past year.
Second, I absolutely neutered the trackback SPAM. These are the fake comments you see on Vladville that say “Mike said this: ” followed by my post contents. What I have essentially done to neutralize these monkeys is removing the hyperlink to their URLs, so even though they SPAM me, it gets them nowhere and just sends more links to my blog.
I kind of make a living killing spammers so this goes a little beyond the lone annoyance, its outright emasculating. So I’m sitting here in the atomic tangerine lab trying to come up with some replicable pattern that I can use. Most trackback SPAM plugins rely on curl to check if the offending web page has the direct link to my blog post. For pretty much everyone, that seems to be the case. So here is about the only thing I have come up with so far:
All trackback SPAM has the full post URL in it. The page also quotes, partially, my blog post and attributes it to someone else. I am intercepting the URL, downloading it with curl, stripping out all the HTML and running preg_match between the two posts.
Because all HTML and punctuation is ignored, it should be pretty easy to find a pattern match over at least 100 characters.
For the most part, nobody quotes paragraphs and paragraphs of text in a blog post, they merely link to the article and offer their point of view on it. Let’s see how it goes, right now I am just logging the matches and not discarding them automatically.
Off topic… I tried this too:
Most trackback spam happens within minutes of the post going live. It is almost safe to say that nobody would have read, thought about and produced a post referencing me within let’s say 30 minutes of my blog post. Something that automated either has no life at all or is a spambot.
If you have a better idea, I’m all ears…
P.S. I killed the monkey-glide as a courtesy to Katie. As you may have noticed, there is some more AJAX happening on Vladville, this time just a stupid CSS trick that brings in additional navigation without cluttering the page — just click on the monkey tale thats right above my head on the top right corner of my page where it says “Whats on Vlad’s Mind?” – (In my best Stewie voice) Maybe I’m thinking maybe the wife needs to take up more blogging and less bitching about how inconvenient her husbands blog is? Write a compelling narrative about the javascript timeouts and smooth scrolling with jquery? Something that will make us all root for the protagonist? Maybe put in some life experiences in the plot? Nah, nah.
Read the whole post...
After deleting the billionth trackback spam from Vladville I figured it was time to do what I do best, wack lines of code until something happens. Thanks to Aksimet and Spam Karma 2 I don’t have a lot of comment SPAM. Yes, every now and then I get to delete one or two but I am at the point where I’m deleting dozens of trackback spams each day.
Trackback SPAM is just spammers way of getting more traffic to their site. They ping the popular blog in hopes that people will accidentally hit the link and end up on their site. Doing a trackback is also very convenient, spamwise, because it does not require them to have an account here, confirm anything or even exist – just put up a blog post and hit pingomatic. Life is good.
Two can play at that game. Here is how you disable trackback linking using WordPress:
/wp-content/comment-template.php
Edit the get_comment_author_link() function and replace it with what I had below.
function get_comment_author_link() { global $comment; $url = get_comment_author_url(); $author = get_comment_author();
if ( empty( $url ) || ‘http://’ == $url ) $return = $author; else { if(get_comment_type() == ‘comment’) { $return = “<a href=’$url’ rel=’external nofollow’>$author</a>”; } else { $return = “$author”; } }
return apply_filters(‘get_comment_author_link’, $return); }
Pretty simple. Here is what it looked like before:
if ( empty( $url ) || ‘http://’ == $url ) $return = $author; else $return = “<a href=’$url’ rel=’external nofollow’>$author</a>”;
What I have basically done is to add another wrapper around the line of code that returned the author along with a link to their blog. My wrapper checks for the comment type and unless the comment type is a comment (which implies they have a registered account here, that I can nuke easilly if they start to SPAM) I don’t print their URL.
So SPAM away boys, nobody is going to click on your junk from this blog anymore.
Read the whole post...
Spamming is a hard job. Spamming blogs is even harder. I’ll save you the colorful description of what I think of the people that do this, and as of late a particular site (universityupdate.com) has been a big thorn in my side. It’s your typical Adwords scumbag, trying to get links any way possible so someone would accidentally click on some of the ads and bring them a quarter.
So how does one get rid of this site, or perhaps any site, you don’t want trackbacks from via WordPress? Simple, just edit your wp-trackback.php and add this somewhere towards the bottom of the script (make sure you’re not putting it inside any other if { } statements:
if (preg_match(“/\buniversityupdate.com\b/i”, $tb_url)) { wp_redirect(get_permalink($tb_id)); exit; }
Pretty simple. Save the file and you’re done. This can work in a number of ways, all that regexp looks for is presence of “universityupdate.com” string in the URL that the splogger is using. I don’t know why I didn’t do this sooner, its certainly faster than nuking a blog comment.
Read the whole post...
The biggest problem not just with WordPress but any blog is the eternal vertical list. Bloggers use lists of all kinds to fill up their blog and often abuse lists to show connections, interests and affiliations their posts do not. This post is all about taming those vertical lists and making WordPress categories comma delimited (means separated by commas).
Great Ways To Fill Your Blog
First of all, the problem: endless vertical lists. Nothing says “mine is bigger” like a huge vertical list. Here is what these unordered lists actually represent:
Blog Rolls – The list of people I met once that haven’t updated their site in 6 months
Categories - Watch me pretend my rants are actually organized and coherent thoughts
Links – Show people you’re a true intellectual by linking to Club Jenna, The Collected Works of Shakespeare, Vivid Entertainment and Michio Kaku’s String Theory. Comment Rolls – Nothing says “I am thought provoking!” like showing recent comments as a list with the top one being “PrinterCartriges4Less on Contemporary Evangelical Literature“
Vertical AdWords – All the cash I’d make if people actually found me interesting.
Flare – Nothing screams Blogosphere like a collection of Web 2.0 crap found all over the net. First you link every which way someone can subscribe to you. Start by listing every feed format known to man. Then you help idiots that can’t cut and paste add you to MSN, My Yahoo, Bloglines, Google, Live Links, Kinja. After you have collected every icon on the web put that “Bloging Loser” crown on your head by putting in a ClusterMap. Nothing shows people your irrelevance more than a dead map of hits, most from random search engine spiders. Congratulations, you’re a blogger!
And the best for last Post Calendar – Show people just how dead your blog really is.
So now that we’ve identified all the flaws with standard blogging templates let’s look at the positive side. Let’s assume you actually had something interesting to say but still wanted to put up some flare. The problem you run into with even minimal use of side items is that your main content gets squished down to the point that your main thoughts look more like haiku than an article. Your options are to either stick these items in the header or the footer but if you had a lot of relevant stuff to put in, such as categories, your lists would take up more than half the page. The answer to taming lists is through hacking and css. I’ll let you pick which one is better.
Hacking Lists with CSS
The simplest way to comma delimit the category list in WordPress is to simply style the list accordingly. Mark Newhouse has a great article on taming lists in general but here is all you need to know about managing your categories in WordPress.
First, stick the following in your css stylesheet:
#inline-list { }
#inline-list p { display: inline; }
#inline-list ul, #inline-list li { display: inline; }
#inline-list-gen ul li:after { content: “, “; } #inline-list-gen ul li.last:after { content: “. “; }
Now you just have to enclose your category list and apply the above style to it:
<div id=”inline-list”> <ul> <?php wp_list_cats(); ?> </ul> </div>
By default wp_list_cats generates <li> items (list items) which can be ordered, unordered or sorted any way you wish. The simplest way to consolidate these lists is by coma separating them so they take up as little room as possible.
Hacking WordPress code to Comma-delimit
Unless you’re a web monkey hacking the code directly is a lot more fun. Not only is it dirty but it also brings you closer to the code by making you maintain a list of changes every time WordPress is upgraded.
First, disable <li> formatting by passing ‘list=0′ parameter to wp_list_cats:
<?php wp_list_cats(‘list=0′); ?>
Second, hack the code. When you pass list=0 parameter WordPress appends <br /> after each category. Sticking a comma instead of a line break can save a ton of space. Using other separators (% | o x) can be even more stylish. So how do you make WordPress do this? Edit wp-includes/template-functions-category.php and replace <br /> with , on line 375 (in WordPress 2.0.4)
if ( $list ) { $thelist .= “\t<li”; if (($category->cat_ID == $wp_query->get_queried_object_id()) && is_category()) { $thelist .= ‘ class=”current-cat”‘; } $thelist .= “>$link\n”; } else { $thelist .= “\t$link <br />\n”; }
BEFORE: $thelist .= “\t$link <br />\n”; AFTER: $thelist .= “\t$link, \n”;
Simple as that. In the PHP code sample above an IF construct is used to evaluate the $list parameter you passed through wp_list_cats(‘list=0′); It’s a simple boolean (0,1 – false, true) comparison. Top part of the code is executed if the $list value is true (‘list=1’) and else is executed if it’s.. well, guess
So there you go, from a 6 foot vertical list to a pretty block like this one:

How tall IS this ladder?
Some template functions implement before and after arguments to allow you to pass values before and after inputs and outputs. Unfortunately, wp_list_cats() does not support that so your only option is to write a filter. That however is a discussion to have much later.
Please keep in mind that I’m just showing you how to get your feet wet and how to edit and tweak the simplest of things in WordPress code. Hopefully this gets rid of your fears of things exploding and buildings coming down if you make slight changes. Hopefully it also makes you think about code, the simplicity and ease of transforming it to do what you want. You’ve got to start somewhere and this is just the least painful way.
Read the whole post...
|
|
Whats on Vlad's Mind?
|
|
|
|
|
Sponsors: This blog is made possible by
Own Web Now Corp and ExchangeDefender.
If you like this blog and are in the need of products we offer I hope you give us some
consideration.
|
|
|
|
|
|
Get The Newsletter
|
Looking for a more focused, exclusive insight into the world of SMB tech & business? Sign up for my newsletter:
Click here to sign up
|
|
|
|
|
Vladfire Vlog
|
Vladfire is my video blog showcasing successful people and technology in small to medium business.
Below are a few recent episodes, check out the archive for all other films.
|

See more episodes...
|
|
|
SBS Show Podcast
|
SBS Show is a free weekly podcast (Internet for recorded radio show) focusing on small business and technology. More at sbsshow.com but check out our latest episode:
SBS Show #26
Erick Simpson
Managed Services Part 2

Listen to older shows..
|
|
|
|
| |
|
|
Categories
|
|
Archives
|
|
About
|
| Apple, Awesome, Beta, Blogroll, Boss, Cloud, Deals, E12, Events, Exchange, ExchangeDefender, Friends, Gadgets, Gators, Gaypile, Google, GTD, Humor, iPhone, IT Business, IT Culture, Legal, Linux, Microsoft, Misc, Mobility, Open Source, OS, OwnWebNow, Pimpin, Podcast, Programming, Rant, SBS Show, Security, Shockey Monkey, SMB, System Admin, Thieving Weasel, Uncategorized, Vista, Vladcast, Vladfire, Vladville, Web 2.0, Windows Home Server, WordPress, Work Ethic, Wrong |
 |
May 2012,
April 2012,
March 2012,
February 2012,
January 2012,
December 2011,
November 2011,
October 2011,
September 2011,
August 2011,
July 2011,
June 2011,
May 2011,
April 2011,
March 2011,
February 2011,
January 2011,
December 2010,
November 2010,
October 2010,
September 2010,
August 2010,
July 2010,
June 2010,
May 2010,
April 2010,
March 2010,
February 2010,
January 2010,
December 2009,
November 2009,
October 2009,
September 2009,
August 2009,
July 2009,
June 2009,
May 2009,
April 2009,
March 2009,
February 2009,
January 2009,
December 2008,
November 2008,
October 2008,
September 2008,
August 2008,
July 2008,
June 2008,
May 2008,
April 2008,
March 2008,
February 2008,
January 2008,
December 2007,
November 2007,
October 2007,
September 2007,
August 2007,
July 2007,
June 2007,
May 2007,
April 2007,
March 2007,
February 2007,
January 2007,
December 2006,
November 2006,
October 2006,
September 2006,
August 2006,
July 2006,
June 2006,
May 2006,
April 2006,
March 2006,
February 2006,
January 2006,
December 2005,
November 2005,
October 2005,
September 2005,
August 2005,
July 2005,
|
 |
Vlad says:
Thanks for checking out my blog. You've officially reached the end of the Internet so take in what you've read and don't look at it as gospel but an invitation to start thinking for yourself.
|
|
|
|
| |
Copyright © 2005-2010 Vlad Media, Inc. All Rights Reserved.
Content is provided AS-IS without warranty of any kind.
Syndicate this blog: 
|
| | |