Shortcode outside posts and pages aka..

Sunday, 28 March 2010

…what would I do without my users #2.

I have recently discovered myself that wordpress can call and “interpret” shortcodes also outside the usual posts and pages.

How do you do this? Use the PHP code below in any header or footer or non-widget ready sidebar or any PHP file of your theme and replace the text between brackets [] with your own shortcode, of course.

<?php echo do_shortcode(‘[shortcode-short attribute1="true" attribute2="10"]‘); ?>

Bear in mind, if the plugin is not installed, activated or it’s not him :-) then you will be echoed the text in brackets without any change.

Have fun with it!

Share and Enjoy:
  • Print
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • LinkedIn
  • Technorati
  • Twitter
  • Reddit
  • StumbleUpon
  • MySpace
  • Propeller

Google News Widget 0.9 released

Monday, 22 March 2010

What would I do without my plugins users. Foreign accents problems…should I not know about it?

Thanks to a friendly french, Jean Bruno at Morgao this time, who tested it and gave me the all “ok”.

I love the Internet…

Share and Enjoy:
  • Print
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • LinkedIn
  • Technorati
  • Twitter
  • Reddit
  • StumbleUpon
  • MySpace
  • Propeller

Google News Widget plugin version 0.7 released

Saturday, 20 March 2010

It displays the list of the latest news by Google News given localization (country-language), search word(s) or topic, number of displayable news and whether you want publication date, date, reference to the author displayed/not. The look & feel is customizable too. It works as a widget or shortcode.
Starting from version 0.7 – for Us and Canada (eng), it’s also possible to display local news by selecting city, state/province or zipcode. Courtesy of Greg at transientmonkey.com.
= 0.7 =
* New feature: added selection of local news (working for Usa and Canada English only)
* Added proper error messages for: empty, non-existing URLs and invalid/misformatted feeds content
* Added defaults for target and list (widget fields)
* Added instruction to hide Warnings from the xmlsimple_load_file function
* Fixed a bug which prevented proper display of description/summary with tags
For a live demo of the shortcode, click here.
Share and Enjoy:
  • Print
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • LinkedIn
  • Technorati
  • Twitter
  • Reddit
  • StumbleUpon
  • MySpace
  • Propeller

RSS Just Better plugin 0.3 released

Thursday, 18 March 2010

By popular demand, I made it compatible with Atom (never thought so many people might have wanted Atom compatibility).

Also, improved error messages…ooops…

A new version of my plugin is now available via this page.

Demo of this plugin always available here.

= From the changelog  0.3  in the readme file =

  • Made it fully compatible with Atom 1.0
  • Added proper error messages for: empty, non-existing URLs and invalid/misformatted feeds content
  • Added defaults for target and list (widget fields)
  • Added instruction to hide Warnings from the xmlsimple_load_file function
  • Fixed a bug which prevented proper display of description/summary with tags
Share and Enjoy:
  • Print
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • LinkedIn
  • Technorati
  • Twitter
  • Reddit
  • StumbleUpon
  • MySpace
  • Propeller

RSS Just Better plugin 0.2 released

Monday, 15 March 2010

After having had some problems with syndicating a feed URL containing search criteria, I have discovered that wordpress encodes data entered as attributes to shortcodes. Well done, but I had to decode my feed URL for my RSS parser understand it.

I also took the opportunity to add a couple of new features.

A new version of my plugin is now available via this page.

Demo of this plugin always available here.

Share and Enjoy:
  • Print
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • LinkedIn
  • Technorati
  • Twitter
  • Reddit
  • StumbleUpon
  • MySpace
  • Propeller

GMT/UTC standards reversed in timezone standards (and PHP, and wordpress, and Unix/Posix)

Thursday, 11 March 2010

Well, software never stops surprising me.

Working on a new project which involves PHP and timezones, I obviously needed to use these PHP supported timezone standards. No problem when I set a timezone to a specific standard location (i.e. ‘America/New_York’), but when using the non-recommended GMT standards, the resulting time was reversed. So, by selecting GMT-5, the America East Coast time, the clock gave me GMT+5 time, something like the time in Uzbekistan (Asia) :-D .

In other words, time ahead of Europe/Greenwich, not behind as if GMT standards signs were reversed.

Now, after double checking the code and some :-x , I found the following:

directly from wikipedia’s Timezone aka TZ database page:

“Additionally a special area of Etc is used for some administrative zones (…). In order to conform with the POSIX style, those zones beginning with “Etc/GMT” have their sign reversed from what most people expect. In this style, zones west of GMT have a positive sign and those east have a negative sign.”

So, yes GMT (aka UTC) standards are reversed in the timezone standard database. I do not know how the “POSIX style” might justify such a confusion, maybe a nerd “stumbling upon” can write POSIX’s very good reasons in my comments ;-)

Not for nothing, the php.net site recommends NOT to use the Etc/GMT standards and wordpress administration page, in Setting -> General -> Timezone field doesn’t show the resulting “local time” by selecting UTC+10 or UTC-5 (unlike what happens by selecting a geographical timezone location).

What I did in my drop-down menu was reversing the signs between the values in the <option> tags and the displayed strings, and added a lengthy comment in the source code.

Well, I hope this helps someone else struggling with the same issue, at least.

Share and Enjoy:
  • Print
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • LinkedIn
  • Technorati
  • Twitter
  • Reddit
  • StumbleUpon
  • MySpace
  • Propeller

RSS Just Better plugin 0.1 released

Wednesday, 10 March 2010

Again a bit of a late announcement, but i released a new plugin. It’s similar to my previously released plugin Google News Widget & Shortcode but this time the user can link any external RSS feed of their choice.

Yes, it’s mocking the native “RSS widget”for wordpress as they will displayed close to each other so you have the RSS widget and another RSS widget “Just better”.

I have created a page on this blog for that plugin too: please take a look.

Share and Enjoy:
  • Print
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • LinkedIn
  • Technorati
  • Twitter
  • Reddit
  • StumbleUpon
  • MySpace
  • Propeller

Google News Widget plugin 0.6 released

A belated announcement, but a new version of my plugin has been released last Saturday.

From the readme file:

== Changelog ==

= 0.6 =

  • added excerpt option to the widget form/shortcode
  • added number of excerpt chars to be displayed on the widget form/shortcode
  • added working message about formatting and sidebars
  • updated readme.txt

== Upgrade Notice ==

= 0.6 =

  • if you want to show Google’s excerpt then upgrade to version 0.6. Please do not use on narrow sidebars as it contains images and formatting.

A very

big

warning: if you select the excerpt, ensure not to use it in a narrow sidebar: the formatting would not give you a nice view out of the Google’s news you choose.

Share and Enjoy:
  • Print
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • LinkedIn
  • Technorati
  • Twitter
  • Reddit
  • StumbleUpon
  • MySpace
  • Propeller

Still about languages and countries codes.

Tuesday, 2 March 2010

Working on a new plugin, I have made the following “discovery”:

As we all know, WordPress has been technically built to be translated in different languages.

The naming convention used to identify the language, is based on the ISO-639 language code (e.g. pt for Portuguese) followed by the ISO-3166 country code (e.g. _PT for Portugal or _BR for Brazil).

Complete lists of codes can be found at the GNU website: country codes and language codes.

But also at the ISO Standards website at: ISO 3166-1 and ISO 639-2 webpages and on wikipedia: country codes list and language codes list.

The naming convention used to identify the languages in wordpress is curiously idenitcal used by Google News to localize its news as showed in the table in my previous post.

Share and Enjoy:
  • Print
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • LinkedIn
  • Technorati
  • Twitter
  • Reddit
  • StumbleUpon
  • MySpace
  • Propeller

Wonders of the Internet

I really owe a special mention to Elmar Friebe, early adopter of my google-news-widget wordpress plugin.

He was so keen in using it on his blog, that didn’t get disheartened by the quirks of version 0.3. He helped me in testing a fix when I still did not get a clue of what was going on and hey, it worked! I mean, the cooperation worked and the fix too. :-)

That’s one of the wonders of the Internet: getting to know special strangers, who do special things for you and suddenly, you realise they are not any longer strangers!

I should be used to this by now, after 16 years of living the Internet, but it still amazes me sometimes.

Nice to meet you, Elmar!

Share and Enjoy:
  • Print
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • LinkedIn
  • Technorati
  • Twitter
  • Reddit
  • StumbleUpon
  • MySpace
  • Propeller