paulgrenwood


Member since 09/23/2009

43 snippets

8663 profile views

0 Comment(s) Posted

View their favorites

Profile

Achievement

first submission:submitting first snipplet

paulgrenwood's Recent Snippets



« Prev 1 2
WordPress allows you to embed videos so easily using oEmbed. You can easily add videos to your post just pasting their URL to your post. WordPress handles all the object and embed HTML for you. But this code is missing wmode parameter which is necess...
0 1205 posted 14 years ago by paulgrenwood
1 1116 posted 15 years ago by paulgrenwood
Set up and array of filenames, which correspond to the file names of the images you are trying to randomize.
0 1149 posted 15 years ago by paulgrenwood
Variables that are submitted via web forms always need to be cleaned/sanitized before use in any way, to prevent against all kinds of different malicious intent.
0 1005 posted 15 years ago by paulgrenwood
Just include this script on the site and you’ll get a Firebug console that pops up for debugging in any browser. Not quite as full featured but it’s still pretty helpful! Remember to remove it when you are done.
1 1187 posted 15 years ago by paulgrenwood
1 1234 posted 15 years ago by paulgrenwood
Search Engine Optimisation, or SEO is something that a lot of bloggers get obsessed about, whilst others think it’s a load of rubbish. I’m halfway between the two – whilst I believe that you can change certain things to better SEO your content,...
0 962 posted 15 years ago by paulgrenwood
Whilst there are a number of ways of displaying thumbnails, this is still my favourite (even if it does require the most work!). First, upload timthumb to /wp-content/themes/yourtheme/ and create an image 250px by 250px with your site’s logo and up...
0 1134 posted 15 years ago by paulgrenwood
This is something that I wished I’d thought of a long time ago – show other posts in the same series using not a plugin but custom fields. All you’ve got to do for this trick to work is create a custom field ‘Series’ with a link to each oth...
1 1005 posted 15 years ago by paulgrenwood
Allow Visitors to Email Posts to Their Friends
0 950 posted 15 years ago by paulgrenwood
1 976 posted 15 years ago by paulgrenwood
2 1142 posted 15 years ago by paulgrenwood
E-mail validation is perhaps the most used validation in web forms, this code will validate email address and also optionally check the MX records of the domain provided in email address to make email validation more robust.
2 1329 posted 15 years ago by paulgrenwood
This function will truncate strings only at word breaks which can be used to show a teaser for complete article without breaking words.
0 1202 posted 15 years ago by paulgrenwood
Creating thumbnails of the images is required many a times, this code will be useful to know about the logic of thumbnail generation.
0 1279 posted 15 years ago by paulgrenwood
Some times you need to accept some url as input but users seldom add http:// to it, this code will add http:// to the URL if it’s not there.
1 1301 posted 15 years ago by paulgrenwood
With most of the popular web services like Twitter providing their data through APIs, it is always helpful to know how to parse API data which is sent in various formats including JSON, XML etc.
1 993 posted 15 years ago by paulgrenwood
0 1065 posted 15 years ago by paulgrenwood
This snippet uses isset() instead strlen() to verify a PHP variable (in this example $username) is set and is at least six characters long.
0 941 posted 15 years ago by paulgrenwood
This code will create a human readable string that will look more close to dictionary words, useful for captchas.
0 3242 posted 15 years ago by paulgrenwood
This function will fetch the real IP address of the user even if he is behind a proxy server.
0 1124 posted 15 years ago by paulgrenwood
If you don’t need human readable string, then use this function instead, which will create a random string you can use for user id’s etc.
1 1135 posted 15 years ago by paulgrenwood
Provide files to the user by forcing them to download.
0 1274 posted 15 years ago by paulgrenwood
With this snippet, you can encode any email address into HTML entities so that spam bots do not find it.
0 1089 posted 15 years ago by paulgrenwood
This function converts URLs and e-mail addresses within a string into clickable hyperlinks.
0 1161 posted 15 years ago by paulgrenwood
1 907 posted 15 years ago by paulgrenwood
« Prev 1 2