Encoding Flash Video (flv) - Part 1 - The Basics

Date: 16th February 2008 at 12:53 am | Filed under: development, flash | Author: Sam Burdge

This is the first part in a series of articles I will be writing on encoding Flash Video (flv files) using the Adobe CS3 Video Encoder. I intend to cover all aspects of flv encoding to help you to attain the best results possible. If you are using another software to encode your flv files, such as Adobe After Effects or Final Cut Pro, many of the principles will be the same.

Read on…

3 Responses to “Encoding Flash Video (flv) - Part 1 - The Basics”

  • Comment by Grant Forrest
    Date: February 29th, 2008 at 10:29 am

    Hi Sam Been hunting the internet for some advice on optimum source files for flash - with no joy. But came across your encoding flash video article and have been enlightened. Many thanks Grant

  • Comment by John Smith
    Date: July 8th, 2008 at 2:50 pm

    Very helpful information. Much appreciated. Thank you.

  • Comment by samir
    Date: July 15th, 2008 at 6:03 pm

    Thank you for this useful article.
    Very informative.
    It solved my issue with horizontal lines in flash video files.

Leave a Comment

WP Digi Clock Plugin - Folder and file permissions

Date: 11th January 2008 at 2:27 am | Filed under: development, plugins, wordpress | Author: Sam Burdge

I have recently received emails from a couple of users of my WP Digi Clock Plugin who have been unable to update the clock's settings via the Digi Clock options page in WordPress. Unfortunately I do not have time to give individual support for my free plugins as I am too busy building sites, earning a living etc. However, I think the reason some of you have been having trouble is due to file/folder permissions on your server. When you update the clock's options the wp-clock-params.php file for the clock is updated (this file stores your clock settings), if the permissions for the file, and the digi-clock folder itself are not set correctly it will not be able to update.

The permissions should be set as follows:

wp-digi-clock (folder) – 755
wp-clock-params.php (file) – 644

Here is a brief explanation of file and folder permissions on a unix server:

The three user types are:

  1. user - the user (the owner of the file or directory), who you are on the system is determined by username and password at login time
  2. group - a group of users, e.g.: administrators, plain users, etc.
  3. world - anyone else, e.g: anonymous users or anyone who is not the owner, or of the same group as the owner, of the file or directory

The three access types are:

  1. read - the file or directory can be read
  2. write - the file or directory can be written to, or deleted
  3. execute - the file (scripts or executables) can be run, or the directory can be entered

To set permissions, in the simplest form, you use a three digit code: the first digit represents the access given to the user, the second digit represents the access given to the group, the third digit represents the access given to the world. The values that make up each access type are:

4 = read
2 = write
1 = execute

To apply more than one type of access to a user type, simply add the values together to get access permissions of the desired types:

7 = read, write & execute (4 + 2 + 1)
6 = read & write (4 + 2)
5 = read & execute (4 + 1)
4 = read
3 = write & execute (2 + 1)
2 = write
1 = execute

Putting together these digits determines the 3-digit permission code that makes up the file's permissions.
E.g. User: read, write & execute (7) + Group: read & execute (5) + World: read & execute (5) = 755.

Leave a Comment

WP Digi Clock Plugin (1.0) - New Version!

Date: 4th December 2007 at 10:18 pm | Filed under: development, flash, plugins, wordpress | Author: Sam Burdge

This easy to use plugin will embed a flash digital clock into your wordpress blog, either in a post or page, or within your blog's template (in the sidebar / header / footer etc.). The background and font colours are managed via the options menu. The clock can display the time as set on the user's local machine or as set by your web server with an optional offset. It also has options for 12hr and 24hr clock.

Installation:

  1. Download the plugin file here: WP Digi Clock Plugin (1.0)
  2. Upload the wp-digi-clock folder to your wp-content/plugins folder
  3. Activate the plugin from the plugins page
  4. Go to Options -> WP Digi Clock to choose your colour scheme and time format options

Usage:

To embed in a post or page:

type in [ wp_digi_clock ] (removing the spaces) anywhere in a post or page.

to embed in your page template (header, footer, sidebar):

use the function wp_digital_clock($x), with $x being a number or identifier for example:

<h2>TIME</h2>
<li><?php wp_digital_clock('1'); ?></li>

1 Response to “WP Digi Clock Plugin (1.0) - New Version!”

  • Comment by Mat
    Date: June 2nd, 2008 at 7:28 pm

    thanks for making a great clock.

    is there a way to change the font size?
    thanks again!

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…

2 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

Leave a Comment

JavaScript Popups

Date: 3rd November 2007 at 4:43 pm | Filed under: development, scripts | Author: Sam Burdge

Something I've noticed recently, whilst installing many different WordPress plugins on my site and on other sites is the inconsistency in JavaScript popup window code used in many plugins, allowing for the same popup to be opened numerous times or for a popup to hide in the background behind another page. The basic code to open a popup is:

window.open('http://bla.com','myWindow','status = 1, height = 300, width = 300,
resizable = 0');

However, if you add this code as the onclick for a button or anchor tag it will open a new popup each time it is clicked regardless of the fact that the window may already be open. Adding return false; will prevent this from happening, but then if the window is at the bottom of the pile clicking on the link will do nothing.

To ensure the window is brought to the front the code should be executed like this:

myPopup = window.open('http://bla.com','myWindow','status = 1, height = 300,
width = 300, resizable = 0'); myPopup.focus(); return false;

6 Responses to “JavaScript Popups”

  • Comment by c-received
    Date: November 6th, 2007 at 7:40 pm

    Hey Sam,

    In the second example the window.open object and it’s properties are being assigned to a custom window object reference. This makes the process of isolating, controlling, and recognising individual window.open objects easier. Basically, the window object reference ties the main window to the sub-window as well as creating a link between the secondary window to its main opener window.

    If you wanted to harden the function shown above some more you could do something like whats below. This ensures the creation code isn’t ran if the window already exists. You can also test and verify if a window is closed by using ‘w.closed’, err not done here.

    function openWin(url){
    var w=null;
    if(!w)w=window.open(url,….);
    else w.focus();
    return false;
    }

    Using approches like these is very bad news. Best practice is to avoid using window.open() at all.

    <a href=”#” rel=”nofollow”>
    <a href=”window.open(…)” rel=”nofollow”>

    Anyway, if you were to, ideally the event that fires this function should be attached to the link unobtrusively, however, at the end of the day it will be formed something like this…

    …onclick=”return openWin(this.href);”

    I.E 7 will put an end to developers setting certain properties by force, e.g. removing the address bar, due to accessibility and security reasons… No doubt someone will find a work around.

    cheers, c-received

  • Comment by c-received
    Date: November 6th, 2007 at 8:03 pm

    Hmmm.. muffed my code and turned it into real HTML … Should fix this soon mate, also have a look into Cross Site Scripting as it would be quite easy to do this on your site.. E.G

  • Comment by c-received
    Date: November 6th, 2007 at 8:06 pm

    a=”get”;
    b=”URL(\”";
    c=”javascript:”;
    d=”alert(’XSS’);\”)”;
    eval(a+b+c+d);

  • Comment by c-received
    Date: November 6th, 2007 at 8:07 pm

    blah blah…

  • Comment by c-received
    Date: November 6th, 2007 at 8:09 pm

    or to test this way ..
    ”;!–”=view source

  • Comment by Sam Burdge
    Date: November 6th, 2007 at 9:55 pm

    Hi c-received,
    Thanks for your detailed response. I will indeed look into Cross Site Scripting. I think you are right that using the window.open(…) method is not great. This brief article was written after I’d spent ages scanning throught the code of about 4 or 5 wp plugins that I’d installed on a clients site to fix these popup window problems.
    S

Leave a Comment