Results 11 - 20 of about 12807 stories
WPCandy on 6 February 2012, 10:21 am   Category: Blog

The first issue of The WPCandy Quarterly is in the printing queue as you read these words. Exciting, right? Since there’s nothing I can do to speed up the process (believe me, I would if I could) I’ve taken some time and looked back over the first issue’s development.

One thing I did, while the design process of the Quarterly moved along, was save several drafts. There were nearly 50 individual design drafts of this issue, actually (we drafted articles separately with the individual authors).

Since the drafts were interesting, I put together a quick video showing a few stages of development for various pages within the Quarterly. In the video you get to see the pages when they weren’t much more than words on a page, when they changed formats and styles, and then what they eventually become. I had fun making it, so I hope you enjoy watching it.

I’ve embedded the video below, just after the jump.

Click here to view the embedded video.

The video’s on YouTube and Vimeo. Thanks to 37signals for the inspiration for the general style.

I find it is useful to look back on early versions and first drafts to see exactly how much the magazine progressed. There were times, particularly on a large project like the Quarterly, where I needed inspiration to keep working on it. Peering back at the early versions and seeing how far it had come definitely helped keep me moving at times.

If you haven’t seen the proof or teaser photos yet, check them out.

What is The WPCandy Quarterly?

The Quarterly is a printed publication (yup, the real kind where you hold paper in your hands) featuring articles written by members of the WordPress community. The first issue includes 11 contributors writing about everything from theme frameworks and open source in the government to the ethos of the WordPress community itself. If you enjoy WPCandy at all (or even just a little bit) then this magazine is just for you.

If you haven’t picked up a copy of The WPCandy Quarterly yet, now is the time. Issues will be hot off the printer and shipped out in just a few days!

You just finished reading The Quarterly Magazine's design process, sped up on video on WPCandy. Please consider leaving a comment!


WPCandy on 6 February 2012, 9:52 am   Category: Blog

Ever find yourself wanting to query the “standard” post format within WordPress and not having much luck? It turns out there’s a Trac Ticket for this very subject. But for now, Alex King came up with a way for it to work with WP_Query calls. Go have a look at his code.

You just finished reading How to query by "standard" post format on WPCandy. Please consider leaving a comment!


WPCandy on 6 February 2012, 9:40 am   Category: Blog

WP on Tour Crew 2012

The 15th of January through the 22nd finally saw its first WP on Tour go live. WPCandy mentioned WP on Tour here before, but it’s basically a bunch of WordPress developers (of all shapes and sizes) sharing a working space for a week.  This first edition saw 10 of us — yes, I was fortunate to be among them — in a beautiful house in Sitges, Spain having fun and co-working for 7 days.

You can find the full list of WP on Tour attendees on this Twitter list, You might have noticed some of your WordPress buddies on Twitter mentioning the #wpontour hashtag and you might have concluded that we had a lot of fun…

…and you’d be right! The only thing we really had in common was our love for WordPress, but if you’ve ever been to a WordCamp you know that there are some awesome people out there in the WordPress community. And to an extend, that’s how WP on Tour felt to me. We had a lot of fun getting to know each other, our housepet Wolfy and of course learning from each other as well.

As we were close to Barcelona we of course went all touristy as well and visited the great city.  While in Barcelona we met up with Automattic’s Renewal team, who were in Barcelona at the same time, for even more WordPress geekyness.

Projects launched

The week was not just fun and play (and some clients projects actually needed finishing), but there also was time to share ideas on various personal projects and some of them actually saw the light of day. Briefly, folks worked on the following projects:

  • Noel Tock created his version of WordPress meets Stripe: WP Stripe
  • Bas van der Lans made a large update to his YouTube DJ tool

The idea behind WP on Tour is to step out of our daily (office) environment and work at a challenging location somewhere in the world. Like a holiday, but with WordPress geeks. This is the best way I know of to get in touch and hang out with developers, designers and evangelists next to visiting a WordCamp. If you feel like organizing your version of WP on Tour then all you’ve got to do is contact Karim.

(Feel like checking out all the pictures we took and what the wolf is doing in some of those pictures? Do check out WP on Tour Flickr pool then!)

You just finished reading The first WP on Tour was a huge success on WPCandy. Please consider leaving a comment!


CatsWhoCode on 6 February 2012, 9:01 am   Category: Blog

Check if a specific website is available

Want to know if a specific website is available? cURL is here to help. This script can be used with a cron job to monitor your websites.

Don’t forget to update the script with the url you want to check on line 3. Once done, just paste it somewhere and it will let you know about the site availability.

<?php

       if (isDomainAvailible('http://www.css-tricks.com'))
       {
               echo "Up and running!";
       }
       else
       {
               echo "Woops, nothing found there.";
       }

       //returns true, if domain is availible, false if not
       function isDomainAvailible($domain)
       {
               //check, if a valid url is provided
               if(!filter_var($domain, FILTER_VALIDATE_URL))
               {
                       return false;
               }

               //initialize curl
               $curlInit = curl_init($domain);
               curl_setopt($curlInit,CURLOPT_CONNECTTIMEOUT,10);
               curl_setopt($curlInit,CURLOPT_HEADER,true);
               curl_setopt($curlInit,CURLOPT_NOBODY,true);
               curl_setopt($curlInit,CURLOPT_RETURNTRANSFER,true);

               //get answer
               $response = curl_exec($curlInit);

               curl_close($curlInit);

               if ($response) return true;

               return false;
       }
?>

→ Source: http://css-tricks.com/snippets/php/check-if-website-is-available/

cURL replacement for file_get_contents()

The file_get_contents() function is very useful but it is unfortunely deactivated by default on some webhosts. Using cURL, we can write a replacement function that works exactly like file_get_contents().

function file_get_contents_curl($url) {
	$ch = curl_init();

	curl_setopt($ch, CURLOPT_HEADER, 0);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //Set curl to return the data instead of printing it to the browser.
	curl_setopt($ch, CURLOPT_URL, $url);

	$data = curl_exec($ch);
	curl_close($ch);

	return $data;
}

→ Source: http://snipplr.com/view/4084

Get latest Twitter status

Using PHP and cURL, it is pretty easy to get the status of a specific user. Once you have it, what about displaying it on your blog, like I do in WPRecipes footer?

function get_status($twitter_id, $hyperlinks = true) {
    $c = curl_init();
    curl_setopt($c, CURLOPT_URL, "http://twitter.com/statuses/user_timeline/$twitter_id.xml?count=1");
    curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
    $src = curl_exec($c);
    curl_close($c);
    preg_match('/<text>(.*)<\/text>/', $src, $m);
    $status = htmlentities($m[1]);
    if( $hyperlinks ) $status = ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]", '<a href="%5C%22%5C%5C0%5C%22">\\0</a>', $status);
    return($status);
}

The function is super easy to use:

echo get_status('catswhocode');

→ Source: http://www.catswhocode.com/blog/php-snippets-to-interact-with-twitter

Twitter: test friendship between two users

If you want to know if a specific user is following you (or someone else) you have to use the Twitter API. This snippet will echo true if the two users specified on lines 18 and 19 are friends. It will return false otherwise.

function make_request($url) {
	$ch = curl_init();
	curl_setopt($ch,CURLOPT_URL,$url);
	curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
	$result = curl_exec($ch);
	curl_close($ch);
	return $result;
}

/* gets the match */
function get_match($regex,$content) {
	preg_match($regex,$content,$matches);
	return $matches[1];
}

/* persons to test */
$person1 = 'phpsnippets';
$person2 = 'catswhocode';

/* send request to twitter */
$url = 'https://api.twitter.com/1/friendships/exist';
$format = 'xml';

/* check */
$persons12 = make_request($url.'.'.$format.'?user_a='.$person1.'&user_b='.$person2);
$result = get_match('/<friends>(.*)<\/friends>/isU',$persons12);
echo $result; // returns "true" or "false"

→ Source: http://www.catswhocode.com/blog/php-snippets-to-interact-with-twitter

Download and save images from a page using cURL

Here is a set of functions that can be very useful: Give this script the url of a webpage, and it will save all images from this page on your server.

function getImages($html) {
    $matches = array();
    $regex = '~http://somedomain.com/images/(.*?)\.jpg~i';
    preg_match_all($regex, $html, $matches);
    foreach ($matches[1] as $img) {
        saveImg($img);
    }
}

function saveImg($name) {
    $url = 'http://somedomain.com/images/'.$name.'.jpg';
    $data = get_data($url);
    file_put_contents('photos/'.$name.'.jpg', $data);
}

$i = 1;
$l = 101;

while ($i < $l) {
    $html = get_data('http://somedomain.com/id/'.$i.'/');
    getImages($html);
    $i += 1;
}

→ Source: http://stackoverflow.com/questions/7747875/grab-download-images-from-multiple-pages-using-php-preg-match-all-curl

Convert currencies using cURl and Google

Converting currencies isn’t very hard to do, but as the currencies fluctuates all the time, we definitely need to use a service like Google to get the most recent values. The currency() function take 3 parameters: from, to, and sum.

function currency($from_Currency,$to_Currency,$amount) {
    $amount = urlencode($amount);
    $from_Currency = urlencode($from_Currency);
    $to_Currency = urlencode($to_Currency);
    $url = "http://www.google.com/ig/calculator?hl=en&q=$amount$from_Currency=?$to_Currency";
    $ch = curl_init();
    $timeout = 0;
    curl_setopt ($ch, CURLOPT_URL, $url);
    curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch,  CURLOPT_USERAGENT , "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1)");
    curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
    $rawdata = curl_exec($ch);
    curl_close($ch);
    $data = explode('"', $rawdata);
    $data = explode(' ', $data['3']);
    $var = $data['0'];
    return round($var,2);
}

→ Source: http://l33ts.org/forum/Thread-PHP-Convert-currencies-using-Google-and-cURL-Snippet

Get remote filesize using cURL

Want to be able to calculate the size of a specific file? The following function can help. It takes 3 parameters: the file url, and in case the file is password protected, a username and a password.

function remote_filesize($url, $user = "", $pw = ""){
    ob_start();
    $ch = curl_init($url);
    curl_setopt($ch, CURLOPT_HEADER, 1);
    curl_setopt($ch, CURLOPT_NOBODY, 1);

    if(!empty($user) && !empty($pw))
    {
        $headers = array('Authorization: Basic ' .  base64_encode("$user:$pw"));
        curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
    }

    $ok = curl_exec($ch);
    curl_close($ch);
    $head = ob_get_contents();
    ob_end_clean();

    $regex = '/Content-Length:\s([0-9].+?)\s/';
    $count = preg_match($regex, $head, $matches);

    return isset($matches[1]) ? $matches[1] : "unknown";
}

→ Source: http://megasnippets.com/source-codes/php/get_remote_filesize

FTP upload with cURL

PHP does have a FTP library, but you can also use cURL to upload files on a FTP server. Here is a working example:

// open a file pointer
$file = fopen("/path/to/file", "r");

// the url contains most of the info needed
$url = "ftp://username:password@mydomain.com:21/path/to/new/file";

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

// upload related options
curl_setopt($ch, CURLOPT_UPLOAD, 1);
curl_setopt($ch, CURLOPT_INFILE, $fp);
curl_setopt($ch, CURLOPT_INFILESIZE, filesize("/path/to/file"));

// set for ASCII mode (e.g. text files)
curl_setopt($ch, CURLOPT_FTPASCII, 1);

$output = curl_exec($ch);
curl_close($ch);

→ Source: http://net.tutsplus.com/tutorials/php/techniques-and-resources-for-mastering-curl/


How Page.ly Was Built 3 days ago.

WP Tavern on 6 February 2012, 8:00 am   Category: News

First off, congratulations to Joshua Strebel and to his wife as they are now first-time parents. Secondly, Joshua has put together a pretty transparent view as to how he created Page.ly, a WordPress specific hosting service. So far, the guide is five parts long but I advise you to start out with part 1, Identifying the opportunity.   

No related posts.


Yoast on 6 February 2012, 3:17 am   Category: Blog

In my previous post I explained how I used the Types plugin to create a new custom post type. That custom post type will be used to display a table of supported themes for my WordPress SEO plugin, and is therefor called wpseo-theme. Now the trick here is that I want users to be able to submit themes through a form.

Gravity Forms + Custom Post Type addon

By default, Gravity Forms allows you to create posts through a form. It doesn't have support for custom post types at the moment though, in part because a wonderful plugin was already created that allows for this. This plugin, aptly named Gravity Forms + Custom Post Types can be downloaded from WordPress.org.

Once you have both Gravity Forms and this plugin activated, you can start creating a form. The first step is to make the form fill our custom post type. We start with creating a form and dragging in a title field:

Create form with Gravity Forms

The title field can be found in the posts field section of Gravity Forms field, below the advanced fields:

Post fields in Gravity Forms

Once you've added this input field and given it a name, go to the advanced section of its edit block, you'll see an option to save as post type, this has been added by the afore mentioned plugin:

title field advanced section - save as custom post type

You check the box and select the custom post type you want to use, in my case, WPSEO Themes. Now we start adding the form. We need a couple of different types of values:

  • The title: done.
  • The "description", which will just be the body text, so you can easily drag in the Body input field.
  • An image, which should be saved as the featured image too, more on that below.
  • Several custom fields, more below too.

Adding a featured image trough the form

This is actually pretty easy: drag in an image field and click edit, you'll see something like the screen below:

Image field - featured image

As you can see, setting the image as featured image is as easy as ticking the box. It's wise to also ask for a description if you don't know what's going to be on the image. In my case, it's a screenshot of the theme, so I won't bother and just set the alt tag automatically.

Adding custom fields through Gravity Forms

The next step is to add the several custom fields we need. In my case I had 5, but you can have as much as you want. You start by dragging a Custom Field input into your form. Once you have that, you click edit and you select the appropriate custom field type:

Select custom field type

In this case, I'm asking for the theme URL, so I select website, but there are all sorts of options you can choose from, as you can see. Now here comes the tricky part, you need to set the name of your custom field. You should go into your Types -> Custom Fields page and check the second value below the custom field title:

Custom field details - Types plugin

That's the name of your custom field, but you should prefix it with "wpcf-", because that's the Types plugin naming convention, which prevents its custom fields from clashing with other ones.

Name custom field

Of course, if you created a custom field group from already existing custom fields you don't need to prefix the custom field name.

True / false or "boolean" input fields

Some of your custom values might be checkboxes, they're either on or off, true or false. That's called a boolean value in math / developers language, but for you, it's really simple. Just create a custom field type "checkboxes", and go into it's settings:

Custom field type checkboxes

Be sure to check the "enable values" box and set the value to just "1". That way, if checked, Gravity Forms will save it as value "1" and the Types plugin will "get it".

Deciding on workflow

Now, once you've used the above info to finish your form, you need to decide on a workflow. On the post title field, the one whose advanced settings we used to save this input as a custom post type, we now go to the "normal" properties:

Post title - field properties

As you can see, you can set a default post author and a post status. Now in my case the author will be me in most cases, as nobody will be logged in. However, if you have enabled registration on your site, you can force people to be logged in before even being able to use this form, by going into your forms advanced settings and checking the "require user to be logged in" checkbox:

Require log-in

This allows for all sorts of workflows, find one that suits your site!

Conclusion

We still haven't written a single line of code, yet we've already created a custom post type and created a form that allows people to submit custom post types to us.

So, one more thing to check of off the to-do list:

  1. Creating a custom post type + custom fields.
  2. Creating a form through which people can submit themes that fills this post type.
  3. Creating a browsable interface for this post type.

In my next post, I'll explain how to use the Views plugin to create "views" for this post type and unveil the finished product!

Use Gravity Forms to submit custom post types is a post by on Yoast - Tweaking Websites.A good WordPress blog needs good hosting, you don't want your blog to be slow, or, even worse, down, do you? Check out my thoughts on WordPress hosting!


Weblog Tools Collection on 5 February 2012, 7:00 am   Category: Themes

Blush is a soft, warm, feminine theme in tones of rose and cream.

Boozurk is a clear theme with a lot of features.

The Frances Wright is a clean and elegant theme.


WPCandy on 4 February 2012, 12:50 pm   Category: Blog

The WPCandy Quarterly is, as far as I know, the first-ever WordPress-centric magazine. Or rather, it will be when it begins shipping out to subscribers in the next week or so. On Friday I received the final print proofs, which wraps up the last necessary step before all the issue are printed and delivered.

I’ve dropped in a few photos of the proof sheets below. Of course I’m a bit biased, but I think this issue looks fantastic. I’ll have more to share about the production process next week, but I just couldn’t help sharing this update now. I’m pretty excited to see this coming together.

Remember, we have a limited number of issues. Pick one up today to be sure you have one of the first issues of the Quarterly.

Proof sheets

When magazines like this are produced, a number of pages are printed on one large sheet. The sheets are then cut down to the various spreads and folded into place.

Print vs. digital

Everyone who orders an issue will receive access to digital copies as well, but even so I think the printed version of the magazine is just cool. For this first run we have only 2,000 copies available — if you haven’t picked up a copy of The WPCandy Quarterly yet, now is the time.

You just finished reading The WPCandy Quarterly print proofs are in on WPCandy. Please consider leaving a comment!


Weblog Tools Collection on 4 February 2012, 7:00 am   Category: Themes

It’s no secret that I’m a fan of responsive themes. Knowing that your WordPress blog will look just as good on a tiny mobile screen as it does on a huge desktop screen is one of the most important factors of design to me, especially in today’s age where mobile device usage is growing so rapidly.

Sadly, there aren’t many responsive themes out there, but Responsive Plugin aims to change that. Once released, Responsive Plugin will make any theme scale perfectly on any screen size. There is no definitive release date, but it is definitely coming out sooner rather than later, and you can find a signup form at the bottom of the site if you want to follow the action.


Comicon Pulse 5 days ago.

WPZOOM on 4 February 2012, 1:54 am   Category: Showcase


Get in touch