WP Flash Title Plugin - Example Page

Date: 15th February 2008 at 10:42 pm | Filed under: blog | Author: Sam Burdge

As you can see from the above title this plugin allows you to embed any font you want, using any colour scheme you choose. Boom!

This is a screengrab from the WP Flash Titles Options page in WordPress, where you are able to select the font, colour, mouseover / hover colour, background colour, font-size, width and height for your Flash Titles.

{{post id="wp-flash-titles-plugin" text="Back to WP Flash Titles post"}}

WP Flash Title Plugin Options - Screengrab

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>

5 Responses 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!

  • Comment by BJJ
    Date: January 15th, 2009 at 1:44 am

    Awesome clock! But the clock is not working in my sidebar? I used a text widget and embedded your code:

    Please help

  • Comment by Sam Burdge
    Date: January 15th, 2009 at 11:39 pm

    Hi BJJ
    Did you double check the plugin had installed correctly? Are you seeing the WP Digi Clock options page in wordpress? If so is the example clock on that page working?
    Sam

  • Comment by Frigate
    Date: May 12th, 2009 at 3:20 pm

    had to edit the params php manually as was getting permission denial but just what I was looking for, perfect - thanks

  • Comment by Kym
    Date: November 3rd, 2009 at 9:51 pm

    I see this link in my 404 logs:

    wp-content/plugins/wp-digi-clock/201a.js

    but the file is there.

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

WP Digi Clock Plugin (0.1BETA)

Date: 19th October 2007 at 10:48 pm | Filed under: development, flash, plugins, wordpress | Author: Sam Burdge

A NEW VERSION OF THE PLUGIN HAS BEEN RELEASED!! Please follow this link: {{post id="wp-digi-clock-plugin-10-new-version" text="WP Digi Clock Version 1.0" target="_self"}}

[wp_digi_clock]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 displays the time as set on the user's local machine. Server time and timezone offsets will be a feature of version 1 when it is released. For now please try it out and let me know of any issues etc. by commenting on this page.

Installation:

  1. Download the plugin file here: Follow the link at the top of this page to get the new version!!
  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

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() for example:

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

9 Responses to “WP Digi Clock Plugin (0.1BETA)”

  • Comment by chris
    Date: November 2nd, 2007 at 11:16 pm

    when trying to change the color, what numbers correspond with what color? is there any info on this?

  • Comment by Sam Burdge
    Date: November 2nd, 2007 at 11:23 pm

    Hi, as this is the very first release I haven’t had a chance to integrate the colour picker. Basically it works by hex codes e.g: #ffffff = white, #000000 = black. For a full list of colour codes you can visit: webmonkey

  • Comment by Hien
    Date: November 3rd, 2007 at 5:14 am

    Hi Sam:

    Just tried out you Digi Clock plugin (0.1BETA). Its a snap to use. I know that you probably have plans for other features so I won’t make any unreasonably unbearable requests. There is only one thing I’d like to bring to light… non-military time. The plugin, works great with my site color scheme right out of the box. I didn’t even have to change a thing. Thanks!

  • Comment by Shawn
    Date: November 5th, 2007 at 8:30 pm

    Hi Sam.. looks good.
    I would love, however, a “countdown” feature…
    allowing us to put a clock widget on the sidebar with a configurable title to provide countdown clocks .. ie.. “Time until election day”, “Time until vacation”, etc

  • Comment by Sam Burdge
    Date: November 5th, 2007 at 9:01 pm

    Hi Shawn, the closest thing I could find is this plugin: Countdown

  • Comment by Afzal Javed
    Date: November 6th, 2007 at 7:32 pm

    I still don’t know how to change the back ground color. Please let me know in which line of plugin-code should I change the code.

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

    Hi Afzal,
    In the options menu in wordpress you should see the tab for WP Digi Clock. Go to the WP Digi Clock options page and enter hex color codes for the background and text colours. If you dont see the colours change at first, try emptying your browser’s cache. Hope this helps…

  • Comment by WordPress 插件集锦系列 1-50套 « wordpress 非官方中文站——助力中文wordpress
    Date: May 2nd, 2009 at 3:07 am

    [...] WP DigiClock 在你的 WordPress 博客中,文章或者侧边拦,或者模板(侧边拦,页眉,页脚等)里面添加数字时钟。 [...]

  • Comment by aljuk
    Date: August 11th, 2010 at 3:21 pm

    Plugin is broken in WP3. Options don’t function, plugin doesn’t display. What a pity.

Leave a Comment