A Plethora of Plugins - Open Source Mayhem?

Date: 26th February 2009 at 6:56 pm | Filed under: blog, wordpress | Author: Sam Burdge | Tags: , , ,

It's great that the wordpress plugins search is now working. What a massive step forward! Thanks wordpress!!

Since the plugin search was fixed it has become much more apparent how many plugins there are which are actually renamed / re-branded copies of other plugins. As plugins are released under the GPL public license there is nothing to stop these so called plugin developers from being able to do this.

This is a real problem as it is important that plugin developers who are creating original, useful plugins continue to do so. If they feel that their work is going to be taken and copied, and that they are going to end up having to share some of the credit with one of these 'plugin leeches', they may feel less inclined to make the plugin publicly available.

My suggestion is that wordpress monitor the originality of new plugins more closely when they are submitted by the developer, a good way to do this would be to allow plugin developers to 'flag' plugins which they feel are too similar to their own plugin or are a direct rip-off of their plugin.

Also, if developers have made minor changes or improvements to someone elses plugin they should be encouraged to work with the original plugin's developer to improve the existing plugin and take a share of the credit with the original developer. This will help to increase the  quality rather than quantity of plugins. A good way to implement this could be to list these offshoots or alternative versions on the original plugins page with an explanation of how they differ from the original.

Leave a Comment

A Single html Form With Multiple Submit Buttons - Changing a Form’s Action Attribute using jQuery

Date: 15th February 2009 at 4:48 pm | Filed under: development, scripts | Author: Sam Burdge | Tags: , , , , , ,

I was recently confronted with the problem of having a single html form with three different submit buttons, each button submitting the form data to a different php script. This is obviously impossible with html alone, as a form can only have one 'action' attribute, which dictates the URL of the file that the form's data is submitted to.

I searched around on the web for an easy way to implement this and found various examples. One of the best examples I found was on CoderLab's blog: Multiple submit buttons on a multiple blog which uses javascript to apply a different action attribute to the form depending on which button is pressed. Each button in the form has it's own onClick function like so:

<form name="myForm" id="myForm">
Search: <input type="text" id="wrdSearch"/>
<input type="button" name="google" id="google" value="Google" onClick="SendTo(this.id)"/>
<input type="button" name="msn" id="msn" value="MSN" onClick="SendTo(this.id)"/>
<input type="button" name="yahoo" id="yahoo" value="Yahoo" onClick="SendTo(this.id)"/>
</form>

(Visit the page to see the javascript that goes with it: http://blog.coderlab.us/2005/10/04/multiple-submit-buttons-in-a-form/)

As I already had jQuery installed on the site, and the CoderLab script would still need some modification to serve my specific purpose, I decided to see if I could find a simpler way to achieve a similar result using jQuery. The form on my site was a lot more complex, with many fields etc. So what I really needed was a script that would submit all the form data to each of the 3 php scripts depending on which submit button was clicked.

Firstly, I stripped the onClick functions out of the form and removed the name attributes from the buttons too, like so:

<form id="myForm" method="post">
Search: <input type="text" name="search"/>
<input type="button" id="button1" value="Submit to script 1" />
<input type="button" id="button2" value="Submit to script 2" />
<input type="button" id="button3" value="Submit to script 3" />
</form>

I then wrote the following jQuery script to change the form's action attribute accordingly and submit it when each button is pressed:

$(document).ready(function(){

$("#button1").click(function(){
$('form#myForm').attr({action: "script_1.php"});
$('form#myForm').submit();
});

$("#button2").click(function(){
$('form#myForm').attr({action: "script_2.php"});
$('form#myForm').submit();
});

$("#button3").click(function(){
$('form#myForm').attr({action: "script_3.php"});
$('form#myForm').submit();
});

});

The script should work on any browser that is compatible with jQuery (see here: http://docs.jquery.com/Browser_Compatibility)

For more information on installing and using jQuery visit the website: http://jquery.com/

10 Responses to “A Single html Form With Multiple Submit Buttons - Changing a Form’s Action Attribute using jQuery”

  • Comment by A Single html Form With Multiple Submit Buttons - Changing a Form’s Action Attribute using jQuery - PHP-update.co.uk
    Date: March 11th, 2009 at 1:55 pm

    [...] More here: A Single html Form With Multiple Submit Buttons - Changing a Form’s Action Attribute controlling j… [...]

  • Comment by Dickram
    Date: March 16th, 2009 at 6:33 pm

    You rock man. I was just looking for this and found your site. I’m using jquery too, with code igniter.
    Thank you very much!!

  • Comment by David
    Date: September 24th, 2010 at 1:04 am

    Hey, your article gives me a big help. Why using $(’form#myForm’) rather than $(’#myform’) though?? thank you very much

  • Comment by Sam Burdge
    Date: September 24th, 2010 at 1:17 am

    Hi David
    Glad it helped ;)

    there is no difference between using $(’form#myForm’) or $(’#myform’)

    i just wrote it that way as i thought it would make it clearer for the tutorial.

  • Comment by David
    Date: September 24th, 2010 at 4:25 am

    Thank you for your reply!~many thanks mate

  • Comment by Ben
    Date: October 4th, 2010 at 10:12 am

    Brilliant, cheers mate. Really helped me out of a whole

  • Comment by Ben
    Date: October 4th, 2010 at 10:13 am

    that should have said a whole world of frustration!!

    (pressed enter a little early)

  • Comment by Tom Lackey
    Date: April 27th, 2011 at 9:21 pm

    this served me well, thanks!

  • Comment by Vishal
    Date: June 10th, 2011 at 9:50 am

    Wow….great stuff… really helped a lot.. thanx buddy.

  • Comment by Mr. Serra
    Date: June 17th, 2011 at 2:57 pm

    God save the internet and people like you!
    Thank you very much!!

Leave a Comment

WP Background Tile Plugin

Date: 3rd February 2009 at 12:47 am | Filed under: plugins, wordpress | Author: Sam Burdge | Tags: , , , ,

The WP Background Tile Plugin for WordPress applies a tiled background image to your blog.  It is as simple as this:

  • Create a background image
  • Upload it
  • Apply it as the background via the WP Background Tile options page

Applying a repeat pattern to the background of a webpage is easily done using css:

body {background-image: url(example.jpg);}

However, if you're not into writing code, or don't know where to insert the css into your wordpress theme, then you will find this plugin much easier. It can also be an easy way of testing out lots of background images before deciding on one you are happy with.

INSTALLATION:

  1. Download the plugin from the link at the bottom of this page
  2. Upload the wp-background-tile folder to your wp-content/plugins folder.
  3. Activate the plugin from the Plugins page in WordPress.

USAGE:

  1. Upload your background image via 'Media => Add New' in Wordpress (or via FTP)
  2. Go to 'Settings => WP Background Tile' in WordPress
  3. Paste or type in the URL of your background image (explained in more detail below)
  4. Press 'Submit'

CREATING A BACKGROUND TILE:

A background tile is an image which is repeated in both directions over the background of a webpage. Look closely at the background of my site and you will notice the green background is not a matte colour, but a subtle texture. Right click on the background of my site and choose 'View Background Image' (Firefox) or 'Save Background As' (IE) and have a look at the image. You will notice that it is small (16 x 16 pixels), as you don't need much of the pattern to make it tile. Stripes and other geometric patterns can work well for a subtle effect.

Tip: Check out the free online Stripe Generator tool, it's a really easy way to create striped background tiles.

Background tiles can also be used for larger images such as a logo repeat. An example of this is www.mrdupes.com. To achieve this type of result using photoshop the 'offset' filter can be very useful.

GETTING THE URL OF A FILE YOU HAVE UPLOADED WITH WORDPRESS:

  1. Go to 'Posts => Add New'
  2. Click on the 'Add Media' button (a little star type icon next to 'Upload/Insert')
  3. Click on the 'Media Library' tab
  4. Click on the word 'Show' next to the file you want the url for
  5. Under 'Link URL' click on the button 'File URL'
  6. The file url should now be in the 'Link URL' text box so you can copy it.

DOWNLOAD PLUGIN:


17 Responses to “WP Background Tile Plugin”

  • Comment by pressitfor.me
    Date: February 3rd, 2009 at 4:25 am

    WP Background Tile Plugin | Sam Burdge…

    The WP Background Tile Plugin for WordPress applies a tiled background image to your blog. It is as simple as this:

    * Create a background image
    * Upload it
    * Apply it as the background via the WP Background Tile options page

    Get the plug…

  • Comment by baron
    Date: February 3rd, 2009 at 4:57 pm

    hi. Thanks for plugin

    perfect.

    Regards

  • Comment by WordPress Plugin Releases for 02/04 | Weblog Tools Collection
    Date: February 4th, 2009 at 3:18 pm

    [...] WP Background Tile [...]

  • Comment by Satranç
    Date: February 4th, 2009 at 6:32 pm

    Hi,
    This is a nice idea. Thanks for plugin.
    But I want to ask a question.
    Why did you create a table? Can we save tha background image as an option?
    Thanks.

  • Comment by WordPress Plugin Releases for 02/04 | MBConsulting.se
    Date: February 11th, 2009 at 7:17 pm

    [...] WP Background Tile [...]

  • Comment by beauty blog
    Date: February 19th, 2009 at 2:14 pm

    can you make a plugin like this to show post in a magazine like layout.

    http://perishablepress.com/press/2008/08/04/two-column-horizontal-sequence-wordpress-post-order/

  • Comment by Sam Burdge
    Date: February 19th, 2009 at 2:31 pm

    Hi beauty blog,

    I have a plugin which does exactly that! Here’s the link:

    http://www.samburdge.co.uk/wordpress/wp-post-columns-plugin-2

  • Comment by dogday
    Date: March 4th, 2009 at 6:19 pm

    I have this nice plugin running in my blog, but it isnt XHTML compliant, I think because of the ‘&’ signs used to pass varibles.

    Could you replace ‘&’ signs with ‘&’ to correct this?.

    I have tried, but my knoledge about php isnt enought to find where is called the function.

    Thanks in advance.

  • Comment by Sam Burdge
    Date: March 5th, 2009 at 2:03 pm

    Hi dogday
    The plugin doesn’t use any & symbol, this error must be coming from your theme! Also, if your theme already uses a background image then the plugin may not work.
    Sam

  • Comment by technofunk
    Date: March 12th, 2009 at 12:33 am

    great plugin.

    one question; what if i dont want this tiled? just a single image. non repeating.

  • Comment by Charles
    Date: September 21st, 2009 at 12:15 am

    Hi,

    I tried it on my site (see comment header) and it tiled only the upper half of the page. I have WP 2.7.1. on that particular site.

    Is this a bug or am I doing something wrong?

    Thanks,
    Charles

  • Comment by KiraSherrine
    Date: October 23rd, 2009 at 6:24 pm

    Hi,

    what part would you input the tile file?

    Also my nav tags (about, contact, …)
    and Sidebar Tags (category, archives)
    are all jpegs … I am looking for ways to input it into the php but cannot find any help on that…any help?

    Kira

  • Comment by bpositive
    Date: November 9th, 2009 at 1:32 pm

    Hi. Great Plugin :-)

    How do i get it to center a larger picture?

    Thanks

  • Comment by Jack
    Date: March 18th, 2010 at 5:11 pm

    Great plugin! I’m using it on two sites and it works like a champ! But on ONE of the sites, the background won’t display in IE8, while it works just fine on the other. Any ideas?
    (www.pdrjunction.com and http://www.hailreporter.com)

  • Comment by monk
    Date: May 4th, 2010 at 7:51 am

    hello

    nice plug in. i use over there ( http://www.monk.gr) and its work great.

    thanks

  • Comment by Carrie Burns
    Date: June 7th, 2010 at 4:19 pm

    Great plugin, but appears that Firefix/Netscape doesn’t like the background as a body style tag, while it works fine in Safari, hoping we can get it to work though.

  • Comment by echav
    Date: August 19th, 2010 at 3:53 pm

    Do you have an option for content background and not body background?
    Thanks

Leave a Comment

Fighting Spam

Date: 19th December 2007 at 12:32 am | Filed under: blog, wordpress | Author: Sam Burdge

I've been receiving a bit of spam on my blog lately :evil: obviously none of it gets through, but its still annoying having to delete it all. So, I have decided to take measures against it by implementing a few changes on my blog. I have installed the Captcha! plugin which now requires users to manually enter the text they see in the picture before their comment is submitted. I have also activated the Askimet plugin which flags comments as spam based on the askimet database.

Whilst looking at the different ways to fight spam I found this article: The Solution to Blog Spamming, which I found very useful.

Leave a Comment

WP Plugins and Custom Fields

Date: 5th November 2007 at 9:14 pm | Filed under: development, scripts, wordpress | Author: Sam Burdge

This article is intended to address issues involving the use of add_post_meta and delete_post_meta in WordPress plugin design. These functions can be used to add or delete custom fields for a post, useful for plugin design as the value for the custom field can be entered via a form in the write page. The add_post_meta code would look something like this:

Read on…

5 Responses to “WP Plugins and Custom Fields”

  • Comment by johnbillion
    Date: December 6th, 2007 at 5:45 pm

    Erm, have you tried update_post_meta ?

  • Comment by Sam Burdge
    Date: December 10th, 2007 at 2:20 pm

    Hi Johnbillion,
    update_post_meta is a tidier way, true. But the problem still remains that if you hook it in using add_action as stated above, there will be instances where the function is called even though the form hasn’t been submitted (i.e. the post/page hasn’t been edited), like when a comment is approved.
    Sam

  • Comment by WP Plugins and Custom Fields | Sam Burdge | Squico
    Date: August 19th, 2009 at 4:40 am

    [...] In: Wordpress plugins 19 Aug 2009 Go to Source [...]

  • Comment by Gvnah
    Date: January 21st, 2010 at 9:29 pm

    hi, i hope this post is still being operated. I’m trying to add a custom field value to all my old posts.. (i want the old posts to have the same value though [same thumbnail])

    I just re-designed my wordpress blog’s theme and the new theme uses custom value to insert thumb-nails..

    the problem is that.. i already have old posts that i want to insert the thumbnails

    could anyone help PLEASE :)

  • Comment by David
    Date: November 10th, 2010 at 7:08 am

    This page is really tough to read with the intense contrast. You might want to make the white a little less bright. Good blog though!

Leave a Comment