Much to do, but exciting times ahead! #projectwhismur 4 days ago


25th
Oct 11

Copying to clipboard in WordPress



I was recently asked, as a commercial request, to create a WordPress plugin that would allow users to click a button and copy text the clipboard. It seemed an easy enough thing to do – 2 weeks later, though, and I’ve thrown in the towel.

Using JavaScript to capture contents is the easy bit – adding it to the clipboard is a lot more difficult. IE has a JavaScript command built in, other browsers vary. Unfortunately, other browsers (e.g. Firefox) also restrict this ability for security reasons. This is because the ability to write to the clipboard also comes with the ability to read from it as well – quite why this functionality can’t be detached and restrict just the reading I don’t know.

So, using JavaScript is problematic.

Thankfully I’m not the first to come across this problem and a third party script named ZeroClipboard is available. This uses Flash to update the clipboard, which doesn’t have the same security limitations. Of course if you’re viewing from a device that doesn’t support Flash (cough, splutter, iPad, iPhone, cough) then you’re still out of luck. None-the-less this seemed a perfect solution.

Unfortunately, my limited JavaScript skills failed me – I found the program to be over-complex for what I needed and failed to be able to get it to work.

At this point I found an alternative – ZClip uses ZeroClipboard but is controlled via JQuery (which is built into WordPress) and provide a much easier and friendly method of access.

I was now in a position where I had a working plugin. Until I used Admin Bar. That seemed to affect the positioning of the Flash overlay so you had to click slightly above the “Copy to clipboard” button to get it to work.

The customer, though, didn’t have an issue with this and I could only hope that they didn’t have anything else within their theme or plugins that could affect it in this way (I did try contacting the developer of Zclip but got no response).

What really ended it all though was the limited way of capturing text in zclip, which I hadn’t appreciated earlier on. ZClip can capture in 2 ways – from static fields (e.g. the text between a SPAN) or dynamic (e.g. from a field). The first doesn’t capture any formatting, even paragraph breaks – returning everything as one long line of text. The second did, but by capturing the HTML.

The customer wanted the customer to be able to copy to the clipboard long paragraphs of text – neither offered a neat solution to this.

Then I gave up. One day I may return to it – certainly ZeroClipboard will probably allow me to do what I need it to, but I’ll have to get my head around how to first.

Delicious Digg Facebook LinkedIn Read It Later reddit StumbleUpon Twitter SeparatorEmail Google Translate PDF Online Print Friendly



10th
May 11

WordPress Tips


This article is provided by Kevin Moor who writes for different sites, which inter alias are working to find better registry repair.

WordPress is powered by PHP and MySQL which is an open resource blog gizmo and a publishing platform as well. WordPress have many features like plug-in architecture and a template system. Actually, WordPress has been widely by thousands of biggest websites in the World Wide Web.

For sure as computer enthusiasts, you have already come across on any feature from a blog. You may wonder how you can get this in your WordPress blog. You do not need to worry anymore because here are some tips that you will absolutely find it effective and very useful.

  • Use Custom Page as your Home Page in WordPress
    This is the first thing that you must have to know on how to create a custom page. There is a need for you to duplicate your page.php or you can create a new .php file and enter the following code at the very top of it: <!--?php /* Template Name: WPBeginnerT1 */ ?-->.You may change the name of the template and can even change the style on the page depending on your preference. Just go to your WordPress admin panel and choose your desired template. You will then have to publish this page and go to Settings and select Reading in the admin panel. Choose the page to be your homepage and you can now have a Custom Home Page.
  • Create a Page that Displays Random Posts
    For sure you have seen this cool feature somewhere on web site, right? Want to try this cool feature for your site? Simply paste the following code on your custom page template: 

    <?php
    query_posts(array('orderby' => 'rand', 'showposts' => 1));
    if (have_posts()) :
    while (have_posts()) : the_post(); ?>
    <h1><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h1>
    <?php the_content(); ?>
    <?php endwhile;
    endif; ?>
  • Display External RSS Feed on Your Site
    Have you noticed bloggers who display their blogs on other’s web site? Do you want to try it too, to earn extra traffic on your website? To do this, just paste the following code in your theme:

    <?php include_once(ABSPATH.WPINC.'/feed.php');
    $rss = fetch_feed('http://feeds.feedburner.com/wpbeginner');
    $maxitems = $rss->get_item_quantity(5);
    $rss_items = $rss->get_items(0, $maxitems);
    ?>
    <ul>
    <?php if ($maxitems == 0) echo '<li>No items.</li>';
    else
    // Loop through each feed item and display each item as a hyperlink.
    foreach ( $rss_items as $item ) : ?>
    <li>
    <a href='<?php echo $item->get_permalink(); ?>'
    title='<?php echo 'Posted '.$item->get_date('j F Y | g:i a'); ?>'>
    <?php echo $item->get_title(); ?></a>
    </li>
    <?php endforeach; ?>
    </ul>

These tips will surely help you. Just remember the tips and for sure your success is within reach.

Delicious Digg Facebook LinkedIn Read It Later reddit StumbleUpon Twitter SeparatorEmail Google Translate PDF Online Print Friendly



18th
Apr 11

Hosting Sites Reviews


Hosting Sites Reviews is a new site – it appears to have only been around for a matter of weeks – dedicated to, yes you guessed it, reviewing UK web hosting companies.

There is plenty of competition already in the market and because it is so new, there aren’t any reviews available – this is a new site trying to get a foot on the rung. The owner doesn’t intend to contribute but, instead, rely on customer submitted reviews. This is has in common with many of the alternatives. Personally, I think this is an opportunity wasted. With so many competing sites, you really need some kind of USP. Customer submitted reviews can sometimes be their own worst enemy with people complaining about issues that really weren’t the hosts problem, or giving them full scores simply because they hadn’t experienced any issues up until then. The big tech review sites ignore Web Host reviews as well, so this would be a great opportunity to have the reviews led by a single person doing a fair comparison between the alternatives.

Hosting Sites Reviews only has a handful of hosting companies on their list at the moment – this list, however, is consistent with many other sites so I wonder if it has anything to do with their affiliate schemes. If a site wants to show itself as fair and all-encompassing, it should really give the opportunity to everyone. I use Memset and (grumble, grumble) Streamline.net but neither are on the list (I’d love to write a review of the latter!).

But, this is a new site and I’m sure it will grow and improve over time. Already is show promise by dividing the companies into categories – green, php, asp hosting, etc. It even has it’s own Facebook page.

Website hosting is rarely taken as seriously as it should be so more and more sites dedicated to the reviewing of these companies can only be a good thing.

Delicious Digg Facebook LinkedIn Read It Later reddit StumbleUpon Twitter SeparatorEmail Google Translate PDF Online Print Friendly