Tips and Tricks About Computers, Web Development, Linux, the Internet and the Like
Computers
The Best Way to Tweet to Twitter, Post on Facebook from WordPress
Jul 26th
I’ve been focusing some time recently to the foundation levels of Internet marketing. I’m aiming to increase visibility as strongly as possible at the core of a website giving it the power to leverage evolving trends as simply as possible. This of course means utilizing APIs from other web applications, such as social networks. The title of this post is true but deceptive. I consider the following method the best way to tweet from WordPress but it’s actually a whole lot more than that. It’s a gateway to a large number of social media applications; one account to rule them all. ping.fm is a service that allows you to link multiple social network websites, such as facebook, twitter, linkedin and more.
So the idea then, is to leverage then is to utilize the ping.fm application from your website. If you’re using WordPress then you’re set, the simple no frills publish 2 ping.fm plugin will allow you to interact with ping.fm from your blog/website.
I’ve tested this out with the free open-source GPL First Person Shooter, Xonotic and a new site I just started dumbtubes.com. Both have twitter accounts that you can see publishing twitter.com/dumbtubes, twitter.com/xonotic. Xonotic also publishes to many other social accounts, see the Xonotic homepage to find other accounts.
Stay tuned for more wordpress tips.
New Python eBook, Much Better, Down and Dirty
Jul 1st
Some friends recommended a book that’s a quicker pace with some better programming practices. Learn Python The Hard way (or quick way
). It reads more like a walk-through tutorial / quick reference and gives you easily repeatable programming practices that will get you a stronger feel for the language. It’s probably best used in combination with the Python Documentation. Also, a fair warning, Dive Into Python has war declared against it.
Patching NextGEN Voting Plugin to Allow Showing of the Vote Form on Single Images
May 30th
Intro
NextGEN Voting is a plugin for the wordpress plugin NextGEN Gallery plugin. Keeping this in mind made the task of extending easier. NextGEN Gallery hooks into wordpress functions, NextGEN Voting hooks into NextGEN Gallery.
By default, NextGEN Voting hooks into the gallery view, giving access to a function that uses the image id for lookup. The only reason we see nothing if we try to paste the same template code into a page other than the recommended “nextgen-gallery/view/gallery.php” is because that function is not given access in any other view.
How-to Add Access to Use the Function in the Image Browser Template
Open “wp-content/plugins/nextgen-gallery-voting/ngg-voting.php”,
Look for:
add_filter("ngg_show_gallery_content", "nggv_show_gallery", 10, 2);
Add After:
add_filter("ngg_show_imagebrowser_content", "nggv_show_imagebrowser", 10, 2);
Look for:
function nggv_show_gallery($out, $gid) { return $out.nggc_voteForm($gid, $buffer); }
Add After:
function nggv_show_imagebrowser($out, $gid) { return $out.nggc_voteForm($gid, $buffer); }
Now we have given access to the function and can paste the following code into “wp-content/plugins/nextgen-gallery/imagebrowser.php”:
< ?php echo nggv_imageVoteForm($image->pid); ?>
Conclusion
I’ve tried to explain this in method in a way you can repeat an extend to suit your needs. By following the same logic and tracing the hooks, you can apply this however you might need.
You’ll want to keep “wp-content/plugins/nextgen-gallery/nggfunctions.php” open as a reference for what hooks are available. You can find hooks by searching for “apply_filters(‘”, it will be the first parameter.
Blocking Ads Cross-browser and Save Bandwith Using Your Hosts file
May 26th
Ethics of blocking ads vs. data mining aside, one of the smartest ways I found to block ads is at http://someonewhocares.org/hosts/zero/ where the author, Dan Pollock has compiled a list of urls, with the help of contributors that all redirect to 0.0.0.0 or 127.0.0.1 (localhost, your machine). By appending this list to your current hosts file (or selectively adding parts), whenever your machine attempts to look up a domain name in this list, it will resolved to 0.0.0.0 or your machine. It will never make a request on the internet to the intended server. It will never even download the advertisement.
To take this a step further, you could develop a similar list for your router or DNS server (if you operate it).
I still use adblock plus on top for missed entries.




